When I save a document with multiple columns it reverts to one column. Do you have a demo of this.
Ken
When I save a document with multiple columns it reverts to one column. Do you have a demo of this.
Ken
Hi,
I posted a file at
https://www.wpcubed.com/ftp/ex/columns.rtf
Which version do you use? This test was made with 5.52.
WPTools 6 Premium also does column balancing, btw.
Julian
Julian,
I can't access this file. I'm using 5.48.
Ken
There was a typo in the link - it works now.
That works fine, what settings could stop columns being saved/loaded?
Hi,
Was WPPREMIUM defined for the project?
The unit WPIORTFPremium must be also included. It usually is when compiler symbol WPPREMIUM is activae. (in WPIO.PAS)
Julian
WPPremium is defined in WPInc.Inc and, as you say, WPIO includes unit WPIORTFPremium.
I have updated to the latest 5.51 source including premium and it still loses the columns on saving.
I am using:
WPRichText1.ActiveParagraph.ASet(WPAT_COLUMNS,2);
WPRichText1.ActiveParagraph.ASet(WPAT_COLUMNS_X,WPCentimeterToTwips(0.5));
WPRichText1.Refresh;
WPRichText1.ChangeApplied;
And it works correctly on the screen but as soon as I save it to the database (it is a TDBWPRichText) it immediately reverts to one column.
The WriteObjectMode is wobRTF.
Further to the above; if I set the DefaultIOFormat to WPTOOLS this works correctly so there is a problem with either saving or loadings columns to/from a database in RTF format.
Hope this helps,
Ken
Hi,
I tested this with RTF as well. Can You test in your app a save+load in RTF format, for example
a button with
WP.AsString := WP.AsANSIString('RTF')
Julian,
What I found out yesterday is that saving it is fine - the problem is in the load as if in WPIORTFPremium.pas I comment out the three lines shown below it works.
Ken
procedure TWPRTFReaderEx.InNewSection(par : TParagraph);
begin
if (FSectionBreakMode=4) and (FCurrentParagraph<>nil) then
Include(FCurrentParagraph.prop, paprNewColumn)
else
if (FSectionBreakMode=3) and (FCurrentColumnCount>0) then //V5.24.4
begin
// Reset Columns
FCurrentParagraph.ASet(WPAT_COLUMNS, 0);
FCurrentColumnCount := 0;
end;
if (FColumnCount>0) and (FCurrentParagraph<>nil) then
begin
FCurrentParagraph.ASet(WPAT_COLUMNS, FColumnCount);
if FColumn_X>0 then FCurrentParagraph.ASet(WPAT_COLUMNS_X, FColumn_X);
if FColumn_Y>0 then FCurrentParagraph.ASet(WPAT_COLUMNS_Y, FColumn_Y);
FCurrentColumnCount := FColumnCount;
// FColumnCount := 0;
// FColumn_X := 0;
// FColumn_Y := 0;
end;
if FSectionBreakMode>=0 then
inherited InNewSection(par);
end;
Thanks,
can You please mail me Your file in WPT format. I would like to test this.
Julian
Julian,
Do you have an update on this?
Ken