[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sw/source
Lubos Lunak
llunak at kemper.freedesktop.org
Mon Jun 27 03:00:37 PDT 2011
sw/source/filter/ww8/wrtw8nds.cxx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit ce50a165755bf80921cb461395890f89e9a22e37
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.
ACK by Cedric.
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index ca502d4..02659bf 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();
}
More information about the Libreoffice-commits
mailing list