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
32namespace sdr::properties
33{
34 // create a new itemset
36 {
37 return SfxItemSet(
38 rPool,
40 // Ranges from SdrAttrObj, SdrCircObj
46 // Range from SdrTextObj:
48 }
49
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
74 RectangleProperties::ItemSetChanged(aChangedItems, nDeletedWhich);
75
76 // local changes
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
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: */
Degree100 GetEndAngle() const
Definition: svdocirc.hxx:139
Degree100 GetStartAngle() const
Definition: svdocirc.hxx:138
SVX_DLLPRIVATE void ImpSetAttrToCircInfo()
Definition: svdocirc.cxx:1086
SdrCircKind GetCircleKind() const
Definition: svdocirc.hxx:93
Abstract DrawObject.
Definition: svdobj.hxx:260
void SetXPolyDirty()
Definition: svdorect.cxx:101
virtual const SfxItemSet & GetObjectItemSet() const override
const SdrObject & GetSdrObject() const
Definition: properties.cxx:43
virtual void ForceDefaultAttributes() override
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool &rPool) override
virtual void ItemSetChanged(o3tl::span< const SfxPoolItem *const > aChangedItems, sal_uInt16 nDeletedWhich) override
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast) override
std::optional< SfxItemSet > mxItemSet
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast) override
virtual void ItemSetChanged(o3tl::span< const SfxPoolItem *const > aChangedItems, sal_uInt16 nDeletedWhich) override
virtual void ForceDefaultAttributes() override
constexpr sal_uInt16 EE_ITEMS_END(EE_FEATURE_END)
constexpr sal_uInt16 EE_ITEMS_START(OWN_ATTR_VALUE_END+1)
static constexpr auto Items
constexpr sal_uInt16 SDRATTR_CIRC_LAST(SDRATTR_CIRCENDANGLE)
constexpr sal_uInt16 SDRATTR_CIRC_FIRST(SDRATTR_MEASURE_LAST+1)
constexpr sal_uInt16 SDRATTR_START(XATTR_START)
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_FIRST(SDRATTR_SOFTEDGE_LAST+1)
constexpr sal_uInt16 SDRATTR_MISC_LAST(SDRATTR_TEXT_CLIPVERTOVERFLOW)
constexpr sal_uInt16 SDRATTR_MISC_FIRST(SDRATTR_CAPTION_LAST+1)
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_LAST(SDRATTR_TEXTCOLUMNS_SPACING)
constexpr sal_uInt16 SDRATTR_SHADOW_LAST(SDRATTR_SHADOWALIGNMENT)
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
SdrCircKind
Definition: svdocirc.hxx:38
SdrAngleItem makeSdrCircStartAngleItem(Degree100 nAngle)
Definition: sxciaitm.hxx:25
SdrAngleItem makeSdrCircEndAngleItem(Degree100 nAngle)
Definition: sxciaitm.hxx:30