summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJuergen Funk <juergen.funk_ml@cib.de>2016-02-10 14:54:24 +0100
committerOliver Specht <oliver.specht@cib.de>2016-02-17 07:29:40 +0000
commitb0facbbedf42a02449d9f35bb4ac8bd7ec2d8917 (patch)
tree879de8e3fc59954dc98bf39ec3300961006f4e40 /sw
parentf17a4694b07856292804c23b80ce92967d401bb8 (diff)
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@cib.de> Tested-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index a82075e8390d..750dcbec8900 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() );