sw/source/core/doc/DocumentContentOperationsManager.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 251798c9b4f2ebad447953c3a4b1048e48cd30e3 Author: Méven Car <meven....@collabora.com> AuthorDate: Fri Aug 8 15:22:31 2025 +0200 Commit: Michael Stahl <michael.st...@collabora.com> CommitDate: Wed Aug 20 19:21:29 2025 +0200 writer: when pasting Copy paragraph style when dest node is " " This can be considered an empty node, that the pasted paragraph can overwrite. Change-Id: Ie28d743088143b01074356154324531463259e31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189194 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Michael Stahl <michael.st...@collabora.com> (cherry picked from commit e53a266e1c93c4ea20345216d6a91a702b2b844f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189900 Tested-by: Jenkins diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 7509516ca726..c18cb0186323 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -5190,8 +5190,9 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo SwTextNode* pSttTextNd = pStart->GetNode().GetTextNode(); SwTextNode* pEndTextNd = pEnd->GetNode().GetTextNode(); SwTextNode* pDestTextNd = aInsPos.GetNode().GetTextNode(); + bool bDestTextNdEmpty = pDestTextNd && (pDestTextNd->GetText().isEmpty() || pDestTextNd->GetText() == " "); bool bCopyCollFormat = !rDoc.IsInsOnlyTextGlossary() && - ( (pDestTextNd && !pDestTextNd->GetText().getLength()) || + ( bDestTextNdEmpty || ( !bOneNode && !rPos.GetContentIndex() ) ); bool bCopyBookmarks = true; bool bCopyPageSource = false;