[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/inc sw/source

Michael Stahl mstahl at redhat.com
Thu Jul 20 09:46:49 UTC 2017


 sw/inc/undobj.hxx                   |    2 +-
 sw/source/core/undo/undobj.cxx      |   19 +++----------------
 sw/source/filter/basflt/shellio.cxx |    3 +--
 3 files changed, 5 insertions(+), 19 deletions(-)

New commits:
commit 1450f9f56c2053a1584f2f1a9e40c54971b57edd
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jul 19 16:52:46 2017 +0200

    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
    (cherry picked from commit 14d2255cbd254dea6e87a04f747e7d6d3d54ceb9)
    Reviewed-on: https://gerrit.libreoffice.org/40191
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index ef154ca2d41c..05cc4fd9b352 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -138,7 +138,7 @@ namespace nsDelContentType
 
 /// 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 = nsDelContentType::DELCNT_ALL);
 
 // 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 e630254389d6..b5f40292ca74 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -633,7 +633,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark,
                         if( !pHistory )
                             pHistory = 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;
@@ -1134,27 +1134,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)
          && (   (nsDelContentType::DELCNT_CHKNOCNTNT & 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 69e5ed9cb688..f8333f856ef9 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -243,8 +243,7 @@ sal_uLong SwReader::Read( const Reader& rOptions )
                                     &&  !IsDestroyFrameAnchoredAtChar(
                                               *pFrameAnchor,
                                               *pUndoPam->GetPoint(),
-                                              *pUndoPam->GetMark(),
-                                              pDoc)
+                                              *pUndoPam->GetMark())
                                     )
                                 )
                             )


More information about the Libreoffice-commits mailing list