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
31 {
32  namespace properties
33  {
34  // create a new itemset
35  std::unique_ptr<SfxItemSet> CaptionProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
36  {
37  return std::make_unique<SfxItemSet>(
38  rPool,
39  svl::Items<
40  // Ranges from SdrAttrObj, SdrCaptionObj:
43  // Range from SdrTextObj:
45  }
46 
48  : RectangleProperties(rObj)
49  {
50  }
51 
53  : RectangleProperties(rProps, rObj)
54  {
55  }
56 
58  {
59  }
60 
61  std::unique_ptr<BaseProperties> CaptionProperties::Clone(SdrObject& rObj) const
62  {
63  return std::unique_ptr<BaseProperties>(new CaptionProperties(*this, rObj));
64  }
65 
67  {
68  SdrCaptionObj& rObj = static_cast<SdrCaptionObj&>(GetSdrObject());
69 
70  // local changes
71  rObj.ImpRecalcTail();
72 
73  // call parent
75  }
76 
77  void CaptionProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
78  {
79  // call parent (always first thing to do, may create the SfxItemSet)
80  RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
81 
82  // local changes
83  SdrCaptionObj& rObj = static_cast<SdrCaptionObj&>(GetSdrObject());
84  rObj.ImpRecalcTail();
85  }
86 
88  {
89  // call parent
91 
92  // force ItemSet
94 
95  // this was set by TextProperties::ForceDefaultAttributes(),
96  // reset to default
97  mpItemSet->ClearItem(XATTR_LINESTYLE);
98  }
99  } // end of namespace properties
100 } // end of namespace sdr
101 
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define EE_ITEMS_START
virtual void ItemSetChanged(const SfxItemSet &rSet) override
virtual const SfxItemSet & GetObjectItemSet() const override
#define SDRATTR_MISC_LAST
Definition: svddef.hxx:220
std::unique_ptr< SfxItemSet > mpItemSet
virtual std::unique_ptr< SfxItemSet > CreateObjectSpecificItemSet(SfxItemPool &rPool) override
virtual void ItemSetChanged(const SfxItemSet &rSet) override
virtual void ForceDefaultAttributes() override
SVX_DLLPRIVATE void ImpRecalcTail()
Definition: svdocapt.cxx:429
#define SDRATTR_TEXTDIRECTION
Definition: svddef.hxx:302
#define XATTR_LINESTYLE
Definition: xdef.hxx:90
#define SDRATTR_START
Definition: svddef.hxx:168
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr) override
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
Abstract DrawObject.
Definition: svdobj.hxx:312
const SdrObject & GetSdrObject() const
Definition: properties.cxx:62
virtual void ForceDefaultAttributes() override
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr) override
#define EE_ITEMS_END