LibreOffice Module svx (master)  1
circleproperties.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  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sal/config.h>
21 
23 #include <svl/itemset.hxx>
24 #include <svl/style.hxx>
25 #include <svx/svddef.hxx>
26 #include <editeng/eeitem.hxx>
27 #include <svx/svdocirc.hxx>
28 #include <sxcikitm.hxx>
29 #include <svx/sxciaitm.hxx>
30 
31 
32 namespace sdr
33 {
34  namespace properties
35  {
36  // create a new itemset
37  std::unique_ptr<SfxItemSet> CircleProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
38  {
39  return std::make_unique<SfxItemSet>(
40  rPool,
41  svl::Items<
42  // Ranges from SdrAttrObj, SdrCircObj
47  // Range from SdrTextObj:
49  }
50 
52  : RectangleProperties(rObj)
53  {
54  }
55 
57  : RectangleProperties(rProps, rObj)
58  {
59  }
60 
62  {
63  }
64 
65  std::unique_ptr<BaseProperties> CircleProperties::Clone(SdrObject& rObj) const
66  {
67  return std::unique_ptr<BaseProperties>(new CircleProperties(*this, rObj));
68  }
69 
71  {
72  SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject());
73 
74  // call parent
76 
77  // local changes
78  rObj.ImpSetAttrToCircInfo();
79  }
80 
81  void CircleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
82  {
83  // call parent (always first thing to do, may create the SfxItemSet)
84  RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
85 
86  // local changes
87  SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject());
88  rObj.SetXPolyDirty();
89 
90  // local changes
91  rObj.ImpSetAttrToCircInfo();
92  }
93 
95  {
96  SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject());
97  SdrCircKind eKind = rObj.GetCircleKind();
98 
99  if(eKind != SdrCircKind::Full)
100  {
101  // force ItemSet
103 
104  mpItemSet->Put(SdrCircKindItem(eKind));
105 
106  if(rObj.GetStartAngle())
107  {
109  }
110 
111  if(rObj.GetEndAngle() != 36000)
112  {
114  }
115  }
116 
117  // call parent after SetObjectItem(SdrCircKindItem())
118  // because ForceDefaultAttr() will call
119  // ImpSetAttrToCircInfo() which needs a correct
120  // SdrCircKindItem
122  }
123  } // end of namespace properties
124 } // end of namespace sdr
125 
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrCircKind
Definition: svdocirc.hxx:39
long GetEndAngle() const
Definition: svdocirc.hxx:141
#define EE_ITEMS_START
long GetStartAngle() const
Definition: svdocirc.hxx:140
SdrCircKind GetCircleKind() const
Definition: svdocirc.hxx:92
virtual const SfxItemSet & GetObjectItemSet() const override
#define SDRATTR_MISC_LAST
Definition: svddef.hxx:220
#define SDRATTR_CIRC_FIRST
Definition: svddef.hxx:260
std::unique_ptr< SfxItemSet > mpItemSet
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
#define SDRATTR_SHADOW_LAST
Definition: svddef.hxx:178
virtual void ItemSetChanged(const SfxItemSet &rSet) override
SdrAngleItem makeSdrCircEndAngleItem(long nAngle)
Definition: sxciaitm.hxx:29
virtual std::unique_ptr< SfxItemSet > CreateObjectSpecificItemSet(SfxItemPool &rPool) override
#define SDRATTR_MISC_FIRST
Definition: svddef.hxx:193
void SetXPolyDirty()
Definition: svdorect.cxx:106
#define SDRATTR_TEXTDIRECTION
Definition: svddef.hxx:302
#define SDRATTR_START
Definition: svddef.hxx:168
Abstract DrawObject.
Definition: svdobj.hxx:312
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr) override
SdrAngleItem makeSdrCircStartAngleItem(long nAngle)
Definition: sxciaitm.hxx:25
SVX_DLLPRIVATE void ImpSetAttrToCircInfo()
Definition: svdocirc.cxx:1093
#define SDRATTR_CIRC_LAST
Definition: svddef.hxx:264
const SdrObject & GetSdrObject() const
Definition: properties.cxx:62
virtual void ItemSetChanged(const SfxItemSet &rSet) override
virtual void ForceDefaultAttributes() override
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr) override
virtual void ForceDefaultAttributes() override
#define EE_ITEMS_END