svx/source/svdraw/svdpage.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 17cd1dacf6a4b587b524edc7384ff26990208132
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Thu Sep 14 22:50:37 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Sep 15 13:45:17 2023 +0200

    tdf#157174: fix crash when clicking "Print Preview"
    
    Don't call Reformat method when treating a virtual SdrObject
    
    bt:
    4  0x00007fd7ff446eb4 in SdrObject::GetBroadcaster() const (this=0x4) at 
/home/julien/lo/libreoffice/svx/source/svdraw/svdobj.cxx:698
    5  0x00007fd7ff48eaee in SdrEdgeObj::Reformat() (this=0x564e82ef22d0) at 
/home/julien/lo/libreoffice/svx/source/svdraw/svdoedge.cxx:1666
    6  0x00007fd7ff551bd9 in SdrObjList::ImplReformatAllEdgeObjects(SdrObjList 
const&) (this=0x564e82a371e0, rObjList=...) at 
/home/julien/lo/libreoffice/svx/source/svdraw/svdpage.cxx:760
    7  0x00007fd7ff551b38 in SdrObjList::ReformatAllEdgeObjects() 
(this=0x564e82a371e0) at 
/home/julien/lo/libreoffice/svx/source/svdraw/svdpage.cxx:744
    8  0x00007fd7ff3d8d1c in SdrModel::ImpReformatAllEdgeObjects() 
(this=0x564e7f79dc50) at 
/home/julien/lo/libreoffice/svx/source/svdraw/svdmodel.cxx:752
    9  0x00007fd7ff3dda3b in SdrModel::setLock(bool) (this=0x564e7f79dc50, 
bLock=false) at /home/julien/lo/libreoffice/svx/source/svdraw/svdmodel.cxx:1618
    10 0x00007fd7c58a9a76 in SwView::~SwView() (this=0x564e82e7bb00) at 
/home/julien/lo/libreoffice/sw/source/uibase/uiview/view.cxx:1163
    11 0x00007fd7c58a9f99 in SwView::~SwView() (this=0x564e82e7bb00) at 
/home/julien/lo/libreoffice/sw/source/uibase/uiview/view.cxx:1122
    12 0x00007fd801835308 in SfxViewFrame::SwitchToViewShell_Impl(unsigned 
short, bool) (this=0x564e82b17680, nViewIdOrNo=1, bIsIndex=true) at 
/home/julien/lo/libreoffice/sfx2/source/view/viewfrm.cxx:2528
    
    See complete bt here:
    https://bugs.documentfoundation.org/attachment.cgi?id=189470
    
    Change-Id: I4de5127686c01a40c1666f6089efa4fe7a114cd0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156934
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 840d9d6cc0e7..8570a2157295 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -754,7 +754,9 @@ void SdrObjList::ImplReformatAllEdgeObjects(const 
SdrObjList& rObjList)
         const bool bIsGroup(nullptr != pChildren);
         if(!bIsGroup)
         {
-            if (pSdrObject->GetObjIdentifier() == SdrObjKind::Edge)
+            // Check IsVirtualObj because sometimes we get SwDrawVirtObj here
+            if (pSdrObject->GetObjIdentifier() == SdrObjKind::Edge
+               && !pSdrObject->IsVirtualObj())
             {
                 SdrEdgeObj* pSdrEdgeObj = static_cast< SdrEdgeObj* 
>(pSdrObject);
                 pSdrEdgeObj->Reformat();

Reply via email to