LibreOffice Module svx (master)  1
captionproperties.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/svdocapt.hxx>
28 
29 
30 namespace sdr::properties
31 {
32  // create a new itemset
34  {
35  return SfxItemSet(
36  rPool,
37  svl::Items<
38  // Ranges from SdrAttrObj, SdrCaptionObj:
42  // Range from SdrTextObj:
44  }
45 
47  : RectangleProperties(rObj)
48  {
49  }
50 
52  : RectangleProperties(rProps, rObj)
53  {
54  }
55 
57  {
58  }
59 
60  std::unique_ptr<BaseProperties> CaptionProperties::Clone(SdrObject& rObj) const
61  {
62  return std::unique_ptr<BaseProperties>(new CaptionProperties(*this, rObj));
63  }
64 
66  {
67  SdrCaptionObj& rObj = static_cast<SdrCaptionObj&>(GetSdrObject());
68 
69  // local changes
70  rObj.ImpRecalcTail();
71 
72  // call parent
74  }
75 
76  void CaptionProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
77  {
78  // call parent (always first thing to do, may create the SfxItemSet)
79  RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
80 
81  // local changes
82  SdrCaptionObj& rObj = static_cast<SdrCaptionObj&>(GetSdrObject());
83  rObj.ImpRecalcTail();
84  }
85 
87  {
88  // call parent
90 
91  // force ItemSet
93 
94  // this was set by TextProperties::ForceDefaultAttributes(),
95  // reset to default
96  mxItemSet->ClearItem(XATTR_LINESTYLE);
97  }
98 } // end of namespace
99 
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_LAST(SDRATTR_TEXTCOLUMNS_SPACING)
static constexpr auto Items
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_FIRST(SDRATTR_SOFTEDGE_LAST+1)
constexpr sal_uInt16 EE_ITEMS_END(EE_FEATURE_END)
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
virtual void ItemSetChanged(const SfxItemSet *) override
virtual const SfxItemSet & GetObjectItemSet() const override
constexpr sal_uInt16 SDRATTR_MISC_LAST(SDRATTR_TEXT_CHAINNEXTNAME)
constexpr sal_uInt16 SDRATTR_START(XATTR_START)
virtual void ForceDefaultAttributes() override
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
SVX_DLLPRIVATE void ImpRecalcTail()
Definition: svdocapt.cxx:408
virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool &rPool) override
constexpr sal_uInt16 EE_ITEMS_START(OWN_ATTR_VALUE_END+1)
virtual void ItemSetChanged(const SfxItemSet *) override
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr) override
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
Abstract DrawObject.
Definition: svdobj.hxx:259
std::optional< SfxItemSet > mxItemSet
const SdrObject & GetSdrObject() const
Definition: properties.cxx:59
virtual void ForceDefaultAttributes() override
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr) override