Code::Blocks Forums

User forums => Help => Topic started by: LETARTARE on January 11, 2017, 02:42:36 pm

Title: Print error
Post by: LETARTARE on January 11, 2017, 02:42:36 pm
with svn10922, Vista pro pack2.

In a simple pane of the editor, a text selected in a file prints correctly.
With the same split pane, the same text selected, the whole file is printed, not the selection.
Do you have the same behavior ?
Thanks in advance.
Title: Re: Print error
Post by: oBFusCATed on January 12, 2017, 01:01:39 am
Is this a regression in this revision?
Title: Re: Print error
Post by: LETARTARE on January 12, 2017, 11:31:23 am
I do not know. That's why I'm asking if this happens with other users.
Title: Re: Print error
Post by: oBFusCATed on January 14, 2017, 01:39:23 pm
Can you try 16.01 or 13.12 or some older night build?
Title: Re: Print error
Post by: LETARTARE on January 14, 2017, 05:47:12 pm
yes :
16.01, svn1816, svn1856 are good
Title: Re: Print error
Post by: oBFusCATed on January 14, 2017, 07:10:23 pm
Do you mean that all versions you've mentioned in the previous post (16.01, 1816 and 1856) are working correctly and only 19022 is broken?
Title: Re: Print error
Post by: LETARTARE on January 15, 2017, 12:58:04 am
yes,
I only have these versions available :
16.01, svn1816, svn1856 are good
10922 it's broken
Title: Re: Print error
Post by: oBFusCATed on January 15, 2017, 01:38:32 am
Can you try this one: https://sourceforge.net/projects/codeblocks/files/Binaries/Nightlies/2016/CB_20160621_rev10868_win32.7z/download ?
Title: Re: Print error
Post by: LETARTARE on January 15, 2017, 06:01:13 pm
10868 it's broken.

10816, 10856, 10868 :
The upper pane prints the selected text.
The lower pane prints the entire file !!

10922 :
Two panes (upper and lower) prints the entire file !!
Title: Re: Print error
Post by: oBFusCATed on January 15, 2017, 11:26:32 pm
I'm confused why are you saying that 10868 is broken but list it with the others 10816 and 10856 where I suppose the behaviour is correct? If the first depicted behaviour correct?

Can you test 10912 (or the nightly before 10922) and tell us if it works?
Title: Re: Print error
Post by: LETARTARE on January 16, 2017, 12:06:55 pm
I decided to repeat the tests systematically on the two panels displaying the same file.

These are the only versions I can still use (Vista Business Pack 2,  TDM-GCC 4.7.1, wxWidgets unicode 2.8.12):

16.01, 10118, 10127, 10816, 10856, 10868, 10912, 10922 :
The upper pane prints the selected text.
The lower pane prints the entire file !!

I will try to search in the source, but I do not know where to look?
Do you know which functions handle printing?

Title: Re: Print error
Post by: Jenna on January 16, 2017, 05:30:02 pm
I decided to repeat the tests systematically on the two panels displaying the same file.

These are the only versions I can still use (Vista Business Pack 2,  TDM-GCC 4.7.1, wxWidgets unicode 2.8.12):

16.01, 10118, 10127, 10816, 10856, 10868, 10912, 19022 :
The upper pane prints the selected text.
The lower pane prints the entire file !!

I will try to search in the source, but I do not know where to look?
Do you know which functions handle printing?
One issue is definitely, that the print-function always uses the first control, not the last active one.
Can you test the attached patch ?
Title: Re: Print error
Post by: LETARTARE on January 16, 2017, 07:10:57 pm
Hello,
thanks for patch, good catch.
Of course, the value of pane 1 (m_pControl) was overwritten with the value of pane 2 in cbEditor::Print(bool selectionOnly, PrintColourMode pcm, bool line_numbers) !!

I only tested it on svn10922 : it's good.

Happy New Year.
Title: Re: Print error
Post by: Jenna on January 16, 2017, 07:31:16 pm
Hello,
thanks for patch, good catch.
Of course, the value of pane 1 (m_pControl) was overwritten with the value of pane 2 in cbEditor::Print(bool selectionOnly, PrintColourMode pcm, bool line_numbers) !!

I only tested it on svn19022 : it's good.
Do I understand it correctly, that the issues are gone with the patch ?
If yes and there are no objections from other devs, I can commit it.

Happy New Year.
Many thanks, the same to you !
Title: Re: Print error
Post by: oBFusCATed on January 16, 2017, 09:16:55 pm
If yes and there are no objections from other devs, I can commit it.
Looks fine to me.

Jens are you able to print on linux?
My printing broke for some reason and there was another printing problem I'm no long able to look at. :(
Title: Re: Print error
Post by: Jenna on January 16, 2017, 09:46:50 pm
If yes and there are no objections from other devs, I can commit it.
Looks fine to me.

Jens are you able to print on linux?
My printing broke for some reason and there was another printing problem I'm no long able to look at. :(
I can print, but scaling is a mess, so the text is nearly unreadable and I have to print all pages to get any output.
If I remember it correctly I tried to work around this years ago and indeed I found a oatch against rev 4905, which is about nine years old.
I will see if it can be used or overworked to enhance/enable printing on Linux.
Title: Re: Print error
Post by: oBFusCATed on January 16, 2017, 10:37:32 pm
I'm trying to print to pdf and the resulting pdf is pretty messed up. Rectangles around every line, text is unreadable because it is overlapping. Cannot switch to portrait mode. I'm not sure all problems are caused by C::B though :(.
I'm not printing at all so I don't care too much about this feature.
Title: Re: Print error
Post by: LETARTARE on January 16, 2017, 11:14:54 pm
Do I understand it correctly, that the issues are gone with the patch ?
Yes, I print the selected text correctly with the upper and lower panes.

Title: Re: Print error
Post by: LETARTARE on February 22, 2017, 12:13:54 am
Good evening,
I use again today C::B svn10922 to print.
Printing works correctly on a split window with line numbers, but after printing the line numbers have disappeared!

By searching 'cbEditor::Print (...)', I think I have found the reason
1- missing backup 'getEdgeMode()'
2- need to call 'm_pData->SetLineNumberColWidth(m_pControl && m_pControl2)' to restore the line numbers on the affected windows (1 or 2).

The split working properly after the correction.
Here is the correction since svn10922.

Title: Re: Print error
Post by: oBFusCATed on February 22, 2017, 12:41:04 am
Patch doesn't apply, please make it against recent trunk
Code
$ patch -p1 < /tmp/mozilla_obfuscated0/cbeditorPrint.patch
(Stripping trailing CRs from patch; use --binary to disable.)
patching file sdk/cbeditor.cpp
Hunk #1 FAILED at 2939.
Hunk #2 FAILED at 2990.
2 out of 2 hunks FAILED -- saving rejects to file sdk/cbeditor.cpp.rej
Title: Re: Print error
Post by: LETARTARE on February 22, 2017, 10:49:38 am
Hello,
here's the fix for svn11019
Title: Re: Print error
Post by: oBFusCATed on February 25, 2017, 09:10:13 pm
In svn, thanks...