sw/source/core/doc/DocumentContentOperationsManager.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit b633549af3168a05cbcc389abba5683358b150b8
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Wed Nov 17 17:18:16 2021 +0000
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Nov 23 08:10:40 2021 +0100

    Crash when fetching clipboard data.
    
    Seems like some unusual corner-case around HTML export.
    
            sw::DocumentContentOperationsManager::CopyImplImpl(SwPaM&, 
SwPosition&, bool, SwPaM*, bool) const
                    
/sw/source/core/doc/DocumentContentOperationsManager.cxx:5068
            sw::DocumentContentOperationsManager::CopyImpl(SwPaM&, SwPosition&, 
bool, SwPaM*, bool) const
                    
/sw/source/core/doc/DocumentContentOperationsManager.cxx:4609
            sw::DocumentContentOperationsManager::CopyRange(SwPaM&, 
SwPosition&, bool, bool, bool) const
                    
/sw/source/core/doc/DocumentContentOperationsManager.cxx:1936
            SwEditShell::CopySelToDoc(SwDoc*)
                    /sw/inc/pam.hxx:193 (discriminator 2)
            SwFEShell::Copy(SwDoc*, rtl::OUString const*)
                    /sw/source/core/frmedt/fecopy.cxx:224
            (anonymous namespace)::lclOverWriteDoc(SwWrtShell&, SwDoc&)
                    /sw/source/uibase/dochdl/swdtflvr.cxx:413
            SwTransferable::GetData(com::sun::star::datatransfer::DataFlavor 
const&, rtl::OUString const&)
                    /include/sfx2/objsh.hxx:866
            
TransferableHelper::getTransferData2(com::sun::star::datatransfer::DataFlavor 
const&, rtl::OUString const&)
                    /include/com/sun/star/uno/Type.h:121
            
TransferableHelper::getTransferData(com::sun::star::datatransfer::DataFlavor 
const&)
                    /include/rtl/ustring.hxx:438
            getFromTransferrable.isra.0
                    /include/com/sun/star/uno/Any.hxx:151
            encodeImageAsHTML
                    /desktop/source/lib/init.cxx:4382
            doc_getTextSelection
    
    Change-Id: I1af52d827ebdc9bbc5278f56547d1b3fd1b87e7c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125455
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index c3251b6232f2..3c383388cc1c 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -5103,8 +5103,11 @@ bool 
DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
     //  and not the source has the page break
     if (rDoc.IsClipBoard() && (rPam.GetPageNum(pStt == rPam.GetPoint()) == 1) 
&& !bCopyPageSource)
     {
-        pDestTextNd->ResetAttr(RES_BREAK);        // remove the page-break
-        pDestTextNd->ResetAttr(RES_PAGEDESC);
+        if (pDestTextNd)
+        {
+            pDestTextNd->ResetAttr(RES_BREAK);        // remove the page-break
+            pDestTextNd->ResetAttr(RES_PAGEDESC);
+        }
     }
 
 

Reply via email to