1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <svx/svdoattr.hxx>
22 #include <svx/xpool.hxx>
23 #include <svx/svdmodel.hxx>
24 #include <svx/svdpage.hxx>
25 #include <svx/svdpool.hxx>
26 #include <svx/svdotext.hxx>
27 #include <svx/svdocapt.hxx>
28 #include <svx/svdograf.hxx>
29 #include <svx/svdoole2.hxx>
30 #include <svx/svdorect.hxx>
31 #include <svx/svdocirc.hxx>
32 #include <svx/svdomeas.hxx>
33 #include <svl/hint.hxx>
34 #include <svl/itemiter.hxx>
35 #include <svx/xenum.hxx>
36 #include <svx/xlineit0.hxx>
37 #include <svx/xlnstwit.hxx>
38 #include <svx/xlnedwit.hxx>
39 #include <svx/xfillit0.hxx>
40 #include <svx/xflbmtit.hxx>
41 #include <svx/xtextit0.hxx>
42 #include <svx/xflbstit.hxx>
43 #include <svx/xflbtoxy.hxx>
44 #include <svx/xftshit.hxx>
46 #include <editeng/editdata.hxx>
47 #include <editeng/colritem.hxx>
48 #include <editeng/fontitem.hxx>
49 #include <editeng/fhgtitem.hxx>
51 #include <svx/xlnstcit.hxx>
52 #include <svx/xlnwtit.hxx>
53 #include <svl/style.hxx>
54 #include <svl/whiter.hxx>
55 #include <svx/xlnclit.hxx>
56 #include <svx/xflclit.hxx>
57 #include <svx/xlntrit.hxx>
58 #include <svx/xfltrit.hxx>
59 #include <svx/xlnedcit.hxx>
60 #include <editeng/adjustitem.hxx>
61 #include <svx/xflbckit.hxx>
62 #include <svx/xtable.hxx>
63 #include <svx/xbtmpit.hxx>
64 #include <svx/xlndsit.hxx>
65 #include <svx/xlnedit.hxx>
66 #include <svx/xflgrit.hxx>
67 #include <svx/xflftrit.hxx>
68 #include <svx/xflhtit.hxx>
69 #include <svx/xlnstit.hxx>
70 #include <sdr/properties/attributeproperties.hxx>
71 #include <basegfx/polygon/b2dpolygon.hxx>
72 #include <svx/xlinjoit.hxx>
74 using namespace com::sun::star
;
76 std::unique_ptr
<sdr::properties::BaseProperties
> SdrAttrObj::CreateObjectSpecificProperties()
78 return std::make_unique
<sdr::properties::AttributeProperties
>(*this);
82 SdrAttrObj::SdrAttrObj(SdrModel
& rSdrModel
)
83 : SdrObject(rSdrModel
)
87 SdrAttrObj::~SdrAttrObj()
91 const tools::Rectangle
& SdrAttrObj::GetSnapRect() const
95 const_cast<SdrAttrObj
*>(this)->RecalcSnapRect();
96 const_cast<SdrAttrObj
*>(this)->bSnapRectDirty
= false;
102 // syntactical sugar for ItemSet accesses
103 void SdrAttrObj::Notify(SfxBroadcaster
& /*rBC*/, const SfxHint
& rHint
)
105 bool bDataChg(SfxHintId::DataChanged
== rHint
.GetId());
109 tools::Rectangle aBoundRect
= GetLastBoundRect();
113 // This may have led to object change
115 BroadcastObjectChange();
116 SendUserCall(SdrUserCallType::ChangeAttr
, aBoundRect
);
120 sal_Int32
SdrAttrObj::ImpGetLineWdt() const
122 sal_Int32
nRetval(0);
124 if(drawing::LineStyle_NONE
!= GetObjectItem(XATTR_LINESTYLE
).GetValue())
126 nRetval
= GetObjectItem(XATTR_LINEWIDTH
).GetValue();
132 bool SdrAttrObj::HasFill() const
134 return bClosedObj
&& GetProperties().GetObjectItemSet().Get(XATTR_FILLSTYLE
).GetValue() != drawing::FillStyle_NONE
;
137 bool SdrAttrObj::HasLine() const
139 return GetProperties().GetObjectItemSet().Get(XATTR_LINESTYLE
).GetValue() != drawing::LineStyle_NONE
;
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */