From d541c4548fdc1835cf4fc020dbaa7ed7c2f734d0 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 23 May 2018 18:14:58 +0200 Subject: [PATCH] tdf#117629 Fix FontWork UNO API/SdrPage settings Change-Id: Id4da3ac2ff9f8bba382512cfafbca323d1002137 Reviewed-on: https://gerrit.libreoffice.org/54722 Tested-by: Jenkins Reviewed-by: Armin Le Grand --- svx/source/tbxctrls/fontworkgallery.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 06c0da159507..29003a619d64 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -216,6 +216,18 @@ void FontWorkGalleryDialog::insertSelectedFontwork() pPage->GetObj(0)->CloneSdrObject( bUseSpecialCalcMode ? *mpDestModel : mpSdrView->getSdrModelFromSdrView())); + // tdf#117629 + // Since the 'old' ::CloneSdrObject also copies the SdrPage* the + // SdrObject::getUnoShape() *will* create the wrong UNO API object + // early. This IS one of the reasons I do change these things - this + // error does not happen with my next change I am working on already + // ARGH! For now, reset the SdrPage* to nullptr. + // What sense does it have to copy the SdrPage* of the original SdrObject ?!? + // TTTT: This also *might* be the hidden reason for the strange code at the + // end of SdrObject::SetPage that tries to delete the SvxShape under some + // circumstances... + pNewObject->SetPage(nullptr); + tools::Rectangle aObjRect( pNewObject->GetLogicRect() ); tools::Rectangle aVisArea = pOutDev->PixelToLogic(tools::Rectangle(Point(0,0), pOutDev->GetOutputSizePixel())); Point aPagePos = aVisArea.Center();