sw/source/core/doc/DocumentContentOperationsManager.cxx |   17 +++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 1638e2bd0da0a356826d58e277a999c5449769ea
Author: Bjoern Michaelsen <bjoern.michael...@canonical.com>
Date:   Fri Aug 28 13:25:08 2015 +0200

    tdf#93353: fix copy fluy in fly
    
    - prevents flys in inlcuded docs in a master doc from disappearing
    - fixes a regression from 3fcb0c3aa8d58a819aa21eb9743eaa6da7394819
    
    Change-Id: If211d8dbf423e2a33a258b43ab7092e1a010206f
    Reviewed-on: https://gerrit.libreoffice.org/18106
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 4f1c396..c6c69f3 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3201,7 +3201,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
     const SwNodeRange& rRg,
     const sal_Int32 nEndContentIndex,
     const SwNodeIndex& rStartIdx,
-    bool bCopyFlyAtFly,
+    const bool bCopyFlyAtFly,
     const bool bMergedFirstNode ) const
 {
     // First collect all Flys, sort them according to their ordering number,
@@ -3223,22 +3223,25 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
         bool bAtContent = (pAnchor->GetAnchorId() == FLY_AT_PARA);
         if ( !pAPos )
             continue;
+        sal_uLong nSkipAfter = pAPos->nNode.GetIndex();
+        sal_uLong nStart = rRg.aStart.GetIndex();
         switch ( pAnchor->GetAnchorId() )
         {
             case FLY_AT_FLY:
-                if( bCopyFlyAtFly && rRg.aStart > pAPos->nNode.GetIndex() + 1 )
-                    continue;
+                if(bCopyFlyAtFly)
+                    ++nSkipAfter;
+                else if(m_rDoc.getIDocumentRedlineAccess().IsRedlineMove())
+                    ++nStart;
             break;
             case FLY_AT_CHAR:
             case FLY_AT_PARA:
-                bCopyFlyAtFly = false;
+                if(m_rDoc.getIDocumentRedlineAccess().IsRedlineMove())
+                    ++nStart;
             break;
             default:
                 continue;
         }
-        if ( !bCopyFlyAtFly && ( 
m_rDoc.getIDocumentRedlineAccess().IsRedlineMove()
-                    ? rRg.aStart >= pAPos->nNode
-                    : rRg.aStart > pAPos->nNode ))
+        if ( nStart > nSkipAfter )
             continue;
         if ( pAPos->nNode > rRg.aEnd )
             continue;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to