From fda06137cc2cac8e223149195c225aded28a13ef Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 17 Oct 2014 10:58:49 +0200 Subject: Work around Clang 3.2 -Wnull-conversion bug ...by running all of writerfilter through loplugin:nullptr rewriter Change-Id: Ie6ec5dd989dc2035ccd10941bc38e557e128be0f --- writerfilter/inc/resourcemodel/TableManager.hxx | 46 ++++++++--------- writerfilter/source/dmapper/DomainMapper.cxx | 26 +++++----- .../source/dmapper/DomainMapperTableHandler.cxx | 10 ++-- .../source/dmapper/DomainMapperTableManager.cxx | 8 +-- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 16 +++--- writerfilter/source/dmapper/DomainMapper_Impl.hxx | 2 +- writerfilter/source/dmapper/FormControlHelper.hxx | 2 +- writerfilter/source/dmapper/GraphicImport.cxx | 2 +- writerfilter/source/dmapper/NumberingManager.cxx | 6 +-- writerfilter/source/dmapper/StyleSheetTable.cxx | 14 +++--- .../source/dmapper/TablePropertiesHandler.cxx | 10 ++-- writerfilter/source/dmapper/TblStylePrHandler.cxx | 2 +- writerfilter/source/dmapper/TextEffectsHandler.cxx | 2 +- writerfilter/source/filter/ImportFilter.cxx | 2 +- writerfilter/source/filter/WriterFilter.cxx | 8 +-- writerfilter/source/ooxml/Handler.cxx | 4 +- writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 2 +- writerfilter/source/ooxml/OOXMLFactory.cxx | 12 ++--- .../source/ooxml/OOXMLFastContextHandler.cxx | 58 +++++++++++----------- .../source/ooxml/OOXMLFastDocumentHandler.cxx | 8 +-- writerfilter/source/ooxml/OOXMLParserState.cxx | 18 +++---- writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx | 30 +++++------ writerfilter/source/resourcemodel/TagLogger.cxx | 14 +++--- .../source/resourcemodel/qnametostrcore.cxx | 2 +- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 34 ++++++------- 25 files changed, 169 insertions(+), 169 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/inc/resourcemodel/TableManager.hxx b/writerfilter/inc/resourcemodel/TableManager.hxx index 4b2a3d6387ce..c13303c31859 100644 --- a/writerfilter/inc/resourcemodel/TableManager.hxx +++ b/writerfilter/inc/resourcemodel/TableManager.hxx @@ -643,7 +643,7 @@ template void TableManager::cellDepth(sal_uInt32 nDepth) { #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) { mpTableLogger->startElement("tablemanager.cellDepth"); mpTableLogger->attribute("depth", nDepth); @@ -658,7 +658,7 @@ template void TableManager::inCell() { #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->element("tablemanager.inCell"); #endif setInCell(true); @@ -671,7 +671,7 @@ template void TableManager::endCell() { #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->element("tablemanager.endCell"); #endif @@ -682,7 +682,7 @@ template void TableManager::endRow() { #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->element("tablemanager.endRow"); #endif @@ -724,7 +724,7 @@ template void TableManager::startLevel() { #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) { typename TableData::Pointer_t pTableData; @@ -734,7 +734,7 @@ void TableManager::startLevel() mpTableLogger->startElement("tablemanager.startLevel"); mpTableLogger->attribute("level", mTableDataStack.size()); - if (pTableData.get() != NULL) + if (pTableData.get() != nullptr) mpTableLogger->attribute("openCell", pTableData->isCellOpen() ? "yes" : "no"); @@ -764,7 +764,7 @@ void TableManager::startLevel() template void TableManager::endLevel() { - if (mpTableDataHandler.get() != NULL) + if (mpTableDataHandler.get() != nullptr) resolveCurrentTable(); // Store the unfinished row as it will be used for the next table @@ -774,7 +774,7 @@ void TableManager::endLevel() mTableDataStack.pop(); #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) { typename TableData::Pointer_t pTableData; @@ -784,7 +784,7 @@ void TableManager::endLevel() mpTableLogger->startElement("tablemanager.endLevel"); mpTableLogger->attribute("level", mTableDataStack.size()); - if (pTableData.get() != NULL) + if (pTableData.get() != nullptr) mpTableLogger->attribute("openCell", pTableData->isCellOpen() ? "yes" : "no"); @@ -886,7 +886,7 @@ template void TableManager::handle0x7() { #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->startElement("tablemanager.handle0x7"); #endif @@ -899,7 +899,7 @@ void TableManager::handle0x7() endRow(); #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->endElement(); #endif } @@ -932,7 +932,7 @@ template void TableManager::cellProps(PropertiesPointer pProps) { #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->startElement("tablemanager.cellProps"); #endif @@ -942,7 +942,7 @@ void TableManager::cellProps(PropertiesPointer pProps) setCellProps(pProps); #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->endElement(); #endif } @@ -952,14 +952,14 @@ void TableManager::cellPropsByCell (unsigned int i, PropertiesPointer pProps) { #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->startElement("tablemanager.cellPropsByCell"); #endif mTableDataStack.top()->insertCellProperties(i, pProps); #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->endElement(); #endif } @@ -968,7 +968,7 @@ template void TableManager::insertRowProps(PropertiesPointer pProps) { #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->startElement("tablemanager.insertRowProps"); #endif @@ -978,7 +978,7 @@ void TableManager::insertRowProps(PropertiesPointer pProps setRowProps(pProps); #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->endElement(); #endif } @@ -987,7 +987,7 @@ template void TableManager::insertTableProps(PropertiesPointer pProps) { #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->startElement("tablemanager.insertTableProps"); #endif @@ -997,7 +997,7 @@ void TableManager::insertTableProps(PropertiesPointer pPro setTableProps(pProps); #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->endElement(); #endif } @@ -1006,11 +1006,11 @@ template void TableManager::resolveCurrentTable() { #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->startElement("tablemanager.resolveCurrentTable"); #endif - if (mpTableDataHandler.get() != NULL) + if (mpTableDataHandler.get() != nullptr) { try { @@ -1052,7 +1052,7 @@ void TableManager::resolveCurrentTable() clearData(); #ifdef DEBUG_WRITERFILTER - if (mpTableLogger != NULL) + if (mpTableLogger != nullptr) mpTableLogger->endElement(); #endif } @@ -1128,7 +1128,7 @@ void TableManager::ensureOpenCell(PropertiesPointer pProp typename TableData::Pointer_t pTableData = mTableDataStack.top(); - if (pTableData.get() != NULL) + if (pTableData.get() != nullptr) { if (!pTableData->isCellOpen()) openCell(getHandle(), pProps); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index c7762f676d9f..45fb28f41468 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -913,7 +913,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) break; case NS_ooxml::LN_CT_DocGrid_type: { - if (pSectionContext != NULL) + if (pSectionContext != nullptr) { switch( nIntValue ) { @@ -965,7 +965,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) m_pImpl->m_oBackgroundColor.reset(nIntValue); break; case NS_ooxml::LN_CT_PageNumber_start: - if (pSectionContext != NULL) + if (pSectionContext != nullptr) pSectionContext->SetPageNumber(nIntValue); break; case NS_ooxml::LN_CT_FtnEdn_type: @@ -1368,7 +1368,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) break; case NS_ooxml::LN_EG_SectPrContents_bidi: - if (pSectionContext != NULL) + if (pSectionContext != nullptr) pSectionContext->Insert(PROP_WRITING_MODE, uno::makeAny( text::WritingMode2::RL_TB)); break; case NS_ooxml::LN_EG_RPrBase_highlight: @@ -1681,7 +1681,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) PropertyMap * pTargetContext = rContext.get(); - if (pSectionContext != NULL && + if (pSectionContext != nullptr && nSprmId == NS_ooxml::LN_EG_SectPrContents_textDirection) { pTargetContext = pSectionContext; @@ -1977,7 +1977,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) { const StyleSheetEntryPtr pEntry = pStyleTable->FindStyleSheetByISTD(sStringValue); OSL_ENSURE( pEntry.get(), "no style sheet found" ); - const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast(pEntry ? pEntry->pProperties.get() : 0); + const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast(pEntry ? pEntry->pProperties.get() : nullptr); if( pStyleSheetProperties && pStyleSheetProperties->GetListId() >= 0 ) { @@ -1989,7 +1989,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) if (!pEntry->sBaseStyleIdentifier.isEmpty()) { const StyleSheetEntryPtr pParent = pStyleTable->FindStyleSheetByISTD(pEntry->sBaseStyleIdentifier); - const StyleSheetPropertyMap* pParentProperties = dynamic_cast(pParent ? pParent->pProperties.get() : 0); + const StyleSheetPropertyMap* pParentProperties = dynamic_cast(pParent ? pParent->pProperties.get() : nullptr); boost::optional pPropMargin; if (pParentProperties && (pPropMargin = pParentProperties->getProperty(PROP_PARA_RIGHT_MARGIN)) ) nParaRightMargin = pPropMargin->second.get(); @@ -2257,7 +2257,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) case NS_ooxml::LN_ffdata: { writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); - if (pProperties.get() != NULL) + if (pProperties.get() != nullptr) { FFDataHandler::Pointer_t pFFDataHandler(new FFDataHandler()); @@ -2270,14 +2270,14 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) case NS_ooxml::LN_CT_SdtPr_comboBox: { writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); - if (pProperties.get() != NULL) + if (pProperties.get() != nullptr) pProperties->resolve(*this); } break; case NS_ooxml::LN_CT_SdtDropDownList_listItem: { writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); - if (pProperties.get() != NULL) + if (pProperties.get() != nullptr) pProperties->resolve(*this); } break; @@ -2356,7 +2356,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) // process subitems writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); - if (pProperties.get() != NULL) + if (pProperties.get() != nullptr) pProperties->resolve(*this); if (nSprmId == NS_ooxml::LN_CT_SdtPr_alias) @@ -2843,7 +2843,7 @@ void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len) m_pImpl->AppendFieldResult(sText); else { - if (pContext == 0) + if (pContext == nullptr) pContext.reset(new PropertyMap()); m_pImpl->appendTextPortion( sText, pContext ); @@ -3020,7 +3020,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) m_pImpl->AppendFieldResult(sText); else { - if (pContext == 0) + if (pContext == nullptr) pContext.reset(new PropertyMap()); m_pImpl->appendTextPortion( sText, pContext ); @@ -3346,7 +3346,7 @@ StyleSheetTablePtr DomainMapper::GetStyleSheetTable( ) GraphicZOrderHelper* DomainMapper::graphicZOrderHelper() { - if( zOrderHelper.get() == NULL ) + if( zOrderHelper.get() == nullptr ) zOrderHelper.reset( new GraphicZOrderHelper ); return zOrderHelper.get(); } diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index cf23230ac7eb..68efba72e9b1 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -74,7 +74,7 @@ void DomainMapperTableHandler::startTable(unsigned int nRows, dmapper_logger->startElement("tablehandler.table"); dmapper_logger->attribute("rows", nRows); - if (pProps.get() != NULL) + if (pProps.get() != nullptr) pProps->dumpXml( dmapper_logger ); #endif } @@ -255,7 +255,7 @@ struct TableInfo , nNestLevel(0) , pTableDefaults(new PropertyMap) , pTableBorders(new PropertyMap) - , pTableStyle(NULL) + , pTableStyle(nullptr) { } @@ -318,7 +318,7 @@ void lcl_DecrementHoriOrientPosition(comphelper::SequenceAsVector& rFrameProperties) { // will receive the table style if any - TableStyleSheetEntry* pTableStyle = NULL; + TableStyleSheetEntry* pTableStyle = nullptr; if( m_aTableProperties.get() ) { @@ -332,7 +332,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo comphelper::SequenceAsHashMap aGrabBag; - if (0 != m_rDMapper_Impl.getTableManager().getCurrentTableRealPosition()) + if (nullptr != m_rDMapper_Impl.getTableManager().getCurrentTableRealPosition()) { TablePositionHandler *pTablePositions = m_rDMapper_Impl.getTableManager().getCurrentTableRealPosition(); @@ -1138,7 +1138,7 @@ void DomainMapperTableHandler::startRow(unsigned int nCells, #ifdef DEBUG_WRITERFILTER dmapper_logger->startElement("table.row"); dmapper_logger->attribute("cells", nCells); - if (pProps != NULL) + if (pProps != nullptr) pProps->dumpXml(dmapper_logger); #endif diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 9cb8eafeab27..c5b1946d6195 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -72,7 +72,7 @@ DomainMapperTableManager::DomainMapperTableManager(bool bOOXML) : DomainMapperTableManager::~DomainMapperTableManager() { if ( m_pTablePropsHandler ) - delete m_pTablePropsHandler, m_pTablePropsHandler = NULL; + delete m_pTablePropsHandler, m_pTablePropsHandler = nullptr; } bool DomainMapperTableManager::attribute(Id nName, Value& rValue) @@ -141,7 +141,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) bRet = true; sal_uInt32 nSprmId = rSprm.getId(); Value::Pointer_t pValue = rSprm.getValue(); - sal_Int32 nIntValue = ((pValue.get() != NULL) ? pValue->getInt() : 0); + sal_Int32 nIntValue = ((pValue.get() != nullptr) ? pValue->getInt() : 0); switch ( nSprmId ) { case 0xf661: //sprmTTRLeft left table indent @@ -509,7 +509,7 @@ TablePositionHandler* DomainMapperTableManager::getCurrentTableRealPosition() if ( !m_aTablePositions.empty( ) && m_aTablePositions.back() ) return (m_aTablePositions.back( )).get(); else - return 0; + return nullptr; } void DomainMapperTableManager::startLevel( ) @@ -573,7 +573,7 @@ void DomainMapperTableManager::endLevel( ) #ifdef DEBUG_WRITERFILTER dmapper_logger->startElement("dmappertablemanager.endLevel"); PropertyMapPtr pProps = getTableProps(); - if (pProps.get() != NULL) + if (pProps.get() != nullptr) getTableProps()->dumpXml( dmapper_logger ); dmapper_logger->endElement(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index bf48b430df6d..645d52c3e2a0 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1009,7 +1009,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap ) dmapper_logger->attribute("isTextAppend", sal_uInt32(xTextAppend.is())); #endif - if (xTextAppend.is() && !getTableManager( ).isIgnore() && pParaContext != NULL) + if (xTextAppend.is() && !getTableManager( ).isIgnore() && pParaContext != nullptr) { try { @@ -1237,7 +1237,7 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, PropertyMapP xTextRange = xTextAppend->insertTextPortion(rString, pValues, xTOCTextCursor); SAL_WARN_IF(!xTextRange.is(), "writerfilter.dmapper", "insertTextPortion failed"); if (!xTextRange.is()) - throw uno::Exception("insertTextPortion failed", NULL); + throw uno::Exception("insertTextPortion failed", nullptr); m_bTextInserted = true; xTOCTextCursor->gotoRange(xTextRange->getEnd(), true); mxTOCTextCursor = xTOCTextCursor; @@ -1614,7 +1614,7 @@ void DomainMapper_Impl::CreateRedline(uno::Reference const& xR sType = rPropNameSupplier.GetName( PROP_PARAGRAPH_FORMAT ); break; default: - throw ::com::sun::star::lang::IllegalArgumentException("illegal redline token type", NULL, 0); + throw ::com::sun::star::lang::IllegalArgumentException("illegal redline token type", nullptr, 0); } uno::Reference < text::XRedline > xRedline( xRange, uno::UNO_QUERY_THROW ); beans::PropertyValues aRedlineProperties( 3 ); @@ -2833,7 +2833,7 @@ void DomainMapper_Impl::handleFieldAsk { //don't insert the field //todo: maybe import a 'normal' input field here? - xFieldInterface = 0; + xFieldInterface = nullptr; } } @@ -4280,7 +4280,7 @@ void DomainMapper_Impl::PopFieldContext() else { FormControlHelper::Pointer_t pFormControlHelper(pContext->getFormControlHelper()); - if (pFormControlHelper.get() != NULL && pFormControlHelper->hasFFDataHandler() ) + if (pFormControlHelper.get() != nullptr && pFormControlHelper->hasFFDataHandler() ) { uno::Reference< text::XFormField > xFormField( pContext->GetFormField() ); xToInsert.set(xFormField, uno::UNO_QUERY); @@ -4629,8 +4629,8 @@ bool DomainMapper_Impl::ExecuteFrameConversion() bRet = false; } } - m_xFrameStartRange = 0; - m_xFrameEndRange = 0; + m_xFrameStartRange = nullptr; + m_xFrameEndRange = nullptr; m_aFrameProperties.realloc( 0 ); return bRet; } @@ -4899,7 +4899,7 @@ uno::Reference DomainMapper_Impl::GetCurrentNumberingCharSt SectionPropertyMap * DomainMapper_Impl::GetSectionContext() { - SectionPropertyMap* pSectionContext = 0; + SectionPropertyMap* pSectionContext = nullptr; //the section context is not available before the first call of startSectionGroup() if( !IsAnyTableImport() ) { diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 4072349dc0a6..69137f2cd813 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -753,7 +753,7 @@ public: /// If the current paragraph has a numbering style associated, this method returns its character style (part of the numbering rules) com::sun::star::uno::Reference GetCurrentNumberingCharStyle(); /// If the current paragraph has a numbering style associated, this method returns its numbering rules - com::sun::star::uno::Reference GetCurrentNumberingRules(sal_Int32* pListLevel = 0); + com::sun::star::uno::Reference GetCurrentNumberingRules(sal_Int32* pListLevel = nullptr); /** Used for attributes/sprms which cannot be evaluated immediatelly (e.g. they depend diff --git a/writerfilter/source/dmapper/FormControlHelper.hxx b/writerfilter/source/dmapper/FormControlHelper.hxx index 2ff0ad11125f..88bdd96d6a8b 100644 --- a/writerfilter/source/dmapper/FormControlHelper.hxx +++ b/writerfilter/source/dmapper/FormControlHelper.hxx @@ -39,7 +39,7 @@ public: bool insertControl(css::uno::Reference const& xTextRange); bool processField(css::uno::Reference const& xFormField); - bool hasFFDataHandler() const { return (m_pFFData != 0); } + bool hasFFDataHandler() const { return (m_pFFData != nullptr); } private: FFDataHandler::Pointer_t m_pFFData; struct FormControlHelper_Impl; diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 63c71da57813..bbedad3fbd47 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -1331,7 +1331,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b uno::Any aContourPolyPolygon; if( aGraphicSize.Width && aGraphicSize.Height && - m_pImpl->mpWrapPolygon.get() != NULL) + m_pImpl->mpWrapPolygon.get() != nullptr) { WrapPolygon::Pointer_t pCorrected = m_pImpl->mpWrapPolygon->correctWordWrapPolygon(aGraphicSize); aContourPolyPolygon <<= pCorrected->getPointSequenceSequence(); diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 66689ec4b778..d219b7b91ee6 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -917,7 +917,7 @@ void ListsManager::lcl_sprm( Sprm& rSprm ) { sal_Int32 nAbstractNumId = rSprm.getValue()->getInt(); ListDef* pListDef = dynamic_cast< ListDef* >( m_pCurrentDefinition.get( ) ); - if ( pListDef != NULL ) + if ( pListDef != nullptr ) { // The current def should be a ListDef pListDef->SetAbstractDefinition( @@ -1122,12 +1122,12 @@ AbstractListDef::Pointer ListsManager::GetAbstractList( sal_Int32 nId ) pStylesTable->FindStyleSheetByISTD( m_aAbstractLists[i]->GetNumStyleLink() ); const StyleSheetPropertyMap* pStyleSheetProperties = - dynamic_cast(pStyleSheetEntry ? pStyleSheetEntry->pProperties.get() : 0); + dynamic_cast(pStyleSheetEntry ? pStyleSheetEntry->pProperties.get() : nullptr); if( pStyleSheetProperties && pStyleSheetProperties->GetNumId() >= 0 ) { ListDef::Pointer pList = GetList( pStyleSheetProperties->GetNumId() ); - if ( pList!=0 ) + if ( pList!=nullptr ) return pList->GetAbstractDefinition(); else pAbstractList = m_aAbstractLists[i]; diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index b923ce890f7e..d1fe9e54576f 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -95,7 +95,7 @@ TableStyleSheetEntry::TableStyleSheetEntry( StyleSheetEntry& rEntry, StyleSheetT TableStyleSheetEntry::~TableStyleSheetEntry( ) { - m_pStyleSheet = NULL; + m_pStyleSheet = nullptr; } void TableStyleSheetEntry::AddTblStylePr( TblStyleType nType, PropertyMapPtr pProps ) @@ -150,7 +150,7 @@ PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask, StyleSheetE if ( pEntry.get( ) ) { - if (pStack.get() == NULL) + if (pStack.get() == nullptr) pStack.reset(new StyleSheetEntryDeque()); StyleSheetEntryDeque::const_iterator aIt = find(pStack->begin(), pStack->end(), pEntry); @@ -661,19 +661,19 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm) } else { - if (pTableEntry != NULL) + if (pTableEntry != nullptr) pTableEntry->AddTblStylePr( nType, pProps ); } if (nSprmId == NS_ooxml::LN_CT_Style_tblPr) { - if (pTableEntry != NULL) + if (pTableEntry != nullptr) pTableEntry->AppendInteropGrabBag(pTblStylePrHandler->getInteropGrabBag("tblPr")); } else if (nSprmId == NS_ooxml::LN_CT_Style_tblStylePr) { pTblStylePrHandler->appendInteropGrabBag("type", pTblStylePrHandler->getTypeString()); - if (pTableEntry != NULL) + if (pTableEntry != nullptr) pTableEntry->AppendInteropGrabBag(pTblStylePrHandler->getInteropGrabBag("tblStylePr")); } } @@ -1030,7 +1030,7 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) //TODO: Handle cases where a paragraph <> character style relation is needed StyleSheetEntryPtr pParent = FindStyleSheetByISTD( pEntry->sBaseStyleIdentifier ); // Writer core doesn't support numbering styles having a parent style, it seems - if (pParent.get() != NULL && !bListStyle) + if (pParent.get() != nullptr && !bListStyle) xStyle->setParentStyle(ConvertStyleName( pParent->sStyleName )); } catch( const uno::RuntimeException& ) @@ -1094,7 +1094,7 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) if( bParaStyle ) { // Set the outline levels - const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast(pEntry ? pEntry->pProperties.get() : 0); + const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast(pEntry ? pEntry->pProperties.get() : nullptr); if ( pStyleSheetProperties ) { aPropValues.realloc( aPropValues.getLength( ) + 1 ); diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx index de7d4c512868..c9516120f696 100644 --- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx +++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx @@ -42,8 +42,8 @@ namespace writerfilter { namespace dmapper { TablePropertiesHandler::TablePropertiesHandler( bool bOOXML ) : - m_pCurrentInteropGrabBag(0), - m_pTableManager( NULL ), + m_pCurrentInteropGrabBag(nullptr), + m_pTableManager( nullptr ), m_bOOXML( bOOXML ) { } @@ -52,7 +52,7 @@ namespace dmapper { TablePropertiesHandler::~TablePropertiesHandler( ) { // Do not delete the table manager... this will be done somewhere else - m_pTableManager = NULL; + m_pTableManager = nullptr; } bool TablePropertiesHandler::sprm(Sprm & rSprm) @@ -65,7 +65,7 @@ namespace dmapper { bool bRet = true; sal_uInt32 nSprmId = rSprm.getId(); Value::Pointer_t pValue = rSprm.getValue(); - sal_Int32 nIntValue = ((pValue.get() != NULL) ? pValue->getInt() : 0); + sal_Int32 nIntValue = ((pValue.get() != nullptr) ? pValue->getInt() : 0); switch( nSprmId ) { case NS_ooxml::LN_CT_TrPrBase_jc: //90706 @@ -159,7 +159,7 @@ namespace dmapper { nToken = XML_tableCellDelete; break; default: - throw ::com::sun::star::lang::IllegalArgumentException("illegal redline token type", NULL, 0); + throw ::com::sun::star::lang::IllegalArgumentException("illegal redline token type", nullptr, 0); break; }; TrackChangesHandlerPtr pTrackChangesHandler( new TrackChangesHandler( nToken ) ); diff --git a/writerfilter/source/dmapper/TblStylePrHandler.cxx b/writerfilter/source/dmapper/TblStylePrHandler.cxx index 2311c6faa14e..d673843b683d 100644 --- a/writerfilter/source/dmapper/TblStylePrHandler.cxx +++ b/writerfilter/source/dmapper/TblStylePrHandler.cxx @@ -41,7 +41,7 @@ m_pProperties( new PropertyMap ) TblStylePrHandler::~TblStylePrHandler( ) { - delete m_pTablePropsHandler, m_pTablePropsHandler = NULL; + delete m_pTablePropsHandler, m_pTablePropsHandler = nullptr; } OUString TblStylePrHandler::getTypeString() diff --git a/writerfilter/source/dmapper/TextEffectsHandler.cxx b/writerfilter/source/dmapper/TextEffectsHandler.cxx index 28e813b4f05f..90971f61dc2a 100644 --- a/writerfilter/source/dmapper/TextEffectsHandler.cxx +++ b/writerfilter/source/dmapper/TextEffectsHandler.cxx @@ -484,7 +484,7 @@ void TextEffectsHandler::convertElementIdToPropertyId(sal_Int32 aElementId) TextEffectsHandler::TextEffectsHandler(sal_uInt32 aElementId) : LoggedProperties(dmapper_logger, "TextEffectsHandler"), - mpGrabBagStack(NULL) + mpGrabBagStack(nullptr) { convertElementIdToPropertyId(aElementId); mpGrabBagStack.reset(new GrabBagStack(maElementName)); diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx index 4cddcc93ea3c..bc705a4f4de2 100644 --- a/writerfilter/source/filter/ImportFilter.cxx +++ b/writerfilter/source/filter/ImportFilter.cxx @@ -147,7 +147,7 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes if ( !xFrame.is() ) { uno::Reference< frame::XController > xController = xModel->getCurrentController(); - xFrame = xController.is() ? xController->getFrame() : NULL; + xFrame = xController.is() ? xController->getFrame() : nullptr; } oox::GraphicHelper gHelper( m_xContext, xFrame, xVbaPrjStrg ); diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 9d37117bd8b6..9c55f2d3c0f5 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -39,10 +39,10 @@ extern "C" /* shared lib exports implemented with helpers */ static const struct ::cppu::ImplementationEntry s_component_entries [] = { - { WriterFilter_createInstance, WriterFilter_getImplementationName, WriterFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }, - { WriterFilterDetection_createInstance, WriterFilterDetection_getImplementationName, WriterFilterDetection_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0} , - { RtfFilter_createInstance, RtfFilter_getImplementationName, RtfFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }, - { 0, 0, 0, 0, 0, 0 } // terminate with NULL + { WriterFilter_createInstance, WriterFilter_getImplementationName, WriterFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, nullptr, 0 }, + { WriterFilterDetection_createInstance, WriterFilterDetection_getImplementationName, WriterFilterDetection_getSupportedServiceNames, ::cppu::createSingleComponentFactory, nullptr, 0} , + { RtfFilter_createInstance, RtfFilter_getImplementationName, RtfFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, nullptr, 0 }, + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } // terminate with NULL }; SAL_DLLPUBLIC_EXPORT void * SAL_CALL writerfilter_component_getFactory(sal_Char const * implName, void * xMgr, void * xRegistry ) diff --git a/writerfilter/source/ooxml/Handler.cxx b/writerfilter/source/ooxml/Handler.cxx index 924c188268ad..519f2975a50b 100644 --- a/writerfilter/source/ooxml/Handler.cxx +++ b/writerfilter/source/ooxml/Handler.cxx @@ -292,7 +292,7 @@ void OOXMLPictureHandler::attribute(Id name, Value & val) { writerfilter::Reference::Pointer_t pProps (val.getProperties()); - if (pProps.get() != NULL) + if (pProps.get() != nullptr) pProps->resolve(*this); } } @@ -302,7 +302,7 @@ void OOXMLPictureHandler::sprm(Sprm & rSprm) writerfilter::Reference::Pointer_t pProps (rSprm.getProps()); - if (pProps.get() != NULL) + if (pProps.get() != nullptr) pProps->resolve(*this); } diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx index 4cacd10cc752..89aa80d2a193 100644 --- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx @@ -52,7 +52,7 @@ OOXMLDocumentImpl::OOXMLDocumentImpl(OOXMLStream::Pointer_t pStream, const uno:: , mxStatusIndicator(xStatusIndicator) , mnXNoteId(0) , mXNoteType(0) - , mxThemeDom(0) + , mxThemeDom(nullptr) , mbIsSubstream(false) , mnPercentSize(0) , mnProgressLastPos(0) diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx index d692305e5a4a..6c92daefcb41 100644 --- a/writerfilter/source/ooxml/OOXMLFactory.cxx +++ b/writerfilter/source/ooxml/OOXMLFactory.cxx @@ -55,7 +55,7 @@ OOXMLFactory::~OOXMLFactory() OOXMLFactory::Pointer_t OOXMLFactory::getInstance() { - if (m_Instance.get() == NULL) + if (m_Instance.get() == nullptr) m_Instance.reset(new OOXMLFactory()); return m_Instance; @@ -67,10 +67,10 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, Id nDefine = pHandler->getDefine(); OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine); - if (pFactory.get() == NULL) + if (pFactory.get() == nullptr) return; - assert( dynamic_cast< sax_fastparser::FastAttributeList *>( Attribs.get() ) != NULL ); + assert( dynamic_cast< sax_fastparser::FastAttributeList *>( Attribs.get() ) != nullptr ); sax_fastparser::FastAttributeList *pAttribs; pAttribs = static_cast< sax_fastparser::FastAttributeList *>( Attribs.get() ); @@ -172,7 +172,7 @@ void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler, Id nDefine = pHandler->getDefine(); OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine); - if (pFactory.get() != NULL) + if (pFactory.get() != nullptr) { pFactory->charactersAction(pHandler, rString); } @@ -183,7 +183,7 @@ void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nTo Id nDefine = pHandler->getDefine(); OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine); - if (pFactory.get() != NULL) + if (pFactory.get() != nullptr) { pFactory->startAction(pHandler); } @@ -194,7 +194,7 @@ void OOXMLFactory::endAction(OOXMLFastContextHandler * pHandler, Token_t /*nToke Id nDefine = pHandler->getDefine(); OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine); - if (pFactory.get() != NULL) + if (pFactory.get() != nullptr) { pFactory->endAction(pHandler); } diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index 1eb6ff8b5e63..7bdebfc1656c 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -115,11 +115,11 @@ sal_uInt32 OOXMLFastContextHandler::mnInstanceCount = 0; OOXMLFastContextHandler::OOXMLFastContextHandler (uno::Reference< uno::XComponentContext > const & context) -: mpParent(NULL), +: mpParent(nullptr), mId(0), mnDefine(0), mnToken(oox::XML_TOKEN_COUNT), - mpStream(NULL), + mpStream(nullptr), mnTableDepth(0), mnInstanceNumber(mnInstanceCount), inPositionV(false), @@ -130,7 +130,7 @@ OOXMLFastContextHandler::OOXMLFastContextHandler mnInstanceCount++; aSetContexts.insert(this); - if (mpParserState.get() == NULL) + if (mpParserState.get() == nullptr) mpParserState.reset(new OOXMLParserState()); mpParserState->incContextCount(); @@ -153,7 +153,7 @@ OOXMLFastContextHandler::OOXMLFastContextHandler { mpParserState = pContext->mpParserState; - if (mpParserState.get() == NULL) + if (mpParserState.get() == nullptr) mpParserState.reset(new OOXMLParserState()); mnInstanceCount++; @@ -391,7 +391,7 @@ void OOXMLFastContextHandler::dumpXml( const TagLogger::Pointer_t pLogger ) cons OOXMLValue::Pointer_t pVal(getValue()); - if (pVal.get() != NULL) + if (pVal.get() != nullptr) pLogger->attribute("value", pVal->toString()); else pLogger->attribute("value", std::string("(null)")); @@ -957,11 +957,11 @@ void OOXMLFastContextHandler::resolvePropertySetAttrs() void OOXMLFastContextHandler::sendPropertyToParent() { - if (mpParent != NULL) + if (mpParent != nullptr) { OOXMLPropertySet::Pointer_t pProps(mpParent->getPropertySet()); - if (pProps.get() != NULL) + if (pProps.get() != nullptr) { OOXMLProperty::Pointer_t pProp(new OOXMLPropertyImpl(mId, getValue(), @@ -973,15 +973,15 @@ void OOXMLFastContextHandler::sendPropertyToParent() void OOXMLFastContextHandler::sendPropertiesToParent() { - if (mpParent != NULL) + if (mpParent != nullptr) { OOXMLPropertySet::Pointer_t pParentProps(mpParent->getPropertySet()); - if (pParentProps.get() != NULL) + if (pParentProps.get() != nullptr) { OOXMLPropertySet::Pointer_t pProps(getPropertySet()); - if (pProps.get() != NULL) + if (pProps.get() != nullptr) { OOXMLValue::Pointer_t pValue (new OOXMLPropertySetValue(getPropertySet())); @@ -1109,7 +1109,7 @@ void OOXMLFastContextHandlerProperties::dumpXml( const TagLogger::Pointer_t pLog OOXMLValue::Pointer_t pVal(getValue()); - if (pVal.get() != NULL) + if (pVal.get() != nullptr) pLogger->attribute("value", pVal->toString()); else pLogger->attribute("value", std::string("(null)")); @@ -1221,7 +1221,7 @@ void OOXMLFastContextHandlerProperties::setParent void OOXMLFastContextHandlerProperties::setPropertySet (OOXMLPropertySet::Pointer_t pPropertySet) { - if (pPropertySet.get() != NULL) + if (pPropertySet.get() != nullptr) mpPropertySet = pPropertySet; } @@ -1297,7 +1297,7 @@ throw (uno::RuntimeException, xml::sax::SAXException) void OOXMLFastContextHandlerValue::setDefaultBooleanValue() { - if (mpValue.get() == NULL) + if (mpValue.get() == nullptr) { OOXMLValue::Pointer_t pValue = OOXMLBooleanValue::Create(true); setValue(pValue); @@ -1306,7 +1306,7 @@ void OOXMLFastContextHandlerValue::setDefaultBooleanValue() void OOXMLFastContextHandlerValue::setDefaultIntegerValue() { - if (mpValue.get() == NULL) + if (mpValue.get() == nullptr) { OOXMLValue::Pointer_t pValue = OOXMLIntegerValue::Create(0); setValue(pValue); @@ -1315,7 +1315,7 @@ void OOXMLFastContextHandlerValue::setDefaultIntegerValue() void OOXMLFastContextHandlerValue::setDefaultHexValue() { - if (mpValue.get() == NULL) + if (mpValue.get() == nullptr) { OOXMLValue::Pointer_t pValue(new OOXMLHexValue(sal_uInt32(0))); setValue(pValue); @@ -1324,7 +1324,7 @@ void OOXMLFastContextHandlerValue::setDefaultHexValue() void OOXMLFastContextHandlerValue::setDefaultStringValue() { - if (mpValue.get() == NULL) + if (mpValue.get() == nullptr) { OOXMLValue::Pointer_t pValue(new OOXMLStringValue(OUString())); setValue(pValue); @@ -1373,11 +1373,11 @@ void OOXMLFastContextHandlerTable::lcl_endFastElement void OOXMLFastContextHandlerTable::addCurrentChild() { OOXMLFastContextHandler * pHandler = dynamic_cast(mCurrentChild.get()); - if (pHandler != NULL) + if (pHandler != nullptr) { OOXMLValue::Pointer_t pValue(pHandler->getValue()); - if (pValue.get() != NULL) + if (pValue.get() != nullptr) { OOXMLTableImpl::ValuePointer_t pTmpVal(pValue->clone()); mTable.add(pTmpVal); @@ -1929,7 +1929,7 @@ throw (uno::RuntimeException, xml::sax::SAXException) if (mxContext.is()) { OOXMLFastContextHandler * pHandler = getFastContextHandler(); - if (pHandler != NULL) + if (pHandler != nullptr) pHandler->attributes(Attribs); } } @@ -2017,7 +2017,7 @@ OOXMLFastContextHandlerWrapper::getFastContextHandler() const if (mxContext.is()) return dynamic_cast(mxContext.get()); - return NULL; + return nullptr; } void OOXMLFastContextHandlerWrapper::newProperty @@ -2026,7 +2026,7 @@ void OOXMLFastContextHandlerWrapper::newProperty if (mxContext.is()) { OOXMLFastContextHandler * pHandler = getFastContextHandler(); - if (pHandler != NULL) + if (pHandler != nullptr) pHandler->newProperty(rId, pVal); } } @@ -2037,7 +2037,7 @@ void OOXMLFastContextHandlerWrapper::setPropertySet if (mxContext.is()) { OOXMLFastContextHandler * pHandler = getFastContextHandler(); - if (pHandler != NULL) + if (pHandler != nullptr) pHandler->setPropertySet(pPropertySet); } @@ -2052,7 +2052,7 @@ OOXMLPropertySet::Pointer_t OOXMLFastContextHandlerWrapper::getPropertySet() if (mxContext.is()) { OOXMLFastContextHandler * pHandler = getFastContextHandler(); - if (pHandler != NULL) + if (pHandler != nullptr) pResult = pHandler->getPropertySet(); } @@ -2066,7 +2066,7 @@ string OOXMLFastContextHandlerWrapper::getType() const if (mxContext.is()) { OOXMLFastContextHandler * pHandler = getFastContextHandler(); - if (pHandler != NULL) + if (pHandler != nullptr) sResult += pHandler->getType(); } @@ -2082,7 +2082,7 @@ void OOXMLFastContextHandlerWrapper::setId(Id rId) if (mxContext.is()) { OOXMLFastContextHandler * pHandler = getFastContextHandler(); - if (pHandler != NULL) + if (pHandler != nullptr) pHandler->setId(rId); } } @@ -2094,7 +2094,7 @@ Id OOXMLFastContextHandlerWrapper::getId() const if (mxContext.is()) { OOXMLFastContextHandler * pHandler = getFastContextHandler(); - if (pHandler != NULL && pHandler->getId() != 0) + if (pHandler != nullptr && pHandler->getId() != 0) nResult = pHandler->getId(); } @@ -2108,7 +2108,7 @@ void OOXMLFastContextHandlerWrapper::setToken(Token_t nToken) if (mxContext.is()) { OOXMLFastContextHandler * pHandler = getFastContextHandler(); - if (pHandler != NULL) + if (pHandler != nullptr) pHandler->setToken(nToken); } } @@ -2120,7 +2120,7 @@ Token_t OOXMLFastContextHandlerWrapper::getToken() const if (mxContext.is()) { OOXMLFastContextHandler * pHandler = getFastContextHandler(); - if (pHandler != NULL) + if (pHandler != nullptr) nResult = pHandler->getToken(); } @@ -2193,7 +2193,7 @@ void OOXMLFastContextHandlerMath::process() // so help it with an intermediate cast. I'm not sure what exactly the problem is, seems to be unrelated // to RTLD_GLOBAL, so most probably a gcc bug. oox::FormulaImportBase* import = dynamic_cast< oox::FormulaImportBase* >( dynamic_cast< SfxBaseModel* >(component.get())); - assert( import != NULL ); + assert( import != nullptr ); if (!import) return; import->readFormulaOoxml( buffer ); diff --git a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx index fc793de10bf8..740bc33ce0df 100644 --- a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx @@ -148,11 +148,11 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL << endl; #endif - if ( mpStream == 0 && mpDocument == 0 ) + if ( mpStream == nullptr && mpDocument == nullptr ) { // document handler has been created as unknown child - see // --> do not provide a child context - return NULL; + return nullptr; } return OOXMLFactory::getInstance()->createFastChildContextFromStart(getContextHandler().get(), Element); @@ -181,7 +181,7 @@ Name #endif return uno::Reference< xml::sax::XFastContextHandler > - ( new OOXMLFastDocumentHandler( m_xContext, 0, 0, 0 ) ); + ( new OOXMLFastDocumentHandler( m_xContext, nullptr, nullptr, 0 ) ); } void SAL_CALL OOXMLFastDocumentHandler::characters(const OUString & /*aChars*/) @@ -208,7 +208,7 @@ void SAL_CALL OOXMLFastDocumentHandler::setDocumentLocator void OOXMLFastDocumentHandler::setIsSubstream( bool bSubstream ) { - if ( mpStream != 0 && mpDocument != 0 ) + if ( mpStream != nullptr && mpDocument != nullptr ) { getContextHandler( )->getParserState( )->setInSectionGroup( bSubstream ); } diff --git a/writerfilter/source/ooxml/OOXMLParserState.cxx b/writerfilter/source/ooxml/OOXMLParserState.cxx index 0028d378952e..3b8f7647cf73 100644 --- a/writerfilter/source/ooxml/OOXMLParserState.cxx +++ b/writerfilter/source/ooxml/OOXMLParserState.cxx @@ -36,7 +36,7 @@ OOXMLParserState::OOXMLParserState() : mbForwardEvents(true), mnContexts(0), mnHandle(0), - mpDocument(NULL), + mpDocument(nullptr), inTxbxContent(false), savedInParagraphGroup(false), savedInCharacterGroup(false), @@ -115,7 +115,7 @@ const OUString & OOXMLParserState::getTarget() const void OOXMLParserState::resolveCharacterProperties(Stream & rStream) { - if (mpCharacterProps.get() != NULL) + if (mpCharacterProps.get() != nullptr) { rStream.props(mpCharacterProps); mpCharacterProps.reset(new OOXMLPropertySetImpl()); @@ -124,7 +124,7 @@ void OOXMLParserState::resolveCharacterProperties(Stream & rStream) void OOXMLParserState::setCharacterProperties(OOXMLPropertySet::Pointer_t pProps) { - if (mpCharacterProps.get() == NULL) + if (mpCharacterProps.get() == nullptr) mpCharacterProps = pProps; else mpCharacterProps->add(pProps); @@ -136,7 +136,7 @@ void OOXMLParserState::setCellProperties(OOXMLPropertySet::Pointer_t pProps) { OOXMLPropertySet::Pointer_t & rCellProps = mCellProps.top(); - if (rCellProps.get() == NULL) + if (rCellProps.get() == nullptr) rCellProps = pProps; else rCellProps->add(pProps); @@ -149,7 +149,7 @@ void OOXMLParserState::setRowProperties(OOXMLPropertySet::Pointer_t pProps) { OOXMLPropertySet::Pointer_t & rRowProps = mRowProps.top(); - if (rRowProps.get() == NULL) + if (rRowProps.get() == nullptr) rRowProps = pProps; else rRowProps->add(pProps); @@ -162,7 +162,7 @@ void OOXMLParserState::resolveCellProperties(Stream & rStream) { OOXMLPropertySet::Pointer_t & rCellProps = mCellProps.top(); - if (rCellProps.get() != NULL) + if (rCellProps.get() != nullptr) { rStream.props(rCellProps); rCellProps.reset(new OOXMLPropertySetImpl()); @@ -176,7 +176,7 @@ void OOXMLParserState::resolveRowProperties(Stream & rStream) { OOXMLPropertySet::Pointer_t & rRowProps = mRowProps.top(); - if (rRowProps.get() != NULL) + if (rRowProps.get() != nullptr) { rStream.props(rRowProps); rRowProps.reset(new OOXMLPropertySetImpl()); @@ -190,7 +190,7 @@ void OOXMLParserState::resolveTableProperties(Stream & rStream) { OOXMLPropertySet::Pointer_t & rTableProps = mTableProps.top(); - if (rTableProps.get() != NULL) + if (rTableProps.get() != nullptr) { rStream.props(rTableProps); // Don't clean the table props to send them again for each row @@ -204,7 +204,7 @@ void OOXMLParserState::setTableProperties(OOXMLPropertySet::Pointer_t pProps) if (!mTableProps.empty()) { OOXMLPropertySet::Pointer_t & rTableProps = mTableProps.top(); - if (rTableProps.get() == NULL) + if (rTableProps.get() == nullptr) rTableProps = pProps; else rTableProps->add(pProps); diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx index 7c4cdd469489..d4a0904287d2 100644 --- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx @@ -66,7 +66,7 @@ Value::Pointer_t OOXMLPropertyImpl::getValue() { Value::Pointer_t pResult; - if (mpValue.get() != NULL) + if (mpValue.get() != nullptr) pResult = Value::Pointer_t(mpValue->clone()); else pResult = Value::Pointer_t(new OOXMLValue()); @@ -78,7 +78,7 @@ writerfilter::Reference::Pointer_t OOXMLPropertyImpl::getBinary() { writerfilter::Reference::Pointer_t pResult; - if (mpValue.get() != NULL) + if (mpValue.get() != nullptr) pResult = mpValue->getBinary(); return pResult; @@ -88,7 +88,7 @@ writerfilter::Reference::Pointer_t OOXMLPropertyImpl::getStream() { writerfilter::Reference::Pointer_t pResult; - if (mpValue.get() != NULL) + if (mpValue.get() != nullptr) pResult = mpValue->getStream(); return pResult; @@ -98,7 +98,7 @@ writerfilter::Reference::Pointer_t OOXMLPropertyImpl::getProps() { writerfilter::Reference::Pointer_t pResult; - if (mpValue.get() != NULL) + if (mpValue.get() != nullptr) pResult = mpValue->getProperties(); return pResult; @@ -133,7 +133,7 @@ string OOXMLPropertyImpl::toString() const sResult += getName(); sResult += ", "; - if (mpValue.get() != NULL) + if (mpValue.get() != nullptr) sResult += mpValue->toString(); else sResult +="(null)"; @@ -150,7 +150,7 @@ Sprm * OOXMLPropertyImpl::clone() void OOXMLPropertyImpl::resolve(writerfilter::Properties & rProperties) { - writerfilter::Properties * pProperties = NULL; + writerfilter::Properties * pProperties = nullptr; pProperties = &rProperties; switch (meType) @@ -396,9 +396,9 @@ bool OOXMLPropertySetImplCompare::operator()(const OOXMLProperty::Pointer_t x, { bool bResult = false; - if (x.get() == NULL && y.get() != NULL) + if (x.get() == nullptr && y.get() != nullptr) bResult = true; - else if (x.get() != NULL && y.get() != NULL) + else if (x.get() != nullptr && y.get() != nullptr) bResult = x->getId() < y->getId(); return bResult; @@ -428,7 +428,7 @@ void OOXMLPropertySetImpl::resolve(Properties & rHandler) { OOXMLProperty::Pointer_t pProp = mProperties[nIt]; - if (pProp.get() != NULL) + if (pProp.get() != nullptr) pProp->resolve(rHandler); } } @@ -462,7 +462,7 @@ string OOXMLPropertySetImpl::getType() const void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty) { - if (pProperty.get() != NULL && pProperty->getId() != 0x0) + if (pProperty.get() != nullptr && pProperty->getId() != 0x0) { mProperties.push_back(pProperty); } @@ -470,12 +470,12 @@ void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty) void OOXMLPropertySetImpl::add(OOXMLPropertySet::Pointer_t pPropertySet) { - if (pPropertySet.get() != NULL) + if (pPropertySet.get() != nullptr) { OOXMLPropertySetImpl * pSet = dynamic_cast(pPropertySet.get()); - if (pSet != NULL) + if (pSet != nullptr) { mProperties.resize(mProperties.size() + pSet->mProperties.size()); for (OOXMLProperties_t::iterator aIt = pSet->mProperties.begin(); @@ -512,7 +512,7 @@ string OOXMLPropertySetImpl::toString() if (aIt != aItBegin) sResult += ", "; - if ((*aIt).get() != NULL) + if ((*aIt).get() != nullptr) sResult += (*aIt)->toString(); else sResult += "0x0"; @@ -794,7 +794,7 @@ void OOXMLTableImpl::resolve(Table & rTable) writerfilter::Reference::Pointer_t pProperties ((*it)->getProperties()); - if (pProperties.get() != NULL) + if (pProperties.get() != nullptr) pTable->entry(nPos, pProperties); ++nPos; @@ -804,7 +804,7 @@ void OOXMLTableImpl::resolve(Table & rTable) void OOXMLTableImpl::add(ValuePointer_t pPropertySet) { - if (pPropertySet.get() != NULL) + if (pPropertySet.get() != nullptr) mPropertySets.push_back(pPropertySet); } diff --git a/writerfilter/source/resourcemodel/TagLogger.cxx b/writerfilter/source/resourcemodel/TagLogger.cxx index 104c361ce628..8338483da83b 100644 --- a/writerfilter/source/resourcemodel/TagLogger.cxx +++ b/writerfilter/source/resourcemodel/TagLogger.cxx @@ -29,14 +29,14 @@ using namespace css; namespace writerfilter { TagLogger::TagLogger(const char* name) - : pWriter( NULL ), pName( name ) + : pWriter( nullptr ), pName( name ) { } TagLogger::~TagLogger() { - pWriter = NULL; - pName = NULL; + pWriter = nullptr; + pName = nullptr; } #ifdef DEBUG_WRITERFILTER @@ -48,7 +48,7 @@ namespace writerfilter std::string fileName; char * temp = getenv("TAGLOGGERTMP"); - if (temp != NULL) + if (temp != nullptr) fileName += temp; else fileName += "/tmp"; @@ -76,7 +76,7 @@ namespace writerfilter { if (!pWriter) return; - xmlTextWriterStartDocument( pWriter, NULL, NULL, NULL ); + xmlTextWriterStartDocument( pWriter, nullptr, nullptr, nullptr ); xmlTextWriterStartElement( pWriter, BAD_CAST( "root" ) ); } @@ -86,7 +86,7 @@ namespace writerfilter return; xmlTextWriterEndDocument( pWriter ); xmlFreeTextWriter( pWriter ); - pWriter = NULL; + pWriter = nullptr; } #endif @@ -267,7 +267,7 @@ namespace writerfilter void PropertySetDumpHandler::resolve( writerfilter::Reference::Pointer_t pProps) { - if (pProps.get() != NULL) + if (pProps.get() != nullptr) pProps->resolve( *this ); } diff --git a/writerfilter/source/resourcemodel/qnametostrcore.cxx b/writerfilter/source/resourcemodel/qnametostrcore.cxx index 4e9a563725fc..27d9bdeb1677 100644 --- a/writerfilter/source/resourcemodel/qnametostrcore.cxx +++ b/writerfilter/source/resourcemodel/qnametostrcore.cxx @@ -26,7 +26,7 @@ QNameToString::Pointer_t QNameToString::pInstance; QNameToString::Pointer_t QNameToString::Instance() { - if (pInstance.get() == NULL) + if (pInstance.get() == nullptr) pInstance = QNameToString::Pointer_t(new QNameToString()); return pInstance; diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index ed963a3d37e4..c7a54721baf0 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -137,7 +137,7 @@ static RTFSprms& lcl_getLastAttributes(RTFSprms& rSprms, Id nId) static void lcl_putBorderProperty(RTFStack& aStates, Id nId, RTFValue::Pointer_t pValue) { - RTFSprms* pAttributes = 0; + RTFSprms* pAttributes = nullptr; if (aStates.top().nBorderState == BORDER_PARAGRAPH_BOX) for (int i = 0; i < 4; i++) { @@ -200,7 +200,7 @@ static const char* lcl_RtfToString(RTFKeyword nKeyword) if (nKeyword == aRTFControlWords[i].nIndex) return aRTFControlWords[i].sKeyword; } - return NULL; + return nullptr; } static util::DateTime lcl_getDateTime(RTFParserState& aState) @@ -241,7 +241,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference const& x m_xDstDoc(xDstDoc), m_xFrame(xFrame), m_xStatusIndicator(xStatusIndicator), - m_pMapperStream(NULL), + m_pMapperStream(nullptr), m_aDefaultState(this), m_bSkipUnknown(false), m_aFontIndexes(), @@ -265,7 +265,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference const& x m_aTableBufferStack(1), // create top-level buffer already m_aSuperBuffer(), m_bHasFootnote(false), - m_pSuperstream(0), + m_pSuperstream(nullptr), m_nStreamType(0), m_nHeaderFooterPositions(), m_nGroupStartPos(0), @@ -344,7 +344,7 @@ void RTFDocumentImpl::setAuthorInitials(OUString& rAuthorInitials) bool RTFDocumentImpl::isSubstream() const { - return m_pSuperstream != 0; + return m_pSuperstream != nullptr; } void RTFDocumentImpl::finishSubstream() @@ -741,7 +741,7 @@ void RTFDocumentImpl::resolve(Stream& rMapper) int RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference const& i_xShape) { SvMemoryStream aStream; - SvStream* pStream = 0; + SvStream* pStream = nullptr; if (!m_pBinaryData.get()) { pStream = &aStream; @@ -787,7 +787,7 @@ int RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference xServiceInfo(m_aStates.top().aDrawingObject.xShape, uno::UNO_QUERY); if (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.text.TextFrame")) - pExtHeader = 0; + pExtHeader = nullptr; OUString aGraphicUrl = m_pGraphicHelper->importGraphicObject(xInputStream, pExtHeader); if (m_aStates.top().aPicture.nStyle != BMPSTYLE_NONE) @@ -1691,7 +1691,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) m_bHasFootnote = true; if (m_aStates.top().pCurrentBuffer == &m_aSuperBuffer) - m_aStates.top().pCurrentBuffer = 0; + m_aStates.top().pCurrentBuffer = nullptr; bool bCustomMark = false; OUString aCustomMark; while (m_aSuperBuffer.size()) @@ -2207,7 +2207,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) if (m_aTableBufferStack.size() == 1) { throw io::WrongFormatException( - "mismatch between \\itap and number of \\nestrow", 0); + "mismatch between \\itap and number of \\nestrow", nullptr); } // note: there may be several states pointing to table buffer! for (size_t i = 0; i < m_aStates.size(); ++i) @@ -2862,7 +2862,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) if (m_nTopLevelCells == 0 && m_nNestedCells == 0) { // Reset that we're in a table. - m_aStates.top().pCurrentBuffer = 0; + m_aStates.top().pCurrentBuffer = nullptr; } else { @@ -3151,8 +3151,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) { if (m_aStates.top().pCurrentBuffer == &m_aSuperBuffer) { - replayBuffer(m_aSuperBuffer, 0, 0); - m_aStates.top().pCurrentBuffer = 0; + replayBuffer(m_aSuperBuffer, nullptr, nullptr); + m_aStates.top().pCurrentBuffer = nullptr; } m_aStates.top().aCharacterSprms.erase(NS_ooxml::LN_EG_RPrBase_vertAlign); } @@ -5449,7 +5449,7 @@ int RTFDocumentImpl::popState() // so help it with an intermediate cast. I'm not sure what exactly the problem is, seems to be unrelated // to RTLD_GLOBAL, so most probably a gcc bug. oox::FormulaImportBase* pImport = dynamic_cast(dynamic_cast(xComponent.get())); - assert(pImport != NULL); + assert(pImport != nullptr); if (pImport) pImport->readFormulaOoxml(m_aMathBuffer); RTFValue::Pointer_t pValue(new RTFValue(xObject)); @@ -5914,10 +5914,10 @@ int RTFDocumentImpl::popState() if (aState.pCurrentBuffer == &m_aSuperBuffer) { - OSL_ASSERT(!m_aStates.empty() && m_aStates.top().pCurrentBuffer == 0); + OSL_ASSERT(!m_aStates.empty() && m_aStates.top().pCurrentBuffer == nullptr); if (!m_bHasFootnote) - replayBuffer(m_aSuperBuffer, 0, 0); + replayBuffer(m_aSuperBuffer, nullptr, nullptr); m_bHasFootnote = false; } @@ -6026,10 +6026,10 @@ RTFParserState::RTFParserState(RTFDocumentImpl* pDocumentImpl) nDay(0), nHour(0), nMinute(0), - pDestinationText(0), + pDestinationText(nullptr), nCurrentStyleIndex(-1), nCurrentCharacterStyleIndex(-1), - pCurrentBuffer(0), + pCurrentBuffer(nullptr), bInListpicture(false), bInBackground(false), bHadShapeText(false), -- cgit