Kaydet (Commit) b6c3afdc authored tarafından Noel Grandin's avatar Noel Grandin

SdrGlobalData::aUserMakeObjUserDataHdl is unused

ever since

    commit ddb1d5eb
    Author: Felix Zhang <fezhang@suse.com>
    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/40363Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c8e8ae88
......@@ -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
......
......@@ -168,7 +168,6 @@ public:
std::vector<Link<SdrObjCreatorParams, SdrObject*>>& ImpGetUserMakeObjHdl();
std::vector<Link<SdrObjUserDataCreatorParams, SdrObjUserData*>>& ImpGetUserMakeObjUserDataHdl();
class SdrOle2Obj;
class AutoTimer;
......@@ -204,8 +203,6 @@ class SVX_DLLPUBLIC SdrGlobalData
public:
std::vector<Link<SdrObjCreatorParams, SdrObject*>>
aUserMakeObjHdl;
std::vector<Link<SdrObjUserDataCreatorParams, SdrObjUserData*>>
aUserMakeObjUserDataHdl;
SdrEngineDefaults* pDefaults;
OLEObjCache aOLEObjCache;
......
......@@ -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<SdrObjCreatorParams, SdrObject*> const & rLink);
static void RemoveMakeObjectHdl(Link<SdrObjCreatorParams, SdrObject*> const & rLink);
static void InsertMakeUserDataHdl(Link<SdrObjUserDataCreatorParams, SdrObjUserData*> const & rLink);
static void RemoveMakeUserDataHdl(Link<SdrObjUserDataCreatorParams, SdrObjUserData*> const & rLink);
private:
static SVX_DLLPRIVATE SdrObject* CreateObjectFromFactory(
......
......@@ -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:
......
......@@ -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;
}
......
......@@ -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 ),
......
......@@ -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 \
......
/* -*- 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 <tools/link.hxx>
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: */
/* -*- 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 <basic/sbx.hxx>
#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: */
......@@ -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())
......
......@@ -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 )
{
......
......@@ -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 );
......
......@@ -373,12 +373,6 @@ std::vector<Link<SdrObjCreatorParams, SdrObject*>>& ImpGetUserMakeObjHdl()
return rGlobalData.aUserMakeObjHdl;
}
std::vector<Link<SdrObjUserDataCreatorParams, SdrObjUserData*>>& ImpGetUserMakeObjUserDataHdl()
{
SdrGlobalData& rGlobalData=GetSdrGlobalData();
return rGlobalData.aUserMakeObjUserDataHdl;
}
OUString ImpGetResStr(const char* pResID)
{
return SvxResId(pResID);
......
......@@ -3282,25 +3282,6 @@ void SdrObjFactory::RemoveMakeObjectHdl(Link<SdrObjCreatorParams, SdrObject*> co
rLL.erase(it);
}
void SdrObjFactory::InsertMakeUserDataHdl(Link<SdrObjUserDataCreatorParams, SdrObjUserData*> const & rLink)
{
std::vector<Link<SdrObjUserDataCreatorParams, SdrObjUserData*>>& 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<SdrObjUserDataCreatorParams, SdrObjUserData*> const & rLink)
{
std::vector<Link<SdrObjUserDataCreatorParams, SdrObjUserData*>>& rLL=ImpGetUserMakeObjUserDataHdl();
auto it = std::find(rLL.begin(), rLL.end(), rLink);
if (it != rLL.end())
rLL.erase(it);
}
namespace svx
{
ISdrObjectFilter::~ISdrObjectFilter()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment