sw/source/core/unocore/unoportenum.cxx |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit a3358bb4a75ce36e1dd4c26a3be7bf0d8dbbfa98
Author:     Serge Krot <serge.k...@cib.de>
AuthorDate: Fri Aug 24 13:31:54 2018 +0200
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Mon Aug 27 22:57:10 2018 +0200

    sw: fix inconsistent bookmark behavior around at-char/as-char anchored 
frames
    
    Added fix for
     Change-Id: Ic1f173c85d3824afabb5b7ebf3a8594311eb9007
     Reviewed-on: https://gerrit.libreoffice.org/46889
     Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
     Tested-by: Jenkins <c...@libreoffice.org>
    
    The problem was (the same condition of the bOnlyFrameStarts parameter
    was used during output of Start and End bookmarks):
      if (BkmType::Start == pPtr->nBkmType && !bOnlyFrameStarts)
      ...
      if (BkmType::End   == pPtr->nBkmType && !bOnlyFrameStarts)
      ...
    Should be:
      if (BkmType::Start == pPtr->nBkmType &&  bOnlyFrameStarts)
      ...
      if (BkmType::End   == pPtr->nBkmType && !bOnlyFrameStarts)
      ...
    
    I assume this was a simple copy-paste bug.
    
    Change-Id: I712a0dccc1638fed3b81c65628033a4dc06c1ca4
    Reviewed-on: https://gerrit.libreoffice.org/59556
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
old mode 100644
new mode 100755
index b60f7f297e6a..1a8a95c23f91
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -615,7 +615,7 @@ static void lcl_ExportBookmark(
 {
     for ( SwXBookmarkPortion_ImplList::iterator aIter = rBkmArr.begin(), aEnd 
= rBkmArr.end(); aIter != aEnd; )
     {
-        SwXBookmarkPortion_ImplSharedPtr pPtr = (*aIter);
+        const SwXBookmarkPortion_ImplSharedPtr& pPtr = (*aIter);
         if ( nIndex > pPtr->getIndex() )
         {
             if (bOnlyFrameStarts)
@@ -627,8 +627,7 @@ static void lcl_ExportBookmark(
         if ( nIndex < pPtr->getIndex() )
             break;
 
-        SwXTextPortion* pPortion = nullptr;
-        if ((BkmType::Start == pPtr->nBkmType && !bOnlyFrameStarts) ||
+        if ((BkmType::Start == pPtr->nBkmType && bOnlyFrameStarts) ||
             (BkmType::StartEnd == pPtr->nBkmType))
         {
             bool bFrameStart = rFramePositions.find(nIndex) != 
rFramePositions.end();
@@ -642,21 +641,22 @@ static void lcl_ExportBookmark(
                 // - this is the start or end (depending on bOnlyFrameStarts)
                 //   of a collapsed bookmark at the same position as an at-char
                 //   anchored frame
-                pPortion =
+                SwXTextPortion* pPortion =
                     new SwXTextPortion(pUnoCursor, xParent, bEnd ? 
PORTION_BOOKMARK_END : PORTION_BOOKMARK_START);
                 rPortions.emplace_back(pPortion);
                 pPortion->SetBookmark(pPtr->xBookmark);
                 pPortion->SetCollapsed( BkmType::StartEnd == pPtr->nBkmType && 
!bFrameStart );
             }
-
         }
-        if (BkmType::End == pPtr->nBkmType && !bOnlyFrameStarts)
+        else if (BkmType::End == pPtr->nBkmType && !bOnlyFrameStarts)
         {
-            pPortion =
+            SwXTextPortion* pPortion =
                 new SwXTextPortion(pUnoCursor, xParent, PORTION_BOOKMARK_END);
             rPortions.emplace_back(pPortion);
             pPortion->SetBookmark(pPtr->xBookmark);
         }
+
+        // next bookmark
         if (bOnlyFrameStarts)
             ++aIter;
         else
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to