2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-12 17:21:24 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include "TransGradientStyle.hxx"
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
|
2001-10-19 17:43:58 +00:00
|
|
|
#include <com/sun/star/awt/Gradient.hpp>
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
|
|
|
|
#include <sax/tools/converter.hxx>
|
|
|
|
|
2007-06-27 14:29:46 +00:00
|
|
|
#include <xmloff/attrlist.hxx>
|
|
|
|
#include <xmloff/nmspmap.hxx>
|
|
|
|
#include <xmloff/xmluconv.hxx>
|
2013-11-11 22:30:35 -06:00
|
|
|
#include <xmloff/xmlnmspe.hxx>
|
2001-06-29 20:07:26 +00:00
|
|
|
#include <rtl/ustrbuf.hxx>
|
2006-06-19 17:27:49 +00:00
|
|
|
#include <rtl/ustring.hxx>
|
2012-01-03 15:12:24 +01:00
|
|
|
#include <tools/color.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <tools/debug.hxx>
|
2007-06-27 14:29:46 +00:00
|
|
|
#include <xmloff/xmltkmap.hxx>
|
|
|
|
#include <xmloff/xmlexp.hxx>
|
|
|
|
#include <xmloff/xmlimp.hxx>
|
2001-10-19 17:43:58 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
using namespace ::com::sun::star;
|
2008-03-12 09:44:32 +00:00
|
|
|
|
2001-06-15 09:37:08 +00:00
|
|
|
using namespace ::xmloff::token;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
enum SvXMLTokenMapAttrs
|
|
|
|
{
|
|
|
|
XML_TOK_GRADIENT_NAME,
|
2004-07-13 07:21:45 +00:00
|
|
|
XML_TOK_GRADIENT_DISPLAY_NAME,
|
2000-09-18 16:07:07 +00:00
|
|
|
XML_TOK_GRADIENT_STYLE,
|
|
|
|
XML_TOK_GRADIENT_CX,
|
|
|
|
XML_TOK_GRADIENT_CY,
|
|
|
|
XML_TOK_GRADIENT_START,
|
|
|
|
XML_TOK_GRADIENT_END,
|
2000-10-10 10:04:20 +00:00
|
|
|
XML_TOK_GRADIENT_ANGLE,
|
2000-09-18 16:07:07 +00:00
|
|
|
XML_TOK_GRADIENT_BORDER,
|
|
|
|
XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN
|
|
|
|
};
|
|
|
|
|
2010-12-12 09:24:14 +01:00
|
|
|
SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] =
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-06-15 09:37:08 +00:00
|
|
|
{ XML_GRADIENTSTYLE_LINEAR, awt::GradientStyle_LINEAR },
|
|
|
|
{ XML_GRADIENTSTYLE_AXIAL, awt::GradientStyle_AXIAL },
|
|
|
|
{ XML_GRADIENTSTYLE_RADIAL, awt::GradientStyle_RADIAL },
|
|
|
|
{ XML_GRADIENTSTYLE_ELLIPSOID, awt::GradientStyle_ELLIPTICAL },
|
|
|
|
{ XML_GRADIENTSTYLE_SQUARE, awt::GradientStyle_SQUARE },
|
|
|
|
{ XML_GRADIENTSTYLE_RECTANGULAR, awt::GradientStyle_RECT },
|
|
|
|
{ XML_TOKEN_INVALID, 0 }
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
2001-10-23 09:05:52 +00:00
|
|
|
// Import
|
|
|
|
|
2001-10-19 17:43:58 +00:00
|
|
|
XMLTransGradientStyleImport::XMLTransGradientStyleImport( SvXMLImport& rImp )
|
|
|
|
: rImport(rImp)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-10-19 17:43:58 +00:00
|
|
|
XMLTransGradientStyleImport::~XMLTransGradientStyleImport()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-01-13 12:07:59 +02:00
|
|
|
void XMLTransGradientStyleImport::importXML(
|
2001-10-19 17:43:58 +00:00
|
|
|
const uno::Reference< xml::sax::XAttributeList >& xAttrList,
|
|
|
|
uno::Any& rValue,
|
|
|
|
OUString& rStrName )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 07:21:45 +00:00
|
|
|
OUString aDisplayName;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
awt::Gradient aGradient;
|
|
|
|
aGradient.XOffset = 0;
|
|
|
|
aGradient.YOffset = 0;
|
|
|
|
aGradient.StartIntensity = 100;
|
|
|
|
aGradient.EndIntensity = 100;
|
|
|
|
aGradient.Angle = 0;
|
|
|
|
aGradient.Border = 0;
|
|
|
|
|
2015-10-14 02:51:05 +02:00
|
|
|
static const SvXMLTokenMapEntry aTrGradientAttrTokenMap[] =
|
2009-04-23 10:42:05 +00:00
|
|
|
{
|
2015-10-14 02:51:05 +02:00
|
|
|
{ XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_GRADIENT_NAME },
|
|
|
|
{ XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, XML_TOK_GRADIENT_DISPLAY_NAME },
|
|
|
|
{ XML_NAMESPACE_DRAW, XML_STYLE, XML_TOK_GRADIENT_STYLE },
|
|
|
|
{ XML_NAMESPACE_DRAW, XML_CX, XML_TOK_GRADIENT_CX },
|
|
|
|
{ XML_NAMESPACE_DRAW, XML_CY, XML_TOK_GRADIENT_CY },
|
|
|
|
{ XML_NAMESPACE_DRAW, XML_START, XML_TOK_GRADIENT_START },
|
|
|
|
{ XML_NAMESPACE_DRAW, XML_END, XML_TOK_GRADIENT_END },
|
|
|
|
{ XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, XML_TOK_GRADIENT_ANGLE },
|
2016-08-26 23:32:23 +05:30
|
|
|
{ XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, XML_TOK_GRADIENT_BORDER,
|
|
|
|
NAMESPACE_TOKEN( XML_NAMESPACE_DRAW ) | XML_BORDER },
|
|
|
|
// XML_GRADIENT_BORDER is a duplicate of XML_BORDER
|
2015-10-14 02:51:05 +02:00
|
|
|
XML_TOKEN_MAP_END
|
|
|
|
};
|
2009-04-23 10:42:05 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
SvXMLTokenMap aTokenMap( aTrGradientAttrTokenMap );
|
2001-10-19 17:43:58 +00:00
|
|
|
SvXMLNamespaceMap& rNamespaceMap = rImport.GetNamespaceMap();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
|
|
|
|
for( sal_Int16 i=0; i < nAttrCount; i++ )
|
|
|
|
{
|
|
|
|
const OUString& rFullAttrName = xAttrList->getNameByIndex( i );
|
|
|
|
OUString aStrAttrName;
|
2001-10-19 17:43:58 +00:00
|
|
|
sal_uInt16 nPrefix = rNamespaceMap.GetKeyByAttrName( rFullAttrName, &aStrAttrName );
|
2000-09-18 16:07:07 +00:00
|
|
|
const OUString& rStrValue = xAttrList->getValueByIndex( i );
|
|
|
|
|
|
|
|
sal_Int32 nTmpValue;
|
|
|
|
|
|
|
|
switch( aTokenMap.Get( nPrefix, aStrAttrName ) )
|
|
|
|
{
|
|
|
|
case XML_TOK_GRADIENT_NAME:
|
|
|
|
{
|
|
|
|
rStrName = rStrValue;
|
|
|
|
}
|
|
|
|
break;
|
2004-07-13 07:21:45 +00:00
|
|
|
case XML_TOK_GRADIENT_DISPLAY_NAME:
|
|
|
|
{
|
|
|
|
aDisplayName = rStrValue;
|
|
|
|
}
|
|
|
|
break;
|
2000-09-18 16:07:07 +00:00
|
|
|
case XML_TOK_GRADIENT_STYLE:
|
|
|
|
{
|
|
|
|
sal_uInt16 eValue;
|
2006-10-12 13:46:29 +00:00
|
|
|
if( SvXMLUnitConverter::convertEnum( eValue, rStrValue, pXML_GradientStyle_Enum ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
aGradient.Style = (awt::GradientStyle) eValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case XML_TOK_GRADIENT_CX:
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
::sax::Converter::convertPercent( nTmpValue, rStrValue );
|
2006-10-12 13:46:29 +00:00
|
|
|
aGradient.XOffset = sal::static_int_cast< sal_Int16 >(nTmpValue);
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case XML_TOK_GRADIENT_CY:
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
::sax::Converter::convertPercent( nTmpValue, rStrValue );
|
2006-10-12 13:46:29 +00:00
|
|
|
aGradient.YOffset = sal::static_int_cast< sal_Int16 >(nTmpValue);
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case XML_TOK_GRADIENT_START:
|
|
|
|
{
|
|
|
|
sal_Int32 aStartTransparency;
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
::sax::Converter::convertPercent( aStartTransparency, rStrValue );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2010-11-10 13:50:33 +08:00
|
|
|
sal_uInt8 n = sal::static_int_cast< sal_uInt8 >(
|
2006-10-12 13:46:29 +00:00
|
|
|
( (100 - aStartTransparency) * 255 ) / 100 );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-10-12 13:46:29 +00:00
|
|
|
Color aColor( n, n, n );
|
2000-09-18 16:07:07 +00:00
|
|
|
aGradient.StartColor = (sal_Int32)( aColor.GetColor() );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case XML_TOK_GRADIENT_END:
|
|
|
|
{
|
|
|
|
sal_Int32 aEndTransparency;
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
::sax::Converter::convertPercent( aEndTransparency, rStrValue );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2010-11-10 13:50:33 +08:00
|
|
|
sal_uInt8 n = sal::static_int_cast< sal_uInt8 >(
|
2006-10-12 13:46:29 +00:00
|
|
|
( (100 - aEndTransparency) * 255 ) / 100 );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-10-12 13:46:29 +00:00
|
|
|
Color aColor( n, n, n );
|
2000-09-18 16:07:07 +00:00
|
|
|
aGradient.EndColor = (sal_Int32)( aColor.GetColor() );
|
|
|
|
}
|
|
|
|
break;
|
2000-10-10 10:04:20 +00:00
|
|
|
case XML_TOK_GRADIENT_ANGLE:
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-10-09 17:51:50 +02:00
|
|
|
bool const bSuccess =
|
|
|
|
::sax::Converter::convertAngle(aGradient.Angle, rStrValue);
|
|
|
|
SAL_INFO_IF(!bSuccess, "xmloff.style", "failed to import draw:angle");
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case XML_TOK_GRADIENT_BORDER:
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
::sax::Converter::convertPercent( nTmpValue, rStrValue );
|
2006-10-12 13:46:29 +00:00
|
|
|
aGradient.Border = sal::static_int_cast< sal_Int16 >(nTmpValue);
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2015-02-09 18:08:39 +01:00
|
|
|
SAL_INFO("xmloff.style", "Unknown token at import transparency gradient style");
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rValue <<= aGradient;
|
|
|
|
|
2012-01-25 21:59:48 -02:00
|
|
|
if( !aDisplayName.isEmpty() )
|
2004-07-13 07:21:45 +00:00
|
|
|
{
|
|
|
|
rImport.AddStyleDisplayName( XML_STYLE_FAMILY_SD_GRADIENT_ID, rStrName,
|
|
|
|
aDisplayName );
|
|
|
|
rStrName = aDisplayName;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2001-10-23 09:05:52 +00:00
|
|
|
|
|
|
|
// Export
|
|
|
|
|
|
|
|
XMLTransGradientStyleExport::XMLTransGradientStyleExport( SvXMLExport& rExp )
|
|
|
|
: rExport(rExp)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
XMLTransGradientStyleExport::~XMLTransGradientStyleExport()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-01-13 12:07:59 +02:00
|
|
|
void XMLTransGradientStyleExport::exportXML(
|
2001-10-23 09:05:52 +00:00
|
|
|
const OUString& rStrName,
|
|
|
|
const uno::Any& rValue )
|
|
|
|
{
|
|
|
|
awt::Gradient aGradient;
|
|
|
|
|
2012-01-25 21:59:48 -02:00
|
|
|
if( !rStrName.isEmpty() )
|
2001-10-23 09:05:52 +00:00
|
|
|
{
|
|
|
|
if( rValue >>= aGradient )
|
|
|
|
{
|
|
|
|
OUString aStrValue;
|
|
|
|
OUStringBuffer aOut;
|
|
|
|
|
|
|
|
// Style
|
2016-01-13 12:07:59 +02:00
|
|
|
if( SvXMLUnitConverter::convertEnum( aOut, aGradient.Style, pXML_GradientStyle_Enum ) )
|
2002-09-25 15:19:26 +00:00
|
|
|
{
|
|
|
|
// Name
|
2014-03-31 11:47:05 +02:00
|
|
|
bool bEncoded = false;
|
2004-07-13 07:21:45 +00:00
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
|
|
|
|
rExport.EncodeStyleName( rStrName,
|
|
|
|
&bEncoded ) );
|
|
|
|
if( bEncoded )
|
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
|
|
|
|
rStrName );
|
2001-10-23 09:05:52 +00:00
|
|
|
|
|
|
|
aStrValue = aOut.makeStringAndClear();
|
2002-09-25 15:19:26 +00:00
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
|
2001-10-23 09:05:52 +00:00
|
|
|
|
2002-09-25 15:19:26 +00:00
|
|
|
// Center x/y
|
|
|
|
if( aGradient.Style != awt::GradientStyle_LINEAR &&
|
|
|
|
aGradient.Style != awt::GradientStyle_AXIAL )
|
|
|
|
{
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
::sax::Converter::convertPercent(aOut, aGradient.XOffset);
|
2002-09-25 15:19:26 +00:00
|
|
|
aStrValue = aOut.makeStringAndClear();
|
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CX, aStrValue );
|
2001-10-23 09:05:52 +00:00
|
|
|
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
::sax::Converter::convertPercent(aOut, aGradient.YOffset);
|
2002-09-25 15:19:26 +00:00
|
|
|
aStrValue = aOut.makeStringAndClear();
|
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CY, aStrValue );
|
|
|
|
}
|
2001-10-23 09:05:52 +00:00
|
|
|
|
2002-09-25 15:19:26 +00:00
|
|
|
Color aColor;
|
2001-10-23 09:05:52 +00:00
|
|
|
|
2002-09-25 15:19:26 +00:00
|
|
|
// Transparency start
|
|
|
|
aColor.SetColor( aGradient.StartColor );
|
2004-07-13 07:21:45 +00:00
|
|
|
sal_Int32 aStartValue = 100 - (sal_Int32)(((aColor.GetRed() + 1) * 100) / 255);
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
::sax::Converter::convertPercent( aOut, aStartValue );
|
2001-10-23 09:05:52 +00:00
|
|
|
aStrValue = aOut.makeStringAndClear();
|
2002-09-25 15:19:26 +00:00
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START, aStrValue );
|
|
|
|
|
|
|
|
// Transparency end
|
|
|
|
aColor.SetColor( aGradient.EndColor );
|
2004-07-13 07:21:45 +00:00
|
|
|
sal_Int32 aEndValue = 100 - (sal_Int32)(((aColor.GetRed() + 1) * 100) / 255);
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
::sax::Converter::convertPercent( aOut, aEndValue );
|
2002-09-25 15:19:26 +00:00
|
|
|
aStrValue = aOut.makeStringAndClear();
|
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END, aStrValue );
|
|
|
|
|
|
|
|
// Angle
|
|
|
|
if( aGradient.Style != awt::GradientStyle_RADIAL )
|
|
|
|
{
|
2015-10-09 17:51:50 +02:00
|
|
|
::sax::Converter::convertAngle(aOut, aGradient.Angle);
|
2002-09-25 15:19:26 +00:00
|
|
|
aStrValue = aOut.makeStringAndClear();
|
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue );
|
|
|
|
}
|
2001-10-23 09:05:52 +00:00
|
|
|
|
2002-09-25 15:19:26 +00:00
|
|
|
// Border
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
::sax::Converter::convertPercent( aOut, aGradient.Border );
|
2002-09-25 15:19:26 +00:00
|
|
|
aStrValue = aOut.makeStringAndClear();
|
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, aStrValue );
|
2001-10-23 09:05:52 +00:00
|
|
|
|
2002-09-25 15:19:26 +00:00
|
|
|
// Do Write
|
|
|
|
SvXMLElementExport rElem( rExport,
|
2004-07-13 07:21:45 +00:00
|
|
|
XML_NAMESPACE_DRAW, XML_OPACITY,
|
2014-03-28 16:28:51 +02:00
|
|
|
true, false );
|
2002-09-25 15:19:26 +00:00
|
|
|
}
|
2001-10-23 09:05:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|