xref: /trunk/main/xmloff/source/style/GradientStyle.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_xmloff.hxx"
30*cdf0e10cSrcweir #include "xmloff/GradientStyle.hxx"
31*cdf0e10cSrcweir #include <com/sun/star/awt/Gradient.hpp>
32*cdf0e10cSrcweir #include <xmloff/attrlist.hxx>
33*cdf0e10cSrcweir #include <xmloff/nmspmap.hxx>
34*cdf0e10cSrcweir #include <xmloff/xmluconv.hxx>
35*cdf0e10cSrcweir #include "xmloff/xmlnmspe.hxx"
36*cdf0e10cSrcweir #include <xmloff/xmltoken.hxx>
37*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
38*cdf0e10cSrcweir #include <rtl/ustring.hxx>
39*cdf0e10cSrcweir #include <tools/debug.hxx>
40*cdf0e10cSrcweir #include <xmloff/xmltkmap.hxx>
41*cdf0e10cSrcweir #include <xmloff/xmlexp.hxx>
42*cdf0e10cSrcweir #include <xmloff/xmlimp.hxx>
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir using namespace ::com::sun::star;
47*cdf0e10cSrcweir using ::rtl::OUString;
48*cdf0e10cSrcweir using ::rtl::OUStringBuffer;
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir using namespace ::xmloff::token;
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir enum SvXMLTokenMapAttrs
53*cdf0e10cSrcweir {
54*cdf0e10cSrcweir     XML_TOK_GRADIENT_NAME,
55*cdf0e10cSrcweir     XML_TOK_GRADIENT_DISPLAY_NAME,
56*cdf0e10cSrcweir     XML_TOK_GRADIENT_STYLE,
57*cdf0e10cSrcweir     XML_TOK_GRADIENT_CX,
58*cdf0e10cSrcweir     XML_TOK_GRADIENT_CY,
59*cdf0e10cSrcweir     XML_TOK_GRADIENT_STARTCOLOR,
60*cdf0e10cSrcweir     XML_TOK_GRADIENT_ENDCOLOR,
61*cdf0e10cSrcweir     XML_TOK_GRADIENT_STARTINT,
62*cdf0e10cSrcweir     XML_TOK_GRADIENT_ENDINT,
63*cdf0e10cSrcweir     XML_TOK_GRADIENT_ANGLE,
64*cdf0e10cSrcweir     XML_TOK_GRADIENT_BORDER,
65*cdf0e10cSrcweir     XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN
66*cdf0e10cSrcweir };
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_GradientStyle_Enum[] =
70*cdf0e10cSrcweir {
71*cdf0e10cSrcweir     { XML_GRADIENTSTYLE_LINEAR,         awt::GradientStyle_LINEAR },
72*cdf0e10cSrcweir     { XML_GRADIENTSTYLE_AXIAL,          awt::GradientStyle_AXIAL },
73*cdf0e10cSrcweir     { XML_GRADIENTSTYLE_RADIAL,         awt::GradientStyle_RADIAL },
74*cdf0e10cSrcweir     { XML_GRADIENTSTYLE_ELLIPSOID,      awt::GradientStyle_ELLIPTICAL },
75*cdf0e10cSrcweir     { XML_GRADIENTSTYLE_SQUARE,         awt::GradientStyle_SQUARE },
76*cdf0e10cSrcweir     { XML_GRADIENTSTYLE_RECTANGULAR,    awt::GradientStyle_RECT },
77*cdf0e10cSrcweir     { XML_TOKEN_INVALID, 0 }
78*cdf0e10cSrcweir };
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir //-------------------------------------------------------------
81*cdf0e10cSrcweir // Import
82*cdf0e10cSrcweir //-------------------------------------------------------------
83*cdf0e10cSrcweir XMLGradientStyleImport::XMLGradientStyleImport(
84*cdf0e10cSrcweir     SvXMLImport& rImp )
85*cdf0e10cSrcweir     : rImport(rImp)
86*cdf0e10cSrcweir {
87*cdf0e10cSrcweir }
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir XMLGradientStyleImport::~XMLGradientStyleImport()
90*cdf0e10cSrcweir {
91*cdf0e10cSrcweir }
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir sal_Bool XMLGradientStyleImport::importXML(
94*cdf0e10cSrcweir     const uno::Reference< xml::sax::XAttributeList >& xAttrList,
95*cdf0e10cSrcweir     uno::Any& rValue,
96*cdf0e10cSrcweir     OUString& rStrName )
97*cdf0e10cSrcweir {
98*cdf0e10cSrcweir     sal_Bool bRet           = sal_False;
99*cdf0e10cSrcweir     sal_Bool bHasName       = sal_False;
100*cdf0e10cSrcweir     sal_Bool bHasStyle      = sal_False;
101*cdf0e10cSrcweir     sal_Bool bHasStartColor = sal_False;
102*cdf0e10cSrcweir     sal_Bool bHasEndColor   = sal_False;
103*cdf0e10cSrcweir     OUString aDisplayName;
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir     awt::Gradient aGradient;
106*cdf0e10cSrcweir     aGradient.XOffset = 0;
107*cdf0e10cSrcweir     aGradient.YOffset = 0;
108*cdf0e10cSrcweir     aGradient.StartIntensity = 100;
109*cdf0e10cSrcweir     aGradient.EndIntensity = 100;
110*cdf0e10cSrcweir     aGradient.Angle = 0;
111*cdf0e10cSrcweir     aGradient.Border = 0;
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir     {
114*cdf0e10cSrcweir         static __FAR_DATA SvXMLTokenMapEntry aGradientAttrTokenMap[] =
115*cdf0e10cSrcweir {
116*cdf0e10cSrcweir     { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_GRADIENT_NAME },
117*cdf0e10cSrcweir     { XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, XML_TOK_GRADIENT_DISPLAY_NAME },
118*cdf0e10cSrcweir     { XML_NAMESPACE_DRAW, XML_STYLE, XML_TOK_GRADIENT_STYLE },
119*cdf0e10cSrcweir     { XML_NAMESPACE_DRAW, XML_CX, XML_TOK_GRADIENT_CX },
120*cdf0e10cSrcweir     { XML_NAMESPACE_DRAW, XML_CY, XML_TOK_GRADIENT_CY },
121*cdf0e10cSrcweir     { XML_NAMESPACE_DRAW, XML_START_COLOR, XML_TOK_GRADIENT_STARTCOLOR },
122*cdf0e10cSrcweir     { XML_NAMESPACE_DRAW, XML_END_COLOR, XML_TOK_GRADIENT_ENDCOLOR },
123*cdf0e10cSrcweir     { XML_NAMESPACE_DRAW, XML_START_INTENSITY, XML_TOK_GRADIENT_STARTINT },
124*cdf0e10cSrcweir     { XML_NAMESPACE_DRAW, XML_END_INTENSITY, XML_TOK_GRADIENT_ENDINT },
125*cdf0e10cSrcweir     { XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, XML_TOK_GRADIENT_ANGLE },
126*cdf0e10cSrcweir     { XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, XML_TOK_GRADIENT_BORDER },
127*cdf0e10cSrcweir     XML_TOKEN_MAP_END
128*cdf0e10cSrcweir };
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir     SvXMLTokenMap aTokenMap( aGradientAttrTokenMap );
131*cdf0e10cSrcweir     SvXMLNamespaceMap& rNamespaceMap = rImport.GetNamespaceMap();
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir     sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
134*cdf0e10cSrcweir     for( sal_Int16 i=0; i < nAttrCount; i++ )
135*cdf0e10cSrcweir     {
136*cdf0e10cSrcweir         const OUString& rFullAttrName = xAttrList->getNameByIndex( i );
137*cdf0e10cSrcweir         OUString aStrAttrName;
138*cdf0e10cSrcweir         sal_uInt16 nPrefix = rNamespaceMap.GetKeyByAttrName( rFullAttrName, &aStrAttrName );
139*cdf0e10cSrcweir         const OUString& rStrValue = xAttrList->getValueByIndex( i );
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir         sal_Int32 nTmpValue;
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir         switch( aTokenMap.Get( nPrefix, aStrAttrName ) )
144*cdf0e10cSrcweir         {
145*cdf0e10cSrcweir         case XML_TOK_GRADIENT_NAME:
146*cdf0e10cSrcweir             {
147*cdf0e10cSrcweir                 rStrName = rStrValue;
148*cdf0e10cSrcweir                 bHasName = sal_True;
149*cdf0e10cSrcweir             }
150*cdf0e10cSrcweir             break;
151*cdf0e10cSrcweir         case XML_TOK_GRADIENT_DISPLAY_NAME:
152*cdf0e10cSrcweir             {
153*cdf0e10cSrcweir                 aDisplayName = rStrValue;
154*cdf0e10cSrcweir             }
155*cdf0e10cSrcweir             break;
156*cdf0e10cSrcweir         case XML_TOK_GRADIENT_STYLE:
157*cdf0e10cSrcweir             {
158*cdf0e10cSrcweir                 sal_uInt16 eValue;
159*cdf0e10cSrcweir                 if( SvXMLUnitConverter::convertEnum( eValue, rStrValue, pXML_GradientStyle_Enum ) )
160*cdf0e10cSrcweir                 {
161*cdf0e10cSrcweir                     aGradient.Style = (awt::GradientStyle) eValue;
162*cdf0e10cSrcweir                     bHasStyle = sal_True;
163*cdf0e10cSrcweir                 }
164*cdf0e10cSrcweir             }
165*cdf0e10cSrcweir             break;
166*cdf0e10cSrcweir         case XML_TOK_GRADIENT_CX:
167*cdf0e10cSrcweir             SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue );
168*cdf0e10cSrcweir             aGradient.XOffset = static_cast< sal_Int16 >( nTmpValue );
169*cdf0e10cSrcweir             break;
170*cdf0e10cSrcweir         case XML_TOK_GRADIENT_CY:
171*cdf0e10cSrcweir             SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue );
172*cdf0e10cSrcweir             aGradient.YOffset = static_cast< sal_Int16 >( nTmpValue );
173*cdf0e10cSrcweir             break;
174*cdf0e10cSrcweir         case XML_TOK_GRADIENT_STARTCOLOR:
175*cdf0e10cSrcweir             {
176*cdf0e10cSrcweir                 Color aColor;
177*cdf0e10cSrcweir                 bHasStartColor = SvXMLUnitConverter::convertColor( aColor, rStrValue );
178*cdf0e10cSrcweir                 if( bHasStartColor )
179*cdf0e10cSrcweir                     aGradient.StartColor = (sal_Int32)( aColor.GetColor() );
180*cdf0e10cSrcweir             }
181*cdf0e10cSrcweir             break;
182*cdf0e10cSrcweir         case XML_TOK_GRADIENT_ENDCOLOR:
183*cdf0e10cSrcweir             {
184*cdf0e10cSrcweir                 Color aColor;
185*cdf0e10cSrcweir                 bHasStartColor = SvXMLUnitConverter::convertColor( aColor, rStrValue );
186*cdf0e10cSrcweir                 if( bHasStartColor )
187*cdf0e10cSrcweir                     aGradient.EndColor = (sal_Int32)( aColor.GetColor() );
188*cdf0e10cSrcweir             }
189*cdf0e10cSrcweir             break;
190*cdf0e10cSrcweir         case XML_TOK_GRADIENT_STARTINT:
191*cdf0e10cSrcweir             SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue );
192*cdf0e10cSrcweir             aGradient.StartIntensity = static_cast< sal_Int16 >( nTmpValue );
193*cdf0e10cSrcweir             break;
194*cdf0e10cSrcweir         case XML_TOK_GRADIENT_ENDINT:
195*cdf0e10cSrcweir             SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue );
196*cdf0e10cSrcweir             aGradient.EndIntensity = static_cast< sal_Int16 >( nTmpValue );
197*cdf0e10cSrcweir             break;
198*cdf0e10cSrcweir         case XML_TOK_GRADIENT_ANGLE:
199*cdf0e10cSrcweir             {
200*cdf0e10cSrcweir                 sal_Int32 nValue;
201*cdf0e10cSrcweir                 SvXMLUnitConverter::convertNumber( nValue, rStrValue, 0, 3600 );
202*cdf0e10cSrcweir                 aGradient.Angle = sal_Int16( nValue );
203*cdf0e10cSrcweir             }
204*cdf0e10cSrcweir             break;
205*cdf0e10cSrcweir         case XML_TOK_GRADIENT_BORDER:
206*cdf0e10cSrcweir             SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue );
207*cdf0e10cSrcweir             aGradient.Border = static_cast< sal_Int16 >( nTmpValue );
208*cdf0e10cSrcweir             break;
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir         default:
211*cdf0e10cSrcweir             DBG_WARNING( "Unknown token at import gradient style" )
212*cdf0e10cSrcweir             ;
213*cdf0e10cSrcweir         }
214*cdf0e10cSrcweir     }
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir     rValue <<= aGradient;
217*cdf0e10cSrcweir 
218*cdf0e10cSrcweir     if( aDisplayName.getLength() )
219*cdf0e10cSrcweir     {
220*cdf0e10cSrcweir         rImport.AddStyleDisplayName( XML_STYLE_FAMILY_SD_GRADIENT_ID, rStrName,
221*cdf0e10cSrcweir                                      aDisplayName );
222*cdf0e10cSrcweir         rStrName = aDisplayName;
223*cdf0e10cSrcweir     }
224*cdf0e10cSrcweir 
225*cdf0e10cSrcweir     bRet = bHasName && bHasStyle && bHasStartColor && bHasEndColor;
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir     }
228*cdf0e10cSrcweir 
229*cdf0e10cSrcweir     return bRet;
230*cdf0e10cSrcweir }
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir //-------------------------------------------------------------
234*cdf0e10cSrcweir // Export
235*cdf0e10cSrcweir //-------------------------------------------------------------
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir #ifndef SVX_LIGHT
238*cdf0e10cSrcweir 
239*cdf0e10cSrcweir XMLGradientStyleExport::XMLGradientStyleExport(
240*cdf0e10cSrcweir     SvXMLExport& rExp )
241*cdf0e10cSrcweir     : rExport(rExp)
242*cdf0e10cSrcweir {
243*cdf0e10cSrcweir }
244*cdf0e10cSrcweir 
245*cdf0e10cSrcweir XMLGradientStyleExport::~XMLGradientStyleExport()
246*cdf0e10cSrcweir {
247*cdf0e10cSrcweir }
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir sal_Bool XMLGradientStyleExport::exportXML(
250*cdf0e10cSrcweir     const OUString& rStrName,
251*cdf0e10cSrcweir     const uno::Any& rValue )
252*cdf0e10cSrcweir {
253*cdf0e10cSrcweir     sal_Bool bRet = sal_False;
254*cdf0e10cSrcweir     awt::Gradient aGradient;
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir     if( rStrName.getLength() )
257*cdf0e10cSrcweir     {
258*cdf0e10cSrcweir         if( rValue >>= aGradient )
259*cdf0e10cSrcweir         {
260*cdf0e10cSrcweir             OUString aStrValue;
261*cdf0e10cSrcweir             OUStringBuffer aOut;
262*cdf0e10cSrcweir 
263*cdf0e10cSrcweir             // Style
264*cdf0e10cSrcweir             if( !SvXMLUnitConverter::convertEnum( aOut, aGradient.Style, pXML_GradientStyle_Enum ) )
265*cdf0e10cSrcweir             {
266*cdf0e10cSrcweir                 bRet = sal_False;
267*cdf0e10cSrcweir             }
268*cdf0e10cSrcweir             else
269*cdf0e10cSrcweir             {
270*cdf0e10cSrcweir                 // Name
271*cdf0e10cSrcweir                 sal_Bool bEncoded = sal_False;
272*cdf0e10cSrcweir                 OUString aStrName( rStrName );
273*cdf0e10cSrcweir                 rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
274*cdf0e10cSrcweir                                       rExport.EncodeStyleName( aStrName,
275*cdf0e10cSrcweir                                                                &bEncoded ) );
276*cdf0e10cSrcweir                 if( bEncoded )
277*cdf0e10cSrcweir                     rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
278*cdf0e10cSrcweir                                           aStrName );
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir                 aStrValue = aOut.makeStringAndClear();
282*cdf0e10cSrcweir                 rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir                 // Center x/y
285*cdf0e10cSrcweir                 if( aGradient.Style != awt::GradientStyle_LINEAR &&
286*cdf0e10cSrcweir                     aGradient.Style != awt::GradientStyle_AXIAL   )
287*cdf0e10cSrcweir                 {
288*cdf0e10cSrcweir                     SvXMLUnitConverter::convertPercent( aOut, aGradient.XOffset );
289*cdf0e10cSrcweir                     aStrValue = aOut.makeStringAndClear();
290*cdf0e10cSrcweir                     rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CX, aStrValue );
291*cdf0e10cSrcweir 
292*cdf0e10cSrcweir                     SvXMLUnitConverter::convertPercent( aOut, aGradient.YOffset );
293*cdf0e10cSrcweir                     aStrValue = aOut.makeStringAndClear();
294*cdf0e10cSrcweir                     rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CY, aStrValue );
295*cdf0e10cSrcweir                 }
296*cdf0e10cSrcweir 
297*cdf0e10cSrcweir                 Color aColor;
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir                 // Color start
300*cdf0e10cSrcweir                 aColor.SetColor( aGradient.StartColor );
301*cdf0e10cSrcweir                 SvXMLUnitConverter::convertColor( aOut, aColor );
302*cdf0e10cSrcweir                 aStrValue = aOut.makeStringAndClear();
303*cdf0e10cSrcweir                 rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_COLOR, aStrValue );
304*cdf0e10cSrcweir 
305*cdf0e10cSrcweir                 // Color end
306*cdf0e10cSrcweir                 aColor.SetColor( aGradient.EndColor );
307*cdf0e10cSrcweir                 SvXMLUnitConverter::convertColor( aOut, aColor );
308*cdf0e10cSrcweir                 aStrValue = aOut.makeStringAndClear();
309*cdf0e10cSrcweir                 rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_COLOR, aStrValue );
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir                 // Intensity start
312*cdf0e10cSrcweir                 SvXMLUnitConverter::convertPercent( aOut, aGradient.StartIntensity );
313*cdf0e10cSrcweir                 aStrValue = aOut.makeStringAndClear();
314*cdf0e10cSrcweir                 rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_INTENSITY, aStrValue );
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir                 // Intensity end
317*cdf0e10cSrcweir                 SvXMLUnitConverter::convertPercent( aOut, aGradient.EndIntensity );
318*cdf0e10cSrcweir                 aStrValue = aOut.makeStringAndClear();
319*cdf0e10cSrcweir                 rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_INTENSITY, aStrValue );
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir                 // Angle
322*cdf0e10cSrcweir                 if( aGradient.Style != awt::GradientStyle_RADIAL )
323*cdf0e10cSrcweir                 {
324*cdf0e10cSrcweir                     SvXMLUnitConverter::convertNumber( aOut, sal_Int32( aGradient.Angle ) );
325*cdf0e10cSrcweir                     aStrValue = aOut.makeStringAndClear();
326*cdf0e10cSrcweir                     rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue );
327*cdf0e10cSrcweir                 }
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir                 // Border
330*cdf0e10cSrcweir                 SvXMLUnitConverter::convertPercent( aOut, aGradient.Border );
331*cdf0e10cSrcweir                 aStrValue = aOut.makeStringAndClear();
332*cdf0e10cSrcweir                 rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, aStrValue );
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir                 // Do Write
335*cdf0e10cSrcweir                 SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_GRADIENT,
336*cdf0e10cSrcweir                                       sal_True, sal_False );
337*cdf0e10cSrcweir             }
338*cdf0e10cSrcweir         }
339*cdf0e10cSrcweir     }
340*cdf0e10cSrcweir 
341*cdf0e10cSrcweir     return bRet;
342*cdf0e10cSrcweir }
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir #endif // #ifndef SVX_LIGHT
345