sw/source/core/doc/DocumentContentOperationsManager.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e53a266e1c93c4ea20345216d6a91a702b2b844f
Author:     Méven Car <meven....@collabora.com>
AuthorDate: Fri Aug 8 15:22:31 2025 +0200
Commit:     Michael Stahl <michael.st...@collabora.com>
CommitDate: Fri Aug 15 12:41:27 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>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 12faf2546917..4b73850dd41f 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -5196,8 +5196,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;

Reply via email to