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... » Remove empty paragraphs
Re: Remove empty paragraphs [message #57579 is a reply to message #57378] Sat, 02 October 2021 09:28 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
You will have to use RichText methods which are unfortunately undocumented ATM.

Anyway, the idea is that RichTxt is an array of "parts". Part can either be a paragraph or a table. If it is table, then each of cells is another RichTxt recursively. Difference between RichText and RichTxt is that RichText contains paragraph styles too, so that way they can be shared between top-level paragraphs and paragraphs in the table (RichText is derived from RichTxt).

Now for your needs, you will need

RichTxt::GetPartCount to get the index of the last paragraph (-1)
RichTxt::IsPara to check that it is a paragraph
RichTxt::GetPartLength to check that is empty
RichTxt::RemovePart to remove it

Mirek

 
Read Message
Read Message
Previous Topic: RichTextView::GetData() Method
Next Topic: How do I set the pagesize (in points or mm) of RichEdit?
Goto Forum:
  


Current Time: Fri May 03 09:38:22 CEST 2024

Total time taken to generate the page: 0.01814 seconds