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 <svx/sdr/properties/graphicproperties.hxx>
21 #include <svl/itemset.hxx>
22 #include <svl/style.hxx>
23 #include <svx/svddef.hxx>
24 #include <editeng/eeitem.hxx>
25 #include <svx/svdograf.hxx>
26 #include <svx/sdgcpitm.hxx>
28 //////////////////////////////////////////////////////////////////////////////
34 // create a new itemset
35 SfxItemSet
& GraphicProperties::CreateObjectSpecificItemSet(SfxItemPool
& rPool
)
37 return *(new SfxItemSet(rPool
,
39 // range from SdrAttrObj
40 SDRATTR_START
, SDRATTR_SHADOW_LAST
,
41 SDRATTR_MISC_FIRST
, SDRATTR_MISC_LAST
,
42 SDRATTR_TEXTDIRECTION
, SDRATTR_TEXTDIRECTION
,
44 // range from SdrGrafObj
45 SDRATTR_GRAF_FIRST
, SDRATTR_GRAF_LAST
,
47 // range from SdrTextObj
48 EE_ITEMS_START
, EE_ITEMS_END
,
54 GraphicProperties::GraphicProperties(SdrObject
& rObj
)
55 : RectangleProperties(rObj
)
59 GraphicProperties::GraphicProperties(const GraphicProperties
& rProps
, SdrObject
& rObj
)
60 : RectangleProperties(rProps
, rObj
)
64 GraphicProperties::~GraphicProperties()
68 BaseProperties
& GraphicProperties::Clone(SdrObject
& rObj
) const
70 return *(new GraphicProperties(*this, rObj
));
73 void GraphicProperties::ItemSetChanged(const SfxItemSet
& rSet
)
75 SdrGrafObj
& rObj
= (SdrGrafObj
&)GetSdrObject();
80 // #i29367# Update GraphicAttr, too. This was formerly
81 // triggered by SdrGrafObj::Notify, which is no longer
82 // called nowadays. BTW: strictly speaking, the whole
83 // ImpSetAttrToGrafInfostuff could
84 // be dumped, when SdrGrafObj::aGrafInfo is removed and
85 // always created on the fly for repaint.
86 rObj
.ImpSetAttrToGrafInfo();
89 RectangleProperties::ItemSetChanged(rSet
);
92 void GraphicProperties::SetStyleSheet(SfxStyleSheet
* pNewStyleSheet
, sal_Bool bDontRemoveHardAttr
)
94 SdrGrafObj
& rObj
= (SdrGrafObj
&)GetSdrObject();
100 RectangleProperties::SetStyleSheet(pNewStyleSheet
, bDontRemoveHardAttr
);
103 rObj
.ImpSetAttrToGrafInfo();
106 void GraphicProperties::ForceDefaultAttributes()
109 RectangleProperties::ForceDefaultAttributes();
114 mpItemSet
->Put( SdrGrafLuminanceItem( 0 ) );
115 mpItemSet
->Put( SdrGrafContrastItem( 0 ) );
116 mpItemSet
->Put( SdrGrafRedItem( 0 ) );
117 mpItemSet
->Put( SdrGrafGreenItem( 0 ) );
118 mpItemSet
->Put( SdrGrafBlueItem( 0 ) );
119 mpItemSet
->Put( SdrGrafGamma100Item( 100 ) );
120 mpItemSet
->Put( SdrGrafTransparenceItem( 0 ) );
121 mpItemSet
->Put( SdrGrafInvertItem( sal_False
) );
122 mpItemSet
->Put( SdrGrafModeItem( GRAPHICDRAWMODE_STANDARD
) );
123 mpItemSet
->Put( SdrGrafCropItem( 0, 0, 0, 0 ) );
125 } // end of namespace properties
126 } // end of namespace sdr
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */