1efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3efeef26fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4efeef26fSAndrew Rist * or more contributor license agreements. See the NOTICE file
5efeef26fSAndrew Rist * distributed with this work for additional information
6efeef26fSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7efeef26fSAndrew Rist * to you under the Apache License, Version 2.0 (the
8efeef26fSAndrew Rist * "License"); you may not use this file except in compliance
9efeef26fSAndrew Rist * with the License. You may obtain a copy of the License at
10efeef26fSAndrew Rist *
11efeef26fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12efeef26fSAndrew Rist *
13efeef26fSAndrew Rist * Unless required by applicable law or agreed to in writing,
14efeef26fSAndrew Rist * software distributed under the License is distributed on an
15efeef26fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16efeef26fSAndrew Rist * KIND, either express or implied. See the License for the
17efeef26fSAndrew Rist * specific language governing permissions and limitations
18efeef26fSAndrew Rist * under the License.
19efeef26fSAndrew Rist *
20efeef26fSAndrew Rist *************************************************************/
21efeef26fSAndrew Rist
22efeef26fSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir
28cdf0e10cSrcweir #include <com/sun/star/text/RelOrientation.hpp>
29cdf0e10cSrcweir #include <com/sun/star/text/VertOrientation.hpp>
30cdf0e10cSrcweir #include <com/sun/star/text/HorizontalAdjust.hpp>
31cdf0e10cSrcweir #include <com/sun/star/text/DocumentStatistic.hpp>
32cdf0e10cSrcweir #include <com/sun/star/text/HoriOrientation.hpp>
33cdf0e10cSrcweir #include <com/sun/star/text/HoriOrientationFormat.hpp>
34cdf0e10cSrcweir #include <com/sun/star/text/NotePrintMode.hpp>
35cdf0e10cSrcweir #include <com/sun/star/text/SizeType.hpp>
36cdf0e10cSrcweir #include <com/sun/star/text/VertOrientationFormat.hpp>
37cdf0e10cSrcweir #include <com/sun/star/text/WrapTextMode.hpp>
38cdf0e10cSrcweir #include <com/sun/star/text/GraphicCrop.hpp>
39cdf0e10cSrcweir #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
40cdf0e10cSrcweir #include <com/sun/star/drawing/ColorMode.hpp>
41cdf0e10cSrcweir #include <svtools/grfmgr.hxx>
42cdf0e10cSrcweir #include <swtypes.hxx>
43cdf0e10cSrcweir #include <grfatr.hxx>
44cdf0e10cSrcweir #include <swunohelper.hxx>
45cdf0e10cSrcweir
46cdf0e10cSrcweir #ifndef _CMDID_H
47cdf0e10cSrcweir #include <cmdid.h>
48cdf0e10cSrcweir #endif
49cdf0e10cSrcweir #ifndef _UNOMID_H
50cdf0e10cSrcweir #include <unomid.h>
51cdf0e10cSrcweir #endif
52cdf0e10cSrcweir
53cdf0e10cSrcweir using namespace ::com::sun::star;
54cdf0e10cSrcweir
TYPEINIT1_AUTOFACTORY(SwCropGrf,SfxPoolItem)55cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(SwCropGrf, SfxPoolItem)
56cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(SwGammaGrf, SfxPoolItem)
57cdf0e10cSrcweir
58cdf0e10cSrcweir /******************************************************************************
59cdf0e10cSrcweir * Implementierung class SwMirrorGrf
60cdf0e10cSrcweir ******************************************************************************/
61cdf0e10cSrcweir
62cdf0e10cSrcweir SfxPoolItem* SwMirrorGrf::Clone( SfxItemPool* ) const
63cdf0e10cSrcweir {
64cdf0e10cSrcweir return new SwMirrorGrf( *this );
65cdf0e10cSrcweir }
66cdf0e10cSrcweir
GetValueCount() const67cdf0e10cSrcweir sal_uInt16 SwMirrorGrf::GetValueCount() const
68cdf0e10cSrcweir {
69cdf0e10cSrcweir return RES_MIRROR_GRAPH_END - RES_MIRROR_GRAPH_BEGIN;
70cdf0e10cSrcweir }
71cdf0e10cSrcweir
operator ==(const SfxPoolItem & rItem) const72cdf0e10cSrcweir int SwMirrorGrf::operator==( const SfxPoolItem& rItem) const
73cdf0e10cSrcweir {
74cdf0e10cSrcweir return SfxEnumItem::operator==(rItem) &&
75cdf0e10cSrcweir ((SwMirrorGrf&)rItem).IsGrfToggle() == IsGrfToggle();
76cdf0e10cSrcweir }
77cdf0e10cSrcweir
lcl_IsHoriOnEvenPages(int nEnum,sal_Bool bToggle)78cdf0e10cSrcweir sal_Bool lcl_IsHoriOnEvenPages(int nEnum, sal_Bool bToggle)
79cdf0e10cSrcweir {
80cdf0e10cSrcweir sal_Bool bEnum = nEnum == RES_MIRROR_GRAPH_VERT ||
81cdf0e10cSrcweir nEnum == RES_MIRROR_GRAPH_BOTH;
82cdf0e10cSrcweir return bEnum != bToggle;
83cdf0e10cSrcweir }
lcl_IsHoriOnOddPages(int nEnum)84cdf0e10cSrcweir sal_Bool lcl_IsHoriOnOddPages(int nEnum)
85cdf0e10cSrcweir {
86cdf0e10cSrcweir sal_Bool bEnum = nEnum == RES_MIRROR_GRAPH_VERT ||
87cdf0e10cSrcweir nEnum == RES_MIRROR_GRAPH_BOTH;
88cdf0e10cSrcweir return bEnum;
89cdf0e10cSrcweir }
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const90cdf0e10cSrcweir sal_Bool SwMirrorGrf::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
91cdf0e10cSrcweir {
92cdf0e10cSrcweir sal_Bool bRet = sal_True,
93cdf0e10cSrcweir bVal;
94cdf0e10cSrcweir // Vertikal und Horizontal sind mal getauscht worden!
95cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS;
96cdf0e10cSrcweir switch ( nMemberId )
97cdf0e10cSrcweir {
98cdf0e10cSrcweir case MID_MIRROR_HORZ_EVEN_PAGES:
99cdf0e10cSrcweir bVal = lcl_IsHoriOnEvenPages(GetValue(), IsGrfToggle());
100cdf0e10cSrcweir break;
101cdf0e10cSrcweir case MID_MIRROR_HORZ_ODD_PAGES:
102cdf0e10cSrcweir bVal = lcl_IsHoriOnOddPages(GetValue());
103cdf0e10cSrcweir break;
104cdf0e10cSrcweir case MID_MIRROR_VERT:
105cdf0e10cSrcweir bVal = GetValue() == RES_MIRROR_GRAPH_HOR ||
106cdf0e10cSrcweir GetValue() == RES_MIRROR_GRAPH_BOTH;
107cdf0e10cSrcweir break;
108cdf0e10cSrcweir default:
109*870262e3SDon Lewis ASSERT( sal_False, "unknown MemberId" );
110cdf0e10cSrcweir bRet = sal_False;
111cdf0e10cSrcweir }
112cdf0e10cSrcweir rVal.setValue( &bVal, ::getBooleanCppuType() );
113cdf0e10cSrcweir return bRet;
114cdf0e10cSrcweir }
115cdf0e10cSrcweir
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)116cdf0e10cSrcweir sal_Bool SwMirrorGrf::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
117cdf0e10cSrcweir {
118cdf0e10cSrcweir sal_Bool bRet = sal_True;
119cdf0e10cSrcweir sal_Bool bVal = *(sal_Bool*)rVal.getValue();
120cdf0e10cSrcweir // Vertikal und Horizontal sind mal getauscht worden!
121cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS;
122cdf0e10cSrcweir switch ( nMemberId )
123cdf0e10cSrcweir {
124cdf0e10cSrcweir case MID_MIRROR_HORZ_EVEN_PAGES:
125cdf0e10cSrcweir case MID_MIRROR_HORZ_ODD_PAGES:
126cdf0e10cSrcweir {
127cdf0e10cSrcweir sal_Bool bIsVert = GetValue() == RES_MIRROR_GRAPH_HOR ||
128cdf0e10cSrcweir GetValue() == RES_MIRROR_GRAPH_BOTH;
129cdf0e10cSrcweir sal_Bool bOnOddPages = nMemberId == MID_MIRROR_HORZ_EVEN_PAGES ?
130cdf0e10cSrcweir lcl_IsHoriOnOddPages(GetValue()) : bVal;
131cdf0e10cSrcweir sal_Bool bOnEvenPages = nMemberId == MID_MIRROR_HORZ_ODD_PAGES ?
132cdf0e10cSrcweir lcl_IsHoriOnEvenPages(GetValue(), IsGrfToggle()) : bVal;
133cdf0e10cSrcweir MirrorGraph nEnum = bOnOddPages ?
134cdf0e10cSrcweir bIsVert ? RES_MIRROR_GRAPH_BOTH : RES_MIRROR_GRAPH_VERT :
135cdf0e10cSrcweir bIsVert ? RES_MIRROR_GRAPH_HOR : RES_MIRROR_GRAPH_DONT;
136cdf0e10cSrcweir sal_Bool bToggle = bOnOddPages != bOnEvenPages;
137cdf0e10cSrcweir SetValue(static_cast<sal_uInt16>(nEnum));
138cdf0e10cSrcweir SetGrfToggle( bToggle );
139cdf0e10cSrcweir }
140cdf0e10cSrcweir break;
141cdf0e10cSrcweir case MID_MIRROR_VERT:
142cdf0e10cSrcweir if ( bVal )
143cdf0e10cSrcweir {
144cdf0e10cSrcweir if ( GetValue() == RES_MIRROR_GRAPH_VERT )
145cdf0e10cSrcweir SetValue( RES_MIRROR_GRAPH_BOTH );
146cdf0e10cSrcweir else if ( GetValue() != RES_MIRROR_GRAPH_BOTH )
147cdf0e10cSrcweir SetValue( RES_MIRROR_GRAPH_HOR );
148cdf0e10cSrcweir }
149cdf0e10cSrcweir else
150cdf0e10cSrcweir {
151cdf0e10cSrcweir if ( GetValue() == RES_MIRROR_GRAPH_BOTH )
152cdf0e10cSrcweir SetValue( RES_MIRROR_GRAPH_VERT );
153cdf0e10cSrcweir else if ( GetValue() == RES_MIRROR_GRAPH_HOR )
154cdf0e10cSrcweir SetValue( RES_MIRROR_GRAPH_DONT );
155cdf0e10cSrcweir }
156cdf0e10cSrcweir break;
157cdf0e10cSrcweir default:
158*870262e3SDon Lewis ASSERT( sal_False, "unknown MemberId" );
159cdf0e10cSrcweir bRet = sal_False;
160cdf0e10cSrcweir }
161cdf0e10cSrcweir return bRet;
162cdf0e10cSrcweir }
163cdf0e10cSrcweir
164cdf0e10cSrcweir
165cdf0e10cSrcweir /******************************************************************************
166cdf0e10cSrcweir * Implementierung class SwCropGrf
167cdf0e10cSrcweir ******************************************************************************/
168cdf0e10cSrcweir
SwCropGrf()169cdf0e10cSrcweir SwCropGrf::SwCropGrf()
170cdf0e10cSrcweir : SvxGrfCrop( RES_GRFATR_CROPGRF )
171cdf0e10cSrcweir {}
172cdf0e10cSrcweir
SwCropGrf(sal_Int32 nL,sal_Int32 nR,sal_Int32 nT,sal_Int32 nB)173cdf0e10cSrcweir SwCropGrf::SwCropGrf(sal_Int32 nL, sal_Int32 nR, sal_Int32 nT, sal_Int32 nB )
174cdf0e10cSrcweir : SvxGrfCrop( nL, nR, nT, nB, RES_GRFATR_CROPGRF )
175cdf0e10cSrcweir {}
176cdf0e10cSrcweir
Clone(SfxItemPool *) const177cdf0e10cSrcweir SfxPoolItem* SwCropGrf::Clone( SfxItemPool* ) const
178cdf0e10cSrcweir {
179cdf0e10cSrcweir return new SwCropGrf( *this );
180cdf0e10cSrcweir }
181cdf0e10cSrcweir
182cdf0e10cSrcweir // ------------------------------------------------------------------
183cdf0e10cSrcweir
Clone(SfxItemPool *) const184cdf0e10cSrcweir SfxPoolItem* SwRotationGrf::Clone( SfxItemPool * ) const
185cdf0e10cSrcweir {
186cdf0e10cSrcweir return new SwRotationGrf( GetValue(), aUnrotatedSize );
187cdf0e10cSrcweir }
188cdf0e10cSrcweir
189cdf0e10cSrcweir
operator ==(const SfxPoolItem & rCmp) const190cdf0e10cSrcweir int SwRotationGrf::operator==( const SfxPoolItem& rCmp ) const
191cdf0e10cSrcweir {
192cdf0e10cSrcweir return SfxUInt16Item::operator==( rCmp ) &&
193cdf0e10cSrcweir GetUnrotatedSize() == ((SwRotationGrf&)rCmp).GetUnrotatedSize();
194cdf0e10cSrcweir }
195cdf0e10cSrcweir
196cdf0e10cSrcweir
QueryValue(uno::Any & rVal,sal_uInt8) const197cdf0e10cSrcweir sal_Bool SwRotationGrf::QueryValue( uno::Any& rVal, sal_uInt8 ) const
198cdf0e10cSrcweir {
199cdf0e10cSrcweir // SfxUInt16Item::QueryValue returns sal_Int32 in Any now... (srx642w)
200cdf0e10cSrcweir // where we still want this to be a sal_Int16
201cdf0e10cSrcweir rVal <<= (sal_Int16)GetValue();
202cdf0e10cSrcweir return sal_True;
203cdf0e10cSrcweir }
204cdf0e10cSrcweir
PutValue(const uno::Any & rVal,sal_uInt8)205cdf0e10cSrcweir sal_Bool SwRotationGrf::PutValue( const uno::Any& rVal, sal_uInt8 )
206cdf0e10cSrcweir {
207cdf0e10cSrcweir // SfxUInt16Item::QueryValue returns sal_Int32 in Any now... (srx642w)
208cdf0e10cSrcweir // where we still want this to be a sal_Int16
209cdf0e10cSrcweir sal_Int16 nValue = 0;
210cdf0e10cSrcweir if (rVal >>= nValue)
211cdf0e10cSrcweir {
212cdf0e10cSrcweir // sal_uInt16 argument needed
213cdf0e10cSrcweir SetValue( (sal_uInt16) nValue );
214cdf0e10cSrcweir return sal_True;
215cdf0e10cSrcweir }
216cdf0e10cSrcweir
217cdf0e10cSrcweir DBG_ERROR( "SwRotationGrf::PutValue - Wrong type!" );
218cdf0e10cSrcweir return sal_False;
219cdf0e10cSrcweir }
220cdf0e10cSrcweir
221cdf0e10cSrcweir // ------------------------------------------------------------------
222cdf0e10cSrcweir
Clone(SfxItemPool *) const223cdf0e10cSrcweir SfxPoolItem* SwLuminanceGrf::Clone( SfxItemPool * ) const
224cdf0e10cSrcweir {
225cdf0e10cSrcweir return new SwLuminanceGrf( *this );
226cdf0e10cSrcweir }
227cdf0e10cSrcweir
228cdf0e10cSrcweir // ------------------------------------------------------------------
229cdf0e10cSrcweir
Clone(SfxItemPool *) const230cdf0e10cSrcweir SfxPoolItem* SwContrastGrf::Clone( SfxItemPool * ) const
231cdf0e10cSrcweir {
232cdf0e10cSrcweir return new SwContrastGrf( *this );
233cdf0e10cSrcweir }
234cdf0e10cSrcweir
235cdf0e10cSrcweir // ------------------------------------------------------------------
236cdf0e10cSrcweir
Clone(SfxItemPool *) const237cdf0e10cSrcweir SfxPoolItem* SwChannelRGrf::Clone( SfxItemPool * ) const
238cdf0e10cSrcweir {
239cdf0e10cSrcweir return new SwChannelRGrf( *this );
240cdf0e10cSrcweir }
241cdf0e10cSrcweir
242cdf0e10cSrcweir // ------------------------------------------------------------------
243cdf0e10cSrcweir
Clone(SfxItemPool *) const244cdf0e10cSrcweir SfxPoolItem* SwChannelGGrf::Clone( SfxItemPool * ) const
245cdf0e10cSrcweir {
246cdf0e10cSrcweir return new SwChannelGGrf( *this );
247cdf0e10cSrcweir }
248cdf0e10cSrcweir
249cdf0e10cSrcweir // ------------------------------------------------------------------
250cdf0e10cSrcweir
Clone(SfxItemPool *) const251cdf0e10cSrcweir SfxPoolItem* SwChannelBGrf::Clone( SfxItemPool * ) const
252cdf0e10cSrcweir {
253cdf0e10cSrcweir return new SwChannelBGrf( *this );
254cdf0e10cSrcweir }
255cdf0e10cSrcweir
256cdf0e10cSrcweir // ------------------------------------------------------------------
257cdf0e10cSrcweir
Clone(SfxItemPool *) const258cdf0e10cSrcweir SfxPoolItem* SwGammaGrf::Clone( SfxItemPool * ) const
259cdf0e10cSrcweir {
260cdf0e10cSrcweir return new SwGammaGrf( *this );
261cdf0e10cSrcweir }
262cdf0e10cSrcweir
operator ==(const SfxPoolItem & rCmp) const263cdf0e10cSrcweir int SwGammaGrf::operator==( const SfxPoolItem& rCmp ) const
264cdf0e10cSrcweir {
265cdf0e10cSrcweir return SfxPoolItem::operator==( rCmp ) &&
266cdf0e10cSrcweir nValue == ((SwGammaGrf&)rCmp).GetValue();
267cdf0e10cSrcweir }
268cdf0e10cSrcweir
QueryValue(uno::Any & rVal,sal_uInt8) const269cdf0e10cSrcweir sal_Bool SwGammaGrf::QueryValue( uno::Any& rVal, sal_uInt8 ) const
270cdf0e10cSrcweir {
271cdf0e10cSrcweir rVal <<= nValue;
272cdf0e10cSrcweir return sal_True;
273cdf0e10cSrcweir }
274cdf0e10cSrcweir
PutValue(const uno::Any & rVal,sal_uInt8)275cdf0e10cSrcweir sal_Bool SwGammaGrf::PutValue( const uno::Any& rVal, sal_uInt8 )
276cdf0e10cSrcweir {
277cdf0e10cSrcweir return rVal >>= nValue;
278cdf0e10cSrcweir }
279cdf0e10cSrcweir
280cdf0e10cSrcweir // ------------------------------------------------------------------
281cdf0e10cSrcweir
Clone(SfxItemPool *) const282cdf0e10cSrcweir SfxPoolItem* SwInvertGrf::Clone( SfxItemPool * ) const
283cdf0e10cSrcweir {
284cdf0e10cSrcweir return new SwInvertGrf( *this );
285cdf0e10cSrcweir }
286cdf0e10cSrcweir
287cdf0e10cSrcweir // ------------------------------------------------------------------
288cdf0e10cSrcweir
Clone(SfxItemPool *) const289cdf0e10cSrcweir SfxPoolItem* SwTransparencyGrf::Clone( SfxItemPool * ) const
290cdf0e10cSrcweir {
291cdf0e10cSrcweir return new SwTransparencyGrf( *this );
292cdf0e10cSrcweir }
293cdf0e10cSrcweir // ------------------------------------------------------------------
QueryValue(uno::Any & rVal,sal_uInt8) const294cdf0e10cSrcweir sal_Bool SwTransparencyGrf::QueryValue( uno::Any& rVal,
295cdf0e10cSrcweir sal_uInt8 ) const
296cdf0e10cSrcweir {
297cdf0e10cSrcweir DBG_ASSERT(ISA(SfxByteItem),"Put/QueryValue should be removed!");
298cdf0e10cSrcweir sal_Int16 nRet = GetValue();
299cdf0e10cSrcweir DBG_ASSERT( 0 <= nRet && nRet <= 100, "value out of range" );
300cdf0e10cSrcweir rVal <<= nRet;
301cdf0e10cSrcweir return sal_True;
302cdf0e10cSrcweir }
303cdf0e10cSrcweir // ------------------------------------------------------------------
PutValue(const uno::Any & rVal,sal_uInt8)304cdf0e10cSrcweir sal_Bool SwTransparencyGrf::PutValue( const uno::Any& rVal,
305cdf0e10cSrcweir sal_uInt8 )
306cdf0e10cSrcweir {
307cdf0e10cSrcweir //temporary conversion until this is a SfxInt16Item!
308cdf0e10cSrcweir DBG_ASSERT(ISA(SfxByteItem),"Put/QueryValue should be removed!");
309cdf0e10cSrcweir sal_Int16 nVal = 0;
310cdf0e10cSrcweir if(!(rVal >>= nVal) || nVal < -100 || nVal > 100)
311cdf0e10cSrcweir return sal_False;
312cdf0e10cSrcweir if(nVal < 0)
313cdf0e10cSrcweir {
314cdf0e10cSrcweir // for compatibility with old documents
315cdf0e10cSrcweir // OD 05.11.2002 #104308# - introduce rounding as for SO 6.0 PP2
316cdf0e10cSrcweir // introduced by fix of #104293#.
317cdf0e10cSrcweir nVal = ( ( nVal * 128 ) - (99/2) ) / 100;
318cdf0e10cSrcweir nVal += 128;
319cdf0e10cSrcweir }
320cdf0e10cSrcweir DBG_ASSERT( 0 <= nVal && nVal <= 100, "value out of range" );
321cdf0e10cSrcweir SetValue(static_cast<sal_uInt8>(nVal));
322cdf0e10cSrcweir return sal_True;
323cdf0e10cSrcweir }
324cdf0e10cSrcweir
325cdf0e10cSrcweir // ------------------------------------------------------------------
326cdf0e10cSrcweir
Clone(SfxItemPool *) const327cdf0e10cSrcweir SfxPoolItem* SwDrawModeGrf::Clone( SfxItemPool * ) const
328cdf0e10cSrcweir {
329cdf0e10cSrcweir return new SwDrawModeGrf( *this );
330cdf0e10cSrcweir }
331cdf0e10cSrcweir
GetValueCount() const332cdf0e10cSrcweir sal_uInt16 SwDrawModeGrf::GetValueCount() const
333cdf0e10cSrcweir {
334cdf0e10cSrcweir // GRAPHICDRAWMODE_STANDARD = 0,
335cdf0e10cSrcweir // GRAPHICDRAWMODE_GREYS = 1,
336cdf0e10cSrcweir // GRAPHICDRAWMODE_MONO = 2,
337cdf0e10cSrcweir // GRAPHICDRAWMODE_WATERMARK = 3
338cdf0e10cSrcweir return GRAPHICDRAWMODE_WATERMARK + 1;
339cdf0e10cSrcweir }
340cdf0e10cSrcweir
QueryValue(uno::Any & rVal,sal_uInt8) const341cdf0e10cSrcweir sal_Bool SwDrawModeGrf::QueryValue( uno::Any& rVal,
342cdf0e10cSrcweir sal_uInt8 ) const
343cdf0e10cSrcweir {
344cdf0e10cSrcweir drawing::ColorMode eRet = (drawing::ColorMode)GetEnumValue();
345cdf0e10cSrcweir rVal <<= eRet;
346cdf0e10cSrcweir return sal_True;
347cdf0e10cSrcweir }
348cdf0e10cSrcweir
PutValue(const uno::Any & rVal,sal_uInt8)349cdf0e10cSrcweir sal_Bool SwDrawModeGrf::PutValue( const uno::Any& rVal,
350cdf0e10cSrcweir sal_uInt8 )
351cdf0e10cSrcweir {
352cdf0e10cSrcweir sal_Int32 eVal = SWUnoHelper::GetEnumAsInt32( rVal );
353cdf0e10cSrcweir if(eVal >= 0 && eVal <= GRAPHICDRAWMODE_WATERMARK)
354cdf0e10cSrcweir {
355cdf0e10cSrcweir SetEnumValue((sal_uInt16)eVal);
356cdf0e10cSrcweir return sal_True;
357cdf0e10cSrcweir }
358cdf0e10cSrcweir return sal_False;
359cdf0e10cSrcweir }
360cdf0e10cSrcweir
361cdf0e10cSrcweir
362cdf0e10cSrcweir
363