This is an automatically generated e-mail. To reply, visit: http://reviewboard.kde.org/r/5152/

Hey, cool fix, thanks!

The patch was for one hunk, you supplied 3. I like the one that fixes the bug you write about the patch needs a bit more work.
Could you update the patch with these fixes? Then it can be committed as far as I can see :)

/trunk/koffice/libs/kotext/opendocument/KoTextLoader.cpp (Diff revision 1)
QString KoTextLoader::createUniqueBookmarkName(KoBookmarkManager* bmm, QString bookmarkName, bool isEndMarker)
835
                if (uniqID > 0) {       // don't go to negative indexes
This looks wrong, the code below expects the uniqID to become zero.

/trunk/koffice/libs/kotext/opendocument/KoTextLoader.cpp (Diff revision 1)
void KoTextLoader::loadSpan(const KoXmlElement &element, QTextCursor &cursor, bool *stripLeadingSpace)
1016
                }
If you want to follow coding style then you should have the closing brace on the same line as the else;
  if (foo) {
  } else {
  }

/trunk/koffice/libs/kotext/opendocument/KoTextLoader.cpp (Diff revision 1)
void KoTextLoader::loadSpan(const KoXmlElement &element, QTextCursor &cursor, bool *stripLeadingSpace)
1032
                    if (startBookmark) {        // set end bookmark only if we got start bookmark (we might not have in case of broken document)
Good catch; this is indeed a correct fix. Could you also add a 
  kWarning(32500) << "some message"
to make clear that we recovered from a broken input file?

- Thomas


On August 26th, 2010, 9:12 a.m., Miroslav Nohaj wrote:

Review request for KOffice.
By Miroslav Nohaj.

Updated 2010-08-26 09:12:32

Description

This small fix just handles the situation when there's a request to finish a bookmark which was not started (i.e. in some strange document). Does nothing special - just checks if really got the pointer to bookmark (and not null).

Diffs

  • /trunk/koffice/libs/kotext/opendocument/KoTextLoader.cpp (1167253)

View Diff