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... » RichEdit assertion
RichEdit assertion [message #52380] Mon, 16 September 2019 15:16 Go to next message
warchef is currently offline  warchef
Messages: 13
Registered: January 2019
Location: Hungary
Promising Member
Hello!

I have following code:

#include <CtrlLib/CtrlLib.h>
#include <RichEdit/RichEdit.h>

using namespace Upp;

struct MyDlg : TopWindow {
	typedef MyDlg CLASSNAME;
	MyDlg()
	{
		Add(edit.SizePos());
		//String good_qtf = "[ [ [@6 Test]]]";
		String bad_qtf = "[ [ [@6 Test]&][ {{5000:5000h1; [@6 ]:: [@6 ]:: [@6 ]:: [@6 ]}}]]";
		
		RichText txt;
		{
			//edit.PasteText(ParseQTF(bad_qtf)); -> All OK
			edit.PasteText(ParseQTF(bad_qtf));// -> Exception
		}
	}
	RichEdit edit;
};

GUI_APP_MAIN
{
	MyDlg().Run();
}


Result:
ASSERT FAILED: Assertion failed in D:\upp\uppsrc\RichText\TxtData.cpp, line 170
part[parai].Is<Para>()

What do I do wrong? Please, anyone who can help me!

Sincerely,
Marton
Re: RichEdit assertion [message #52388 is a reply to message #52380] Mon, 16 September 2019 22:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Pasted text here cannot end with table. You should add "&" at the end.

That said, it should not crash either. Therefore I have fixed PasteText to add that empty paragraph if necessarry (in the trunk).

Mirek
Re: RichEdit assertion [message #52391 is a reply to message #52388] Tue, 17 September 2019 09:59 Go to previous message
warchef is currently offline  warchef
Messages: 13
Registered: January 2019
Location: Hungary
Promising Member
Thank you very much, it works!

Sincerely,
Marton
Previous Topic: QTF and not UTF8 characters
Next Topic: Does a Ctrl may be a RichObject ?
Goto Forum:
  


Current Time: Thu Mar 28 17:34:15 CET 2024

Total time taken to generate the page: 0.03532 seconds