From 14d2255cbd254dea6e87a04f747e7d6d3d54ceb9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 19 Jul 2017 16:52:46 +0200 Subject: tdf#107975: Revert "fix deleting an image anchored to last paragraph ... in document" This reverts commit 2903d85d6197829633d7f96c95cd55821c2c20ff. It was a good idea, but is not complete. Change-Id: Ia0da2640889ce6e78b89b27c75fae9d6508afd40 --- sw/source/core/undo/undobj.cxx | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'sw/source/core/undo/undobj.cxx') diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 13f0843b95e7..9ad7a4d69748 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -637,7 +637,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, if( !pHistory ) pHistory.reset( new SwHistory ); if (IsDestroyFrameAnchoredAtChar( - *pAPos, *pStt, *pEnd, pDoc, nDelContentType)) + *pAPos, *pStt, *pEnd, nDelContentType)) { pHistory->Add( *static_cast(pFormat), nChainInsPos ); n = n >= rSpzArr.size() ? rSpzArr.size() : n+1; @@ -1138,27 +1138,14 @@ OUString ShortenString(const OUString & rStr, sal_Int32 nLength, const OUString } bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos, - SwPosition const & rStart, SwPosition const & rEnd, const SwDoc* doc, + SwPosition const & rStart, SwPosition const & rEnd, DelContentType const nDelContentType) { - bool inSelection = rAnchorPos < rEnd; - if( rAnchorPos == rEnd ) - { - const SwNodes& nodes = doc->GetNodes(); - if( rEnd == SwPosition( nodes.GetEndOfContent())) - inSelection = true; - else - { - SwNodeIndex idx( nodes.GetEndOfContent()); - if( SwContentNode* last = SwNodes::GoPrevious( &idx )) - inSelection = rEnd == SwPosition( *last, last->Len()); - } - } // Here we identified the objects to destroy: // - anchored between start and end of the selection // - anchored in start of the selection with "CheckNoContent" // - anchored in start of sel. and the selection start at pos 0 - return inSelection + return (rAnchorPos.nNode < rEnd.nNode) && ( (DelContentType::CheckNoCntnt & nDelContentType) || (rStart.nNode < rAnchorPos.nNode) || !rStart.nContent.GetIndex() -- cgit v1.2.3