diff options
author | Radu Ioan <ioan.radu.g@gmail.com> | 2013-05-04 01:40:09 +0300 |
---|---|---|
committer | Bosdonnat Cedric <cedric.bosdonnat@free.fr> | 2013-05-14 13:59:53 +0000 |
commit | ac937d8be69953abcaf1365644c6607c279f37a6 (patch) | |
tree | e2ca8187c686cb8274c948cfa19bc84670ce6c0f /xmloff | |
parent | fdo#39468 Comment translation GER-ENG in sw/source/ui/shells/ (Part 4) (diff) | |
download | core-ac937d8be69953abcaf1365644c6607c279f37a6.tar.gz core-ac937d8be69953abcaf1365644c6607c279f37a6.zip |
fdo#43157 - Clean up OSL_ASSERT, DBG_ASSERT
- replaced osl_trace with sal_info
- replaced dbg_* with sal_*
Change-Id: I80aca85562e4a43fded5c37f9895e51f79e42c14
Reviewed-on: https://gerrit.libreoffice.org/3771
Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Tested-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/RDFaImportHelper.cxx | 33 | ||||
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 32 | ||||
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 42 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlimp.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/txtparai.cxx | 37 | ||||
-rw-r--r-- | xmloff/source/transform/EventOASISTContext.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/transform/Oasis2OOo.cxx | 8 |
7 files changed, 76 insertions, 88 deletions
diff --git a/xmloff/source/core/RDFaImportHelper.cxx b/xmloff/source/core/RDFaImportHelper.cxx index e37789435fea..3ff61d1b9055 100644 --- a/xmloff/source/core/RDFaImportHelper.cxx +++ b/xmloff/source/core/RDFaImportHelper.cxx @@ -191,7 +191,7 @@ RDFaReader::ReadCURIE(OUString const & i_rCURIE) const } else { - OSL_ENSURE(XML_NAMESPACE_NONE != nKey, "no namespace?"); + SAL_WARN_IF(XML_NAMESPACE_NONE == nKey, "xmloff.core", "no namespace?"); if ((XML_NAMESPACE_UNKNOWN != nKey) && (XML_NAMESPACE_XMLNS != nKey)) { @@ -201,12 +201,12 @@ RDFaReader::ReadCURIE(OUString const & i_rCURIE) const } else { - OSL_TRACE( "ReadCURIE: invalid CURIE: invalid prefix" ); + SAL_INFO("xmloff.core", "ReadCURIE: invalid CURIE: invalid prefix" ); return OUString(); } } } - OSL_TRACE( "ReadCURIE: invalid CURIE: no prefix" ); + SAL_INFO("xmloff.core", "ReadCURIE: invalid CURIE: no prefix" ); return OUString(); } @@ -229,7 +229,7 @@ RDFaReader::ReadCURIEs(OUString const & i_rCURIEs) const while (!CURIEs.isEmpty()); if (vec.empty()) { - OSL_TRACE( "ReadCURIEs: invalid CURIEs" ); + SAL_INFO("xmloff.core", "ReadCURIEs: invalid CURIEs" ); } return vec; } @@ -246,7 +246,7 @@ RDFaReader::ReadURIOrSafeCURIE(OUString const & i_rURIOrSafeCURIE) const } else { - OSL_TRACE( "ReadURIOrSafeCURIE: invalid SafeCURIE" ); + SAL_INFO("xmloff.core", "ReadURIOrSafeCURIE: invalid SafeCURIE" ); return OUString(); } } @@ -254,7 +254,7 @@ RDFaReader::ReadURIOrSafeCURIE(OUString const & i_rURIOrSafeCURIE) const { if (i_rURIOrSafeCURIE.matchAsciiL("_:", 2)) // blank node { - OSL_TRACE( "ReadURIOrSafeCURIE: invalid URI: scheme is _" ); + SAL_INFO("xmloff.core", "ReadURIOrSafeCURIE: invalid URI: scheme is _" ); return OUString(); } else @@ -282,7 +282,7 @@ RDFaInserter::MakeURI( OUString const & i_rURI) const { if (i_rURI.matchAsciiL("_:", 2)) // blank node { - OSL_TRACE("MakeURI: cannot create URI for blank node"); + SAL_INFO("xmloff.core", "MakeURI: cannot create URI for blank node"); return 0; } else @@ -293,7 +293,7 @@ RDFaInserter::MakeURI( OUString const & i_rURI) const } catch (uno::Exception &) { - OSL_FAIL("MakeURI: cannot create URI"); + SAL_WARN("xmloff.core", "MakeURI: cannot create URI"); return 0; } } @@ -309,7 +309,7 @@ RDFaInserter::MakeResource( OUString const & i_rResource) // N.B.: content.xml and styles.xml are distinct graphs OUString name( i_rResource.copy(2) ); const uno::Reference< rdf::XBlankNode > xBNode( LookupBlankNode(name) ); - OSL_ENSURE(xBNode.is(), "no blank node?"); + SAL_WARN_IF(!xBNode.is(), "xmloff.core", "no blank node?"); return uno::Reference<rdf::XResource>( xBNode, uno::UNO_QUERY); } else @@ -334,8 +334,7 @@ public: void RDFaInserter::InsertRDFaEntry( struct RDFaEntry const & i_rEntry) { - OSL_ENSURE(i_rEntry.m_xObject.is(), - "InsertRDFaEntry: invalid arg: null object"); + SAL_WARN_IF(!i_rEntry.m_xObject.is(), "xmloff.core", "InsertRDFaEntry: invalid arg: null object"); if (!i_rEntry.m_xObject.is()) return; const uno::Reference< rdf::XResource > xSubject( @@ -388,7 +387,7 @@ void RDFaInserter::InsertRDFaEntry( } catch (uno::Exception &) { - OSL_FAIL("InsertRDFaEntry: setStatementRDFa failed?"); + SAL_WARN("xmloff.core", "InsertRDFaEntry: setStatementRDFa failed?"); } } @@ -412,7 +411,7 @@ RDFaImportHelper::ParseRDFa( { if (i_rProperty.isEmpty()) { - OSL_TRACE("AddRDFa: invalid input: xhtml:property empty"); + SAL_INFO("xmloff.core", "AddRDFa: invalid input: xhtml:property empty"); return ::boost::shared_ptr<ParsedRDFaAttributes>(); } // must parse CURIEs here: need namespace declaration context @@ -440,12 +439,12 @@ RDFaImportHelper::AddRDFa( { if (!i_xObject.is()) { - OSL_FAIL("AddRDFa: invalid arg: null textcontent"); + SAL_WARN("xmloff.core", "AddRDFa: invalid arg: null textcontent"); return; } if (!i_pRDFaAttributes.get()) { - OSL_FAIL("AddRDFa: invalid arg: null RDFa attributes"); + SAL_WARN("xmloff.core", "AddRDFa: invalid arg: null RDFa attributes"); return; } m_RDFaEntries.push_back(RDFaEntry(i_xObject, i_pRDFaAttributes)); @@ -470,11 +469,11 @@ RDFaImportHelper::ParseAndAddRDFa( void RDFaImportHelper::InsertRDFa( uno::Reference< rdf::XRepositorySupplier> const & i_xModel) { - OSL_ENSURE(i_xModel.is(), "InsertRDFa: invalid arg: model null"); + SAL_WARN_IF(!i_xModel.is(), "xmloff.core", "InsertRDFa: invalid arg: model null"); if (!i_xModel.is()) return; const uno::Reference< rdf::XDocumentRepository > xRepository( i_xModel->getRDFRepository(), uno::UNO_QUERY); - OSL_ENSURE(xRepository.is(), "InsertRDFa: no DocumentRepository?"); + SAL_WARN_IF(!xRepository.is(), "xmloff.core", "InsertRDFa: no DocumentRepository?"); if (!xRepository.is()) return; RDFaInserter inserter(GetImport().GetComponentContext(), xRepository); ::std::for_each(m_RDFaEntries.begin(), m_RDFaEntries.end(), diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 82ba7252f4d7..491b58f5002a 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -459,7 +459,7 @@ SvXMLExport::SvXMLExport( msWS( GetXMLToken(XML_WS) ), mbSaveLinkedSections(sal_True) { - DBG_ASSERT( xContext.is(), "got no service manager" ); + SAL_WARN_IF( !xContext.is(), "xmloff.core", "got no service manager" ); _InitCtor(); } @@ -489,7 +489,7 @@ SvXMLExport::SvXMLExport( msWS( GetXMLToken(XML_WS) ), mbSaveLinkedSections(sal_True) { - DBG_ASSERT( xContext.is(), "got no service manager" ); + SAL_WARN_IF( !xContext.is(), "xmloff.core", "got no service manager" ); mpImpl->SetSchemeOf( msOrigFileName ); _InitCtor(); @@ -527,7 +527,7 @@ SvXMLExport::SvXMLExport( msWS( GetXMLToken(XML_WS) ), mbSaveLinkedSections(sal_True) { - DBG_ASSERT( xContext.is(), "got no service manager" ); + SAL_WARN_IF(!xContext.is(), "xmloff.core", "got no service manager" ); mpImpl->SetSchemeOf( msOrigFileName ); _InitCtor(); @@ -1035,8 +1035,7 @@ void SvXMLExport::ClearAttrList() #ifdef DBG_UTIL void SvXMLExport::CheckAttrList() { - DBG_ASSERT( !mpAttrList->getLength(), - "XMLExport::CheckAttrList: list is not empty" ); + SAL_WARN_IF( mpAttrList->getLength(), "xmloff.core", "XMLExport::CheckAttrList: list is not empty" ); } #endif @@ -1293,8 +1292,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) Reference< xml::sax::XDocumentHandler > xTmpDocHandler( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.comp.Oasis2OOoTransformer", aArgs, m_xContext), UNO_QUERY); - OSL_ENSURE( xTmpDocHandler.is(), - "can't instantiate OASIS transformer component" ); + SAL_WARN_IF(!xTmpDocHandler.is(), "xmloff.core", "can't instantiate OASIS transformer component" ); if( xTmpDocHandler.is() ) { mxHandler = xTmpDocHandler; @@ -1340,7 +1338,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) case SvtSaveOptions::ODFVER_010: break; default: - OSL_FAIL("xmloff::SvXMLExport::exportDoc(), unexpected odf default version!"); + SAL_WARN("xmloff.core", "xmloff::SvXMLExport::exportDoc(), unexpected odf default version!"); } if( pVersion ) @@ -1976,7 +1974,7 @@ ProgressBarHelper* SvXMLExport::GetProgressBarHelper() if (aAny.getValueType() == getBooleanCppuType()) mpProgressBarHelper->SetRepeat(::cppu::any2bool(aAny)); else { - SAL_WARN( "xmloff.core", "why is it no boolean?" ); + SAL_WARN("xmloff.core", "why is it no boolean?" ); } } } @@ -2077,7 +2075,7 @@ sal_Bool SvXMLExport::ExportEmbeddedOwnObject( Reference< XComponent >& rComp ) } } - OSL_ENSURE( sFilterService.getLength(), "no export filter for own object" ); + SAL_WARN_IF( !sFilterService.getLength(), "xmloff.core", "no export filter for own object" ); if( sFilterService.isEmpty() ) return sal_False; @@ -2115,8 +2113,7 @@ sal_Bool SvXMLExport::ExportEmbeddedOwnObject( Reference< XComponent >& rComp ) Reference< document::XExporter > xExporter( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(sFilterService, aArgs, m_xContext), UNO_QUERY); - OSL_ENSURE( xExporter.is(), - "can't instantiate export filter component for own object" ); + SAL_WARN_IF( !xExporter.is(), "xmloff.core", "can't instantiate export filter component for own object" ); if( !xExporter.is() ) return sal_False; @@ -2244,9 +2241,8 @@ void SvXMLExport::EndElement(const OUString& rName, mpNamespaceMap = mpImpl->mNamespaceMaps.top().first; mpImpl->mNamespaceMaps.pop(); } - OSL_ENSURE(mpImpl->mNamespaceMaps.empty() || - (mpImpl->mNamespaceMaps.top().second < mpImpl->mDepth), - "SvXMLExport: NamespaceMaps corrupted"); + SAL_WARN_IF(!mpImpl->mNamespaceMaps.empty() && + (mpImpl->mNamespaceMaps.top().second >= mpImpl->mDepth), "xmloff.core", "SvXMLExport: NamespaceMaps corrupted"); if ((mnErrorFlags & ERROR_DO_NOTHING) != ERROR_DO_NOTHING) { @@ -2407,8 +2403,7 @@ SvXMLExport::AddAttributeXmlId(uno::Reference<uno::XInterface> const & i_xIfc) } else { - OSL_FAIL("SvXMLExport::AddAttributeXmlId: " - "invalid stream name"); + SAL_WARN("xmloff.core","SvXMLExport::AddAttributeXmlId: invalid stream name"); } } else @@ -2425,8 +2420,7 @@ SvXMLExport::AddAttributeXmlId(uno::Reference<uno::XInterface> const & i_xIfc) } else { - OSL_TRACE("SvXMLExport::AddAttributeXmlId: " - "no stream name given: dropping styles.xml xml:id"); + SAL_INFO("xmloff.core", "SvXMLExport::AddAttributeXmlId: no stream name given: dropping styles.xml xml:id"); } } } diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index b9de04c615c7..1b0893356cd7 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -172,7 +172,7 @@ getBuildIdsProperty(uno::Reference<beans::XPropertySet> const& xImportInfo) } catch (Exception const& e) { - SAL_WARN("xmloff", "exception getting BuildId" << e.Message); + SAL_WARN("xmloff.core", "exception getting BuildId" << e.Message); } } return OUString(); @@ -203,8 +203,7 @@ getBuildIdsProperty(uno::Reference<beans::XPropertySet> const& xImportInfo) } else { - SAL_INFO_IF('4' != loVersion[0], "xmloff", - "unknown LO version: " << loVersion); + SAL_INFO_IF('4' != loVersion[0], "xmloff.core", "unknown LO version: " << loVersion); mnGeneratorVersion = SvXMLImport::LO_4x; } return; // ignore buildIds @@ -298,7 +297,7 @@ public: , mpRDFaHelper() // lazy , mpDocumentInfo() // lazy { - OSL_ENSURE(mxComponentContext.is(), "SvXMLImport: no ComponentContext"); + SAL_WARN_IF(!mxComponentContext.is(), "xmloff.core", "SvXMLImport: no ComponentContext"); if (!mxComponentContext.is()) throw uno::RuntimeException(); } @@ -410,7 +409,7 @@ SvXMLImport::SvXMLImport( mbIsTableShapeSupported( false ), mbIsGraphicLoadOnDemandSupported( true ) { - DBG_ASSERT( xContext.is(), "got no service manager" ); + SAL_WARN_IF( !xContext.is(), "xmloff.core", "got no service manager" ); _InitCtor(); } @@ -679,7 +678,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName, pContext = (*mpContexts)[nCount - 1]->CreateChildContext( nPrefix, aLocalName, xAttrList ); - DBG_ASSERT( pContext && pContext->GetPrefix() == nPrefix, + SAL_WARN_IF( !pContext || (pContext->GetPrefix() != nPrefix), "xmloff.core", "SvXMLImport::startElement: created context has wrong prefix" ); } else @@ -707,7 +706,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName, } } - DBG_ASSERT( pContext, "SvXMLImport::startElement: missing context" ); + SAL_WARN_IF( !pContext, "xmloff.core", "SvXMLImport::startElement: missing context" ); if( !pContext ) pContext = new SvXMLImportContext( *this, nPrefix, aLocalName ); @@ -732,7 +731,7 @@ rName throw(xml::sax::SAXException, uno::RuntimeException) { sal_uInt16 nCount = mpContexts->size(); - DBG_ASSERT( nCount, "SvXMLImport::endElement: no context left" ); + SAL_WARN_IF( nCount == 0, "xmloff.core", "SvXMLImport::endElement: no context left" ); if( nCount > 0 ) { // Get topmost context and remove it from the stack. @@ -744,10 +743,8 @@ rName OUString aLocalName; sal_uInt16 nPrefix = mpNamespaceMap->GetKeyByAttrName( rName, &aLocalName ); - DBG_ASSERT( pContext->GetPrefix() == nPrefix, - "SvXMLImport::endElement: popped context has wrong prefix" ); - DBG_ASSERT( pContext->GetLocalName() == aLocalName, - "SvXMLImport::endElement: popped context has wrong lname" ); + SAL_WARN_IF( pContext->GetPrefix() != nPrefix, "xmloff.core", "SvXMLImport::endElement: popped context has wrong prefix" ); + SAL_WARN_IF( pContext->GetLocalName() != aLocalName, "xmloff.core", "SvXMLImport::endElement: popped context has wrong lname" ); #endif // Call a EndElement at the current context. @@ -840,7 +837,7 @@ void SAL_CALL SvXMLImport::setTargetDocument( const uno::Reference< lang::XCompo mxModel->addEventListener(mxEventListener); } - DBG_ASSERT( !mpNumImport, "number format import already exists." ); + SAL_WARN_IF( mpNumImport, "xmloff.core", "number format import already exists." ); if( mpNumImport ) { delete mpNumImport; @@ -1344,7 +1341,7 @@ void SvXMLImport::AddStyleDisplayName( sal_uInt16 nFamily, StyleMap::value_type aValue( aKey, rDisplayName ); ::std::pair<StyleMap::iterator,bool> aRes( mpStyleMap->insert( aValue ) ); SAL_WARN_IF( !aRes.second, - "xmloff", + "xmloff.core", "duplicate style name" ); } @@ -1439,11 +1436,11 @@ void SvXMLImport::AddNumberStyle(sal_Int32 nKey, const OUString& rName) } catch ( uno::Exception& ) { - OSL_FAIL("Numberformat could not be inserted"); + SAL_WARN( "xmloff.core", "Numberformat could not be inserted"); } } else { - OSL_FAIL("not possible to create NameContainer"); + SAL_WARN( "xmloff.core", "not possible to create NameContainer"); } } @@ -1628,8 +1625,7 @@ sal_Bool SvXMLImport::IsODFVersionConsistent( const OUString& aODFVersion ) void SvXMLImport::_CreateNumberFormatsSupplier() { - DBG_ASSERT( !mxNumberFormatsSupplier.is(), - "number formats supplier already exists!" ); + SAL_WARN_IF( mxNumberFormatsSupplier.is(), "xmloff.core", "number formats supplier already exists!" ); if(mxModel.is()) mxNumberFormatsSupplier = uno::Reference< util::XNumberFormatsSupplier> (mxModel, uno::UNO_QUERY); @@ -1638,7 +1634,7 @@ void SvXMLImport::_CreateNumberFormatsSupplier() void SvXMLImport::_CreateDataStylesImport() { - DBG_ASSERT( mpNumImport == NULL, "data styles import already exists!" ); + SAL_WARN_IF( mpNumImport != NULL, "xmloff.core", "data styles import already exists!" ); uno::Reference<util::XNumberFormatsSupplier> xNum = GetNumberFormatsSupplier(); if ( xNum.is() ) @@ -1654,7 +1650,7 @@ sal_Unicode SvXMLImport::ConvStarBatsCharToStarSymbol( sal_Unicode c ) OUString sStarBats( "StarBats" ); mpImpl->hBatsFontConv = CreateFontToSubsFontConverter( sStarBats, FONTTOSUBSFONT_IMPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ); - OSL_ENSURE( mpImpl->hBatsFontConv, "Got no symbol font converter" ); + SAL_WARN_IF( !mpImpl->hBatsFontConv, "xmloff.core", "Got no symbol font converter" ); } if( mpImpl->hBatsFontConv ) { @@ -1672,7 +1668,7 @@ sal_Unicode SvXMLImport::ConvStarMathCharToStarSymbol( sal_Unicode c ) OUString sStarMath( "StarMath" ); mpImpl->hMathFontConv = CreateFontToSubsFontConverter( sStarMath, FONTTOSUBSFONT_IMPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ); - OSL_ENSURE( mpImpl->hMathFontConv, "Got no symbol font converter" ); + SAL_WARN_IF( !mpImpl->hMathFontConv, "xmloff.core", "Got no symbol font converter" ); } if( mpImpl->hMathFontConv ) { @@ -1865,11 +1861,11 @@ void SvXMLImport::SetXmlId(uno::Reference<uno::XInterface> const & i_xIfc, xMeta->setMetadataReference(mdref); } catch (lang::IllegalArgumentException &) { // probably duplicate; ignore - OSL_TRACE("SvXMLImport::SetXmlId: cannot set xml:id"); + SAL_INFO("xmloff.core", "SvXMLImport::SetXmlId: cannot set xml:id"); } } } catch (uno::Exception &) { - OSL_FAIL("SvXMLImport::SetXmlId: exception?"); + SAL_WARN("xmloff.core","SvXMLImport::SetXmlId: exception?"); } } } diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index afa0ea68d27d..3626c784c7ba 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -201,7 +201,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( } case XML_TOK_DOC_META: { - DBG_WARNING("XML_TOK_DOC_META: should not have come here, maybe document is invalid?"); + SAL_INFO("xmloff.draw", "XML_TOK_DOC_META: should not have come here, maybe document is invalid?"); break; } case XML_TOK_DOC_SCRIPT: @@ -924,7 +924,7 @@ void SdXMLImport::SetConfigurationSettings(const com::sun::star::uno::Sequence<c } catch(const uno::Exception&) { - OSL_TRACE( "#SdXMLImport::SetConfigurationSettings: Exception!" ); + SAL_INFO("xmloff.draw", "#SdXMLImport::SetConfigurationSettings: Exception!" ); } pValues++; @@ -950,7 +950,7 @@ void SdXMLImport::SetStatistics( if (i_rStats[i].Value >>= val) { nCount = val; } else { - OSL_FAIL("SdXMLImport::SetStatistics: invalid entry"); + SAL_WARN("xmloff.draw", "SdXMLImport::SetStatistics: invalid entry"); } } } diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 34ffa831fcab..a50aee001901 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -774,7 +774,7 @@ void XMLMetaImportContextBase::StartElement( void XMLMetaImportContextBase::EndElement() { - OSL_ENSURE(m_xStart.is(), "no mxStart?"); + SAL_WARN_IF(!m_xStart.is(), "xmloff.text", "no mxStart?"); if (!m_xStart.is()) return; const Reference<XTextRange> xEndRange( @@ -894,8 +894,7 @@ void XMLMetaImportContext::ProcessAttribute(sal_uInt16 const i_nPrefix, void XMLMetaImportContext::InsertMeta( const Reference<XTextRange> & i_xInsertionRange) { - OSL_ENSURE(!m_bHaveAbout == !m_sProperty.getLength(), - "XMLMetaImportContext::InsertMeta: invalid RDFa?"); + SAL_WARN_IF(m_bHaveAbout == m_sProperty.isEmpty(), "xmloff.text", "XMLMetaImportContext::InsertMeta: invalid RDFa?"); if (!m_XmlId.isEmpty() || (m_bHaveAbout && !m_sProperty.isEmpty())) { // insert mark @@ -907,7 +906,7 @@ void XMLMetaImportContext::InsertMeta( OUString(), i_xInsertionRange, m_XmlId), uno::UNO_QUERY); - OSL_ENSURE(xMeta.is(), "cannot insert Meta?"); + SAL_WARN_IF(!xMeta.is(), "xmloff.text", "cannot insert Meta?"); if (xMeta.is() && m_bHaveAbout) { @@ -917,7 +916,7 @@ void XMLMetaImportContext::InsertMeta( } else { - OSL_TRACE("invalid <text:meta>: no xml:id, no valid RDFa"); + SAL_INFO("xmloff.text", "invalid <text:meta>: no xml:id, no valid RDFa"); } } @@ -986,7 +985,7 @@ void XMLMetaFieldImportContext::InsertMeta( OUString(), i_xInsertionRange, m_XmlId), UNO_QUERY); - OSL_ENSURE(xPropertySet.is(), "cannot insert MetaField?"); + SAL_WARN_IF(!xPropertySet.is(), "xmloff.text", "cannot insert MetaField?"); if (!xPropertySet.is()) return; if (!m_DataStyleName.isEmpty()) @@ -1016,7 +1015,7 @@ void XMLMetaFieldImportContext::InsertMeta( } else { - OSL_TRACE("invalid <text:meta-field>: no xml:id"); + SAL_INFO("xmloff.text", "invalid <text:meta-field>: no xml:id"); } } @@ -1173,7 +1172,7 @@ void XMLIndexMarkImportContext_Impl::StartElement( } default: - OSL_FAIL("unknown index mark type!"); + SAL_WARN("xmloff.text", "unknown index mark type!"); break; } } @@ -1233,7 +1232,7 @@ void XMLIndexMarkImportContext_Impl::ProcessAttribute( break; default: - OSL_FAIL("unknown index mark type!"); + SAL_WARN("xmloff.text", "unknown index mark type!"); break; } } @@ -1284,7 +1283,7 @@ void XMLIndexMarkImportContext_Impl::GetServiceName( default: { - OSL_FAIL("unknown index mark type!"); + SAL_WARN("xmloff.text", "unknown index mark type!"); OUString sTmp; sServiceName = sTmp; break; @@ -1353,7 +1352,7 @@ void XMLTOCMarkImportContext_Impl::ProcessAttribute( OUString sValue, Reference<beans::XPropertySet>& rPropSet) { - DBG_ASSERT(rPropSet.is(), "need PropertySet"); + SAL_WARN_IF(!rPropSet.is(), "xmloff.text", "need PropertySet"); if ((XML_NAMESPACE_TEXT == nNamespace) && IsXMLToken( sLocalName, XML_OUTLINE_LEVEL ) ) @@ -2035,21 +2034,21 @@ XMLParaContext::~XMLParaContext() (xAttrCursor, uno::UNO_QUERY_THROW); const uno::Reference<container::XEnumeration> xEnum( xEA->createEnumeration(), uno::UNO_QUERY_THROW); - OSL_ENSURE(xEnum->hasMoreElements(), "xml:id: no paragraph?"); + SAL_WARN_IF(!xEnum->hasMoreElements(), "xmloff.text", "xml:id: no paragraph?"); if (xEnum->hasMoreElements()) { uno::Reference<rdf::XMetadatable> xMeta; xEnum->nextElement() >>= xMeta; - OSL_ENSURE(xMeta.is(), "xml:id: not XMetadatable"); + SAL_WARN_IF(!xMeta.is(), "xmloff.text", "xml:id: not XMetadatable"); GetImport().SetXmlId(xMeta, m_sXmlId); if (m_bHaveAbout) { GetImport().AddRDFa(xMeta, m_sAbout, m_sProperty, m_sContent, m_sDatatype); } - OSL_ENSURE(!xEnum->hasMoreElements(), "xml:id: > 1 paragraph?"); + SAL_WARN_IF(xEnum->hasMoreElements(), "xmloff.text", "xml:id: > 1 paragraph?"); } } catch (const uno::Exception &) { - OSL_TRACE("XMLParaContext::~XMLParaContext: exception"); + SAL_INFO("xmloff.text", "XMLParaContext::~XMLParaContext: exception"); } } @@ -2265,7 +2264,7 @@ XMLParaContext::~XMLParaContext() } break; default: - DBG_ASSERT( !this, "What's this" ); + SAL_WARN( "xmloff.text", "What's this" ); break; } } @@ -2368,10 +2367,10 @@ XMLNumberedParaContext::XMLNumberedParaContext( i_rImport.GetTextImport()->GetTextListHelper() ); if (m_ListId.isEmpty()) { - OSL_ENSURE( i_rImport.GetODFVersion() != "1.2", "invalid numbered-paragraph: no list-id (1.2)" ); + SAL_WARN_IF( i_rImport.GetODFVersion() == "1.2", "xmloff.text", "invalid numbered-paragraph: no list-id (1.2)" ); m_ListId = rTextListsHelper.GetNumberedParagraphListId(m_Level, StyleName); - OSL_ENSURE(!m_ListId.isEmpty(), "numbered-paragraph: no ListId"); + SAL_WARN_IF(m_ListId.isEmpty(), "xmloff.text", "numbered-paragraph: no ListId"); if (m_ListId.isEmpty()) { return; } @@ -2379,7 +2378,7 @@ XMLNumberedParaContext::XMLNumberedParaContext( m_xNumRules = rTextListsHelper.EnsureNumberedParagraph( i_rImport, m_ListId, m_Level, StyleName); - OSL_ENSURE(m_xNumRules.is(), "numbered-paragraph: no NumRules"); + SAL_WARN_IF(!m_xNumRules.is(), "xmloff.text", "numbered-paragraph: no NumRules"); i_rImport.GetTextImport()->GetTextListHelper().PushListContext( this ); } diff --git a/xmloff/source/transform/EventOASISTContext.cxx b/xmloff/source/transform/EventOASISTContext.cxx index 99e3af1740a6..a06ea44f741d 100644 --- a/xmloff/source/transform/EventOASISTContext.cxx +++ b/xmloff/source/transform/EventOASISTContext.cxx @@ -231,11 +231,11 @@ bool ParseURL( void XMLEventOASISTransformerContext::StartElement( const Reference< XAttributeList >& rAttrList ) { - OSL_TRACE("XMLEventOASISTransformerContext::StartElement"); + SAL_INFO("xmloff.transform", "XMLEventOASISTransformerContext::StartElement"); XMLTransformerActions *pActions = GetTransformer().GetUserDefinedActions( OASIS_EVENT_ACTIONS ); - OSL_ENSURE( pActions, "go no actions" ); + SAL_WARN_IF( pActions == NULL, "xmloff.transform", "got no actions" ); Reference< XAttributeList > xAttrList( rAttrList ); XMLMutableAttributeList *pMutableAttrList = 0; @@ -388,7 +388,7 @@ void XMLEventOASISTransformerContext::StartElement( case XML_ATACTION_COPY: break; default: - OSL_ENSURE( !this, "unknown action" ); + SAL_WARN( "xmloff.transform", "unknown action" ); break; } } diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx index 80edd1b0d5f2..f0bd47f8459a 100644 --- a/xmloff/source/transform/Oasis2OOo.cxx +++ b/xmloff/source/transform/Oasis2OOo.cxx @@ -1345,7 +1345,7 @@ void XMLTabStopOASISTContext_Impl::StartElement( { XMLTransformerActions *pActions = GetTransformer().GetUserDefinedActions( OASIS_TAB_STOP_ACTIONS ); - OSL_ENSURE( pActions, "go no actions" ); + SAL_WARN_IF( NULL == pActions, "xmloff.transform", "got no actions" ); sal_Unicode cStyleLeaderChar = 0; sal_Int16 nLeaderText = -1; @@ -1416,7 +1416,7 @@ void XMLTabStopOASISTContext_Impl::StartElement( } break; default: - OSL_ENSURE( !this, "unknown action" ); + SAL_WARN( "xmloff.transform", "unknown action" ); break; } } @@ -1688,7 +1688,7 @@ XMLTransformerContext *Oasis2OOoTransformer::CreateUserDefinedContext( case XML_ETACTION_CHART_PLOT_AREA: return new XMLChartPlotAreaOASISTContext( *this, rQName ); default: - OSL_ENSURE( !this, "no user defined context found!" ); + SAL_WARN( "xmloff.transform", "no user defined context found!" ); break; } @@ -2055,7 +2055,7 @@ Reference< XInterface > SAL_CALL Oasis2OOoTransformer_createInstance( const Reference< XMultiServiceFactory > &) throw( Exception ) { - OSL_TRACE("Creating Oasis2OOoTransformer"); + SAL_INFO("xmloff.transform", "Creating Oasis2OOoTransformer"); return (cppu::OWeakObject*)new Oasis2OOoTransformer; } |