! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[mousepad] printing line numbers
Status:
RESOLVED: FIXED
Product:
Mousepad
Component:
General

Comments

Description Christian Hesse 2013-01-28 16:07:59 CET
When printing with mousepad I get line numbers on the paper though this option is disable in printing options.
Comment 1 Christian Hesse 2013-01-28 16:08:41 CET
Btw, tested with latest git (0.3.0-12-g8d234ab).
Comment 2 b3nmore 2013-05-11 12:49:58 CEST
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].
Comment 3 b3nmore 2013-06-05 13:42:34 CEST
Created attachment 5056 
Should fix, that line numbers are always printed
Comment 4 b3nmore 2013-06-06 17:43:56 CEST
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.
Comment 5 b3nmore 2013-07-24 18:51:17 CEST
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.
Comment 6 Andre Miranda editbugs 2013-10-14 05:57:46 CEST
(In reply to b3nmore from comment #5)
> 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.

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.
Comment 7 b3nmore 2013-10-14 17:09:06 CEST
(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.
Comment 8 Andre Miranda editbugs 2013-10-14 23:49:34 CEST
(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 :)
Comment 9 b3nmore 2013-10-15 17:55:53 CEST
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.
Comment 10 Matthew Brush editbugs 2014-07-12 05:21:42 CEST
Patch applied in http://git.xfce.org/apps/mousepad/commit/?id=8525dbdaf58cce86f235ec92923e1c48f493c6d9. Thanks!
Comment 11 Matthew Brush editbugs 2014-07-12 05:23:47 CEST
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.

Bug #9813

Reported by:
Christian Hesse
Reported on: 2013-01-28
Last modified on: 2014-07-12

People

Assignee:
Matthew Brush
CC List:
5 users

Version

Target Milestone:
Mousepad 0.4.x

Attachments

Additional information