Kaydet (Commit) 99eaa798 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

tdf#93353: fix copy fluy in fly

- prevents flys in inlcuded docs in a master doc from disappearing
- fixes a regression from 3fcb0c3a

Change-Id: If211d8dbf423e2a33a258b43ab7092e1a010206f
üst 2de6bd04
...@@ -3201,7 +3201,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( ...@@ -3201,7 +3201,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
const SwNodeRange& rRg, const SwNodeRange& rRg,
const sal_Int32 nEndContentIndex, const sal_Int32 nEndContentIndex,
const SwNodeIndex& rStartIdx, const SwNodeIndex& rStartIdx,
bool bCopyFlyAtFly, const bool bCopyFlyAtFly,
const bool bMergedFirstNode ) const const bool bMergedFirstNode ) const
{ {
// First collect all Flys, sort them according to their ordering number, // First collect all Flys, sort them according to their ordering number,
...@@ -3223,22 +3223,25 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( ...@@ -3223,22 +3223,25 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
bool bAtContent = (pAnchor->GetAnchorId() == FLY_AT_PARA); bool bAtContent = (pAnchor->GetAnchorId() == FLY_AT_PARA);
if ( !pAPos ) if ( !pAPos )
continue; continue;
sal_uLong nSkipAfter = pAPos->nNode.GetIndex();
sal_uLong nStart = rRg.aStart.GetIndex();
switch ( pAnchor->GetAnchorId() ) switch ( pAnchor->GetAnchorId() )
{ {
case FLY_AT_FLY: case FLY_AT_FLY:
if( bCopyFlyAtFly && rRg.aStart > pAPos->nNode.GetIndex() + 1 ) if(bCopyFlyAtFly)
continue; ++nSkipAfter;
else if(m_rDoc.getIDocumentRedlineAccess().IsRedlineMove())
++nStart;
break; break;
case FLY_AT_CHAR: case FLY_AT_CHAR:
case FLY_AT_PARA: case FLY_AT_PARA:
bCopyFlyAtFly = false; if(m_rDoc.getIDocumentRedlineAccess().IsRedlineMove())
++nStart;
break; break;
default: default:
continue; continue;
} }
if ( !bCopyFlyAtFly && ( m_rDoc.getIDocumentRedlineAccess().IsRedlineMove() if ( nStart > nSkipAfter )
? rRg.aStart >= pAPos->nNode
: rRg.aStart > pAPos->nNode ))
continue; continue;
if ( pAPos->nNode > rRg.aEnd ) if ( pAPos->nNode > rRg.aEnd )
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment