summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-08-28 13:25:08 +0200
committerMichael Stahl <mstahl@redhat.com>2015-08-28 21:42:46 +0000
commit1638e2bd0da0a356826d58e277a999c5449769ea (patch)
treecf307f5414312e1ba0bb030b659ab6ba78a68e30
parent394387490ad4f8e52deeb2f32d7f83042b3eded1 (diff)
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 <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 4f1c3960480b..c6c69f3e3d8a 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;