diff options
-rw-r--r-- | sw/inc/undobj.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/undo/undobj.cxx | 19 | ||||
-rw-r--r-- | sw/source/filter/basflt/shellio.cxx | 3 |
3 files changed, 5 insertions, 19 deletions
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 61f7735cf4cf..60069b8fa18e 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -142,7 +142,7 @@ namespace o3tl { /// will DelContentIndex destroy a frame anchored at character at rAnchorPos? bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos, - SwPosition const & rStart, SwPosition const & rEnd, const SwDoc* doc, + SwPosition const & rStart, SwPosition const & rEnd, DelContentType const nDelContentType = DelContentType::AllMask); // This class has to be inherited into an Undo-object if it saves content 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<SwFlyFrameFormat *>(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() diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 3e2a3ec4393c..a937a2d7a030 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -245,8 +245,7 @@ ErrCode SwReader::Read( const Reader& rOptions ) && !IsDestroyFrameAnchoredAtChar( *pFrameAnchor, *pUndoPam->GetPoint(), - *pUndoPam->GetMark(), - mxDoc.get()) + *pUndoPam->GetMark()) ) ) ) |