[Libreoffice-commits] core.git: sw/source

Juergen Funk juergen.funk_ml at cib.de
Wed Feb 17 07:30:08 UTC 2016


 sw/source/core/doc/DocumentContentOperationsManager.cxx |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit b0facbbedf42a02449d9f35bb4ac8bd7ec2d8917
Author: Juergen Funk <juergen.funk_ml at cib.de>
Date:   Wed Feb 10 14:54:24 2016 +0100

    tdf#97526 - in copy/paste ignore unwanted page break on first paragraph
    
    In copy/paste ignore the page break attribute from the first paragraph
    of the document (see also tdf#39400)
    
    Change-Id: I838c21c14647d4692673bd30df320e6704de1455
    Reviewed-on: https://gerrit.libreoffice.org/22270
    Reviewed-by: Oliver Specht <oliver.specht at cib.de>
    Tested-by: Oliver Specht <oliver.specht at cib.de>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index a82075e..750dcbe 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -4180,6 +4180,7 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos,
                         ( (pDestTextNd && !pDestTextNd->GetText().getLength()) ||
                           ( !bOneNode && !rPos.nContent.GetIndex() ) );
     bool bCopyBookmarks = true;
+    bool bCopyPageSource  = false;
     bool bStartIsTextNode = nullptr != pSttTextNd;
 
     // #i104585# copy outline num rule to clipboard (for ASCII filter)
@@ -4444,10 +4445,24 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos,
                     pCopyPam->GetPoint()->nNode.GetIndex()+1 ]->GetTextNode()))
             {
                 pDestTextNd->SetAttr( aBrkSet );
+                bCopyPageSource = true;
             }
         }
     } while( false );
 
+
+    // it is not possible to make this test when copy from the clipBoard to document
+    //  in this case the PageNum not exist anymore
+    // tdf#39400 and tdf#97526
+    // when copy from document to ClipBoard, and it is from the first page
+    //  and not the source has the page break
+    if (pDoc->IsClipBoard() && (rPam.GetPageNum(pStt == rPam.GetPoint()) == 1) && !bCopyPageSource)
+    {
+        pDestTextNd->ResetAttr(RES_BREAK);        // remove the page-break
+        pDestTextNd->ResetAttr(RES_PAGEDESC);
+    }
+
+
     // Adjust position (in case it was moved / in another node)
     rPos.nContent.Assign( rPos.nNode.GetNode().GetContentNode(),
                             rPos.nContent.GetIndex() );


More information about the Libreoffice-commits mailing list