summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-05 12:19:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-05 14:25:02 +0100
commitddd43218e9900536381733735adf8681d345e775 (patch)
tree5bb211e63d9b739d20eb248f1ab9f0fb481e118d /sc
parent9c036b1d3db253a1fd43ce76ce1d919e2029af59 (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 'sc')
-rw-r--r--sc/source/filter/xml/XMLTrackedChangesContext.cxx3
-rw-r--r--sc/source/filter/xml/xmlbodyi.cxx3
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx11
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx3
-rw-r--r--sc/source/filter/xml/xmlsubti.cxx3
5 files changed, 14 insertions, 9 deletions
diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
index 223f26db9764..86e1dcba2efc 100644
--- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx
+++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
@@ -33,6 +33,7 @@
#include <sax/tools/converter.hxx>
#include <svl/zforlist.hxx>
#include <svl/sharedstringpool.hxx>
+#include <comphelper/base64.hxx>
#include <com/sun/star/text/XTextCursor.hpp>
#include <com/sun/star/text/ControlCharacter.hpp>
@@ -375,7 +376,7 @@ ScXMLTrackedChangesContext::ScXMLTrackedChangesContext( ScXMLImport& rImport,
if( !aIter.isEmpty() )
{
uno::Sequence<sal_Int8> aPass;
- ::sax::Converter::decodeBase64( aPass, aIter.toString() );
+ ::comphelper::Base64::decode( aPass, aIter.toString() );
pChangeTrackingImportHelper->SetProtection(aPass);
}
}
diff --git a/sc/source/filter/xml/xmlbodyi.cxx b/sc/source/filter/xml/xmlbodyi.cxx
index 226db0ab313c..e7068ce9fcec 100644
--- a/sc/source/filter/xml/xmlbodyi.cxx
+++ b/sc/source/filter/xml/xmlbodyi.cxx
@@ -49,6 +49,7 @@
#include <xmloff/xmlnmspe.hxx>
#include <xmloff/nmspmap.hxx>
+#include <comphelper/base64.hxx>
#include <sax/tools/converter.hxx>
#include <sal/types.h>
@@ -265,7 +266,7 @@ void SAL_CALL ScXMLBodyContext::endFastElement(sal_Int32 nElement)
uno::Sequence<sal_Int8> aPass;
if (!sPassword.isEmpty())
{
- ::sax::Converter::decodeBase64(aPass, sPassword);
+ ::comphelper::Base64::decode(aPass, sPassword);
pProtection->setPasswordHash(aPass, meHash1, meHash2);
}
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index e02f32f8c7bd..d41bc3ba2b5a 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -111,6 +111,7 @@
#include <rtl/math.hxx>
#include <svl/zforlist.hxx>
#include <svx/unoshape.hxx>
+#include <comphelper/base64.hxx>
#include <comphelper/extract.hxx>
#include <toolkit/helper/convert.hxx>
#include <svx/svdobj.hxx>
@@ -1713,7 +1714,7 @@ void ScXMLExport::SetBodyAttributes()
eHashUsed = PASSHASH_XL;
}
}
- ::sax::Converter::encodeBase64(aBuffer, aPassHash);
+ ::comphelper::Base64::encode(aBuffer, aPassHash);
if (!aBuffer.isEmpty())
{
AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
@@ -2848,13 +2849,13 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const uno::Reference<sheet::XSpre
ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED;
if (pProtect->hasPasswordHash(PASSHASH_SHA1))
{
- ::sax::Converter::encodeBase64(aBuffer,
+ ::comphelper::Base64::encode(aBuffer,
pProtect->getPasswordHash(PASSHASH_SHA1));
eHashUsed = PASSHASH_SHA1;
}
else if (pProtect->hasPasswordHash(PASSHASH_SHA256))
{
- ::sax::Converter::encodeBase64(aBuffer,
+ ::comphelper::Base64::encode(aBuffer,
pProtect->getPasswordHash(PASSHASH_SHA256));
eHashUsed = PASSHASH_SHA256;
}
@@ -2862,7 +2863,7 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const uno::Reference<sheet::XSpre
{
// Double-hash this by SHA1 on top of the legacy xls hash.
uno::Sequence<sal_Int8> aHash = pProtect->getPasswordHash(PASSHASH_XL, PASSHASH_SHA1);
- ::sax::Converter::encodeBase64(aBuffer, aHash);
+ ::comphelper::Base64::encode(aBuffer, aHash);
eHashUsed = PASSHASH_XL;
}
if (!aBuffer.isEmpty())
@@ -4906,7 +4907,7 @@ void ScXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>&
OUStringBuffer aTrackedChangesKey;
if (GetDocument() && GetDocument()->GetChangeTrack() && GetDocument()->GetChangeTrack()->IsProtected())
{
- ::sax::Converter::encodeBase64(aTrackedChangesKey,
+ ::comphelper::Base64::encode(aTrackedChangesKey,
GetDocument()->GetChangeTrack()->GetProtection());
if (!aTrackedChangesKey.isEmpty())
++nPropsToAdd;
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index b521ebedb7a7..4e2c3bb56531 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -77,6 +77,7 @@
#include <unonames.hxx>
#include <numformat.hxx>
+#include <comphelper/base64.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/propertysequence.hxx>
@@ -1186,7 +1187,7 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence<beans::PropertyVa
if (aConfigProps[i].Value >>= sKey)
{
uno::Sequence<sal_Int8> aPass;
- ::sax::Converter::decodeBase64(aPass, sKey);
+ ::comphelper::Base64::decode(aPass, sKey);
if (aPass.getLength())
{
if (pDoc->GetChangeTrack())
diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx
index 6f1033ef37a4..a71d38ed263e 100644
--- a/sc/source/filter/xml/xmlsubti.cxx
+++ b/sc/source/filter/xml/xmlsubti.cxx
@@ -39,6 +39,7 @@
#include <xmloff/xmltkmap.hxx>
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmlerror.hxx>
+#include <comphelper/base64.hxx>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
@@ -200,7 +201,7 @@ void ScMyTables::DeleteTable()
if (rImport.GetDocument() && maProtectionData.mbProtected)
{
uno::Sequence<sal_Int8> aHash;
- ::sax::Converter::decodeBase64(aHash, maProtectionData.maPassword);
+ ::comphelper::Base64::decode(aHash, maProtectionData.maPassword);
std::unique_ptr<ScTableProtection> pProtect(new ScTableProtection);
pProtect->setProtected(maProtectionData.mbProtected);