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 
69  void CircleProperties::ItemSetChanged(o3tl::span< const SfxPoolItem* const > aChangedItems, sal_uInt16 nDeletedWhich)
70  {
71  SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject());
72 
73  // call parent
74  RectangleProperties::ItemSetChanged(aChangedItems, nDeletedWhich);
75 
76  // local changes
77  rObj.ImpSetAttrToCircInfo();
78  }
79 
80  void CircleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr,
81  bool bBroadcast)
82  {
83  // call parent (always first thing to do, may create the SfxItemSet)
84  RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, bBroadcast);
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  mxItemSet->Put(SdrCircKindItem(eKind));
105 
106  if(rObj.GetStartAngle())
107  {
109  }
110 
111  if(rObj.GetEndAngle() != 36000_deg100)
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
124 
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrCircKind
Definition: svdocirc.hxx:38
Degree100 GetStartAngle() const
Definition: svdocirc.hxx:138
virtual void ItemSetChanged(o3tl::span< const SfxPoolItem *const > aChangedItems, sal_uInt16 nDeletedWhich) override
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_LAST(SDRATTR_TEXTCOLUMNS_SPACING)
static constexpr auto Items
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
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast) 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(o3tl::span< const SfxPoolItem *const > aChangedItems, sal_uInt16 nDeletedWhich) override
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast) override
void SetXPolyDirty()
Definition: svdorect.cxx:101
constexpr sal_uInt16 EE_ITEMS_START(OWN_ATTR_VALUE_END+1)
Abstract DrawObject.
Definition: svdobj.hxx:260
SdrAngleItem makeSdrCircStartAngleItem(Degree100 nAngle)
Definition: sxciaitm.hxx:25
constexpr sal_uInt16 SDRATTR_SHADOW_LAST(SDRATTR_SHADOWBLUR)
SVX_DLLPRIVATE void ImpSetAttrToCircInfo()
Definition: svdocirc.cxx:1083
std::optional< SfxItemSet > mxItemSet
const SdrObject & GetSdrObject() const
Definition: properties.cxx:43
virtual void ForceDefaultAttributes() override
SdrAngleItem makeSdrCircEndAngleItem(Degree100 nAngle)
Definition: sxciaitm.hxx:30
constexpr sal_uInt16 SDRATTR_MISC_FIRST(SDRATTR_CAPTION_LAST+1)
constexpr sal_uInt16 SDRATTR_CIRC_FIRST(SDRATTR_MEASURE_LAST+1)
virtual void ForceDefaultAttributes() override