summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChr. Rossmanith <ChrRossmanith@gmx.de>2013-01-01 21:38:06 +0100
committerChr. Rossmanith <ChrRossmanith@gmx.de>2013-01-07 19:39:46 +0100
commit6eb0522395c236ae6930a300992ad092449f9592 (patch)
tree0302cf16978c9cc6b91af9735b2ecc0f49b79422
parentf1043aaed082824ca423eee10be5802873e058f3 (diff)
dummy commit (WIP)
Change-Id: Ibeee6553312323b75b2403ad6832595f228e0e3c
-rw-r--r--filter/source/svg/svgreader.cxx24
-rw-r--r--offapi/UnoApi_offapi.mk2
-rw-r--r--svx/inc/svx/xflgrit.hxx5
-rw-r--r--svx/source/xoutdev/xattr.cxx19
-rw-r--r--xmloff/Library_xo.mk1
-rw-r--r--xmloff/Package_inc.mk1
-rw-r--r--xmloff/inc/xmloff/xmlstyle.hxx5
-rw-r--r--xmloff/source/style/FillStyleContext.cxx151
-rw-r--r--xmloff/source/style/FillStyleContext.hxx67
-rw-r--r--xmloff/source/style/GradientStyle.cxx12
-rw-r--r--xmloff/source/style/xmlstyle.cxx5
11 files changed, 274 insertions, 18 deletions
diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index 5e9e994de348..51a0860c8bfb 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -179,7 +179,6 @@ struct AnnotatingVisitor
case XML_LINEARGRADIENT:
{
const sal_Int32 nNumAttrs( xAttributes->getLength() );
- rtl::OUString sAttributeValue;
maGradientVector.push_back(Gradient(Gradient::LINEAR));
// do we have a reference to a parent gradient? parse
@@ -217,7 +216,6 @@ struct AnnotatingVisitor
case XML_RADIALGRADIENT:
{
const sal_Int32 nNumAttrs( xAttributes->getLength() );
- rtl::OUString sAttributeValue;
maGradientVector.push_back(Gradient(Gradient::RADIAL));
// do we have a reference to a parent gradient? parse
@@ -255,7 +253,6 @@ struct AnnotatingVisitor
case XML_STOP:
{
const sal_Int32 nNumAttrs( xAttributes->getLength() );
- rtl::OUString sAttributeValue;
maGradientStopVector.push_back(GradientStop());
maGradientVector.back().maStops.push_back(maGradientStopVector.size()-1);
for( sal_Int32 i=0; i<nNumAttrs; ++i )
@@ -518,7 +515,8 @@ struct AnnotatingVisitor
double rRotate, rShearX;
if( rState.maFillGradient.maTransform.decompose(rScale, rTranslate, rRotate, rShearX) )
xAttrs->AddAttribute( "draw:angle",
- rtl::OUString::valueOf(rRotate*1800.0/M_PI ) );
+ rtl::OUString::valueOf(rRotate*1800.0/M_PI + 900) );
+ SAL_INFO("svg", "maStops " << rState.maFillGradient.maStops[0] << " " << rState.maFillGradient.maStops[1] );
xAttrs->AddAttribute( "draw:start-color",
getOdfColor(
maGradientStopVector[
@@ -813,6 +811,11 @@ struct AnnotatingVisitor
const sal_Int32 nTokenId,
const rtl::OUString& sValue )
{
+ rtl::OString aValueUtf8( sValue.getStr(),
+ sValue.getLength(),
+ RTL_TEXTENCODING_UTF8 );
+
+ SAL_INFO("svg", "nTokenId " << nTokenId);
switch(nTokenId)
{
case XML_HREF:
@@ -836,7 +839,18 @@ struct AnnotatingVisitor
case XML_STYLE:
parseStyle( sValue );
break;
+ case XML_STOP_COLOR:
+ parseColor( aValueUtf8.getStr(), io_rGradientStop.maStopColor );
+ break;
+ case XML_STOP_OPACITY:
+ io_rGradientStop.maStopColor.a = sValue.toDouble();
+ if (io_rGradientStop.maStopColor.a < 0)
+ io_rGradientStop.maStopColor.a = 0;
+ else if (io_rGradientStop.maStopColor.a > 1)
+ io_rGradientStop.maStopColor.a = 1;
+ break;
default:
+ SAL_INFO("svg", "nTokenId unknown " << getTokenName(nTokenId));
break;
}
}
@@ -1031,9 +1045,11 @@ struct AnnotatingVisitor
parseTextAlign(maCurrState,aValueUtf8.getStr());
break;
case XML_STOP_COLOR:
+ SAL_INFO("svg", "XML_STOP_COLOR1");
if( maGradientVector.empty() ||
maGradientVector.back().maStops.empty() )
break;
+ SAL_INFO("svg", "XML_STOP_COLOR2");
parseColor( aValueUtf8.getStr(),
maGradientStopVector[
maGradientVector.back().maStops.back()].maStopColor );
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 56e5f4811ba8..454b2978e6b8 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -1642,7 +1642,9 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\
FontWeight \
FontWidth \
Gradient \
+ SvgGradient \
GradientStyle \
+ GradientSpread \
ImageAlign \
ImagePosition \
ImageScaleMode \
diff --git a/svx/inc/svx/xflgrit.hxx b/svx/inc/svx/xflgrit.hxx
index b4318cf1dc2c..62c04db4c78b 100644
--- a/svx/inc/svx/xflgrit.hxx
+++ b/svx/inc/svx/xflgrit.hxx
@@ -23,6 +23,7 @@
#include <svx/xit.hxx>
#include <svx/xgrad.hxx>
#include "svx/svxdllapi.h"
+#include <com/sun/star/awt/SvgGradient.hpp>
class SdrModel;
@@ -31,8 +32,8 @@ class SdrModel;
//------------------------
class SVX_DLLPUBLIC XFillGradientItem : public NameOrIndex
{
- XGradient aGradient;
-
+ XGradient aGradient;
+ ::com::sun::star::awt::SvgGradient aSvgGradient;
public:
TYPEINFO();
XFillGradientItem() : NameOrIndex(XATTR_FILLGRADIENT, -1) {}
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index ce3f1de6c077..097a34d49f9f 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -3443,6 +3443,7 @@ bool XFillGradientItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uI
{
if ( aPropSeq[n].Value >>= aGradient2 )
bGradient = true;
+
}
}
@@ -3483,11 +3484,19 @@ bool XFillGradientItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uI
case MID_FILLGRADIENT:
{
::com::sun::star::awt::Gradient aGradient2;
- if(!(rVal >>= aGradient2))
- return false;
+ ::com::sun::star::awt::SvgGradient aSvgGradient2;
+ bool bIsSvgGradient(false);
+
+ if( !(rVal >>= aGradient2) )
+ {
+ if( !(rVal >>= aSvgGradient2) )
+ return false;
+ bIsSvgGradient=true;
+ }
XGradient aXGradient;
+ if ( !bIsSvgGradient ) {
aXGradient.SetGradientStyle( (XGradientStyle) aGradient2.Style );
aXGradient.SetStartColor( aGradient2.StartColor );
aXGradient.SetEndColor( aGradient2.EndColor );
@@ -3498,7 +3507,11 @@ bool XFillGradientItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uI
aXGradient.SetStartIntens( aGradient2.StartIntensity );
aXGradient.SetEndIntens( aGradient2.EndIntensity );
aXGradient.SetSteps( aGradient2.StepCount );
-
+ }
+ else {
+ aXGradient.SetStartColor( aSvgGradient2.StopColor[0] );
+ aXGradient.SetEndColor( aSvgGradient2.StopColor[1] );
+ }
SetGradientValue( aXGradient );
break;
}
diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index b8164826f2df..4b9e68dbaa77 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -196,6 +196,7 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
xmloff/source/style/EnumPropertyHdl \
xmloff/source/style/FillStyleContext \
xmloff/source/style/GradientStyle \
+ xmloff/source/style/SvgGradientStyle \
xmloff/source/style/HatchStyle \
xmloff/source/style/ImageStyle \
xmloff/source/style/MarkerStyle \
diff --git a/xmloff/Package_inc.mk b/xmloff/Package_inc.mk
index 9b3628b691db..dd324302bf81 100644
--- a/xmloff/Package_inc.mk
+++ b/xmloff/Package_inc.mk
@@ -22,6 +22,7 @@ $(eval $(call gb_Package_add_file,xmloff_inc,inc/xmloff/DashStyle.hxx,xmloff/Das
$(eval $(call gb_Package_add_file,xmloff_inc,inc/xmloff/DocumentSettingsContext.hxx,xmloff/DocumentSettingsContext.hxx))
$(eval $(call gb_Package_add_file,xmloff_inc,inc/xmloff/EnumPropertyHdl.hxx,xmloff/EnumPropertyHdl.hxx))
$(eval $(call gb_Package_add_file,xmloff_inc,inc/xmloff/GradientStyle.hxx,xmloff/GradientStyle.hxx))
+$(eval $(call gb_Package_add_file,xmloff_inc,inc/xmloff/SvgGradientStyle.hxx,xmloff/SvgGradientStyle.hxx))
$(eval $(call gb_Package_add_file,xmloff_inc,inc/xmloff/HatchStyle.hxx,xmloff/HatchStyle.hxx))
$(eval $(call gb_Package_add_file,xmloff_inc,inc/xmloff/ImageStyle.hxx,xmloff/ImageStyle.hxx))
$(eval $(call gb_Package_add_file,xmloff_inc,inc/xmloff/MarkerStyle.hxx,xmloff/MarkerStyle.hxx))
diff --git a/xmloff/inc/xmloff/xmlstyle.hxx b/xmloff/inc/xmloff/xmlstyle.hxx
index 8296b24799a0..74c7b0223917 100644
--- a/xmloff/inc/xmloff/xmlstyle.hxx
+++ b/xmloff/inc/xmloff/xmlstyle.hxx
@@ -45,6 +45,7 @@ enum XMLStyleStylesElemTokens
XML_TOK_TEXT_LIST_STYLE,
XML_TOK_TEXT_OUTLINE,
XML_TOK_STYLES_GRADIENTSTYLES,
+ XML_TOK_STYLES_LINEARGRADIENTSTYLES,
XML_TOK_STYLES_HATCHSTYLES,
XML_TOK_STYLES_BITMAPSTYLES,
XML_TOK_STYLES_TRANSGRADIENTSTYLES,
@@ -74,8 +75,8 @@ class XMLOFF_DLLPUBLIC SvXMLStyleContext : public SvXMLImportContext
sal_Bool mbValid : 1; // Set this to false in CreateAndInsert
// if the style shouldn't be processed
- // by Finish() or si somehow invalid.
- sal_Bool mbNew : 1; // Set this to false in CreateAnsInsert
+ // by Finish() or is somehow invalid.
+ sal_Bool mbNew : 1; // Set this to false in CreateAndInsert
// if the style is already existing.
sal_Bool mbDefaultStyle : 1;
diff --git a/xmloff/source/style/FillStyleContext.cxx b/xmloff/source/style/FillStyleContext.cxx
index 563da21714eb..330573cf0ece 100644
--- a/xmloff/source/style/FillStyleContext.cxx
+++ b/xmloff/source/style/FillStyleContext.cxx
@@ -18,9 +18,11 @@
*/
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/awt/SvgGradient.hpp>
#include "FillStyleContext.hxx"
#include <xmloff/xmlimp.hxx>
#include "xmloff/GradientStyle.hxx"
+#include "xmloff/SvgGradientStyle.hxx"
#include "xmloff/HatchStyle.hxx"
#include "xmloff/ImageStyle.hxx"
#include "TransGradientStyle.hxx"
@@ -30,6 +32,8 @@
#include <xmloff/nmspmap.hxx>
#include "xmloff/xmlnmspe.hxx"
#include <xmloff/XMLBase64ImportContext.hxx>
+#include <sax/tools/converter.hxx>
+#include <comphelper/sequence.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -46,7 +50,6 @@ XMLGradientStyleContext::XMLGradientStyleContext( SvXMLImport& rImport, sal_uInt
const uno::Reference< xml::sax::XAttributeList >& xAttrList)
: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList)
{
-
// start import
XMLGradientStyleImport aGradientStyle( GetImport() );
aGradientStyle.importXML( xAttrList, maAny, maStrName );
@@ -86,6 +89,152 @@ sal_Bool XMLGradientStyleContext::IsTransient() const
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
+TYPEINIT1( XMLLinearGradientStyleContext, SvXMLStyleContext );
+
+XMLLinearGradientStyleContext::XMLLinearGradientStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const uno::Reference< xml::sax::XAttributeList >& xAttrList)
+: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList)
+{
+ // start import
+ XMLSvgGradientStyleImport aGradientStyle( GetImport() );
+ aGradientStyle.importXML( xAttrList, maAny, maStrName );
+}
+
+XMLLinearGradientStyleContext::~XMLLinearGradientStyleContext()
+{
+}
+
+
+SvXMLImportContext* XMLLinearGradientStyleContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList )
+{
+ if( (XML_NAMESPACE_SVG == nPrefix) && xmloff::token::IsXMLToken( rLocalName, xmloff::token::XML_STOP ) )
+ {
+ return new XMLSvgGradientStopImportContext(GetImport(),
+ nPrefix, rLocalName,
+ *this);
+ }
+ else
+ {
+ return SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
+ }
+}
+
+void XMLLinearGradientStyleContext::EndElement()
+{
+ uno::Reference< container::XNameContainer > xGradient( GetImport().GetGradientHelper() );
+
+ try
+ {
+ if(xGradient.is())
+ {
+ if( xGradient->hasByName( maStrName ) )
+ {
+ xGradient->replaceByName( maStrName, maAny );
+ }
+ else
+ {
+ xGradient->insertByName( maStrName, maAny );
+ }
+ }
+ }
+ catch( container::ElementExistException& )
+ {}
+}
+
+sal_Bool XMLLinearGradientStyleContext::IsTransient() const
+{
+ return sal_True;
+}
+
+void XMLLinearGradientStyleContext::SetGradientStop( ::com::sun::star::util::Color aColor, double aOffset)
+{
+ mStopColors.push_back( aColor );
+ mStopOffsets.push_back( aOffset );
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+TYPEINIT1( XMLSvgGradientStopImportContext, SvXMLImportContext );
+
+XMLSvgGradientStopImportContext::XMLSvgGradientStopImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ XMLLinearGradientStyleContext& rGradientStyle)
+ : SvXMLImportContext(rImport, nPrfx, rLName),
+ rGradientStyleContext(rGradientStyle)
+{
+}
+
+XMLSvgGradientStopImportContext::~XMLSvgGradientStopImportContext()
+{
+}
+
+void XMLSvgGradientStopImportContext::StartElement(
+ const uno::Reference<xml::sax::XAttributeList> & xAttrList)
+{
+ sal_Int16 nLength = xAttrList->getLength();
+ ::util::Color aColor;
+ OUString colorString("black");
+ double opacity = 1;
+ double offset=0;
+ double nTmp;
+
+ for(sal_Int16 i=0; i<nLength; i++)
+ {
+ OUString sLocalName;
+ sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
+ GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName );
+
+ if ( nPrefix == XML_NAMESPACE_SVG )
+ {
+ if ( xmloff::token::IsXMLToken(sLocalName, xmloff::token::XML_OFFSET) )
+ {
+ SAL_INFO("svg", "offset " << sLocalName << " " << xAttrList->getValueByIndex(i));
+ OUString value = xAttrList->getValueByIndex( i );
+ // using convertDouble instead of convertPercent because the latter expects sal_Int32& as its first arg
+ if ((value.indexOf( "%" ) != -1) && ::sax::Converter::convertDouble( nTmp, value ))
+ {
+ SAL_INFO("svg", "offset converted " << nTmp/100);
+ offset = nTmp * 0.01;
+ }
+ else if ( ::sax::Converter::convertDouble( nTmp, value ) ) {
+ SAL_INFO("svg", "offset converted " << nTmp);
+ offset = nTmp;
+ }
+ else
+ {
+ SAL_WARN("svg", "Could not convert gradient offset " << value);
+ }
+ }
+ else if ( xmloff::token::IsXMLToken(sLocalName, xmloff::token::XML_STOPCOLOR) )
+ {
+ colorString = xAttrList->getValueByIndex(i);
+ SAL_INFO("svg", "stop color " << sLocalName << " " << xAttrList->getValueByIndex(i));
+ }
+ else if ( xmloff::token::IsXMLToken(sLocalName, xmloff::token::XML_STOPOPACITY) )
+ {
+ SAL_INFO("svg", "stop opacity " << sLocalName << " " << xAttrList->getValueByIndex(i));
+ ::sax::Converter::convertDouble( nTmp, xAttrList->getValueByIndex(i) );
+ opacity = nTmp;
+ }
+ }
+ }
+ bool bColorSet;
+ bColorSet = ::sax::Converter::convertColor( aColor, colorString, opacity );
+ rGradientStyleContext.SetGradientStop( aColor, offset );
+}
+
+void XMLSvgGradientStopImportContext::EndElement()
+{
+ // uno::Reference< container::XNameContainer > xGradient( GetImport().GetGradientHelper() );
+
+ SAL_INFO("svgb", "EndElement");
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
TYPEINIT1( XMLHatchStyleContext, SvXMLStyleContext );
XMLHatchStyleContext::XMLHatchStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
diff --git a/xmloff/source/style/FillStyleContext.hxx b/xmloff/source/style/FillStyleContext.hxx
index b8d1d795864b..f90c100e3017 100644
--- a/xmloff/source/style/FillStyleContext.hxx
+++ b/xmloff/source/style/FillStyleContext.hxx
@@ -21,11 +21,12 @@
#define _XMLOFF_FILLSTYLECONTEXTS_HXX_
#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/util/Color.hpp>
#include <xmloff/xmlstyle.hxx>
-#include<rtl/ustring.hxx>
+#include <rtl/ustring.hxx>
//////////////////////////////////////////////////////////////////////////////
-// draw:gardient context
+// draw:gradient context
class XMLGradientStyleContext: public SvXMLStyleContext
{
@@ -46,6 +47,68 @@ public:
};
//////////////////////////////////////////////////////////////////////////////
+// svg:linearGradient context
+class XMLLinearGradientStyleContext: public SvXMLStyleContext
+{
+private:
+ ::com::sun::star::uno::Any maAny;
+ rtl::OUString maStrName;
+ ::std::vector< ::com::sun::star::util::Color > mStopColors;
+ ::std::vector< double > mStopOffsets;
+
+public:
+ TYPEINFO();
+
+ XMLLinearGradientStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName,
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::sax::XAttributeList> & xAttrList );
+ virtual ~XMLLinearGradientStyleContext();
+
+ virtual void EndElement();
+
+ virtual sal_Bool IsTransient() const;
+
+ void SetGradientStop( ::com::sun::star::util::Color aColor, double aOffset);
+
+protected:
+ virtual SvXMLImportContext *CreateChildContext(
+ sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// import svg:stop elements
+class XMLSvgGradientStopImportContext : public SvXMLImportContext
+{
+ XMLLinearGradientStyleContext& rGradientStyleContext;
+
+private:
+ ::com::sun::star::uno::Any maAny;
+
+public:
+
+ TYPEINFO();
+
+ XMLSvgGradientStopImportContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLocalName,
+ XMLLinearGradientStyleContext& rGradientStyle);
+
+ ~XMLSvgGradientStopImportContext();
+
+protected:
+
+ virtual void StartElement(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
+
+ virtual void EndElement();
+};
+
+//////////////////////////////////////////////////////////////////////////////
// draw:hatch context
class XMLHatchStyleContext: public SvXMLStyleContext
diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx
index eb432e7dba01..0be3650be642 100644
--- a/xmloff/source/style/GradientStyle.cxx
+++ b/xmloff/source/style/GradientStyle.cxx
@@ -90,6 +90,8 @@ sal_Bool XMLGradientStyleImport::importXML(
uno::Any& rValue,
OUString& rStrName )
{
+ SAL_INFO ("svg", "importXML");
+
sal_Bool bRet = sal_False;
sal_Bool bHasName = sal_False;
sal_Bool bHasStyle = sal_False;
@@ -107,7 +109,7 @@ sal_Bool XMLGradientStyleImport::importXML(
{
static 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 },
@@ -126,13 +128,14 @@ sal_Bool XMLGradientStyleImport::importXML(
SvXMLNamespaceMap& rNamespaceMap = rImport.GetNamespaceMap();
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ SAL_INFO ("svg", "nAttrCount " << nAttrCount);
for( sal_Int16 i=0; i < nAttrCount; i++ )
{
const OUString& rFullAttrName = xAttrList->getNameByIndex( i );
OUString aStrAttrName;
sal_uInt16 nPrefix = rNamespaceMap.GetKeyByAttrName( rFullAttrName, &aStrAttrName );
const OUString& rStrValue = xAttrList->getValueByIndex( i );
-
+ SAL_INFO ("svg", "FullAttrName: " << rFullAttrName << " rStrValue: " << rStrValue << " aStrAttrName: " << aStrAttrName);
sal_Int32 nTmpValue;
switch( aTokenMap.Get( nPrefix, aStrAttrName ) )
@@ -199,8 +202,8 @@ sal_Bool XMLGradientStyleImport::importXML(
break;
default:
- DBG_WARNING( "Unknown token at import gradient style" )
- ;
+ SAL_INFO("svg", "Unknown token at import gradient style");
+ DBG_WARNING( "Unknown token at import gradient style" );
}
}
@@ -242,6 +245,7 @@ sal_Bool XMLGradientStyleExport::exportXML(
sal_Bool bRet = sal_False;
awt::Gradient aGradient;
+
if( !rStrName.isEmpty() )
{
if( rValue >>= aGradient )
diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx
index b69f3f6b97f6..da698c0aa557 100644
--- a/xmloff/source/style/xmlstyle.cxx
+++ b/xmloff/source/style/xmlstyle.cxx
@@ -490,6 +490,11 @@ SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext( sal_uInt16 p_nPr
pStyle = new XMLGradientStyleContext( GetImport(), p_nPrefix, rLocalName, xAttrList );
break;
}
+ case XML_TOK_STYLES_LINEARGRADIENTSTYLES:
+ {
+ pStyle = new XMLLinearGradientStyleContext( GetImport(), p_nPrefix, rLocalName, xAttrList );
+ break;
+ }
case XML_TOK_STYLES_HATCHSTYLES:
{
pStyle = new XMLHatchStyleContext( GetImport(), p_nPrefix, rLocalName, xAttrList );