diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 12:19:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 14:25:02 +0100 |
commit | ddd43218e9900536381733735adf8681d345e775 (patch) | |
tree | 5bb211e63d9b739d20eb248f1ab9f0fb481e118d /xmloff/source | |
parent | 9c036b1d3db253a1fd43ce76ce1d919e2029af59 (diff) |
drop sax::tools::*base64 methods
and use the underlying comphelper methods rather. This is so that I can
break the dependency that tools has on sax, and can add methods that
make sax depend on tools.
Change-Id: I8a2d6ce2ffc3529a0020710ade6a1748ee5af7d5
Reviewed-on: https://gerrit.libreoffice.org/50767
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/core/DocumentSettingsContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/core/SettingsExportHelper.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/core/XMLBase64Export.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/core/XMLBase64ImportContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/XMLSectionExport.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/XMLSectionImportContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/transform/OOo2Oasis.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/transform/Oasis2OOo.cxx | 5 |
9 files changed, 19 insertions, 10 deletions
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx index 02965c05b822..8d4c2c05ba59 100644 --- a/xmloff/source/core/DocumentSettingsContext.cxx +++ b/xmloff/source/core/DocumentSettingsContext.cxx @@ -31,6 +31,7 @@ #include <xmloff/nmspmap.hxx> #include <xmloff/xmluconv.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/base64.hxx> #include <vector> #include <com/sun/star/i18n/XForbiddenCharacters.hpp> @@ -498,7 +499,7 @@ void XMLConfigItemContext::Characters( const OUString& rChars ) } uno::Sequence<sal_Int8> aBuffer((sChars.getLength() / 4) * 3 ); sal_Int32 const nCharsDecoded = - ::sax::Converter::decodeBase64SomeChars( aBuffer, sChars ); + ::comphelper::Base64::decodeSomeChars( aBuffer, sChars ); sal_uInt32 nStartPos(maDecoded.getLength()); sal_uInt32 nCount(aBuffer.getLength()); maDecoded.realloc(nStartPos + nCount); diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx index 92e2a61c94e5..045028a423f8 100644 --- a/xmloff/source/core/SettingsExportHelper.cxx +++ b/xmloff/source/core/SettingsExportHelper.cxx @@ -25,6 +25,7 @@ #include <xmloff/xmltoken.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <comphelper/base64.hxx> #include <comphelper/extract.hxx> #include <comphelper/processfactory.hxx> @@ -344,7 +345,7 @@ void XMLSettingsExportHelper::exportbase64Binary( if(nLength) { OUStringBuffer sBuffer; - ::sax::Converter::encodeBase64(sBuffer, aProps); + ::comphelper::Base64::encode(sBuffer, aProps); m_rContext.Characters( sBuffer.makeStringAndClear() ); } m_rContext.EndElement( false ); diff --git a/xmloff/source/core/XMLBase64Export.cxx b/xmloff/source/core/XMLBase64Export.cxx index fe431e34edd6..26efc980f443 100644 --- a/xmloff/source/core/XMLBase64Export.cxx +++ b/xmloff/source/core/XMLBase64Export.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/io/XInputStream.hpp> #include <sax/tools/converter.hxx> +#include <comphelper/base64.hxx> #include <xmloff/xmlexp.hxx> #include <xmloff/xmlnmspe.hxx> @@ -51,7 +52,7 @@ bool XMLBase64Export::exportXML( const Reference < XInputStream> & rIn ) nRead = rIn->readBytes( aInBuff, INPUT_BUFFER_SIZE ); if( nRead > 0 ) { - ::sax::Converter::encodeBase64( aOutBuff, aInBuff ); + ::comphelper::Base64::encode( aOutBuff, aInBuff ); GetExport().Characters( aOutBuff.makeStringAndClear() ); if( nRead == INPUT_BUFFER_SIZE ) GetExport().IgnorableWhitespace(); diff --git a/xmloff/source/core/XMLBase64ImportContext.cxx b/xmloff/source/core/XMLBase64ImportContext.cxx index c44ddd907d3d..fd3fdae5b768 100644 --- a/xmloff/source/core/XMLBase64ImportContext.cxx +++ b/xmloff/source/core/XMLBase64ImportContext.cxx @@ -20,6 +20,7 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <sax/tools/converter.hxx> +#include <comphelper/base64.hxx> #include <xmloff/xmlimp.hxx> #include <xmloff/XMLBase64ImportContext.hxx> @@ -65,7 +66,7 @@ void XMLBase64ImportContext::Characters( const OUString& rChars ) } Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 ); sal_Int32 const nCharsDecoded = - ::sax::Converter::decodeBase64SomeChars( aBuffer, sChars ); + ::comphelper::Base64::decodeSomeChars( aBuffer, sChars ); xOut->writeBytes( aBuffer ); if( nCharsDecoded != sChars.getLength() ) sBase64CharsLeft = sChars.copy( nCharsDecoded ); diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index 46189a119ca7..e8c3533d5a39 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/text/ChapterFormat.hpp> #include <sax/tools/converter.hxx> +#include <comphelper/base64.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmlnmspe.hxx> @@ -397,7 +398,7 @@ void XMLSectionExport::ExportRegularSectionStart( if (aPassword.getLength() > 0) { OUStringBuffer aBuffer; - ::sax::Converter::encodeBase64(aBuffer, aPassword); + ::comphelper::Base64::encode(aBuffer, aPassword); // in ODF 1.0/1.1 the algorithm was left unspecified so we can write anything GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx index 50021e9159f3..a7e971e4dc14 100644 --- a/xmloff/source/text/XMLSectionImportContext.cxx +++ b/xmloff/source/text/XMLSectionImportContext.cxx @@ -20,6 +20,7 @@ #include "XMLSectionImportContext.hxx" #include "XMLSectionSourceImportContext.hxx" #include "XMLSectionSourceDDEImportContext.hxx" +#include <comphelper/base64.hxx> #include <xmloff/xmlictxt.hxx> #include <xmloff/xmlimp.hxx> #include <xmloff/txtimp.hxx> @@ -283,7 +284,7 @@ void XMLSectionImportContext::ProcessAttributes( } break; case XML_TOK_SECTION_PROTECTION_KEY: - ::sax::Converter::decodeBase64(aSequence, sAttr); + ::comphelper::Base64::decode(aSequence, sAttr); bSequenceOK = true; break; case XML_TOK_SECTION_PROTECT: diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 9d60d11072dc..0580c1a70915 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -19,6 +19,7 @@ #include <o3tl/make_unique.hxx> #include <osl/diagnose.h> +#include <comphelper/base64.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -1215,7 +1216,7 @@ void XMLTextFrameContext_Impl::Characters( const OUString& rChars ) } Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 ); sal_Int32 nCharsDecoded = - ::sax::Converter::decodeBase64SomeChars( aBuffer, sChars ); + ::comphelper::Base64::decodeSomeChars( aBuffer, sChars ); xBase64Stream->writeBytes( aBuffer ); if( nCharsDecoded != sChars.getLength() ) sBase64CharsLeft = sChars.copy( nCharsDecoded ); diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index b3f7ccbefdcd..50eee3b7fb9e 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -20,6 +20,7 @@ #include <rtl/ustrbuf.hxx> #include <osl/diagnose.h> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <comphelper/base64.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/servicehelper.hxx> #include <sax/tools/converter.hxx> @@ -1414,7 +1415,7 @@ void XMLTrackedChangesOOoTContext_Impl::StartElement( xPropSetInfo->hasPropertyByName( aPropName ) ) { Sequence < sal_Int8 > aKey; - ::sax::Converter::decodeBase64( aKey, + ::comphelper::Base64::decode( aKey, rAttrList->getValueByIndex( i ) ); rPropSet->setPropertyValue( aPropName, makeAny( aKey ) ); } diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx index f3e234c390ed..555cafc04576 100644 --- a/xmloff/source/transform/Oasis2OOo.cxx +++ b/xmloff/source/transform/Oasis2OOo.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <comphelper/base64.hxx> #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <rtl/ustrbuf.hxx> @@ -1498,7 +1499,7 @@ void XMLConfigItemTContext_Impl::EndElement() xPropSetInfo->hasPropertyByName( aPropName ) ) { Sequence < sal_Int8 > aKey; - ::sax::Converter::decodeBase64( aKey, m_aContent ); + ::comphelper::Base64::decode( aKey, m_aContent ); rPropSet->setPropertyValue( aPropName, makeAny( aKey ) ); } } @@ -1551,7 +1552,7 @@ void XMLTrackedChangesOASISTContext_Impl::StartElement( if( aKey.getLength() ) { OUStringBuffer aBuffer; - ::sax::Converter::encodeBase64( aBuffer, aKey ); + ::comphelper::Base64::encode( aBuffer, aKey ); XMLMutableAttributeList *pMutableAttrList = new XMLMutableAttributeList( xAttrList ); xAttrList = pMutableAttrList; |