[Libreoffice-commits] .: sw/source
Lubos Lunak
llunak at kemper.freedesktop.org
Mon Jun 27 02:59:15 PDT 2011
sw/source/filter/ww8/wrtw8nds.cxx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 1eeb7343c2744cdd574c1aad245fbfc23fc29bff
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Mon Jun 27 11:57:46 2011 +0200
avoid infinite loop when writting out docs with bookmarks (bnc#700370)
The next position is either next attribute or next bookmark, whichever
comes first.
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 183fe59..72ae0fd 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1618,7 +1618,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 );
@@ -1630,9 +1630,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();
}
More information about the Libreoffice-commits
mailing list