summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-01-15 20:21:58 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-01-16 11:13:02 +0000
commit17dc855c6f4a4023393d7006e77a40f89a86fcda (patch)
treec2abe9d0f51bc8ca71cc486f9d61de2c16639d0c
parentbe3b99f12fa145f26b5ad4821b47d42776dae4c2 (diff)
cid#1519051 silence Unchecked dynamic_cast
and cid#1519050 Unchecked dynamic_cast cid#1519049 Unchecked dynamic_cast cid#1519047 Unchecked dynamic_cast Change-Id: I3feb25cda71c459c549f0e64558935d1030ed309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145541 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx2
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx1
-rw-r--r--xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx1
3 files changed, 4 insertions, 0 deletions
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
index 3e9d2582c171..3a1a353286e5 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -59,6 +59,7 @@ OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,cons
static void lcl_correctCellAddress(const OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & xAttribs)
{
comphelper::AttributeList* pList = dynamic_cast<comphelper::AttributeList*>(xAttribs.get());
+ assert(pList && "can only succeed");
OUString sCellAddress = pList->getValueByName(_sName);
const sal_Int32 nPos = sCellAddress.lastIndexOf('$');
if ( nPos != -1 )
@@ -202,6 +203,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const
else if ( m_bTableRowsStarted && !m_bFirstRowExported && _sName == "table:table-cell" )
{
comphelper::AttributeList* pList = dynamic_cast<comphelper::AttributeList*>(xAttribs.get());
+ assert(pList && "can only succeed");
static OUString s_sValue(lcl_createAttribute(XML_NP_OFFICE,XML_VALUE));
pList->RemoveAttribute(s_sValue);
}
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 1bcd82311d26..3546bfe5f043 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -661,6 +661,7 @@ bool ScXMLImportWrapper::ExportToComponent(const uno::Reference<uno::XComponentC
if ( xFilter.is() )
{
ScXMLExport* pExport = static_cast<ScXMLExport*>(dynamic_cast<SvXMLExport*>(xFilter.get()));
+ assert(pExport && "can only succeed");
pExport->SetSharedData(std::move(pSharedData));
// if there are sheets to copy, get the source stream
diff --git a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
index 74c80afe1a82..6b5c3d6c5bc6 100644
--- a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
@@ -59,6 +59,7 @@ uno::Reference< css::xml::crypto::XXMLSecurityContext > SAL_CALL
uno::Reference< css::xml::crypto::XSecurityEnvironment > xSecEnv = css::xml::crypto::SecurityEnvironment::create( m_xContext );
SecurityEnvironment_NssImpl* pSecEnv = dynamic_cast<SecurityEnvironment_NssImpl*>(xSecEnv.get());
+ assert(pSecEnv && "can only succeed");
pSecEnv->setCertDb(pCertHandle);
sal_Int32 n = xSecCtx->addSecurityEnvironment(xSecEnv);