diff options
author | Michael Stahl <mst@openoffice.org> | 2011-10-11 14:19:00 +0200 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2011-10-11 17:57:00 +0200 |
commit | 3ca2bef76886450058d1667703aeafe4c2e456c3 (patch) | |
tree | b18d70f79bfcfd2b2e34790e86edafb4c4337a80 /filter | |
parent | 02c32e0f0e75a9df80888051d1ec189fa14129bd (diff) |
#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
Diffstat (limited to 'filter')
-rw-r--r-- | filter/Library_svgfilter.mk | 1 | ||||
-rw-r--r-- | filter/Library_xsltfilter.mk | 1 | ||||
-rw-r--r-- | filter/source/svg/svgreader.cxx | 4 | ||||
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 6 | ||||
-rw-r--r-- | filter/source/svg/svgwriter.hxx | 1 | ||||
-rw-r--r-- | filter/source/xsltfilter/OleHandler.cxx | 16 | ||||
-rw-r--r-- | filter/source/xsltfilter/OleHandler.hxx | 1 |
7 files changed, 20 insertions, 10 deletions
diff --git a/filter/Library_svgfilter.mk b/filter/Library_svgfilter.mk index 9a6e19aa9c9c..dbdd5be86f6e 100644 --- a/filter/Library_svgfilter.mk +++ b/filter/Library_svgfilter.mk @@ -47,6 +47,7 @@ $(eval $(call gb_Library_add_linked_libs,svgfilter,\ svl \ utl \ tl \ + sax \ comphelper \ basegfx \ cppuhelper \ diff --git a/filter/Library_xsltfilter.mk b/filter/Library_xsltfilter.mk index 2409a47aab4f..0208ecda8c66 100644 --- a/filter/Library_xsltfilter.mk +++ b/filter/Library_xsltfilter.mk @@ -35,6 +35,7 @@ $(eval $(call gb_Library_add_linked_libs,xsltfilter,\ xo \ tl \ package2 \ + sax \ comphelper \ ucbhelper \ cppuhelper \ diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 125a68f2e406..6b66c5081509 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -56,7 +56,7 @@ #include <basegfx/polygon/b2dpolygoncutandtouch.hxx> #include <basegfx/polygon/b2dpolypolygoncutter.hxx> #include <unotools/streamwrap.hxx> -#include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include <vcl/graph.hxx> #include <vcl/virdev.hxx> #include <vcl/gradient.hxx> @@ -2311,7 +2311,7 @@ struct ShapeRenderingVisitor Graphic aGraphic; uno::Sequence<sal_Int8> aData; - SvXMLUnitConverter::decodeBase64(aData, + ::sax::Converter::decodeBase64(aData, rtl::OUString::createFromAscii(sLinkValue.c_str())); SvMemoryStream aSrc(aData.getArray(), aData.getLength(), diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index a3c89ea0251f..66ca7bd5156c 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -32,7 +32,11 @@ #include "svgfilter.hxx" #include "svgfontexport.hxx" #include "svgwriter.hxx" + #include <vcl/unohelp.hxx> + +#include <sax/tools/converter.hxx> + #include <boost/shared_array.hpp> using ::rtl::OUString; @@ -1328,7 +1332,7 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, Sequence< sal_Int8 > aSeq( (sal_Int8*) aOStm.GetData(), aOStm.Tell() ); rtl::OUStringBuffer aBuffer; aBuffer.appendAscii( "data:image/png;base64," ); - SvXMLUnitConverter::encodeBase64( aBuffer, aSeq ); + ::sax::Converter::encodeBase64( aBuffer, aSeq ); if( bApplyMapping ) { diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index 814c67dbd883..dd033a2bb3cc 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -46,7 +46,6 @@ #include <vcl/rendergraphicrasterizer.hxx> #include <xmloff/xmlexp.hxx> #include <xmloff/nmspmap.hxx> -#include <xmloff/xmluconv.hxx> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/RuntimeException.hpp> diff --git a/filter/source/xsltfilter/OleHandler.cxx b/filter/source/xsltfilter/OleHandler.cxx index a26642f51a33..f411695efb4f 100644 --- a/filter/source/xsltfilter/OleHandler.cxx +++ b/filter/source/xsltfilter/OleHandler.cxx @@ -42,7 +42,11 @@ #include <libxslt/transform.h> #include <libxslt/xsltutils.h> #include <libxslt/variables.h> -#include <xmloff/xmluconv.hxx> + +#include <rtl/ustrbuf.hxx> + +#include <sax/tools/converter.hxx> + #include <package/Inflater.hxx> #include <package/Deflater.hxx> @@ -95,7 +99,8 @@ namespace XSLT void SAL_CALL OleHandler::initRootStorageFromBase64(const OString& content) { Sequence<sal_Int8> oleData; - SvXMLUnitConverter::decodeBase64(oleData, ::rtl::OStringToOUString(content, RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS)); + ::sax::Converter::decodeBase64(oleData, ::rtl::OStringToOUString( + content, RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS)); m_rootStream = createTempFile(); Reference<XOutputStream> xOutput = m_rootStream->getOutputStream(); xOutput->writeBytes(oleData); @@ -154,7 +159,7 @@ namespace XSLT delete decompresser; //return the base64 string of the uncompressed data OUStringBuffer buf(oleLength); - SvXMLUnitConverter::encodeBase64(buf, result); + ::sax::Converter::encodeBase64(buf, result); return ::rtl::OUStringToOString(buf.toString(), RTL_TEXTENCODING_UTF8); } @@ -187,7 +192,7 @@ namespace XSLT xInput->readBytes(oledata, oleLength); //return the base64 encoded string OUStringBuffer buf(oleLength); - SvXMLUnitConverter::encodeBase64(buf, oledata); + ::sax::Converter::encodeBase64(buf, oledata); return ::rtl::OUStringToOString(buf.toString(), RTL_TEXTENCODING_UTF8); } return encodeSubStorage(streamName); @@ -198,7 +203,8 @@ namespace XSLT { //decode the base64 string Sequence<sal_Int8> oledata; - SvXMLUnitConverter::decodeBase64(oledata, rtl::OStringToOUString(content, RTL_TEXTENCODING_ASCII_US)); + ::sax::Converter::decodeBase64(oledata, + rtl::OStringToOUString(content, RTL_TEXTENCODING_ASCII_US)); //create a temp stream to write data to Reference<XStream> subStream = createTempFile(); Reference<XInputStream> xInput = subStream->getInputStream(); diff --git a/filter/source/xsltfilter/OleHandler.hxx b/filter/source/xsltfilter/OleHandler.hxx index 1452b1a8c934..8db4f889796e 100644 --- a/filter/source/xsltfilter/OleHandler.hxx +++ b/filter/source/xsltfilter/OleHandler.hxx @@ -41,7 +41,6 @@ #include <libxslt/transform.h> #include <libxslt/xsltutils.h> #include <libxslt/variables.h> -#include <xmloff/xmluconv.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/servicefactory.hxx> |