From c17c410706eab6e4d449b2a20a51bf3702329341 Mon Sep 17 00:00:00 2001 From: Dennis Francis Date: Fri, 6 May 2022 10:56:38 +0530 Subject: lok: do not recreate lok-drawview for every tile paint This lets the ScLOKDrawView live long enough for non-tile painting related invocation of its methods and hopefully those of its member objects. This is a blind fix for the following crash: /opt/collaboraoffice/program/../program/libsclo.so (anonymous namespace)::ScLOKProxyObjectContact::calculateGridOffsetForViewOjectContact(basegfx::B2DVector&, sdr::contact::ViewObjectContact const&) const ... /opt/collaboraoffice/program/libmergedlo.so SdrTextObj::NbcSetOutlinerParaObjectForText(std::unique_ptr >, SdrText*) /home/collabora/jenkins/workspace/build_linux_co-2021_online_snapshot/svx/source/svdraw/svdotext.cxx:1379 /opt/collaboraoffice/program/libmergedlo.so sdr::properties::TextProperties::ItemSetChanged(SfxItemSet const&) /opt/rh/devtoolset-10/root/usr/include/c++/10/bits/unique_ptr.h:360 /opt/collaboraoffice/program/libmergedlo.so sdr::properties::RectangleProperties::ItemSetChanged(SfxItemSet const&) /home/collabora/jenkins/workspace/build_linux_co-2021_online_snapshot/svx/source/sdr/properties/rectangleproperties.cxx:54 /opt/collaboraoffice/program/libmergedlo.so sdr::properties::DefaultProperties::SetObjectItem(SfxPoolItem const&) /home/collabora/jenkins/workspace/build_linux_co-2021_online_snapshot/svx/source/sdr/properties/defaultproperties.cxx:120 /opt/collaboraoffice/program/libscfiltlo.so XclTxo::XclTxo(XclExpRoot const&, EditTextObject const&, SdrObject*) /home/collabora/jenkins/workspace/build_linux_co-2021_online_snapshot/include/svl/cenumitm.hxx:26 /opt/collaboraoffice/program/libscfiltlo.so XclObjComment::XclObjComment(XclExpObjectManager&, tools::Rectangle const&, EditTextObject const&, SdrCaptionObj*, bool, ScAddress const&, tools::Rectangle const&, tools::Rectangle const&) /opt/rh/devtoolset-10/root/usr/include/c++/10/bits/unique_ptr.h:179 /opt/collaboraoffice/program/libscfiltlo.so XclExpNote::XclExpNote(XclExpRoot const&, ScAddress const&, ScPostIt const*, rtl::OUString const&) /opt/rh/devtoolset-10/root/usr/include/c++/10/tuple:137 /opt/collaboraoffice/program/libscfiltlo.so ExcTable::FillAsTableXml() /home/collabora/jenkins/workspace/build_linux_co-2021_online_snapshot/include/rtl/ref.hxx:65 /opt/collaboraoffice/program/libscfiltlo.so ExcDocument::ReadDoc() /home/collabora/jenkins/workspace/build_linux_co-2021_online_snapshot/sc/source/filter/excel/excdoc.cxx:747 /opt/collaboraoffice/program/libscfiltlo.so XclExpXmlStream::exportDocument() /home/collabora/jenkins/workspace/build_linux_co-2021_online_snapshot/sc/source/filter/excel/xestream.cxx:1107 /opt/collaboraoffice/program/libooxlo.so Change-Id: I248395cca1e2da37208fc449aca731175a5aa368 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133914 Tested-by: Andras Timar Reviewed-by: Andras Timar --- sc/source/ui/view/gridwin4.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 2580b25fafd2..0c697bf085ef 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1571,13 +1571,16 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, { bool bPrintTwipsMsgs = comphelper::LibreOfficeKit::isCompatFlagSet( comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs); - mpLOKDrawView.reset(bPrintTwipsMsgs ? - new ScLOKDrawView( - &rDevice, - mrViewData) : - new FmFormView( - *pModel, - &rDevice)); + if (!mpLOKDrawView) + { + mpLOKDrawView.reset(bPrintTwipsMsgs ? + new ScLOKDrawView( + &rDevice, + mrViewData) : + new FmFormView( + *pModel, + &rDevice)); + } mpLOKDrawView->SetNegativeX(bLayoutRTL); mpLOKDrawView->ShowSdrPage(mpLOKDrawView->GetModel()->GetPage(nTab)); -- cgit