1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <svdobjplusdata.hxx>
11 #include <svdobjuserdatalist.hxx>
12 #include <o3tl/deleter.hxx>
13 #include <svx/svdglue.hxx>
14 #include <svl/SfxBroadcaster.hxx>
15 #include <osl/diagnose.h>
17 SdrObjPlusData::SdrObjPlusData()
21 SdrObjPlusData::~SdrObjPlusData()
23 o3tl::reset_preserve_ptr_during(pBroadcast
);
24 pUserDataList
.reset();
28 SdrObjPlusData
* SdrObjPlusData::Clone(SdrObject
* pObj1
) const
30 SdrObjPlusData
* pNewPlusData
=new SdrObjPlusData
;
31 if (pUserDataList
!=nullptr) {
32 sal_uInt16 nCount
=pUserDataList
->GetUserDataCount();
34 pNewPlusData
->pUserDataList
.reset(new SdrObjUserDataList
);
35 for (sal_uInt16 i
=0; i
<nCount
; i
++) {
36 std::unique_ptr
<SdrObjUserData
> pNewUserData
=pUserDataList
->GetUserData(i
).Clone(pObj1
);
37 if (pNewUserData
!=nullptr) {
38 pNewPlusData
->pUserDataList
->AppendUserData(std::move(pNewUserData
));
40 OSL_FAIL("SdrObjPlusData::Clone(): UserData.Clone() returns NULL.");
45 if (pGluePoints
!=nullptr) pNewPlusData
->pGluePoints
.reset(new SdrGluePointList(*pGluePoints
));
46 // MtfAnimator isn't copied either
49 // copy object name, title and description
50 pNewPlusData
->aObjName
= aObjName
;
51 pNewPlusData
->aObjTitle
= aObjTitle
;
52 pNewPlusData
->aObjDescription
= aObjDescription
;
53 pNewPlusData
->isDecorative
= isDecorative
;
58 void SdrObjPlusData::SetGluePoints(const SdrGluePointList
& rPts
)
63 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */