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::properties
33 {
34  // create a new itemset
35  std::unique_ptr<SfxItemSet> CircleProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
36  {
37  return std::make_unique<SfxItemSet>(
38  rPool,
39  svl::Items<
40  // Ranges from SdrAttrObj, SdrCircObj
45  // Range from SdrTextObj:
47  }
48 
50  : RectangleProperties(rObj)
51  {
52  }
53 
55  : RectangleProperties(rProps, rObj)
56  {
57  }
58 
60  {
61  }
62 
63  std::unique_ptr<BaseProperties> CircleProperties::Clone(SdrObject& rObj) const
64  {
65  return std::unique_ptr<BaseProperties>(new CircleProperties(*this, rObj));
66  }
67 
69  {
70  SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject());
71 
72  // call parent
74 
75  // local changes
76  rObj.ImpSetAttrToCircInfo();
77  }
78 
79  void CircleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
80  {
81  // call parent (always first thing to do, may create the SfxItemSet)
82  RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
83 
84  // local changes
85  SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject());
86  rObj.SetXPolyDirty();
87 
88  // local changes
89  rObj.ImpSetAttrToCircInfo();
90  }
91 
93  {
94  SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject());
95  SdrCircKind eKind = rObj.GetCircleKind();
96 
97  if(eKind != SdrCircKind::Full)
98  {
99  // force ItemSet
101 
102  mpItemSet->Put(SdrCircKindItem(eKind));
103 
104  if(rObj.GetStartAngle())
105  {
107  }
108 
109  if(rObj.GetEndAngle() != 36000)
110  {
112  }
113  }
114 
115  // call parent after SetObjectItem(SdrCircKindItem())
116  // because ForceDefaultAttr() will call
117  // ImpSetAttrToCircInfo() which needs a correct
118  // SdrCircKindItem
120  }
121 } // end of namespace
122 
123 /* 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:60
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