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 .
20 #include <sal/config.h>
22 #include <sdr/properties/captionproperties.hxx>
23 #include <svl/itemset.hxx>
24 #include <svl/style.hxx>
25 #include <svx/svddef.hxx>
26 #include <editeng/eeitem.hxx>
27 #include <svx/svdocapt.hxx>
30 namespace sdr::properties
32 // create a new itemset
33 SfxItemSet
CaptionProperties::CreateObjectSpecificItemSet(SfxItemPool
& rPool
)
38 // Ranges from SdrAttrObj, SdrCaptionObj:
39 SDRATTR_START
, SDRATTR_MISC_LAST
,
40 SDRATTR_TEXTDIRECTION
, SDRATTR_TEXTDIRECTION
,
41 SDRATTR_TEXTCOLUMNS_FIRST
, SDRATTR_TEXTCOLUMNS_LAST
,
42 // Range from SdrTextObj:
43 EE_ITEMS_START
, EE_ITEMS_END
>);
46 CaptionProperties::CaptionProperties(SdrObject
& rObj
)
47 : RectangleProperties(rObj
)
51 CaptionProperties::CaptionProperties(const CaptionProperties
& rProps
, SdrObject
& rObj
)
52 : RectangleProperties(rProps
, rObj
)
56 CaptionProperties::~CaptionProperties()
60 std::unique_ptr
<BaseProperties
> CaptionProperties::Clone(SdrObject
& rObj
) const
62 return std::unique_ptr
<BaseProperties
>(new CaptionProperties(*this, rObj
));
65 void CaptionProperties::ItemSetChanged(std::span
< const SfxPoolItem
* const > aChangedItems
, sal_uInt16 nDeletedWhich
, bool bAdjustTextFrameWidthAndHeight
)
67 SdrCaptionObj
& rObj
= static_cast<SdrCaptionObj
&>(GetSdrObject());
73 RectangleProperties::ItemSetChanged(aChangedItems
, nDeletedWhich
, bAdjustTextFrameWidthAndHeight
);
76 void CaptionProperties::SetStyleSheet(SfxStyleSheet
* pNewStyleSheet
, bool bDontRemoveHardAttr
,
77 bool bBroadcast
, bool bAdjustTextFrameWidthAndHeight
)
79 // call parent (always first thing to do, may create the SfxItemSet)
80 RectangleProperties::SetStyleSheet(pNewStyleSheet
, bDontRemoveHardAttr
, bBroadcast
, bAdjustTextFrameWidthAndHeight
);
83 SdrCaptionObj
& rObj
= static_cast<SdrCaptionObj
&>(GetSdrObject());
87 void CaptionProperties::ForceDefaultAttributes()
90 RectangleProperties::ForceDefaultAttributes();
92 // this was set by TextProperties::ForceDefaultAttributes(),
94 if (static_cast<SdrCaptionObj
&>(GetSdrObject()).GetSpecialTextBoxShadow())
96 moItemSet
->ClearItem(XATTR_FILLCOLOR
);
97 moItemSet
->ClearItem(XATTR_FILLSTYLE
);
99 moItemSet
->ClearItem(XATTR_LINESTYLE
);
101 } // end of namespace
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */