diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/Library_svxcore.mk | 2 | ||||
-rw-r--r-- | svx/source/inc/svdobjplusdata.hxx | 47 | ||||
-rw-r--r-- | svx/source/inc/svdobjuserdatalist.hxx | 36 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 1 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 97 | ||||
-rw-r--r-- | svx/source/svdraw/svdobjplusdata.cxx | 67 | ||||
-rw-r--r-- | svx/source/svdraw/svdobjuserdatalist.cxx | 35 |
7 files changed, 191 insertions, 94 deletions
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 23cb969a978a..420a6b8c4487 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -303,6 +303,8 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/svdraw/svdoashp \ svx/source/svdraw/svdoattr \ svx/source/svdraw/svdobj \ + svx/source/svdraw/svdobjplusdata \ + svx/source/svdraw/svdobjuserdatalist \ svx/source/svdraw/svdocapt \ svx/source/svdraw/svdocirc \ svx/source/svdraw/svdoedge \ diff --git a/svx/source/inc/svdobjplusdata.hxx b/svx/source/inc/svdobjplusdata.hxx new file mode 100644 index 000000000000..289f64b2560f --- /dev/null +++ b/svx/source/inc/svdobjplusdata.hxx @@ -0,0 +1,47 @@ +/* -*- 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/. +*/ + +#ifndef INCLUDED_SVX_SVDOBJPLUSDATA_HXX +#define INCLUDED_SVX_SVDOBJPLUSDATA_HXX + +#include <tools/rtti.hxx> +#include <rtl/ustring.hxx> + +class SdrObject; +class SfxBroadcaster; +class SdrObjUserDataList; +class SdrGluePointList; + +// Bitsack for DrawObjects +class SdrObjPlusData +{ + friend class SdrObject; + + SfxBroadcaster* pBroadcast; // broadcaster, if this object is referenced (bVirtObj=true). Also for connectors etc. + SdrObjUserDataList* pUserDataList; // application specific data + SdrGluePointList* pGluePoints; // glue points for glueing object connectors + + // #i68101# + // object name, title and description + OUString aObjName; + OUString aObjTitle; + OUString aObjDescription; + +public: + TYPEINFO(); + SdrObjPlusData(); + virtual ~SdrObjPlusData(); + virtual SdrObjPlusData* Clone(SdrObject* pObj1) const; + + void SetGluePoints(const SdrGluePointList& rPts); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/inc/svdobjuserdatalist.hxx b/svx/source/inc/svdobjuserdatalist.hxx new file mode 100644 index 000000000000..b13b640fa310 --- /dev/null +++ b/svx/source/inc/svdobjuserdatalist.hxx @@ -0,0 +1,36 @@ +/* -*- 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/. +*/ + +#ifndef INCLUDED_SVX_SVDOBJUSERDATALIST_HXX +#define INCLUDED_SVX_SVDOBJUSERDATALIST_HXX + +#include <svx/svdobj.hxx> + +#include <boost/ptr_container/ptr_vector.hpp> + +class SdrObjUserData; + +class SdrObjUserDataList +{ + typedef boost::ptr_vector<SdrObjUserData> ListType; + ListType maList; + +public: + SdrObjUserDataList(); + ~SdrObjUserDataList(); + + size_t GetUserDataCount() const; + SdrObjUserData* GetUserData(size_t nNum); + void AppendUserData(SdrObjUserData* pData); + void DeleteUserData(size_t nNum); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index d7efb5de2998..60910e124b97 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -80,6 +80,7 @@ #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/tools/unotools.hxx> #include "svdconv.hxx" +#include <svdobjplusdata.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index d5f0c6ed8119..a683ab2ed767 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -129,8 +129,10 @@ #include <svx/xpoly.hxx> #include <rtl/strbuf.hxx> #include <svdoopengl.hxx> +#include <svdobjplusdata.hxx> +#include <svdobjuserdatalist.hxx> + #include <boost/scoped_ptr.hpp> -#include <boost/ptr_container/ptr_vector.hpp> using namespace ::com::sun::star; @@ -225,47 +227,6 @@ OUString SdrObjUserData::GetMacroPopupComment(const SdrObjMacroHitRec& /*rRec*/, return OUString(); } -class SdrObjUserDataList -{ - typedef boost::ptr_vector<SdrObjUserData> ListType; - ListType maList; - -public: - SdrObjUserDataList(); - ~SdrObjUserDataList(); - - size_t GetUserDataCount() const; - SdrObjUserData* GetUserData(size_t nNum); - void AppendUserData(SdrObjUserData* pData); - void DeleteUserData(size_t nNum); -}; - -SdrObjUserDataList::SdrObjUserDataList() {} -SdrObjUserDataList::~SdrObjUserDataList() {} - -size_t SdrObjUserDataList::GetUserDataCount() const -{ - return static_cast<sal_uInt16>(maList.size()); -} - -SdrObjUserData* SdrObjUserDataList::GetUserData(size_t nNum) -{ - return &maList.at(nNum); -} - -void SdrObjUserDataList::AppendUserData(SdrObjUserData* pData) -{ - maList.push_back(pData); -} - -void SdrObjUserDataList::DeleteUserData(size_t nNum) -{ - maList.erase(maList.begin()+nNum); -} - - - - SdrObjGeoData::SdrObjGeoData(): pGPL(NULL), bMovProt(false), @@ -282,58 +243,6 @@ SdrObjGeoData::~SdrObjGeoData() delete pGPL; } - - -TYPEINIT0(SdrObjPlusData); - -SdrObjPlusData::SdrObjPlusData(): - pBroadcast(NULL), - pUserDataList(NULL), - pGluePoints(NULL) -{ -} - -SdrObjPlusData::~SdrObjPlusData() -{ - delete pBroadcast; - delete pUserDataList; - delete pGluePoints; -} - -SdrObjPlusData* SdrObjPlusData::Clone(SdrObject* pObj1) const -{ - SdrObjPlusData* pNeuPlusData=new SdrObjPlusData; - if (pUserDataList!=NULL) { - sal_uInt16 nAnz=pUserDataList->GetUserDataCount(); - if (nAnz!=0) { - pNeuPlusData->pUserDataList=new SdrObjUserDataList; - for (sal_uInt16 i=0; i<nAnz; i++) { - SdrObjUserData* pNeuUserData=pUserDataList->GetUserData(i)->Clone(pObj1); - if (pNeuUserData!=NULL) { - pNeuPlusData->pUserDataList->AppendUserData(pNeuUserData); - } else { - OSL_FAIL("SdrObjPlusData::Clone(): UserData.Clone() returns NULL."); - } - } - } - } - if (pGluePoints!=NULL) pNeuPlusData->pGluePoints=new SdrGluePointList(*pGluePoints); - // MtfAnimator isn't copied either - - // #i68101# - // copy object name, title and description - pNeuPlusData->aObjName = aObjName; - pNeuPlusData->aObjTitle = aObjTitle; - pNeuPlusData->aObjDescription = aObjDescription; - - return pNeuPlusData; -} - -void SdrObjPlusData::SetGluePoints(const SdrGluePointList& rPts) -{ - return *pGluePoints = rPts; -} - SdrObjTransformInfoRec::SdrObjTransformInfoRec() : bSelectAllowed(true), bMoveAllowed(true), diff --git a/svx/source/svdraw/svdobjplusdata.cxx b/svx/source/svdraw/svdobjplusdata.cxx new file mode 100644 index 000000000000..b9d7da8423cc --- /dev/null +++ b/svx/source/svdraw/svdobjplusdata.cxx @@ -0,0 +1,67 @@ +/* -*- 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/. +*/ + +#include <svdobjplusdata.hxx> +#include <svdobjuserdatalist.hxx> + +#include <svx/svdglue.hxx> + +#include <svl/SfxBroadcaster.hxx> + +TYPEINIT0(SdrObjPlusData); + +SdrObjPlusData::SdrObjPlusData(): + pBroadcast(NULL), + pUserDataList(NULL), + pGluePoints(NULL) +{ +} + +SdrObjPlusData::~SdrObjPlusData() +{ + delete pBroadcast; + delete pUserDataList; + delete pGluePoints; +} + +SdrObjPlusData* SdrObjPlusData::Clone(SdrObject* pObj1) const +{ + SdrObjPlusData* pNeuPlusData=new SdrObjPlusData; + if (pUserDataList!=NULL) { + sal_uInt16 nAnz=pUserDataList->GetUserDataCount(); + if (nAnz!=0) { + pNeuPlusData->pUserDataList=new SdrObjUserDataList; + for (sal_uInt16 i=0; i<nAnz; i++) { + SdrObjUserData* pNeuUserData=pUserDataList->GetUserData(i)->Clone(pObj1); + if (pNeuUserData!=NULL) { + pNeuPlusData->pUserDataList->AppendUserData(pNeuUserData); + } else { + OSL_FAIL("SdrObjPlusData::Clone(): UserData.Clone() returns NULL."); + } + } + } + } + if (pGluePoints!=NULL) pNeuPlusData->pGluePoints=new SdrGluePointList(*pGluePoints); + // MtfAnimator isn't copied either + + // #i68101# + // copy object name, title and description + pNeuPlusData->aObjName = aObjName; + pNeuPlusData->aObjTitle = aObjTitle; + pNeuPlusData->aObjDescription = aObjDescription; + + return pNeuPlusData; +} + +void SdrObjPlusData::SetGluePoints(const SdrGluePointList& rPts) +{ + return *pGluePoints = rPts; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdobjuserdatalist.cxx b/svx/source/svdraw/svdobjuserdatalist.cxx new file mode 100644 index 000000000000..c7d24ddb8a58 --- /dev/null +++ b/svx/source/svdraw/svdobjuserdatalist.cxx @@ -0,0 +1,35 @@ +/* -*- 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/. +*/ + +#include <svdobjuserdatalist.hxx> + +SdrObjUserDataList::SdrObjUserDataList() {} +SdrObjUserDataList::~SdrObjUserDataList() {} + +size_t SdrObjUserDataList::GetUserDataCount() const +{ + return maList.size(); +} + +SdrObjUserData* SdrObjUserDataList::GetUserData(size_t nNum) +{ + return &maList.at(nNum); +} + +void SdrObjUserDataList::AppendUserData(SdrObjUserData* pData) +{ + maList.push_back(pData); +} + +void SdrObjUserDataList::DeleteUserData(size_t nNum) +{ + maList.erase(maList.begin()+nNum); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |