[Libreoffice-commits] core.git: svx/source

Armin Le Grand Armin.Le.Grand at cib.de
Wed May 23 21:24:56 UTC 2018


 svx/source/tbxctrls/fontworkgallery.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit d541c4548fdc1835cf4fc020dbaa7ed7c2f734d0
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date:   Wed May 23 18:14:58 2018 +0200

    tdf#117629 Fix FontWork UNO API/SdrPage settings
    
    Change-Id: Id4da3ac2ff9f8bba382512cfafbca323d1002137
    Reviewed-on: https://gerrit.libreoffice.org/54722
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Armin Le Grand <Armin.Le.Grand at cib.de>

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();


More information about the Libreoffice-commits mailing list