summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-08-28 13:25:08 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-08-28 13:29:39 +0200
commit99eaa798eb167688648da16a61f0214938caf7c5 (patch)
tree667e9a3d34b7f1956cb2266d28b1c77a46f01907 /sw
parent2de6bd04d9a40d746ebcd5d666efdbb30507623a (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
Diffstat (limited to 'sw')
-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 df092d9ca5d1..32ece3e5d929 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;