summaryrefslogtreecommitdiff
path: root/xmloff/source/xforms
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-06-12 11:39:15 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-17 06:39:30 +0000
commite6c004dd9f24c32f5e7468182a5e8d42293ec7b6 (patch)
tree7128862b7cfe1770d07ef2b3613a52ea26b410c6 /xmloff/source/xforms
parent9c79945ca62b18213728cdd23d9f390304aee1de (diff)
convert DBG_ASSERT in xmloff
Change-Id: I2f4bbbef451026fc34638e17fa29b6db2c14d850 Reviewed-on: https://gerrit.libreoffice.org/26191 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmloff/source/xforms')
-rw-r--r--xmloff/source/xforms/SchemaRestrictionContext.cxx8
-rw-r--r--xmloff/source/xforms/TokenContext.cxx4
-rw-r--r--xmloff/source/xforms/XFormsBindContext.cxx6
-rw-r--r--xmloff/source/xforms/XFormsInstanceContext.cxx4
-rw-r--r--xmloff/source/xforms/XFormsSubmissionContext.cxx4
-rw-r--r--xmloff/source/xforms/xformsapi.cxx4
-rw-r--r--xmloff/source/xforms/xformsexport.cxx2
7 files changed, 16 insertions, 16 deletions
diff --git a/xmloff/source/xforms/SchemaRestrictionContext.cxx b/xmloff/source/xforms/SchemaRestrictionContext.cxx
index 3032c81c435c..e595a88bd79f 100644
--- a/xmloff/source/xforms/SchemaRestrictionContext.cxx
+++ b/xmloff/source/xforms/SchemaRestrictionContext.cxx
@@ -90,7 +90,7 @@ SchemaRestrictionContext::SchemaRestrictionContext(
msTypeName( sTypeName ),
msBaseName()
{
- DBG_ASSERT( mxRepository.is(), "need repository" );
+ SAL_WARN_IF( !mxRepository.is(), "xmloff", "need repository" );
}
SchemaRestrictionContext::~SchemaRestrictionContext()
@@ -103,8 +103,8 @@ void SchemaRestrictionContext::CreateDataType()
if( mxDataType.is() )
return;
- DBG_ASSERT( !msBaseName.isEmpty(), "no base name?" );
- DBG_ASSERT( mxRepository.is(), "no repository?" );
+ SAL_WARN_IF( msBaseName.isEmpty(), "xmloff", "no base name?" );
+ SAL_WARN_IF( !mxRepository.is(), "xmloff", "no repository?" );
try
{
@@ -121,7 +121,7 @@ void SchemaRestrictionContext::CreateDataType()
{
OSL_FAIL( "exception during type creation" );
}
- DBG_ASSERT( mxDataType.is(), "can't create type" );
+ SAL_WARN_IF( !mxDataType.is(), "xmloff", "can't create type" );
}
void SchemaRestrictionContext::HandleAttribute(
diff --git a/xmloff/source/xforms/TokenContext.cxx b/xmloff/source/xforms/TokenContext.cxx
index 8751b9d0771c..a1341b90c1b0 100644
--- a/xmloff/source/xforms/TokenContext.cxx
+++ b/xmloff/source/xforms/TokenContext.cxx
@@ -60,7 +60,7 @@ void TokenContext::StartElement(
// - if in map: call HandleAttribute
// - xmlns:... : ignore
// - other: warning
- DBG_ASSERT( mpAttributes != nullptr, "no token map for attributes" );
+ SAL_WARN_IF( mpAttributes == nullptr, "xmloff", "no token map for attributes" );
SvXMLTokenMap aMap( mpAttributes );
sal_Int16 nCount = xAttributeList->getLength();
@@ -100,7 +100,7 @@ SvXMLImportContext* TokenContext::CreateChildContext(
SvXMLImportContext* pContext = nullptr;
- DBG_ASSERT( mpChildren != nullptr, "no token map for child elements" );
+ SAL_WARN_IF( mpChildren == nullptr, "xmloff", "no token map for child elements" );
SvXMLTokenMap aMap( mpChildren );
sal_uInt16 nToken = aMap.Get( nPrefix, rLocalName );
if( nToken != XML_TOK_UNKNOWN )
diff --git a/xmloff/source/xforms/XFormsBindContext.cxx b/xmloff/source/xforms/XFormsBindContext.cxx
index 096e3fb6e097..9c7c811ceab4 100644
--- a/xmloff/source/xforms/XFormsBindContext.cxx
+++ b/xmloff/source/xforms/XFormsBindContext.cxx
@@ -72,7 +72,7 @@ XFormsBindContext::XFormsBindContext(
{
// attach binding to model
mxBinding = mxModel->createBinding();
- DBG_ASSERT( mxBinding.is(), "can't create binding" );
+ SAL_WARN_IF( !mxBinding.is(), "xmloff", "can't create binding" );
mxModel->getBindings()->insert( makeAny( mxBinding ) );
}
@@ -126,7 +126,7 @@ void XFormsBindContext::StartElement(
mxBinding->getPropertyValue( "BindingNamespaces" ),
UNO_QUERY );
- DBG_ASSERT( xContainer.is(), "binding should have a namespace container" );
+ SAL_WARN_IF( !xContainer.is(), "xmloff", "binding should have a namespace container" );
if( xContainer.is() )
lcl_fillNamespaceContainer( GetImport().GetNamespaceMap(), xContainer);
@@ -158,7 +158,7 @@ static void lcl_fillNamespaceContainer(
const OUString& sNamespace = aMap.GetNameByKey( nKeyIter );
// as a hack, we will ignore our own 'default' namespaces
- DBG_ASSERT( !sPrefix.isEmpty(), "no prefix?" );
+ SAL_WARN_IF( sPrefix.isEmpty(), "xmloff", "no prefix?" );
if( !sPrefix.startsWith("_") &&
nKeyIter >= XML_OLD_NAMESPACE_META_IDX )
{
diff --git a/xmloff/source/xforms/XFormsInstanceContext.cxx b/xmloff/source/xforms/XFormsInstanceContext.cxx
index d536fc1dd789..cf5a24ce1971 100644
--- a/xmloff/source/xforms/XFormsInstanceContext.cxx
+++ b/xmloff/source/xforms/XFormsInstanceContext.cxx
@@ -63,7 +63,7 @@ XFormsInstanceContext::XFormsInstanceContext(
TokenContext( rImport, nPrefix, rLocalName, aAttributes, aEmptyMap ),
mxModel( xModel )
{
- DBG_ASSERT( mxModel.is(), "need model" );
+ SAL_WARN_IF( !mxModel.is(), "xmloff", "need model" );
}
XFormsInstanceContext::~XFormsInstanceContext()
@@ -94,7 +94,7 @@ SvXMLImportContext* XFormsInstanceContext::CreateChildContext(
pContext = pInstance;
}
- DBG_ASSERT( pContext != nullptr, "no context!" );
+ SAL_WARN_IF( pContext == nullptr, "xmloff", "no context!" );
return pContext;
}
diff --git a/xmloff/source/xforms/XFormsSubmissionContext.cxx b/xmloff/source/xforms/XFormsSubmissionContext.cxx
index 3fdfb2565eca..0ebad871ac6d 100644
--- a/xmloff/source/xforms/XFormsSubmissionContext.cxx
+++ b/xmloff/source/xforms/XFormsSubmissionContext.cxx
@@ -72,9 +72,9 @@ XFormsSubmissionContext::XFormsSubmissionContext(
mxSubmission()
{
// register submission with model
- DBG_ASSERT( xModel.is(), "need model" );
+ SAL_WARN_IF( !xModel.is(), "xmloff", "need model" );
mxSubmission = xModel->createSubmission().get();
- DBG_ASSERT( mxSubmission.is(), "can't create submission" );
+ SAL_WARN_IF( !mxSubmission.is(), "xmloff", "can't create submission" );
xModel->getSubmissions()->insert( makeAny( mxSubmission ) );
}
diff --git a/xmloff/source/xforms/xformsapi.cxx b/xmloff/source/xforms/xformsapi.cxx
index 17383a4908b9..13e22047c35a 100644
--- a/xmloff/source/xforms/xformsapi.cxx
+++ b/xmloff/source/xforms/xformsapi.cxx
@@ -90,7 +90,7 @@ void xforms_addXFormsModel(
}
// TODO: implement proper error handling
- DBG_ASSERT( bSuccess, "can't import model" );
+ SAL_WARN_IF( !bSuccess, "xmloff", "can't import model" );
(void)bSuccess;
}
@@ -203,7 +203,7 @@ sal_uInt16 xforms_getTypeClass(
if( nToken != XML_TOK_UNKNOWN )
{
// we found an XSD name: then get the proper API name for it
- DBG_ASSERT( xRepository.is(), "can't find type without repository");
+ SAL_WARN_IF( !xRepository.is(), "xmloff", "can't find type without repository");
switch( nToken )
{
case XML_STRING:
diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx
index f12d07e36f2f..e12f9b29f91c 100644
--- a/xmloff/source/xforms/xformsexport.cxx
+++ b/xmloff/source/xforms/xformsexport.cxx
@@ -562,7 +562,7 @@ void exportXFormsSchemas( SvXMLExport& rExport,
if( xTypes.is() )
{
Reference<XEnumeration> xEnum = xTypes->createEnumeration();
- DBG_ASSERT( xEnum.is(), "no enum?" );
+ SAL_WARN_IF( !xEnum.is(), "xmloff", "no enum?" );
while( xEnum->hasMoreElements() )
{
Reference<XPropertySet> xType( xEnum->nextElement(), UNO_QUERY );