mousepad always prints line numbers

Bug #1267958 reported by Forest
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Mousepad
Fix Released
Medium
mousepad (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Mousepad 0.3.0 always includes line numbers when printing, regardless of whether "Print line numbers" is checked in Document Settings.

Revision history for this message
In , Christian Hesse (eworm) wrote :

When printing with mousepad I get line numbers on the paper though this option is disable in printing options.

Revision history for this message
In , Christian Hesse (eworm) wrote :

Btw, tested with latest git (0.3.0-12-g8d234ab).

Revision history for this message
In , b3nmore (b3nmore) wrote :

My guess: gtk_source_print_compositor_set_print_line_numbers () is not set to 0 if 'print line numbers' is unchecked. In both cases the value of line_number_increment is used, which is always in [1,100].

Revision history for this message
In , b3nmore (b3nmore) wrote :

Created attachment 5056
Should fix, that line numbers are always printed

Revision history for this message
In , b3nmore (b3nmore) wrote :

Created attachment 5057
Fixes: line numbers are always printed

Additionally set print->line_number_increment = 0, since this is stored and restored when printing the next time.

Revision history for this message
In , b3nmore (b3nmore) wrote :

Created attachment 5103
Should fix: line numbers are always printed

Second approach was too simple and left gtk_source_print_compositor_set_print_line_numbers in some cases in undefined/wrong state. The attached patch hopefully handles this more robust.

Revision history for this message
In , André Miranda (andreldm) wrote :

(In reply to b3nmore from comment #5)
> Created attachment 5103 [details]
> Should fix: line numbers are always printed
>
> Second approach was too simple and left
> gtk_source_print_compositor_set_print_line_numbers in some cases in
> undefined/wrong state. The attached patch hopefully handles this more robust.

Sorry, but the patch doesn't solve the problem here.
Also notice that the patch tries to rename the filename and has to be applied on the mousepad/mousepad folder(where the source files are), I think it should be applied on mousepad(where the configs files are).
I'll try to investigate this problem soon.

Revision history for this message
In , b3nmore (b3nmore) wrote :

(In reply to André Miranda from comment #6)
> Sorry, but the patch doesn't solve the problem here.
> Also notice that the patch tries to rename the filename ...
Hm, this is strange. How did you apply the patch exactly?
> ... and has to be
> applied on the mousepad/mousepad folder(where the source files are), ...
Yes, this how patches usually are used. You change (in this case) mousepad-print.c by applying the patch to it. Then you compile mousepad and the resulting binary shouldn't show the corresponding issue anymore.
> ... I think
> it should be applied on mousepad(where the configs files are).
No idea, what you mean by this.
> I'll try to investigate this problem soon.
Good luck.

Revision history for this message
In , André Miranda (andreldm) wrote :

(In reply to b3nmore from comment #7)
> (In reply to André Miranda from comment #6)
> > Sorry, but the patch doesn't solve the problem here.
> > Also notice that the patch tries to rename the filename ...
> Hm, this is strange. How did you apply the patch exactly?
git apply ~/mousepad-print.patch
But I must have done something wrong, now the fix seems to be working just nicely :)

> > ... and has to be
> > applied on the mousepad/mousepad folder(where the source files are), ...
> Yes, this how patches usually are used. You change (in this case)
> mousepad-print.c by applying the patch to it. Then you compile mousepad and
> the resulting binary shouldn't show the corresponding issue anymore.
> > ... I think
> > it should be applied on mousepad(where the configs files are).
> No idea, what you mean by this.
I meant the following:
git clone <url> mousepad
cd mousepad (local repo root)
cd mousepad (this folder is known in other projects as 'src')

See? there are 2 mousepad folders, in order to your patch be applied I must do the git apply on the second folder.
Also notice the first two lines on the patch, git cannot find "print_fix_num_printing.c". I hope now you understand what I mean :)

Revision history for this message
In , b3nmore (b3nmore) wrote :

Alright, I used good ol' diff to create the patch. So it was meant to be applied with patch. I should use git format-patch in the future ...

Anyway, glad to hear that it works for you now.

Revision history for this message
Forest (foresto) wrote :

For those who don't want to wait for a fix, I've just published a build in my PPA that includes a patch from the upstream bug report:

https://launchpad.net/~foresto/+archive/ubuntutweaks/

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mousepad (Ubuntu):
status: New → Confirmed
Revision history for this message
In , G-matt-8 (g-matt-8) wrote :
Revision history for this message
In , G-matt-8 (g-matt-8) wrote :

Ah crap. I credited Christian Hesse in the commit message instead of b3nmore! Sorry about that b3nmore, unfortunately I can't change it I don't think.

Changed in mousepad:
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

Fixed in version 0.4.0-0ubuntu1 (Vivid).

Changed in mousepad (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.