LibreOffice Module svx (master) 1
svdobjplusdata.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3* This file is part of the LibreOffice project.
4*
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/.
8*/
9
10#include <svdobjplusdata.hxx>
12#include <o3tl/deleter.hxx>
13#include <svx/svdglue.hxx>
15#include <osl/diagnose.h>
16
18{
19}
20
22{
24 pUserDataList.reset();
25 pGluePoints.reset();
26}
27
29{
30 SdrObjPlusData* pNewPlusData=new SdrObjPlusData;
31 if (pUserDataList!=nullptr) {
32 sal_uInt16 nCount=pUserDataList->GetUserDataCount();
33 if (nCount!=0) {
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));
39 } else {
40 OSL_FAIL("SdrObjPlusData::Clone(): UserData.Clone() returns NULL.");
41 }
42 }
43 }
44 }
45 if (pGluePoints!=nullptr) pNewPlusData->pGluePoints.reset(new SdrGluePointList(*pGluePoints));
46 // MtfAnimator isn't copied either
47
48 // #i68101#
49 // copy object name, title and description
50 pNewPlusData->aObjName = aObjName;
51 pNewPlusData->aObjTitle = aObjTitle;
52 pNewPlusData->aObjDescription = aObjDescription;
53 pNewPlusData->isDecorative = isDecorative;
54
55 return pNewPlusData;
56}
57
59{
60 *pGluePoints = rPts;
61}
62
63/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrObjPlusData * Clone(SdrObject *pObj1) const
std::unique_ptr< SdrGluePointList > pGluePoints
void SetGluePoints(const SdrGluePointList &rPts)
std::unique_ptr< SfxBroadcaster > pBroadcast
std::unique_ptr< SdrObjUserDataList > pUserDataList
OUString aObjDescription
Abstract DrawObject.
Definition: svdobj.hxx:260
int nCount
int i
void reset_preserve_ptr_during(uniqueptr &ptr)