3694 printer.setDocName(pathlib.Path(self.__curFile).name) |
3694 printer.setDocName(pathlib.Path(self.__curFile).name) |
3695 else: |
3695 else: |
3696 printer.setDocName(self.tr("Untitled")) |
3696 printer.setDocName(self.tr("Untitled")) |
3697 if printDialog.printRange() == QAbstractPrintDialog.PrintRange.Selection: |
3697 if printDialog.printRange() == QAbstractPrintDialog.PrintRange.Selection: |
3698 # get the selection |
3698 # get the selection |
3699 fromLine, fromIndex, toLine, toIndex = self.__textEdit.getSelection() |
3699 fromLine, _fromIndex, toLine, toIndex = self.__textEdit.getSelection() |
3700 if toIndex == 0: |
3700 if toIndex == 0: |
3701 toLine -= 1 |
3701 toLine -= 1 |
3702 # QScintilla seems to print one line more than told |
3702 # QScintilla seems to print one line more than told |
3703 res = printer.printRange(self.__textEdit, fromLine, toLine - 1) |
3703 res = printer.printRange(self.__textEdit, fromLine, toLine - 1) |
3704 else: |
3704 else: |