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
36  {
37  return SfxItemSet(
38  rPool,
39  svl::Items<
40  // Ranges from SdrAttrObj, SdrCircObj
46  // Range from SdrTextObj:
48  }
49 
51  : RectangleProperties(rObj)
52  {
53  }
54 
56  : RectangleProperties(rProps, rObj)
57  {
58  }
59 
61  {
62  }
63 
64  std::unique_ptr<BaseProperties> CircleProperties::Clone(SdrObject& rObj) const
65  {
66  return std::unique_ptr<BaseProperties>(new CircleProperties(*this, rObj));
67  }
68 
70  {
71  SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject());
72 
73  // call parent
75 
76  // local changes
77  rObj.ImpSetAttrToCircInfo();
78  }
79 
80  void CircleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
81  {
82  // call parent (always first thing to do, may create the SfxItemSet)
83  RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
84 
85  // local changes
86  SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject());
87  rObj.SetXPolyDirty();
88 
89  // local changes
90  rObj.ImpSetAttrToCircInfo();
91  }
92 
94  {
95  SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject());
96  SdrCircKind eKind = rObj.GetCircleKind();
97 
98  if(eKind != SdrCircKind::Full)
99  {
100  // force ItemSet
102 
103  mxItemSet->Put(SdrCircKindItem(eKind));
104 
105  if(rObj.GetStartAngle())
106  {
108  }
109 
110  if(rObj.GetEndAngle() != 36000_deg100)
111  {
113  }
114  }
115 
116  // call parent after SetObjectItem(SdrCircKindItem())
117  // because ForceDefaultAttr() will call
118  // ImpSetAttrToCircInfo() which needs a correct
119  // SdrCircKindItem
121  }
122 } // end of namespace
123 
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrCircKind
Definition: svdocirc.hxx:38
Degree100 GetStartAngle() const
Definition: svdocirc.hxx:138
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_LAST(SDRATTR_TEXTCOLUMNS_SPACING)
virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool &rPool) override
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_FIRST(SDRATTR_SOFTEDGE_LAST+1)
constexpr sal_uInt16 EE_ITEMS_END(EE_FEATURE_END)
SdrCircKind GetCircleKind() const
Definition: svdocirc.hxx:93
virtual const SfxItemSet & GetObjectItemSet() const override
constexpr sal_uInt16 SDRATTR_MISC_LAST(SDRATTR_TEXT_CHAINNEXTNAME)
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
constexpr sal_uInt16 SDRATTR_START(XATTR_START)
Degree100 GetEndAngle() const
Definition: svdocirc.hxx:139
constexpr sal_uInt16 SDRATTR_CIRC_LAST(SDRATTR_CIRCENDANGLE)
virtual void ItemSetChanged(const SfxItemSet &rSet) override
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
void SetXPolyDirty()
Definition: svdorect.cxx:105
constexpr sal_uInt16 EE_ITEMS_START(OWN_ATTR_VALUE_END+1)
Abstract DrawObject.
Definition: svdobj.hxx:258
SdrAngleItem makeSdrCircStartAngleItem(Degree100 nAngle)
Definition: sxciaitm.hxx:25
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr) override
constexpr sal_uInt16 SDRATTR_SHADOW_LAST(SDRATTR_SHADOWBLUR)
SVX_DLLPRIVATE void ImpSetAttrToCircInfo()
Definition: svdocirc.cxx:1078
std::optional< SfxItemSet > mxItemSet
const SdrObject & GetSdrObject() const
Definition: properties.cxx:59
virtual void ItemSetChanged(const SfxItemSet &rSet) override
virtual void ForceDefaultAttributes() override
SdrAngleItem makeSdrCircEndAngleItem(Degree100 nAngle)
Definition: sxciaitm.hxx:30
constexpr sal_uInt16 SDRATTR_MISC_FIRST(SDRATTR_CAPTION_LAST+1)
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr) override
constexpr sal_uInt16 SDRATTR_CIRC_FIRST(SDRATTR_MEASURE_LAST+1)
virtual void ForceDefaultAttributes() override