1*f6e50924SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f6e50924SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f6e50924SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f6e50924SAndrew Rist  * distributed with this work for additional information
6*f6e50924SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f6e50924SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f6e50924SAndrew Rist  * "License"); you may not use this file except in compliance
9*f6e50924SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*f6e50924SAndrew Rist  *
11*f6e50924SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f6e50924SAndrew Rist  *
13*f6e50924SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f6e50924SAndrew Rist  * software distributed under the License is distributed on an
15*f6e50924SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f6e50924SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f6e50924SAndrew Rist  * specific language governing permissions and limitations
18*f6e50924SAndrew Rist  * under the License.
19*f6e50924SAndrew Rist  *
20*f6e50924SAndrew Rist  *************************************************************/
21*f6e50924SAndrew Rist 
22*f6e50924SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svx.hxx"
26cdf0e10cSrcweir #include <svx/sdr/properties/graphicproperties.hxx>
27cdf0e10cSrcweir #include <svl/itemset.hxx>
28cdf0e10cSrcweir #include <svl/style.hxx>
29cdf0e10cSrcweir #include <svx/svddef.hxx>
30cdf0e10cSrcweir #include <editeng/eeitem.hxx>
31cdf0e10cSrcweir #include <svx/svdograf.hxx>
32cdf0e10cSrcweir #include <svx/sdgcpitm.hxx>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace sdr
37cdf0e10cSrcweir {
38cdf0e10cSrcweir 	namespace properties
39cdf0e10cSrcweir 	{
40cdf0e10cSrcweir 		// create a new itemset
CreateObjectSpecificItemSet(SfxItemPool & rPool)41cdf0e10cSrcweir 		SfxItemSet& GraphicProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
42cdf0e10cSrcweir 		{
43cdf0e10cSrcweir 			return *(new SfxItemSet(rPool,
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 				// range from SdrAttrObj
46cdf0e10cSrcweir 				SDRATTR_START, SDRATTR_SHADOW_LAST,
47cdf0e10cSrcweir 				SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
48cdf0e10cSrcweir 				SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 				// range from SdrGrafObj
51cdf0e10cSrcweir 				SDRATTR_GRAF_FIRST, SDRATTR_GRAF_LAST,
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 				// range from SdrTextObj
54cdf0e10cSrcweir 				EE_ITEMS_START, EE_ITEMS_END,
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 				// end
57cdf0e10cSrcweir 				0, 0));
58cdf0e10cSrcweir 		}
59cdf0e10cSrcweir 
GraphicProperties(SdrObject & rObj)60cdf0e10cSrcweir 		GraphicProperties::GraphicProperties(SdrObject& rObj)
61cdf0e10cSrcweir 		:	RectangleProperties(rObj)
62cdf0e10cSrcweir 		{
63cdf0e10cSrcweir 		}
64cdf0e10cSrcweir 
GraphicProperties(const GraphicProperties & rProps,SdrObject & rObj)65cdf0e10cSrcweir 		GraphicProperties::GraphicProperties(const GraphicProperties& rProps, SdrObject& rObj)
66cdf0e10cSrcweir 		:	RectangleProperties(rProps, rObj)
67cdf0e10cSrcweir 		{
68cdf0e10cSrcweir 		}
69cdf0e10cSrcweir 
~GraphicProperties()70cdf0e10cSrcweir 		GraphicProperties::~GraphicProperties()
71cdf0e10cSrcweir 		{
72cdf0e10cSrcweir 		}
73cdf0e10cSrcweir 
Clone(SdrObject & rObj) const74cdf0e10cSrcweir 		BaseProperties& GraphicProperties::Clone(SdrObject& rObj) const
75cdf0e10cSrcweir 		{
76cdf0e10cSrcweir 			return *(new GraphicProperties(*this, rObj));
77cdf0e10cSrcweir 		}
78cdf0e10cSrcweir 
ItemSetChanged(const SfxItemSet & rSet)79cdf0e10cSrcweir 		void GraphicProperties::ItemSetChanged(const SfxItemSet& rSet)
80cdf0e10cSrcweir 		{
81cdf0e10cSrcweir 			SdrGrafObj& rObj = (SdrGrafObj&)GetSdrObject();
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 			// local changes
84cdf0e10cSrcweir 			rObj.SetXPolyDirty();
85cdf0e10cSrcweir 
86cdf0e10cSrcweir             // #i29367# Update GraphicAttr, too. This was formerly
87cdf0e10cSrcweir             // triggered by SdrGrafObj::Notify, which is no longer
88cdf0e10cSrcweir             // called nowadays. BTW: strictly speaking, the whole
89cdf0e10cSrcweir             // ImpSetAttrToGrafInfo/ImpSetGrafInfoToAttr stuff could
90cdf0e10cSrcweir             // be dumped, when SdrGrafObj::aGrafInfo is removed and
91cdf0e10cSrcweir             // always created on the fly for repaint.
92cdf0e10cSrcweir             rObj.ImpSetAttrToGrafInfo();
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 			// call parent
95cdf0e10cSrcweir 			RectangleProperties::ItemSetChanged(rSet);
96cdf0e10cSrcweir 		}
97cdf0e10cSrcweir 
SetStyleSheet(SfxStyleSheet * pNewStyleSheet,sal_Bool bDontRemoveHardAttr)98cdf0e10cSrcweir 		void GraphicProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
99cdf0e10cSrcweir 		{
100cdf0e10cSrcweir 			SdrGrafObj& rObj = (SdrGrafObj&)GetSdrObject();
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 			// local changes
103cdf0e10cSrcweir 			rObj.SetXPolyDirty();
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 			// call parent
106cdf0e10cSrcweir 			RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 			// local changes
109cdf0e10cSrcweir 			rObj.ImpSetAttrToGrafInfo();
110cdf0e10cSrcweir 		}
111cdf0e10cSrcweir 
ForceDefaultAttributes()112cdf0e10cSrcweir 		void GraphicProperties::ForceDefaultAttributes()
113cdf0e10cSrcweir 		{
114cdf0e10cSrcweir 			// call parent
115cdf0e10cSrcweir 			RectangleProperties::ForceDefaultAttributes();
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 			// force ItemSet
118cdf0e10cSrcweir 			GetObjectItemSet();
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 			mpItemSet->Put( SdrGrafLuminanceItem( 0 ) );
121cdf0e10cSrcweir 			mpItemSet->Put( SdrGrafContrastItem( 0 ) );
122cdf0e10cSrcweir 			mpItemSet->Put( SdrGrafRedItem( 0 ) );
123cdf0e10cSrcweir 			mpItemSet->Put( SdrGrafGreenItem( 0 ) );
124cdf0e10cSrcweir 			mpItemSet->Put( SdrGrafBlueItem( 0 ) );
125cdf0e10cSrcweir 			mpItemSet->Put( SdrGrafGamma100Item( 100 ) );
126cdf0e10cSrcweir 			mpItemSet->Put( SdrGrafTransparenceItem( 0 ) );
127cdf0e10cSrcweir 			mpItemSet->Put( SdrGrafInvertItem( sal_False ) );
128cdf0e10cSrcweir 			mpItemSet->Put( SdrGrafModeItem( GRAPHICDRAWMODE_STANDARD ) );
129cdf0e10cSrcweir 			mpItemSet->Put( SdrGrafCropItem( 0, 0, 0, 0 ) );
130cdf0e10cSrcweir 		}
131cdf0e10cSrcweir 	} // end of namespace properties
132cdf0e10cSrcweir } // end of namespace sdr
133cdf0e10cSrcweir 
134cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
135cdf0e10cSrcweir // eof
136