diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2011-06-27 11:57:46 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2011-06-27 12:00:12 +0200 |
commit | ce50a165755bf80921cb461395890f89e9a22e37 (patch) | |
tree | 105ce9148f800f8b35148435cd39f181f8c6032c | |
parent | 39d4ce1b676e659e8de0e0752516d22aa5777953 (diff) |
avoid infinite loop when writting out docs with bookmarks (bnc#700370)
The next position is either next attribute or next bookmark, whichever
comes first.
ACK by Cedric.
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index ca502d4c09..02659bf4a4 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1622,7 +1622,7 @@ xub_StrLen MSWordExportBase::GetNextPos( SwWW8AttrIter* aAttrIter, const SwTxtNo xub_StrLen nNextPos = aAttrIter->WhereNext(); xub_StrLen nNextBookmark = nNextPos; - if( nNextBookmark > nAktPos )//no need to search for bookmarks otherwise + if( nNextBookmark > nAktPos ) //no need to search for bookmarks otherwise (checked in UpdatePosition()) { GetSortedBookmarks( rNode, nAktPos, nNextBookmark - nAktPos ); NearestBookmark( nNextBookmark, nAktPos, false ); @@ -1634,9 +1634,9 @@ void MSWordExportBase::UpdatePosition( SwWW8AttrIter* aAttrIter, xub_StrLen nAkt { xub_StrLen nNextPos; - // go to next attribute if no bookmark is found and if the next attribute position if at the current position + // go to next attribute if no bookmark is found or if the bookmark is behind the next attribute position bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true ); - if( !bNextBookmark && nAktPos >= aAttrIter->WhereNext() ) + if( !bNextBookmark || nNextPos > aAttrIter->WhereNext() ) aAttrIter->NextPos(); } |