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
|
|
|
|
2013-11-11 22:30:35 -06:00
|
|
|
#include <xmloff/GradientStyle.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:24:45 +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>
|
2007-06-27 14:24:45 +00:00
|
|
|
#include <xmloff/xmltoken.hxx>
|
2001-06-29 20:07:26 +00:00
|
|
|
#include <rtl/ustrbuf.hxx>
|
2006-06-19 17:24:53 +00:00
|
|
|
#include <rtl/ustring.hxx>
|
2018-07-11 08:00:51 +02:00
|
|
|
#include <sal/log.hxx>
|
2007-06-27 14:24:45 +00:00
|
|
|
#include <xmloff/xmltkmap.hxx>
|
|
|
|
#include <xmloff/xmlexp.hxx>
|
|
|
|
#include <xmloff/xmlimp.hxx>
|
2019-01-12 22:28:32 +01:00
|
|
|
#include <xmloff/xmlement.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:42:21 +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:18: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_STARTCOLOR,
|
|
|
|
XML_TOK_GRADIENT_ENDCOLOR,
|
|
|
|
XML_TOK_GRADIENT_STARTINT,
|
|
|
|
XML_TOK_GRADIENT_ENDINT,
|
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
|
|
|
|
};
|
|
|
|
|
2017-03-09 09:04:15 +02:00
|
|
|
SvXMLEnumMapEntry<awt::GradientStyle> 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 },
|
2018-01-15 09:00:57 +01:00
|
|
|
{ XML_TOKEN_INVALID, awt::GradientStyle(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
|
|
|
XMLGradientStyleImport::XMLGradientStyleImport(
|
|
|
|
SvXMLImport& rImp )
|
|
|
|
: rImport(rImp)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-10-19 17:43:58 +00:00
|
|
|
XMLGradientStyleImport::~XMLGradientStyleImport()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-01-15 09:36:20 +02:00
|
|
|
void XMLGradientStyleImport::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
|
|
|
{
|
2014-03-27 14:39:19 +02:00
|
|
|
static const SvXMLTokenMapEntry aGradientAttrTokenMap[] =
|
|
|
|
{
|
|
|
|
{ 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_COLOR, XML_TOK_GRADIENT_STARTCOLOR },
|
|
|
|
{ XML_NAMESPACE_DRAW, XML_END_COLOR, XML_TOK_GRADIENT_ENDCOLOR },
|
|
|
|
{ XML_NAMESPACE_DRAW, XML_START_INTENSITY, XML_TOK_GRADIENT_STARTINT },
|
|
|
|
{ XML_NAMESPACE_DRAW, XML_END_INTENSITY, XML_TOK_GRADIENT_ENDINT },
|
|
|
|
{ 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,
|
2017-06-27 00:46:25 +05:30
|
|
|
XML_ELEMENT( DRAW, XML_BORDER ) },
|
2016-08-26 23:32:23 +05:30
|
|
|
// XML_GRADIENT_BORDER is a duplicate of XML_BORDER
|
2014-03-27 14:39:19 +02:00
|
|
|
XML_TOKEN_MAP_END
|
|
|
|
};
|
|
|
|
|
2004-07-13 07:18: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;
|
|
|
|
|
|
|
|
SvXMLTokenMap aTokenMap( aGradientAttrTokenMap );
|
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 );
|
2013-01-07 22:27:41 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
sal_Int32 nTmpValue;
|
|
|
|
|
|
|
|
switch( aTokenMap.Get( nPrefix, aStrAttrName ) )
|
|
|
|
{
|
|
|
|
case XML_TOK_GRADIENT_NAME:
|
2016-01-15 10:42:04 +02:00
|
|
|
rStrName = rStrValue;
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
2004-07-13 07:18:45 +00:00
|
|
|
case XML_TOK_GRADIENT_DISPLAY_NAME:
|
2016-01-15 10:42:04 +02:00
|
|
|
aDisplayName = rStrValue;
|
2004-07-13 07:18:45 +00:00
|
|
|
break;
|
2000-09-18 16:07:07 +00:00
|
|
|
case XML_TOK_GRADIENT_STYLE:
|
2017-03-09 09:04:15 +02:00
|
|
|
SvXMLUnitConverter::convertEnum( aGradient.Style, rStrValue, pXML_GradientStyle_Enum );
|
2000-09-18 16:07:07 +00:00
|
|
|
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 );
|
2004-07-13 07:18:45 +00:00
|
|
|
aGradient.XOffset = static_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 );
|
2004-07-13 07:18:45 +00:00
|
|
|
aGradient.YOffset = static_cast< sal_Int16 >( nTmpValue );
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case XML_TOK_GRADIENT_STARTCOLOR:
|
2016-01-15 10:42:04 +02:00
|
|
|
::sax::Converter::convertColor(aGradient.StartColor, rStrValue);
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case XML_TOK_GRADIENT_ENDCOLOR:
|
2016-01-15 10:42:04 +02:00
|
|
|
::sax::Converter::convertColor(aGradient.EndColor, rStrValue);
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case XML_TOK_GRADIENT_STARTINT:
|
#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 );
|
2004-07-13 07:18:45 +00:00
|
|
|
aGradient.StartIntensity = static_cast< sal_Int16 >( nTmpValue );
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
case XML_TOK_GRADIENT_ENDINT:
|
#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 );
|
2004-07-13 07:18:45 +00:00
|
|
|
aGradient.EndIntensity = static_cast< sal_Int16 >( nTmpValue );
|
2000-09-18 16:07:07 +00:00
|
|
|
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 );
|
2004-07-13 07:18:45 +00:00
|
|
|
aGradient.Border = static_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 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:18: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-19 17:43:58 +00:00
|
|
|
|
2001-10-23 09:05:52 +00:00
|
|
|
// Export
|
|
|
|
|
|
|
|
XMLGradientStyleExport::XMLGradientStyleExport(
|
|
|
|
SvXMLExport& rExp )
|
|
|
|
: rExport(rExp)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
XMLGradientStyleExport::~XMLGradientStyleExport()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-01-15 09:36:20 +02:00
|
|
|
void XMLGradientStyleExport::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-15 09:36:20 +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:18:45 +00:00
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
|
2016-04-12 16:39:03 +02:00
|
|
|
rExport.EncodeStyleName( rStrName,
|
2004-07-13 07:18:45 +00:00
|
|
|
&bEncoded ) );
|
|
|
|
if( bEncoded )
|
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
|
2016-04-12 16:39:03 +02:00
|
|
|
rStrName );
|
2004-07-13 07:18:45 +00:00
|
|
|
|
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 );
|
#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 );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Color start
|
#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::convertColor(aOut, aGradient.StartColor);
|
2002-09-25 15:19:26 +00:00
|
|
|
aStrValue = aOut.makeStringAndClear();
|
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_COLOR, aStrValue );
|
2001-10-23 09:05:52 +00:00
|
|
|
|
2002-09-25 15:19:26 +00:00
|
|
|
// Color end
|
#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::convertColor(aOut, aGradient.EndColor);
|
2002-09-25 15:19:26 +00:00
|
|
|
aStrValue = aOut.makeStringAndClear();
|
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_COLOR, aStrValue );
|
2001-10-23 09:05:52 +00:00
|
|
|
|
2002-09-25 15:19:26 +00:00
|
|
|
// Intensity start
|
#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.StartIntensity);
|
2002-09-25 15:19:26 +00:00
|
|
|
aStrValue = aOut.makeStringAndClear();
|
|
|
|
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_INTENSITY, aStrValue );
|
2001-10-23 09:05:52 +00:00
|
|
|
|
2002-09-25 15:19:26 +00:00
|
|
|
// Intensity end
|
#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.EndIntensity);
|
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_END_INTENSITY, aStrValue );
|
2001-10-23 09:05:52 +00:00
|
|
|
|
2002-09-25 15:19:26 +00:00
|
|
|
// 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 );
|
|
|
|
|
|
|
|
// Do Write
|
|
|
|
SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_GRADIENT,
|
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: */
|