summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-06-12 14:47:53 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-13 06:53:42 +0000
commitc2d195447feb4d7f8ab6642a8d05bfb85797eb05 (patch)
treef73a00581f48043bdca2ea5af1e4889b6911c92c /xmlsecurity
parente2574399f7b78bc05eaf11dad41f7c1e5215dc1d (diff)
Convert DBG_ASSERT in xmlsecurity
Change-Id: Ideec43617ff214b7e0dcbb0a1969955b34ee19e4 Reviewed-on: https://gerrit.libreoffice.org/26196 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx6
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx6
-rw-r--r--xmlsecurity/source/dialogs/macrosecurity.cxx2
-rw-r--r--xmlsecurity/source/helper/documentsignaturehelper.cxx2
-rw-r--r--xmlsecurity/source/helper/xmlsignaturehelper.cxx10
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx4
-rw-r--r--xmlsecurity/source/helper/xsecparser.cxx2
-rw-r--r--xmlsecurity/source/helper/xsecsign.cxx2
-rw-r--r--xmlsecurity/source/helper/xsecverify.cxx4
9 files changed, 19 insertions, 19 deletions
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index d57fc6bef68b..06921922f5f7 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -224,7 +224,7 @@ bool DocumentDigitalSignatures::ImplViewSignatures(
nullptr, mxCtx, eMode, bReadOnly, m_sODFVersion,
m_bHasDocumentSignature);
bool bInit = aSignaturesDialog->Init();
- DBG_ASSERT( bInit, "Error initializing security context!" );
+ SAL_WARN_IF( !bInit, "xmlsecurity", "Error initializing security context!" );
if ( bInit )
{
aSignaturesDialog->SetStorage( rxStorage );
@@ -281,7 +281,7 @@ DocumentDigitalSignatures::ImplVerifySignatures(
bool bInit = aSignatureHelper.Init();
- DBG_ASSERT( bInit, "Error initializing security context!" );
+ SAL_WARN_IF( !bInit, "xmlsecurity", "Error initializing security context!" );
if ( !bInit )
return Sequence< css::security::DocumentSignatureInformation >(0);
@@ -404,7 +404,7 @@ void DocumentDigitalSignatures::showCertificate(
bool bInit = aSignatureHelper.Init();
- DBG_ASSERT( bInit, "Error initializing security context!" );
+ SAL_WARN_IF( !bInit, "xmlsecurity", "Error initializing security context!" );
if ( bInit )
{
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index fa0b18097880..b20be6cb01b3 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -201,7 +201,7 @@ bool DigitalSignaturesDialog::Init()
{
bool bInit = maSignatureManager.maSignatureHelper.Init();
- DBG_ASSERT( bInit, "Error initializing security context!" );
+ SAL_WARN_IF( !bInit, "xmlsecurity", "Error initializing security context!" );
if ( bInit )
{
@@ -455,7 +455,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
if (!xCert.is())
xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) );
- DBG_ASSERT( xCert.is(), "Certificate not found and can't be created!" );
+ SAL_WARN_IF( !xCert.is(), "xmlsecurity", "Certificate not found and can't be created!" );
OUString aSubject;
OUString aIssuer;
@@ -587,7 +587,7 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails()
if (!xCert.is())
xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) );
- DBG_ASSERT( xCert.is(), "Error getting Certificate!" );
+ SAL_WARN_IF( !xCert.is(), "xmlsecurity", "Error getting Certificate!" );
if ( xCert.is() )
{
ScopedVclPtrInstance< CertificateViewer > aViewer( this, maSignatureManager.maSignatureHelper.GetSecurityEnvironment(), xCert, false );
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index 9d7950e36d1a..36e4c614a4a8 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -230,7 +230,7 @@ IMPL_LINK_NOARG_TYPED(MacroSecurityTrustedSourcesTP, ViewCertPBHdl, Button*, voi
if ( !xCert.is() )
xCert = mpDlg->mxSecurityEnvironment->createCertificateFromAscii( maTrustedAuthors[nSelected][2] ) ;
- DBG_ASSERT( xCert.is(), "*MacroSecurityTrustedSourcesTP::ViewCertPBHdl(): Certificate not found and can't be created!" );
+ SAL_WARN_IF( !xCert.is(), "xmlsecurity", "*MacroSecurityTrustedSourcesTP::ViewCertPBHdl(): Certificate not found and can't be created!" );
if ( xCert.is() )
{
diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx
index d50a4fc497f6..7886153574ed 100644
--- a/xmlsecurity/source/helper/documentsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx
@@ -383,7 +383,7 @@ SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream(
catch(css::io::IOException& )
{
// Doesn't have to exist...
- DBG_ASSERT( nOpenMode == css::embed::ElementModes::READ, "Error creating signature stream..." );
+ SAL_WARN_IF( nOpenMode != css::embed::ElementModes::READ, "xmlsecurity", "Error creating signature stream..." );
}
}
else if(xNameAccess->hasByName("[Content_Types].xml"))
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index b1d155449b13..b4dd0c181a5c 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -74,8 +74,8 @@ XMLSignatureHelper::~XMLSignatureHelper()
bool XMLSignatureHelper::Init()
{
- DBG_ASSERT( !mxSEInitializer.is(), "XMLSignatureHelper::Init - mxSEInitializer already set!" );
- DBG_ASSERT( !mxSecurityContext.is(), "XMLSignatureHelper::Init - mxSecurityContext already set!" );
+ SAL_WARN_IF( mxSEInitializer.is(), "xmlsecurity", "XMLSignatureHelper::Init - mxSEInitializer already set!" );
+ SAL_WARN_IF( mxSecurityContext.is(), "xmlsecurity", "XMLSignatureHelper::Init - mxSecurityContext already set!" );
mxSEInitializer = css::xml::crypto::SEInitializer::create( mxCtx );
@@ -89,9 +89,9 @@ void XMLSignatureHelper::SetStorage(
const Reference < css::embed::XStorage >& rxStorage,
const OUString& sODFVersion)
{
- DBG_ASSERT( !mxUriBinding.is(), "SetStorage - UriBinding already set!" );
+ SAL_WARN_IF( mxUriBinding.is(), "xmlsecurity", "SetStorage - UriBinding already set!" );
mxUriBinding = new UriBindingHelper( rxStorage );
- DBG_ASSERT(rxStorage.is(), "SetStorage - empty storage!");
+ SAL_WARN_IF(!rxStorage.is(), "xmlsecurity", "SetStorage - empty storage!");
mbODFPre1_2 = DocumentSignatureHelper::isODFPre_1_2(sODFVersion);
}
@@ -256,7 +256,7 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const css::uno::Reference< css:
{
mbError = false;
- DBG_ASSERT(xInputStream.is(), "input stream missing");
+ SAL_WARN_IF(!xInputStream.is(), "xmlsecurity", "input stream missing");
/*
* prepare ParserInputSrouce
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index c3482ad495ad..85d607c8fde1 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -417,7 +417,7 @@ cssu::Reference< css::io::XInputStream >
{
cssu::Reference< css::io::XInputStream > xObjectInputStream;
- DBG_ASSERT( m_xUriBinding.is(), "Need XUriBinding!" );
+ SAL_WARN_IF( !m_xUriBinding.is(), "xmlsecurity", "Need XUriBinding!" );
xObjectInputStream = m_xUriBinding->getUriBinding(objectURL);
@@ -864,7 +864,7 @@ SignatureInformation XSecController::getSignatureInformation( sal_Int32 nSecurit
{
SignatureInformation aInf( 0 );
int nIndex = findSignatureInfor(nSecurityId);
- DBG_ASSERT( nIndex != -1, "getSignatureInformation - SecurityId is invalid!" );
+ SAL_WARN_IF( nIndex == -1, "xmlsecurity", "getSignatureInformation - SecurityId is invalid!" );
if ( nIndex != -1)
{
aInf = m_vInternalSignatureInformations[nIndex].signatureInfor;
diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx
index 3118f3e24347..f823a7ec4e39 100644
--- a/xmlsecurity/source/helper/xsecparser.cxx
+++ b/xmlsecurity/source/helper/xsecparser.cxx
@@ -107,7 +107,7 @@ void SAL_CALL XSecParser::startElement(
else if ( aName == TAG_REFERENCE )
{
OUString ouUri = xAttribs->getValueByName(ATTR_URI);
- DBG_ASSERT( ouUri != nullptr, "URI == NULL" );
+ SAL_WARN_IF( ouUri == nullptr, "xmlsecurity", "URI == NULL" );
if (ouUri.startsWith(CHAR_FRAGMENT))
{
diff --git a/xmlsecurity/source/helper/xsecsign.cxx b/xmlsecurity/source/helper/xsecsign.cxx
index 795c990aed3d..a048fbb7b213 100644
--- a/xmlsecurity/source/helper/xsecsign.cxx
+++ b/xmlsecurity/source/helper/xsecsign.cxx
@@ -306,7 +306,7 @@ bool XSecController::WriteSignature(
{
bool rc = false;
- DBG_ASSERT( xDocumentHandler.is(), "I really need a document handler!" );
+ SAL_WARN_IF( !xDocumentHandler.is(), "xmlsecurity", "I really need a document handler!" );
/*
* chain the SAXEventKeeper to the SAX chain
diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx
index a60b4c567022..7651e4ae0b4b 100644
--- a/xmlsecurity/source/helper/xsecverify.cxx
+++ b/xmlsecurity/source/helper/xsecverify.cxx
@@ -327,7 +327,7 @@ void XSecController::setPropertyId( OUString& ouPropertyId )
/* public: for signature verify */
void XSecController::collectToVerify( const OUString& referenceId )
{
- /* DBG_ASSERT( m_xSAXEventKeeper.is(), "the SAXEventKeeper is NULL" ); */
+ /* SAL_WARN_IF( !m_xSAXEventKeeper.is(), "xmlsecurity", "the SAXEventKeeper is NULL" ); */
if ( m_nStatusOfSecurityComponents == INITIALIZED )
/*
@@ -392,7 +392,7 @@ void XSecController::collectToVerify( const OUString& referenceId )
void XSecController::addSignature( sal_Int32 nSignatureId )
{
- DBG_ASSERT( m_xSecParser.is(), "No XSecParser initialized" );
+ SAL_WARN_IF( !m_xSecParser.is(), "xmlsecurity", "No XSecParser initialized" );
m_nReservedSignatureId = nSignatureId;
m_bVerifyCurrentSignature = true;