1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: graphicproperties.cxx,v $
10 * $Revision: 1.12.76.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
33 #include <svx/sdr/properties/graphicproperties.hxx>
34 #include <svtools/itemset.hxx>
35 #include <svtools/style.hxx>
36 #include <svx/svddef.hxx>
37 #include <svx/eeitem.hxx>
38 #include <svx/svdograf.hxx>
39 #include <svx/sdgcpitm.hxx>
41 //////////////////////////////////////////////////////////////////////////////
47 // create a new itemset
48 SfxItemSet
& GraphicProperties::CreateObjectSpecificItemSet(SfxItemPool
& rPool
)
50 return *(new SfxItemSet(rPool
,
52 // range from SdrAttrObj
53 SDRATTR_START
, SDRATTR_SHADOW_LAST
,
54 SDRATTR_MISC_FIRST
, SDRATTR_MISC_LAST
,
55 SDRATTR_TEXTDIRECTION
, SDRATTR_TEXTDIRECTION
,
57 // range from SdrGrafObj
58 SDRATTR_GRAF_FIRST
, SDRATTR_GRAF_LAST
,
60 // range from SdrTextObj
61 EE_ITEMS_START
, EE_ITEMS_END
,
67 GraphicProperties::GraphicProperties(SdrObject
& rObj
)
68 : RectangleProperties(rObj
)
72 GraphicProperties::GraphicProperties(const GraphicProperties
& rProps
, SdrObject
& rObj
)
73 : RectangleProperties(rProps
, rObj
)
77 GraphicProperties::~GraphicProperties()
81 BaseProperties
& GraphicProperties::Clone(SdrObject
& rObj
) const
83 return *(new GraphicProperties(*this, rObj
));
86 void GraphicProperties::ItemSetChanged(const SfxItemSet
& rSet
)
88 SdrGrafObj
& rObj
= (SdrGrafObj
&)GetSdrObject();
93 // #i29367# Update GraphicAttr, too. This was formerly
94 // triggered by SdrGrafObj::Notify, which is no longer
95 // called nowadays. BTW: strictly speaking, the whole
96 // ImpSetAttrToGrafInfo/ImpSetGrafInfoToAttr stuff could
97 // be dumped, when SdrGrafObj::aGrafInfo is removed and
98 // always created on the fly for repaint.
99 rObj
.ImpSetAttrToGrafInfo();
102 RectangleProperties::ItemSetChanged(rSet
);
105 void GraphicProperties::SetStyleSheet(SfxStyleSheet
* pNewStyleSheet
, sal_Bool bDontRemoveHardAttr
)
107 SdrGrafObj
& rObj
= (SdrGrafObj
&)GetSdrObject();
110 rObj
.SetXPolyDirty();
113 RectangleProperties::SetStyleSheet(pNewStyleSheet
, bDontRemoveHardAttr
);
116 rObj
.ImpSetAttrToGrafInfo();
119 void GraphicProperties::ForceDefaultAttributes()
122 RectangleProperties::ForceDefaultAttributes();
127 mpItemSet
->Put( SdrGrafLuminanceItem( 0 ) );
128 mpItemSet
->Put( SdrGrafContrastItem( 0 ) );
129 mpItemSet
->Put( SdrGrafRedItem( 0 ) );
130 mpItemSet
->Put( SdrGrafGreenItem( 0 ) );
131 mpItemSet
->Put( SdrGrafBlueItem( 0 ) );
132 mpItemSet
->Put( SdrGrafGamma100Item( 100 ) );
133 mpItemSet
->Put( SdrGrafTransparenceItem( 0 ) );
134 mpItemSet
->Put( SdrGrafInvertItem( FALSE
) );
135 mpItemSet
->Put( SdrGrafModeItem( GRAPHICDRAWMODE_STANDARD
) );
136 mpItemSet
->Put( SdrGrafCropItem( 0, 0, 0, 0 ) );
139 mpItemSet
->Put( XFillStyleItem(XFILL_NONE
) );
140 mpItemSet
->Put( XLineStyleItem(XLINE_NONE
) );
142 } // end of namespace properties
143 } // end of namespace sdr
145 //////////////////////////////////////////////////////////////////////////////