From b6c3afdcbe66075f5a82d35ce8e403e7fe696174 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 24 Jul 2017 13:56:33 +0200 Subject: SdrGlobalData::aUserMakeObjUserDataHdl is unused ever since commit ddb1d5ebf0a81888001ffa1dbab883df70cdc279 Author: Felix Zhang Date: Fri Nov 18 18:23:52 2011 +0800 remove unused Sdr methods removed the SdrObjFactory::MakeNewObjUserData method Change-Id: I95c167b2f20b436bcc0085b6b616406ac210045f Reviewed-on: https://gerrit.libreoffice.org/40363 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svx/galmisc.hxx | 9 ------ include/svx/svdetc.hxx | 3 -- include/svx/svdobj.hxx | 8 ------ sc/inc/userdat.hxx | 8 ------ sc/source/core/data/drwlayer.cxx | 4 --- sc/source/core/data/userdat.cxx | 25 ----------------- sd/Library_sd.mk | 1 - sd/inc/sdobjfac.hxx | 39 -------------------------- sd/source/core/sdobjfac.cxx | 59 ---------------------------------------- sd/source/ui/app/sddll.cxx | 4 --- svx/source/gallery2/galmisc.cxx | 8 ------ svx/source/gallery2/galtheme.cxx | 2 -- svx/source/svdraw/svdetc.cxx | 6 ---- svx/source/svdraw/svdobj.cxx | 19 ------------- 14 files changed, 195 deletions(-) delete mode 100644 sd/inc/sdobjfac.hxx delete mode 100644 sd/source/core/sdobjfac.cxx diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx index 7ab20dee1ef0..b74f7f7e2061 100644 --- a/include/svx/galmisc.hxx +++ b/include/svx/galmisc.hxx @@ -115,15 +115,6 @@ public: const ImageMap& GetImageMap() const { return aImageMap; } }; -class SgaUserDataFactory -{ -public: - SgaUserDataFactory() { SdrObjFactory::InsertMakeUserDataHdl( LINK(this,SgaUserDataFactory,MakeUserData) ); } - ~SgaUserDataFactory() { SdrObjFactory::RemoveMakeUserDataHdl( LINK(this,SgaUserDataFactory,MakeUserData) ); } - - DECL_STATIC_LINK( SgaUserDataFactory, MakeUserData, SdrObjUserDataCreatorParams, SdrObjUserData* ); -}; - class GraphicFilter; class SVX_DLLPUBLIC GalleryProgress diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx index 8cffd3cb6323..171e8d1318ba 100644 --- a/include/svx/svdetc.hxx +++ b/include/svx/svdetc.hxx @@ -168,7 +168,6 @@ public: std::vector>& ImpGetUserMakeObjHdl(); -std::vector>& ImpGetUserMakeObjUserDataHdl(); class SdrOle2Obj; class AutoTimer; @@ -204,8 +203,6 @@ class SVX_DLLPUBLIC SdrGlobalData public: std::vector> aUserMakeObjHdl; - std::vector> - aUserMakeObjUserDataHdl; SdrEngineDefaults* pDefaults; OLEObjCache aOLEObjCache; diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 380564066a69..5d4669eb5749 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -968,12 +968,6 @@ struct SdrObjCreatorParams SdrInventor nInventor; sal_uInt16 nObjIdentifier; }; -struct SdrObjUserDataCreatorParams -{ - SdrInventor nInventor; - sal_uInt16 nObjIdentifier; - SdrObject* pObject; -}; /** * Whoever creates his own objects must set a link in the SdrObjFactory class. @@ -990,8 +984,6 @@ public: static SdrObject* MakeNewObject(SdrInventor nInventor, sal_uInt16 nObjIdentifier, const tools::Rectangle& rSnapRect, SdrPage* pPage); static void InsertMakeObjectHdl(Link const & rLink); static void RemoveMakeObjectHdl(Link const & rLink); - static void InsertMakeUserDataHdl(Link const & rLink); - static void RemoveMakeUserDataHdl(Link const & rLink); private: static SVX_DLLPRIVATE SdrObject* CreateObjectFromFactory( diff --git a/sc/inc/userdat.hxx b/sc/inc/userdat.hxx index 756ddc4876ef..4ee5b27ebc7e 100644 --- a/sc/inc/userdat.hxx +++ b/sc/inc/userdat.hxx @@ -31,14 +31,6 @@ #define SC_UD_IMAPDATA 2 #define SC_UD_MACRODATA 3 -class ScDrawObjFactory -{ - DECL_STATIC_LINK( ScDrawObjFactory, MakeUserData, SdrObjUserDataCreatorParams, SdrObjUserData* ); -public: - ScDrawObjFactory(); - ~ScDrawObjFactory(); -}; - class SC_DLLPUBLIC ScDrawObjData : public SdrObjUserData { public: diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 0c0544e27e2f..16833568b511 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -79,7 +79,6 @@ using namespace ::com::sun::star; -static ScDrawObjFactory* pFac = nullptr; static E3dObjFactory* pF3d = nullptr; static sal_uInt16 nInst = 0; @@ -323,7 +322,6 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const OUString& rName ) : if( !nInst++ ) { - pFac = new ScDrawObjFactory; pF3d = new E3dObjFactory; } } @@ -337,8 +335,6 @@ ScDrawLayer::~ScDrawLayer() delete pUndoGroup; if( !--nInst ) { - delete pFac; - pFac = nullptr; delete pF3d; pF3d = nullptr; } diff --git a/sc/source/core/data/userdat.cxx b/sc/source/core/data/userdat.cxx index 1a76e397a081..9e00a4fdc179 100644 --- a/sc/source/core/data/userdat.cxx +++ b/sc/source/core/data/userdat.cxx @@ -21,31 +21,6 @@ #include "drwlayer.hxx" #include "rechead.hxx" -ScDrawObjFactory::ScDrawObjFactory() -{ - SdrObjFactory::InsertMakeUserDataHdl( LINK ( this, ScDrawObjFactory, MakeUserData ) ); -} - -ScDrawObjFactory::~ScDrawObjFactory() -{ - SdrObjFactory::RemoveMakeUserDataHdl( LINK ( this, ScDrawObjFactory, MakeUserData ) ); -} - -IMPL_STATIC_LINK( - ScDrawObjFactory, MakeUserData, SdrObjUserDataCreatorParams, aParams, SdrObjUserData* ) -{ - if ( aParams.nInventor == SdrInventor::ScOrSwDraw ) - { - if ( aParams.nObjIdentifier == SC_UD_OBJDATA ) - return new ScDrawObjData; - else if ( aParams.nObjIdentifier == SC_UD_IMAPDATA ) - return new ScIMapInfo; - else if ( aParams.nObjIdentifier == SC_UD_MACRODATA ) - return new ScMacroInfo; - OSL_FAIL("MakeUserData: wrong ID"); - } - return nullptr; -} ScDrawObjData::ScDrawObjData() : SdrObjUserData( SdrInventor::ScOrSwDraw, SC_UD_OBJDATA ), diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 3c5cd3318f2e..ecaf83587f26 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -135,7 +135,6 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ sd/source/core/drawdoc_animations \ sd/source/core/pglink \ sd/source/core/sdiocmpt \ - sd/source/core/sdobjfac \ sd/source/core/sdpage \ sd/source/core/sdpage2 \ sd/source/core/sdpage_animations \ diff --git a/sd/inc/sdobjfac.hxx b/sd/inc/sdobjfac.hxx deleted file mode 100644 index 56c96baf3442..000000000000 --- a/sd/inc/sdobjfac.hxx +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SD_INC_SDOBJFAC_HXX -#define INCLUDED_SD_INC_SDOBJFAC_HXX - -#include - -class SdrObjFactory; - -class SdObjectFactory -{ -public: - SdObjectFactory() {} - - DECL_STATIC_LINK( SdObjectFactory, MakeUserData, SdrObjUserDataCreatorParams, SdrObjUserData* ); -}; - -extern SdObjectFactory aSdObjectFactory; - -#endif // INCLUDED_SD_INC_SDOBJFAC_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/core/sdobjfac.cxx b/sd/source/core/sdobjfac.cxx deleted file mode 100644 index abffd218030b..000000000000 --- a/sd/source/core/sdobjfac.cxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include - -#include "sdmod.hxx" -#include "sdpage.hxx" -#include "sdobjfac.hxx" -#include "glob.hxx" -#include "anminfo.hxx" -#include "imapinfo.hxx" -#include "drawdoc.hxx" - -SdObjectFactory aSdObjectFactory; - -/************************************************************************* -|* -|* void SdObjectFactory::MakeUserData() -|* -\************************************************************************/ - -IMPL_STATIC_LINK( SdObjectFactory, MakeUserData, SdrObjUserDataCreatorParams, aParams, SdrObjUserData* ) -{ - if ( aParams.nInventor == SdrInventor::StarDrawUserData ) - { - switch( aParams.nObjIdentifier ) - { - case SD_ANIMATIONINFO_ID: - return new SdAnimationInfo( *aParams.pObject ); - break; - - case SD_IMAPINFO_ID: - return new SdIMapInfo; - break; - - default: - break; - } - } - return nullptr; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index 60b7a8b4748c..8b8430d32d56 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -51,7 +51,6 @@ #include "OutlineViewShellBase.hxx" #include "PaneChildWindows.hxx" #include "sdresid.hxx" -#include "sdobjfac.hxx" #include "SpellDialogChildWindow.hxx" #include "SlideSorterViewShell.hxx" #include "SlideSorterViewShellBase.hxx" @@ -287,9 +286,6 @@ void SdDLL::Init() // register css::form::component::Form-Object-Factory FmFormObjFactory(); - // register Object-Factory - SdrObjFactory::InsertMakeUserDataHdl(LINK(&aSdObjectFactory, SdObjectFactory, MakeUserData)); - // register your exotic remote controls here #ifdef ENABLE_SDREMOTE if (!utl::ConfigManager::IsAvoidConfig() && !Application::IsHeadlessModeEnabled()) diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index aed3a7169e4e..f87769814f7d 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -65,14 +65,6 @@ BitmapEx GalleryResGetBitmapEx(const OUString &rId) return aBmpEx; } -IMPL_STATIC_LINK( - SgaUserDataFactory, MakeUserData, SdrObjUserDataCreatorParams, aParams, SdrObjUserData* ) -{ - if ( aParams.nInventor == SdrInventor::SgaImap && aParams.nObjIdentifier == ID_IMAPINFO ) - return new SgaIMapInfo; - return nullptr; -} - GalleryGraphicImportRet GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic, OUString& rFilterName, bool bShowProgress ) { diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index d71a2c4b280b..c5b8013f26a1 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -1245,8 +1245,6 @@ bool GalleryTheme::InsertTransferable( const uno::Reference< datatransfer::XTran if( aModel.GetModel() ) { - SgaUserDataFactory aFactory; - SdrPage* pPage = aModel.GetModel()->GetPage(0); SdrGrafObj* pGrafObj = new SdrGrafObj( *pGraphic ); diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index 00418251e783..2d1061f1a1fe 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -373,12 +373,6 @@ std::vector>& ImpGetUserMakeObjHdl() return rGlobalData.aUserMakeObjHdl; } -std::vector>& ImpGetUserMakeObjUserDataHdl() -{ - SdrGlobalData& rGlobalData=GetSdrGlobalData(); - return rGlobalData.aUserMakeObjUserDataHdl; -} - OUString ImpGetResStr(const char* pResID) { return SvxResId(pResID); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 975af73c5dda..bbb564ed2cb8 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -3282,25 +3282,6 @@ void SdrObjFactory::RemoveMakeObjectHdl(Link co rLL.erase(it); } -void SdrObjFactory::InsertMakeUserDataHdl(Link const & rLink) -{ - std::vector>& rLL=ImpGetUserMakeObjUserDataHdl(); - auto it = std::find(rLL.begin(), rLL.end(), rLink); - if (it != rLL.end()) { - OSL_FAIL("SdrObjFactory::InsertMakeUserDataHdl(): Link already in place."); - } else { - rLL.push_back(rLink); - } -} - -void SdrObjFactory::RemoveMakeUserDataHdl(Link const & rLink) -{ - std::vector>& rLL=ImpGetUserMakeObjUserDataHdl(); - auto it = std::find(rLL.begin(), rLL.end(), rLink); - if (it != rLL.end()) - rLL.erase(it); -} - namespace svx { ISdrObjectFilter::~ISdrObjectFilter() -- cgit