Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » Page break does not work in Style
Page break does not work in Style [message #57759] Thu, 09 December 2021 10:32 Go to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

It seems that in RichText/TextStyle.cpp, the marked line below prevents Style Manager item 'Text flow > Break page before' from working. It gets reset here:
void RichText::SetStyle(const Uuid& id, const RichStyle& _style)
{
	Invalidate();
	RichStyle& s = style.GetAdd(id);
	s = _style;
	s.format.styleid = id;
	s.format.language = 0;
	s.format.newpage = false;        << THIS HERE IS THE ONE
	StyleChangeOp op;
	op.nid = op.id = id;
	Update(op);
}

This is the reason, I cannot introduce heading styles that start new chapters automatically on a new page in UWord.

If I comment out this line, there is just one issue: The heading starts on a new page even when this is the first line on the page, and this would obviously leave an unintentional blank page before before the heading in this case.

Best regards,

Tom
Re: Page break does not work in Style [message #58192 is a reply to message #57759] Fri, 18 March 2022 14:48 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Tom1 wrote on Thu, 09 December 2021 10:32
Hi,

It seems that in RichText/TextStyle.cpp, the marked line below prevents Style Manager item 'Text flow > Break page before' from working. It gets reset here:
void RichText::SetStyle(const Uuid& id, const RichStyle& _style)
{
	Invalidate();
	RichStyle& s = style.GetAdd(id);
	s = _style;
	s.format.styleid = id;
	s.format.language = 0;
	s.format.newpage = false;        << THIS HERE IS THE ONE
	StyleChangeOp op;
	op.nid = op.id = id;
	Update(op);
}

This is the reason, I cannot introduce heading styles that start new chapters automatically on a new page in UWord.

If I comment out this line, there is just one issue: The heading starts on a new page even when this is the first line on the page, and this would obviously leave an unintentional blank page before before the heading in this case.

Best regards,

Tom


Added new paragraph option: "First on page" (QTF [F ) - hopefully this solves your problem. Please test.

Mirek
Re: Page break does not work in Style [message #58195 is a reply to message #58192] Fri, 18 March 2022 18:52 Go to previous message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi Mirek!

Many thanks! This works just perfectly.

Best regards,

Tom
Previous Topic: How do I set the pagesize (in points or mm) of RichEdit?
Next Topic: Skipping footer/header and page numbering...
Goto Forum:
  


Current Time: Thu Mar 28 21:06:01 CET 2024

Total time taken to generate the page: 0.01275 seconds