diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-01-07 22:27:41 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-01-07 22:27:41 +0100 |
commit | eda0cec9ac990020e9da804ec3ed38e2cbfeeb77 (patch) | |
tree | ce01afe125d3868a9677004b2aa5ef47b67aefaf /xmloff | |
parent | Fix type SMPT->SMTP (diff) | |
download | core-eda0cec9ac990020e9da804ec3ed38e2cbfeeb77.tar.gz core-eda0cec9ac990020e9da804ec3ed38e2cbfeeb77.zip |
Revert "dummy commit (WIP)"
This reverts commit 6eb0522395c236ae6930a300992ad092449f9592.
It does not compile and the message and contents suggest it probably wasn't
meant to be pushed.
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/Library_xo.mk | 1 | ||||
-rw-r--r-- | xmloff/Package_inc.mk | 1 | ||||
-rw-r--r-- | xmloff/inc/xmloff/xmlstyle.hxx | 5 | ||||
-rw-r--r-- | xmloff/source/style/FillStyleContext.cxx | 151 | ||||
-rw-r--r-- | xmloff/source/style/FillStyleContext.hxx | 67 | ||||
-rw-r--r-- | xmloff/source/style/GradientStyle.cxx | 12 | ||||
-rw-r--r-- | xmloff/source/style/xmlstyle.cxx | 5 |
7 files changed, 9 insertions, 233 deletions
diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk index 4b9e68dbaa77..b8164826f2df 100644 --- a/xmloff/Library_xo.mk +++ b/xmloff/Library_xo.mk @@ -196,7 +196,6 @@ $(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 dd324302bf81..9b3628b691db 100644 --- a/xmloff/Package_inc.mk +++ b/xmloff/Package_inc.mk @@ -22,7 +22,6 @@ $(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 74c7b0223917..8296b24799a0 100644 --- a/xmloff/inc/xmloff/xmlstyle.hxx +++ b/xmloff/inc/xmloff/xmlstyle.hxx @@ -45,7 +45,6 @@ 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, @@ -75,8 +74,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 is somehow invalid. - sal_Bool mbNew : 1; // Set this to false in CreateAndInsert + // by Finish() or si somehow invalid. + sal_Bool mbNew : 1; // Set this to false in CreateAnsInsert // 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 330573cf0ece..563da21714eb 100644 --- a/xmloff/source/style/FillStyleContext.cxx +++ b/xmloff/source/style/FillStyleContext.cxx @@ -18,11 +18,9 @@ */ #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" @@ -32,8 +30,6 @@ #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; @@ -50,6 +46,7 @@ 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 ); @@ -89,152 +86,6 @@ 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 f90c100e3017..b8d1d795864b 100644 --- a/xmloff/source/style/FillStyleContext.hxx +++ b/xmloff/source/style/FillStyleContext.hxx @@ -21,12 +21,11 @@ #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:gradient context +// draw:gardient context class XMLGradientStyleContext: public SvXMLStyleContext { @@ -47,68 +46,6 @@ 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 0be3650be642..eb432e7dba01 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -90,8 +90,6 @@ 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; @@ -109,7 +107,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 }, @@ -128,14 +126,13 @@ 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 ) ) @@ -202,8 +199,8 @@ sal_Bool XMLGradientStyleImport::importXML( break; default: - SAL_INFO("svg", "Unknown token at import gradient style"); - DBG_WARNING( "Unknown token at import gradient style" ); + DBG_WARNING( "Unknown token at import gradient style" ) + ; } } @@ -245,7 +242,6 @@ 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 da698c0aa557..b69f3f6b97f6 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -490,11 +490,6 @@ 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 ); |