Rich Text Format
Rich Text Format
Is there already a complete implementation of the Rich Text Format from word?
Re: Rich Text Format
Hi,
wxRichTextCtrl?
Thank you.
wxRichTextCtrl?
Thank you.
Re: Rich Text Format
There is no import or export of RTF format in wxWidgets. There was an RTF import implementation for wxRichTextCtrl from a Chinese programmer, but i can't find the link any more.
Use the source, Luke!
Re: Rich Text Format
I found a parser for phyton, but not for C++.
Did you mean this one:
https://github.com/cctags/gumpad2/blob/ ... FParser.py
Anyway implementing this into c++, is still to high for me, after all still a beginner.
Re: Rich Text Format
I need this for a database which has app. 15000 items in it, and all items are as rtf, otherwise I would have to convert them into something readable like html, and place it back in the database, which is not so easy either, But if i can stay with rtf, it is easier to use for other existing programms. So a lot of reason to stay with rtf.
Re: Rich Text Format
Do you really need the RTF import in the application? Can't you do the conversion "offline" with an external tool?
Anyway, I found the source code from the RTF importer i was talking about. I uploaded it here: https://www.sendspace.com/file/0uushz
I comes with no documentation except the comments in the header file and i also don't know if it works with the current wxRichTextCtrl.
There is also http://librtf.sourceforge.net/
Anyway, I found the source code from the RTF importer i was talking about. I uploaded it here: https://www.sendspace.com/file/0uushz
I comes with no documentation except the comments in the header file and i also don't know if it works with the current wxRichTextCtrl.
There is also http://librtf.sourceforge.net/
Use the source, Luke!
Re: Rich Text Format
Just implemented a quick test, to read it from a file, and whis worked, now I have to change it to a memory file system, as it is working with stream, and not just strings, what would make it easier for me.
But thanks for the tipp, it looks at the moment like it will work.
But thanks for the tipp, it looks at the moment like it will work.
Re: Rich Text Format
How is it best to get it from a string to a stream?
Re: Rich Text Format
Thanks managed to change it so it works with my string from the database.
Now only saving, but that will take still a bit.
If I have a question there I will ask.
Now only saving, but that will take still a bit.
If I have a question there I will ask.
Re: Rich Text Format
Did not check right away, but there are a lot of memory leaks in the rtf code. As soon as I implement it, I have memory leaks, if I leave it away there are none. But not easy to get rid of them, as I tried some delete, but then it gave errors.
Re: Rich Text Format
Doublemax
Can you check for the memory leaks, by the one you uploaded for me.
Yes it works with the current wxRichtextctrl but produces a lot of memory leaks, and I find no solution how to clean those.
Can you check for the memory leaks, by the one you uploaded for me.
Yes it works with the current wxRichtextctrl but produces a lot of memory leaks, and I find no solution how to clean those.
Re: Rich Text Format
Hi,
If you are on Windows with MSVC - did you try VLD?
Thank you.
If you are on Windows with MSVC - did you try VLD?
Thank you.
Re: Rich Text Format
tried vld, my own code is also without leak, it is the external, and there are app. 1400 memory leaks, as it uses all the time new. and with a delete it generates an error, so I'm out of ideas. Even if I just make a delete before the next new call, it throughs an exception.
Re: Rich Text Format
the leak depend how long the rtf text is. had now 15.255 leaks;
Here the
causes the error:
And that is just one of the places where it generates the memory leaks.
Code: Select all
void RtfLayerNode::AddAttribute(wxString name,wxString value)
{
RtfAttributes *attr = new RtfAttributes(name,value);
m_Attrlist.Append(attr);
delete attr;
}
Code: Select all
delete attr;
If I start it without the delete attr; it works, but it has a lot of memory leaks.Unhandled unknown exception; terminating the apllication.
And that is just one of the places where it generates the memory leaks.