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>
11 #include <svdobjuserdatalist.hxx>
12 #include <o3tl/deleter.hxx>
13 #include <svx/svdglue.hxx>
14 #include <svl/SfxBroadcaster.hxx>
15 
17 {
18 }
19 
21 {
23  pUserDataList.reset();
24  pGluePoints.reset();
25 }
26 
28 {
29  SdrObjPlusData* pNewPlusData=new SdrObjPlusData;
30  if (pUserDataList!=nullptr) {
31  sal_uInt16 nCount=pUserDataList->GetUserDataCount();
32  if (nCount!=0) {
33  pNewPlusData->pUserDataList.reset(new SdrObjUserDataList);
34  for (sal_uInt16 i=0; i<nCount; i++) {
35  std::unique_ptr<SdrObjUserData> pNewUserData=pUserDataList->GetUserData(i).Clone(pObj1);
36  if (pNewUserData!=nullptr) {
37  pNewPlusData->pUserDataList->AppendUserData(std::move(pNewUserData));
38  } else {
39  OSL_FAIL("SdrObjPlusData::Clone(): UserData.Clone() returns NULL.");
40  }
41  }
42  }
43  }
44  if (pGluePoints!=nullptr) pNewPlusData->pGluePoints.reset(new SdrGluePointList(*pGluePoints));
45  // MtfAnimator isn't copied either
46 
47  // #i68101#
48  // copy object name, title and description
49  pNewPlusData->aObjName = aObjName;
50  pNewPlusData->aObjTitle = aObjTitle;
51  pNewPlusData->aObjDescription = aObjDescription;
52 
53  return pNewPlusData;
54 }
55 
57 {
58  *pGluePoints = rPts;
59 }
60 
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString aObjDescription
SdrObjPlusData * Clone(SdrObject *pObj1) const
void reset_preserve_ptr_during(uniqueptr &ptr)
int nCount
std::unique_ptr< SfxBroadcaster > pBroadcast
std::unique_ptr< SdrObjUserDataList > pUserDataList
int i
Abstract DrawObject.
Definition: svdobj.hxx:312
void SetGluePoints(const SdrGluePointList &rPts)
std::unique_ptr< SdrGluePointList > pGluePoints