summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2023-09-14 22:50:37 +0200
committerAndras Timar <andras.timar@collabora.com>2023-09-18 10:13:51 +0200
commitc8cef77b6c51c94387b321ac48321e6cc5c0a106 (patch)
tree57d069a27eff8e9d550233d0848d75913f1b3b27
parente8a4387848966616078bccc08bcf30c44d9af136 (diff)
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 (cherry picked from commit 17cd1dacf6a4b587b524edc7384ff26990208132) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--svx/source/svdraw/svdpage.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index bc04316941c4..8378dcfed820 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -795,7 +795,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();