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

New commits:
commit 8583ce9ebb38717144d0fa2ea9cffa9b134e7068
Author:     Méven Car <meven....@collabora.com>
AuthorDate: Fri Aug 8 15:22:31 2025 +0200
Commit:     Michael Stahl <michael.st...@collabora.com>
CommitDate: Mon Aug 18 14:11:28 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/+/189854
    Tested-by: Michael Stahl <michael.st...@collabora.com>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index d73794765165..e2058f458c26 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -5189,8 +5189,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