diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:25:48 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:53 +0100 |
commit | 01b49802c7cda7fd4d5ba71263cef7bc95234b89 (patch) | |
tree | b8d92f1c6abf5ac548d0bcb0c581ebfcffd8bfac /sw/source/filter/ww8 | |
parent | 6cd7bf2043146a630925a2e49336f02c802f707a (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
Diffstat (limited to 'sw/source/filter/ww8')
49 files changed, 1482 insertions, 1482 deletions
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 3f4b08b04063..92640e340f90 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -44,8 +44,8 @@ WW8TableNodeInfoInner::WW8TableNodeInfoInner(WW8TableNodeInfo * pParent) , mbEndOfCell(false) , mbFirstInTable(false) , mbVertMerge(false) -, mpTableBox(NULL) -, mpTable(NULL) +, mpTableBox(nullptr) +, mpTable(nullptr) { } @@ -129,9 +129,9 @@ void WW8TableNodeInfoInner::setRect(const SwRect & rRect) const SwNode * WW8TableNodeInfoInner::getNode() const { - const SwNode * pResult = NULL; + const SwNode * pResult = nullptr; - if (mpParent != NULL) + if (mpParent != nullptr) pResult = mpParent->getNode(); return pResult; @@ -144,7 +144,7 @@ TableBoxVectorPtr WW8TableNodeInfoInner::getTableBoxesOfRow() WW8TableCellGrid::Pointer_t pCellGrid = mpParent->getParent()->getCellGridForTable(getTable(), false); - if (pCellGrid.get() == NULL) + if (pCellGrid.get() == nullptr) { const SwTableLine * pTabLine = getTableBox()->GetUpper(); const SwTableBoxes & rTableBoxes = pTabLine->GetTabBoxes(); @@ -238,7 +238,7 @@ WidthsPtr WW8TableNodeInfoInner::getColumnWidthsBasedOnAllRows() WW8TableCellGrid::Pointer_t pCellGrid = mpParent->getParent()->getCellGridForTable(getTable(), false); - if (pCellGrid.get() == NULL) + if (pCellGrid.get() == nullptr) { const SwTable * pTable = getTable(); const SwTableLines& rTableLines = pTable->GetTabLines(); @@ -297,7 +297,7 @@ WidthsPtr WW8TableNodeInfoInner::getWidthsOfRow() WW8TableCellGrid::Pointer_t pCellGrid = mpParent->getParent()->getCellGridForTable(getTable(), false); - if (pCellGrid.get() == NULL) + if (pCellGrid.get() == nullptr) { const SwTableBox * pTabBox = getTableBox(); const SwTableLine * pTabLine = pTabBox->GetUpper(); @@ -330,7 +330,7 @@ RowSpansPtr WW8TableNodeInfoInner::getRowSpansOfRow() WW8TableCellGrid::Pointer_t pCellGrid = mpParent->getParent()->getCellGridForTable(getTable(), false); - if (pCellGrid.get() == NULL) + if (pCellGrid.get() == nullptr) { const SwTableBox * pTabBox = getTableBox(); const SwTableLine * pTabLine = pTabBox->GetUpper(); @@ -383,8 +383,8 @@ WW8TableNodeInfo::WW8TableNodeInfo(WW8TableInfo * pParent, : mpParent(pParent), mnDepth(0), mpNode(pNode), - mpNext(NULL), - mpNextNode(NULL) + mpNext(nullptr), + mpNextNode(nullptr) { } @@ -593,7 +593,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable, RowEndInners_t &rLa const SwTableBox * pTableBox = aTableCellInfo.getTableBox(); const SwStartNode * pSttNd = pTableBox->GetSttNd(); - if (pSttNd != NULL) + if (pSttNd != nullptr) { SwPaM aPam(*pSttNd, 0); @@ -628,7 +628,7 @@ void WW8TableInfo::processSwTable(const SwTable * pTable) { SAL_INFO( "sw.ww8", "<processSwTable>" ); - WW8TableNodeInfo * pPrev = NULL; + WW8TableNodeInfo * pPrev = nullptr; RowEndInners_t aLastRowEnds; if (pTable->IsTableComplex() && pTable->HasLayout()) @@ -834,7 +834,7 @@ WW8TableInfo::processTableBox(const SwTable * pTable, } while (!bDone); - if (pEndOfCellInfo.get() != NULL) + if (pEndOfCellInfo.get() != nullptr) { pEndOfCellInfo->setEndOfCell(true); @@ -862,7 +862,7 @@ WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo { WW8TableNodeInfo::Pointer_t pNodeInfo = getTableNodeInfo(pNode); - if (pNodeInfo.get() == NULL) + if (pNodeInfo.get() == nullptr) { pNodeInfo = WW8TableNodeInfo::Pointer_t(new WW8TableNodeInfo(this, pNode)); @@ -935,21 +935,21 @@ WW8TableNodeInfo::Pointer_t WW8TableInfo::getTableNodeInfo const SwNode * WW8TableInfo::getNextNode(const SwNode * pNode) { - const SwNode * pResult = NULL; + const SwNode * pResult = nullptr; WW8TableNodeInfo::Pointer_t pNodeInfo = getTableNodeInfo(pNode); - if (pNodeInfo.get() != NULL) + if (pNodeInfo.get() != nullptr) { WW8TableNodeInfo * pNextInfo = pNodeInfo->getNext(); - if (pNextInfo != NULL) + if (pNextInfo != nullptr) pResult = pNextInfo->getNode(); else { const SwNode * pNextNode = pNodeInfo->getNextNode(); - if (pNextNode != NULL) + if (pNextNode != nullptr) pResult = pNextNode; } } @@ -961,9 +961,9 @@ bool WW8TableNodeInfo::operator < (const WW8TableNodeInfo & rInfo) const { bool bRet = false; - if (rInfo.mpNode != NULL) + if (rInfo.mpNode != nullptr) { - if (mpNode == NULL) + if (mpNode == nullptr) { bRet = true; } @@ -999,7 +999,7 @@ bool CellInfo::operator < (const CellInfo & aCellInfo) const { if (aCellInfo.getTableNodeInfo()) { - if (m_pNodeInfo == NULL) + if (m_pNodeInfo == nullptr) aRet = true; else { @@ -1102,7 +1102,7 @@ void WW8TableCellGrid::insert(const SwRect & rRect, { CellInfo aCellInfo(rRect, pNodeInfo); - if (pFormatFrmWidth != NULL) + if (pFormatFrmWidth != nullptr) aCellInfo.setFormatFrmWidth(*pFormatFrmWidth); WW8TableCellGridRow::Pointer_t pRow = getRow(rRect.Top()); @@ -1144,7 +1144,7 @@ void WW8TableCellGrid::addShadowCells() { aRect.Top(*aRowSpanIt); unsigned long nFormatFrmWidth = aCellIt->getFormatFrmWidth(); - insert(aRect, NULL, &nFormatFrmWidth); + insert(aRect, nullptr, &nFormatFrmWidth); bVertMerge = true; } @@ -1179,7 +1179,7 @@ void WW8TableCellGrid::addShadowCells() } WW8TableCellGridRow::Pointer_t pRow = getRow(*aTopsIt); - if (pRow.get() != NULL) + if (pRow.get() != nullptr) pRow->setRowSpans(pRowSpans); ++aTopsIt; @@ -1191,7 +1191,7 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds) { RowTops_t::const_iterator aTopsIt = getRowTopsBegin(); sal_uInt32 nRow = 0; - WW8TableNodeInfo * pLastNodeInfo = NULL; + WW8TableNodeInfo * pLastNodeInfo = nullptr; while (aTopsIt != getRowTopsEnd()) { @@ -1203,7 +1203,7 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds) sal_uInt32 nShadows = 0; sal_uInt32 nCell = 0; bool bBeginningOfCell = true; - WW8TableNodeInfo * pEndOfCellInfo = NULL; + WW8TableNodeInfo * pEndOfCellInfo = nullptr; sal_uInt32 nDepthInCell = 0; while (aCellIt != aCellEndIt) { @@ -1216,7 +1216,7 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds) if (pNode->IsStartNode()) { nDepthInCell++; - pEndOfCellInfo = NULL; + pEndOfCellInfo = nullptr; } if (nDepthInCell == 1 && pNode->IsTextNode()) @@ -1253,7 +1253,7 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds) if (pNodeInfo) pTableBoxes->push_back(pNodeInfo->getTableBox()); else - pTableBoxes->push_back(NULL); + pTableBoxes->push_back(nullptr); } ++aCellIt; @@ -1269,7 +1269,7 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds) pEndOfCellInfo->setEndOfCell(true); } - pEndOfCellInfo = NULL; + pEndOfCellInfo = nullptr; } } @@ -1330,7 +1330,7 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds) WW8TableCellGridRow::Pointer_t pRow = getRow(*aTopsIt); WidthsPtr pWidths = pRow->getWidths(); - if (pWidths != 0) + if (pWidths != nullptr) { sResult += "<widths>"; @@ -1350,7 +1350,7 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds) } RowSpansPtr pRowSpans = pRow->getRowSpans(); - if (pRowSpans.get() != NULL) + if (pRowSpans.get() != nullptr) { sResult += "<rowspans>"; @@ -1386,7 +1386,7 @@ TableBoxVectorPtr WW8TableCellGrid::getTableBoxesOfRow WW8TableCellGridRow::Pointer_t pRow = getRow(pNodeInfoInner->getRect().Top(), false); - if (pRow.get() != NULL) + if (pRow.get() != nullptr) { pResult = pRow->getTableBoxVector(); } @@ -1402,7 +1402,7 @@ WidthsPtr WW8TableCellGrid::getWidthsOfRow WW8TableCellGridRow::Pointer_t pRow = getRow(pNodeInfoInner->getRect().Top(), false); - if (pRow.get() != NULL) + if (pRow.get() != nullptr) { pResult = pRow->getWidths(); } @@ -1418,7 +1418,7 @@ RowSpansPtr WW8TableCellGrid::getRowSpansOfRow WW8TableCellGridRow::Pointer_t pRow = getRow(pNodeInfoInner->getRect().Top(), false); - if (pRow.get() != NULL) + if (pRow.get() != nullptr) { pResult = pRow->getRowSpans(); } @@ -1477,7 +1477,7 @@ void WW8TableCellGridRow::setRowSpans(RowSpansPtr pRowSpans) CellInfo::CellInfo(const SwRect & aRect, WW8TableNodeInfo * pNodeInfo) : m_aRect(aRect), m_pNodeInfo(pNodeInfo), m_nFormatFrmWidth(0) { - if (pNodeInfo != NULL) + if (pNodeInfo != nullptr) { const SwTableBox * pBox = pNodeInfo->getTableBox(); const SwFrameFormat * pFrameFormat = pBox->GetFrameFormat(); diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx index 06454cff01a5..f6f7168e5d92 100644 --- a/sw/source/filter/ww8/WW8TableInfo.hxx +++ b/sw/source/filter/ww8/WW8TableInfo.hxx @@ -276,7 +276,7 @@ public: ~WW8TableCellGrid(); void insert(const SwRect & rRect, WW8TableNodeInfo * pNodeInfo, - unsigned long * pFormatFrmWidth = NULL); + unsigned long * pFormatFrmWidth = nullptr); void addShadowCells(); WW8TableNodeInfo *connectCells(RowEndInners_t &rLastRowEnds); @@ -330,7 +330,7 @@ class WW8TableInfo sal_uInt32 nRow, sal_uInt32 nCell, sal_uInt32 nDepth, - SwRect * pRect = NULL); + SwRect * pRect = nullptr); WW8TableCellGrid::Pointer_t getCellGridForTable(const SwTable * pTable, bool bCreate = true); diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 506717dddc30..3fe18ea3536e 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -292,7 +292,7 @@ public: /// Write a section break /// msword::ColumnBreak or msword::PageBreak - virtual void SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = NULL ) = 0; + virtual void SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = nullptr ) = 0; // preserve page vertical alignment virtual void TextVerticalAdjustment( const css::drawing::TextVerticalAdjust) {}; @@ -358,7 +358,7 @@ public: sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, const OUString &rNumberingString, - const SvxBrushItem* pBrush = 0) = 0; // #i120928 export graphic of bullet + const SvxBrushItem* pBrush = nullptr) = 0; // #i120928 export graphic of bullet protected: diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index e06f81cd0cc7..cfd048424302 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -537,7 +537,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT WritePostponedCustomShape(); m_pSerializer->endElementNS( XML_w, XML_r ); } - m_pPostponedCustomShape.reset(0); + m_pPostponedCustomShape.reset(nullptr); m_aFramesOfParagraph.clear(); } @@ -591,7 +591,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT pushToTableExportContext(aTableExportContext); m_pCurrentFrame = it->get(); m_rExport.SdrExporter().writeOnlyTextOfFrame(it->get()); - m_pCurrentFrame = NULL; + m_pCurrentFrame = nullptr; popFromTableExportContext(aTableExportContext); } aFramePrTextbox.clear(); @@ -936,7 +936,7 @@ void lcl_writeParagraphMarkerProperties(DocxAttributeOutput& rAttributeOutput, c { SfxWhichIter aIter(rParagraphMarkerProperties); sal_uInt16 nWhichId = aIter.FirstWhich(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; // Did we already produce a <w:sz> element? bool bFontSizeWritten = false; while (nWhichId) @@ -1286,7 +1286,7 @@ void DocxAttributeOutput::EndRun() WritePendingPlaceholder(); - m_pRedlineData = NULL; + m_pRedlineData = nullptr; if ( m_closeHyperlinkInThisRun ) { @@ -1709,9 +1709,9 @@ void DocxAttributeOutput::StartRunProperties() void DocxAttributeOutput::InitCollectedRunProperties() { - m_pFontsAttrList = 0; - m_pEastAsianLayoutAttrList = 0; - m_pCharLangAttrList = 0; + m_pFontsAttrList = nullptr; + m_pEastAsianLayoutAttrList = nullptr; + m_pCharLangAttrList = nullptr; // Write the elements in the spec order static const sal_Int32 aOrder[] = @@ -2065,7 +2065,7 @@ void DocxAttributeOutput::WritePostponedGraphic() it != m_pPostponedGraphic->end(); ++it ) FlyFrameGraphic( it->grfNode, it->size, it->mOLEFrameFormat, it->mOLENode, it->pSdrObj ); - m_pPostponedGraphic.reset(0); + m_pPostponedGraphic.reset(nullptr); } void DocxAttributeOutput::WritePostponedDiagram() @@ -2074,7 +2074,7 @@ void DocxAttributeOutput::WritePostponedDiagram() it != m_pPostponedDiagrams->end(); ++it ) m_rExport.SdrExporter().writeDiagram( it->object, *(it->frame), m_anchorId++ ); - m_pPostponedDiagrams.reset(0); + m_pPostponedDiagrams.reset(nullptr); } void DocxAttributeOutput::FootnoteEndnoteRefTag() @@ -2228,7 +2228,7 @@ void DocxAttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 nPos, co m_pSerializer->endElementNS( XML_w, XML_rubyPr ); m_pSerializer->startElementNS( XML_w, XML_rt, FSEND ); - StartRun( NULL ); + StartRun( nullptr ); StartRunProperties( ); SwWW8AttrIter aAttrIt( m_rExport, rNode ); aAttrIt.OutAttr( nPos, true ); @@ -2238,13 +2238,13 @@ void DocxAttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 nPos, co m_pSerializer->singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); - EndRunProperties( NULL ); + EndRunProperties( nullptr ); RunText( rRuby.GetText( ) ); EndRun( ); m_pSerializer->endElementNS( XML_w, XML_rt ); m_pSerializer->startElementNS( XML_w, XML_rubyBase, FSEND ); - StartRun( NULL ); + StartRun( nullptr ); } void DocxAttributeOutput::EndRuby() @@ -2291,7 +2291,7 @@ bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarge if ( !sMark.isEmpty() && !bBookmarkOnly ) { - m_rExport.OutputField( NULL, ww::eHYPERLINK, sUrl ); + m_rExport.OutputField( nullptr, ww::eHYPERLINK, sUrl ); } else { @@ -2357,7 +2357,7 @@ bool DocxAttributeOutput::EndURL(bool const) void DocxAttributeOutput::FieldVanish( const OUString& rText, ww::eField eType ) { - WriteField_Impl( NULL, eType, rText, WRITEFIELD_ALL ); + WriteField_Impl( nullptr, eType, rText, WRITEFIELD_ALL ); } // The difference between 'Redline' and 'StartRedline'+'EndRedline' is that: @@ -2574,7 +2574,7 @@ void DocxAttributeOutput::ParagraphStyle( sal_uInt16 nStyle ) } static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, const SvxBorderLine* pBorderLine, sal_uInt16 nDist, - bool bWriteShadow = false, const table::BorderLine2* rStyleProps = NULL ) + bool bWriteShadow = false, const table::BorderLine2* rStyleProps = nullptr ) { // Compute val attribute value // Can be one of: @@ -2638,7 +2638,7 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co break; } } - else if( rStyleProps == NULL ) + else if( rStyleProps == nullptr ) // no line, and no line set by the style either: // there is no need to write the property return; @@ -2646,7 +2646,7 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co // compare the properties with the theme properties before writing them: // if they are equal, it means that they were style-defined and there is // no need to write them. - if( rStyleProps != NULL && pBorderLine && !pBorderLine->isEmpty() && + if( rStyleProps != nullptr && pBorderLine && !pBorderLine->isEmpty() && pBorderLine->GetBorderLineStyle() == rStyleProps->LineStyle && pBorderLine->GetColor() == rStyleProps->Color && pBorderLine->GetWidth() == convertMm100ToTwip( rStyleProps->LineWidth ) ) @@ -2779,7 +2779,7 @@ static void impl_borders( FSHelperPtr pSerializer, const SvxBoxItem& rBox, const for( int i = 0; i < 4; ++i, ++pBrd ) { const SvxBorderLine* pLn = rBox.GetLine( *pBrd ); - const table::BorderLine2 *aStyleProps = NULL; + const table::BorderLine2 *aStyleProps = nullptr; if( rTableStyleConf.find( *pBrd ) != rTableStyleConf.end() ) aStyleProps = &rTableStyleConf[ *pBrd ]; @@ -2853,14 +2853,14 @@ static void impl_borders( FSHelperPtr pSerializer, const SvxBoxItem& rBox, const } if (bWriteInsideH) { - const table::BorderLine2 *aStyleProps = NULL; + const table::BorderLine2 *aStyleProps = nullptr; if( rTableStyleConf.find( SvxBoxItemLine::BOTTOM ) != rTableStyleConf.end() ) aStyleProps = &rTableStyleConf[ SvxBoxItemLine::BOTTOM ]; impl_borderLine( pSerializer, XML_insideH, rBox.GetLine(SvxBoxItemLine::BOTTOM), 0, false, aStyleProps ); } if (bWriteInsideV) { - const table::BorderLine2 *aStyleProps = NULL; + const table::BorderLine2 *aStyleProps = nullptr; if( rTableStyleConf.find( SvxBoxItemLine::RIGHT ) != rTableStyleConf.end() ) aStyleProps = &rTableStyleConf[ SvxBoxItemLine::RIGHT ]; impl_borderLine( pSerializer, XML_insideV, rBox.GetLine(SvxBoxItemLine::RIGHT), 0, false, aStyleProps ); @@ -2870,7 +2870,7 @@ static void impl_borders( FSHelperPtr pSerializer, const SvxBoxItem& rBox, const } } -static void impl_cellMargins( FSHelperPtr pSerializer, const SvxBoxItem& rBox, sal_Int32 tag, bool bUseStartEnd = false, const SvxBoxItem* pDefaultMargins = 0) +static void impl_cellMargins( FSHelperPtr pSerializer, const SvxBoxItem& rBox, sal_Int32 tag, bool bUseStartEnd = false, const SvxBoxItem* pDefaultMargins = nullptr) { static const SvxBoxItemLine aBorders[] = { @@ -2986,7 +2986,7 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point const SvxBoxItem& rDefaultBox = (*tableFirstCells.rbegin())->getTableBox( )->GetFrameFormat( )->GetBox( ); { // The cell borders - impl_borders( m_pSerializer, rBox, lcl_getTableCellBorderOptions(bEcma), NULL, m_aTableStyleConf ); + impl_borders( m_pSerializer, rBox, lcl_getTableCellBorderOptions(bEcma), nullptr, m_aTableStyleConf ); } TableBackgrounds( pTableTextNodeInfoInner ); @@ -3056,7 +3056,7 @@ void DocxAttributeOutput::EndTable() m_tableReference->m_bTableCellOpen = true; // Cleans the table helper - m_xTableWrt.reset(0); + m_xTableWrt.reset(nullptr); m_aTableStyleConf.clear(); } @@ -3286,7 +3286,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t {"lastColumn", XML_lastColumn}, {"noHBand", XML_noHBand}, {"noVBand", XML_noVBand}, - {0, 0} + {nullptr, 0} }; if (sal_Int32 nToken = DocxStringGetToken(aTokens, aAttributeList[i].Name)) @@ -3352,7 +3352,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t XFastAttributeListRef xAttrListTablePosRef( attrListTablePos ); m_pSerializer->singleElementNS( XML_w, XML_tblpPr, xAttrListTablePosRef); - attrListTablePos = NULL; + attrListTablePos = nullptr; } else SAL_WARN("sw.ww8", "DocxAttributeOutput::TableDefinition: unhandled property: " << aGrabBagElement->first); @@ -3444,7 +3444,7 @@ void DocxAttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Point if (m_aTableStyleConf.empty()) { // the defaults of the table are taken from the top-left cell - impl_borders(m_pSerializer, pFrameFormat->GetBox(), lcl_getTableDefaultBorderOptions(bEcma), NULL, m_aTableStyleConf); + impl_borders(m_pSerializer, pFrameFormat->GetBox(), lcl_getTableDefaultBorderOptions(bEcma), nullptr, m_aTableStyleConf); } } @@ -3527,7 +3527,7 @@ void DocxAttributeOutput::TableRowRedline( ww8::WW8TableNodeInfoInner::Pointer_t { SwExtraRedline* pExtraRedline = aExtraRedlineTable.GetRedline(nCurRedlinePos); const SwTableRowRedline* pTableRowRedline = dynamic_cast<const SwTableRowRedline*>(pExtraRedline); - const SwTableLine *pRedTabLine = pTableRowRedline ? &pTableRowRedline->GetTableLine() : NULL; + const SwTableLine *pRedTabLine = pTableRowRedline ? &pTableRowRedline->GetTableLine() : nullptr; if (pRedTabLine == pTabLine) { // Redline for this table row @@ -3573,7 +3573,7 @@ void DocxAttributeOutput::TableCellRedline( ww8::WW8TableNodeInfoInner::Pointer_ { SwExtraRedline* pExtraRedline = aExtraRedlineTable.GetRedline(nCurRedlinePos); const SwTableCellRedline* pTableCellRedline = dynamic_cast<const SwTableCellRedline*>(pExtraRedline); - const SwTableBox *pRedTabBox = pTableCellRedline ? &pTableCellRedline->GetTableBox() : NULL; + const SwTableBox *pRedTabBox = pTableCellRedline ? &pTableCellRedline->GetTableBox() : nullptr; if (pRedTabBox == pTabBox) { // Redline for this table cell @@ -3619,7 +3619,7 @@ void DocxAttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTa if ( ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight() ) { sal_Int32 nHeight = rLSz.GetHeight(); - const char *pRule = NULL; + const char *pRule = nullptr; switch ( rLSz.GetHeightSizeType() ) { @@ -3779,7 +3779,7 @@ DocxStringTokenMap const aDefaultTokens[] = { {"count", XML_count}, {"defUIPriority", XML_defUIPriority}, {"defLockedState", XML_defLockedState}, - {0, 0} + {nullptr, 0} }; DocxStringTokenMap const aExceptionTokens[] = { @@ -3789,7 +3789,7 @@ DocxStringTokenMap const aExceptionTokens[] = { {"semiHidden", XML_semiHidden}, {"unhideWhenUsed", XML_unhideWhenUsed}, {"qFormat", XML_qFormat}, - {0, 0} + {nullptr, 0} }; } @@ -3825,7 +3825,7 @@ void DocxAttributeOutput::LatentStyles() XFastAttributeListRef xAttributeList(pAttributeList); m_pSerializer->startElementNS(XML_w, XML_latentStyles, xAttributeList); - pAttributeList = 0; + pAttributeList = nullptr; // Then handle the exceptions. for (sal_Int32 i = 0; i < aLsdExceptions.getLength(); ++i) @@ -3840,7 +3840,7 @@ void DocxAttributeOutput::LatentStyles() xAttributeList = pAttributeList; m_pSerializer->singleElementNS(XML_w, XML_lsdException, xAttributeList); - pAttributeList = 0; + pAttributeList = nullptr; } m_pSerializer->endElementNS(XML_w, XML_latentStyles); @@ -3857,7 +3857,7 @@ bool lcl_isDefaultFontSize(const SvxFontHeightItem& rFontHeight, SwDoc* pDoc) SwTextFormatColl* pDefaultStyle = pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD); if (pDefaultStyle) { - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if (pDefaultStyle->GetAttrSet().HasItem(RES_CHRATR_FONTSIZE, &pItem)) return static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() != rFontHeight.GetHeight(); } @@ -3921,8 +3921,8 @@ void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem& rHt) const SvxBrushItem& rBrushItem = static_cast< const SvxBrushItem& >(rHt); bMustWrite = (rBrushItem.GetColor() != COL_AUTO || rBrushItem.GetShadingValue() != ShadingPattern::CLEAR || - rBrushItem.GetGraphic() != NULL || - rBrushItem.GetGraphicObject() != NULL); + rBrushItem.GetGraphic() != nullptr || + rBrushItem.GetGraphicObject() != nullptr); } break; @@ -3989,8 +3989,8 @@ void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem& rHt) const SvxBrushItem& rBrushItem = static_cast< const SvxBrushItem& >(rHt); bMustWrite = (rBrushItem.GetColor() != COL_AUTO || rBrushItem.GetShadingValue() != ShadingPattern::CLEAR || - rBrushItem.GetGraphic() != NULL || - rBrushItem.GetGraphicObject() != NULL); + rBrushItem.GetGraphic() != nullptr || + rBrushItem.GetGraphicObject() != nullptr); } break; @@ -4174,7 +4174,7 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size { // linked image, just create the relation OUString aFileName; - pGrfNode->GetFileFilterNms( &aFileName, 0 ); + pGrfNode->GetFileFilterNms( &aFileName, nullptr ); // TODO Convert the file name to relative for better interoperability @@ -4187,7 +4187,7 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size else { // inline, we also have to write the image itself - const Graphic* pGraphic = 0; + const Graphic* pGraphic = nullptr; if (pGrfNode) pGraphic = &pGrfNode->GetGrf(); else @@ -4212,7 +4212,7 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size // In case there are any grab-bag items on the graphic frame, emit them now. // These are always character grab-bags, as graphics are at-char or as-char in Word. - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if (pFrameFormat->GetAttrSet().HasItem(RES_FRMATR_GRABBAG, &pItem)) { const SfxGrabBagItem* pGrabBag = static_cast<const SfxGrabBagItem*>(pItem); @@ -4295,7 +4295,7 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size FSNS( XML_r, nImageType ), aRelId.getStr(), FSEND ); - pItem = 0; + pItem = nullptr; sal_uInt32 nMode = GRAPHICDRAWMODE_STANDARD; if ( pGrfNode && SfxItemState::SET == pGrfNode->GetSwAttrSet().GetItemState(RES_GRFATR_DRAWMODE, true, &pItem)) @@ -4373,10 +4373,10 @@ void DocxAttributeOutput::WriteOLE2Obj( const SdrObject* pSdrObj, SwOLENode& rOL return; // Then we fall back to just export the object as a graphic. if( !m_pPostponedGraphic ) - FlyFrameGraphic( 0, rSize, pFlyFrameFormat, &rOLENode ); + FlyFrameGraphic( nullptr, rSize, pFlyFrameFormat, &rOLENode ); else // w:drawing should not be inside w:rPr, so write it out later - m_pPostponedGraphic->push_back(PostponedGraphic(0, rSize, pFlyFrameFormat, &rOLENode, 0)); + m_pPostponedGraphic->push_back(PostponedGraphic(nullptr, rSize, pFlyFrameFormat, &rOLENode, nullptr)); } bool DocxAttributeOutput::WriteOLEChart( const SdrObject* pSdrObj, const Size& rSize ) @@ -4404,7 +4404,7 @@ bool DocxAttributeOutput::WriteOLEChart( const SdrObject* pSdrObj, const Size& r */ void DocxAttributeOutput::WritePostponedChart() { - if(m_postponedChart == NULL) + if(m_postponedChart == nullptr) return; uno::Reference< chart2::XChartDocument > xChartDoc; uno::Reference< drawing::XShape > xShape( const_cast<SdrObject*>(m_postponedChart)->getUnoShape(), uno::UNO_QUERY ); @@ -4479,7 +4479,7 @@ void DocxAttributeOutput::WritePostponedChart() m_pSerializer->endElementNS( XML_w, XML_drawing ); } - m_postponedChart = NULL; + m_postponedChart = nullptr; } bool DocxAttributeOutput::WriteOLEMath( const SdrObject*, const SwOLENode& rOLENode, const Size& ) @@ -4506,7 +4506,7 @@ void DocxAttributeOutput::WritePostponedMath(const SwOLENode* pPostponedMath) // 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::FormulaExportBase* formulaexport = dynamic_cast<oox::FormulaExportBase*>(dynamic_cast<SfxBaseModel*>(xInterface.get())); - assert( formulaexport != NULL ); + assert( formulaexport != nullptr ); if (formulaexport) formulaexport->writeFormulaOoxml( m_pSerializer, GetExport().GetFilter().getVersion()); } @@ -4699,7 +4699,7 @@ void DocxAttributeOutput::WritePostponedOLE() } // clear list of postponed objects - m_pPostponedOLEs.reset(0); + m_pPostponedOLEs.reset(nullptr); } void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const SwFlyFrameFormat* rFlyFrameFormat ) @@ -4828,7 +4828,7 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S { // the embedded file could not be saved // fallback: save as an image - FlyFrameGraphic( 0, rSize, rFlyFrameFormat, &rNode ); + FlyFrameGraphic( nullptr, rSize, rFlyFrameFormat, &rNode ); return; } @@ -4887,7 +4887,7 @@ void DocxAttributeOutput::WritePostponedVMLDrawing() { m_rExport.SdrExporter().writeVMLDrawing(it->object, *(it->frame), *(it->point)); } - m_pPostponedVMLDrawings.reset(0); + m_pPostponedVMLDrawings.reset(nullptr); } void DocxAttributeOutput::WritePostponedCustomShape() @@ -4906,7 +4906,7 @@ void DocxAttributeOutput::WritePostponedCustomShape() m_rExport.SdrExporter().writeDMLAndVMLDrawing(it->object, *(it->frame), *(it->point), m_anchorId++); } m_bStartedParaSdt = bStartedParaSdt; - m_pPostponedCustomShape.reset(0); + m_pPostponedCustomShape.reset(nullptr); } void DocxAttributeOutput::WritePostponedDMLDrawing() @@ -4944,18 +4944,18 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po { const SdrObject* pSdrObj = rFrame.GetFrameFormat().FindRealSdrObject(); const SwNode *pNode = rFrame.GetContent(); - const SwGrfNode *pGrfNode = pNode ? pNode->GetGrfNode() : 0; + const SwGrfNode *pGrfNode = pNode ? pNode->GetGrfNode() : nullptr; if ( pGrfNode ) { if (!m_pPostponedGraphic) { m_bPostponedProcessingFly = false ; - FlyFrameGraphic( pGrfNode, rFrame.GetLayoutSize(), 0, 0, pSdrObj); + FlyFrameGraphic( pGrfNode, rFrame.GetLayoutSize(), nullptr, nullptr, pSdrObj); } else // we are writing out attributes, but w:drawing should not be inside w:rPr, { // so write it out later m_bPostponedProcessingFly = true ; - m_pPostponedGraphic->push_back(PostponedGraphic(pGrfNode, rFrame.GetLayoutSize(), 0, 0, pSdrObj)); + m_pPostponedGraphic->push_back(PostponedGraphic(pGrfNode, rFrame.GetLayoutSize(), nullptr, nullptr, pSdrObj)); } } } @@ -5121,7 +5121,7 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj) StartParagraphProperties(); aAttrIter.OutParaAttr(false); SfxItemSet aParagraphMarkerProperties(m_rExport.m_pDoc->GetAttrPool()); - EndParagraphProperties(aParagraphMarkerProperties, 0, 0, 0); + EndParagraphProperties(aParagraphMarkerProperties, nullptr, nullptr, nullptr); do { const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd); @@ -5297,7 +5297,7 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType, SAL_WARN("sw.ww8", "Unhandled style property: " << rGrabBag[i].Name); } - const char* pType = 0; + const char* pType = nullptr; switch (eType) { case STYLE_TYPE_PARA: pType = "paragraph"; break; @@ -5746,7 +5746,7 @@ void DocxAttributeOutput::SectionType( sal_uInt8 nBreakCode ) /* break code: 0 No break, 1 New column 2 New page, 3 Even page, 4 Odd page */ - const char* pType = NULL; + const char* pType = nullptr; switch ( nBreakCode ) { case 1: pType = "nextColumn"; break; @@ -5822,7 +5822,7 @@ void DocxAttributeOutput::FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding nEnc void DocxAttributeOutput::FontFamilyType( FontFamily eFamily ) const { - const char *pFamily = NULL; + const char *pFamily = nullptr; switch ( eFamily ) { case FAMILY_ROMAN: pFamily = "roman"; break; @@ -5841,7 +5841,7 @@ void DocxAttributeOutput::FontFamilyType( FontFamily eFamily ) const void DocxAttributeOutput::FontPitchType( FontPitch ePitch ) const { - const char *pPitch = NULL; + const char *pPitch = nullptr; switch ( ePitch ) { case PITCH_VARIABLE: pPitch = "variable"; break; @@ -6049,7 +6049,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, FSEND ); // suffix - const char *pSuffix = NULL; + const char *pSuffix = nullptr; switch ( nFollow ) { case 1: pSuffix = "space"; break; @@ -6196,7 +6196,7 @@ void DocxAttributeOutput::CharColor( const SvxColorItem& rColor ) aColorString = msfilter::util::ConvertColor( aColor ); - const char* pExistingValue(NULL); + const char* pExistingValue(nullptr); if (m_pColorAttrList.is() && m_pColorAttrList->getAsChar(FSNS(XML_w, XML_val), pExistingValue)) { assert(aColorString.equalsL(pExistingValue, rtl_str_getLength(pExistingValue))); @@ -6676,7 +6676,7 @@ void DocxAttributeOutput::WritePostitFields() // Check for the text object existing, it seems that it can be NULL when saving a newly created // comment without giving focus back to the main document. As GetText() is empty in that case as well, // that is probably a bug in the Writer core. - if( f->GetTextObject() != NULL ) + if( f->GetTextObject() != nullptr ) GetExport().WriteOutliner( *f->GetTextObject(), TXT_ATN ); m_pSerializer->endElementNS( XML_w, XML_comment ); } @@ -6695,17 +6695,17 @@ bool DocxAttributeOutput::DropdownField( const SwField* pField ) bool DocxAttributeOutput::PlaceholderField( const SwField* pField ) { - assert( pendingPlaceholder == NULL ); + assert( pendingPlaceholder == nullptr ); pendingPlaceholder = pField; return false; // do not expand } void DocxAttributeOutput::WritePendingPlaceholder() { - if( pendingPlaceholder == NULL ) + if( pendingPlaceholder == nullptr ) return; const SwField* pField = pendingPlaceholder; - pendingPlaceholder = NULL; + pendingPlaceholder = nullptr; m_pSerializer->startElementNS( XML_w, XML_sdt, FSEND ); m_pSerializer->startElementNS( XML_w, XML_sdtPr, FSEND ); if( !pField->GetPar2().isEmpty()) @@ -6937,7 +6937,7 @@ void DocxAttributeOutput::WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr const SwEndNoteInfo& info, int listtag ) { fs->startElementNS( XML_w, tag, FSEND ); - const char* fmt = NULL; + const char* fmt = nullptr; switch( info.aFormat.GetNumberingType()) { case SVX_NUM_CHARS_UPPER_LETTER_N: // fall through, map to upper letters @@ -6968,7 +6968,7 @@ void DocxAttributeOutput::WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr default: break; // no format } - if( fmt != NULL ) + if( fmt != nullptr ) fs->singleElementNS( XML_w, XML_numFmt, FSNS( XML_w, XML_val ), fmt, FSEND ); if( info.nFootnoteOffset != 0 ) fs->singleElementNS( XML_w, XML_numStart, FSNS( XML_w, XML_val ), @@ -7021,10 +7021,10 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust ) const SfxItemSet* pItems = GetExport().GetCurItemSet(); const SvxFrameDirectionItem* rFrameDir = pItems? - static_cast< const SvxFrameDirectionItem* >( pItems->GetItem( RES_FRAMEDIR ) ): NULL; + static_cast< const SvxFrameDirectionItem* >( pItems->GetItem( RES_FRAMEDIR ) ): nullptr; short nDir = FRMDIR_ENVIRONMENT; - if( rFrameDir != NULL ) + if( rFrameDir != nullptr ) nDir = rFrameDir->GetValue(); if ( nDir == FRMDIR_ENVIRONMENT ) nDir = GetExport( ).GetDefaultFrameDirection( ); @@ -7269,7 +7269,7 @@ void DocxAttributeOutput::FormatFrameSize( const SwFormatFrmSize& rSize ) attrList->add( FSNS( XML_w, XML_h ), OString::number( rSize.GetHeight( ) ) ); XFastAttributeListRef xAttrList( attrList ); - attrList = NULL; + attrList = nullptr; m_pSerializer->singleElementNS( XML_w, XML_pgSz, xAttrList ); } @@ -8458,7 +8458,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri m_pFootnotesList( new ::docx::FootnotesList() ), m_pEndnotesList( new ::docx::FootnotesList() ), m_footnoteEndnoteRefTag( 0 ), - m_pRedlineData( NULL ), + m_pRedlineData( nullptr ), m_nRedlineId( 0 ), m_bOpenedSectPr( false ), m_bHadSectPr(false), @@ -8468,7 +8468,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri m_sFieldBkm( ), m_nNextBookmarkId( 0 ), m_nNextAnnotationMarkId( 0 ), - m_pCurrentFrame( NULL ), + m_pCurrentFrame( nullptr ), m_bParagraphOpened( false ), m_bParagraphFrameOpen( false ), m_bIsFirstParagraph( true ), @@ -8481,8 +8481,8 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri m_startedHyperlink( false ), m_nHyperLinkCount(0), m_nFieldsInHyperlink( 0 ), - m_postponedChart( NULL ), - pendingPlaceholder( NULL ), + m_postponedChart( nullptr ), + pendingPlaceholder( nullptr ), m_postitFieldsMaxId( 0 ), m_anchorId( 1 ), m_nextFontId( 1 ), diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index fadc5124880c..53042bc62222 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -57,7 +57,7 @@ struct FieldInfos bool bOpen; bool bClose; OUString sCmd; - FieldInfos() : pFieldmark(NULL), eType(ww::eUNKNOWN), bOpen(false), bClose(false){} + FieldInfos() : pFieldmark(nullptr), eType(ww::eUNKNOWN), bOpen(false), bClose(false){} }; enum DocxColBreakStatus @@ -288,7 +288,7 @@ public: /// Write a section break /// msword::ColumnBreak or msword::PageBreak - virtual void SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = NULL ) override; + virtual void SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = nullptr ) override; // preserve DOCX page vertical alignment virtual void TextVerticalAdjustment( const css::drawing::TextVerticalAdjust ) SAL_OVERRIDE; @@ -364,7 +364,7 @@ public: sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, const OUString &rNumberingString, - const SvxBrushItem* pBrush = 0 ) override; + const SvxBrushItem* pBrush = nullptr ) override; void WriteField_Impl( const SwField* pField, ww::eField eType, const OUString& rFieldCmd, sal_uInt8 nMode ); void WriteFormData_Impl( const ::sw::mark::IFieldmark& rFieldmark ); @@ -408,7 +408,7 @@ private: /// replacement graphics, set the first as 0, and pass the remaining three. /// /// @see WriteOLE2Obj() - void FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrameFormat* pOLEFrameFormat = 0, SwOLENode* pOLENode = 0, const SdrObject* pSdrObj = 0); + void FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrameFormat* pOLEFrameFormat = nullptr, SwOLENode* pOLENode = nullptr, const SdrObject* pSdrObj = nullptr); void WriteSrcRect( const SdrObject* pSdrObj ); void WriteOLE2Obj( const SdrObject* pSdrObj, SwOLENode& rNode, const Size& rSize, const SwFlyFrameFormat* pFlyFrameFormat); bool WriteOLEChart( const SdrObject* pSdrObj, const Size& rSize ); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index aa12283ade93..109b36d3f7f3 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -414,7 +414,7 @@ void DocxExport::OutputDML(uno::Reference<drawing::XShape>& xShape) nNamespace = XML_wpg; else if (xServiceInfo->supportsService("com.sun.star.drawing.GraphicObjectShape")) nNamespace = XML_pic; - oox::drawingml::ShapeExport aExport(nNamespace, m_pAttrOutput->GetSerializer(), 0, m_pFilter, oox::drawingml::DrawingML::DOCUMENT_DOCX, m_pAttrOutput); + oox::drawingml::ShapeExport aExport(nNamespace, m_pAttrOutput->GetSerializer(), nullptr, m_pFilter, oox::drawingml::DrawingML::DOCUMENT_DOCX, m_pAttrOutput); aExport.WriteShape(xShape); } @@ -454,8 +454,8 @@ void DocxExport::ExportDocument_Impl() WriteEmbeddings(); m_aLinkedTextboxesHelper.clear(); //final cleanup - delete m_pStyles, m_pStyles = NULL; - delete m_pSections, m_pSections = NULL; + delete m_pStyles, m_pStyles = nullptr; + delete m_pSections, m_pSections = nullptr; } void DocxExport::AppendSection( const SwPageDesc *pPageDesc, const SwSectionFormat* pFormat, sal_uLong nLnNum ) @@ -1344,7 +1344,7 @@ void DocxExport::WriteMainText() // the last section info m_pAttrOutput->EndParaSdtBlock(); - const WW8_SepInfo *pSectionInfo = m_pSections? m_pSections->CurrentSectionInfo(): NULL; + const WW8_SepInfo *pSectionInfo = m_pSections? m_pSections->CurrentSectionInfo(): nullptr; if ( pSectionInfo ) SectionProperties( *pSectionInfo ); @@ -1397,7 +1397,7 @@ void DocxExport::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTy sal_Int32 nAktPos = 0; const sal_Int32 nEnd = aStr.getLength(); do { - AttrOutput().StartRun( NULL ); + AttrOutput().StartRun( nullptr ); const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd); rtl_TextEncoding eNextChrSet = aAttrIter.GetNextCharSet(); @@ -1414,7 +1414,7 @@ void DocxExport::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTy } AttrOutput().StartRunProperties(); aAttrIter.OutAttr( nAktPos ); - AttrOutput().EndRunProperties( NULL ); + AttrOutput().EndRunProperties( nullptr ); nAktPos = nNextAttr; eChrSet = eNextChrSet; @@ -1434,14 +1434,14 @@ void DocxExport::SetFS( ::sax_fastparser::FSHelperPtr pFS ) DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam ) : MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ), m_pFilter( pFilter ), - m_pAttrOutput( NULL ), - m_pSections( NULL ), + m_pAttrOutput( nullptr ), + m_pSections( nullptr ), m_nHeaders( 0 ), m_nFooters( 0 ), m_nOLEObjects( 0 ), m_nHeadersFootersInSection(0), - m_pVMLExport( NULL ), - m_pSdrExport( NULL ) + m_pVMLExport( nullptr ), + m_pSdrExport( nullptr ) { // Write the document properies WriteProperties( ); @@ -1471,10 +1471,10 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur DocxExport::~DocxExport() { - delete m_pSdrExport, m_pSdrExport = NULL; - delete m_pVMLExport, m_pVMLExport = NULL; - delete m_pAttrOutput, m_pAttrOutput = NULL; - delete m_pDrawingML, m_pDrawingML = NULL; + delete m_pSdrExport, m_pSdrExport = nullptr; + delete m_pVMLExport, m_pVMLExport = nullptr; + delete m_pAttrOutput, m_pAttrOutput = nullptr; + delete m_pDrawingML, m_pDrawingML = nullptr; } DocxSettingsData::DocxSettingsData() diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 3643a6569ada..a4315d702c5e 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -200,8 +200,8 @@ protected: /// Get ready for a new section. virtual void PrepareNewPageDesc( const SfxItemSet* pSet, const SwNode& rNd, - const SwFormatPageDesc* pNewPgDescFormat = 0, - const SwPageDesc* pNewPgDesc = 0 ) override; + const SwFormatPageDesc* pNewPgDescFormat = nullptr, + const SwPageDesc* pNewPgDesc = nullptr ) override; private: /// Setup pStyles and write styles.xml diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx index 0076ed07fe43..64a5edd0a9b1 100644 --- a/sw/source/filter/ww8/docxexportfilter.cxx +++ b/sw/source/filter/ww8/docxexportfilter.cxx @@ -53,7 +53,7 @@ bool DocxExportFilter::exportDocument() // update layout (if present), for SwWriteTable SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); - if (pViewShell != NULL) + if (pViewShell != nullptr) pViewShell->CalcLayout(); // get SwPaM* @@ -114,14 +114,14 @@ extern "C" { DocxExport_createInstance, DocxExport_getImplementationName, DocxExport_getSupportedServiceNames, ::cppu::createSingleComponentFactory, - 0, 0 + nullptr, 0 }, { RtfExport_createInstance, RtfExport_getImplementationName, RtfExport_getSupportedServiceNames, ::cppu::createSingleComponentFactory, - 0, 0 + nullptr, 0 }, - { 0, 0, 0, 0, 0, 0 } + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } }; SAL_DLLPUBLIC_EXPORT void* SAL_CALL msword_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey ) diff --git a/sw/source/filter/ww8/docxexportfilter.hxx b/sw/source/filter/ww8/docxexportfilter.hxx index b5ed18d3bbd9..0c4b859b8092 100644 --- a/sw/source/filter/ww8/docxexportfilter.hxx +++ b/sw/source/filter/ww8/docxexportfilter.hxx @@ -35,9 +35,9 @@ public: // FIXME these should not even exist for the export-only filter! // For now, let's just do empty implementations of those. virtual bool importDocument() override { return false; } - virtual const ::oox::drawingml::Theme* getCurrentTheme() const override { return NULL; } - virtual ::oox::vml::Drawing* getVmlDrawing() override { return NULL; } - virtual ::oox::drawingml::chart::ChartConverter* getChartConverter() override { return NULL; } + virtual const ::oox::drawingml::Theme* getCurrentTheme() const override { return nullptr; } + virtual ::oox::vml::Drawing* getVmlDrawing() override { return nullptr; } + virtual ::oox::drawingml::chart::ChartConverter* getChartConverter() override { return nullptr; } virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles() override { return ::oox::drawingml::table::TableStyleListPtr(); } // Actual export of the DOCX document @@ -48,7 +48,7 @@ private: virtual ::oox::ole::VbaProject* implCreateVbaProject() const override { - return NULL; // FIXME: implement me ! + return nullptr; // FIXME: implement me ! } }; diff --git a/sw/source/filter/ww8/docxfootnotes.hxx b/sw/source/filter/ww8/docxfootnotes.hxx index 281d842335a3..87593aa80e13 100644 --- a/sw/source/filter/ww8/docxfootnotes.hxx +++ b/sw/source/filter/ww8/docxfootnotes.hxx @@ -56,7 +56,7 @@ public: if ( m_nCurrent < 0 ) { rId = -1; - return NULL; + return nullptr; } // skip ids 0 and 1 - they are reserved for separator and diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index ba9c83905abf..c4581b103d08 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -154,7 +154,7 @@ struct DocxSdrExport::Impl m_rExport(rExport), m_pSerializer(pSerializer), m_pDrawingML(pDrawingML), - m_pFlyFrameSize(0), + m_pFlyFrameSize(nullptr), m_bTextFrameSyntax(false), m_bDMLTextFrameSyntax(false), m_bFrameBtLr(false), @@ -162,8 +162,8 @@ struct DocxSdrExport::Impl m_bParagraphSdtOpen(false), m_bParagraphHasDrawing(false), m_bFlyFrameGraphic(false), - m_pFlyWrapAttrList(0), - m_pBodyPrAttrList(0), + m_pFlyWrapAttrList(nullptr), + m_pBodyPrAttrList(nullptr), m_bDMLAndVMLDrawingOpen(false), m_aTextBoxes(SwTextBoxHelper::findTextBoxes(m_rExport.m_pDoc)), m_nDMLandVMLTextFrameRotation(0) @@ -356,7 +356,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons bool bOpaque = pFrameFormat->GetOpaque().GetValue(); awt::Point aPos(pFrameFormat->GetHoriOrient().GetPos(), pFrameFormat->GetVertOrient().GetPos()); const SdrObject* pObj = pFrameFormat->FindRealSdrObject(); - if (pObj != NULL) + if (pObj != nullptr) { // SdrObjects know their layer, consider that instead of the frame format. bOpaque = pObj->GetLayer() != pFrameFormat->GetDoc()->getIDocumentDrawModelAccess().GetHellId() && pObj->GetLayer() != pFrameFormat->GetDoc()->getIDocumentDrawModelAccess().GetInvisibleHellId(); @@ -372,13 +372,13 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons attrList->add(XML_locked, "0"); attrList->add(XML_layoutInCell, "1"); attrList->add(XML_allowOverlap, "1"); // TODO - if (pObj != NULL) + if (pObj != nullptr) // It seems 0 and 1 have special meaning: just start counting from 2 to avoid issues with that. attrList->add(XML_relativeHeight, OString::number(pObj->GetOrdNum() + 2)); else // relativeHeight is mandatory attribute, if value is not present, we must write default value attrList->add(XML_relativeHeight, "0"); - if (pObj != NULL) + if (pObj != nullptr) { OUString sAnchorId = lclGetAnchorIdFromGrabBag(pObj); if (!sAnchorId.isEmpty()) @@ -389,8 +389,8 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons m_pImpl->m_pSerializer->singleElementNS(XML_wp, XML_simplePos, XML_x, "0", XML_y, "0", FSEND); // required, unused const char* relativeFromH; const char* relativeFromV; - const char* alignH = NULL; - const char* alignV = NULL; + const char* alignH = nullptr; + const char* alignV = nullptr; switch (pFrameFormat->GetVertOrient().GetRelationOrient()) { case text::RelOrientation::PAGE_PRINT_AREA: @@ -481,7 +481,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons **/ const sal_Int64 MAX_INTEGER_VALUE = SAL_MAX_INT32; const sal_Int64 MIN_INTEGER_VALUE = SAL_MIN_INT32; - if (alignH != NULL) + if (alignH != nullptr) { m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_align, FSEND); m_pImpl->m_pSerializer->write(alignH); @@ -527,11 +527,11 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons (strcmp(relativeFromV, "line") == 0 || strcmp(relativeFromV, "paragraph") == 0) && (!alignV || strcmp(alignV, "top") == 0)) { - alignV = NULL; + alignV = nullptr; nTwipstoEMU = 635; } - if (alignV != NULL) + if (alignV != nullptr) { m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_align, FSEND); m_pImpl->m_pSerializer->write(alignV); @@ -561,7 +561,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons aAttrList->add(XML_distL, OString::number(TwipsToEMU(pLRSpaceItem.GetLeft())).getStr()); aAttrList->add(XML_distR, OString::number(TwipsToEMU(pLRSpaceItem.GetRight())).getStr()); const SdrObject* pObj = pFrameFormat->FindRealSdrObject(); - if (pObj != NULL) + if (pObj != nullptr) { OUString sAnchorId = lclGetAnchorIdFromGrabBag(pObj); if (!sAnchorId.isEmpty()) @@ -780,7 +780,7 @@ void DocxSdrExport::writeVMLDrawing(const SdrObject* sdrObj, const SwFrameFormat m_pImpl->m_pSerializer->endElementNS(XML_w, XML_pict); if (bSwapInPage) - const_cast< SdrObject* >(sdrObj)->SetPage(0); + const_cast< SdrObject* >(sdrObj)->SetPage(nullptr); } bool lcl_isLockedCanvas(uno::Reference<drawing::XShape> xShape) @@ -1314,7 +1314,7 @@ void DocxSdrExport::writeOnlyTextOfFrame(sw::Frame* pParentFrame) void DocxSdrExport::writeBoxItemLine(const SvxBoxItem& rBox) { - const editeng::SvxBorderLine* pBorderLine = 0; + const editeng::SvxBorderLine* pBorderLine = nullptr; if (rBox.GetTop()) { @@ -1529,7 +1529,7 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId, bo m_pImpl->m_rExport.m_bLinkedTextboxesHelperInitialized = true; } - m_pImpl->m_rExport.m_pParentFrame = NULL; + m_pImpl->m_rExport.m_pParentFrame = nullptr; bool skipTxBxContent = false ; bool isTxbxLinked = false ; @@ -1593,7 +1593,7 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId, bo pFS->endElementNS(XML_wps, XML_txbx); } sax_fastparser::XFastAttributeListRef xBodyPrAttrList(m_pImpl->m_pBodyPrAttrList); - m_pImpl->m_pBodyPrAttrList = NULL; + m_pImpl->m_pBodyPrAttrList = nullptr; if (!bTextBoxOnly) { pFS->startElementNS(XML_wps, XML_bodyPr, xBodyPrAttrList); @@ -1668,7 +1668,7 @@ void DocxSdrExport::writeVMLTextFrame(sw::Frame* pParentFrame, bool bTextBoxOnly m_pImpl->m_pFlyAttrList->add(XML_style, m_pImpl->m_aTextFrameStyle.makeStringAndClear()); const SdrObject* pObject = pParentFrame->GetFrameFormat().FindRealSdrObject(); - if (pObject != NULL) + if (pObject != nullptr) { OUString sAnchorId = lclGetAnchorIdFromGrabBag(pObject); if (!sAnchorId.isEmpty()) @@ -1680,8 +1680,8 @@ void DocxSdrExport::writeVMLTextFrame(sw::Frame* pParentFrame, bool bTextBoxOnly sax_fastparser::XFastAttributeListRef xTextboxAttrList(m_pImpl->m_pTextboxAttrList.get()); m_pImpl->m_pTextboxAttrList.clear(); m_pImpl->m_bTextFrameSyntax = false; - m_pImpl->m_pFlyFrameSize = 0; - m_pImpl->m_rExport.m_pParentFrame = NULL; + m_pImpl->m_pFlyFrameSize = nullptr; + m_pImpl->m_rExport.m_pParentFrame = nullptr; if (!bTextBoxOnly) { @@ -1719,7 +1719,7 @@ void DocxSdrExport::writeVMLTextFrame(sw::Frame* pParentFrame, bool bTextBoxOnly if (m_pImpl->m_pFlyWrapAttrList) { sax_fastparser::XFastAttributeListRef xFlyWrapAttrList(m_pImpl->m_pFlyWrapAttrList); - m_pImpl->m_pFlyWrapAttrList = NULL; + m_pImpl->m_pFlyWrapAttrList = nullptr; pFS->singleElementNS(XML_w10, XML_wrap, xFlyWrapAttrList); } @@ -1744,7 +1744,7 @@ bool DocxSdrExport::Impl::checkFrameBtlr(SwNode* pStartNode, bool bDML) SwTextNode* pTextNode = pStartNode->GetTextNode(); - const SfxPoolItem* pItem = 0; // explicitly init to avoid warnings + const SfxPoolItem* pItem = nullptr; // explicitly init to avoid warnings bool bItemSet = false; if (pTextNode->HasSwAttrSet()) { diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx index 1142f3551b51..3d6d075685c3 100644 --- a/sw/source/filter/ww8/docxtablestyleexport.cxx +++ b/sw/source/filter/ww8/docxtablestyleexport.cxx @@ -92,7 +92,7 @@ void DocxTableStyleExport::CnfStyle(uno::Sequence<beans::PropertyValue>& rAttrib {"firstRowLastColumn", XML_firstRowLastColumn}, {"lastRowFirstColumn", XML_lastRowFirstColumn}, {"lastRowLastColumn", XML_lastRowLastColumn}, - {0, 0} + {nullptr, 0} }; if (sal_Int32 nToken = DocxStringGetToken(aTokens, rAttributeList[j].Name)) @@ -143,7 +143,7 @@ void DocxTableStyleExport::Impl::tableStyleTableCellMar(uno::Sequence<beans::Pro {"end", XML_end}, {"top", XML_top}, {"bottom", XML_bottom}, - {0, 0} + {nullptr, 0} }; if (!rTableCellMar.hasElements()) @@ -174,7 +174,7 @@ void DocxTableStyleExport::Impl::tableStyleTcBorder(sal_Int32 nToken, const uno: {"space", XML_space}, {"themeColor", XML_themeColor}, {"themeTint", XML_themeTint}, - {0, 0} + {nullptr, 0} }; if (!rTcBorder.hasElements()) @@ -203,7 +203,7 @@ void DocxTableStyleExport::Impl::tableStyleTcBorders(uno::Sequence<beans::Proper {"insideV", XML_insideV}, {"tl2br", XML_tl2br}, {"tr2bl", XML_tr2bl}, - {0, 0} + {nullptr, 0} }; if (!rTcBorders.hasElements()) diff --git a/sw/source/filter/ww8/fields.cxx b/sw/source/filter/ww8/fields.cxx index e0d9764377cb..d95ccf12de4b 100644 --- a/sw/source/filter/ww8/fields.cxx +++ b/sw/source/filter/ww8/fields.cxx @@ -29,9 +29,9 @@ namespace ww // #i43956# - field <eFOOTREF> = 5 should be mapped to "REF" static const char *aFieldNames[] = { - /* 0*/ 0, - /* 1*/ 0, - /* 2*/ 0, + /* 0*/ nullptr, + /* 1*/ nullptr, + /* 2*/ nullptr, /* 3*/ "REF", /* 4*/ "XE", /* 5*/ "REF", @@ -65,18 +65,18 @@ namespace ww /*33*/ "PAGE", /*34*/ "=", /*35*/ "QUOTE", - /*36*/ 0, + /*36*/ nullptr, /*37*/ "PAGEREF", /*38*/ "ASK", /*39*/ "FILLIN", - /*40*/ 0, + /*40*/ nullptr, /*41*/ "NEXT", /*42*/ "NEXTIF", /*43*/ "SKIPIF", /*44*/ "MERGEREC", - /*45*/ 0, - /*46*/ 0, - /*47*/ 0, + /*45*/ nullptr, + /*46*/ nullptr, + /*47*/ nullptr, /*48*/ "PRINT", /*49*/ "EQ", /*50*/ "GOTOBUTTON", @@ -84,7 +84,7 @@ namespace ww /*52*/ "AUTONUMOUT", /*53*/ "AUTONUMLGL", /*54*/ "AUTONUM", - /*55*/ 0, + /*55*/ nullptr, /*56*/ "LINK", /*57*/ "SYMBOL", /*58*/ "EMBED", @@ -105,22 +105,22 @@ namespace ww /*73*/ "TOA", /*74*/ "TA", /*75*/ "MERGESEQ", - /*76*/ 0, + /*76*/ nullptr, /*77*/ "PRIVATE", /*78*/ "DATABASE", /*79*/ "AUTOTEXT", /*80*/ "COMPARE", - /*81*/ 0, - /*82*/ 0, + /*81*/ nullptr, + /*82*/ nullptr, /*83*/ "FORMDROPDOWN", /*84*/ "ADVANCE", /*85*/ "DOCPROPERTY", - /*86*/ 0, + /*86*/ nullptr, /*87*/ "CONTROL", /*88*/ "HYPERLINK", /*89*/ "AUTOTEXTLIST", /*90*/ "LISTNUM", - /*91*/ 0, + /*91*/ nullptr, /*92*/ "BIDIOUTLINE", /*93*/ "ADDRESSBLOCK", /*94*/ "GREETINGLINE", diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 434ec181c9db..52cdf24cccc8 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -476,7 +476,7 @@ void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/, nRubyScript = i18n::ScriptType::ASIAN; const SwTextRuby* pRubyText = rRuby.GetTextRuby(); - const SwCharFormat* pFormat = pRubyText ? pRubyText->GetCharFormat() : 0; + const SwCharFormat* pFormat = pRubyText ? pRubyText->GetCharFormat() : nullptr; OUString sFamilyName; long nHeight; if (pFormat) @@ -531,16 +531,16 @@ void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/, aStr += OUString::number(nHeight); aStr += "("; EndRun(); - m_rExport.OutputField(0, ww::eEQ, aStr, WRITEFIELD_START | WRITEFIELD_CMD_START); + m_rExport.OutputField(nullptr, ww::eEQ, aStr, WRITEFIELD_START | WRITEFIELD_CMD_START); aStr = rRuby.GetText(); aStr += ")"; aStr += ","; - m_rExport.OutputField(0, ww::eEQ, aStr, 0); + m_rExport.OutputField(nullptr, ww::eEQ, aStr, 0); } void RtfAttributeOutput::EndRuby() { - m_rExport.OutputField(0, ww::eEQ, ")", WRITEFIELD_END | WRITEFIELD_CLOSE); + m_rExport.OutputField(nullptr, ww::eEQ, ")", WRITEFIELD_END | WRITEFIELD_CLOSE); EndRun(); } @@ -981,7 +981,7 @@ void RtfAttributeOutput::InitTableHelper(ww8::WW8TableNodeInfoInner::Pointer_t p void RtfAttributeOutput::StartTable(ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/) { // To trigger calling InitTableHelper() - m_pTableWrt.reset(0); + m_pTableWrt.reset(nullptr); } void RtfAttributeOutput::StartTableRow(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) @@ -1075,7 +1075,7 @@ void RtfAttributeOutput::EndTable() if (m_nTableDepth > 0) { m_nTableDepth--; - m_pTableWrt.reset(0); + m_pTableWrt.reset(nullptr); } // We closed the table; if it is a nested table, the cell that contains it @@ -1083,7 +1083,7 @@ void RtfAttributeOutput::EndTable() m_bTableCellOpen = true; // Cleans the table helper - m_pTableWrt.reset(0); + m_pTableWrt.reset(nullptr); } void RtfAttributeOutput::FinishTableRowCell(ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool /*bForceEmptyParagraph*/) @@ -1293,7 +1293,7 @@ void RtfAttributeOutput::SectionPageNumbering(sal_uInt16 nNumType, const ::boost m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGNRESTART); } - const char* pStr = 0; + const char* pStr = nullptr; switch (nNumType) { case SVX_NUM_CHARS_UPPER_LETTER: @@ -1327,7 +1327,7 @@ void RtfAttributeOutput::SectionType(sal_uInt8 nBreakCode) * break code: 0 No break, 1 New column * 2 New page, 3 Even page, 4 Odd page */ - const char* sType = NULL; + const char* sType = nullptr; switch (nBreakCode) { case 1: @@ -1828,7 +1828,7 @@ void RtfAttributeOutput::writeTextFrame(const sw::Frame& rFrame, bool bTextBox) m_nTableDepth = nTableDepth; } - m_rExport.m_pParentFrame = NULL; + m_rExport.m_pParentFrame = nullptr; m_rExport.Strm().WriteChar('}'); // shptxt @@ -1843,7 +1843,7 @@ void RtfAttributeOutput::writeTextFrame(const sw::Frame& rFrame, bool bTextBox) void RtfAttributeOutput::OutputFlyFrame_Impl(const sw::Frame& rFrame, const Point& /*rNdTopLeft*/) { const SwNode* pNode = rFrame.GetContent(); - const SwGrfNode* pGrfNode = pNode ? pNode->GetGrfNode() : 0; + const SwGrfNode* pGrfNode = pNode ? pNode->GetGrfNode() : nullptr; switch (rFrame.GetWriterType()) { @@ -1872,7 +1872,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const sw::Frame& rFrame, const Poin m_rExport.Strm().WriteCharPtr(m_aRunText.makeStringAndClear().getStr()); m_rExport.Strm().WriteCharPtr(m_aStyles.makeStringAndClear().getStr()); m_rExport.m_bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = false; - m_pFlyFrameSize = 0; + m_pFlyFrameSize = nullptr; const SwFrameFormat& rFrameFormat = rFrame.GetFrameFormat(); lcl_TextFrameShadow(m_aFlyProperties, rFrameFormat); @@ -1907,7 +1907,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const sw::Frame& rFrame, const Poin m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE); m_rExport.OutputFormat(rFrame.GetFrameFormat(), false, false, true); m_aRunText->append('}'); - m_rExport.m_pParentFrame = NULL; + m_rExport.m_pParentFrame = nullptr; } if (pGrfNode) @@ -1943,7 +1943,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const sw::Frame& rFrame, const Poin m_aRunText->append('}'); if (bSwapInPage) - const_cast< SdrObject* >(pSdrObj)->SetPage(0); + const_cast< SdrObject* >(pSdrObj)->SetPage(nullptr); } } break; @@ -2354,7 +2354,7 @@ void RtfAttributeOutput::CharShadow(const SvxShadowedItem& rShadow) void RtfAttributeOutput::CharUnderline(const SvxUnderlineItem& rUnderline) { - const char* pStr = 0; + const char* pStr = nullptr; const SfxPoolItem* pItem = m_rExport.HasItem(RES_CHRATR_WORDLINEMODE); bool bWord = false; if (pItem) @@ -2594,7 +2594,7 @@ void RtfAttributeOutput::CharRelief(const SvxCharReliefItem& rRelief) pStr = OOO_STRING_SVTOOLS_RTF_IMPR; break; default: - pStr = 0; + pStr = nullptr; break; } @@ -2630,7 +2630,7 @@ void RtfAttributeOutput::TextINetFormat(const SwFormatINetFormat& rURL) const SwCharFormat* pFormat; const SwTextINetFormat* pTextAtr = rURL.GetTextINetFormat(); - if (pTextAtr && 0 != (pFormat = pTextAtr->GetCharFormat())) + if (pTextAtr && nullptr != (pFormat = pTextAtr->GetCharFormat())) { sal_uInt16 nStyle = m_rExport.GetId(pFormat); OString* pString = m_rExport.GetStyle(nStyle); @@ -2751,7 +2751,7 @@ void RtfAttributeOutput::ParaTabStop(const SvxTabStopItem& rTabStop) const SvxTabStop& rTS = rTabStop[ n ]; if (SVX_TAB_ADJUST_DEFAULT != rTS.GetAdjustment()) { - const char* pFill = 0; + const char* pFill = nullptr; switch (rTS.GetFill()) { case cDfltFillChar: @@ -2775,7 +2775,7 @@ void RtfAttributeOutput::ParaTabStop(const SvxTabStopItem& rTabStop) if (pFill) m_aStyles.append(pFill); - const sal_Char* pAdjStr = 0; + const sal_Char* pAdjStr = nullptr; switch (rTS.GetAdjustment()) { case SVX_TAB_ADJUST_RIGHT: @@ -2811,7 +2811,7 @@ void RtfAttributeOutput::ParaHyphenZone(const SvxHyphenZoneItem& rHyphenZone) void RtfAttributeOutput::ParaNumRule_Impl(const SwTextNode* pTextNd, sal_Int32 nLvl, sal_Int32 nNumId) { - if (USHRT_MAX == nNumId || 0 == nNumId || 0 == pTextNd) + if (USHRT_MAX == nNumId || 0 == nNumId || nullptr == pTextNd) return; const SwNumRule* pRule = pTextNd->GetNumRule(); @@ -3500,8 +3500,8 @@ RtfAttributeOutput::RtfAttributeOutput(RtfExport& rExport) m_aCells(), m_bSingleEmptyRun(false), m_bInRun(false), - m_pFlyFrameSize(0), - m_pPrevPageDesc(0) + m_pFlyFrameSize(nullptr), + m_pPrevPageDesc(nullptr) { } @@ -3677,7 +3677,7 @@ static void lcl_AppendSP(OStringBuffer& rBuffer, static OString ExportPICT(const SwFlyFrameFormat* pFlyFrameFormat, const Size& rOrig, const Size& rRendered, const Size& rMapped, const SwCropGrf& rCr, const char* pBLIPType, const sal_uInt8* pGraphicAry, - unsigned long nSize, const RtfExport& rExport, SvStream* pStream = 0, bool bWritePicProp = true) + unsigned long nSize, const RtfExport& rExport, SvStream* pStream = nullptr, bool bWritePicProp = true) { OStringBuffer aRet; if (pBLIPType && nSize && pGraphicAry) @@ -3764,7 +3764,7 @@ void RtfAttributeOutput::FlyFrameOLEReplacement(const SwFlyFrameFormat* pFlyFram Size aMapped(pGraphic->GetPrefSize()); const SwCropGrf& rCr = static_cast<const SwCropGrf&>(rOLENode.GetAttr(RES_GRFATR_CROPGRF)); const sal_Char* pBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP; - const sal_uInt8* pGraphicAry = 0; + const sal_uInt8* pGraphicAry = nullptr; SvMemoryStream aStream; if (GraphicConverter::Export(aStream, *pGraphic, ConvertDataFormat::PNG) != ERRCODE_NONE) SAL_WARN("sw.rtf", "failed to export the graphic"); @@ -3803,7 +3803,7 @@ bool RtfAttributeOutput::FlyFrameOLEMath(const SwFlyFrameFormat* pFlyFrameFormat // 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::FormulaExportBase* pBase = dynamic_cast<oox::FormulaExportBase*>(dynamic_cast<SfxBaseModel*>(xClosable.get())); - assert(pBase != NULL); + assert(pBase != nullptr); OStringBuffer aBuf; if (pBase) pBase->writeFormulaRtf(aBuf, m_rExport.eCurrentEncoding); @@ -3828,7 +3828,7 @@ void RtfAttributeOutput::FlyFrameOLE(const SwFlyFrameFormat* pFlyFrameFormat, Sw void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat, const SwGrfNode* pGrfNode) { SvMemoryStream aStream; - const sal_uInt8* pGraphicAry = 0; + const sal_uInt8* pGraphicAry = nullptr; sal_uInt32 nSize = 0; const Graphic& rGraphic(pGrfNode->GetGrf()); @@ -3841,7 +3841,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat const sal_Char* pConvertDestinationBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; GfxLink aGraphicLink; - const sal_Char* pBLIPType = 0; + const sal_Char* pBLIPType = nullptr; if (rGraphic.IsLink()) { aGraphicLink = rGraphic.GetLink(); @@ -3859,7 +3859,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat // compatible, keep it that way by assigning NULL value to pGraphicAry case GFX_LINK_TYPE_NATIVE_BMP: // pBLIPType = OOO_STRING_SVTOOLS_RTF_WBITMAP; - pGraphicAry = 0; + pGraphicAry = nullptr; break; case GFX_LINK_TYPE_NATIVE_JPG: @@ -3908,7 +3908,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat aRendered.Width() = rS.GetWidth(); aRendered.Height() = rS.GetHeight(); - sw::Frame* pFrame = 0; + sw::Frame* pFrame = nullptr; for (sw::FrameIter it = m_rExport.m_aFrames.begin(); it != m_rExport.m_aFrames.end(); ++it) { if (pFlyFrameFormat == &it->GetFrameFormat()) @@ -3938,8 +3938,8 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat m_rExport.m_bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = true; m_rExport.OutputFormat(pFrame->GetFrameFormat(), false, false, true); m_rExport.m_bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = false; - m_rExport.m_pParentFrame = NULL; - m_pFlyFrameSize = 0; + m_rExport.m_pParentFrame = nullptr; + m_pFlyFrameSize = nullptr; std::vector< std::pair<OString, OString> > aFlyProperties; aFlyProperties.push_back(std::make_pair<OString, OString>("shapeType", OString::number(ESCHER_ShpInst_PictureFrame))); @@ -4031,7 +4031,7 @@ void RtfAttributeOutput::BulletDefinition(int /*nId*/, const Graphic& rGraphic, m_rExport.OutULong(aSize.Height()); m_rExport.Strm().WriteCharPtr(SAL_NEWLINE_STRING); - const sal_uInt8* pGraphicAry = 0; + const sal_uInt8* pGraphicAry = nullptr; SvMemoryStream aStream; if (GraphicConverter::Export(aStream, rGraphic, ConvertDataFormat::PNG) != ERRCODE_NONE) SAL_WARN("sw.rtf", "failed to export the numbering picture bullet"); diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 7f249d544db2..403c79798476 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -158,7 +158,7 @@ public: /// Write a section break /// msword::ColumnBreak or msword::PageBreak - virtual void SectionBreak(sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = NULL) override; + virtual void SectionBreak(sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = nullptr) override; /// Start of the section properties. virtual void StartSection() override; @@ -210,7 +210,7 @@ public: sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, const OUString& rNumberingString, - const SvxBrushItem* pBrush = 0) override;//For i120928,to export graphic of bullet + const SvxBrushItem* pBrush = nullptr) override;//For i120928,to export graphic of bullet void WriteField_Impl(const SwField* pField, ww::eField eType, const OUString& rFieldCmd, sal_uInt8 nMode); void WriteBookmarks_Impl(std::vector< OUString >& rStarts, std::vector< OUString >& rEnds); @@ -631,7 +631,7 @@ public: void FontPitchType(FontPitch ePitch) const; /// Writes binary data as a hex dump. - static OString WriteHex(const sal_uInt8* pData, sal_uInt32 nSize, SvStream* pStream = 0, sal_uInt32 nLimit = 64); + static OString WriteHex(const sal_uInt8* pData, sal_uInt32 nSize, SvStream* pStream = nullptr, sal_uInt32 nLimit = 64); void BulletDefinition(int nId, const Graphic& rGraphic, Size aSize) override; diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 607521cd4e9d..df670a7f0982 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -177,7 +177,7 @@ void RtfExport::WriteChar(sal_Unicode) /* WriteChar() has nothing to do for rtf. */ } -static bool IsExportNumRule(const SwNumRule& rRule, sal_uInt8* pEnd = 0) +static bool IsExportNumRule(const SwNumRule& rRule, sal_uInt8* pEnd = nullptr) { sal_uInt8 nEnd = MAXLEVEL; while (nEnd-- && !rRule.GetNumFormat(nEnd)) @@ -388,7 +388,7 @@ void RtfExport::WriteMainText() SwTableNode* pTableNode = m_pCurPam->GetNode().FindTableNode(); if (m_pWriter && m_pWriter->bWriteOnlyFirstTable - && pTableNode != 0) + && pTableNode != nullptr) { m_pCurPam->GetPoint()->nNode = *pTableNode; m_pCurPam->GetMark()->nNode = *(pTableNode->EndOfSectionNode()); @@ -556,11 +556,11 @@ void RtfExport::ExportDocument_Impl() if (m_pDoc->GetPageDescCnt()) { // Seeking the first SwFormatPageDesc. If no set, the default is valid - const SwFormatPageDesc* pSttPgDsc = 0; + const SwFormatPageDesc* pSttPgDsc = nullptr; { const SwNode& rSttNd = *m_pDoc->GetNodes()[ m_pDoc->GetNodes().GetEndOfExtras().GetIndex() + 2 ]; - const SfxItemSet* pSet = 0; + const SfxItemSet* pSet = nullptr; if (rSttNd.IsContentNode()) pSet = &rSttNd.GetContentNode()->GetSwAttrSet(); @@ -577,7 +577,7 @@ void RtfExport::ExportDocument_Impl() size_t nPosInDoc; pSttPgDsc = static_cast<const SwFormatPageDesc*>(&pSet->Get(RES_PAGEDESC)); if (!pSttPgDsc->GetPageDesc()) - pSttPgDsc = 0; + pSttPgDsc = nullptr; else if (m_pDoc->FindPageDesc(pSttPgDsc->GetPageDesc()->GetName(), &nPosInDoc)) { Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_IGNORE).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PGDSCNO); @@ -812,7 +812,7 @@ RtfExport::RtfExport(RtfExportFilter* pFilter, SwDoc* pDocument, SwPaM* pCurrent m_pFilter(pFilter), m_pWriter(pWriter), m_pAttrOutput(), - m_pSections(NULL), + m_pSections(nullptr), m_pSdrExport(), m_bOutOutlineOnly(bOutOutlineOnly), eDefaultEncoding(rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING))), @@ -940,7 +940,7 @@ void RtfExport::InsColor(const Color& rCol) void RtfExport::InsColorLine(const SvxBoxItem& rBox) { - const editeng::SvxBorderLine* pLine = 0; + const editeng::SvxBorderLine* pLine = nullptr; if (rBox.GetTop()) InsColor((pLine = rBox.GetTop())->GetColor()); @@ -981,12 +981,12 @@ void RtfExport::OutColorTable() { const SvxColorItem* pCol = static_cast<const SvxColorItem*>(GetDfltAttr(RES_CHRATR_COLOR)); InsColor(pCol->GetValue()); - if (0 != (pCol = static_cast<const SvxColorItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_COLOR)))) + if (nullptr != (pCol = static_cast<const SvxColorItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_COLOR)))) InsColor(pCol->GetValue()); nMaxItem = rPool.GetItemCount2(RES_CHRATR_COLOR); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (0 != (pCol = static_cast<const SvxColorItem*>(rPool.GetItem2(RES_CHRATR_COLOR, n)))) + if (nullptr != (pCol = static_cast<const SvxColorItem*>(rPool.GetItem2(RES_CHRATR_COLOR, n)))) InsColor(pCol->GetValue()); } @@ -995,7 +995,7 @@ void RtfExport::OutColorTable() nMaxItem = rPool.GetItemCount2(RES_CHRATR_UNDERLINE); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (0 != (pUnder = static_cast<const SvxUnderlineItem*>(rPool.GetItem2(RES_CHRATR_UNDERLINE, n)))) + if (nullptr != (pUnder = static_cast<const SvxUnderlineItem*>(rPool.GetItem2(RES_CHRATR_UNDERLINE, n)))) InsColor(pUnder->GetColor()); } @@ -1005,7 +1005,7 @@ void RtfExport::OutColorTable() nMaxItem = rPool.GetItemCount2(RES_CHRATR_OVERLINE); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (0 != (pOver = static_cast<const SvxOverlineItem*>(rPool.GetItem2(RES_CHRATR_OVERLINE, n)))) + if (nullptr != (pOver = static_cast<const SvxOverlineItem*>(rPool.GetItem2(RES_CHRATR_OVERLINE, n)))) InsColor(pOver->GetColor()); } @@ -1022,14 +1022,14 @@ void RtfExport::OutColorTable() { const SvxBrushItem* pBkgrd = static_cast<const SvxBrushItem*>(GetDfltAttr(*pIds)); InsColor(pBkgrd->GetColor()); - if (0 != (pBkgrd = static_cast<const SvxBrushItem*>(rPool.GetPoolDefaultItem(*pIds)))) + if (nullptr != (pBkgrd = static_cast<const SvxBrushItem*>(rPool.GetPoolDefaultItem(*pIds)))) { InsColor(pBkgrd->GetColor()); } nMaxItem = rPool.GetItemCount2(*pIds); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (0 != (pBkgrd = static_cast<const SvxBrushItem*>(rPool.GetItem2(*pIds , n)))) + if (nullptr != (pBkgrd = static_cast<const SvxBrushItem*>(rPool.GetItem2(*pIds , n)))) { InsColor(pBkgrd->GetColor()); } @@ -1040,14 +1040,14 @@ void RtfExport::OutColorTable() { const SvxShadowItem* pShadow = static_cast<const SvxShadowItem*>(GetDfltAttr(RES_SHADOW)); InsColor(pShadow->GetColor()); - if (0 != (pShadow = static_cast<const SvxShadowItem*>(rPool.GetPoolDefaultItem(RES_SHADOW)))) + if (nullptr != (pShadow = static_cast<const SvxShadowItem*>(rPool.GetPoolDefaultItem(RES_SHADOW)))) { InsColor(pShadow->GetColor()); } nMaxItem = rPool.GetItemCount2(RES_SHADOW); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (0 != (pShadow = static_cast<const SvxShadowItem*>(rPool.GetItem2(RES_SHADOW, n)))) + if (nullptr != (pShadow = static_cast<const SvxShadowItem*>(rPool.GetItem2(RES_SHADOW, n)))) { InsColor(pShadow->GetColor()); } @@ -1057,24 +1057,24 @@ void RtfExport::OutColorTable() // frame border color { const SvxBoxItem* pBox; - if (0 != (pBox = static_cast<const SvxBoxItem*>(rPool.GetPoolDefaultItem(RES_BOX)))) + if (nullptr != (pBox = static_cast<const SvxBoxItem*>(rPool.GetPoolDefaultItem(RES_BOX)))) InsColorLine(*pBox); nMaxItem = rPool.GetItemCount2(RES_BOX); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (0 != (pBox = static_cast<const SvxBoxItem*>(rPool.GetItem2(RES_BOX, n)))) + if (nullptr != (pBox = static_cast<const SvxBoxItem*>(rPool.GetItem2(RES_BOX, n)))) InsColorLine(*pBox); } } { const SvxBoxItem* pCharBox; - if (0 != (pCharBox = static_cast<const SvxBoxItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_BOX)))) + if (nullptr != (pCharBox = static_cast<const SvxBoxItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_BOX)))) InsColorLine(*pCharBox); nMaxItem = rPool.GetItemCount2(RES_CHRATR_BOX); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (0 != (pCharBox = static_cast<const SvxBoxItem*>(rPool.GetItem2(RES_CHRATR_BOX, n)))) + if (nullptr != (pCharBox = static_cast<const SvxBoxItem*>(rPool.GetItem2(RES_CHRATR_BOX, n)))) InsColorLine(*pCharBox); } } @@ -1111,7 +1111,7 @@ OString* RtfExport::GetStyle(sal_uInt16 nId) std::map<sal_uInt16,OString>::iterator i = m_aStyTable.find(nId); if (i != m_aStyTable.end()) return &i->second; - return NULL; + return nullptr; } sal_uInt16 RtfExport::GetRedline(const OUString& rAuthor) @@ -1130,7 +1130,7 @@ const OUString* RtfExport::GetRedline(sal_uInt16 nId) for (std::map<OUString,sal_uInt16>::iterator aIter = m_aRedlineTable.begin(); aIter != m_aRedlineTable.end(); ++aIter) if ((*aIter).second == nId) return &(*aIter).first; - return NULL; + return nullptr; } void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bWriteReset, bool bCheckForFirstPage) @@ -1253,7 +1253,7 @@ SwRTFWriter::~SwRTFWriter() sal_uLong SwRTFWriter::WriteStream() { SwPaM aPam(*pCurPam->End(), *pCurPam->Start()); - RtfExport aExport(NULL, pDoc, &aPam, pCurPam, this, m_bOutOutlineOnly); + RtfExport aExport(nullptr, pDoc, &aPam, pCurPam, this, m_bOutOutlineOnly); aExport.ExportDocument(true); return 0; } diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index c4c3f869d2b5..cdf7b8e825ec 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -133,8 +133,8 @@ protected: /// Get ready for a new section. virtual void PrepareNewPageDesc(const SfxItemSet* pSet, const SwNode& rNd, - const SwFormatPageDesc* pNewPgDescFormat = 0, - const SwPageDesc* pNewPgDesc = 0) override; + const SwFormatPageDesc* pNewPgDescFormat = nullptr, + const SwPageDesc* pNewPgDesc = nullptr) override; /// Return value indicates if an inherited outline numbering is suppressed. virtual bool DisallowInheritingOutlineNumbering(const SwFormat& rFormat) override; diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx b/sw/source/filter/ww8/rtfexportfilter.cxx index b7ea8f22f38e..70a514318c0e 100644 --- a/sw/source/filter/ww8/rtfexportfilter.cxx +++ b/sw/source/filter/ww8/rtfexportfilter.cxx @@ -62,7 +62,7 @@ sal_Bool RtfExportFilter::filter(const uno::Sequence< beans::PropertyValue >& aD // fdo#37161 - update layout (if present), for SwWriteTable SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); - if (pViewShell != NULL) + if (pViewShell != nullptr) pViewShell->CalcLayout(); // get SwPaM* @@ -76,7 +76,7 @@ sal_Bool RtfExportFilter::filter(const uno::Sequence< beans::PropertyValue >& aD // export the document // (in a separate block so that it's destructed before the commit) { - RtfExport aExport(this, pDoc, pCurPam, &aPam, NULL); + RtfExport aExport(this, pDoc, pCurPam, &aPam, nullptr); aExport.ExportDocument(true); } diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index 5a28807fd79e..364d1a685336 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -32,10 +32,10 @@ using namespace css; RtfSdrExport::RtfSdrExport(RtfExport& rExport) - : EscherEx(EscherExGlobalRef(new EscherExGlobal), 0), + : EscherEx(EscherExGlobalRef(new EscherExGlobal), nullptr), m_rExport(rExport), m_rAttrOutput(static_cast<RtfAttributeOutput&>(m_rExport.AttrOutput())), - m_pSdrObject(NULL), + m_pSdrObject(nullptr), m_nShapeType(ESCHER_ShpInst_Nil), m_nShapeFlags(0) , m_aShapeStyle(200), @@ -48,8 +48,8 @@ RtfSdrExport::RtfSdrExport(RtfExport& rExport) RtfSdrExport::~RtfSdrExport() { - delete mpOutStrm, mpOutStrm = NULL; - delete[] m_pShapeTypeWritten, m_pShapeTypeWritten = NULL; + delete mpOutStrm, mpOutStrm = nullptr; + delete[] m_pShapeTypeWritten, m_pShapeTypeWritten = nullptr; } void RtfSdrExport::OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance) @@ -514,7 +514,7 @@ sal_Int32 RtfSdrExport::StartShape() { if (SwFrameFormat* pTextBox = SwTextBoxHelper::findTextBox(pShape)) { - sw::Frame* pFrame = 0; + sw::Frame* pFrame = nullptr; for (sw::FrameIter it = m_rExport.m_aFrames.begin(); it != m_rExport.m_aFrames.end(); ++it) { if (pTextBox == &it->GetFrameFormat()) @@ -533,7 +533,7 @@ sal_Int32 RtfSdrExport::StartShape() const SdrTextObj* pTextObj = dynamic_cast<const SdrTextObj*>(m_pSdrObject); if (pTextObj) { - const OutlinerParaObject* pParaObj = 0; + const OutlinerParaObject* pParaObj = nullptr; std::unique_ptr<const OutlinerParaObject> pOwnedParaObj; /* diff --git a/sw/source/filter/ww8/rtfsdrexport.hxx b/sw/source/filter/ww8/rtfsdrexport.hxx index fdb5371c2c95..ab0b24d32696 100644 --- a/sw/source/filter/ww8/rtfsdrexport.hxx +++ b/sw/source/filter/ww8/rtfsdrexport.hxx @@ -89,7 +89,7 @@ private: virtual void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance = 0) override; virtual void CloseContainer() override; - virtual sal_uInt32 EnterGroup(const OUString& rShapeName, const Rectangle* pBoundRect = 0) override; + virtual sal_uInt32 EnterGroup(const OUString& rShapeName, const Rectangle* pBoundRect = nullptr) override; virtual void LeaveGroup() override; virtual void AddShape(sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_uInt32 nShapeId = 0) override; diff --git a/sw/source/filter/ww8/rtfstringbuffer.cxx b/sw/source/filter/ww8/rtfstringbuffer.cxx index 44f0340b38c4..55c4d68a2653 100644 --- a/sw/source/filter/ww8/rtfstringbuffer.cxx +++ b/sw/source/filter/ww8/rtfstringbuffer.cxx @@ -11,8 +11,8 @@ RtfStringBufferValue::RtfStringBufferValue() : m_aBuffer(), - m_pFlyFrameFormat(0), - m_pGrfNode(0) + m_pFlyFrameFormat(nullptr), + m_pGrfNode(nullptr) { } @@ -38,7 +38,7 @@ OString RtfStringBufferValue::makeStringAndClear() bool RtfStringBufferValue::isGraphic() const { - return m_pFlyFrameFormat != 0 && m_pGrfNode != 0; + return m_pFlyFrameFormat != nullptr && m_pGrfNode != nullptr; } RtfStringBuffer::RtfStringBuffer() diff --git a/sw/source/filter/ww8/styles.cxx b/sw/source/filter/ww8/styles.cxx index 3f74cf5f0a8b..47c2f87ff620 100644 --- a/sw/source/filter/ww8/styles.cxx +++ b/sw/source/filter/ww8/styles.cxx @@ -134,7 +134,7 @@ namespace ww const sal_Char* GetEnglishNameFromSti(sti eSti) throw() { if (eSti >= stiMax) - return 0; + return nullptr; else return GetStiNames()[eSti]; } diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index d537e2d084de..8b157913ff8e 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -165,12 +165,12 @@ namespace sw { //For i120928,size conversion before exporting graphic of bullet Frame::Frame(const Graphic &rGrf, const SwPosition &rPos) - : mpFlyFrm(NULL) + : mpFlyFrm(nullptr) , maPos(rPos) , maSize() , maLayoutSize() , meWriterType(eBulletGrf) - , mpStartFrameContent(0) + , mpStartFrameContent(nullptr) , mbIsInline(true) , mbForBullet(true) , maGrf(rGrf) @@ -195,7 +195,7 @@ namespace sw , maSize() , maLayoutSize() // #i43447# , meWriterType(eTextBox) - , mpStartFrameContent(0) + , mpStartFrameContent(nullptr) // #i43447# - move to initialization list , mbIsInline( (rFormat.GetAnchor().GetAnchorId() == FLY_AS_CHAR) ) // #i120928# - handle graphic of bullet within existing implementation @@ -321,7 +321,7 @@ namespace sw rName, OUString() ); - mxIPRef = 0; + mxIPRef = nullptr; } return bSuccess; @@ -342,7 +342,7 @@ namespace sw { } - mxIPRef = 0; + mxIPRef = nullptr; } } } @@ -424,7 +424,7 @@ namespace sw sal_uInt16 nTotal = rSet.TotalCount(); for( sal_uInt16 nItem =0; nItem < nTotal; ++nItem ) { - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if( SfxItemState::SET == rSet.GetItemState( rSet.GetWhichByPos( nItem ), true, &pItem ) ) { rItems[pItem->Which()] = pItem; @@ -438,7 +438,7 @@ namespace sw { do rItems[pItem->Which()] = pItem; - while (!aIter.IsAtEnd() && 0 != (pItem = aIter.NextItem())); + while (!aIter.IsAtEnd() && nullptr != (pItem = aIter.NextItem())); } } } @@ -449,7 +449,7 @@ namespace sw sw::cPoolItemIter aIter = rItems.find(eType); if (aIter != rItems.end()) return aIter->second; - return 0; + return nullptr; } void ClearOverridesFromSet(const SwFormatCharFormat &rFormat, SfxItemSet &rSet) @@ -462,7 +462,7 @@ namespace sw const SfxPoolItem *pItem = aIter.GetCurItem(); do rSet.ClearItem(pItem->Which()); - while (!aIter.IsAtEnd() && 0 != (pItem = aIter.NextItem())); + while (!aIter.IsAtEnd() && nullptr != (pItem = aIter.NextItem())); } } } @@ -556,17 +556,17 @@ namespace sw if (nLevel < 0 || nLevel >= MAXLEVEL) { OSL_FAIL("Invalid level"); - return NULL; + return nullptr; } return &(rRule.Get( static_cast< sal_uInt16 >(nLevel) )); } const SwNumFormat* GetNumFormatFromTextNode(const SwTextNode &rTextNode) { - const SwNumRule *pRule = 0; + const SwNumRule *pRule = nullptr; if ( rTextNode.IsNumbered() && rTextNode.IsCountedInList() && - 0 != (pRule = rTextNode.GetNumRule()) + nullptr != (pRule = rTextNode.GetNumRule()) ) { return GetNumFormatFromSwNumRuleLevel(*pRule, @@ -575,18 +575,18 @@ namespace sw OSL_ENSURE(rTextNode.GetDoc(), "No document for node?, suspicious"); if (!rTextNode.GetDoc()) - return 0; + return nullptr; if ( rTextNode.IsNumbered() && rTextNode.IsCountedInList() && - 0 != (pRule = rTextNode.GetDoc()->GetOutlineNumRule()) + nullptr != (pRule = rTextNode.GetDoc()->GetOutlineNumRule()) ) { return GetNumFormatFromSwNumRuleLevel(*pRule, rTextNode.GetActualListLevel()); } - return 0; + return nullptr; } const SwNumRule* GetNumRuleFromTextNode(const SwTextNode &rTextNode) @@ -596,16 +596,16 @@ namespace sw const SwNumRule* GetNormalNumRuleFromTextNode(const SwTextNode &rTextNode) { - const SwNumRule *pRule = 0; + const SwNumRule *pRule = nullptr; if ( rTextNode.IsNumbered() && rTextNode.IsCountedInList() && - 0 != (pRule = rTextNode.GetNumRule()) + nullptr != (pRule = rTextNode.GetNumRule()) ) { return pRule; } - return 0; + return nullptr; } SwNoTextNode *GetNoTextNodeFromSwFrameFormat(const SwFrameFormat &rFormat) @@ -613,14 +613,14 @@ namespace sw const SwNodeIndex *pIndex = rFormat.GetContent().GetContentIdx(); OSL_ENSURE(pIndex, "No NodeIndex in SwFrameFormat ?, suspicious"); if (!pIndex) - return 0; + return nullptr; SwNodeIndex aIdx(*pIndex, 1); return aIdx.GetNode().GetNoTextNode(); } bool HasPageBreak(const SwNode &rNd) { - const SvxFormatBreakItem *pBreak = 0; + const SvxFormatBreakItem *pBreak = nullptr; if (rNd.IsTableNode() && rNd.GetTableNode()) { const SwTable& rTable = rNd.GetTableNode()->GetTable(); @@ -766,13 +766,13 @@ namespace sw { SwRedlineData aData(pFltRedline->eTypePrev, pFltRedline->nAutorNoPrev, pFltRedline->aStampPrev, OUString(), - 0); + nullptr); mrDoc.getIDocumentRedlineAccess().AppendRedline(new SwRangeRedline(aData, aRegion), true); } SwRedlineData aData(pFltRedline->eType, pFltRedline->nAutorNo, - pFltRedline->aStamp, OUString(), 0); + pFltRedline->aStamp, OUString(), nullptr); SwRangeRedline *const pNewRedline(new SwRangeRedline(aData, aRegion)); // the point node may be deleted in AppendRedline, so park @@ -856,7 +856,7 @@ namespace sw { SwFrameFormat * pFrameFormat = pTable->GetTable().GetFrameFormat(); - if (pFrameFormat != NULL) + if (pFrameFormat != nullptr) { SwNodeIndex *pIndex = aIter->second; pTable->DelFrms(); diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx index 0d115bb90451..7538cb36a0fb 100644 --- a/sw/source/filter/ww8/writerhelper.hxx +++ b/sw/source/filter/ww8/writerhelper.hxx @@ -262,7 +262,7 @@ namespace sw template<class T> const T * item_cast(const SfxPoolItem *pItem) { if (pItem && !pItem->IsA(STATICTYPE(T))) - pItem = 0; + pItem = nullptr; return static_cast<const T *>(pItem); } @@ -565,7 +565,7 @@ namespace sw @author <a href="mailto:cmc@openoffice.org">Caolán McNamara</a> */ - Frames GetFrames(const SwDoc &rDoc, SwPaM *pPaM = 0); + Frames GetFrames(const SwDoc &rDoc, SwPaM *pPaM = nullptr); /** fix up frame positions, must be called after SetRedlineMode */ void UpdateFramePositions(Frames & rFrames); diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index f9d3fc94146f..229a757ebbd0 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -156,7 +156,7 @@ namespace myImplHelpers OSL_ENSURE(SAL_N_ELEMENTS(aArr) == 75, "Style Array has false size"); - SwTextFormatColl* pRet = 0; + SwTextFormatColl* pRet = nullptr; //If this is a built-in word style that has a built-in writer //equivalent, then map it to one of our built in styles regardless //of its name @@ -220,7 +220,7 @@ namespace myImplHelpers eLookup = RES_POOLCHR_NORMAL_END; break; } - SwCharFormat *pRet = 0; + SwCharFormat *pRet = nullptr; if (eLookup != RES_POOLCHR_NORMAL_END) pRet = mrDoc.getIDocumentStylePoolAccess().GetCharFormatFromPool( static_cast< sal_uInt16 >(eLookup) ); return pRet; @@ -567,7 +567,7 @@ namespace sw UErrorCode nError = U_ZERO_ERROR; UBiDi* pBidi = ubidi_openSized(rText.getLength(), 0, &nError); ubidi_setPara(pBidi, reinterpret_cast<const UChar *>(rText.getStr()), rText.getLength(), - static_cast< UBiDiLevel >(eDefaultDir), 0, &nError); + static_cast< UBiDiLevel >(eDefaultDir), nullptr, &nError); sal_Int32 nCount = ubidi_countRuns(pBidi, &nError); aDirChanges.reserve(nCount); diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 5717a91bba7b..fa39c6d6e600 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -450,7 +450,7 @@ void WW8Export::DoComboBox(const OUString &rName, const OUString &rSelected, uno::Sequence<OUString> &rListItems) { - OutputField(0, ww::eFORMDROPDOWN, FieldString(ww::eFORMDROPDOWN), + OutputField(nullptr, ww::eFORMDROPDOWN, FieldString(ww::eFORMDROPDOWN), WRITEFIELD_START | WRITEFIELD_CMD_START); // write the refence to the "picture" structure sal_uLong nDataStt = pDataStrm->Tell(); @@ -470,7 +470,7 @@ void WW8Export::DoComboBox(const OUString &rName, m_pChpPlc->AppendFkpEntry(Strm().Tell(), sizeof(aArr1), aArr1); - OutputField(0, ww::eFORMDROPDOWN, FieldString(ww::eFORMDROPDOWN), + OutputField(nullptr, ww::eFORMDROPDOWN, FieldString(ww::eFORMDROPDOWN), WRITEFIELD_CLOSE); ::sw::WW8FFData aFFData; @@ -497,7 +497,7 @@ void WW8Export::DoCheckBox(uno::Reference<beans::XPropertySet> xPropSet) uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo(); - OutputField(0, ww::eFORMCHECKBOX, FieldString(ww::eFORMCHECKBOX), + OutputField(nullptr, ww::eFORMCHECKBOX, FieldString(ww::eFORMCHECKBOX), WRITEFIELD_START | WRITEFIELD_CMD_START); // write the refence to the "picture" structure sal_uLong nDataStt = pDataStrm->Tell(); @@ -552,12 +552,12 @@ void WW8Export::DoCheckBox(uno::Reference<beans::XPropertySet> xPropSet) aFFData.Write(pDataStrm); - OutputField(0, ww::eFORMCHECKBOX, OUString(), WRITEFIELD_CLOSE); + OutputField(nullptr, ww::eFORMCHECKBOX, OUString(), WRITEFIELD_CLOSE); } void WW8Export::DoFormText(const SwInputField * pField) { - OutputField(0, ww::eFORMTEXT, FieldString(ww::eFORMTEXT), + OutputField(nullptr, ww::eFORMTEXT, FieldString(ww::eFORMTEXT), WRITEFIELD_START | WRITEFIELD_CMD_START); // write the refence to the "picture" structure sal_uLong nDataStt = pDataStrm->Tell(); @@ -585,7 +585,7 @@ void WW8Export::DoFormText(const SwInputField * pField) aFFData.setStatus(pField->GetToolTip()); aFFData.Write(pDataStrm); - OutputField(0, ww::eFORMTEXT, OUString(), WRITEFIELD_CMD_END); + OutputField(nullptr, ww::eFORMTEXT, OUString(), WRITEFIELD_CMD_END); const OUString fieldStr( pField->ExpandField(true) ); SwWW8Writer::WriteString16(Strm(), fieldStr, false); @@ -600,7 +600,7 @@ void WW8Export::DoFormText(const SwInputField * pField) m_pChpPlc->AppendFkpEntry(Strm().Tell(), sizeof( aArr2 ), aArr2 ); - OutputField(0, ww::eFORMTEXT, OUString(), WRITEFIELD_CLOSE); + OutputField(nullptr, ww::eFORMTEXT, OUString(), WRITEFIELD_CLOSE); } PlcDrawObj::~PlcDrawObj() @@ -990,13 +990,13 @@ void WW8_WrPlcTextBoxes::Append( const SdrObject& rObj, sal_uInt32 nShapeId ) aContent.push_back( &rObj ); aShapeIds.push_back( nShapeId ); //save NULL, if we have an actual SdrObject - aSpareFormats.push_back(NULL); + aSpareFormats.push_back(nullptr); } void WW8_WrPlcTextBoxes::Append( const SwFrameFormat* pFormat, sal_uInt32 nShapeId ) { //no sdr object, we insert a NULL in the aContent and save the real fmt in aSpareFormats. - aContent.push_back( NULL ); + aContent.push_back( nullptr ); aShapeIds.push_back( nShapeId ); aSpareFormats.push_back(pFormat); } @@ -1039,7 +1039,7 @@ void WW8Export::AppendFlyInFlys(const sw::Frame& rFrameFormat, if (rFrameFormat.IsInline()) { - OutputField(0, ww::eSHAPE, FieldString(ww::eSHAPE), + OutputField(nullptr, ww::eSHAPE, FieldString(ww::eSHAPE), WRITEFIELD_START | WRITEFIELD_CMD_START | WRITEFIELD_CMD_END); } @@ -1067,12 +1067,12 @@ void WW8Export::AppendFlyInFlys(const sw::Frame& rFrameFormat, } if (rFrameFormat.IsInline()) - OutputField(0, ww::eSHAPE, OUString(), WRITEFIELD_CLOSE); + OutputField(nullptr, ww::eSHAPE, OUString(), WRITEFIELD_CLOSE); } MSWord_SdrAttrIter::MSWord_SdrAttrIter( MSWordExportBase& rWr, const EditTextObject& rEditObj, sal_uInt8 nTyp ) - : MSWordAttrIter( rWr ), pEditObj(&rEditObj), pEditPool(0), mnTyp(nTyp) + : MSWordAttrIter( rWr ), pEditObj(&rEditObj), pEditPool(nullptr), mnTyp(nTyp) { NextPara( 0 ); } @@ -1203,7 +1203,7 @@ void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos ) if (!aTextAtrArr.empty()) { const SwModify* pOldMod = m_rExport.m_pOutFormatNode; - m_rExport.m_pOutFormatNode = 0; + m_rExport.m_pOutFormatNode = nullptr; const SfxItemPool* pSrcPool = pEditPool; const SfxItemPool& rDstPool = m_rExport.m_pDoc->GetAttrPool(); @@ -1290,10 +1290,10 @@ const SfxPoolItem* MSWord_SdrAttrIter::HasTextItem(sal_uInt16 nWhich) const if (nWhich == i->pAttr->Which() && nTmpSwPos >= i->nStart && nTmpSwPos < i->nEnd) return i->pAttr; // Found if (nTmpSwPos < i->nStart) - return NULL; // dann kommt da nichts mehr + return nullptr; // dann kommt da nichts mehr } } - return NULL; + return nullptr; } const SfxPoolItem& MSWord_SdrAttrIter::GetItem( sal_uInt16 nWhich ) const @@ -1378,14 +1378,14 @@ void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr, const std::set<sal_uInt16>* m_rExport.AttrOutput().OutputItem(*pI); delete pI; } - } while( !aIter.IsAtEnd() && 0 != ( pItem = aIter.NextItem() ) ); + } while( !aIter.IsAtEnd() && nullptr != ( pItem = aIter.NextItem() ) ); m_rExport.SetCurItemSet( pOldSet ); } } void WW8Export::WriteSdrTextObj(const SdrTextObj& rTextObj, sal_uInt8 nTyp) { - const OutlinerParaObject* pParaObj = 0; + const OutlinerParaObject* pParaObj = nullptr; bool bOwnParaObj = false; /* @@ -1526,7 +1526,7 @@ void WW8Export::WriteEscher() pFib->fcDggInfo = nStart; pFib->lcbDggInfo = pTableStrm->Tell() - nStart; - delete m_pEscher, m_pEscher = 0; + delete m_pEscher, m_pEscher = nullptr; } } @@ -1668,7 +1668,7 @@ sal_Int32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrameFormat& rFormat, sal_uI { sal_Int32 nBorderThick=0; SwNoTextNode *pNd = GetNoTextNodeFromSwFrameFormat(rFormat); - SwGrfNode *pGrfNd = pNd ? pNd->GetGrfNode() : 0; + SwGrfNode *pGrfNd = pNd ? pNd->GetGrfNode() : nullptr; OSL_ENSURE(pGrfNd, "No SwGrfNode ?, suspicious"); if (!pGrfNd) return nBorderThick; @@ -1686,7 +1686,7 @@ sal_Int32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrameFormat& rFormat, sal_uI if (pGrfNd->IsLinkedFile()) { OUString sURL; - pGrfNd->GetFileFilterNms( &sURL, 0 ); + pGrfNd->GetFileFilterNms( &sURL, nullptr ); ww::bytes aBuf; SwWW8Writer::InsAsString16( aBuf, sURL ); @@ -1890,7 +1890,7 @@ sal_Int32 SwBasicEscherEx::WriteOLEFlyFrame(const SwFrameFormat& rFormat, sal_uI EscherPropertyContainer aPropOpt; const SwMirrorGrf &rMirror = rOLENd.GetSwAttrSet().GetMirrorGrf(); WriteOLEPicture(aPropOpt, AddMirrorFlags(0xa00 | SHAPEFLAG_OLESHAPE, - rMirror), pGraphic ? *pGraphic : Graphic(), *pSdrObj, nShapeId, bRectIsSet ? &aRect : NULL ); + rMirror), pGraphic ? *pGraphic : Graphic(), *pSdrObj, nShapeId, bRectIsSet ? &aRect : nullptr ); nBorderThick = WriteFlyFrameAttr(rFormat, mso_sptPictureFrame, aPropOpt); WriteGrfAttr(rOLENd, aPropOpt); @@ -1979,7 +1979,7 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat, const SvxBorderLine* pLine; for( SvxBoxItemLine n : o3tl::enumrange<SvxBoxItemLine>() ) - if( 0 != ( pLine = static_cast<const SvxBoxItem*>(pItem)->GetLine( n )) ) + if( nullptr != ( pLine = static_cast<const SvxBoxItem*>(pItem)->GetLine( n )) ) { if( bFirstLine ) { @@ -2266,7 +2266,7 @@ void SwBasicEscherEx::WritePictures() SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) : SwBasicEscherEx(pStrm, rWW8Wrt), - pTextBxs(0) + pTextBxs(nullptr) { aHostData.SetClientData(&aWinwordAnchoring); OpenContainer( ESCHER_DggContainer ); @@ -2353,7 +2353,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) nShapeId = AddSdrObject(*pSdrObj); if (bSwapInPage) - (const_cast<SdrObject*>(pSdrObj))->SetPage(0); + (const_cast<SdrObject*>(pSdrObj))->SetPage(nullptr); } #if OSL_DEBUG_LEVEL > 0 else @@ -2383,7 +2383,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) EscherPropertyContainer aPropOpt; const SwFrameFormat &rFormat = rWrt.m_pDoc->GetPageDesc(0).GetMaster(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; SfxItemState eState = rFormat.GetItemState(RES_BACKGROUND, true, &pItem); if (SfxItemState::SET == eState && pItem) @@ -2424,7 +2424,7 @@ void SwEscherEx::FinishEscher() { pEscherStrm->Seek(0); rWrt.pTableStrm->WriteStream( *pEscherStrm ); - delete pEscherStrm, pEscherStrm = 0; + delete pEscherStrm, pEscherStrm = nullptr; } /** method to perform conversion of positioning attributes with the help @@ -2465,7 +2465,7 @@ bool WinwordAnchoring::ConvertPosition( SwFormatHoriOrient& _iorHoriOri, } // determine anchored object - SwAnchoredObject* pAnchoredObj( 0L ); + SwAnchoredObject* pAnchoredObj( nullptr ); { const SwContact* pContact = _rFrameFormat.FindContactObj(); if ( pContact ) @@ -2909,7 +2909,7 @@ sal_Int32 SwEscherEx::WriteFlyFrm(const DrawObj &rObj, sal_uInt32 &rShapeId, sal_uInt32 nTextId; sal_uInt16 nOff = 0; const SwFrameFormat* pFormat = &rFormat, *pPrev; - while( 0 != ( pPrev = pFormat->GetChain().GetPrev() )) + while( nullptr != ( pPrev = pFormat->GetChain().GetPrev() )) { ++nOff; pFormat = pPrev; @@ -3084,7 +3084,7 @@ void SwEscherEx::WriteOCXControl( const SwFrameFormat& rFormat, sal_uInt32 nShap EscherPropertyContainer aPropOpt; WriteOLEPicture(aPropOpt, 0xa00 | SHAPEFLAG_OLESHAPE, aGraphic, - *pSdrObj, nShapeId, NULL ); + *pSdrObj, nShapeId, nullptr ); WriteFlyFrameAttr( rFormat, mso_sptPictureFrame , aPropOpt ); aPropOpt.Commit( GetStream() ); @@ -3154,7 +3154,7 @@ sal_uInt32 SwEscherEx::QueryTextID( } SwMSConvertControls::SwMSConvertControls( SfxObjectShell *pDSh,SwPaM *pP ) : oox -::ole::MSConvertOCXControls( pDSh ? pDSh->GetModel() : NULL ), pPaM( pP ), mnObjectId(0) +::ole::MSConvertOCXControls( pDSh ? pDSh->GetModel() : nullptr ), pPaM( pP ), mnObjectId(0) { } @@ -3220,13 +3220,13 @@ bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrUnoObj& rFo OUString sField = FieldString(ww::eCONTROL) + "Forms." + sUName + ".1 \\s "; - rWW8Wrt.OutputField(0, ww::eCONTROL, sField, + rWW8Wrt.OutputField(nullptr, ww::eCONTROL, sField, WRITEFIELD_START|WRITEFIELD_CMD_START|WRITEFIELD_CMD_END); rWW8Wrt.m_pChpPlc->AppendFkpEntry(rWW8Wrt.Strm().Tell(),sizeof(aSpecOLE), aSpecOLE); rWW8Wrt.WriteChar( 0x1 ); - rWW8Wrt.OutputField(0, ww::eCONTROL, OUString(), WRITEFIELD_END | WRITEFIELD_CLOSE); + rWW8Wrt.OutputField(nullptr, ww::eCONTROL, OUString(), WRITEFIELD_END | WRITEFIELD_CLOSE); return true; } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index d948f8c51d77..a04012be37bc 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -109,7 +109,7 @@ using namespace ::oox::vml; static OUString lcl_getFieldCode( const IFieldmark* pFieldmark ) { - OSL_ENSURE(pFieldmark!=NULL, "where is my fieldmark???"); + OSL_ENSURE(pFieldmark!=nullptr, "where is my fieldmark???"); if ( !pFieldmark) return OUString(); @@ -129,7 +129,7 @@ static OUString lcl_getFieldCode( const IFieldmark* pFieldmark ) } static ww::eField lcl_getFieldId( const IFieldmark* pFieldmark ) { - OSL_ENSURE(pFieldmark!=NULL, "where is my fieldmark???"); + OSL_ENSURE(pFieldmark!=nullptr, "where is my fieldmark???"); if ( !pFieldmark ) return ww::eUNKNOWN; if ( pFieldmark->GetFieldname( ) == ODF_FORMTEXT ) @@ -180,7 +180,7 @@ SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTextNode& rTextNd) : MSWordAttrIter(rWr), rNd(rTextNd), maCharRuns(GetPseudoCharRuns(rTextNd)), - pCurRedline(0), + pCurRedline(nullptr), nAktSwPos(0), nCurRedlinePos(USHRT_MAX), mrSwFormatDrop(rTextNd.GetSwAttrSet().GetDrop()) @@ -395,7 +395,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby ) const SvxFontItem &rParentFont = ItemGet<SvxFontItem>( static_cast<const SwTextFormatColl&>(rNd.GetAnyFormatColl()), nFontId); const SvxFontItem *pFont = &rParentFont; - const SfxPoolItem *pGrabBag = 0; + const SfxPoolItem *pGrabBag = nullptr; SfxItemSet aExportSet(*rNd.GetSwAttrSet().GetPool(), RES_CHRATR_BEGIN, RES_TXTATR_END - 1); @@ -468,7 +468,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby ) sw::PoolItems aExportItems; GetPoolItems( aExportSet, aExportItems, false ); - if( rNd.GetpSwpHints() == 0 ) + if( rNd.GetpSwpHints() == nullptr ) m_rExport.SetCurItemSet(&aExportSet); sw::cPoolItemIter aEnd = aRangeItems.end(); @@ -491,8 +491,8 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby ) m_rExport.m_pOutFormatNode = pOldMod; } - if( rNd.GetpSwpHints() == 0 ) - m_rExport.SetCurItemSet(0); + if( rNd.GetpSwpHints() == nullptr ) + m_rExport.SetCurItemSet(nullptr); OSL_ENSURE( pFont, "must be *some* font associated with this txtnode" ); if ( pFont ) @@ -715,7 +715,7 @@ bool SwWW8AttrIter::RequiresImplicitBookmark() // It searches with bDeep const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const { - const SfxPoolItem* pRet = 0; + const SfxPoolItem* pRet = nullptr; const SwpHints* pTextAttrs = rNd.GetpSwpHints(); if (pTextAttrs && !m_rExport.m_aCurrentCharPropStarts.empty()) { @@ -724,8 +724,8 @@ const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const { const SwTextAttr* pHt = pTextAttrs->Get(i); const SfxPoolItem* pItem = &pHt->GetAttr(); - const sal_Int32 * pAtrEnd = 0; - if( 0 != ( pAtrEnd = pHt->End() ) && // only Attr with an end + const sal_Int32 * pAtrEnd = nullptr; + if( nullptr != ( pAtrEnd = pHt->End() ) && // only Attr with an end nTmpSwPos >= pHt->GetStart() && nTmpSwPos < *pAtrEnd ) { if ( nWhich == pItem->Which() ) @@ -812,7 +812,7 @@ void WW8AttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 /*nPos*/, nRubyScript = i18n::ScriptType::ASIAN; const SwTextRuby* pRubyText = rRuby.GetTextRuby(); - const SwCharFormat* pFormat = pRubyText ? pRubyText->GetCharFormat() : 0; + const SwCharFormat* pFormat = pRubyText ? pRubyText->GetCharFormat() : nullptr; OUString sFamilyName; long nHeight; if ( pFormat ) @@ -875,14 +875,14 @@ void WW8AttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 /*nPos*/, else aStr += ";"; - m_rWW8Export.OutputField( 0, ww::eEQ, aStr, + m_rWW8Export.OutputField( nullptr, ww::eEQ, aStr, WRITEFIELD_START | WRITEFIELD_CMD_START ); } void WW8AttributeOutput::EndRuby() { m_rWW8Export.WriteChar( ')' ); - m_rWW8Export.OutputField( 0, ww::eEQ, OUString(), WRITEFIELD_END | WRITEFIELD_CLOSE ); + m_rWW8Export.OutputField( nullptr, ww::eEQ, OUString(), WRITEFIELD_END | WRITEFIELD_CLOSE ); } /*#i15387# Better ideas welcome*/ @@ -973,7 +973,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget bool bBookMarkOnly = AnalyzeURL( rUrl, rTarget, &sURL, &sMark ); - m_rWW8Export.OutputField( 0, ww::eHYPERLINK, sURL, WRITEFIELD_START | WRITEFIELD_CMD_START ); + m_rWW8Export.OutputField( nullptr, ww::eHYPERLINK, sURL, WRITEFIELD_START | WRITEFIELD_CMD_START ); // write the refence to the "picture" structure sal_uLong nDataStt = m_rWW8Export.pDataStrm->Tell(); @@ -994,7 +994,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget m_rWW8Export.m_pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), sizeof( aArr1 ), aArr1 ); - m_rWW8Export.OutputField( 0, ww::eHYPERLINK, sURL, WRITEFIELD_CMD_END ); + m_rWW8Export.OutputField( nullptr, ww::eHYPERLINK, sURL, WRITEFIELD_CMD_END ); // now write the picture structure sURL = aURL.GetURLNoMark(); @@ -1119,7 +1119,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget bool WW8AttributeOutput::EndURL(bool const) { - m_rWW8Export.OutputField( 0, ww::eHYPERLINK, OUString(), WRITEFIELD_CLOSE ); + m_rWW8Export.OutputField( nullptr, ww::eHYPERLINK, OUString(), WRITEFIELD_CLOSE ); return true; } @@ -1385,7 +1385,7 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons const SwRedlineData* SwWW8AttrIter::GetParagraphLevelRedline( ) { - pCurRedline = NULL; + pCurRedline = nullptr; // ToDo : this is not the most ideal ... should start maybe from 'nCurRedlinePos' for( size_t nRedlinePos = 0; nRedlinePos < m_rExport.m_pDoc->getIDocumentRedlineAccess().GetRedlineTable().size(); ++nRedlinePos ) @@ -1407,7 +1407,7 @@ const SwRedlineData* SwWW8AttrIter::GetParagraphLevelRedline( ) } } } - return NULL; + return nullptr; } const SwRedlineData* SwWW8AttrIter::GetRunLevelRedline( sal_Int32 nPos ) @@ -1418,7 +1418,7 @@ const SwRedlineData* SwWW8AttrIter::GetRunLevelRedline( sal_Int32 nPos ) if( pEnd->nNode == rNd && pEnd->nContent.GetIndex() <= nPos ) { - pCurRedline = 0; + pCurRedline = nullptr; ++nCurRedlinePos; } else @@ -1434,7 +1434,7 @@ const SwRedlineData* SwWW8AttrIter::GetRunLevelRedline( sal_Int32 nPos ) default: break; } - pCurRedline = 0; + pCurRedline = nullptr; ++nCurRedlinePos; } } @@ -1487,7 +1487,7 @@ const SwRedlineData* SwWW8AttrIter::GetRunLevelRedline( sal_Int32 nPos ) } } } - return NULL; + return nullptr; } short MSWordExportBase::GetCurrentPageDirection() const @@ -1540,13 +1540,13 @@ short MSWordExportBase::GetDefaultFrameDirection( ) const short MSWordExportBase::TrueFrameDirection( const SwFrameFormat &rFlyFormat ) const { const SwFrameFormat *pFlyFormat = &rFlyFormat; - const SvxFrameDirectionItem* pItem = 0; + const SvxFrameDirectionItem* pItem = nullptr; while ( pFlyFormat ) { pItem = &pFlyFormat->GetFrmDir(); if ( FRMDIR_ENVIRONMENT == pItem->GetValue() ) { - pItem = 0; + pItem = nullptr; const SwFormatAnchor* pAnchor = &pFlyFormat->GetAnchor(); if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetContentAnchor() ) @@ -1554,10 +1554,10 @@ short MSWordExportBase::TrueFrameDirection( const SwFrameFormat &rFlyFormat ) co pFlyFormat = pAnchor->GetContentAnchor()->nNode.GetNode().GetFlyFormat(); } else - pFlyFormat = 0; + pFlyFormat = nullptr; } else - pFlyFormat = 0; + pFlyFormat = nullptr; } short nRet; @@ -1576,7 +1576,7 @@ const SvxBrushItem* WW8Export::GetCurrentPageBgBrush() const ? m_pAktPageDesc->GetMaster() : m_pDoc->GetPageDesc(0).GetMaster(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; //If not set, or "no fill", get real bg SfxItemState eState = rFormat.GetItemState(RES_BACKGROUND, true, &pItem); @@ -1592,19 +1592,19 @@ const SvxBrushItem* WW8Export::GetCurrentPageBgBrush() const SvxBrushItem WW8Export::TrueFrameBgBrush(const SwFrameFormat &rFlyFormat) const { const SwFrameFormat *pFlyFormat = &rFlyFormat; - const SvxBrushItem* pRet = 0; + const SvxBrushItem* pRet = nullptr; while (pFlyFormat) { //If not set, or "no fill", get real bg - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; SfxItemState eState = pFlyFormat->GetItemState(RES_BACKGROUND, true, &pItem); pRet = static_cast<const SvxBrushItem*>(pItem); if (SfxItemState::SET != eState || !pRet || (!pRet->GetGraphic() && pRet->GetColor() == COL_TRANSPARENT)) { - pRet = 0; + pRet = nullptr; const SwFormatAnchor* pAnchor = &pFlyFormat->GetAnchor(); if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetContentAnchor()) @@ -1613,10 +1613,10 @@ SvxBrushItem WW8Export::TrueFrameBgBrush(const SwFrameFormat &rFlyFormat) const pAnchor->GetContentAnchor()->nNode.GetNode().GetFlyFormat(); } else - pFlyFormat = 0; + pFlyFormat = nullptr; } else - pFlyFormat = 0; + pFlyFormat = nullptr; } if (!pRet) @@ -1756,7 +1756,7 @@ void WW8AttributeOutput::FormatDrop( const SwTextNode& rNode, const SwFormatDrop m_rWW8Export.WriteCR( pTextNodeInfoInner ); - if ( pTextNodeInfo.get() != NULL ) + if ( pTextNodeInfo.get() != nullptr ) { #ifdef DBG_UTIL SAL_INFO( "sw.ww8", pTextNodeInfo->toString()); @@ -2085,7 +2085,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) AttrOutput().StartParagraph( pTextNodeInfo ); - const SwSection* pTOXSect = 0; + const SwSection* pTOXSect = nullptr; if( m_bInWriteTOX ) { // check for end of TOX @@ -2099,7 +2099,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) const SwNode* pNxt = rNode.GetNodes().GoNext( &aIdx ); if( pNxt && pNxt->FindSectionNode() == pTOXSectNd ) - pTOXSect = 0; + pTOXSect = nullptr; } } } @@ -2120,7 +2120,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) OUString aStringForImage("\001"); ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner; - if ( pTextNodeInfo.get() != NULL ) + if ( pTextNodeInfo.get() != nullptr ) { pTextNodeInfoInner = pTextNodeInfo->getFirstInner(); if ( pTextNodeInfoInner && pTextNodeInfoInner->isEndOfCell() ) { @@ -2199,13 +2199,13 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) } } - OutputField( NULL, eFieldId, sCode, WRITEFIELD_START | WRITEFIELD_CMD_START ); + OutputField( nullptr, eFieldId, sCode, WRITEFIELD_START | WRITEFIELD_CMD_START ); if ( pFieldmark && pFieldmark->GetFieldname( ) == ODF_FORMTEXT ) WriteFormData( *pFieldmark ); else if ( pFieldmark && pFieldmark->GetFieldname( ) == ODF_HYPERLINK ) WriteHyperlinkData( *pFieldmark ); - OutputField( NULL, lcl_getFieldId( pFieldmark ), OUString(), WRITEFIELD_CMD_END ); + OutputField( nullptr, lcl_getFieldId( pFieldmark ), OUString(), WRITEFIELD_CMD_END ); if ( pFieldmark && pFieldmark->GetFieldname() == ODF_UNHANDLED ) { @@ -2240,7 +2240,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) } } - OutputField( NULL, eFieldId, OUString(), WRITEFIELD_CLOSE ); + OutputField( nullptr, eFieldId, OUString(), WRITEFIELD_CLOSE ); if ( pFieldmark && pFieldmark->GetFieldname() == ODF_FORMTEXT ) AppendBookmark( pFieldmark->GetName() ); @@ -2256,12 +2256,12 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) if ( isDropdownOrCheckbox ) AppendBookmark( pFieldmark->GetName() ); - OutputField( NULL, lcl_getFieldId( pFieldmark ), + OutputField( nullptr, lcl_getFieldId( pFieldmark ), lcl_getFieldCode( pFieldmark ), WRITEFIELD_START | WRITEFIELD_CMD_START ); if ( isDropdownOrCheckbox ) WriteFormData( *pFieldmark ); - OutputField( NULL, lcl_getFieldId( pFieldmark ), OUString(), WRITEFIELD_CLOSE ); + OutputField( nullptr, lcl_getFieldId( pFieldmark ), OUString(), WRITEFIELD_CLOSE ); if ( isDropdownOrCheckbox ) AppendBookmark( pFieldmark->GetName() ); } @@ -2438,7 +2438,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) if ( m_pParentFrame && IsInTable() ) // Fly-Attrs OutputFormat( m_pParentFrame->GetFrameFormat(), false, false, true ); - if ( pTextNodeInfo.get() != NULL ) + if ( pTextNodeInfo.get() != nullptr ) { #ifdef DBG_UTIL SAL_INFO( "sw.ww8", pTextNodeInfo->toString()); @@ -2450,7 +2450,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) const SwTable * pTable = pTextNodeInfoInner->getTable(); const SwTableFormat* pTabFormat = pTable->GetFrameFormat(); - if (pTabFormat != NULL) + if (pTabFormat != nullptr) { if (pTabFormat->GetBreak().GetBreak() == SVX_BREAK_PAGE_BEFORE) AttrOutput().PageBreakBefore(true); @@ -2460,7 +2460,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) if ( !bFlyInTable ) { - SfxItemSet* pTmpSet = 0; + SfxItemSet* pTmpSet = nullptr; const sal_uInt8 nPrvNxtNd = rNode.HasPrevNextLayNode(); if( (ND_HAS_PREV_LAYNODE|ND_HAS_NEXT_LAYNODE ) != nPrvNxtNd ) @@ -2591,7 +2591,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) // #i44815# adjust numbering/indents for numbered paragraphs // without number (NO_NUMLEVEL) // #i47013# need to check rNode.GetNumRule()!=NULL as well. - if ( ! rNode.IsCountedInList() && rNode.GetNumRule()!=NULL ) + if ( ! rNode.IsCountedInList() && rNode.GetNumRule()!=nullptr ) { // WW8 does not know numbered paragraphs without number // (NO_NUMLEVEL). In WW8AttributeOutput::ParaNumRule(), we will export @@ -2603,10 +2603,10 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) pTmpSet = new SfxItemSet(rNode.GetSwAttrSet()); // create new LRSpace item, based on the current (if present) - const SfxPoolItem* pPoolItem = NULL; + const SfxPoolItem* pPoolItem = nullptr; pTmpSet->GetItemState(RES_LR_SPACE, true, &pPoolItem); SvxLRSpaceItem aLRSpace( - ( pPoolItem == NULL ) + ( pPoolItem == nullptr ) ? SvxLRSpaceItem(0, 0, 0, 0, RES_LR_SPACE) : *static_cast<const SvxLRSpaceItem*>( pPoolItem ) ); @@ -2695,7 +2695,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) // bDontSplit : set keep at first paragraphs in all lines except from last line // but only for non-complex tables const SwTableBox* pBox = rNode.GetTableBox(); - const SwTableLine* pLine = pBox ? pBox->GetUpper() : 0; + const SwTableLine* pLine = pBox ? pBox->GetUpper() : nullptr; if ( pLine && !pLine->GetUpper() ) { @@ -2741,7 +2741,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) // Pap-Attrs, so script is not necessary OutputItemSet( *pNewSet, true, false, i18n::ScriptType::LATIN, false); - m_pStyAttr = 0; + m_pStyAttr = nullptr; m_pOutFormatNode = pOldMod; if( pNewSet != rNode.GetpSwAttrSet() ) @@ -2810,7 +2810,7 @@ bool MSWordExportBase::NoPageBreakSection( const SfxItemSet* pSet ) { bool bNoPageBreak = false; if ( SfxItemState::SET != pSet->GetItemState(RES_PAGEDESC, true, &pI) - || 0 == static_cast<const SwFormatPageDesc*>(pI)->GetPageDesc() ) + || nullptr == static_cast<const SwFormatPageDesc*>(pI)->GetPageDesc() ) { bNoPageBreak = true; } @@ -2861,10 +2861,10 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode ) RES_LINENUMBER )).GetStartValue(); } else - pSet = 0; + pSet = nullptr; if ( pSet && NoPageBreakSection( pSet ) ) - pSet = 0; + pSet = nullptr; if ( !pSet ) { @@ -3025,7 +3025,7 @@ void WW8AttributeOutput::Redline( const SwRedlineData* pRedline ) NS_sprm::LN_CFRMarkDel, NS_sprm::LN_CIbstRMarkDel, NS_sprm::LN_CDttmRMarkDel, }; - const sal_uInt16* pSprmIds = 0; + const sal_uInt16* pSprmIds = nullptr; switch( pRedline->GetType() ) { case nsRedlineType_t::REDLINE_INSERT: diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index cf5a3cf43f44..084254fd3599 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -408,7 +408,7 @@ void MSWordExportBase::AbstractNumberingDefinitions() OUString sNumStr; OUString sFontName; bool bWriteBullet = false; - const vcl::Font* pBulletFont=0; + const vcl::Font* pBulletFont=nullptr; rtl_TextEncoding eChrSet=0; FontFamily eFamily=FAMILY_DECORATIVE; if( SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType() || @@ -480,8 +480,8 @@ void MSWordExportBase::AbstractNumberingDefinitions() } // Attributes of the numbering - wwFont *pPseudoFont = NULL; - const SfxItemSet* pOutSet = NULL; + wwFont *pPseudoFont = nullptr; + const SfxItemSet* pOutSet = nullptr; // cbGrpprlChpx SfxItemSet aSet( m_pDoc->GetAttrPool(), RES_CHRATR_BEGIN, @@ -534,7 +534,7 @@ void MSWordExportBase::AbstractNumberingDefinitions() pPseudoFont, pOutSet, nIndentAt, nFirstLineIndex, nListTabPos, sNumStr, - rFormat.GetNumberingType()==SVX_NUM_BITMAP ? rFormat.GetBrush():0); + rFormat.GetNumberingType()==SVX_NUM_BITMAP ? rFormat.GetBrush():nullptr); delete pPseudoFont; } diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 1d4edb4852b4..d3ed0bc4aa4d 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -444,7 +444,7 @@ void MSWordStyles::SetStyleDefaults( const SwFormat& rFormat, bool bPap ) // dynamic defaults const SfxItemPool& rPool = *rFormat.GetAttrSet().GetPool(); for( n = nStt; n < nEnd; ++n ) - aFlags[ n - RES_CHRATR_BEGIN ] = 0 != rPool.GetPoolDefaultItem( n ); + aFlags[ n - RES_CHRATR_BEGIN ] = nullptr != rPool.GetPoolDefaultItem( n ); // static defaults, that differs between WinWord and SO if( bPap ) @@ -504,14 +504,14 @@ void MSWordStyles::WriteProperties( const SwFormat* pFormat, bool bParProp, sal_ { m_rExport.AttrOutput().StartStyleProperties( bParProp, nPos ); - OSL_ENSURE( m_rExport.m_pCurrentStyle == NULL, "Current style not NULL" ); // set current style before calling out + OSL_ENSURE( m_rExport.m_pCurrentStyle == nullptr, "Current style not NULL" ); // set current style before calling out m_rExport.m_pCurrentStyle = pFormat; m_rExport.OutputFormat( *pFormat, bParProp, !bParProp ); OSL_ENSURE( m_rExport.m_pCurrentStyle == pFormat, "current style was changed" ); // reset current style... - m_rExport.m_pCurrentStyle = NULL; + m_rExport.m_pCurrentStyle = nullptr; if ( bInsDefCharSiz ) // not derived from other Style SetStyleDefaults( *pFormat, bParProp ); @@ -849,7 +849,7 @@ void wwFontHelper::InitFontTable(const SwDoc& rDoc) pFont->GetFamily(), pFont->GetCharSet())); const SfxItemPool& rPool = rDoc.GetAttrPool(); - if (0 != (pFont = static_cast<const SvxFontItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_FONT)))) + if (nullptr != (pFont = static_cast<const SvxFontItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_FONT)))) { GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), pFont->GetFamily(), pFont->GetCharSet())); @@ -865,7 +865,7 @@ void wwFontHelper::InitFontTable(const SwDoc& rDoc) for (sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet) { pFont = static_cast<const SvxFontItem*>(rPool.GetItem2( *pId, nGet )); - if (0 != pFont) + if (nullptr != pFont) { GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), pFont->GetFamily(), pFont->GetCharSet())); @@ -963,12 +963,12 @@ void WW8_WrPlc0::Write( SvStream& rStrm ) MSWordSections::MSWordSections( MSWordExportBase& rExport ) : mbDocumentIsProtected( false ) { - const SwSectionFormat *pFormat = 0; + const SwSectionFormat *pFormat = nullptr; rExport.m_pAktPageDesc = &rExport.m_pDoc->GetPageDesc( 0 ); const SfxPoolItem* pI; const SwNode* pNd = rExport.m_pCurPam->GetContentNode(); - const SfxItemSet* pSet = pNd ? &static_cast<const SwContentNode*>(pNd)->GetSwAttrSet() : 0; + const SfxItemSet* pSet = pNd ? &static_cast<const SwContentNode*>(pNd)->GetSwAttrSet() : nullptr; sal_uLong nRstLnNum = pSet ? static_cast<const SwFormatLineNumber&>(pSet->Get( RES_LINENUMBER )).GetStartValue() : 0; @@ -979,7 +979,7 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport ) pSet = &pTableNd->GetTable().GetFrameFormat()->GetAttrSet(); pNd = pTableNd; } - else if (pNd && 0 != ( pSectNd = pNd->FindSectionNode() )) + else if (pNd && nullptr != ( pSectNd = pNd->FindSectionNode() )) { if ( TOX_HEADER_SECTION == pSectNd->GetSection().GetType() && pSectNd->StartOfSectionNode()->IsSectionNode() ) @@ -1011,7 +1011,7 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport ) WW8_WrPlcSepx::WW8_WrPlcSepx( MSWordExportBase& rExport ) : MSWordSections( rExport ) , m_bHeaderFooterWritten( false ) - , pTextPos( 0 ) + , pTextPos( nullptr ) { // to be in sync with the AppendSection() call in the MSWordSections // constructor @@ -1076,7 +1076,7 @@ const WW8_SepInfo* MSWordSections::CurrentSectionInfo() if ( !aSects.empty() ) return &aSects.back(); - return NULL; + return nullptr; } void MSWordSections::AppendSection( const SwPageDesc* pPd, @@ -1085,7 +1085,7 @@ void MSWordSections::AppendSection( const SwPageDesc* pPd, if (HeaderFooterWritten()) { return; // #i117955# prevent new sections in endnotes } - aSects.push_back( WW8_SepInfo( pPd, pSectionFormat, nLnNumRestartNo, boost::none, NULL, bIsFirstParagraph ) ); + aSects.push_back( WW8_SepInfo( pPd, pSectionFormat, nLnNumRestartNo, boost::none, nullptr, bIsFirstParagraph ) ); NeedsDocumentProtected( aSects.back() ); } @@ -1738,7 +1738,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt */ const SwTextNode *pOldPageRoot = GetHdFtPageRoot(); - SetHdFtPageRoot( rSepInfo.pPDNd ? rSepInfo.pPDNd->GetTextNode() : 0 ); + SetHdFtPageRoot( rSepInfo.pPDNd ? rSepInfo.pPDNd->GetTextNode() : nullptr ); WriteHeadersFooters( nHeadFootFlags, *pPdFormat, *pPdLeftFormat, *pPdFirstPgFormat, nBreakCode ); @@ -1795,7 +1795,7 @@ bool WW8_WrPlcSepx::WriteKFText( WW8Export& rWrt ) rWrt.pFib->ccpHdr = nCpEnd - nCpStart; } else - delete pTextPos, pTextPos = 0; + delete pTextPos, pTextPos = nullptr; return rWrt.pFib->ccpHdr != 0; } @@ -1807,7 +1807,7 @@ void WW8_WrPlcSepx::WriteSepx( SvStream& rStrm ) const for (size_t i = 0; i < m_SectionAttributes.size(); i++) // all sections { WW8_PdAttrDesc *const pA = m_SectionAttributes[i].get(); - if (pA->m_nLen && pA->m_pData != 0) + if (pA->m_nLen && pA->m_pData != nullptr) { SVBT16 nL; pA->m_nSepxFcPos = rStrm.Tell(); @@ -1894,7 +1894,7 @@ void MSWordExportBase::WriteHeaderFooterText( const SwFormat& rFormat, bool bHea m_bOutKF = bOldKF; } else - pSttIdx = 0; + pSttIdx = nullptr; } if ( !pSttIdx ) @@ -1910,7 +1910,7 @@ void MSWordExportBase::WriteHeaderFooterText( const SwFormat& rFormat, bool bHea // WW8_WrPlcFootnoteEdn is the class for Footnotes and Endnotes WW8_WrPlcSubDoc::WW8_WrPlcSubDoc() - : pTextPos( 0 ) + : pTextPos( nullptr ) { } @@ -1941,7 +1941,7 @@ WW8_Annotation::WW8_Annotation(const SwPostItField* pPostIt, WW8_CP nRangeStart, WW8_Annotation::WW8_Annotation(const SwRedlineData* pRedline) : - mpRichText(0), + mpRichText(nullptr), maDateTime( DateTime::EMPTY ), m_nRangeStart(0), m_nRangeEnd(0) @@ -2031,7 +2031,7 @@ bool WW8_WrPlcSubDoc::WriteGenericText( WW8Export& rWrt, sal_uInt8 nTTyp, aCps.insert( aCps.begin()+i, nCP ); pTextPos->Append( nCP ); - if( aContent[ i ] != NULL ) + if( aContent[ i ] != nullptr ) { // is it an writer or sdr - textbox? const SdrObject& rObj = *static_cast<SdrObject const *>(aContent[ i ]); @@ -2307,7 +2307,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, pChn = &pChn->GetNext()->GetChain(); } } - if( NULL == pObj ) + if( nullptr == pObj ) { if (i < aSpareFormats.size() && aSpareFormats[i]) { @@ -2445,7 +2445,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, const std::vector<sal_uInt32>* WW8_WrPlcSubDoc::GetShapeIdArr() const { - return 0; + return nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index fd2b4eddc939..59effda72ba4 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -139,7 +139,7 @@ class WW8_WrFkp public: WW8_WrFkp(ePLCFT ePl, WW8_FC nStartFc); ~WW8_WrFkp(); - bool Append( WW8_FC nEndFc, sal_uInt16 nVarLen = 0, const sal_uInt8* pSprms = 0 ); + bool Append( WW8_FC nEndFc, sal_uInt16 nVarLen = 0, const sal_uInt8* pSprms = nullptr ); bool Combine(); void Write( SvStream& rStrm, SwWW8WrGrf& rGrf ); @@ -191,7 +191,7 @@ public: WW8_WrtBookmarks(); ~WW8_WrtBookmarks(); //! Add a new bookmark to the list OR add an end position to an existing bookmark. - void Append( WW8_CP nStartCp, const OUString& rNm, const ::sw::mark::IMark* pBkmk=NULL ); + void Append( WW8_CP nStartCp, const OUString& rNm, const ::sw::mark::IMark* pBkmk=nullptr ); //! Write out bookmarks to file. void Write( WW8Export& rWrt ); //! Move existing field marks from one position to another. @@ -209,7 +209,7 @@ WW8_WrtBookmarks::~WW8_WrtBookmarks() if (aItr->second) { delete aItr->second; - aItr->second = NULL; + aItr->second = nullptr; } } } @@ -303,7 +303,7 @@ void WW8_WrtBookmarks::MoveFieldMarks(WW8_CP nFrom, WW8_CP nTo) aItr->second->first = nTo; } aSttCps.insert(std::pair<long,BKMKCP*>(nTo,aItr->second)); - aItr->second = NULL; + aItr->second = nullptr; aRange = aSttCps.equal_range(nFrom); aItr = aRange.first; continue; @@ -538,8 +538,8 @@ void WW8Export::ExportDopTypography(WW8DopTypography &rTypo) }, }; - const i18n::ForbiddenCharacters *pForbidden = 0; - const i18n::ForbiddenCharacters *pUseMe = 0; + const i18n::ForbiddenCharacters *pForbidden = nullptr; + const i18n::ForbiddenCharacters *pUseMe = nullptr; sal_uInt8 nUseReserved=0; int nNoNeeded=0; /* @@ -566,7 +566,7 @@ void WW8Export::ExportDopTypography(WW8DopTypography &rTypo) for (rTypo.reserved1=8;rTypo.reserved1>0;rTypo.reserved1-=2) { - if (0 != (pForbidden = m_pDoc->getIDocumentSettingAccess().getForbiddenCharacters(rTypo.GetConvertedLang(), + if (nullptr != (pForbidden = m_pDoc->getIDocumentSettingAccess().getForbiddenCharacters(rTypo.GetConvertedLang(), false))) { int nIdx = (rTypo.reserved1-2)/2; @@ -642,7 +642,7 @@ void WW8Export::ExportDopTypography(WW8DopTypography &rTypo) // WW8_SwAttrIter::OutAttr() and WW8Export::OutputItemSet() const SfxPoolItem* MSWordExportBase::HasItem( sal_uInt16 nWhich ) const { - const SfxPoolItem* pItem=0; + const SfxPoolItem* pItem=nullptr; if (m_pISet) { // if write a EditEngine text, then the WhichIds are greater as @@ -650,14 +650,14 @@ const SfxPoolItem* MSWordExportBase::HasItem( sal_uInt16 nWhich ) const // EditEngine Range nWhich = sw::hack::GetSetWhichFromSwDocWhich(*m_pISet, *m_pDoc, nWhich); if (nWhich && SfxItemState::SET != m_pISet->GetItemState(nWhich, true, &pItem)) - pItem = 0; + pItem = nullptr; } else if( m_pChpIter ) pItem = m_pChpIter->HasTextItem( nWhich ); else { OSL_ENSURE( false, "Where is my ItemSet / pChpIter ?" ); - pItem = 0; + pItem = nullptr; } return pItem; } @@ -679,7 +679,7 @@ const SfxPoolItem& MSWordExportBase::GetItem(sal_uInt16 nWhich) const else { OSL_ENSURE( false, "Where is my ItemSet / pChpIter ?" ); - pItem = 0; + pItem = nullptr; } return *pItem; } @@ -784,7 +784,7 @@ bool WW8_WrPlcField::Write( WW8Export& rWrt ) break; default: - pfc = plc = 0; + pfc = plc = nullptr; break; } @@ -1026,7 +1026,7 @@ sal_uInt8 WW8_WrFkp::SearchSameSprm( sal_uInt16 nVarLen, const sal_uInt8* pSprms sal_uInt8 *WW8_WrFkp::CopyLastSprms(sal_uInt8 &rLen) { rLen=0; - sal_uInt8 *pStart=0,*pRet=0; + sal_uInt8 *pStart=nullptr,*pRet=nullptr; if (!bCombined) pStart = pOfs; @@ -1127,7 +1127,7 @@ bool WW8_WrFkp::Combine() if( nIMax ) memcpy( pFkp + ( nIMax + 1 ) * 4, pOfs, nIMax * nItemSize ); delete[] pOfs; - pOfs = 0; + pOfs = nullptr; pFkp[511] = nIMax; bCombined = true; @@ -1330,7 +1330,7 @@ void WW8Export::AppendBookmarks( const SwTextNode& rNd, sal_Int32 nAktPos, sal_I continue; const SwPosition* pPos = &rBkmk.GetMarkPos(); - const SwPosition* pOPos = 0; + const SwPosition* pOPos = nullptr; if(rBkmk.IsExpanded()) pOPos = &rBkmk.GetOtherMarkPos(); if( pOPos && pOPos->nNode == pPos->nNode && @@ -1405,7 +1405,7 @@ int MSWordExportBase::CollectGrfsOfBullets() { continue; } - const Graphic *pGraf = rFormat.GetBrush()? rFormat.GetBrush()->GetGraphic():0; + const Graphic *pGraf = rFormat.GetBrush()? rFormat.GetBrush()->GetGraphic():nullptr; if ( pGraf ) { bool bHas = false; @@ -1730,7 +1730,7 @@ void WW8Export::OutSwString(const OUString& rStr, sal_Int32 nStt, void WW8Export::WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) { - if (pTableTextNodeInfoInner.get() != NULL && pTableTextNodeInfoInner->getDepth() == 1 && pTableTextNodeInfoInner->isEndOfCell()) + if (pTableTextNodeInfoInner.get() != nullptr && pTableTextNodeInfoInner->getDepth() == 1 && pTableTextNodeInfoInner->isEndOfCell()) WriteChar('\007'); else WriteChar( '\015' ); @@ -1765,7 +1765,7 @@ void MSWordExportBase::SaveData( sal_uLong nStt, sal_uLong nEnd ) MSWordSaveData aData; // WW8Export only stuff - zeroed here not to issue warnings - aData.pOOld = NULL; + aData.pOOld = nullptr; // Common stuff aData.pOldPam = m_pCurPam; @@ -1828,7 +1828,7 @@ void WW8Export::SaveData( sal_uLong nStt, sal_uLong nEnd ) pO = new ww::bytes(); } else - rData.pOOld = 0; // reuse pO + rData.pOOld = nullptr; // reuse pO rData.bOldWriteAll = GetWriter().bWriteAll; GetWriter().bWriteAll = true; @@ -1922,7 +1922,7 @@ static sal_uInt16 lcl_TCFlags(SwDoc &rDoc, const SwTableBox * pBox, sal_Int32 nR else if (nRowSpan < 0) nFlags |= (1 << 5); - if (pBox != NULL) + if (pBox != nullptr) { const SwFrameFormat * pFormat = pBox->GetFrameFormat(); switch (pFormat->GetVertOrient().GetVertOrient()) @@ -2094,7 +2094,7 @@ void WW8AttributeOutput::TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTab // Writing these SPRM's will make the table a floating one, so only write // them in case the table is already inside a frame. - if (pTableFormat != NULL && pTable->GetTableNode()->GetFlyFormat()) + if (pTableFormat != nullptr && pTable->GetTableNode()->GetFlyFormat()) { const SvxULSpaceItem & rUL = pTableFormat->GetULSpace(); @@ -2209,8 +2209,8 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t sal_uInt16 npOCount = m_rWW8Export.pO->size(); const SwTableBox * pTabBox1 = *aIt; - const SwFrameFormat * pBoxFormat = NULL; - if (pTabBox1 != NULL) + const SwFrameFormat * pBoxFormat = nullptr; + if (pTabBox1 != nullptr) pBoxFormat = pTabBox1->GetFrameFormat(); sal_uInt16 nFlags = @@ -2220,14 +2220,14 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t static sal_uInt8 aNullBytes[] = { 0x0, 0x0 }; m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), aNullBytes, aNullBytes+2 ); // dummy - if (pBoxFormat != NULL) + if (pBoxFormat != nullptr) { const SvxBoxItem & rBoxItem = pBoxFormat->GetBox(); WW8Export::Out_SwFormatTableBox( *m_rWW8Export.pO, &rBoxItem ); // 8/16 Byte } else - WW8Export::Out_SwFormatTableBox( *m_rWW8Export.pO, NULL); // 8/16 Byte + WW8Export::Out_SwFormatTableBox( *m_rWW8Export.pO, nullptr); // 8/16 Byte SAL_INFO( "sw.ww8.level2", "<tclength>" << ( m_rWW8Export.pO->size() - npOCount ) << "</tclength>" ); } @@ -2351,14 +2351,14 @@ void WW8AttributeOutput::TableCellBorders( const SwTableLine * pTabLine = pTabBox->GetUpper(); const SwTableBoxes & rTabBoxes = pTabLine->GetTabBoxes(); sal_uInt8 nBoxes = std::min<size_t>(rTabBoxes.size(), 255); - const SvxBoxItem * pLastBox = 0; + const SvxBoxItem * pLastBox = nullptr; sal_uInt8 nSeqStart = 0; // start of sequence of cells with same borders // Detect sequences of cells which have the same borders, and output // a border description for each such cell range. for ( unsigned n = 0; n <= nBoxes; ++n ) { - const SvxBoxItem * pBox = (n == nBoxes) ? 0 : + const SvxBoxItem * pBox = (n == nBoxes) ? nullptr : &rTabBoxes[n]->GetFrameFormat()->GetBox(); if( !pLastBox ) pLastBox = pBox; @@ -2387,7 +2387,7 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t { const SwTableBox * pBox1 = rTabBoxes[n]; const SwFrameFormat * pFrameFormat = pBox1->GetFrameFormat(); - const SfxPoolItem * pI = NULL; + const SfxPoolItem * pI = nullptr; Color aColor; if ( SfxItemState::SET == pFrameFormat->GetAttrSet().GetItemState( RES_BACKGROUND, false, &pI ) ) @@ -2417,7 +2417,7 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t { const SwTableBox * pBox1 = rTabBoxes[n]; const SwFrameFormat * pFrameFormat = pBox1->GetFrameFormat(); - const SfxPoolItem * pI = NULL; + const SfxPoolItem * pI = nullptr; Color aColor; if ( SfxItemState::SET == @@ -2542,7 +2542,7 @@ void MSWordExportBase::WriteText() SwTextNode *pTempNext = aIdx.GetNode().GetTextNode(); if ( pTempNext ) { - const SfxPoolItem * pTempItem = NULL; + const SfxPoolItem * pTempItem = nullptr; if (pTempNext->GetpSwAttrSet() && SfxItemState::SET == pTempNext->GetpSwAttrSet()->GetItemState(RES_PAGEDESC, false, &pTempItem) && pTempItem && static_cast<const SwFormatPageDesc*>(pTempItem)->GetRegisteredIn()) { @@ -2602,10 +2602,10 @@ void MSWordExportBase::WriteText() if (pCurrentNode == pNextNode) { SAL_WARN("sw.ww8", "loop in TableInfo"); - pNextNode = NULL; + pNextNode = nullptr; } - if (pNextNode != NULL) + if (pNextNode != nullptr) m_pCurPam->GetPoint()->nNode = SwNodeIndex(*pNextNode); else ++m_pCurPam->GetPoint()->nNode; @@ -2649,15 +2649,15 @@ bool MSWordExportBase::IsInTable() const { bool bResult = false; - if (m_pCurPam != NULL) + if (m_pCurPam != nullptr) { SwNode& rNode = m_pCurPam->GetNode(); - if (m_pTableInfo.get() != NULL) + if (m_pTableInfo.get() != nullptr) { ww8::WW8TableNodeInfo::Pointer_t pTableNodeInfo = m_pTableInfo->getTableNodeInfo(&rNode); - if (pTableNodeInfo.get() != NULL && pTableNodeInfo->getDepth() > 0) + if (pTableNodeInfo.get() != nullptr && pTableNodeInfo->getDepth() > 0) { bResult = true; } @@ -2928,16 +2928,16 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) m_bFootnoteAtTextEnd = m_bEndAtTextEnd = true; - m_pParentFrame = 0; - m_pFlyOffset = 0; + m_pParentFrame = nullptr; + m_pFlyOffset = nullptr; m_eNewAnchorType = FLY_AT_PAGE; m_nTextTyp = TXT_MAINTEXT; m_nStyleBeforeFly = m_nLastFormatId = 0; - m_pStyAttr = 0; - m_pCurrentStyle = NULL; - m_pOutFormatNode = 0; - m_pEscher = 0; - m_pRedlAuthors = 0; + m_pStyAttr = nullptr; + m_pCurrentStyle = nullptr; + m_pOutFormatNode = nullptr; + m_pEscher = nullptr; + m_pRedlAuthors = nullptr; m_aTOXArr.clear(); if ( !m_pOLEExp ) @@ -2960,7 +2960,7 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) m_pOCXExp = new SwMSConvertControls( m_pDoc->GetDocShell(), m_pCurPam ); // #i81405# - Collect anchored objects before changing the redline mode. - m_aFrames = GetFrames( *m_pDoc, bWriteAll? NULL : m_pOrigPam ); + m_aFrames = GetFrames( *m_pDoc, bWriteAll? nullptr : m_pOrigPam ); m_nOrigRedlineMode = m_pDoc->getIDocumentRedlineAccess().GetRedlineMode(); if ( !m_pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() ) @@ -3214,7 +3214,7 @@ void WW8Export::ExportDocument_Impl() delete m_pPiece; delete pDop; delete pFib; - GetWriter().SetStream( 0 ); + GetWriter().SetStream( nullptr ); xWwStrm->SetBufferSize( 0 ); xTableStrm->SetBufferSize( 0 ); @@ -3222,7 +3222,7 @@ void WW8Export::ExportDocument_Impl() if( 0 == pDataStrm->Seek( STREAM_SEEK_TO_END )) { xDataStrm.Clear(); - pDataStrm = 0; + pDataStrm = nullptr; GetWriter().GetStorage().Remove(OUString(SL::aData)); } } @@ -3294,7 +3294,7 @@ sal_uLong SwWW8Writer::WriteStorage() { // #i34818# - update layout (if present), for SwWriteTable SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); - if( pViewShell != NULL ) + if( pViewShell != nullptr ) pViewShell->CalcLayout(); long nMaxNode = pDoc->GetNodes().Count(); @@ -3314,7 +3314,7 @@ sal_uLong SwWW8Writer::WriteStorage() WW8Export aExport(this, pDoc, pCurPam, pOrigPam, bDot); m_pExport = &aExport; aExport.ExportDocument( bWriteAll ); - m_pExport = NULL; + m_pExport = nullptr; } ::EndProgress( pDoc->GetDocShell() ); @@ -3331,20 +3331,20 @@ sal_uLong SwWW8Writer::Write( SwPaM& rPaM, SfxMedium& rMed, { mpMedium = &rMed; sal_uLong nRet = StgWriter::Write( rPaM, rMed, pFileName ); - mpMedium = NULL; + mpMedium = nullptr; return nRet; } MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam ) : m_aMainStg(sMainStream) - , m_pISet(0) - , m_pPiece(NULL) - , m_pUsedNumTable(0) - , m_pTopNodeOfHdFtPage(0) - , m_pBkmks(0) - , m_pRedlAuthors(0) - , m_pOLEExp(0) - , m_pOCXExp(0) + , m_pISet(nullptr) + , m_pPiece(nullptr) + , m_pUsedNumTable(nullptr) + , m_pTopNodeOfHdFtPage(nullptr) + , m_pBkmks(nullptr) + , m_pRedlAuthors(nullptr) + , m_pOLEExp(nullptr) + , m_pOCXExp(nullptr) , m_pTableInfo(new ww8::WW8TableInfo()) , m_nCharFormatStart(0) , m_nFormatCollStart(0) @@ -3353,33 +3353,33 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM , m_nUniqueList(0) , m_nHdFtIndex(0) , m_nOrigRedlineMode(0) - , m_pAktPageDesc(0) + , m_pAktPageDesc(nullptr) , m_bPrevTextNodeIsEmpty(false) - , m_pPapPlc(0) - , m_pChpPlc(0) - , m_pChpIter(0) - , m_pStyles(NULL) - , m_pAtn(0) - , m_pTextBxs(0) - , m_pHFTextBxs(0) - , m_pParentFrame(0) - , m_pFlyOffset(0) + , m_pPapPlc(nullptr) + , m_pChpPlc(nullptr) + , m_pChpIter(nullptr) + , m_pStyles(nullptr) + , m_pAtn(nullptr) + , m_pTextBxs(nullptr) + , m_pHFTextBxs(nullptr) + , m_pParentFrame(nullptr) + , m_pFlyOffset(nullptr) , m_eNewAnchorType(FLY_AS_CHAR) - , m_pFieldMain(0) - , m_pFieldHdFt(0) - , m_pFieldFootnote(0) - , m_pFieldEdn(0) - , m_pFieldAtn(0) - , m_pFieldTextBxs(0) - , m_pFieldHFTextBxs(0) - , m_pMagicTable(0) - , m_pGrf(0) - , m_pStyAttr(0) - , m_pOutFormatNode(0) - , m_pCurrentStyle(0) - , m_pSdrObjs(0) - , m_pHFSdrObjs(0) - , m_pEscher(0) + , m_pFieldMain(nullptr) + , m_pFieldHdFt(nullptr) + , m_pFieldFootnote(nullptr) + , m_pFieldEdn(nullptr) + , m_pFieldAtn(nullptr) + , m_pFieldTextBxs(nullptr) + , m_pFieldHFTextBxs(nullptr) + , m_pMagicTable(nullptr) + , m_pGrf(nullptr) + , m_pStyAttr(nullptr) + , m_pOutFormatNode(nullptr) + , m_pCurrentStyle(nullptr) + , m_pSdrObjs(nullptr) + , m_pHFSdrObjs(nullptr) + , m_pEscher(nullptr) , m_nTextTyp(0) , m_bStyDef(false) , m_bBreakBefore(false) @@ -3419,14 +3419,14 @@ WW8Export::WW8Export( SwWW8Writer *pWriter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, bool bDot ) : MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ) - , pO(NULL) - , pTableStrm(NULL) - , pDataStrm(NULL) - , pFib(NULL) - , pDop(NULL) - , pFootnote(NULL) - , pEdn(NULL) - , pSepx(NULL) + , pO(nullptr) + , pTableStrm(nullptr) + , pDataStrm(nullptr) + , pFib(nullptr) + , pDop(nullptr) + , pFootnote(nullptr) + , pEdn(nullptr) + , pSepx(nullptr) , m_bDot(bDot) , m_pWriter(pWriter) , m_pAttrOutput(new WW8AttributeOutput(*this)) @@ -3435,7 +3435,7 @@ WW8Export::WW8Export( SwWW8Writer *pWriter, WW8Export::~WW8Export() { - delete m_pAttrOutput, m_pAttrOutput = NULL; + delete m_pAttrOutput, m_pAttrOutput = nullptr; } AttributeOutputBase& WW8Export::AttrOutput() const @@ -3450,8 +3450,8 @@ MSWordSections& WW8Export::Sections() const SwWW8Writer::SwWW8Writer(const OUString& rFltName, const OUString& rBaseURL) : StgWriter(), - m_pExport( NULL ), - mpMedium( 0 ) + m_pExport( nullptr ), + mpMedium( nullptr ) { assert(rFltName == FILTER_WW8); // WW6/7 export was removed (void)rFltName; @@ -3767,7 +3767,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer if (nShadowsBefore > 0) { ww8::WW8TableNodeInfoInner::Pointer_t - pTmpNodeInfoInner(new ww8::WW8TableNodeInfoInner(NULL)); + pTmpNodeInfoInner(new ww8::WW8TableNodeInfoInner(nullptr)); pTmpNodeInfoInner->setDepth(pNodeInfoInner->getDepth()); pTmpNodeInfoInner->setEndOfCell(true); @@ -3802,7 +3802,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer if (nShadowsAfter > 0) { ww8::WW8TableNodeInfoInner::Pointer_t - pTmpNodeInfoInner(new ww8::WW8TableNodeInfoInner(NULL)); + pTmpNodeInfoInner(new ww8::WW8TableNodeInfoInner(nullptr)); pTmpNodeInfoInner->setDepth(pNodeInfoInner->getDepth()); pTmpNodeInfoInner->setEndOfCell(true); @@ -3841,7 +3841,7 @@ void MSWordExportBase::OutputStartNode( const SwStartNode & rNode) ww8::WW8TableNodeInfo::Pointer_t pNodeInfo = m_pTableInfo->getTableNodeInfo( &rNode ); - if (pNodeInfo.get() != NULL) + if (pNodeInfo.get() != nullptr) { #ifdef DBG_UTIL SAL_INFO( "sw.ww8", pNodeInfo->toString()); @@ -3868,7 +3868,7 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) ww8::WW8TableNodeInfo::Pointer_t pNodeInfo = m_pTableInfo->getTableNodeInfo( &rNode ); - if (pNodeInfo.get() != NULL) + if (pNodeInfo.get() != nullptr) { #ifdef DBG_UTIL SAL_INFO( "sw.ww8", pNodeInfo->toString()); @@ -3889,7 +3889,7 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) const NfKeywordTable & MSWordExportBase::GetNfKeywordTable() { - if (m_pKeyMap.get() == NULL) + if (m_pKeyMap.get() == nullptr) { m_pKeyMap.reset(new NfKeywordTable); NfKeywordTable & rKeywordTable = *m_pKeyMap; diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index aaadd8e08c0d..1d835b0633aa 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -170,13 +170,13 @@ struct WW8_SepInfo bool bIsFirstParagraph; WW8_SepInfo() - : pPageDesc(0), pSectionFormat(0), pPDNd(0), nLnNumRestartNo(0), bIsFirstParagraph(false) + : pPageDesc(nullptr), pSectionFormat(nullptr), pPDNd(nullptr), nLnNumRestartNo(0), bIsFirstParagraph(false) {} WW8_SepInfo( const SwPageDesc* pPD, const SwSectionFormat* pFormat, sal_uLong nLnRestart, ::boost::optional<sal_uInt16> oPgRestart = boost::none, - const SwNode* pNd = NULL, bool bIsFirstPara = false ) + const SwNode* pNd = nullptr, bool bIsFirstPara = false ) : pPageDesc( pPD ), pSectionFormat( pFormat ), pPDNd( pNd ), nLnNumRestartNo( nLnRestart ), oPgRestartNo( oPgRestart ), bIsFirstParagraph( bIsFirstPara ) @@ -206,7 +206,7 @@ public: virtual bool HeaderFooterWritten(); void AppendSection( const SwPageDesc* pPd, - const SwSectionFormat* pSectionFormat = 0, + const SwSectionFormat* pSectionFormat = nullptr, sal_uLong nLnNumRestartNo = 0, bool bIsFirstParagraph = false ); void AppendSection( const SwFormatPageDesc& rPd, @@ -253,7 +253,7 @@ public: void AppendSep( WW8_CP nStartCp, const SwPageDesc* pPd, - const SwSectionFormat* pSectionFormat = 0, + const SwSectionFormat* pSectionFormat = nullptr, sal_uLong nLnNumRestartNo = 0 ); void AppendSep( WW8_CP nStartCp, const SwFormatPageDesc& rPd, const SwNode& rNd, @@ -724,7 +724,7 @@ public: /// Write section properties. /// /// pA is ignored for docx. - void SectionProperties( const WW8_SepInfo& rSectionInfo, WW8_PdAttrDesc* pA = NULL ); + void SectionProperties( const WW8_SepInfo& rSectionInfo, WW8_PdAttrDesc* pA = nullptr ); /// Output the numbering table. virtual void WriteNumbering() = 0; @@ -808,8 +808,8 @@ protected: virtual void PrepareNewPageDesc( const SfxItemSet* pSet, const SwNode& rNd, - const SwFormatPageDesc* pNewPgDescFormat = 0, - const SwPageDesc* pNewPgDesc = 0 ) = 0; + const SwFormatPageDesc* pNewPgDescFormat = nullptr, + const SwPageDesc* pNewPgDesc = nullptr ) = 0; /// Return value indicates if an inherited outline numbering is suppressed. virtual bool DisallowInheritingOutlineNumbering(const SwFormat &rFormat) = 0; @@ -929,7 +929,7 @@ public: bool InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec ); using StgWriter::Write; - virtual sal_uLong Write( SwPaM&, SfxMedium&, const OUString* = 0 ) override; + virtual sal_uLong Write( SwPaM&, SfxMedium&, const OUString* = nullptr ) override; //Seems not an expected to provide method to access the private member SfxMedium* GetMedia() { return mpMedium; } @@ -1009,8 +1009,8 @@ public: sal_uInt16 AddRedlineAuthor( sal_uInt16 nId ); - void WriteFootnoteBegin( const SwFormatFootnote& rFootnote, ww::bytes* pO = 0 ); - void WritePostItBegin( ww::bytes* pO = 0 ); + void WriteFootnoteBegin( const SwFormatFootnote& rFootnote, ww::bytes* pO = nullptr ); + void WritePostItBegin( ww::bytes* pO = nullptr ); const SvxBrushItem* GetCurrentPageBgBrush() const; SvxBrushItem TrueFrameBgBrush(const SwFrameFormat &rFlyFormat) const; @@ -1065,8 +1065,8 @@ public: // #i76300# virtual void PrepareNewPageDesc( const SfxItemSet* pSet, const SwNode& rNd, - const SwFormatPageDesc* pNewPgDescFormat = 0, - const SwPageDesc* pNewPgDesc = 0 ) override; + const SwFormatPageDesc* pNewPgDescFormat = nullptr, + const SwPageDesc* pNewPgDesc = nullptr ) override; static void Out_BorderLine(ww::bytes& rO, const ::editeng::SvxBorderLine* pLine, sal_uInt16 nDist, sal_uInt16 nSprmNo, sal_uInt16 nSprmNoVer9, @@ -1267,7 +1267,7 @@ private: public: WW8_WrPlcPn( WW8Export& rWrt, ePLCFT ePl, WW8_FC nStartFc ); ~WW8_WrPlcPn(); - void AppendFkpEntry(WW8_FC nEndFc,short nVarLen = 0,const sal_uInt8* pSprms = 0); + void AppendFkpEntry(WW8_FC nEndFc,short nVarLen = 0,const sal_uInt8* pSprms = nullptr); void WriteFkps(); void WritePlc(); sal_uInt8 *CopyLastSprms(sal_uInt8 &rLen); @@ -1359,7 +1359,7 @@ private: static void WritePICFHeader(SvStream& rStrm, const sw::Frame &rFly, sal_uInt16 mm, sal_uInt16 nWidth, sal_uInt16 nHeight, - const SwAttrSet* pAttrSet = 0); + const SwAttrSet* pAttrSet = nullptr); void WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem); void WriteGrfFromGrfNode(SvStream& rStrm, const SwGrfNode &rNd, const sw::Frame &rFly, sal_uInt16 nWidth, sal_uInt16 nHeight); @@ -1423,7 +1423,7 @@ public: MSWord_SdrAttrIter( MSWordExportBase& rWr, const EditTextObject& rEditObj, sal_uInt8 nType ); void NextPara( sal_Int32 nPar ); - void OutParaAttr(bool bCharAttr, const std::set<sal_uInt16>* pWhichsToIgnore = NULL); + void OutParaAttr(bool bCharAttr, const std::set<sal_uInt16>* pWhichsToIgnore = nullptr); void OutEEField(const SfxPoolItem& rHt); bool IsTextAttr(sal_Int32 nSwPos); diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index 56ed88c90ee8..bf252de0137f 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -118,7 +118,7 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet, bGraphicNeeded = true; } } while( !bGraphicNeeded && !aIter.IsAtEnd() && - 0 != ( pItem = aIter.NextItem() ) ); + nullptr != ( pItem = aIter.NextItem() ) ); /* Now we must see if the object contains a preview itself which is equal to @@ -141,14 +141,14 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet, if ( pOLENd ) nAspect = pOLENd->GetAspect(); SdrOle2Obj *pRet = SvxMSDffManager::CreateSdrOLEFromStorage( - rStorageName,xObjStg,m_pDoc->GetDocStorage(),aGraph,aRect,aVisArea,0,nErr,0,nAspect); + rStorageName,xObjStg,m_pDoc->GetDocStorage(),aGraph,aRect,aVisArea,nullptr,nErr,0,nAspect); if (pRet) { uno::Reference< embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef(); if ( xObj.is() ) { - SvStream* pGraphicStream = NULL; + SvStream* pGraphicStream = nullptr; comphelper::EmbeddedObjectContainer aCnt( m_pDoc->GetDocStorage() ); try { @@ -263,7 +263,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode ) // in the escher export OUString sServer = FieldString(ww::eEMBED) + xOleStg->GetUserName() + " "; - OutputField(0, ww::eEMBED, sServer, WRITEFIELD_START | + OutputField(nullptr, ww::eEMBED, sServer, WRITEFIELD_START | WRITEFIELD_CMD_START | WRITEFIELD_CMD_END); m_pChpPlc->AppendFkpEntry( Strm().Tell(), @@ -309,7 +309,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode ) OutGrf(*m_pParentFrame); } - OutputField(0, ww::eEMBED, OUString(), + OutputField(nullptr, ww::eEMBED, OUString(), WRITEFIELD_END | WRITEFIELD_CLOSE); if (bEndCR) //No newline in inline case @@ -379,7 +379,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame) // #i29408# // linked, as-character anchored graphics have to be exported as fields. const SwGrfNode* pGrfNd = rFrame.IsInline() && rFrame.GetContent() - ? rFrame.GetContent()->GetGrfNode() : 0; + ? rFrame.GetContent()->GetGrfNode() : nullptr; if ( pGrfNd && pGrfNd->IsLinkedFile() ) { OUString sStr( FieldString(ww::eINCLUDEPICTURE) ); @@ -388,13 +388,13 @@ void WW8Export::OutGrf(const sw::Frame &rFrame) if ( pGrfNd ) { OUString aFileURL; - pGrfNd->GetFileFilterNms( &aFileURL, 0 ); + pGrfNd->GetFileFilterNms( &aFileURL, nullptr ); sStr += aFileURL; } } sStr += "\" \\d"; - OutputField( 0, ww::eINCLUDEPICTURE, sStr, + OutputField( nullptr, ww::eINCLUDEPICTURE, sStr, WRITEFIELD_START | WRITEFIELD_CMD_START | WRITEFIELD_CMD_END ); } @@ -473,7 +473,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame) // linked, as-character anchored graphics have to be exported as fields. else if ( pGrfNd && pGrfNd->IsLinkedFile() ) { - OutputField( 0, ww::eINCLUDEPICTURE, OUString(), WRITEFIELD_CLOSE ); + OutputField( nullptr, ww::eINCLUDEPICTURE, OUString(), WRITEFIELD_CLOSE ); } //Added for i120568,the hyperlink info within a graphic whose anchor type is //"As character" will be exported to ensure the fidelity @@ -659,7 +659,7 @@ void SwWW8WrGrf::WriteGrfFromGrfNode(SvStream& rStrm, const SwGrfNode &rGrfNd, if (rGrfNd.IsLinkedFile()) // Linked File { OUString aFileN; - rGrfNd.GetFileFilterNms( &aFileN, 0 ); + rGrfNd.GetFileFilterNms( &aFileN, nullptr ); sal_uInt16 mm = 94; // 94 = BMP, GIF @@ -786,7 +786,7 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem) case sw::Frame::eGraphic: { const SwNode *pNode = rItem.maFly.GetContent(); - const SwGrfNode *pNd = pNode ? pNode->GetGrfNode() : 0; + const SwGrfNode *pNd = pNode ? pNode->GetGrfNode() : nullptr; OSL_ENSURE(pNd, "Impossible"); if (pNd) WriteGrfFromGrfNode(rStrm, *pNd, rItem.maFly, nWidth, nHeight); @@ -806,7 +806,7 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem) case sw::Frame::eOle: { const SwNode *pNode = rItem.maFly.GetContent(); - const SwOLENode *pNd = pNode ? pNode->GetOLENode() : 0; + const SwOLENode *pNd = pNode ? pNode->GetOLENode() : nullptr; OSL_ENSURE(pNd, "Impossible"); if (pNd) { diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 22249f1c17ea..9f0ca1765dec 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -244,7 +244,7 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFormat, b // No explicit adjust set ? if ( SfxItemState::SET != rSet.GetItemState( RES_PARATR_ADJUST, bExportParentItemSet ) ) { - if ( 0 != ( pItem = rSet.GetItem( RES_PARATR_ADJUST, bExportParentItemSet ) ) ) + if ( nullptr != ( pItem = rSet.GetItem( RES_PARATR_ADJUST, bExportParentItemSet ) ) ) { // then set the adjust used by the parent format AttrOutput().OutputItem( *pItem ); @@ -291,7 +291,7 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFormat, b AttrOutput().OutputItem(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND)); } } - m_pISet = 0; // fuer Doppel-Attribute + m_pISet = nullptr; // fuer Doppel-Attribute } } @@ -340,7 +340,7 @@ bool MSWordExportBase::FormatHdFtContainsChapterField(const SwFrameFormat &rForm if ( m_aChapterFieldLocs.empty() ) return false; - const SwFrameFormat *pFormat = 0; + const SwFrameFormat *pFormat = nullptr; pFormat = rFormat.GetHeader().GetHeaderFormat(); if ( pFormat && ContentContainsChapterField( pFormat->GetContent() ) ) @@ -397,8 +397,8 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode m_bBreakBefore = true; bool bNewPageDesc = false; - const SfxPoolItem* pItem=0; - const SwFormatPageDesc *pPgDesc=0; + const SfxPoolItem* pItem=nullptr; + const SwFormatPageDesc *pPgDesc=nullptr; //Output a sectionbreak if theres a new pagedesciptor. otherwise output a //pagebreak if there is a pagebreak here, unless the new page (follow @@ -429,7 +429,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode * set pSet to NULL as we don't want to add any section breaks. */ if ( isCellOpen && ( m_pAktPageDesc->GetName() != pPageDesc->GetName() ) ) - pSet = NULL; + pSet = nullptr; } else if (!sw::util::IsPlausableSingleWordSection(m_pAktPageDesc->GetFirstMaster(), pPageDesc->GetMaster())) { @@ -442,7 +442,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode if ( pSet && pSet->Count() ) { if ( SfxItemState::SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem ) && - static_cast<const SwFormatPageDesc*>(pItem)->GetRegisteredIn() != NULL) + static_cast<const SwFormatPageDesc*>(pItem)->GetRegisteredIn() != nullptr) { bBreakSet = true; bNewPageDesc = true; @@ -459,7 +459,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode if ( pTableNode ) { const SwTableBox* pBox = rNd.GetTableBox(); - const SwTableLine* pLine = pBox ? pBox->GetUpper() : 0; + const SwTableLine* pLine = pBox ? pBox->GetUpper() : nullptr; // but only for non-complex tables if ( pLine && !pLine->GetUpper() ) { @@ -554,7 +554,7 @@ bool MSWordExportBase::OutputFollowPageDesc( const SfxItemSet* pSet, const SwTex m_pAktPageDesc && m_pAktPageDesc != m_pAktPageDesc->GetFollow() ) { - PrepareNewPageDesc( pSet, *pNd, 0, m_pAktPageDesc->GetFollow() ); + PrepareNewPageDesc( pSet, *pNd, nullptr, m_pAktPageDesc->GetFollow() ); bRet = true; } @@ -563,7 +563,7 @@ bool MSWordExportBase::OutputFollowPageDesc( const SfxItemSet* pSet, const SwTex const SwSectionFormat* MSWordExportBase::GetSectionFormat( const SwNode& rNd ) { - const SwSectionFormat* pFormat = NULL; + const SwSectionFormat* pFormat = nullptr; const SwSectionNode* pSect = rNd.FindSectionNode(); if ( pSect && CONTENT_SECTION == pSect->GetSection().GetType() ) @@ -576,7 +576,7 @@ const SwSectionFormat* MSWordExportBase::GetSectionFormat( const SwNode& rNd ) sal_uLong MSWordExportBase::GetSectionLineNo( const SfxItemSet* pSet, const SwNode& rNd ) { - const SwFormatLineNumber* pNItem = 0; + const SwFormatLineNumber* pNItem = nullptr; if ( pSet ) { pNItem = &( ItemGet<SwFormatLineNumber>( *pSet, RES_LINENUMBER ) ); @@ -854,7 +854,7 @@ bool MSWordExportBase::HasRefToObject( sal_uInt16 nTyp, const OUString* pName, s { const SwTextNode* pNd = pFormatField->GetTextField()->GetpTextNode(); if ( pFormatField->GetTextField() && nTyp == pFormatField->GetField()->GetSubType() && - 0 != pNd && pNd->GetNodes().IsDocNodes() ) + nullptr != pNd && pNd->GetNodes().IsDocNodes() ) { const SwGetRefField& rRField = *static_cast< SwGetRefField* >( pFormatField->GetField() ); switch ( nTyp ) @@ -939,7 +939,7 @@ void WW8AttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTe mbOnTOXEnding = false; m_rWW8Export.pO->clear(); - if ( pTextNodeInfoInner.get() != NULL ) + if ( pTextNodeInfoInner.get() != nullptr ) { if ( pTextNodeInfoInner->isEndOfLine() ) { @@ -1549,7 +1549,7 @@ void WW8AttributeOutput::TextINetFormat( const SwFormatINetFormat& rINet ) // add optional parameter <bIncludeEmptyPicLocation> // It is needed to write an empty picture location for page number field separators static void InsertSpecialChar( WW8Export& rWrt, sal_uInt8 c, - OUString* pLinkStr = 0L, + OUString* pLinkStr = nullptr, bool bIncludeEmptyPicLocation = false ) { ww::bytes aItems; @@ -1636,7 +1636,7 @@ static OUString lcl_GetExpandedField(const SwField &rField) WW8_WrPlcField* WW8Export::CurrentFieldPlc() const { - WW8_WrPlcField* pFieldP = NULL; + WW8_WrPlcField* pFieldP = nullptr; switch (m_nTextTyp) { case TXT_MAINTEXT: @@ -1701,7 +1701,7 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType, aField13[0] |= 0x80; aField13[1] = static_cast< sal_uInt8 >(eFieldType); // Typ nachtragen pFieldP->Append( Fc2Cp( Strm().Tell() ), aField13 ); - InsertSpecialChar( *this, 0x13, 0, bIncludeEmptyPicLocation ); + InsertSpecialChar( *this, 0x13, nullptr, bIncludeEmptyPicLocation ); } if (WRITEFIELD_CMD_START & nMode) { @@ -1733,7 +1733,7 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType, else if ( nSubType == REF_FOOTNOTE || nSubType == REF_ENDNOTE ) { - aLinkStr = GetBookmarkName( nSubType, 0, rRField.GetSeqNo() ); + aLinkStr = GetBookmarkName( nSubType, nullptr, rRField.GetSeqNo() ); } else if ( nSubType == REF_SEQUENCEFLD ) { @@ -1748,7 +1748,7 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType, static const sal_uInt8 aField14[2] = { 0x14, 0xff }; pFieldP->Append( Fc2Cp( Strm().Tell() ), aField14 ); pFieldP->ResultAdded(); - InsertSpecialChar( *this, 0x14, 0, bIncludeEmptyPicLocation ); + InsertSpecialChar( *this, 0x14, nullptr, bIncludeEmptyPicLocation ); } if (WRITEFIELD_END & nMode) { @@ -1800,7 +1800,7 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType, } pFieldP->Append( Fc2Cp( Strm().Tell() ), aField15 ); - InsertSpecialChar( *this, 0x15, 0, bIncludeEmptyPicLocation ); + InsertSpecialChar( *this, 0x15, nullptr, bIncludeEmptyPicLocation ); } } @@ -1808,14 +1808,14 @@ void WW8Export::StartCommentOutput(const OUString& rName) { OUString sStr(FieldString(ww::eQUOTE)); sStr += "[" + rName + "] "; - OutputField(0, ww::eQUOTE, sStr, WRITEFIELD_START | WRITEFIELD_CMD_START); + OutputField(nullptr, ww::eQUOTE, sStr, WRITEFIELD_START | WRITEFIELD_CMD_START); } void WW8Export::EndCommentOutput(const OUString& rName) { OUString sStr(" ["); sStr += rName + "] "; - OutputField(0, ww::eQUOTE, sStr, WRITEFIELD_CMD_END | WRITEFIELD_END | + OutputField(nullptr, ww::eQUOTE, sStr, WRITEFIELD_CMD_END | WRITEFIELD_END | WRITEFIELD_CLOSE); } @@ -1950,7 +1950,7 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) sal_uLong nRstLnNum = 0; SwSection *pParent = rSect.GetParent(); WW8_SepInfo rInfo(&GetExport( ).m_pDoc->GetPageDesc(0), - pParent ? pParent->GetFormat() : NULL, nRstLnNum); + pParent ? pParent->GetFormat() : nullptr, nRstLnNum); GetExport( ).AttrOutput().SectionBreak( msword::PageBreak, &rInfo ); } @@ -2253,7 +2253,7 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) if (!sStr.isEmpty()) { GetExport( ).m_bInWriteTOX = true; - GetExport( ).OutputField( 0, eCode, sStr, WRITEFIELD_START | WRITEFIELD_CMD_START | + GetExport( ).OutputField( nullptr, eCode, sStr, WRITEFIELD_START | WRITEFIELD_CMD_START | WRITEFIELD_CMD_END ); } } @@ -2267,7 +2267,7 @@ void AttributeOutputBase::EndTOX( const SwSection& rSect,bool bCareEnd ) if ( pTOX ) { ww::eField eCode = TOX_INDEX == pTOX->GetType() ? ww::eINDEX : ww::eTOC; - GetExport( ).OutputField( 0, eCode, OUString(), WRITEFIELD_CLOSE ); + GetExport( ).OutputField( nullptr, eCode, OUString(), WRITEFIELD_CLOSE ); if ( pTOX->GetType() == TOX_INDEX && GetExport().AddSectionBreaksForTOX() ) { @@ -2609,7 +2609,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField ) const SwDocInfoField * pDocInfoField = dynamic_cast<const SwDocInfoField *> (pField); - if (pDocInfoField != NULL) + if (pDocInfoField != nullptr) { OUString sFieldname = pDocInfoField->GetFieldName(); sal_Int32 nIndex = sFieldname.indexOf(':'); @@ -2790,7 +2790,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField ) break; } sStr = FieldString(eField) - + MSWordExportBase::GetBookmarkName(nSubType, 0, rRField.GetSeqNo()); + + MSWordExportBase::GetBookmarkName(nSubType, nullptr, rRField.GetSeqNo()); break; } @@ -3121,9 +3121,9 @@ void AttributeOutputBase::TextFootnote( const SwFormatFootnote& rFootnote ) // if any reference to this footnote/endnote then insert an internal // Bookmark. OUString sBkmkNm; - if ( GetExport().HasRefToObject( nTyp, 0, rFootnote.GetTextFootnote()->GetSeqRefNo() )) + if ( GetExport().HasRefToObject( nTyp, nullptr, rFootnote.GetTextFootnote()->GetSeqRefNo() )) { - sBkmkNm = MSWordExportBase::GetBookmarkName( nTyp, 0, + sBkmkNm = MSWordExportBase::GetBookmarkName( nTyp, nullptr, rFootnote.GetTextFootnote()->GetSeqRefNo() ); GetExport().AppendBookmark( sBkmkNm ); } @@ -3204,7 +3204,7 @@ void WW8AttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines ) void AttributeOutputBase::ParaNumRule( const SwNumRuleItem& rNumRule ) { - const SwTextNode* pTextNd = 0; + const SwTextNode* pTextNd = nullptr; sal_uInt16 nNumId; sal_uInt8 nLvl = 0; if (!rNumRule.GetValue().isEmpty()) @@ -3535,7 +3535,7 @@ sal_uInt32 AttributeOutputBase::GridCharacterPitch( const SwTextGridItem& rGrid sal_uInt32 nPageCharSize = 0; - if (pSwFormat != NULL) + if (pSwFormat != nullptr) { nPageCharSize = ItemGet<SvxFontHeightItem> (*pSwFormat, RES_CHRATR_FONTSIZE).GetHeight(); @@ -4074,7 +4074,7 @@ void WW8Export::Out_SwFormatTableBox( ww::bytes& rO, const SvxBoxItem * pBox ) for( int i = 0; i < 4; ++i ) { const SvxBorderLine* pLn; - if (pBox != NULL) + if (pBox != nullptr) pLn = pBox->GetLine( aBorders[i] ); else pLn = & aBorderLine; @@ -4093,8 +4093,8 @@ void WW8Export::Out_CellRangeBorders( const SvxBoxItem * pBox, sal_uInt8 nStart, for( int i = 0; i < 4; ++i ) { - const SvxBorderLine* pLn = 0; - if (pBox != NULL) + const SvxBorderLine* pLn = nullptr; + if (pBox != nullptr) pLn = pBox->GetLine( aBorders[i] ); if (!pLn) continue; @@ -4302,7 +4302,7 @@ void AttributeOutputBase::ParaLineSpacing( const SvxLineSpacingItem& rSpacing ) nSpace = (short)rSpacing.GetInterLineSpace(); sal_uInt16 nScript = i18n::ScriptType::LATIN; - const SwAttrSet *pSet = 0; + const SwAttrSet *pSet = nullptr; if ( GetExport().m_pOutFormatNode && dynamic_cast< const SwFormat *>( GetExport().m_pOutFormatNode ) != nullptr ) { const SwFormat *pFormat = static_cast<const SwFormat*>( GetExport().m_pOutFormatNode ); @@ -4522,7 +4522,7 @@ public: SwWW8WrTabu::SwWW8WrTabu(sal_uInt16 nDelMax, sal_uInt16 nAddMax) : nAdd(0), nDel(0) { - pDel = nDelMax ? new sal_uInt8[nDelMax * 2] : 0; + pDel = nDelMax ? new sal_uInt8[nDelMax * 2] : nullptr; pAddPos = new sal_uInt8[nAddMax * 2]; pAddTyp = new sal_uInt8[nAddMax]; } @@ -4675,7 +4675,7 @@ static void ParaTabStopDelAdd( WW8Export& rWrt, } else { - pTO = 0; + pTO = nullptr; nOP = LONG_MAX; } @@ -4693,7 +4693,7 @@ static void ParaTabStopDelAdd( WW8Export& rWrt, } else { - pTN = 0; + pTN = nullptr; nNP = LONG_MAX; } @@ -4736,14 +4736,14 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops ) { const SfxPoolItem* pLR = m_rWW8Export.HasItem( RES_LR_SPACE ); - if ( pLR != NULL ) + if ( pLR != nullptr ) nCurrentLeft = static_cast<const SvxLRSpaceItem*>(pLR)->GetTextLeft(); } // #i100264# if ( m_rWW8Export.m_bStyDef && - m_rWW8Export.m_pCurrentStyle != NULL && - m_rWW8Export.m_pCurrentStyle->DerivedFrom() != NULL ) + m_rWW8Export.m_pCurrentStyle != nullptr && + m_rWW8Export.m_pCurrentStyle->DerivedFrom() != nullptr ) { SvxTabStopItem aParentTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); const SwFormat *pParentStyle = m_rWW8Export.m_pCurrentStyle->DerivedFrom(); @@ -4766,7 +4766,7 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops ) return; } - const SvxTabStopItem* pStyleTabs = 0; + const SvxTabStopItem* pStyleTabs = nullptr; if ( !m_rWW8Export.m_bStyDef && m_rWW8Export.m_pStyAttr ) { pStyleTabs = m_rWW8Export.m_pStyAttr->GetItem<SvxTabStopItem>(RES_PARATR_TABSTOP); @@ -5048,7 +5048,7 @@ void AttributeOutputBase::OutputStyleItemSet( const SfxItemSet& rSet, bool bDeep if ( !bDeep ) return; - while ( 0 != ( pSet = pSet->GetParent() ) && !pSet->Count() ) + while ( nullptr != ( pSet = pSet->GetParent() ) && !pSet->Count() ) ; if ( !pSet ) @@ -5063,7 +5063,7 @@ void AttributeOutputBase::OutputStyleItemSet( const SfxItemSet& rSet, bool bDeep pItem = aIter.GetCurItem(); do { OutputItem( *pItem ); - } while ( !aIter.IsAtEnd() && 0 != ( pItem = aIter.NextItem() ) ); + } while ( !aIter.IsAtEnd() && nullptr != ( pItem = aIter.NextItem() ) ); } else { @@ -5086,7 +5086,7 @@ void AttributeOutputBase::OutputStyleItemSet( const SfxItemSet& rSet, bool bDeep void AttributeOutputBase::FormatCharBorder( const SvxBoxItem& rBox ) { // Get one of the borders (if there is any border then in docx also will be) - const SvxBorderLine* pBorderLine = 0; + const SvxBorderLine* pBorderLine = nullptr; sal_uInt16 nDist = 0; if( rBox.GetTop() ) { @@ -5162,7 +5162,7 @@ const SwRedlineData* AttributeOutputBase::GetParagraphMarkerRedline( const SwTex } } } - return NULL; + return nullptr; } void AttributeOutputBase::CharBackgroundBase( const SvxBrushItem& rBrush ) diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index eae91c0bce11..4c83070437e2 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -145,7 +145,7 @@ public: /// Write a section break /// msword::ColumnBreak or msword::PageBreak - virtual void SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = NULL ) override; + virtual void SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = nullptr ) override; // preserve DOC page vertical alignment virtual void TextVerticalAdjustment( const css::drawing::TextVerticalAdjust ) SAL_OVERRIDE; @@ -196,7 +196,7 @@ public: sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, const OUString &rNumberingString, - const SvxBrushItem* pBrush = 0) override; //For i120928,transfer graphic of bullet + const SvxBrushItem* pBrush = nullptr) override; //For i120928,transfer graphic of bullet protected: /// Output frames - the implementation. diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index f89b8fd0098c..cb89dfbc0aa1 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -35,7 +35,7 @@ WW8Glossary::WW8Glossary(tools::SvRef<SotStorageStream> &refStrm, sal_uInt8 nVersion, SotStorage *pStg) - : pGlossary(0), rStrm(refStrm), xStg(pStg), nStrings(0) + : pGlossary(nullptr), rStrm(refStrm), xStg(pStg), nStrings(0) { refStrm->SetEndian(SvStreamEndian::LITTLE); WW8Fib aWwFib(*refStrm, nVersion); @@ -109,13 +109,13 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, SwTextFormatColl* pColl = pD->getIDocumentStylePoolAccess().GetTextCollFromPool (RES_POOLCOLL_STANDARD, false); sal_uInt16 nGlosEntry = 0; - SwContentNode* pCNd = 0; + SwContentNode* pCNd = nullptr; do { SwPaM aPam( aStart ); { SwNodeIndex& rIdx = aPam.GetPoint()->nNode; ++rIdx; - if( 0 == ( pCNd = rIdx.GetNode().GetTextNode() ) ) + if( nullptr == ( pCNd = rIdx.GetNode().GetTextNode() ) ) { pCNd = pD->GetNodes().MakeTextNode( rIdx, pColl ); rIdx = *pCNd; @@ -126,7 +126,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, { SwNodeIndex& rIdx = aPam.GetPoint()->nNode; rIdx = aStart.GetNode().EndOfSectionIndex() - 1; - if(( 0 == ( pCNd = rIdx.GetNode().GetContentNode() ) ) + if(( nullptr == ( pCNd = rIdx.GetNode().GetContentNode() ) ) || HasBareGraphicEnd(pD,rIdx)) { ++rIdx; diff --git a/sw/source/filter/ww8/ww8glsy.hxx b/sw/source/filter/ww8/ww8glsy.hxx index a375f1dd06c0..1b62971817fe 100644 --- a/sw/source/filter/ww8/ww8glsy.hxx +++ b/sw/source/filter/ww8/ww8glsy.hxx @@ -57,7 +57,7 @@ private: class WW8Glossary { public: - WW8Glossary( tools::SvRef<SotStorageStream> &refStrm, sal_uInt8 nVersion, SotStorage *pStg=0); + WW8Glossary( tools::SvRef<SotStorageStream> &refStrm, sal_uInt8 nVersion, SotStorage *pStg=nullptr); bool Load( SwTextBlocks &rBlocks, bool bSaveRelFile ); ~WW8Glossary() { delete pGlossary; } WW8GlossaryFib *GetFib() { return pGlossary; } diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index de4bd8f26243..1d3113cbeb25 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -307,7 +307,7 @@ SdrObject* SwWW8ImplReader::ReadLine(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) WW8_DP_LINE aLine; if( !ReadGrafStart( static_cast<void*>(&aLine), sizeof( aLine ), pHd, rSet ) ) - return 0; + return nullptr; Point aP[2]; { @@ -339,7 +339,7 @@ SdrObject* SwWW8ImplReader::ReadRect(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) WW8_DP_RECT aRect; if( !ReadGrafStart( static_cast<void*>(&aRect), sizeof( aRect ), pHd, rSet ) ) - return 0; + return nullptr; Point aP0( (sal_Int16)SVBT16ToShort( pHd->xa ) + m_nDrawXOfs2, (sal_Int16)SVBT16ToShort( pHd->ya ) + m_nDrawYOfs2 ); @@ -360,7 +360,7 @@ SdrObject* SwWW8ImplReader::ReadElipse(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) WW8_DP_ELIPSE aElipse; if( !ReadGrafStart( static_cast<void*>(&aElipse), sizeof( aElipse ), pHd, rSet ) ) - return 0; + return nullptr; Point aP0( (sal_Int16)SVBT16ToShort( pHd->xa ) + m_nDrawXOfs2, (sal_Int16)SVBT16ToShort( pHd->ya ) + m_nDrawYOfs2 ); @@ -381,7 +381,7 @@ SdrObject* SwWW8ImplReader::ReadArc(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) WW8_DP_ARC aArc; if( !ReadGrafStart( static_cast<void*>(&aArc), sizeof( aArc ), pHd, rSet ) ) - return 0; + return nullptr; Point aP0( (sal_Int16)SVBT16ToShort( pHd->xa ) + m_nDrawXOfs2, (sal_Int16)SVBT16ToShort( pHd->ya ) + m_nDrawYOfs2 ); @@ -414,7 +414,7 @@ SdrObject* SwWW8ImplReader::ReadPolyLine(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) WW8_DP_POLYLINE aPoly; if( !ReadGrafStart( static_cast<void*>(&aPoly), sizeof( aPoly ), pHd, rSet ) ) - return 0; + return nullptr; sal_uInt16 nCount = SVBT16ToShort( aPoly.aBits1 ) >> 1 & 0x7fff; std::unique_ptr<SVBT16[]> xP(new SVBT16[nCount * 2]); @@ -422,7 +422,7 @@ SdrObject* SwWW8ImplReader::ReadPolyLine(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) bool bCouldRead = checkRead(*m_pStrm, xP.get(), nCount * 4); // Punkte einlesen OSL_ENSURE(bCouldRead, "Short PolyLine header"); if (!bCouldRead) - return 0; + return nullptr; tools::Polygon aP( nCount ); Point aPt; @@ -478,7 +478,7 @@ ESelection GetESelection(EditEngine &rDrawEditEngine, long nCpStart, long nCpEnd void SwWW8ImplReader::InsertTxbxStyAttrs( SfxItemSet& rS, sal_uInt16 nColl ) { SwWW8StyInf * pStyInf = GetStyle(nColl); - if( pStyInf != NULL && pStyInf->pFormat && pStyInf->bColl ) + if( pStyInf != nullptr && pStyInf->pFormat && pStyInf->bColl ) { const SfxPoolItem* pItem; for( sal_uInt16 i = POOLATTR_BEGIN; i < POOLATTR_END; i++ ) @@ -771,7 +771,7 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp, sal_uInt16 nTxBxS, sal_uInt16 nSequence) { // grab the TextBox-PLCF quickly - WW8PLCFspecial* pT = m_pPlcxMan ? m_pPlcxMan->GetTxbx() : 0; + WW8PLCFspecial* pT = m_pPlcxMan ? m_pPlcxMan->GetTxbx() : nullptr; if( !pT ) { OSL_ENSURE( false, "+Wo ist der Grafik-Text (1) ?" ); @@ -934,13 +934,13 @@ void removePositions(EditEngine &rDrawEditEngine, const std::vector<sal_Int32>& OutlinerParaObject* SwWW8ImplReader::ImportAsOutliner(OUString &rString, WW8_CP nStartCp, WW8_CP nEndCp, ManTypes eType) { - OutlinerParaObject* pRet = 0; + OutlinerParaObject* pRet = nullptr; sal_Int32 nLen = GetRangeAsDrawingString(rString, nStartCp, nEndCp, eType); if (nLen > 0) { if (!m_pDrawEditEngine) - m_pDrawEditEngine = new EditEngine(0); + m_pDrawEditEngine = new EditEngine(nullptr); //replace dos line endings with editeng ones, replace any extra chars with //placeholders to keep the inserted string len in sync with the attribute cps @@ -991,7 +991,7 @@ SwFrameFormat* SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, bool* pbTestTxbxContainsText, long* pnStartCp, long* pnEndCp, bool* pbContainsGraphics, SvxMSDffImportRec* pRecord) { - SwFrameFormat* pFlyFormat = 0; + SwFrameFormat* pFlyFormat = nullptr; sal_uLong nOld = m_pStrm->Tell(); ManTypes eType = m_pPlcxMan->GetManType() == MAN_HDFT ? MAN_TXBX_HDFT : MAN_TXBX; @@ -1005,7 +1005,7 @@ SwFrameFormat* SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, GetRangeAsDrawingString(aString, nStartCp, nEndCp, eType) > 0; if (!m_pDrawEditEngine) - m_pDrawEditEngine = new EditEngine(0); + m_pDrawEditEngine = new EditEngine(nullptr); if( pObjSiz ) m_pDrawEditEngine->SetPaperSize( *pObjSiz ); @@ -1044,7 +1044,7 @@ SwFrameFormat* SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, { const sal_uInt8* pParams; while( aSprmIter.GetSprms() - && (0 != (pParams = aSprmIter.GetAktParams())) ) + && (nullptr != (pParams = aSprmIter.GetAktParams())) ) { sal_uInt16 nAktId = aSprmIter.GetAktId(); switch( nAktId ) @@ -1109,7 +1109,7 @@ SwFrameFormat* SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, { InsertAttrsAsDrawingAttrs(nNewStartCp, nNewStartCp+1, eType, true); - pFlyFormat = ImportGraf(bMakeSdrGrafObj ? pTextObj : 0, + pFlyFormat = ImportGraf(bMakeSdrGrafObj ? pTextObj : nullptr, pOldFlyFormat); } } @@ -1149,7 +1149,7 @@ SwFrameFormat* SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, } } aString.clear(); - rbEraseTextObj = (0 != pFlyFormat); + rbEraseTextObj = (nullptr != pFlyFormat); } } } @@ -1198,7 +1198,7 @@ bool SwWW8ImplReader::TxbxChainContainsRealText(sal_uInt16 nTxBxS, long& rStartC long& rEndCp) { bool bErase, bContainsText; - InsertTxbxText( 0,0,nTxBxS,USHRT_MAX,0,0,false, bErase, &bContainsText, + InsertTxbxText( nullptr,nullptr,nTxBxS,USHRT_MAX,0,nullptr,false, bErase, &bContainsText, &rStartCp, &rEndCp ); return bContainsText; } @@ -1210,7 +1210,7 @@ SdrObject* SwWW8ImplReader::ReadTextBox(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) WW8_DP_TXTBOX aTextB; if( !ReadGrafStart( static_cast<void*>(&aTextB), sizeof( aTextB ), pHd, rSet ) ) - return 0; + return nullptr; Point aP0( (sal_Int16)SVBT16ToShort( pHd->xa ) + m_nDrawXOfs2, (sal_Int16)SVBT16ToShort( pHd->ya ) + m_nDrawYOfs2 ); @@ -1226,8 +1226,8 @@ SdrObject* SwWW8ImplReader::ReadTextBox(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) long nStartCpFly,nEndCpFly; bool bContainsGraphics; - InsertTxbxText(dynamic_cast<SdrTextObj*>(pObj), &aSize, 0, 0, 0, 0, false, - bDummy,0,&nStartCpFly,&nEndCpFly,&bContainsGraphics); + InsertTxbxText(dynamic_cast<SdrTextObj*>(pObj), &aSize, 0, 0, 0, nullptr, false, + bDummy,nullptr,&nStartCpFly,&nEndCpFly,&bContainsGraphics); SetStdAttr( rSet, aTextB.aLnt, aTextB.aShd ); SetFill( rSet, aTextB.aFill ); @@ -1251,7 +1251,7 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) WW8_DP_CALLOUT_TXTBOX aCallB; if( !ReadGrafStart( static_cast<void*>(&aCallB), sizeof( aCallB ), pHd, rSet ) ) - return 0; + return nullptr; sal_uInt16 nCount = SVBT16ToShort( aCallB.dpPolyLine.aBits1 ) >> 1 & 0x7fff; std::unique_ptr<SVBT16[]> xP(new SVBT16[nCount * 2]); @@ -1259,7 +1259,7 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) bool bCouldRead = checkRead(*m_pStrm, xP.get(), nCount * 4); // Punkte einlesen OSL_ENSURE(bCouldRead, "Short CaptionBox header"); if (!bCouldRead) - return 0; + return nullptr; sal_uInt8 nTyp = (sal_uInt8)nCount - 1; if( nTyp == 1 && SVBT16ToShort( xP[0] ) == SVBT16ToShort( xP[2] ) ) @@ -1287,7 +1287,7 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) (sal_Int16)SVBT16ToShort( aCallB.dpheadTxbx.dya ) ); bool bEraseThisObject; - InsertTxbxText(pObj, &aSize, 0, 0, 0, 0, false, bEraseThisObject ); + InsertTxbxText(pObj, &aSize, 0, 0, 0, nullptr, false, bEraseThisObject ); if( SVBT16ToShort( aCallB.dptxbx.aLnt.lnps ) != 5 ) // Umrandung sichtbar ? SetStdAttr( rSet, aCallB.dptxbx.aLnt, aCallB.dptxbx.aShd ); @@ -1304,7 +1304,7 @@ SdrObject *SwWW8ImplReader::ReadGroup(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) sal_Int16 nGrouped; if( !ReadGrafStart( static_cast<void*>(&nGrouped), sizeof( nGrouped ), pHd, rSet ) ) - return 0; + return nullptr; #ifdef OSL_BIGENDIAN nGrouped = (sal_Int16)OSL_SWAPWORD( nGrouped ); @@ -1340,7 +1340,7 @@ SdrObject* SwWW8ImplReader::ReadGrafPrimitive(short& rLeft, SfxAllItemSet &rSet) { // This whole archaic word 6 graphic import can probably be refactored // into an object hierarachy with a little effort. - SdrObject *pRet=0; + SdrObject *pRet=nullptr; WW8_DPHEAD aHd; // Lese Draw-Primitive-Header bool bCouldRead = checkRead(*m_pStrm, &aHd, sizeof(WW8_DPHEAD)); OSL_ENSURE(bCouldRead, "Graphic Primitive header short read" ); @@ -1687,22 +1687,22 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj, rInnerDist.Bottom()+=nLineThick; const SvxBorderLine *pLine; - if (0 != (pLine = aBox.GetLine(SvxBoxItemLine::LEFT))) + if (nullptr != (pLine = aBox.GetLine(SvxBoxItemLine::LEFT))) { rInnerDist.Left() -= (pLine->GetScaledWidth()); } - if (0 != (pLine = aBox.GetLine(SvxBoxItemLine::TOP))) + if (nullptr != (pLine = aBox.GetLine(SvxBoxItemLine::TOP))) { rInnerDist.Top() -= (pLine->GetScaledWidth()); } - if (0 != (pLine = aBox.GetLine(SvxBoxItemLine::RIGHT))) + if (nullptr != (pLine = aBox.GetLine(SvxBoxItemLine::RIGHT))) { rInnerDist.Right() -= (pLine->GetScaledWidth()); } - if (0 != (pLine = aBox.GetLine(SvxBoxItemLine::BOTTOM))) + if (nullptr != (pLine = aBox.GetLine(SvxBoxItemLine::BOTTOM))) { rInnerDist.Bottom() -= (pLine->GetScaledWidth()); } @@ -2058,7 +2058,7 @@ SwWW8ImplReader::SetAttributesAtGrfNode(SvxMSDffImportRec const*const pRecord, { const SwNodeIndex* pIdx = pFlyFormat->GetContent(false).GetContentIdx(); SwGrfNode* pGrfNd; - if( pIdx && 0 != (pGrfNd = m_rDoc.GetNodes()[pIdx->GetIndex() + 1]->GetGrfNode() )) + if( pIdx && nullptr != (pGrfNd = m_rDoc.GetNodes()[pIdx->GetIndex() + 1]->GetGrfNode() )) { Size aSz(pGrfNd->GetTwipSize()); // use type <sal_uInt64> instead of sal_uLong to get correct results @@ -2139,7 +2139,7 @@ SdrObject* SwWW8ImplReader::CreateContactObject(SwFrameFormat* pFlyFormat) { if (pFlyFormat) { - SdrObject* pNewObject = m_bNewDoc ? 0 : pFlyFormat->FindRealSdrObject(); + SdrObject* pNewObject = m_bNewDoc ? nullptr : pFlyFormat->FindRealSdrObject(); if (!pNewObject) pNewObject = pFlyFormat->FindSdrObject(); if (!pNewObject && dynamic_cast< const SwFlyFrameFormat *>( pFlyFormat ) != nullptr) @@ -2151,7 +2151,7 @@ SdrObject* SwWW8ImplReader::CreateContactObject(SwFrameFormat* pFlyFormat) } return pNewObject; } - return 0; + return nullptr; } // Miserable miserable hack to fudge word's graphic layout in RTL mode to ours. @@ -2436,7 +2436,7 @@ bool SwWW8ImplReader::IsObjectLayoutInTableCell( const sal_uInt32 nLayoutInTable SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) { if( m_nIniFlags & WW8FL_NO_GRAFLAYER ) - return 0; + return nullptr; ::SetProgressState(m_nProgress, m_pDocShell); // Update @@ -2449,7 +2449,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) if( !pPF ) { OSL_ENSURE( false, "Where is the graphic (1) ?" ); - return 0; + return nullptr; } if( m_bVer67 ) @@ -2460,7 +2460,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) ReadGrafLayer1( pPF, nGrafAnchorCp ); m_pStrm->Seek( nOldPos ); - return 0; + return nullptr; } // Normal case of Word 8+ version stuff @@ -2470,7 +2470,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) void* pF0; if( !pPF->Get( nStartFc, pF0 ) ){ OSL_ENSURE( false, "+Wo ist die Grafik (2) ?" ); - return 0; + return nullptr; } WW8_FSPA_SHADOW* pFS = static_cast<WW8_FSPA_SHADOW*>(pF0); @@ -2481,7 +2481,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) if( !pF->nSpId ) { OSL_ENSURE( false, "+Wo ist die Grafik (3) ?" ); - return 0; + return nullptr; } if (!m_pMSDffManager->GetModel()) @@ -2496,9 +2496,9 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) sorts of trouble later on */ SwDocShell* pPersist = m_rDoc.GetDocShell(); - m_rDoc.SetDocShell(0); // #i20540# Persist guard + m_rDoc.SetDocShell(nullptr); // #i20540# Persist guard - SdrObject* pObject = 0; + SdrObject* pObject = nullptr; bool bOk = (m_pMSDffManager->GetShape(pF->nSpId, pObject, aData) && pObject); m_rDoc.SetDocShell(pPersist); // #i20540# Persist guard @@ -2506,11 +2506,11 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) if (!bOk) { OSL_ENSURE( false, "Where is the Shape ?" ); - return 0; + return nullptr; } bool bDone = false; - SdrObject* pOurNewObject = 0; + SdrObject* pOurNewObject = nullptr; bool bReplaceable = false; switch (SdrObjKind(pObject->GetObjIdentifier())) @@ -2590,7 +2590,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) if (aData.size() != 1) bReplaceable = false; - SvxMSDffImportRec* pRecord = 0; + SvxMSDffImportRec* pRecord = nullptr; /* Get the record for top level object, so we can get the word anchoring and wrapping information for it. @@ -2607,7 +2607,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) OSL_ENSURE(pRecord, "how did that happen?"); if (!pRecord) - return 0; + return nullptr; const bool bLayoutInTableCell = m_nInTable && IsObjectLayoutInTableCell( pRecord->nLayoutInTableCell ); @@ -2623,7 +2623,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) // #i21847# // Some shapes are set to *hidden*, don't import those ones. if (pRecord->bHidden) - return 0; + return nullptr; sal_uInt16 nCount = pObject->GetUserDataCount(); if(nCount) @@ -2655,7 +2655,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) pFormatURL->SetName(aObjName); if (!aTarFrm.isEmpty()) pFormatURL->SetTargetFrameName(aTarFrm); - pFormatURL->SetMap(0); + pFormatURL->SetMap(nullptr); aFlySet.Put(*pFormatURL); } @@ -2672,7 +2672,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) OUString aObjName = pObject->GetName(); - SwFrameFormat* pRetFrameFormat = 0; + SwFrameFormat* pRetFrameFormat = nullptr; if (bReplaceable) { // Single graphics or ole objects @@ -2819,8 +2819,8 @@ SwFrameFormat* SwWW8ImplReader::MungeTextIntoDrawBox(SdrObject* pTrueObject, bool bEraseThisObject; InsertTxbxText( pSdrTextObj, &aObjSize, pRecord->aTextId.nTxBxS, pRecord->aTextId.nSequence, nGrafAnchorCp, pRetFrameFormat, - (pSdrTextObj != pTrueObject) || (0 != pGroupObject), - bEraseThisObject, 0, 0, 0, 0, pRecord); + (pSdrTextObj != pTrueObject) || (nullptr != pGroupObject), + bEraseThisObject, nullptr, nullptr, nullptr, nullptr, pRecord); // wurde dieses Objekt ersetzt ?? if (bEraseThisObject) @@ -2835,7 +2835,7 @@ SwFrameFormat* SwWW8ImplReader::MungeTextIntoDrawBox(SdrObject* pTrueObject, if (pSdrTextObj != pNewObj) { // Objekt in der Z-Order-Liste ersetzen - m_pMSDffManager->ExchangeInShapeOrder(pSdrTextObj, 0,0, pNewObj); + m_pMSDffManager->ExchangeInShapeOrder(pSdrTextObj, 0,nullptr, pNewObj); // Objekt jetzt noch loeschen SdrObject::Free( pRecord->pObj ); // und das neue Objekt merken. @@ -2852,9 +2852,9 @@ SwFrameFormat* SwWW8ImplReader::MungeTextIntoDrawBox(SdrObject* pTrueObject, // und FrameFormat entfernen, da durch Grafik ersetzt (dies // loescht auch das Objekt) m_rDoc.DelFrameFormat( pRetFrameFormat ); - pRetFrameFormat = 0; + pRetFrameFormat = nullptr; // auch den Objektmerker loeschen - pRecord->pObj = 0; + pRecord->pObj = nullptr; } } else @@ -2876,7 +2876,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject, SdrObject* &rpOurNewObject, SvxMSDffImportRec* pRecord, RndStdIds eAnchor, WW8_FSPA *pF, SfxItemSet &rFlySet) { - SwFlyFrameFormat* pRetFrameFormat = 0; + SwFlyFrameFormat* pRetFrameFormat = nullptr; long nStartCp; long nEndCp; @@ -2935,7 +2935,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject, */ m_pMSDffManager->StoreShapeOrder(pF->nSpId, (((sal_uLong)pRecord->aTextId.nTxBxS) << 16) + - pRecord->aTextId.nSequence, 0, pRetFrameFormat); + pRecord->aTextId.nSequence, nullptr, pRetFrameFormat); // The Contact object has to be inserted into the draw page, so // SwWW8ImplReader::LoadDoc1() can determine the z-order. @@ -2998,7 +2998,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObj SdrObject* &rpOurNewObject, SvxMSDffImportRec* pRecord, WW8_FSPA *pF, SfxItemSet &rFlySet ) { - SwFlyFrameFormat* pRetFrameFormat = 0; + SwFlyFrameFormat* pRetFrameFormat = nullptr; long nWidthTw = pF->nXaRight - pF->nXaLeft; if (0 > nWidthTw) nWidthTw = 0; @@ -3043,8 +3043,8 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObj // as a linked graphic - if (GRAPHIC_NONE == eType || CanUseRemoteLink(aGrfName)) { - pRetFrameFormat = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, aGrfName, OUString(), 0, - &rFlySet, &aGrSet, NULL); + pRetFrameFormat = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, aGrfName, OUString(), nullptr, + &rFlySet, &aGrSet, nullptr); bDone = true; } } @@ -3052,7 +3052,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObj { const Graphic& rGraph = pGrf->GetGraphic(); pRetFrameFormat = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, OUString(), OUString(), &rGraph, - &rFlySet, &aGrSet, NULL); + &rFlySet, &aGrSet, nullptr); } } diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index d041ea3ee882..09c13885fab1 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -369,7 +369,7 @@ SwFlyFrameFormat* SwWW8ImplReader::MakeGrafNotInContent(const WW8PicDesc& rPD, aFlySet.Put( SwFormatFrmSize( ATT_FIX_SIZE, nWidth, nHeight ) ); SwFlyFrameFormat* pFlyFormat = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, rFileName, OUString(), pGraph, - &aFlySet, &rGrfSet, NULL); + &aFlySet, &rGrfSet, nullptr); // So the frames are generated when inserted in an existing doc: if (m_rDoc.getIDocumentLayoutAccess().GetCurrentViewShell() && @@ -387,7 +387,7 @@ SwFrameFormat* SwWW8ImplReader::MakeGrafInContent(const WW8_PIC& rPic, { WW8FlySet aFlySet(*this, m_pPaM, rPic, rPD.nWidth, rPD.nHeight); - SwFrameFormat* pFlyFormat = 0; + SwFrameFormat* pFlyFormat = nullptr; if (rFileName.isEmpty() && m_nObjLocFc) // dann sollte ists ein OLE-Object pFlyFormat = ImportOle(pGraph, &aFlySet, &rGrfSet); @@ -396,7 +396,7 @@ SwFrameFormat* SwWW8ImplReader::MakeGrafInContent(const WW8_PIC& rPic, { pFlyFormat = m_rDoc.getIDocumentContentOperations().Insert( *m_pPaM, rFileName, OUString(), pGraph, &aFlySet, - &rGrfSet, NULL); + &rGrfSet, nullptr); } // Resize the frame to the size of the picture if graphic is inside a frame @@ -409,19 +409,19 @@ SwFrameFormat* SwWW8ImplReader::MakeGrafInContent(const WW8_PIC& rPic, SwFrameFormat* SwWW8ImplReader::ImportGraf1(WW8_PIC& rPic, SvStream* pSt, sal_uLong nFilePos ) { - SwFrameFormat* pRet = 0; + SwFrameFormat* pRet = nullptr; if( pSt->IsEof() || rPic.fError || rPic.MFP.mm == 99 ) - return 0; + return nullptr; OUString aFileName; bool bInDoc; - Graphic* pGraph = 0; + Graphic* pGraph = nullptr; bool bOk = ReadGrafFile(aFileName, pGraph, rPic, pSt, nFilePos, &bInDoc); if (!bOk) { delete pGraph; - return 0; // Graphic could not be readed correctly + return nullptr; // Graphic could not be readed correctly } WW8PicDesc aPD( rPic ); @@ -459,13 +459,13 @@ void SwWW8ImplReader::PicRead(SvStream *pDataStream, WW8_PIC *pPic, SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, SwFrameFormat* pOldFlyFormat) { - SwFrameFormat* pRet = 0; + SwFrameFormat* pRet = nullptr; if ( ((m_pStrm == m_pDataStream ) && !m_nPicLocFc) || (m_nIniFlags & WW8FL_NO_GRAF) ) { - return 0; + return nullptr; } ::SetProgressState(m_nProgress, m_pDocShell); // Update @@ -506,12 +506,12 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, m_pFlyFormatOfJustInsertedGraphic->SetFormatAttr( aFlySet ); - m_pFlyFormatOfJustInsertedGraphic = 0; + m_pFlyFormatOfJustInsertedGraphic = nullptr; } else if((0x64 == aPic.MFP.mm) || (0x66 == aPic.MFP.mm)) { // verlinkte Grafik im Escher-Objekt - SdrObject* pObject = 0; + SdrObject* pObject = nullptr; WW8PicDesc aPD( aPic ); if (!m_pMSDffManager) @@ -658,7 +658,7 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, if (!pRet) { pRet = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, OUString(), OUString(), - &rGraph, &aAttrSet, &aGrSet, NULL ); + &rGraph, &aAttrSet, &aGrSet, nullptr ); } } else @@ -670,7 +670,7 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, if (pRet) { if (pRecord) - SetAttributesAtGrfNode(pRecord, pRet, 0); + SetAttributesAtGrfNode(pRecord, pRet, nullptr); // #i68101# // removed pObject->HasSetName() usage since always returned @@ -685,7 +685,7 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, { if (pOurNewObject != pObject) { - m_pMSDffManager->ExchangeInShapeOrder( pObject, 0, 0, + m_pMSDffManager->ExchangeInShapeOrder( pObject, 0, nullptr, pOurNewObject ); // delete and destroy old SdrGrafObj from page diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 0886debc7155..d4ea09f766c8 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -178,7 +178,7 @@ SwMacroInfo* GetMacroInfo( SdrObject* pObj, bool bCreate ) // static } } - return 0; + return nullptr; }; void lclGetAbsPath(OUString& rPath, sal_uInt16 nLevel, SwDocShell* pDocShell) @@ -528,8 +528,8 @@ Sttb::getStringAtIndex( sal_uInt32 index ) SwMSDffManager::SwMSDffManager( SwWW8ImplReader& rRdr, bool bSkipImages ) : SvxMSDffManager(*rRdr.m_pTableStream, rRdr.GetBaseURL(), rRdr.m_pWwFib->fcDggInfo, - rRdr.m_pDataStream, 0, 0, COL_WHITE, rRdr.m_pStrm, bSkipImages), - rReader(rRdr), pFallbackStream(0) + rRdr.m_pDataStream, nullptr, 0, COL_WHITE, rRdr.m_pStrm, bSkipImages), + rReader(rRdr), pFallbackStream(nullptr) { SetSvxMSDffSettings( GetSvxMSDffSettings() ); nSvxMSDffOLEConvFlags = SwMSDffManager::GetFilterFlags(); @@ -568,10 +568,10 @@ SdrObject* SwMSDffManager::ImportOLE( long nOLEId, // if drawing OLE objects are allowed in Writer. if ( _nCalledByGroup > 0 ) { - return 0L; + return nullptr; } - SdrObject* pRet = 0; + SdrObject* pRet = nullptr; OUString sStorageName; tools::SvRef<SotStorage> xSrcStg; uno::Reference < embed::XStorage > xDstStg; @@ -602,7 +602,7 @@ void SwMSDffManager::DisableFallbackStream() pFallbackStream = pStData2; aOldEscherBlipCache = aEscherBlipCache; aEscherBlipCache.clear(); - pStData2 = 0; + pStData2 = nullptr; } void SwMSDffManager::EnableFallbackStream() @@ -610,7 +610,7 @@ void SwMSDffManager::EnableFallbackStream() pStData2 = pFallbackStream; aEscherBlipCache = aOldEscherBlipCache; aOldEscherBlipCache.clear(); - pFallbackStream = 0; + pFallbackStream = nullptr; } sal_uInt16 SwWW8ImplReader::GetToggleAttrFlags() const @@ -948,7 +948,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, aSet.Put( SdrTextVertAdjustItem( eTVA ) ); aSet.Put( SdrTextHorzAdjustItem( eTHA ) ); - if (pObj != NULL) + if (pObj != nullptr) { pObj->SetMergedItemSet(aSet); pObj->SetModel(pSdrModel); @@ -1022,7 +1022,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, SfxItemSet aSet( pSdrModel->GetItemPool() ); ApplyAttributes( rSt, aSet, rObjData ); - const SfxPoolItem* pPoolItem=NULL; + const SfxPoolItem* pPoolItem=nullptr; SfxItemState eState = aSet.GetItemState( XATTR_FILLCOLOR, false, &pPoolItem ); if( SfxItemState::DEFAULT == eState ) @@ -1059,7 +1059,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, if (SeekToContent(DFF_Prop_pWrapPolygonVertices, rSt)) { delete pImpRec->pWrapPolygon; - pImpRec->pWrapPolygon = NULL; + pImpRec->pWrapPolygon = nullptr; sal_uInt16 nNumElemVert(0), nNumElemMemVert(0), nElemSizeVert(0); rSt.ReadUInt16( nNumElemVert ).ReadUInt16( nNumElemMemVert ).ReadUInt16( nElemSizeVert ); @@ -1235,7 +1235,7 @@ void SwWW8FltControlStack::NewAttr(const SwPosition& rPos, SwFltStackEntry* SwWW8FltControlStack::SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnde, long nHand, bool ) { - SwFltStackEntry *pRet = NULL; + SwFltStackEntry *pRet = nullptr; // Doing a textbox, and using the control stack only as a temporary // collection point for properties which will are not to be set into // the real document @@ -1333,7 +1333,7 @@ void SyncIndentWithList( SvxLRSpaceItem &rLR, const SwNumFormat* SwWW8FltControlStack::GetNumFormatFromStack(const SwPosition &rPos, const SwTextNode &rTextNode) { - const SwNumFormat *pRet = 0; + const SwNumFormat *pRet = nullptr; const SfxPoolItem *pItem = GetStackAttr(rPos, RES_FLTR_NUMRULE); if (pItem && rTextNode.GetNumRule()) { @@ -1387,7 +1387,7 @@ void SwWW8ReferencedFltEndStack::SetAttrInDoc( const SwPosition& rTmpPos, bool bInsertBookmarkIntoDoc = true; SwFltBookmark* pFltBookmark = dynamic_cast<SwFltBookmark*>(rEntry.pAttr); - if ( pFltBookmark != 0 && pFltBookmark->IsTOCBookmark() ) + if ( pFltBookmark != nullptr && pFltBookmark->IsTOCBookmark() ) { const OUString& rName = pFltBookmark->GetName(); ::std::set< OUString, SwWW8::ltstr >::const_iterator aResult = aReferencedTOCBookmarks.find(rName); @@ -1441,7 +1441,7 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwTextNode *pTextNode = static_cast<SwTextNode*>(pNode); - const SwNumFormat *pNum = 0; + const SwNumFormat *pNum = nullptr; pNum = GetNumFormatFromStack( *aRegion.GetPoint(), *pTextNode ); if (!pNum) { @@ -1497,7 +1497,7 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, // If we have just one single inline graphic then // don't insert a field for the single frame, set // the frames hyperlink field attribute directly. - if (0 != (pFrm = SwWW8ImplReader::ContainsSingleInlineGraphic(aRegion))) + if (nullptr != (pFrm = SwWW8ImplReader::ContainsSingleInlineGraphic(aRegion))) { const SwFormatINetFormat *pAttr = static_cast<const SwFormatINetFormat *>( rEntry.pAttr); @@ -1592,7 +1592,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetStackAttr(const SwPosition& rPos, } } } - return 0; + return nullptr; } bool SwWW8FltRefStack::IsFootnoteEdnBkmField( @@ -1717,7 +1717,7 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen) SvxTabStopItem aAttr(0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP); - const SwTextFormatColl* pSty = 0; + const SwTextFormatColl* pSty = nullptr; sal_uInt16 nTabBase; if (m_pAktColl && m_nAktColl < m_vColl.size()) // StyleDef { @@ -1764,10 +1764,10 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen) if (aLoopWatch.find(reinterpret_cast<size_t>(pSty)) != aLoopWatch.end()) - pSty = 0; + pSty = nullptr; } else - pSty = 0; // Give up on the search + pSty = nullptr; // Give up on the search } } @@ -2065,11 +2065,11 @@ WW8ReaderSave::WW8ReaderSave(SwWW8ImplReader* pRdr ,WW8_CP nStartCp) : = pRdr->m_bHasBorder = false; pRdr->m_bFirstPara = true; pRdr->m_nInTable = 0; - pRdr->m_pWFlyPara = 0; - pRdr->m_pSFlyPara = 0; - pRdr->m_pPreviousNumPaM = 0; - pRdr->m_pPrevNumRule = 0; - pRdr->m_pTableDesc = 0; + pRdr->m_pWFlyPara = nullptr; + pRdr->m_pSFlyPara = nullptr; + pRdr->m_pPreviousNumPaM = nullptr; + pRdr->m_pPrevNumRule = nullptr; + pRdr->m_pTableDesc = nullptr; pRdr->m_nAktColl = 0; pRdr->m_pCtrlStck = new SwWW8FltControlStack(&pRdr->m_rDoc, pRdr->m_nFieldFlags, @@ -2212,7 +2212,7 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) OutlinerParaObject *pOutliner = ImportAsOutliner( sText, pRes->nCp2OrIdx, pRes->nCp2OrIdx + pRes->nMemLen, MAN_AND ); - m_pFormatOfJustInsertedApo = 0; + m_pFormatOfJustInsertedApo = nullptr; SwPostItField aPostIt( static_cast<SwPostItFieldType*>(m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(RES_POSTITFLD)), sAuthor, sText, sInitials, OUString(), aDate ); @@ -2434,7 +2434,7 @@ void wwSectionManager::SetHdFt(wwSection &rSection, int nSect, OSL_ENSURE(rSection.mpPage, "makes no sense to call with a main page"); if (rSection.mpPage) { - mrReader.Read_HdFt(nSect, pPrevious ? pPrevious->mpPage : 0, + mrReader.Read_HdFt(nSect, pPrevious ? pPrevious->mpPage : nullptr, rSection); } @@ -2449,9 +2449,9 @@ void SwWW8ImplReader::AppendTextNode(SwPosition& rPos) { SwTextNode* pText = m_pPaM->GetNode().GetTextNode(); - const SwNumRule* pRule = NULL; + const SwNumRule* pRule = nullptr; - if (pText != NULL) + if (pText != nullptr) pRule = sw::util::GetNumRuleFromTextNode(*pText); if ( @@ -2475,7 +2475,7 @@ void SwWW8ImplReader::AppendTextNode(SwPosition& rPos) // cache current paragraph if(m_pPreviousNumPaM) - delete m_pPreviousNumPaM, m_pPreviousNumPaM = 0; + delete m_pPreviousNumPaM, m_pPreviousNumPaM = nullptr; m_pPreviousNumPaM = new SwPaM(*m_pPaM, m_pPaM); m_pPrevNumRule = pRule; @@ -2485,14 +2485,14 @@ void SwWW8ImplReader::AppendTextNode(SwPosition& rPos) // If the previous paragraph has numbering but the current one does not // we need to add a space after the previous paragraph SetLowerSpacing(*m_pPreviousNumPaM, GetParagraphAutoSpace(m_pWDop->fDontUseHTMLAutoSpacing)); - delete m_pPreviousNumPaM, m_pPreviousNumPaM = 0; - m_pPrevNumRule = 0; + delete m_pPreviousNumPaM, m_pPreviousNumPaM = nullptr; + m_pPrevNumRule = nullptr; } else { // clear paragraph cache if(m_pPreviousNumPaM) - delete m_pPreviousNumPaM, m_pPreviousNumPaM = 0; + delete m_pPreviousNumPaM, m_pPreviousNumPaM = nullptr; m_pPrevNumRule = pRule; } @@ -2517,7 +2517,7 @@ bool SwWW8ImplReader::SetSpacing(SwPaM &rMyPam, int nSpace, bool bIsUpper ) const SvxULSpaceItem* pULSpaceItem = static_cast<const SvxULSpaceItem*>(m_pCtrlStck->GetFormatAttr(*pSpacingPos, RES_UL_SPACE)); - if(pULSpaceItem != 0) + if(pULSpaceItem != nullptr) { SvxULSpaceItem aUL(*pULSpaceItem); @@ -2585,7 +2585,7 @@ bool SwWW8ImplReader::ProcessSpecial(bool &rbReSync, WW8_CP nStartCp) OSL_ENSURE(m_nInTable >= 0,"nInTable < 0!"); // TabRowEnd - bool bTableRowEnd = (m_pPlcxMan->HasParaSprm(m_bVer67 ? 25 : 0x2417) != 0 ); + bool bTableRowEnd = (m_pPlcxMan->HasParaSprm(m_bVer67 ? 25 : 0x2417) != nullptr ); // Unfortunately, for every paragraph we need to check first whether // they contain a sprm 29 (0x261B), which starts an APO. @@ -2616,16 +2616,16 @@ bool SwWW8ImplReader::ProcessSpecial(bool &rbReSync, WW8_CP nStartCp) sal_uInt8 nCellLevel = 0; if (m_bVer67) - nCellLevel = int(0 != m_pPlcxMan->HasParaSprm(24)); + nCellLevel = int(nullptr != m_pPlcxMan->HasParaSprm(24)); else { - nCellLevel = int(0 != m_pPlcxMan->HasParaSprm(0x2416)); + nCellLevel = int(nullptr != m_pPlcxMan->HasParaSprm(0x2416)); if (!nCellLevel) - nCellLevel = int(0 != m_pPlcxMan->HasParaSprm(0x244B)); + nCellLevel = int(nullptr != m_pPlcxMan->HasParaSprm(0x244B)); } do { - WW8_TablePos *pTabPos=0; + WW8_TablePos *pTabPos=nullptr; WW8_TablePos aTabPos; if(nCellLevel && !m_bVer67) { @@ -2826,12 +2826,12 @@ rtl_TextEncoding SwWW8ImplReader::GetCurrentCJKCharSet() void SwWW8ImplReader::PostProcessAttrs() { - if (m_pPostProcessAttrsInfo != NULL) + if (m_pPostProcessAttrsInfo != nullptr) { SfxItemIter aIter(m_pPostProcessAttrsInfo->mItemSet); const SfxPoolItem * pItem = aIter.GetCurItem(); - if (pItem != NULL) + if (pItem != nullptr) { do { @@ -2840,11 +2840,11 @@ void SwWW8ImplReader::PostProcessAttrs() m_pCtrlStck->SetAttr(*m_pPostProcessAttrsInfo->mPaM.GetMark(), pItem->Which()); } - while (!aIter.IsAtEnd() && 0 != (pItem = aIter.NextItem())); + while (!aIter.IsAtEnd() && nullptr != (pItem = aIter.NextItem())); } delete m_pPostProcessAttrsInfo; - m_pPostProcessAttrsInfo = NULL; + m_pPostProcessAttrsInfo = nullptr; } } @@ -2882,7 +2882,7 @@ sal_Size Custom8BitToUnicode(rtl_TextToUnicodeConverter hConverter, sal_uInt32 nInfo = 0; sal_Size nThisConverted=0; - nDestChars += rtl_convertTextToUnicode(hConverter, 0, + nDestChars += rtl_convertTextToUnicode(hConverter, nullptr, pIn+nConverted, nInLen-nConverted, pOut+nDestChars, nOutLen-nDestChars, nFlags, &nInfo, &nThisConverted); @@ -2899,7 +2899,7 @@ sal_Size Custom8BitToUnicode(rtl_TextToUnicodeConverter hConverter, sal_Size nOtherConverted; rtl_TextToUnicodeConverter hCP1252Converter = rtl_createTextToUnicodeConverter(RTL_TEXTENCODING_MS_1252); - nDestChars += rtl_convertTextToUnicode(hCP1252Converter, 0, + nDestChars += rtl_convertTextToUnicode(hCP1252Converter, nullptr, pIn+nConverted, 1, pOut+nDestChars, nOutLen-nDestChars, nFlags2, &nInfo, &nOtherConverted); @@ -3026,7 +3026,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp */ const SfxPoolItem * pItem = GetFormatAttr(RES_CHRATR_CJK_LANGUAGE); - if (pItem != NULL && LANGUAGE_JAPANESE != static_cast<const SvxLanguageItem *>(pItem)->GetLanguage()) + if (pItem != nullptr && LANGUAGE_JAPANESE != static_cast<const SvxLanguageItem *>(pItem)->GetLanguage()) { SAL_WARN("sw.ww8", "discarding word95 RTL_TEXTENCODING_MS_932 encoding"); eSrcCharSet = GetCharSetFromLanguage(); @@ -3040,9 +3040,9 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp sal_Unicode* pBuffer = pStr->buffer; sal_Unicode* pWork = pBuffer; - sal_Char* p8Bits = NULL; + sal_Char* p8Bits = nullptr; - rtl_TextToUnicodeConverter hConverter = 0; + rtl_TextToUnicodeConverter hConverter = nullptr; if (!m_bIsUnicode || m_bVer67) hConverter = rtl_createTextToUnicodeConverter(eSrcCharSet); @@ -3055,7 +3055,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp sal_uInt16 nCTLLang = 0; const SfxPoolItem * pItem = GetFormatAttr(RES_CHRATR_CTL_LANGUAGE); - if (pItem != NULL) + if (pItem != nullptr) nCTLLang = static_cast<const SvxLanguageItem *>(pItem)->GetLanguage(); sal_Int32 nL2; @@ -3123,7 +3123,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp pStr->length = nEndUsed; emulateMSWordAddTextToParagraph(OUString(pStr, SAL_NO_ACQUIRE)); - pStr = NULL; + pStr = nullptr; rPos += nL2; if (!m_aApos.back()) // a para end in apo doesn't count m_bWasParaEnd = false; // No CR @@ -3247,7 +3247,7 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const OUString& rAddString OUString sParagraphText; const SwContentNode *pCntNd = m_pPaM->GetContentNode(); - const SwTextNode* pNd = pCntNd ? pCntNd->GetTextNode() : NULL; + const SwTextNode* pNd = pCntNd ? pCntNd->GetTextNode() : nullptr; if (pNd) sParagraphText = pNd->GetText(); sal_Int32 nParaOffset = sParagraphText.getLength(); @@ -3262,7 +3262,7 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const OUString& rAddString OUString sChunk(rAddString.copy(nPos, nEnd-nPos)); const sal_uInt16 aIds[] = {RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_FONT}; - const SvxFontItem *pOverriddenItems[] = {NULL, NULL, NULL}; + const SvxFontItem *pOverriddenItems[] = {nullptr, nullptr, nullptr}; bool aForced[] = {false, false, false}; int nLclIdctHint = 0xFF; @@ -3372,7 +3372,7 @@ void SwWW8ImplReader::simpleAddTextToParagraph(const OUString& rAddString) #endif const SwContentNode *pCntNd = m_pPaM->GetContentNode(); - const SwTextNode* pNd = pCntNd ? pCntNd->GetTextNode() : NULL; + const SwTextNode* pNd = pCntNd ? pCntNd->GetTextNode() : nullptr; OSL_ENSURE(pNd, "What the hell, where's my text node"); @@ -3524,7 +3524,7 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) { // Always insert a txtnode for a column break, e.g. ## SwContentNode *pCntNd=m_pPaM->GetContentNode(); - if (pCntNd!=NULL && pCntNd->Len()>0) // if par is empty not break is needed + if (pCntNd!=nullptr && pCntNd->Len()>0) // if par is empty not break is needed AppendTextNode(*m_pPaM->GetPoint()); m_rDoc.getIDocumentContentOperations().InsertPoolItem(*m_pPaM, SvxFormatBreakItem(SVX_BREAK_COLUMN_BEFORE, RES_BREAK)); } @@ -3616,7 +3616,7 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) } if( !bReadObj ) { - SwFrameFormat *pResult = 0; + SwFrameFormat *pResult = nullptr; if (m_bObj) pResult = ImportOle(); else if (m_bSpec) @@ -3851,7 +3851,7 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStar { m_pCtrlStck->KillUnlockedAttrs( *m_pPaM->GetPoint() ); if( nOldColl != m_pPlcxMan->GetColl() ) - ProcessAktCollChange(aRes, 0, false); + ProcessAktCollChange(aRes, nullptr, false); } return nNext; @@ -3947,7 +3947,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) m_bWasParaEnd = false; m_nAktColl = 0; - m_pAktItemSet = 0; + m_pAktItemSet = nullptr; m_nCharFormat = -1; m_bSpec = false; m_bPgSecBreak = false; @@ -3956,10 +3956,10 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) long nCpOfs = m_pPlcxMan->GetCpOfs(); // Offset for Header/Footer, Footnote WW8_CP nNext = m_pPlcxMan->Where(); - SwTextNode* pPreviousNode = 0; + SwTextNode* pPreviousNode = nullptr; sal_uInt8 nDropLines = 0; - SwCharFormat* pNewSwCharFormat = 0; - const SwCharFormat* pFormat = 0; + SwCharFormat* pNewSwCharFormat = nullptr; + const SwCharFormat* pFormat = nullptr; m_pStrm->Seek( m_pSBase->WW8Cp2Fc( nStartCp + nCpOfs, &m_bIsUnicode ) ); WW8_CP l = nStartCp; @@ -3975,7 +3975,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) ReadAttrs( l, nNext, nTextEnd, bStartLine );// Takes SectionBreaks into account, too OSL_ENSURE(m_pPaM->GetNode().GetTextNode(), "Missing txtnode"); - if (m_pPostProcessAttrsInfo != NULL) + if (m_pPostProcessAttrsInfo != nullptr) PostProcessAttrs(); if (l >= nTextEnd) @@ -4039,7 +4039,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) SwPosition aStart(*pEndNd); m_pCtrlStck->NewAttr(aStart, aDrop); m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_PARATR_DROP); - pPreviousNode = 0; + pPreviousNode = nullptr; } else if (m_bDropCap) { @@ -4056,14 +4056,14 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) if (pDCS) nDropLines = (*pDCS) >> 3; else // There is no Drop Cap Specifier hence no dropcap - pPreviousNode = 0; + pPreviousNode = nullptr; if (const sal_uInt8 *pDistance = m_pPlcxMan->GetPapPLCF()->HasSprm(0x842F)) nDistance = SVBT16ToShort( pDistance ); else nDistance = 0; - const SwFormatCharFormat *pSwFormatCharFormat = 0; + const SwFormatCharFormat *pSwFormatCharFormat = nullptr; if(m_pAktItemSet) pSwFormatCharFormat = &(ItemGet<SwFormatCharFormat>(*m_pAktItemSet, RES_TXTATR_CHARFMT)); @@ -4080,7 +4080,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) } delete m_pAktItemSet; - m_pAktItemSet = 0; + m_pAktItemSet = nullptr; m_bDropCap=false; } @@ -4133,7 +4133,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) CloseAttrEnds(); - delete m_pPlcxMan, m_pPlcxMan = 0; + delete m_pPlcxMan, m_pPlcxMan = nullptr; return bJoined; } @@ -4142,55 +4142,55 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage, : m_pDocShell(rD.GetDocShell()) , m_pStg(pStorage) , m_pStrm(pSt) - , m_pTableStream(0) - , m_pDataStream(0) + , m_pTableStream(nullptr) + , m_pDataStream(nullptr) , m_rDoc(rD) - , m_pPaM(0) - , m_pCtrlStck(0) - , m_pRedlineStack(0) - , m_pReffedStck(0) - , m_pReffingStck(0) - , m_pAnchorStck(0) + , m_pPaM(nullptr) + , m_pCtrlStck(nullptr) + , m_pRedlineStack(nullptr) + , m_pReffedStck(nullptr) + , m_pReffingStck(nullptr) + , m_pAnchorStck(nullptr) , m_aSectionManager(*this) , m_aExtraneousParas(rD) , m_aInsertedTables(rD) , m_aSectionNameGenerator(rD, OUString("WW")) - , m_pSprmParser(NULL) + , m_pSprmParser(nullptr) , m_aGrfNameGenerator(bNewDoc, OUString('G')) , m_aParaStyleMapper(rD) , m_aCharStyleMapper(rD) - , m_pFormImpl(0) - , m_pFlyFormatOfJustInsertedGraphic(0) - , m_pFormatOfJustInsertedApo(0) - , m_pPreviousNumPaM(0) - , m_pPrevNumRule(0) - , m_pPostProcessAttrsInfo(0) - , m_pWwFib(0) - , m_pFonts(0) - , m_pWDop(0) - , m_pLstManager(0) - , m_pSBase(0) - , m_pPlcxMan(0) + , m_pFormImpl(nullptr) + , m_pFlyFormatOfJustInsertedGraphic(nullptr) + , m_pFormatOfJustInsertedApo(nullptr) + , m_pPreviousNumPaM(nullptr) + , m_pPrevNumRule(nullptr) + , m_pPostProcessAttrsInfo(nullptr) + , m_pWwFib(nullptr) + , m_pFonts(nullptr) + , m_pWDop(nullptr) + , m_pLstManager(nullptr) + , m_pSBase(nullptr) + , m_pPlcxMan(nullptr) , m_aTextNodesHavingFirstLineOfstSet() , m_aTextNodesHavingLeftIndentSet() - , m_pStyles(0) - , m_pAktColl(0) - , m_pAktItemSet(0) - , m_pDfltTextFormatColl(0) - , m_pStandardFormatColl(0) - , m_pHdFt(0) - , m_pWFlyPara(0) - , m_pSFlyPara(0) - , m_pTableDesc(0) - , m_pNumOlst(0) - , m_pNode_FLY_AT_PARA(0) - , m_pDrawModel(0) - , m_pDrawPg(0) - , m_pDrawEditEngine(0) - , m_pWWZOrder(0) - , m_pNumFieldType(0) - , m_pMSDffManager(0) - , m_pAtnNames(0) + , m_pStyles(nullptr) + , m_pAktColl(nullptr) + , m_pAktItemSet(nullptr) + , m_pDfltTextFormatColl(nullptr) + , m_pStandardFormatColl(nullptr) + , m_pHdFt(nullptr) + , m_pWFlyPara(nullptr) + , m_pSFlyPara(nullptr) + , m_pTableDesc(nullptr) + , m_pNumOlst(nullptr) + , m_pNode_FLY_AT_PARA(nullptr) + , m_pDrawModel(nullptr) + , m_pDrawPg(nullptr) + , m_pDrawEditEngine(nullptr) + , m_pWWZOrder(nullptr) + , m_pNumFieldType(nullptr) + , m_pMSDffManager(nullptr) + , m_pAtnNames(nullptr) , m_sBaseURL(rBaseURL) , m_nIniFlags(0) , m_nIniFlags1(0) @@ -4265,7 +4265,7 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage, , m_bLoadingTOXCache(false) , m_nEmbeddedTOXLevel(0) , m_bLoadingTOXHyperlink(false) - , m_pPosAfterTOC(0) + , m_pPosAfterTOC(nullptr) , m_bCareFirstParaEndInToc(false) , m_bCareLastParaEndInToc(false) , m_aTOXEndCps() @@ -4308,7 +4308,7 @@ void wwSectionManager::SetSegmentToPageDesc(const wwSection &rSection, { Rectangle aRect(0, 0, 100, 100); // A dummy, we don't care about the size SvxMSDffImportData aData(aRect); - SdrObject* pObject = 0; + SdrObject* pObject = nullptr; if (mrReader.m_pMSDffManager->GetShape(0x401, pObject, aData)) { // Only handle shape if it is a background shape @@ -4402,14 +4402,14 @@ SwFormatPageDesc wwSectionManager::SetSwFormatPageDesc(mySegIter &rIter, { rIter->mpPage = mrReader.m_rDoc.MakePageDesc( SwViewShell::GetShellRes()->GetPageDescName(mnDesc, ShellResource::NORMAL_PAGE), - 0, false); + nullptr, false); } OSL_ENSURE(rIter->mpPage, "no page!"); if (!rIter->mpPage) return SwFormatPageDesc(); // Set page before hd/ft - const wwSection *pPrevious = 0; + const wwSection *pPrevious = nullptr; if (rIter != rStart) pPrevious = &(*(rIter-1)); SetHdFt(*rIter, std::distance(rStart, rIter), pPrevious); @@ -4532,7 +4532,7 @@ void wwSectionManager::InsertSegments() GiveNodePageDesc(aIter->maStart, aDesc, mrReader.m_rDoc); } - SwTextNode* pTextNd = 0; + SwTextNode* pTextNd = nullptr; if (bInsertSection) { // Start getting the bounds of this section @@ -4549,7 +4549,7 @@ void wwSectionManager::InsertSegments() const SwPosition* pPos = aSectPaM.GetPoint(); SwTextNode const*const pSttNd = pPos->nNode.GetNode().GetTextNode(); - const SwTableNode* pTableNd = pSttNd ? pSttNd->FindTableNode() : 0; + const SwTableNode* pTableNd = pSttNd ? pSttNd->FindTableNode() : nullptr; if (pTableNd) { pTextNd = @@ -4637,7 +4637,7 @@ void wwSectionManager::InsertSegments() SwNodeIndex aIdx(*pTextNd); SwPaM aTest(aIdx); mrReader.m_rDoc.getIDocumentContentOperations().DelFullPara(aTest); - pTextNd = 0; + pTextNd = nullptr; } } } @@ -5215,8 +5215,8 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) // Initialize FlyFrame Formats SwFlyFrameFormat* pFlyFormat = pOrder->pFly; - SwFlyFrameFormat* pNextFlyFormat = 0; - SwFlyFrameFormat* pPrevFlyFormat = 0; + SwFlyFrameFormat* pNextFlyFormat = nullptr; + SwFlyFrameFormat* pPrevFlyFormat = nullptr; // Determine successor, if we can SvxMSDffShapeTxBxSort::iterator tmpIter1 = it; @@ -5277,8 +5277,8 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) delete m_pSprmParser; ::EndProgress(m_pDocShell); - m_pDataStream = 0; - m_pTableStream = 0; + m_pDataStream = nullptr; + m_pTableStream = nullptr; DeleteCtrlStk(); m_pRedlineStack->closeall(*m_pPaM->GetPoint()); @@ -5314,12 +5314,12 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) SwFrameFormat* pFrameFormat = pHt->GetFlyCnt().GetFrameFormat(); vecFrameFormat.push_back(pFrameFormat); const SwNodeIndex* pNdIdx = pFrameFormat->GetContent().GetContentIdx(); - const SwNodes* pNodesArray = (pNdIdx != NULL) + const SwNodes* pNodesArray = (pNdIdx != nullptr) ? &(pNdIdx->GetNodes()) - : NULL; - const SwGrfNode *pGrf = (pNodesArray != NULL) + : nullptr; + const SwGrfNode *pGrf = (pNodesArray != nullptr) ? dynamic_cast<const SwGrfNode*>((*pNodesArray)[pNdIdx->GetIndex() + 1]) - : NULL; + : nullptr; vecBulletGrf.push_back(pGrf); } } @@ -5335,7 +5335,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) const sal_uInt16 nGrfBulletCP = aNumFormat.GetGrfBulletCP(); if ( nType == SVX_NUM_BITMAP && vecBulletGrf.size() > nGrfBulletCP - && vecBulletGrf[nGrfBulletCP] != NULL ) + && vecBulletGrf[nGrfBulletCP] != nullptr ) { Graphic aGraphic = vecBulletGrf[nGrfBulletCP]->GetGrf(); SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH); @@ -5627,9 +5627,9 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss) if (!nErrRet) nErrRet = SetSubStreams(xTableStream, xDataStream); - utl::TempFile *pTempMain = 0; - utl::TempFile *pTempTable = 0; - utl::TempFile *pTempData = 0; + utl::TempFile *pTempMain = nullptr; + utl::TempFile *pTempTable = nullptr; + utl::TempFile *pTempData = nullptr; SvFileStream aDecryptMain; SvFileStream aDecryptTable; SvFileStream aDecryptData; @@ -5817,7 +5817,7 @@ void SwWW8ImplReader::SetOutlineStyles() // - Populate temporary list of WW8 Built-In Heading Styles for further // iteration std::vector<SwWW8StyInf*> aWW8BuiltInHeadingStyles; - const SwNumRule* pChosenWW8ListStyle = NULL; + const SwNumRule* pChosenWW8ListStyle = nullptr; { std::map<const SwNumRule*, int> aWW8ListStyleCounts; for (size_t nI = 0; nI < m_vColl.size(); ++nI) @@ -5832,7 +5832,7 @@ void SwWW8ImplReader::SetOutlineStyles() aWW8BuiltInHeadingStyles.push_back(&rSI); const SwNumRule* pWW8ListStyle = rSI.GetOutlineNumrule(); - if (pWW8ListStyle != NULL) + if (pWW8ListStyle != nullptr) { std::map<const SwNumRule*, int>::iterator aCountIter = aWW8ListStyleCounts.find(pWW8ListStyle); @@ -5893,7 +5893,7 @@ void SwWW8ImplReader::SetOutlineStyles() continue; } - if (pChosenWW8ListStyle != NULL && pStyleInf->mnWW8OutlineLevel + if (pChosenWW8ListStyle != nullptr && pStyleInf->mnWW8OutlineLevel == pStyleInf->nListLevel) { const SwNumFormat& rRule @@ -5917,7 +5917,7 @@ void SwWW8ImplReader::SetOutlineStyles() pTextFormatColl->DeleteAssignmentToListLevelOfOutlineStyle(false); // Apply existing WW8 list style a normal list style at the // Paragraph Style - if (pStyleInf->GetOutlineNumrule() != NULL) + if (pStyleInf->GetOutlineNumrule() != nullptr) { pTextFormatColl->SetFormatAttr( SwNumRuleItem(pStyleInf->GetOutlineNumrule()->GetName())); @@ -5972,7 +5972,7 @@ const OUString* SwWW8ImplReader::GetAnnotationAuthor(sal_uInt16 nIdx) rStrm.Seek( nOldPos ); } - const OUString *pRet = 0; + const OUString *pRet = nullptr; if (m_pAtnNames && nIdx < m_pAtnNames->size()) pRet = &((*m_pAtnNames)[nIdx]); return pRet; @@ -6169,8 +6169,8 @@ sal_uLong WW8Reader::Read(SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, co // Remove Frame and offsets from Frame Template Reader::ResetFrameFormats( rDoc ); - rPaM.GetBound().nContent.Assign(0, 0); - rPaM.GetBound(false).nContent.Assign(0, 0); + rPaM.GetBound().nContent.Assign(nullptr, 0); + rPaM.GetBound(false).nContent.Assign(nullptr, 0); } try diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 42ee0676f241..e0b0eabde52e 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -152,7 +152,7 @@ public: //the rParaSprms returns back the original word paragraph indent //sprms which were attached to the original numbering format SwNumRule* GetNumRuleForActivation(sal_uInt16 nLFOPosition, const sal_uInt8 nLevel, - std::vector<sal_uInt8> &rParaSprms, SwTextNode *pNode=0); + std::vector<sal_uInt8> &rParaSprms, SwTextNode *pNode=nullptr); SwNumRule* CreateNextRule(bool bSimple); ~WW8ListManager(); SwNumRule* GetNumRule(size_t i); @@ -204,7 +204,7 @@ struct WW8FlyPara // the contained graphics *not* as a character bool mbVertSet; // true if vertical positioning has been set - WW8FlyPara(bool bIsVer67, const WW8FlyPara* pSrc = 0); + WW8FlyPara(bool bIsVer67, const WW8FlyPara* pSrc = nullptr); bool operator==(const WW8FlyPara& rSrc) const; void Read(sal_uInt8 nSprm29, WW8PLCFx_Cp_FKP* pPap); void ReadFull(sal_uInt8 nSprm29, SwWW8ImplReader* pIo); @@ -261,9 +261,9 @@ public: eLTRFontSrcCharSet(0), eRTLFontSrcCharSet(0), eCJKFontSrcCharSet(0), - pFormat( 0 ), - pWWFly( 0 ), - pOutlineNumrule( 0 ), + pFormat( nullptr ), + pWWFly( nullptr ), + pOutlineNumrule( nullptr ), nFilePos( 0 ), nBase( 0 ), nFollow( 0 ), @@ -309,7 +309,7 @@ public: bool HasWW8OutlineLevel() const { - return (pFormat != NULL && (MAXLEVEL > mnWW8OutlineLevel)); + return (pFormat != nullptr && (MAXLEVEL > mnWW8OutlineLevel)); } bool IsOutlineNumbered() const @@ -744,7 +744,7 @@ public: css::uno::Reference< css::drawing::XShape > *pShape, bool bFloatingCtrl) override; bool ExportControl(WW8Export &rWrt, const SdrUnoObj& rFormObj); bool ReadOCXStream( tools::SvRef<SotStorage>& rSrc1, - css::uno::Reference< css::drawing::XShape > *pShapeRef=0, + css::uno::Reference< css::drawing::XShape > *pShapeRef=nullptr, bool bFloatingCtrl=false ); private: sal_uInt32 GenerateObjectID() { return ++mnObjectId; } @@ -978,7 +978,7 @@ struct ApoTestResults WW8FlyPara* mpStyleApo; ApoTestResults() : mbStartApo(false), mbStopApo(false), m_bHasSprm37(false) - , m_bHasSprm29(false), m_nSprm29(0), mpStyleApo(0) {} + , m_bHasSprm29(false), m_nSprm29(0), mpStyleApo(nullptr) {} bool HasStartStop() const { return (mbStartApo || mbStopApo); } bool HasFrame() const { return (m_bHasSprm29 || m_bHasSprm37 || mpStyleApo); } }; @@ -989,7 +989,7 @@ struct ANLDRuleMap SwNumRule* mpNumberingNumRule; // WinWord 6 numbering, variant 2 SwNumRule* GetNumRule(sal_uInt8 nNumType); void SetNumRule(SwNumRule*, sal_uInt8 nNumType); - ANLDRuleMap() : mpOutlineNumRule(0), mpNumberingNumRule(0) {} + ANLDRuleMap() : mpOutlineNumRule(nullptr), mpNumberingNumRule(nullptr) {} }; struct SprmReadInfo; @@ -1396,15 +1396,15 @@ private: SwPageDesc* pNewPageDesc, sal_uInt8 nCode ); void DeleteStk(SwFltControlStack* prStck); - void DeleteCtrlStk() { DeleteStk( m_pCtrlStck ); m_pCtrlStck = 0; } + void DeleteCtrlStk() { DeleteStk( m_pCtrlStck ); m_pCtrlStck = nullptr; } void DeleteRefStks() { DeleteStk( m_pReffedStck ); - m_pReffedStck = 0; + m_pReffedStck = nullptr; DeleteStk( m_pReffingStck ); - m_pReffingStck = 0; + m_pReffingStck = nullptr; } - void DeleteAnchorStk() { DeleteStk( m_pAnchorStck ); m_pAnchorStck = 0; } + void DeleteAnchorStk() { DeleteStk( m_pAnchorStck ); m_pAnchorStck = nullptr; } void emulateMSWordAddTextToParagraph(const OUString& rAddString); void simpleAddTextToParagraph(const OUString& rAddString); bool HandlePageBreakChar(); @@ -1458,14 +1458,14 @@ private: // Note #i20672# we can't properly support between lines so best to ignore // them for now static bool SetBorder(SvxBoxItem& rBox, const WW8_BRCVer9* pbrc, - short *pSizeArray=0, sal_uInt8 nSetBorders=0xFF); + short *pSizeArray=nullptr, sal_uInt8 nSetBorders=0xFF); static void GetBorderDistance(const WW8_BRCVer9* pbrc, Rectangle& rInnerDist); static sal_uInt16 GetParagraphAutoSpace(bool fDontUseHTMLAutoSpacing); static bool SetShadow(SvxShadowItem& rShadow, const short *pSizeArray, const WW8_BRCVer9& aRightBrc); //returns true is a shadow was set static bool SetFlyBordersShadow(SfxItemSet& rFlySet, const WW8_BRCVer9 *pbrc, - short *SizeArray=0); + short *SizeArray=nullptr); static void SetPageBorder(SwFrameFormat &rFormat, const wwSection &rSection); static sal_Int32 MatchSdrBoxIntoFlyBoxItem( const Color& rLineColor, @@ -1488,7 +1488,7 @@ private: //Apo == Absolutely Positioned Object, MSWord's old-style frames WW8FlyPara *ConstructApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos); - bool StartApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos, SvxULSpaceItem* pULSpaceItem = 0); + bool StartApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos, SvxULSpaceItem* pULSpaceItem = nullptr); void StopApo(); bool TestSameApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos); ApoTestResults TestApo(int nCellLevel, bool bTableRowEnd, @@ -1515,13 +1515,13 @@ private: SwFrameFormat *AddAutoAnchor(SwFrameFormat *pFormat); SwFrameFormat* ImportGraf1(WW8_PIC& rPic, SvStream* pSt, sal_uLong nFilePos); - SwFrameFormat* ImportGraf(SdrTextObj* pTextObj = 0, SwFrameFormat* pFlyFormat = 0); + SwFrameFormat* ImportGraf(SdrTextObj* pTextObj = nullptr, SwFrameFormat* pFlyFormat = nullptr); - SdrObject* ImportOleBase( Graphic& rGraph, const Graphic* pGrf=0, - const SfxItemSet* pFlySet=0, const Rectangle& aVisArea = Rectangle() ); + SdrObject* ImportOleBase( Graphic& rGraph, const Graphic* pGrf=nullptr, + const SfxItemSet* pFlySet=nullptr, const Rectangle& aVisArea = Rectangle() ); - SwFrameFormat* ImportOle( const Graphic* = 0, const SfxItemSet* pFlySet = 0, - const SfxItemSet* pGrfSet = 0, const Rectangle& aVisArea = Rectangle() ); + SwFrameFormat* ImportOle( const Graphic* = nullptr, const SfxItemSet* pFlySet = nullptr, + const SfxItemSet* pGrfSet = nullptr, const Rectangle& aVisArea = Rectangle() ); SwFlyFrameFormat* InsertOle(SdrOle2Obj &rObject, const SfxItemSet &rFlySet, const SfxItemSet *rGrfSet); @@ -1539,7 +1539,7 @@ private: void ReadDocVars(); - bool StartTable(WW8_CP nStartCp, SvxULSpaceItem* pULSpaceItem = 0); + bool StartTable(WW8_CP nStartCp, SvxULSpaceItem* pULSpaceItem = nullptr); bool InEqualApo(int nLvl) const; bool InLocalApo() const { return InEqualApo(m_nInTable); } bool InEqualOrHigherApo(int nLvl) const; @@ -1587,9 +1587,9 @@ private: SwFrameFormat* InsertTxbxText(SdrTextObj* pTextObj, Size* pObjSiz, sal_uInt16 nTxBxS, sal_uInt16 nSequence, long nPosCp, SwFrameFormat* pFlyFormat, bool bMakeSdrGrafObj, bool& rbEraseTextObj, - bool* pbTestTxbxContainsText = 0, long* pnStartCp = 0, - long* pnEndCp = 0, bool* pbContainsGraphics = 0, - SvxMSDffImportRec* pRecord = 0); + bool* pbTestTxbxContainsText = nullptr, long* pnStartCp = nullptr, + long* pnEndCp = nullptr, bool* pbContainsGraphics = nullptr, + SvxMSDffImportRec* pRecord = nullptr); bool TxbxChainContainsRealText( sal_uInt16 nTxBxS, long& rStartCp, long& rEndCp ); @@ -1884,7 +1884,7 @@ public: // really private, but can only be done public const OUString& GetBaseURL() const { return m_sBaseURL; } // load a complete doc file - sal_uLong LoadDoc(WW8Glossary *pGloss=0); + sal_uLong LoadDoc(WW8Glossary *pGloss=nullptr); rtl_TextEncoding GetCurrentCharSet(); rtl_TextEncoding GetCurrentCJKCharSet(); rtl_TextEncoding GetCharSetFromLanguage(); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index c4e1abfab91b..f774d41280a7 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -179,7 +179,7 @@ public: WW8TabDesc( SwWW8ImplReader* pIoClass, WW8_CP nStartCp ); bool Ok() const { return bOk; } - void CreateSwTable(SvxULSpaceItem* pULSpaceItem = 0); + void CreateSwTable(SvxULSpaceItem* pULSpaceItem = nullptr); void UseSwTable(); void SetSizePosition(SwFrameFormat* pFrameFormat); void TableCellEnd(); @@ -300,7 +300,7 @@ sal_uInt16 SwWW8ImplReader::End_Footnote() sal_Int32 nPos = m_pPaM->GetPoint()->nContent.GetIndex(); OUString sChar; - SwTextAttr* pFN = 0; + SwTextAttr* pFN = nullptr; //There should have been a footnote char, we will replace this. if (pText && nPos) { @@ -419,7 +419,7 @@ bool SwWW8ImplReader::SearchRowEnd(WW8PLCFx_Cp_FKP* pPap, WW8_CP &rStartCp, int nLevel) const { WW8PLCFxDesc aRes; - aRes.pMemPos = 0; + aRes.pMemPos = nullptr; aRes.nEndPos = rStartCp; bool bReadRes(false); WW8PLCFxDesc aPrevRes; @@ -431,8 +431,8 @@ bool SwWW8ImplReader::SearchRowEnd(WW8PLCFx_Cp_FKP* pPap, WW8_CP &rStartCp, const sal_uInt8* pB = pPap->HasSprm(TabRowSprm(nLevel)); if (pB && *pB == 1) { - const sal_uInt8 *pLevel = 0; - if (0 != (pLevel = pPap->HasSprm(0x6649))) + const sal_uInt8 *pLevel = nullptr; + if (nullptr != (pLevel = pPap->HasSprm(0x6649))) { if (nLevel + 1 == *pLevel) return true; @@ -446,7 +446,7 @@ bool SwWW8ImplReader::SearchRowEnd(WW8PLCFx_Cp_FKP* pPap, WW8_CP &rStartCp, } aRes.nStartPos = aRes.nEndPos; - aRes.pMemPos = 0; + aRes.pMemPos = nullptr; //Seek to our next block of properties if (!(pPap->SeekPos(aRes.nStartPos))) { @@ -472,12 +472,12 @@ bool SwWW8ImplReader::SearchRowEnd(WW8PLCFx_Cp_FKP* pPap, WW8_CP &rStartCp, ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, bool bTableRowEnd, const WW8_TablePos *pTabPos) { - const WW8_TablePos *pTopLevelTable = nCellLevel <= 1 ? pTabPos : 0; + const WW8_TablePos *pTopLevelTable = nCellLevel <= 1 ? pTabPos : nullptr; ApoTestResults aRet; // Frame in Style Definition (word appears to ignore them if inside an // text autoshape) if (!m_bTxbxFlySection && m_nAktColl < m_vColl.size()) - aRet.mpStyleApo = StyleExists(m_nAktColl) ? m_vColl[m_nAktColl].pWWFly : 0; + aRet.mpStyleApo = StyleExists(m_nAktColl) ? m_vColl[m_nAktColl].pWWFly : nullptr; /* #i1140# @@ -500,7 +500,7 @@ ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, bool bTableRowEnd, aRet.m_bHasSprm37 = m_pPlcxMan->HasParaSprm( m_bVer67 ? 37 : 0x2423 ); const sal_uInt8 *pSrpm29 = m_pPlcxMan->HasParaSprm( m_bVer67 ? 29 : 0x261B ); - aRet.m_bHasSprm29 = pSrpm29 != NULL; + aRet.m_bHasSprm29 = pSrpm29 != nullptr; aRet.m_nSprm29 = pSrpm29 ? *pSrpm29 : 0; // Is there some frame data here @@ -760,7 +760,7 @@ SwNumRule* SwWW8ImplReader::GetStyRule() const OUString aName( m_rDoc.GetUniqueNumRuleName( &aBaseName, false) ); // #i86652# - sal_uInt16 nRul = m_rDoc.MakeNumRule( aName, 0, false, + sal_uInt16 nRul = m_rDoc.MakeNumRule( aName, nullptr, false, SvxNumberFormat::LABEL_ALIGNMENT ); m_pStyles->pStyRule = m_rDoc.GetNumRuleTable()[nRul]; // Auto == false-> Nummerierungsvorlage @@ -783,7 +783,7 @@ void SwWW8ImplReader::Read_ANLevelNo( sal_uInt16, const sal_uInt8* pData, short // only for SwTextFormatColl, not CharFormat // WW: 0 = no Numbering SwWW8StyInf * pColl = GetStyle(m_nAktColl); - if (pColl != NULL && pColl->bColl && *pData) + if (pColl != nullptr && pColl->bColl && *pData) { // Range WW:1..9 -> SW:0..8 no bullets / numbering @@ -847,7 +847,7 @@ void SwWW8ImplReader::Read_ANLevelDesc( sal_uInt16, const sal_uInt8* pData, shor m_pAktColl->SetFormatAttr( SwNumRuleItem( pNR->GetName() ) ); pStyInf = GetStyle(m_nAktColl); - if (pStyInf != NULL) + if (pStyInf != nullptr) pStyInf->bHasStyNumRule = true; } } @@ -884,7 +884,7 @@ void SwWW8ImplReader::Read_OLST( sal_uInt16, const sal_uInt8* pData, short nLen delete m_pNumOlst; if (nLen <= 0) { - m_pNumOlst = 0; + m_pNumOlst = nullptr; return; } m_pNumOlst = new WW8_OLST; @@ -934,7 +934,7 @@ void SwWW8ImplReader::StartAnl(const sal_uInt8* pSprm13) SwNumRule *pNumRule = m_aANLDRules.GetNumRule(m_nWwNumType); // check for COL numbering: - const sal_uInt8* pS12 = 0;// sprmAnld + const sal_uInt8* pS12 = nullptr;// sprmAnld OUString sNumRule; if (m_pTableDesc) @@ -956,7 +956,7 @@ void SwWW8ImplReader::StartAnl(const sal_uInt8* pSprm13) } SwWW8StyInf * pStyInf = GetStyle(m_nAktColl); - if (sNumRule.isEmpty() && pStyInf != NULL && pStyInf->bHasStyNumRule) + if (sNumRule.isEmpty() && pStyInf != nullptr && pStyInf->bHasStyNumRule) { sNumRule = pStyInf->pFormat->GetNumRule().GetValue(); pNumRule = m_rDoc.FindNumRulePtr(sNumRule); @@ -970,7 +970,7 @@ void SwWW8ImplReader::StartAnl(const sal_uInt8* pSprm13) { // #i86652# pNumRule = m_rDoc.GetNumRuleTable()[ - m_rDoc.MakeNumRule( sNumRule, 0, false, + m_rDoc.MakeNumRule( sNumRule, nullptr, false, SvxNumberFormat::LABEL_ALIGNMENT ) ]; } if (m_pTableDesc) @@ -1073,7 +1073,7 @@ void SwWW8ImplReader::StopAnlToRestart(sal_uInt8 nNewType, bool bGoBack) else m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_FLTR_NUMRULE); - m_aANLDRules.mpNumberingNumRule = 0; + m_aANLDRules.mpNumberingNumRule = nullptr; /* #i18816# my take on this problem is that moving either way from an outline to a @@ -1083,7 +1083,7 @@ void SwWW8ImplReader::StopAnlToRestart(sal_uInt8 nNewType, bool bGoBack) (((m_nWwNumType == WW8_Outline) && (nNewType == WW8_Numbering)) || ((m_nWwNumType == WW8_Numbering) && (nNewType == WW8_Outline))); if (!bNumberingNotStopOutline) - m_aANLDRules.mpOutlineNumRule = 0; + m_aANLDRules.mpOutlineNumRule = nullptr; m_nSwNumLevel = 0xff; m_nWwNumType = WW8_None; @@ -1135,9 +1135,9 @@ void WW8TabBandDesc::ReadDef(bool bVer67, const sal_uInt8* pS) nLen -= 2 * ( nCols + 1 ); if( nCols != nOldCols ) // different column count { - delete[] pTCs, pTCs = 0; - delete[] pSHDs, pSHDs = 0; - delete[] pNewSHDs, pNewSHDs = 0; + delete[] pTCs, pTCs = nullptr; + delete[] pSHDs, pSHDs = nullptr; + delete[] pNewSHDs, pNewSHDs = nullptr; } short nFileCols = nLen / ( bVer67 ? 10 : 20 ); // really saved @@ -1589,7 +1589,7 @@ const sal_uInt8 *HasTabCellSprm(WW8PLCFx_Cp_FKP* pPap, bool bVer67) pParams = pPap->HasSprm(24); else { - if (0 == (pParams = pPap->HasSprm(0x244B))) + if (nullptr == (pParams = pPap->HasSprm(0x244B))) pParams = pPap->HasSprm(0x2416); } return pParams; @@ -1718,17 +1718,17 @@ wwTableSprm GetTableSprm(sal_uInt16 nId, ww::WordVersion eVer) } WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : - mpOldRedlineStack(0), + mpOldRedlineStack(nullptr), pIo(pIoClass), - pFirstBand(0), - pActBand(0), - pTmpPos(0), - pTableNd(0), - pTabLines(0), - pTabLine(0), - pTabBoxes(0), - pTabBox(0), - pAktWWCell(0), + pFirstBand(nullptr), + pActBand(nullptr), + pTmpPos(nullptr), + pTableNd(nullptr), + pTabLines(nullptr), + pTabLine(nullptr), + pTabBoxes(nullptr), + pTabBox(nullptr), + pAktWWCell(nullptr), nRows(0), nDefaultSwCols(0), nBands(0), @@ -1746,9 +1746,9 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : nAktBandRow(0), nAktCol(0), nRowsToRepeat(0), - pTable(0), - pParentPos(0), - pFlyFormat(0), + pTable(nullptr), + pParentPos(nullptr), + pFlyFormat(nullptr), aItemSet(pIo->m_rDoc.GetAttrPool(),RES_FRMATR_BEGIN,RES_FRMATR_END-1) { pIo->m_bAktAND_fNumberAcross = false; @@ -1777,12 +1777,12 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : { short nTabeDxaNew = SHRT_MAX; bool bTabRowJustRead = false; - const sal_uInt8* pShadeSprm = 0; - const sal_uInt8* pNewShadeSprm = 0; - const sal_uInt8* pTableBorders = 0; - const sal_uInt8* pTableBorders90 = 0; + const sal_uInt8* pShadeSprm = nullptr; + const sal_uInt8* pNewShadeSprm = nullptr; + const sal_uInt8* pTableBorders = nullptr; + const sal_uInt8* pTableBorders90 = nullptr; std::vector<const sal_uInt8*> aTSetBrcs, aTSetBrc90s; - WW8_TablePos *pTabPos = 0; + WW8_TablePos *pTabPos = nullptr; // search end of a tab row if(!(pIo->SearchRowEnd(pPap, nStartCp, pIo->m_nInTable))) @@ -1801,7 +1801,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : { bool bRepeatedSprm = false; const sal_uInt8* pParams; - while (aSprmIter.GetSprms() && 0 != (pParams = aSprmIter.GetAktParams())) + while (aSprmIter.GetSprms() && nullptr != (pParams = aSprmIter.GetAktParams())) { sal_uInt16 nId = aSprmIter.GetAktId(); wwTableSprm eSprm = GetTableSprm(nId, pIo->GetFib().GetFIBVersion()); @@ -1961,7 +1961,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : //Seek our pap to its next block of properties WW8PLCFxDesc aRes; - aRes.pMemPos = 0; + aRes.pMemPos = nullptr; aRes.nStartPos = nStartCp; if (!(pPap->SeekPos(aRes.nStartPos))) @@ -1999,7 +1999,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : pTabPos = &aTabPos; //Move back to this cell - aRes.pMemPos = 0; + aRes.pMemPos = nullptr; aRes.nStartPos = nStartCp; // PlcxMan currently points too far ahead so we need to bring @@ -2050,7 +2050,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : pNewBand->nRows = 1; pActBand->pNextBand = pNewBand; // am Ende einschleifen nBands++; - pNewBand = 0; // do not delete + pNewBand = nullptr; // do not delete } CalcDefaults(); } @@ -2400,7 +2400,7 @@ void WW8TabDesc::CreateSwTable(SvxULSpaceItem* pULSpaceItem) { if (const SfxItemSet* pSet = pNd->GetpSwAttrSet()) { - SfxPoolItem *pSetAttr = 0; + SfxPoolItem *pSetAttr = nullptr; const SfxPoolItem* pItem; if (SfxItemState::SET == pSet->GetItemState(RES_BREAK, false, &pItem)) { @@ -2523,7 +2523,7 @@ void WW8TabDesc::MergeCells() for( short j = 0; j < pActBand->nRows; j++, nRow++ ) for( short i = 0; i < pActBand->nWwCols; i++ ) { - WW8SelBoxInfo* pActMGroup = 0; + WW8SelBoxInfo* pActMGroup = nullptr; // start a new merge group if appropriate @@ -2608,7 +2608,7 @@ void WW8TabDesc::MergeCells() { WW8SelBoxInfo* p = FindMergeGroup( nX1, pActMGroup->nGroupWidth, false ); - if (p == 0) + if (p == nullptr) { break; } @@ -2633,14 +2633,14 @@ void WW8TabDesc::MergeCells() //match, see #i23022#/#i18644# void WW8TabDesc::ParkPaM() { - SwTableBox *pTabBox2 = 0; + SwTableBox *pTabBox2 = nullptr; short nRow = nAktRow + 1; if (nRow < (sal_uInt16)pTabLines->size()) { if (SwTableLine *pLine = (*pTabLines)[nRow]) { SwTableBoxes &rBoxes = pLine->GetTabBoxes(); - pTabBox2 = rBoxes.empty() ? 0 : rBoxes.front(); + pTabBox2 = rBoxes.empty() ? nullptr : rBoxes.front(); } } @@ -2678,13 +2678,13 @@ void WW8TabDesc::FinishSwTable() pIo->m_pRedlineStack->closeall(*pIo->m_pPaM->GetPoint()); delete pIo->m_pRedlineStack; pIo->m_pRedlineStack = mpOldRedlineStack; - mpOldRedlineStack = 0; + mpOldRedlineStack = nullptr; WW8DupProperties aDup(pIo->m_rDoc,pIo->m_pCtrlStck); pIo->m_pCtrlStck->SetAttr( *pIo->m_pPaM->GetPoint(), 0, false); MoveOutsideTable(); - delete pTmpPos, pTmpPos = 0; + delete pTmpPos, pTmpPos = nullptr; aDup.Insert(*pIo->m_pPaM->GetPoint()); @@ -2716,7 +2716,7 @@ void WW8TabDesc::FinishSwTable() } } } - pIo->m_pFormatOfJustInsertedApo = 0; + pIo->m_pFormatOfJustInsertedApo = nullptr; m_MergeGroups.clear(); } } @@ -2778,7 +2778,7 @@ WW8SelBoxInfo* WW8TabDesc::FindMergeGroup(short nX1, short nWidth, bool bExact) } } } - return 0; + return nullptr; } bool WW8TabDesc::IsValidCell(short nCol) const @@ -2939,7 +2939,7 @@ void WW8TabDesc::InsertCells( short nIns ) pTabBox = (*pTabBoxes)[0]; pIo->m_rDoc.GetNodes().InsBoxen( pTableNd, pTabLine, static_cast<SwTableBoxFormat*>(pTabBox->GetFrameFormat()), - const_cast<SwTextFormatColl*>(pIo->m_pDfltTextFormatColl), 0, pTabBoxes->size(), nIns ); + const_cast<SwTextFormatColl*>(pIo->m_pDfltTextFormatColl), nullptr, pTabBoxes->size(), nIns ); // The third parameter contains the FrameFormat of the boxes. // Here it is possible to optimize to save (reduce) FrameFormats. } @@ -3175,7 +3175,7 @@ void WW8TabDesc::AdjustNewBand() if(nOldBoxRightLineWidth>nCurrentRightLineWidth) aCurrentBox.SetLine(aOldBox.GetLine(SvxBoxItemLine::RIGHT), SvxBoxItemLine::LEFT); - aOldBox.SetLine(0, SvxBoxItemLine::RIGHT); + aOldBox.SetLine(nullptr, SvxBoxItemLine::RIGHT); pBox2->GetFrameFormat()->SetFormatAttr(aOldBox); } @@ -3261,7 +3261,7 @@ SwTableBox* WW8TabDesc::UpdateTableMergeGroup( WW8_TCell& rCell, sal_uInt16 nCol ) { // set default for return - SwTableBox* pResult = 0; + SwTableBox* pResult = nullptr; // check if the box has to be merged // If cell is the first one to be merged, a new merge group has to be provided. @@ -3275,7 +3275,7 @@ SwTableBox* WW8TabDesc::UpdateTableMergeGroup( WW8_TCell& rCell, rCell.bVertRestart ) ) { // detect appropriate merge group - WW8SelBoxInfo* pTheMergeGroup = 0; + WW8SelBoxInfo* pTheMergeGroup = nullptr; if( pActGroup ) // assign group pTheMergeGroup = pActGroup; @@ -3341,15 +3341,15 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp, SvxULSpaceItem* pULSpaceItem) // #i33818# - determine absolute position object attributes, // if possible. It's needed for nested tables. - WW8FlyPara* pTableWFlyPara( 0L ); - WW8SwFlyPara* pTableSFlyPara( 0L ); + WW8FlyPara* pTableWFlyPara( nullptr ); + WW8SwFlyPara* pTableSFlyPara( nullptr ); // #i45301# - anchor nested table inside Writer fly frame // only at-character, if absolute position object attributes are available. // Thus, default anchor type is as-character anchored. RndStdIds eAnchor( FLY_AS_CHAR ); if ( m_nInTable ) { - WW8_TablePos* pNestedTabPos( 0L ); + WW8_TablePos* pNestedTabPos( nullptr ); WW8_TablePos aNestedTabPos; WW8PLCFxSave1 aSave; m_pPlcxMan->GetPap()->Save( aSave ); @@ -3429,7 +3429,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp, SvxULSpaceItem* pULSpaceItem) m_pTableDesc->pFlyFormat->SetFormatAttr( SwFormatFollowTextFlow( true ) ); } else - m_pTableDesc->SetSizePosition(0); + m_pTableDesc->SetSizePosition(nullptr); m_pTableDesc->UseSwTable(); } else @@ -3439,7 +3439,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp, SvxULSpaceItem* pULSpaceItem) delete pTableWFlyPara; delete pTableSFlyPara; - return 0 != m_pTableDesc; + return nullptr != m_pTableDesc; } void SwWW8ImplReader::TabCellEnd() @@ -3473,7 +3473,7 @@ void SwWW8ImplReader::PopTableDesc() delete m_pTableDesc; if (m_aTableStack.empty()) - m_pTableDesc = 0; + m_pTableDesc = nullptr; else { m_pTableDesc = m_aTableStack.top(); @@ -3536,7 +3536,7 @@ sal_uInt16 SwWW8ImplReader::StyleUsingLFO( sal_uInt16 nLFOIndex ) const const SwFormat* SwWW8ImplReader::GetStyleWithOrgWWName( OUString& rName ) const { - SwFormat* pRet = 0; + SwFormat* pRet = nullptr; if( !m_vColl.empty() ) { for(sal_uInt16 nI = 0; nI < m_pStyles->GetCount(); nI++ ) @@ -3555,7 +3555,7 @@ const SwFormat* SwWW8ImplReader::GetStyleWithOrgWWName( OUString& rName ) const const sal_uInt8* WW8RStyle::HasParaSprm( sal_uInt16 nId ) const { if( !pParaSprms || !nSprmsLen ) - return 0; + return nullptr; return maSprmParser.findSprmData(nId, pParaSprms, nSprmsLen); } @@ -3578,7 +3578,7 @@ void WW8RStyle::ImportSprms(sal_uInt8 *pSprms, short nLen, bool bPap) aSprmIter.advance(); } - pParaSprms = 0; + pParaSprms = nullptr; nSprmsLen = 0; } @@ -3679,8 +3679,8 @@ WW8RStyle::WW8RStyle(WW8Fib& _rFib, SwWW8ImplReader* pI) , maSprmParser(_rFib.GetFIBVersion()) , pIo(pI) , pStStrm(pI->m_pTableStream) - , pStyRule(0) - , pParaSprms(0) + , pStyRule(nullptr) + , pParaSprms(nullptr) , nSprmsLen(0) , nWwNumLevel(0) , bTextColChanged(false) @@ -3812,7 +3812,7 @@ bool WW8RStyle::PrepareStyle(SwWW8StyInf &rSI, ww::sti eSti, sal_uInt16 nThisSty rSI.nFollow = nNextStyle; // remember Follow - pStyRule = 0; // recreate if necessary + pStyRule = nullptr; // recreate if necessary bTextColChanged = bFontChanged = bCJKFontChanged = bCTLFontChanged = bFSizeChanged = bFCTLSizeChanged = bWidowsChanged = false; pIo->SetNAktColl( nThisStyle ); @@ -3835,7 +3835,7 @@ void WW8RStyle::PostStyle(SwWW8StyInf &rSI, bool bOldNoImp) Set1StyleDefaults(); } - pStyRule = 0; // to be on the safe side + pStyRule = nullptr; // to be on the safe side pIo->m_bStyNormal = false; pIo->SetNAktColl( 0 ); pIo->m_bNoAttrImport = bOldNoImp; @@ -3959,8 +3959,8 @@ void WW8RStyle::ScanStyles() // investigate style dependencies SwWW8StyInf &rSI = pIo->m_vColl[i]; rSI.nFilePos = pStStrm->Tell(); // remember FilePos - WW8_STD* pStd = Read1Style( nSkip, 0, 0 ); // read STD - rSI.bValid = (0 != pStd); + WW8_STD* pStd = Read1Style( nSkip, nullptr, nullptr ); // read STD + rSI.bValid = (nullptr != pStd); if (rSI.bValid) { rSI.nBase = pStd->istdBase; // remember Basis @@ -4509,7 +4509,7 @@ void WW8RStyle::Import() } // we do not read styles anymore: - pIo->m_pAktColl = 0; + pIo->m_pAktColl = nullptr; } rtl_TextEncoding SwWW8StyInf::GetCharSet() const diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 97670add2009..6d7750b0a8e0 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -140,7 +140,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, OUString& rStr ) { WW8PLCFx_Book* pB = m_pPlcxMan->GetBook(); OUString aBookmarkName; - if (pB!=NULL) { + if (pB!=nullptr) { WW8_CP currentCP=pF->nSCode; WW8_CP currentLen=pF->nLen; @@ -155,7 +155,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, OUString& rStr ) } } - if (pB!=NULL && aBookmarkName.isEmpty()) { + if (pB!=nullptr && aBookmarkName.isEmpty()) { aBookmarkName=pB->GetUniqueBookmarkName(aFormula.msTitle); } @@ -191,7 +191,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, OUString& rStr ) OUString aBookmarkName; WW8PLCFx_Book* pB = m_pPlcxMan->GetBook(); - if (pB!=NULL) { + if (pB!=nullptr) { WW8_CP currentCP=pF->nSCode; WW8_CP currentLen=pF->nLen; @@ -206,7 +206,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, OUString& rStr ) } } - if (pB!=NULL && aBookmarkName.isEmpty()) { + if (pB!=nullptr && aBookmarkName.isEmpty()) { aBookmarkName=pB->GetUniqueBookmarkName(aFormula.msTitle); } @@ -215,8 +215,8 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, OUString& rStr ) IDocumentMarkAccess* pMarksAccess = m_rDoc.getIDocumentMarkAccess( ); IFieldmark* pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeNoTextFieldBookmark( *m_pPaM, aBookmarkName, ODF_FORMCHECKBOX ) ); - OSL_ENSURE(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); - if (pFieldmark!=NULL) { + OSL_ENSURE(pFieldmark!=nullptr, "hmmm; why was the bookmark not created?"); + if (pFieldmark!=nullptr) { IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters(); ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(pFieldmark); (*pParameters)[ODF_FORMCHECKBOX_NAME] = uno::makeAny(OUString(aFormula.msTitle)); @@ -263,7 +263,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormListBox( WW8FieldDesc* pF, OUString& rStr) // TODO: review me OUString aBookmarkName; WW8PLCFx_Book* pB = m_pPlcxMan->GetBook(); - if (pB!=NULL) + if (pB!=nullptr) { WW8_CP currentCP=pF->nSCode; WW8_CP currentLen=pF->nLen; @@ -279,7 +279,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormListBox( WW8FieldDesc* pF, OUString& rStr) } } - if (pB!=NULL && aBookmarkName.isEmpty()) + if (pB!=nullptr && aBookmarkName.isEmpty()) aBookmarkName=pB->GetUniqueBookmarkName(aFormula.msTitle); if (!aBookmarkName.isEmpty()) @@ -287,8 +287,8 @@ eF_ResT SwWW8ImplReader::Read_F_FormListBox( WW8FieldDesc* pF, OUString& rStr) IDocumentMarkAccess* pMarksAccess = m_rDoc.getIDocumentMarkAccess( ); IFieldmark *pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeNoTextFieldBookmark( *m_pPaM, aBookmarkName, ODF_FORMDROPDOWN ) ); - OSL_ENSURE(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); - if ( pFieldmark != NULL ) + OSL_ENSURE(pFieldmark!=nullptr, "hmmm; why was the bookmark not created?"); + if ( pFieldmark != nullptr ) { uno::Sequence< OUString > vListEntries(aFormula.maListEntries.size()); ::std::copy(aFormula.maListEntries.begin(), aFormula.maListEntries.end(), vListEntries.begin()); @@ -313,7 +313,7 @@ eF_ResT SwWW8ImplReader::Read_F_HTMLControl(WW8FieldDesc*, OUString&) void SwWW8ImplReader::DeleteFormImpl() { - delete m_pFormImpl, m_pFormImpl = 0; + delete m_pFormImpl, m_pFormImpl = nullptr; } // Hilfs-Deklarationen @@ -476,7 +476,7 @@ WW8LSTInfo* WW8ListManager::GetLSTByListId( sal_uInt32 nIdLst ) const std::vector<WW8LSTInfo *>::const_iterator aResult = std::find_if(maLSTInfos.begin(),maLSTInfos.end(),ListWithId(nIdLst)); if (aResult == maLSTInfos.end()) - return 0; + return nullptr; return *aResult; } @@ -581,8 +581,8 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, SfxItemSet*& rpItemSet, // "sprmPDxaLeft" pap.dxaLeft;dxa;word; sal_uInt8* pSprm; if ( - (0 != (pSprm = GrpprlHasSprm(0x840F,aGrpprlPapx[0],aLVL.nLenGrpprlPapx))) || - (0 != (pSprm = GrpprlHasSprm(0x845E,aGrpprlPapx[0],aLVL.nLenGrpprlPapx))) + (nullptr != (pSprm = GrpprlHasSprm(0x840F,aGrpprlPapx[0],aLVL.nLenGrpprlPapx))) || + (nullptr != (pSprm = GrpprlHasSprm(0x845E,aGrpprlPapx[0],aLVL.nLenGrpprlPapx))) ) { sal_uInt8 *pBegin = pSprm-2; @@ -595,8 +595,8 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, SfxItemSet*& rpItemSet, // "sprmPDxaLeft1" pap.dxaLeft1;dxa;word; if ( - (0 != (pSprm = GrpprlHasSprm(0x8411,aGrpprlPapx[0],aLVL.nLenGrpprlPapx)) ) || - (0 != (pSprm = GrpprlHasSprm(0x8460,aGrpprlPapx[0],aLVL.nLenGrpprlPapx)) ) + (nullptr != (pSprm = GrpprlHasSprm(0x8411,aGrpprlPapx[0],aLVL.nLenGrpprlPapx)) ) || + (nullptr != (pSprm = GrpprlHasSprm(0x8460,aGrpprlPapx[0],aLVL.nLenGrpprlPapx)) ) ) { sal_uInt8 *pBegin = pSprm-2; @@ -606,7 +606,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, SfxItemSet*& rpItemSet, } // #i86652# - read tab setting - if(0 != (pSprm = GrpprlHasSprm(0xC615,aGrpprlPapx[0],aLVL.nLenGrpprlPapx)) ) + if(nullptr != (pSprm = GrpprlHasSprm(0xC615,aGrpprlPapx[0],aLVL.nLenGrpprlPapx)) ) { bool bDone = false; if (*(pSprm-1) == 5) @@ -720,7 +720,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, SfxItemSet*& rpItemSet, } // Reader-ItemSet-Pointer und Reader-Style zuruecksetzen - rReader.SetAktItemSet( 0 ); + rReader.SetAktItemSet( nullptr ); rReader.SetNAktColl( nOldColl ); rReader.SetToggleAttrFlags(nOldFlags1); rReader.SetToggleBiDiAttrFlags(nOldFlags2); @@ -1118,7 +1118,7 @@ SwNumRule* WW8ListManager::CreateNextRule(bool bSimple) const OUString sPrefix("WW8Num" + OUString::number(nUniqueList++)); // #i86652# sal_uInt16 nRul = - rDoc.MakeNumRule( rDoc.GetUniqueNumRuleName(&sPrefix), 0, false, + rDoc.MakeNumRule( rDoc.GetUniqueNumRuleName(&sPrefix), nullptr, false, SvxNumberFormat::LABEL_ALIGNMENT ); SwNumRule* pMyNumRule = rDoc.GetNumRuleTable()[nRul]; pMyNumRule->SetAutoRule(false); @@ -1131,7 +1131,7 @@ SwNumRule* WW8ListManager::GetNumRule(size_t i) if (i < maLSTInfos.size()) return maLSTInfos[i]->pNumRule; else - return 0; + return nullptr; } // oeffentliche Methoden @@ -1555,7 +1555,7 @@ SwNumRule* WW8ListManager::GetNumRuleForActivation(sal_uInt16 nLFOPosition, const sal_uInt8 nLevel, std::vector<sal_uInt8> &rParaSprms, SwTextNode *pNode) { if (m_LFOInfos.size() <= nLFOPosition) - return 0; + return nullptr; WW8LFOInfo& rLFOInfo = *m_LFOInfos[nLFOPosition]; @@ -1563,7 +1563,7 @@ SwNumRule* WW8ListManager::GetNumRuleForActivation(sal_uInt16 nLFOPosition, rLFOInfo.bUsedInDoc = true; if( !rLFOInfo.pNumRule ) - return 0; + return nullptr; // #i25545# // #i100132# - a number format does not have to exist on given list level @@ -1793,7 +1793,7 @@ void SwWW8ImplReader::RegisterNumFormatOnStyle(sal_uInt16 nStyle) ItemGet<SvxLRSpaceItem>(*rStyleInf.pFormat, RES_LR_SPACE); // Phase 2: aktualisieren der StyleDef nach einlesen aller Listen - SwNumRule* pNmRule = 0; + SwNumRule* pNmRule = nullptr; const sal_uInt16 nLFO = rStyleInf.nLFOIndex; const sal_uInt8 nLevel = rStyleInf.nListLevel; if ( @@ -1805,7 +1805,7 @@ void SwWW8ImplReader::RegisterNumFormatOnStyle(sal_uInt16 nStyle) pNmRule = m_pLstManager->GetNumRuleForActivation(nLFO, nLevel, aParaSprms); - if (pNmRule != NULL) + if (pNmRule != nullptr) { if (rStyleInf.IsWW8BuiltInHeadingStyle() && rStyleInf.HasWW8OutlineLevel()) @@ -1845,9 +1845,9 @@ void SwWW8ImplReader::RegisterNumFormatOnTextNode(sal_uInt16 nActLFO, std::vector<sal_uInt8> aParaSprms; const SwNumRule* pRule = bSetAttr ? m_pLstManager->GetNumRuleForActivation( nActLFO, nActLevel, - aParaSprms, pTextNd) : 0; + aParaSprms, pTextNd) : nullptr; - if (pRule != NULL || !bSetAttr) + if (pRule != nullptr || !bSetAttr) { if (bSetAttr && pTextNd->GetNumRule() != pRule && pTextNd->GetNumRule() != m_rDoc.GetOutlineNumRule()) @@ -2300,7 +2300,7 @@ awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString, { RES_CHRATR_UNDERLINE, "FontUnderline" }, { RES_CHRATR_CROSSEDOUT, "FontStrikeout" }, { RES_CHRATR_POSTURE, "FontSlant" }, - { 0, 0 } + { 0, nullptr } }; vcl::Font aFont; diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index a8f4856627a6..586be7d8758e 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -202,11 +202,11 @@ SwFlyFrameFormat* SwWW8ImplReader::InsertOle(SdrOle2Obj &rObject, SfxObjectShell *pPersist = m_rDoc.GetPersist(); OSL_ENSURE(pPersist, "No persist, cannot insert objects correctly"); if (!pPersist) - return 0; + return nullptr; - SwFlyFrameFormat *pRet = 0; + SwFlyFrameFormat *pRet = nullptr; - SfxItemSet *pMathFlySet = 0; + SfxItemSet *pMathFlySet = nullptr; uno::Reference < embed::XClassifiedObject > xClass( rObject.GetObjRef(), uno::UNO_QUERY ); if( xClass.is() ) { @@ -235,7 +235,7 @@ SwFlyFrameFormat* SwWW8ImplReader::InsertOle(SdrOle2Obj &rObject, if (bSuccess) { const SfxItemSet *pFlySet = pMathFlySet ? pMathFlySet : &rFlySet; - pRet = m_rDoc.getIDocumentContentOperations().InsertOLE(*m_pPaM, sNewName, rObject.GetAspect(), pFlySet, rGrfSet, 0); + pRet = m_rDoc.getIDocumentContentOperations().InsertOLE(*m_pPaM, sNewName, rObject.GetAspect(), pFlySet, rGrfSet, nullptr); } delete pMathFlySet; return pRet; @@ -245,7 +245,7 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf, const SfxItemSet* pFlySet, const SfxItemSet *pGrfSet, const Rectangle& aVisArea ) { ::SetProgressState(m_nProgress, m_pDocShell); // Update - SwFrameFormat* pFormat = 0; + SwFrameFormat* pFormat = nullptr; GrafikCtor(); @@ -253,7 +253,7 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf, SdrObject* pRet = ImportOleBase(aGraph, pGrf, pFlySet, aVisArea ); // create flyset - SfxItemSet* pTempSet = 0; + SfxItemSet* pTempSet = nullptr; if( !pFlySet ) { pTempSet = new SfxItemSet( m_rDoc.GetAttrPool(), RES_FRMATR_BEGIN, @@ -300,7 +300,7 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf, ) { pFormat = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, OUString(), OUString(), &aGraph, pFlySet, - pGrfSet, NULL); + pGrfSet, nullptr); } delete pTempSet; return pFormat; @@ -387,7 +387,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, } } - SdrObject* pRet = 0; + SdrObject* pRet = nullptr; if (!(m_bIsHeader || m_bIsFooter)) { @@ -413,7 +413,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, { sal_uLong nOldPos = m_pDataStream->Tell(); m_pDataStream->Seek(STREAM_SEEK_TO_END); - SvStream *pTmpData = 0; + SvStream *pTmpData = nullptr; if (m_nObjLocFc < m_pDataStream->Tell()) { pTmpData = m_pDataStream; @@ -490,18 +490,18 @@ void SwWW8ImplReader::Read_CRevisionMark(RedlineType_t eType, if( m_bVer67 ) { m_pPlcxMan->HasCharSprm(69, aResult); - pSprmCIbstRMark = aResult.empty() ? 0 : aResult.back(); + pSprmCIbstRMark = aResult.empty() ? nullptr : aResult.back(); aResult.clear(); m_pPlcxMan->HasCharSprm(70, aResult); - pSprmCDttmRMark = aResult.empty() ? 0 : aResult.back(); + pSprmCDttmRMark = aResult.empty() ? nullptr : aResult.back(); } else { m_pPlcxMan->HasCharSprm( bIns ? 0x4804 : 0x4863, aResult); - pSprmCIbstRMark = aResult.empty() ? 0 : aResult.back(); + pSprmCIbstRMark = aResult.empty() ? nullptr : aResult.back(); aResult.clear(); m_pPlcxMan->HasCharSprm( bIns ? 0x6805 : NS_sprm::LN_CDttmRMarkDel, aResult); - pSprmCDttmRMark = aResult.empty() ? 0 : aResult.back(); + pSprmCDttmRMark = aResult.empty() ? nullptr : aResult.back(); } } diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 595ab85ef7a5..77960c9dc545 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -506,14 +506,14 @@ sal_uInt16 SwWW8ImplReader::End_Field() switch (nRet) { case 70: - if (bUseEnhFields && m_pPaM!=NULL && m_pPaM->GetPoint()!=NULL) { + if (bUseEnhFields && m_pPaM!=nullptr && m_pPaM->GetPoint()!=nullptr) { SwPosition aEndPos = *m_pPaM->GetPoint(); SwPaM aFieldPam( m_aFieldStack.back().GetPtNode(), m_aFieldStack.back().GetPtContent(), aEndPos.nNode, aEndPos.nContent.GetIndex()); IDocumentMarkAccess* pMarksAccess = m_rDoc.getIDocumentMarkAccess( ); IFieldmark *pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeFieldBookmark( aFieldPam, m_aFieldStack.back().GetBookmarkName(), ODF_FORMTEXT ) ); - OSL_ENSURE(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); - if (pFieldmark!=NULL) { + OSL_ENSURE(pFieldmark!=nullptr, "hmmm; why was the bookmark not created?"); + if (pFieldmark!=nullptr) { const IFieldmark::parameter_map_t& pParametersToAdd = m_aFieldStack.back().getParameters(); pFieldmark->GetParameters()->insert(pParametersToAdd.begin(), pParametersToAdd.end()); } @@ -548,7 +548,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() { *m_pPaM = *m_pPosAfterTOC; delete m_pPosAfterTOC; - m_pPosAfterTOC = 0; + m_pPosAfterTOC = nullptr; } } } @@ -713,18 +713,18 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) enum Limits {eMax = 96}; static const FNReadField aWW8FieldTab[eMax+1] = { - 0, + nullptr, &SwWW8ImplReader::Read_F_Input, - 0, + nullptr, &SwWW8ImplReader::Read_F_Ref, // 3 - 0, - 0, + nullptr, + nullptr, &SwWW8ImplReader::Read_F_Set, // 6 - 0, + nullptr, &SwWW8ImplReader::Read_F_Tox, // 8 - 0, - 0, - 0, + nullptr, + nullptr, + nullptr, &SwWW8ImplReader::Read_F_Seq, // 12 &SwWW8ImplReader::Read_F_Tox, // 13 &SwWW8ImplReader::Read_F_DocInfo, // 14 @@ -747,71 +747,71 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) &SwWW8ImplReader::Read_F_DateTime, // 31 &SwWW8ImplReader::Read_F_DateTime, // 32 &SwWW8ImplReader::Read_F_CurPage, // 33 - 0, - 0, + nullptr, + nullptr, &SwWW8ImplReader::Read_F_IncludeText, // 36 &SwWW8ImplReader::Read_F_PgRef, // 37 &SwWW8ImplReader::Read_F_InputVar, // 38 &SwWW8ImplReader::Read_F_Input, // 39 - 0, + nullptr, &SwWW8ImplReader::Read_F_DBNext, // 41 - 0, - 0, + nullptr, + nullptr, &SwWW8ImplReader::Read_F_DBNum, // 44 - 0, - 0, - 0, - 0, + nullptr, + nullptr, + nullptr, + nullptr, &SwWW8ImplReader::Read_F_Equation, // 49 - 0, + nullptr, &SwWW8ImplReader::Read_F_Macro, // 51 &SwWW8ImplReader::Read_F_ANumber, // 52 &SwWW8ImplReader::Read_F_ANumber, // 53 &SwWW8ImplReader::Read_F_ANumber, // 54 - 0, + nullptr, - 0, // 56 + nullptr, // 56 &SwWW8ImplReader::Read_F_Symbol, // 57 &SwWW8ImplReader::Read_F_Embedd, // 58 &SwWW8ImplReader::Read_F_DBField, // 59 - 0, - 0, - 0, - 0, + nullptr, + nullptr, + nullptr, + nullptr, &SwWW8ImplReader::Read_F_DocInfo, // 64 - DOCVARIABLE - 0, - 0, + nullptr, + nullptr, &SwWW8ImplReader::Read_F_IncludePicture, // 67 &SwWW8ImplReader::Read_F_IncludeText, // 68 - 0, + nullptr, &SwWW8ImplReader::Read_F_FormTextBox, // 70 &SwWW8ImplReader::Read_F_FormCheckBox, // 71 &SwWW8ImplReader::Read_F_NoteReference, // 72 - 0, /*&SwWW8ImplReader::Read_F_Tox*/ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, + nullptr, /*&SwWW8ImplReader::Read_F_Tox*/ + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, &SwWW8ImplReader::Read_F_FormListBox, // 83 - 0, // 84 + nullptr, // 84 &SwWW8ImplReader::Read_F_DocInfo, // 85 - 0, // 86 + nullptr, // 86 &SwWW8ImplReader::Read_F_OCX, // 87 &SwWW8ImplReader::Read_F_Hyperlink, // 88 - 0, // 89 - 0, // 90 + nullptr, // 89 + nullptr, // 90 &SwWW8ImplReader::Read_F_HTMLControl, // 91 - 0, // 92 - 0, // 93 - 0, // 94 + nullptr, // 92 + nullptr, // 93 + nullptr, // 94 &SwWW8ImplReader::Read_F_Shape, // 95 - 0 // eMax - Dummy leer Methode + nullptr // eMax - Dummy leer Methode }; OSL_ENSURE( ( sizeof( aWW8FieldTab ) / sizeof( *aWW8FieldTab ) == eMax+1 ), "FeldFunc-Tabelle stimmt nicht" ); @@ -1232,7 +1232,7 @@ filter itself. SwFltStackEntry *SwWW8FltRefStack::RefToVar(const SwField* pField, SwFltStackEntry &rEntry) { - SwFltStackEntry *pRet=0; + SwFltStackEntry *pRet=nullptr; if (pField && RES_GETREFFLD == pField->Which()) { //Get the name of the ref field, and see if actually a variable @@ -2324,9 +2324,9 @@ eF_ResT SwWW8ImplReader::Read_F_IncludePicture( WW8FieldDesc*, OUString& rStr ) m_pFlyFormatOfJustInsertedGraphic = m_rDoc.getIDocumentContentOperations().Insert( *m_pPaM, aGrfName, OUString(), - 0, // Graphic* + nullptr, // Graphic* &aFlySet, - 0, 0); // SwFrameFormat* + nullptr, nullptr); // SwFrameFormat* m_aGrfNameGenerator.SetUniqueGraphName(m_pFlyFormatOfJustInsertedGraphic, INetURLObject(aGrfName).GetBase()); } @@ -2389,7 +2389,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludeText( WW8FieldDesc* /*pF*/, OUString& rSt aSection.SetProtectFlag(true); SwSection *const pSection = - m_rDoc.InsertSwSection(*m_pPaM, aSection, 0, 0, false); + m_rDoc.InsertSwSection(*m_pPaM, aSection, nullptr, nullptr, false); OSL_ENSURE(pSection, "no section inserted"); if (!pSection) return FLD_TEXT; @@ -2617,7 +2617,7 @@ void SwWW8ImplReader::Read_SubF_Ruby( WW8ReadFieldParams& rReadParam) } SwFormatRuby aRuby(sRuby); - const SwCharFormat *pCharFormat=0; + const SwCharFormat *pCharFormat=nullptr; //Make a guess at which of asian of western we should be setting sal_uInt16 nScript; if (g_pBreakIt->GetBreakIter().is()) @@ -2649,7 +2649,7 @@ void SwWW8ImplReader::Read_SubF_Ruby( WW8ReadFieldParams& rReadParam) //Create a new char style if necessary if (!pCharFormat) { - SwCharFormat *pFormat=0; + SwCharFormat *pFormat=nullptr; OUString aNm; //Take this as the base name SwStyleNameMapper::FillUIName(RES_POOLCHR_RUBYTEXT,aNm); @@ -2990,7 +2990,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) case 'o': { sal_Int32 nVal; - if( !aReadParam.GetTokenSttFromTo(0, &nVal, WW8ListManager::nMaxLevel) ) + if( !aReadParam.GetTokenSttFromTo(nullptr, &nVal, WW8ListManager::nMaxLevel) ) nVal = lcl_GetMaxValidWordTOCLevel(aOrigForm); if( nMaxLevel < nVal ) nMaxLevel = nVal; @@ -3003,7 +3003,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) case 'l': { sal_Int32 nVal; - if( aReadParam.GetTokenSttFromTo(0, &nVal, WW8ListManager::nMaxLevel) ) + if( aReadParam.GetTokenSttFromTo(nullptr, &nVal, WW8ListManager::nMaxLevel) ) { if( nMaxLevel < nVal ) nMaxLevel = nVal; @@ -3183,7 +3183,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) // In an ideal world we could handle the tab stop between the number and // the entry correctly, but I currently have no clue how to obtain // the tab stop position. It is _not_ set at the paragraph style. - SwForm* pForm = 0; + SwForm* pForm = nullptr; for (size_t nI = 0; nI < m_vColl.size(); ++nI) { const SwWW8StyInf& rSI = m_vColl[nI]; diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 958f50680d6f..2d88ac7464eb 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -112,7 +112,7 @@ using namespace nsHdFtFlags; static sal_uInt8 lcl_ReadBorders(bool bVer67, WW8_BRCVer9* brc, WW8PLCFx_Cp_FKP* pPap, - const WW8RStyle* pSty = 0, const WW8PLCFx_SEPX* pSep = 0); + const WW8RStyle* pSty = nullptr, const WW8PLCFx_SEPX* pSep = nullptr); ColorData SwWW8ImplReader::GetCol(sal_uInt8 nIco) { @@ -661,16 +661,16 @@ SwSectionFormat *wwSectionManager::InsertSection( aSection.SetProtectFlag(SectionIsProtected(rSection)); rSection.mpSection = - mrReader.m_rDoc.InsertSwSection( rMyPaM, aSection, 0, & aSet ); + mrReader.m_rDoc.InsertSwSection( rMyPaM, aSection, nullptr, & aSet ); OSL_ENSURE(rSection.mpSection, "section not inserted!"); if (!rSection.mpSection) - return 0; + return nullptr; - SwPageDesc *pPage = 0; + SwPageDesc *pPage = nullptr; mySegrIter aEnd = maSegments.rend(); for (mySegrIter aIter = maSegments.rbegin(); aIter != aEnd; ++aIter) { - if (0 != (pPage = aIter->mpPage)) + if (nullptr != (pPage = aIter->mpPage)) break; } @@ -680,12 +680,12 @@ SwSectionFormat *wwSectionManager::InsertSection( pPage = &mrReader.m_rDoc.GetPageDesc(0); if (!pPage) - return 0; + return nullptr; SwSectionFormat *pFormat = rSection.mpSection->GetFormat(); OSL_ENSURE(pFormat, "impossible"); if (!pFormat) - return 0; + return nullptr; SwFrameFormat& rFormat = pPage->GetMaster(); const SvxLRSpaceItem& rLR = rFormat.GetLRSpace(); @@ -755,8 +755,8 @@ void SwWW8ImplReader::HandleLineNumbering(const wwSection &rSection) } wwSection::wwSection(const SwPosition &rPos) : maStart(rPos.nNode) - , mpSection(0) - , mpPage(0) + , mpSection(nullptr) + , mpPage(nullptr) , meDir(FRMDIR_HORI_LEFT_TOP) , mLinkId(0) , nPgWidth(SvxPaperInfo::GetPaperSize(PAPER_A4).Width()) @@ -834,7 +834,7 @@ void wwSectionManager::CreateSep(const long nTextPos, bool /*bMustHaveBreak*/) aSection.SetLinkFileName( sSectionName ); aSection.SetProtectFlag(true); // #i19922# - improvement: return value of method <Insert> not used. - mrReader.m_rDoc.InsertSwSection(*mrReader.m_pPaM, aSection, 0, 0, false); + mrReader.m_rDoc.InsertSwSection(*mrReader.m_pPaM, aSection, nullptr, nullptr, false); } wwSection aLastSection(*mrReader.m_pPaM->GetPoint()); @@ -1112,7 +1112,7 @@ void wwSectionManager::CreateSep(const long nTextPos, bool /*bMustHaveBreak*/) aNewSection.maSep.pgbOffsetFrom = (pgbProp & 0x00E0) >> 5; aNewSection.mnBorders = - ::lcl_ReadBorders(eVer <= ww::eWW7, aNewSection.brc, 0, 0, pSep); + ::lcl_ReadBorders(eVer <= ww::eWW7, aNewSection.brc, nullptr, nullptr, pSep); } // check if Line Numbering must be activated or reset @@ -1237,7 +1237,7 @@ static bool _SetWW8_BRC(int nBrcVer, WW8_BRCVer9& rVar, const sal_uInt8* pS) rVar = WW8_BRCVer9(WW8_BRC(*reinterpret_cast<const WW8_BRCVer6*>(pS))); } - return 0 != pS; + return nullptr != pS; } static sal_uInt8 lcl_ReadBorders(bool bVer67, WW8_BRCVer9* brc, WW8PLCFx_Cp_FKP* pPap, @@ -1327,7 +1327,7 @@ static sal_uInt8 lcl_ReadBorders(bool bVer67, WW8_BRCVer9* brc, WW8PLCFx_Cp_FKP* void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, sal_uInt32 cv, short nIdx, SvxBoxItemLine nOOIndex, sal_uInt16 nWWIndex, - short *pSize=0) + short *pSize=nullptr) { // LO cannot handle outset/inset (new in WW9 BRC) so fall back same as WW8 if ( nIdx == 0x1A || nIdx == 0x1B ) @@ -1418,7 +1418,7 @@ bool SwWW8ImplReader::SetBorder(SvxBoxItem& rBox, const WW8_BRCVer9* pbrc, border, so with a sprm set, but no border, then disable the appropriate border */ - rBox.SetLine( 0, aIdArr[ i ].second ); + rBox.SetLine( nullptr, aIdArr[ i ].second ); } } return bChange; @@ -1494,7 +1494,7 @@ inline bool SetValSprm( sal_Int16* pVar, WW8PLCFx_Cp_FKP* pPap, sal_uInt16 nId ) const sal_uInt8* pS = pPap->HasSprm( nId ); if( pS ) *pVar = (sal_Int16)SVBT16ToShort( pS ); - return ( pS != 0 ); + return ( pS != nullptr ); } inline bool SetValSprm( sal_Int16* pVar, const WW8RStyle* pStyle, sal_uInt16 nId ) @@ -1502,7 +1502,7 @@ inline bool SetValSprm( sal_Int16* pVar, const WW8RStyle* pStyle, sal_uInt16 nId const sal_uInt8* pS = pStyle->HasParaSprm( nId ); if( pS ) *pVar = (sal_Int16)SVBT16ToShort( pS ); - return ( pS != 0 ); + return ( pS != nullptr ); } /* @@ -1561,7 +1561,7 @@ bool WW8FlyPara::operator==(const WW8FlyPara& rSrc) const // Read for normal text void WW8FlyPara::Read(sal_uInt8 nOrigSp29, WW8PLCFx_Cp_FKP* pPap) { - const sal_uInt8* pS = 0; + const sal_uInt8* pS = nullptr; if( bVer67 ) { SetValSprm( &nSp26, pPap, 26 ); // X-position //sprmPDxaAbs @@ -1653,10 +1653,10 @@ void WW8FlyPara::ReadFull(sal_uInt8 nOrigSp29, SwWW8ImplReader* pIo) } ww::WordVersion eVer = pIo->GetFib().GetFIBVersion(); - WW8FlyPara *pNowStyleApo=0; + WW8FlyPara *pNowStyleApo=nullptr; sal_uInt16 nColl = pPap->GetIstd(); ww::sti eSti = eVer < ww::eWW6 ? ww::GetCanonicalStiFromStc( static_cast< sal_uInt8 >(nColl) ) : static_cast<ww::sti>(nColl); - while (eSti != ww::stiNil && nColl < pIo->m_vColl.size() && 0 == (pNowStyleApo = pIo->m_vColl[nColl].pWWFly)) + while (eSti != ww::stiNil && nColl < pIo->m_vColl.size() && nullptr == (pNowStyleApo = pIo->m_vColl[nColl].pWWFly)) { nColl = pIo->m_vColl[nColl].nBase; eSti = eVer < ww::eWW6 ? ww::GetCanonicalStiFromStc( static_cast< sal_uInt8 >(nColl) ) : static_cast<ww::sti>(nColl); @@ -1679,7 +1679,7 @@ void WW8FlyPara::ReadFull(sal_uInt8 nOrigSp29, SwWW8ImplReader* pIo) // read for Apo definitions in Styledefs void WW8FlyPara::Read(sal_uInt8 nOrigSp29, WW8RStyle* pStyle) { - const sal_uInt8* pS = 0; + const sal_uInt8* pS = nullptr; if (bVer67) { SetValSprm( &nSp26, pStyle, 26 ); // X-position @@ -1713,7 +1713,7 @@ void WW8FlyPara::Read(sal_uInt8 nOrigSp29, WW8RStyle* pStyle) nSp37 = *pS; } - if (::lcl_ReadBorders(bVer67, brc, 0, pStyle)) // border + if (::lcl_ReadBorders(bVer67, brc, nullptr, pStyle)) // border bBorderLines = ::lcl_IsBorder(brc); /* @@ -2162,7 +2162,7 @@ void WW8DupProperties::Insert(const SwPosition &rPos) do { pCtrlStck->NewAttr(rPos, *pItem); - }while( !aIter.IsAtEnd() && 0 != ( pItem = aIter.NextItem() ) ); + }while( !aIter.IsAtEnd() && nullptr != ( pItem = aIter.NextItem() ) ); } } } @@ -2263,7 +2263,7 @@ SwTwips SwWW8ImplReader::MoveOutsideFly(SwFrameFormat *pFlyFormat, WW8FlyPara *SwWW8ImplReader::ConstructApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos) { - WW8FlyPara *pRet = 0; + WW8FlyPara *pRet = nullptr; OSL_ENSURE(rApo.HasFrame() || pTabPos, "If no frame found, *MUST* be in a table"); @@ -2276,7 +2276,7 @@ WW8FlyPara *SwWW8ImplReader::ConstructApo(const ApoTestResults &rApo, pRet->ApplyTabPos(pTabPos); if (pRet->IsEmpty()) - delete pRet, pRet = 0; + delete pRet, pRet = nullptr; return pRet; } @@ -2285,7 +2285,7 @@ bool SwWW8ImplReader::IsDropCap() // Find the DCS (Drop Cap Specifier) for the paragraph // if does not exist or if the first three bits are 0 // then there is no dropcap on the paragraph - WW8PLCFx_Cp_FKP *pPap = m_pPlcxMan ? m_pPlcxMan->GetPapPLCF() : 0; + WW8PLCFx_Cp_FKP *pPap = m_pPlcxMan ? m_pPlcxMan->GetPapPLCF() : nullptr; if (pPap) { const sal_uInt8 *pDCS; @@ -2313,7 +2313,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos, SvxULSpaceItem* pULSpaceItem) { - if (0 == (m_pWFlyPara = ConstructApo(rApo, pTabPos))) + if (nullptr == (m_pWFlyPara = ConstructApo(rApo, pTabPos))) return false; // <WW8SwFlyPara> constructor has changed - new 4th parameter @@ -2345,7 +2345,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, if (pTabPos && pTabPos->bNoFly) { - m_pSFlyPara->pFlyFormat = 0; + m_pSFlyPara->pFlyFormat = nullptr; if (pULSpaceItem) { // Word positioned tables can have a position (like a @@ -2353,7 +2353,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, // pages. If we decide to import this as a normal table (so it // can flow across multiple pages), then turn the vertical // orientation position of the fly into a table upper margin. - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if (aFlySet.HasItem(RES_VERT_ORIENT, &pItem)) { const SwFormatVertOrient* pOrient = static_cast<const SwFormatVertOrient*>(pItem); @@ -2582,7 +2582,7 @@ void SwWW8ImplReader::StopApo() m_pSFlyPara->pFlyFormat->SetFormatAttr(aSize); } - delete m_pSFlyPara->pMainTextPos, m_pSFlyPara->pMainTextPos = 0; + delete m_pSFlyPara->pMainTextPos, m_pSFlyPara->pMainTextPos = nullptr; // To create the SwFrms when inserting into an existing document, fltshell.cxx // will call pFlyFrm->MakeFrms() when setting the FltAnchor attribute @@ -2665,14 +2665,14 @@ void SwWW8ImplReader::NewAttr( const SfxPoolItem& rAttr, // fetches attribute from FormatColl / Stack / Doc const SfxPoolItem* SwWW8ImplReader::GetFormatAttr( sal_uInt16 nWhich ) { - const SfxPoolItem* pRet = 0; + const SfxPoolItem* pRet = nullptr; if (m_pAktColl) pRet = &(m_pAktColl->GetFormatAttr(nWhich)); else if (m_pAktItemSet) { pRet = m_pAktItemSet->GetItem(nWhich); if (!pRet) - pRet = m_pStandardFormatColl ? &(m_pStandardFormatColl->GetFormatAttr(nWhich)) : 0; + pRet = m_pStandardFormatColl ? &(m_pStandardFormatColl->GetFormatAttr(nWhich)) : nullptr; if (!pRet) pRet = &m_rDoc.GetAttrPool().GetDefaultItem(nWhich); } @@ -2688,7 +2688,7 @@ const SfxPoolItem* SwWW8ImplReader::GetFormatAttr( sal_uInt16 nWhich ) } } if (!pRet) - pRet = m_pStandardFormatColl ? &(m_pStandardFormatColl->GetFormatAttr(nWhich)) : 0; + pRet = m_pStandardFormatColl ? &(m_pStandardFormatColl->GetFormatAttr(nWhich)) : nullptr; if (!pRet) pRet = &m_rDoc.GetAttrPool().GetDefaultItem(nWhich); } @@ -2758,17 +2758,17 @@ void SwWW8ImplReader::Read_POutLvl(sal_uInt16, const sal_uInt8* pData, short nLe return; } - if (m_pAktColl != NULL) + if (m_pAktColl != nullptr) { SwWW8StyInf* pSI = GetStyle(m_nAktColl); - if (pSI != NULL) + if (pSI != nullptr) { pSI->mnWW8OutlineLevel = static_cast< sal_uInt8 >( ( pData ? *pData : 0 ) ); NewAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL, SwWW8StyInf::WW8OutlineLevelToOutlinelevel( pSI->mnWW8OutlineLevel ) ) ); } } - else if (m_pPaM != NULL) + else if (m_pPaM != nullptr) { const sal_uInt8 nOutlineLevel = SwWW8StyInf::WW8OutlineLevelToOutlinelevel( @@ -2821,7 +2821,7 @@ void SwWW8ImplReader::Read_Symbol(sal_uInt16, const sal_uInt8* pData, short nLen SwWW8StyInf *SwWW8ImplReader::GetStyle(sal_uInt16 nColl) const { - return const_cast<SwWW8StyInf *>(nColl < m_vColl.size() ? &m_vColl[nColl] : 0); + return const_cast<SwWW8StyInf *>(nColl < m_vColl.size() ? &m_vColl[nColl] : nullptr); } // Read_BoldUsw for italic, bold, small caps, majuscule, struck out, @@ -3171,7 +3171,7 @@ SwFrameFormat *SwWW8ImplReader::ContainsSingleInlineGraphic(const SwPaM &rRegion contains only a single graphic, and if that graphic is anchored as FLY_AS_CHAR and then we can change its anchoring to centered in the line. */ - SwFrameFormat *pRet=0; + SwFrameFormat *pRet=nullptr; SwNodeIndex aBegin(rRegion.Start()->nNode); const sal_Int32 nBegin(rRegion.Start()->nContent.GetIndex()); SwNodeIndex aEnd(rRegion.End()->nNode); @@ -3180,8 +3180,8 @@ SwFrameFormat *SwWW8ImplReader::ContainsSingleInlineGraphic(const SwPaM &rRegion const SwTextAttr* pTFlyAttr; if ( aBegin == aEnd && nBegin == nEnd - 1 && - 0 != (pTNd = aBegin.GetNode().GetTextNode()) && - 0 != (pTFlyAttr = pTNd->GetTextAttrForCharAt(nBegin, RES_TXTATR_FLYCNT)) + nullptr != (pTNd = aBegin.GetNode().GetTextNode()) && + nullptr != (pTFlyAttr = pTNd->GetTextAttrForCharAt(nBegin, RES_TXTATR_FLYCNT)) ) { const SwFormatFlyCnt& rFly = pTFlyAttr->GetFlyCnt(); @@ -3213,10 +3213,10 @@ bool SwWW8ImplReader::ConvertSubToGraphicPlacement() SwFltPosition aMkPos((*m_pCtrlStck)[nPos].m_aMkPos); SwFltPosition aPtPos(*m_pPaM->GetPoint()); - SwFrameFormat *pFlyFormat = 0; + SwFrameFormat *pFlyFormat = nullptr; if ( SwFltStackEntry::MakeRegion(&m_rDoc,aRegion,false,aMkPos,aPtPos) && - 0 != (pFlyFormat = ContainsSingleInlineGraphic(aRegion)) + nullptr != (pFlyFormat = ContainsSingleInlineGraphic(aRegion)) ) { m_pCtrlStck->DeleteAndDestroy(nPos); @@ -3247,7 +3247,7 @@ void SwWW8ImplReader::Read_SubSuperProp( sal_uInt16, const sal_uInt8* pData, sho // #i59022: Check ensure nHeight != 0. Div by zero otherwise. sal_Int32 nHeight = 240; - if (pF != NULL && pF->GetHeight() != 0) + if (pF != nullptr && pF->GetHeight() != 0) nHeight = pF->GetHeight(); nPos2 /= nHeight; // ... now in % (rounded) if( nPos2 > 100 ) // for safety @@ -3424,7 +3424,7 @@ void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, sh else { SvxUnderlineItem* pUnderlineAttr = const_cast<SvxUnderlineItem*>(static_cast<const SvxUnderlineItem*>(m_pCtrlStck->GetOpenStackAttr( *m_pPaM->GetPoint(), RES_CHRATR_UNDERLINE ))); - if( pUnderlineAttr != NULL ) + if( pUnderlineAttr != nullptr ) pUnderlineAttr->SetColor( Color( msfilter::util::BGRToRGB(SVBT32ToUInt32( pData )))); } } @@ -3917,7 +3917,7 @@ void SwWW8ImplReader::Read_NoLineNumb(sal_uInt16 , const sal_uInt8* pData, short bool lcl_HasExplicitLeft(const WW8PLCFMan *pPlcxMan, bool bVer67) { - WW8PLCFx_Cp_FKP *pPap = pPlcxMan ? pPlcxMan->GetPapPLCF() : 0; + WW8PLCFx_Cp_FKP *pPap = pPlcxMan ? pPlcxMan->GetPapPLCF() : nullptr; if (pPap) { if (bVer67) @@ -4316,7 +4316,7 @@ bool SwWW8ImplReader::IsRightToLeft() { bool bRTL = false; const sal_uInt8 *pDir = - m_pPlcxMan ? m_pPlcxMan->GetPapPLCF()->HasSprm(0x2441) : 0; + m_pPlcxMan ? m_pPlcxMan->GetPapPLCF()->HasSprm(0x2441) : nullptr; if (pDir) bRTL = *pDir != 0; else @@ -4413,7 +4413,7 @@ void SwWW8ImplReader::Read_Emphasis( sal_uInt16, const sal_uInt8* pData, short n //Only the cjk language setting seems to matter to word, the western //one is ignored const sal_uInt8 *pLang = - m_pPlcxMan ? m_pPlcxMan->GetChpPLCF()->HasSprm(0x486E) : 0; + m_pPlcxMan ? m_pPlcxMan->GetChpPLCF()->HasSprm(0x486E) : nullptr; if (pLang) nLang = SVBT16ToShort( pLang ); @@ -4759,9 +4759,9 @@ void SwWW8ImplReader::Read_Border(sal_uInt16 , const sal_uInt8*, short nLen) sal_uInt8 nBorder; if( m_pAktColl ) - nBorder = ::lcl_ReadBorders(m_bVer67, aBrcs, 0, m_pStyles); + nBorder = ::lcl_ReadBorders(m_bVer67, aBrcs, nullptr, m_pStyles); else - nBorder = ::lcl_ReadBorders(m_bVer67, aBrcs, m_pPlcxMan ? m_pPlcxMan->GetPapPLCF() : NULL); + nBorder = ::lcl_ReadBorders(m_bVer67, aBrcs, m_pPlcxMan ? m_pPlcxMan->GetPapPLCF() : nullptr); if( nBorder ) // Border { @@ -4837,10 +4837,10 @@ void SwWW8ImplReader::Read_CharBorder(sal_uInt16 nId, const sal_uInt8* pData, sh // Border style is none -> no border, no shadow if( editeng::ConvertBorderStyleFromWord(aBrc.brcType()) != table::BorderLineStyle::NONE ) { - Set1Border(aBoxItem, aBrc, SvxBoxItemLine::TOP, 0, 0, true); - Set1Border(aBoxItem, aBrc, SvxBoxItemLine::BOTTOM, 0, 0, true); - Set1Border(aBoxItem, aBrc, SvxBoxItemLine::LEFT, 0, 0, true); - Set1Border(aBoxItem, aBrc, SvxBoxItemLine::RIGHT, 0, 0, true); + Set1Border(aBoxItem, aBrc, SvxBoxItemLine::TOP, 0, nullptr, true); + Set1Border(aBoxItem, aBrc, SvxBoxItemLine::BOTTOM, 0, nullptr, true); + Set1Border(aBoxItem, aBrc, SvxBoxItemLine::LEFT, 0, nullptr, true); + Set1Border(aBoxItem, aBrc, SvxBoxItemLine::RIGHT, 0, nullptr, true); NewAttr( aBoxItem ); short aSizeArray[WW8_RIGHT+1]={0}; aSizeArray[WW8_RIGHT] = 1; @@ -4976,34 +4976,34 @@ void SwWW8ImplReader::Read_ApoPPC( sal_uInt16, const sal_uInt8* pData, short ) m_vColl[m_nAktColl].pWWFly = pFly; pFly->Read(*pData, m_pStyles); if (pFly->IsEmpty()) - delete m_vColl[m_nAktColl].pWWFly, m_vColl[m_nAktColl].pWWFly = 0; + delete m_vColl[m_nAktColl].pWWFly, m_vColl[m_nAktColl].pWWFly = nullptr; } } bool SwWW8ImplReader::ParseTabPos(WW8_TablePos *pTabPos, WW8PLCFx_Cp_FKP* pPap) { bool bRet = false; - const sal_uInt8 *pRes=0; + const sal_uInt8 *pRes=nullptr; memset(pTabPos, 0, sizeof(WW8_TablePos)); - if (0 != (pRes = pPap->HasSprm(0x360D))) + if (nullptr != (pRes = pPap->HasSprm(0x360D))) { pTabPos->nSp29 = *pRes; pTabPos->nSp37 = 2; //Possible fail area, always parallel wrap - if (0 != (pRes = pPap->HasSprm(0x940E))) + if (nullptr != (pRes = pPap->HasSprm(0x940E))) pTabPos->nSp26 = SVBT16ToShort(pRes); - if (0 != (pRes = pPap->HasSprm(0x940F))) + if (nullptr != (pRes = pPap->HasSprm(0x940F))) pTabPos->nSp27 = SVBT16ToShort(pRes); - if (0 != (pRes = pPap->HasSprm(0x9410))) + if (nullptr != (pRes = pPap->HasSprm(0x9410))) pTabPos->nLeMgn = SVBT16ToShort(pRes); - if (0 != (pRes = pPap->HasSprm(0x941E))) + if (nullptr != (pRes = pPap->HasSprm(0x941E))) pTabPos->nRiMgn = SVBT16ToShort(pRes); - if (0 != (pRes = pPap->HasSprm(0x9411))) + if (nullptr != (pRes = pPap->HasSprm(0x9411))) pTabPos->nUpMgn = SVBT16ToShort(pRes); - if (0 != (pRes = pPap->HasSprm(0x941F))) + if (nullptr != (pRes = pPap->HasSprm(0x941F))) pTabPos->nLoMgn = SVBT16ToShort(pRes); bRet = true; } - if (0 != (pRes = pPap->HasSprm(NS_sprm::LN_TDefTable))) + if (nullptr != (pRes = pPap->HasSprm(NS_sprm::LN_TDefTable))) { WW8TabBandDesc aDesc; aDesc.ReadDef(false, pRes); @@ -5058,8 +5058,8 @@ void SwWW8ImplReader::EndExtSprm(sal_uInt16 nSprmId) /* 0 (256) */ &SwWW8ImplReader::End_Footnote, // FootNote /* 1 (257) */ &SwWW8ImplReader::End_Footnote, // EndNote /* 2 (258) */ &SwWW8ImplReader::End_Field, // Feld - /* 3 (259) */ 0, // Bookmark - /* 4 (260) */ 0 // Annotation + /* 3 (259) */ nullptr, // Bookmark + /* 4 (260) */ nullptr // Annotation }; sal_uInt8 nIdx = static_cast< sal_uInt8 >(nSprmId - eFTN); @@ -5090,25 +5090,25 @@ const wwSprmDispatcher *GetWW2SprmDispatcher() { static SprmReadInfo aSprms[] = { - {0, 0}, // "0" Default bzw. Error + {0, nullptr}, // "0" Default bzw. Error //wird uebersprungen! , {2, &SwWW8ImplReader::Read_StyleCode}, //"sprmPIstd", pap.istd //(style code) - {3, 0}, //"sprmPIstdPermute", pap.istd + {3, nullptr}, //"sprmPIstdPermute", pap.istd //permutation - {4, 0}, //"sprmPIncLv1", + {4, nullptr}, //"sprmPIncLv1", //pap.istddifference {5, &SwWW8ImplReader::Read_Justify}, //"sprmPJc", pap.jc //(justification) - {6, 0}, //"sprmPFSideBySide", + {6, nullptr}, //"sprmPFSideBySide", //pap.fSideBySide {7, &SwWW8ImplReader::Read_KeepLines}, //"sprmPFKeep", pap.fKeep {8, &SwWW8ImplReader::Read_KeepParas}, //"sprmPFKeepFollow ", //pap.fKeepFollow {9, &SwWW8ImplReader::Read_BreakBefore}, //"sprmPPageBreakBefore", //pap.fPageBreakBefore - {10, 0}, //"sprmPBrcl", pap.brcl - {11, 0}, //"sprmPBrcp ", pap.brcp + {10, nullptr}, //"sprmPBrcl", pap.brcl + {11, nullptr}, //"sprmPBrcp ", pap.brcp {12, &SwWW8ImplReader::Read_ANLevelDesc}, //"sprmPAnld", pap.anld (ANLD //structure) {13, &SwWW8ImplReader::Read_ANLevelNo}, //"sprmPNLvlAnm", pap.nLvlAnm @@ -5118,37 +5118,37 @@ const wwSprmDispatcher *GetWW2SprmDispatcher() //pap.itbdMac, ... {16, &SwWW8ImplReader::Read_LR}, //"sprmPDxaRight", pap.dxaRight {17, &SwWW8ImplReader::Read_LR}, //"sprmPDxaLeft", pap.dxaLeft - {18, 0}, //"sprmPNest", pap.dxaLeft + {18, nullptr}, //"sprmPNest", pap.dxaLeft {19, &SwWW8ImplReader::Read_LR}, //"sprmPDxaLeft1", pap.dxaLeft1 {20, &SwWW8ImplReader::Read_LineSpace}, //"sprmPDyaLine", pap.lspd //an LSPD {21, &SwWW8ImplReader::Read_UL}, //"sprmPDyaBefore", //pap.dyaBefore {22, &SwWW8ImplReader::Read_UL}, //"sprmPDyaAfter", pap.dyaAfter - {23, 0}, //"?sprmPChgTabs", pap.itbdMac, + {23, nullptr}, //"?sprmPChgTabs", pap.itbdMac, //pap.rgdxaTab, ... - {24, 0}, //"sprmPFInTable", pap.fInTable + {24, nullptr}, //"sprmPFInTable", pap.fInTable {25, &SwWW8ImplReader::Read_TabRowEnd}, //"sprmPTtp", pap.fTtp - {26, 0}, //"sprmPDxaAbs", pap.dxaAbs - {27, 0}, //"sprmPDyaAbs", pap.dyaAbs - {28, 0}, //"sprmPDxaWidth", pap.dxaWidth + {26, nullptr}, //"sprmPDxaAbs", pap.dxaAbs + {27, nullptr}, //"sprmPDyaAbs", pap.dyaAbs + {28, nullptr}, //"sprmPDxaWidth", pap.dxaWidth {29, &SwWW8ImplReader::Read_ApoPPC}, //"sprmPPc", pap.pcHorz, //pap.pcVert - {30, 0}, //"sprmPBrcTop10", pap.brcTop + {30, nullptr}, //"sprmPBrcTop10", pap.brcTop //BRC10 - {31, 0}, //"sprmPBrcLeft10", + {31, nullptr}, //"sprmPBrcLeft10", //pap.brcLeft BRC10 - {32, 0}, //"sprmPBrcBottom10", + {32, nullptr}, //"sprmPBrcBottom10", //pap.brcBottom BRC10 - {33, 0}, //"sprmPBrcRight10", + {33, nullptr}, //"sprmPBrcRight10", //pap.brcRight BRC10 - {34, 0}, //"sprmPBrcBetween10", + {34, nullptr}, //"sprmPBrcBetween10", //pap.brcBetween BRC10 - {35, 0}, //"sprmPBrcBar10", pap.brcBar + {35, nullptr}, //"sprmPBrcBar10", pap.brcBar //BRC10 - {36, 0}, //"sprmPFromText10", + {36, nullptr}, //"sprmPFromText10", //pap.dxaFromText dxa - {37, 0}, //"sprmPWr", pap.wr wr + {37, nullptr}, //"sprmPWr", pap.wr wr {38, &SwWW8ImplReader::Read_Border}, //"sprmPBrcTop", pap.brcTop BRC {39, &SwWW8ImplReader::Read_Border}, //"sprmPBrcLeft", //pap.brcLeft BRC @@ -5158,30 +5158,30 @@ const wwSprmDispatcher *GetWW2SprmDispatcher() //pap.brcRight BRC {42, &SwWW8ImplReader::Read_Border}, //"sprmPBrcBetween", //pap.brcBetween BRC - {43, 0}, //"sprmPBrcBar", pap.brcBar + {43, nullptr}, //"sprmPBrcBar", pap.brcBar //BRC word {44, &SwWW8ImplReader::Read_Hyphenation}, //"sprmPFNoAutoHyph", //pap.fNoAutoHyph - {45, 0}, //"sprmPWHeightAbs", + {45, nullptr}, //"sprmPWHeightAbs", //pap.wHeightAbs w - {46, 0}, //"sprmPDcs", pap.dcs DCS + {46, nullptr}, //"sprmPDcs", pap.dcs DCS {47, &SwWW8ImplReader::Read_Shade}, //"sprmPShd", pap.shd SHD - {48, 0}, //"sprmPDyaFromText", + {48, nullptr}, //"sprmPDyaFromText", //pap.dyaFromText dya - {49, 0}, //"sprmPDxaFromText", + {49, nullptr}, //"sprmPDxaFromText", //pap.dxaFromText dxa - {50, 0}, //"sprmPFLocked", pap.fLocked + {50, nullptr}, //"sprmPFLocked", pap.fLocked //0 or 1 byte {51, &SwWW8ImplReader::Read_WidowControl}, //"sprmPFWidowControl", //pap.fWidowControl 0 or 1 byte - {52, 0}, //"?sprmPRuler 52", - {53, 0}, //"??53", - {54, 0}, //"??54", - {55, 0}, //"??55", - {56, 0}, //"??56", - {57, 0}, //"??57", - {58, 0}, //"??58", - {59, 0}, //"??59", + {52, nullptr}, //"?sprmPRuler 52", + {53, nullptr}, //"??53", + {54, nullptr}, //"??54", + {55, nullptr}, //"??55", + {56, nullptr}, //"??56", + {57, nullptr}, //"??57", + {58, nullptr}, //"??58", + {59, nullptr}, //"??59", {60, &SwWW8ImplReader::Read_BoldUsw}, //"sprmCFBold", chp.fBold 0,1, //128, or 129 byte @@ -5202,17 +5202,17 @@ const wwSprmDispatcher *GetWW2SprmDispatcher() //0,1, 128, or 129 byte {68, &SwWW8ImplReader::Read_FontCode}, //"sprmCFtc", chp.ftc ftc word {69, &SwWW8ImplReader::Read_Underline}, // "sprmCKul", chp.kul kul byte - {70, 0}, //"sprmCSizePos", chp.hps, + {70, nullptr}, //"sprmCSizePos", chp.hps, //chp.hpsPos 3 bytes {71, &SwWW8ImplReader::Read_Kern}, //"sprmCDxaSpace", //chp.dxaSpace dxa word {72, &SwWW8ImplReader::Read_Language}, //"sprmCLid", chp.lid LID word {73, &SwWW8ImplReader::Read_TextColor}, //"sprmCIco", chp.ico ico byte {74, &SwWW8ImplReader::Read_FontSize}, //"sprmCHps", chp.hps hps word! - {75, 0}, //"sprmCHpsInc", chp.hps byte + {75, nullptr}, //"sprmCHpsInc", chp.hps byte {76, &SwWW8ImplReader::Read_SubSuperProp}, //"sprmCHpsPos", chp.hpsPos //hps byte - {77, 0}, //"sprmCHpsPosAdj", chp.hpsPos + {77, nullptr}, //"sprmCHpsPosAdj", chp.hpsPos //hps byte {78, &SwWW8ImplReader::Read_Majority}, //"?sprmCMajority", chp.fBold, //chp.fItalic, chp.fSmallCaps @@ -5222,20 +5222,20 @@ const wwSprmDispatcher *GetWW2SprmDispatcher() {83, &SwWW8ImplReader::Read_Language}, //sprmClidBi {84, &SwWW8ImplReader::Read_TextColor}, //sprmCIcoBi {85, &SwWW8ImplReader::Read_FontSize}, //sprmCHpsBi - {86, 0}, //sprmCFBiDi - {87, 0}, //sprmCFDiacColor - {94, 0}, //"sprmPicBrcl", pic.brcl brcl + {86, nullptr}, //sprmCFBiDi + {87, nullptr}, //sprmCFDiacColor + {94, nullptr}, //"sprmPicBrcl", pic.brcl brcl //(see PIC structure //definition) byte - {95, 0}, //"sprmPicScale", pic.mx, + {95, nullptr}, //"sprmPicScale", pic.mx, //pic.my, pic.dxaCropleft, - {96, 0}, //"sprmPicBrcTop", pic.brcTop + {96, nullptr}, //"sprmPicBrcTop", pic.brcTop //BRC word - {97, 0}, //"sprmPicBrcLeft", + {97, nullptr}, //"sprmPicBrcLeft", //pic.brcLeft BRC word - {98, 0}, //"sprmPicBrcBottom", + {98, nullptr}, //"sprmPicBrcBottom", //pic.brcBottom BRC word - {99, 0} //"sprmPicBrcRight", + {99, nullptr} //"sprmPicBrcRight", }; static wwSprmDispatcher aSprmSrch(aSprms, sizeof(aSprms) / sizeof(aSprms[0])); @@ -5246,25 +5246,25 @@ const wwSprmDispatcher *GetWW6SprmDispatcher() { static SprmReadInfo aSprms[] = { - {0, 0}, // "0" Default bzw. Error + {0, nullptr}, // "0" Default bzw. Error //wird uebersprungen! , {2, &SwWW8ImplReader::Read_StyleCode}, //"sprmPIstd", pap.istd //(style code) - {3, 0}, //"sprmPIstdPermute", pap.istd + {3, nullptr}, //"sprmPIstdPermute", pap.istd //permutation - {4, 0}, //"sprmPIncLv1", + {4, nullptr}, //"sprmPIncLv1", //pap.istddifference {5, &SwWW8ImplReader::Read_Justify}, //"sprmPJc", pap.jc //(justification) - {6, 0}, //"sprmPFSideBySide", + {6, nullptr}, //"sprmPFSideBySide", //pap.fSideBySide {7, &SwWW8ImplReader::Read_KeepLines}, //"sprmPFKeep", pap.fKeep {8, &SwWW8ImplReader::Read_KeepParas}, //"sprmPFKeepFollow ", //pap.fKeepFollow {9, &SwWW8ImplReader::Read_BreakBefore}, //"sprmPPageBreakBefore", //pap.fPageBreakBefore - {10, 0}, //"sprmPBrcl", pap.brcl - {11, 0}, //"sprmPBrcp ", pap.brcp + {10, nullptr}, //"sprmPBrcl", pap.brcl + {11, nullptr}, //"sprmPBrcp ", pap.brcp {12, &SwWW8ImplReader::Read_ANLevelDesc}, //"sprmPAnld", pap.anld (ANLD //structure) {13, &SwWW8ImplReader::Read_ANLevelNo}, //"sprmPNLvlAnm", pap.nLvlAnm @@ -5274,37 +5274,37 @@ const wwSprmDispatcher *GetWW6SprmDispatcher() //pap.itbdMac, ... {16, &SwWW8ImplReader::Read_LR}, //"sprmPDxaRight", pap.dxaRight {17, &SwWW8ImplReader::Read_LR}, //"sprmPDxaLeft", pap.dxaLeft - {18, 0}, //"sprmPNest", pap.dxaLeft + {18, nullptr}, //"sprmPNest", pap.dxaLeft {19, &SwWW8ImplReader::Read_LR}, //"sprmPDxaLeft1", pap.dxaLeft1 {20, &SwWW8ImplReader::Read_LineSpace}, //"sprmPDyaLine", pap.lspd //an LSPD {21, &SwWW8ImplReader::Read_UL}, //"sprmPDyaBefore", //pap.dyaBefore {22, &SwWW8ImplReader::Read_UL}, //"sprmPDyaAfter", pap.dyaAfter - {23, 0}, //"?sprmPChgTabs", pap.itbdMac, + {23, nullptr}, //"?sprmPChgTabs", pap.itbdMac, //pap.rgdxaTab, ... - {24, 0}, //"sprmPFInTable", pap.fInTable + {24, nullptr}, //"sprmPFInTable", pap.fInTable {25, &SwWW8ImplReader::Read_TabRowEnd}, //"sprmPTtp", pap.fTtp - {26, 0}, //"sprmPDxaAbs", pap.dxaAbs - {27, 0}, //"sprmPDyaAbs", pap.dyaAbs - {28, 0}, //"sprmPDxaWidth", pap.dxaWidth + {26, nullptr}, //"sprmPDxaAbs", pap.dxaAbs + {27, nullptr}, //"sprmPDyaAbs", pap.dyaAbs + {28, nullptr}, //"sprmPDxaWidth", pap.dxaWidth {29, &SwWW8ImplReader::Read_ApoPPC}, //"sprmPPc", pap.pcHorz, //pap.pcVert - {30, 0}, //"sprmPBrcTop10", pap.brcTop + {30, nullptr}, //"sprmPBrcTop10", pap.brcTop //BRC10 - {31, 0}, //"sprmPBrcLeft10", + {31, nullptr}, //"sprmPBrcLeft10", //pap.brcLeft BRC10 - {32, 0}, //"sprmPBrcBottom10", + {32, nullptr}, //"sprmPBrcBottom10", //pap.brcBottom BRC10 - {33, 0}, //"sprmPBrcRight10", + {33, nullptr}, //"sprmPBrcRight10", //pap.brcRight BRC10 - {34, 0}, //"sprmPBrcBetween10", + {34, nullptr}, //"sprmPBrcBetween10", //pap.brcBetween BRC10 - {35, 0}, //"sprmPBrcBar10", pap.brcBar + {35, nullptr}, //"sprmPBrcBar10", pap.brcBar //BRC10 - {36, 0}, //"sprmPFromText10", + {36, nullptr}, //"sprmPFromText10", //pap.dxaFromText dxa - {37, 0}, //"sprmPWr", pap.wr wr + {37, nullptr}, //"sprmPWr", pap.wr wr {38, &SwWW8ImplReader::Read_Border}, //"sprmPBrcTop", pap.brcTop BRC {39, &SwWW8ImplReader::Read_Border}, //"sprmPBrcLeft", //pap.brcLeft BRC @@ -5314,34 +5314,34 @@ const wwSprmDispatcher *GetWW6SprmDispatcher() //pap.brcRight BRC {42, &SwWW8ImplReader::Read_Border}, //"sprmPBrcBetween", //pap.brcBetween BRC - {43, 0}, //"sprmPBrcBar", pap.brcBar + {43, nullptr}, //"sprmPBrcBar", pap.brcBar //BRC word {44, &SwWW8ImplReader::Read_Hyphenation}, //"sprmPFNoAutoHyph", //pap.fNoAutoHyph - {45, 0}, //"sprmPWHeightAbs", + {45, nullptr}, //"sprmPWHeightAbs", //pap.wHeightAbs w - {46, 0}, //"sprmPDcs", pap.dcs DCS + {46, nullptr}, //"sprmPDcs", pap.dcs DCS {47, &SwWW8ImplReader::Read_Shade}, //"sprmPShd", pap.shd SHD - {48, 0}, //"sprmPDyaFromText", + {48, nullptr}, //"sprmPDyaFromText", //pap.dyaFromText dya - {49, 0}, //"sprmPDxaFromText", + {49, nullptr}, //"sprmPDxaFromText", //pap.dxaFromText dxa - {50, 0}, //"sprmPFLocked", pap.fLocked + {50, nullptr}, //"sprmPFLocked", pap.fLocked //0 or 1 byte {51, &SwWW8ImplReader::Read_WidowControl}, //"sprmPFWidowControl", //pap.fWidowControl 0 or 1 byte - {52, 0}, //"?sprmPRuler 52", - {53, 0}, //"??53", - {54, 0}, //"??54", - {55, 0}, //"??55", - {56, 0}, //"??56", - {57, 0}, //"??57", - {58, 0}, //"??58", - {59, 0}, //"??59", - {60, 0}, //"??60", - {61, 0}, //"??61", - {62, 0}, //"??62", - {63, 0}, //"??63", + {52, nullptr}, //"?sprmPRuler 52", + {53, nullptr}, //"??53", + {54, nullptr}, //"??54", + {55, nullptr}, //"??55", + {56, nullptr}, //"??56", + {57, nullptr}, //"??57", + {58, nullptr}, //"??58", + {59, nullptr}, //"??59", + {60, nullptr}, //"??60", + {61, nullptr}, //"??61", + {62, nullptr}, //"??62", + {63, nullptr}, //"??63", {64, &SwWW8ImplReader::Read_ParaBiDi}, //"rtl bidi ? {65, &SwWW8ImplReader::Read_CFRMarkDel}, //"sprmCFStrikeRM", //chp.fRMarkDel 1 or 0 bit @@ -5351,14 +5351,14 @@ const wwSprmDispatcher *GetWW6SprmDispatcher() //chp.fFieldVanish 1 or 0 bit {68, &SwWW8ImplReader::Read_PicLoc}, //"sprmCPicLocation", //chp.fcPic and chp.fSpec - {69, 0}, //"sprmCIbstRMark", + {69, nullptr}, //"sprmCIbstRMark", //chp.ibstRMark index into //sttbRMark - {70, 0}, //"sprmCDttmRMark", chp.dttm + {70, nullptr}, //"sprmCDttmRMark", chp.dttm //DTTM long - {71, 0}, //"sprmCFData", chp.fData 1 or + {71, nullptr}, //"sprmCFData", chp.fData 1 or //0 bit - {72, 0}, //"sprmCRMReason", + {72, nullptr}, //"sprmCRMReason", //chp.idslRMReason an index to //a table {73, &SwWW8ImplReader::Read_CharSet}, //"sprmCChse", chp.fChsDiff @@ -5367,20 +5367,20 @@ const wwSprmDispatcher *GetWW6SprmDispatcher() //chp.chSym and chp.ftcSym {75, &SwWW8ImplReader::Read_Obj}, //"sprmCFOle2", chp.fOle2 1 //or 0 bit - {76, 0}, //"??76", - {77, 0}, //"??77", - {78, 0}, //"??78", - {79, 0}, //"??79", + {76, nullptr}, //"??76", + {77, nullptr}, //"??77", + {78, nullptr}, //"??78", + {79, nullptr}, //"??79", {80, &SwWW8ImplReader::Read_CColl}, //"sprmCIstd", chp.istd istd, //see stylesheet definition //short - {81, 0}, //"sprmCIstdPermute", chp.istd + {81, nullptr}, //"sprmCIstdPermute", chp.istd //permutation vector - {82, 0}, //"sprmCDefault", whole CHP + {82, nullptr}, //"sprmCDefault", whole CHP //none variable length - {83, 0}, //"sprmCPlain", whole CHP + {83, nullptr}, //"sprmCPlain", whole CHP //none 0 - {84, 0}, //"??84", + {84, nullptr}, //"??84", {85, &SwWW8ImplReader::Read_BoldUsw}, //"sprmCFBold", chp.fBold 0,1, //128, or 129 byte {86, &SwWW8ImplReader::Read_BoldUsw}, //"sprmCFItalic", chp.fItalic @@ -5400,25 +5400,25 @@ const wwSprmDispatcher *GetWW6SprmDispatcher() //0,1, 128, or 129 byte {93, &SwWW8ImplReader::Read_FontCode}, //"sprmCFtc", chp.ftc ftc word {94, &SwWW8ImplReader::Read_Underline}, // "sprmCKul", chp.kul kul byte - {95, 0}, //"sprmCSizePos", chp.hps, + {95, nullptr}, //"sprmCSizePos", chp.hps, //chp.hpsPos 3 bytes {96, &SwWW8ImplReader::Read_Kern}, //"sprmCDxaSpace", //chp.dxaSpace dxa word {97, &SwWW8ImplReader::Read_Language}, //"sprmCLid", chp.lid LID word {98, &SwWW8ImplReader::Read_TextColor}, //"sprmCIco", chp.ico ico byte {99, &SwWW8ImplReader::Read_FontSize}, //"sprmCHps", chp.hps hps word! - {100, 0}, //"sprmCHpsInc", chp.hps byte + {100, nullptr}, //"sprmCHpsInc", chp.hps byte {101, &SwWW8ImplReader::Read_SubSuperProp}, //"sprmCHpsPos", chp.hpsPos //hps byte - {102, 0}, //"sprmCHpsPosAdj", chp.hpsPos + {102, nullptr}, //"sprmCHpsPosAdj", chp.hpsPos //hps byte {103, &SwWW8ImplReader::Read_Majority}, //"?sprmCMajority", chp.fBold, //chp.fItalic, chp.fSmallCaps {104, &SwWW8ImplReader::Read_SubSuper}, //"sprmCIss", chp.iss iss byte - {105, 0}, //"sprmCHpsNew50", chp.hps hps + {105, nullptr}, //"sprmCHpsNew50", chp.hps hps //variable width, length //always recorded as 2 - {106, 0}, //"sprmCHpsInc1", chp.hps + {106, nullptr}, //"sprmCHpsInc1", chp.hps //complex variable width, //length always recorded as 2 {107, &SwWW8ImplReader::Read_FontKern}, //"sprmCHpsKern", chp.hpsKern @@ -5426,9 +5426,9 @@ const wwSprmDispatcher *GetWW6SprmDispatcher() {108, &SwWW8ImplReader::Read_Majority}, //"sprmCMajority50", chp.fBold, //chp.fItalic, chp.fSmallCaps, // chp.fVanish, ... - {109, 0}, //"sprmCHpsMul", chp.hps + {109, nullptr}, //"sprmCHpsMul", chp.hps //percentage to grow hps short - {110, 0}, //"sprmCCondHyhen", chp.ysri + {110, nullptr}, //"sprmCCondHyhen", chp.ysri //ysri short {111, &SwWW8ImplReader::Read_FontCode}, //ww7 font {112, &SwWW8ImplReader::Read_FontCode}, //ww7 CJK font @@ -5440,164 +5440,164 @@ const wwSprmDispatcher *GetWW6SprmDispatcher() //or 0 bit {118, &SwWW8ImplReader::Read_Obj}, //"sprmCFObj", chp.fObj 1 or 0 //bit - {119, 0}, //"sprmPicBrcl", pic.brcl brcl + {119, nullptr}, //"sprmPicBrcl", pic.brcl brcl //(see PIC structure //definition) byte - {120, 0}, //"sprmPicScale", pic.mx, + {120, nullptr}, //"sprmPicScale", pic.mx, //pic.my, pic.dxaCropleft, - {121, 0}, //"sprmPicBrcTop", pic.brcTop + {121, nullptr}, //"sprmPicBrcTop", pic.brcTop //BRC word - {122, 0}, //"sprmPicBrcLeft", + {122, nullptr}, //"sprmPicBrcLeft", //pic.brcLeft BRC word - {123, 0}, //"sprmPicBrcBottom", + {123, nullptr}, //"sprmPicBrcBottom", //pic.brcBottom BRC word - {124, 0}, //"sprmPicBrcRight", + {124, nullptr}, //"sprmPicBrcRight", //pic.brcRight BRC word - {125, 0}, //"??125", - {126, 0}, //"??126", - {127, 0}, //"??127", - {128, 0}, //"??128", - {129, 0}, //"??129", - {130, 0}, //"??130", - {131, 0}, //"sprmSScnsPgn", sep.cnsPgn + {125, nullptr}, //"??125", + {126, nullptr}, //"??126", + {127, nullptr}, //"??127", + {128, nullptr}, //"??128", + {129, nullptr}, //"??129", + {130, nullptr}, //"??130", + {131, nullptr}, //"sprmSScnsPgn", sep.cnsPgn //cns byte - {132, 0}, //"sprmSiHeadingPgn", + {132, nullptr}, //"sprmSiHeadingPgn", //sep.iHeadingPgn heading //number level byte {133, &SwWW8ImplReader::Read_OLST}, //"sprmSOlstAnm", sep.olstAnm //OLST variable length - {134, 0}, //"??135", - {135, 0}, //"??135", - {136, 0}, //"sprmSDxaColWidth", + {134, nullptr}, //"??135", + {135, nullptr}, //"??135", + {136, nullptr}, //"sprmSDxaColWidth", //sep.rgdxaColWidthSpacing //complex 3 bytes - {137, 0}, //"sprmSDxaColSpacing", + {137, nullptr}, //"sprmSDxaColSpacing", //sep.rgdxaColWidthSpacing //complex 3 bytes - {138, 0}, //"sprmSFEvenlySpaced", + {138, nullptr}, //"sprmSFEvenlySpaced", //sep.fEvenlySpaced 1 or 0 byte - {139, 0}, //"sprmSFProtected", + {139, nullptr}, //"sprmSFProtected", //sep.fUnlocked 1 or 0 byte - {140, 0}, //"sprmSDmBinFirst", + {140, nullptr}, //"sprmSDmBinFirst", //sep.dmBinFirst word - {141, 0}, //"sprmSDmBinOther", + {141, nullptr}, //"sprmSDmBinOther", //sep.dmBinOther word - {142, 0}, //"sprmSBkc", sep.bkc bkc + {142, nullptr}, //"sprmSBkc", sep.bkc bkc //byte BreakCode - {143, 0}, //"sprmSFTitlePage", + {143, nullptr}, //"sprmSFTitlePage", //sep.fTitlePage 0 or 1 byte - {144, 0}, //"sprmSCcolumns", sep.ccolM1 + {144, nullptr}, //"sprmSCcolumns", sep.ccolM1 //# of cols - 1 word - {145, 0}, //"sprmSDxaColumns", + {145, nullptr}, //"sprmSDxaColumns", //sep.dxaColumns dxa word - {146, 0}, //"sprmSFAutoPgn", + {146, nullptr}, //"sprmSFAutoPgn", //sep.fAutoPgn obsolete byte - {147, 0}, //"sprmSNfcPgn", sep.nfcPgn + {147, nullptr}, //"sprmSNfcPgn", sep.nfcPgn //nfc byte - {148, 0}, //"sprmSDyaPgn", sep.dyaPgn + {148, nullptr}, //"sprmSDyaPgn", sep.dyaPgn //dya short - {149, 0}, //"sprmSDxaPgn", sep.dxaPgn + {149, nullptr}, //"sprmSDxaPgn", sep.dxaPgn //dya short - {150, 0}, //"sprmSFPgnRestart", + {150, nullptr}, //"sprmSFPgnRestart", //sep.fPgnRestart 0 or 1 byte - {151, 0}, //"sprmSFEndnote", sep.fEndnote + {151, nullptr}, //"sprmSFEndnote", sep.fEndnote //0 or 1 byte - {152, 0}, //"sprmSLnc", sep.lnc lnc byte - {153, 0}, //"sprmSGprfIhdt", sep.grpfIhdt + {152, nullptr}, //"sprmSLnc", sep.lnc lnc byte + {153, nullptr}, //"sprmSGprfIhdt", sep.grpfIhdt //grpfihdt byte - {154, 0}, //"sprmSNLnnMod", sep.nLnnMod + {154, nullptr}, //"sprmSNLnnMod", sep.nLnnMod //non-neg int. word - {155, 0}, //"sprmSDxaLnn", sep.dxaLnn + {155, nullptr}, //"sprmSDxaLnn", sep.dxaLnn //dxa word - {156, 0}, //"sprmSDyaHdrTop", + {156, nullptr}, //"sprmSDyaHdrTop", //sep.dyaHdrTop dya word - {157, 0}, //"sprmSDyaHdrBottom", + {157, nullptr}, //"sprmSDyaHdrBottom", //sep.dyaHdrBottom dya word - {158, 0}, //"sprmSLBetween", + {158, nullptr}, //"sprmSLBetween", //sep.fLBetween 0 or 1 byte - {159, 0}, //"sprmSVjc", sep.vjc vjc byte - {160, 0}, //"sprmSLnnMin", sep.lnnMin + {159, nullptr}, //"sprmSVjc", sep.vjc vjc byte + {160, nullptr}, //"sprmSLnnMin", sep.lnnMin //lnn word - {161, 0}, //"sprmSPgnStart", sep.pgnStart + {161, nullptr}, //"sprmSPgnStart", sep.pgnStart //pgn word - {162, 0}, //"sprmSBOrientation", + {162, nullptr}, //"sprmSBOrientation", //sep.dmOrientPage dm byte - {163, 0}, //"?SprmSBCustomize 163", ? - {164, 0}, //"sprmSXaPage", sep.xaPage xa + {163, nullptr}, //"?SprmSBCustomize 163", ? + {164, nullptr}, //"sprmSXaPage", sep.xaPage xa //word - {165, 0}, //"sprmSYaPage", sep.yaPage ya + {165, nullptr}, //"sprmSYaPage", sep.yaPage ya //word - {166, 0}, //"sprmSDxaLeft", sep.dxaLeft + {166, nullptr}, //"sprmSDxaLeft", sep.dxaLeft //dxa word - {167, 0}, //"sprmSDxaRight", sep.dxaRight + {167, nullptr}, //"sprmSDxaRight", sep.dxaRight //dxa word - {168, 0}, //"sprmSDyaTop", sep.dyaTop //dya word - {169, 0}, //"sprmSDyaBottom", + {168, nullptr}, //"sprmSDyaTop", sep.dyaTop //dya word + {169, nullptr}, //"sprmSDyaBottom", //sep.dyaBottom dya word - {170, 0}, //"sprmSDzaGutter", + {170, nullptr}, //"sprmSDzaGutter", //sep.dzaGutter dza word - {171, 0}, //"sprmSDMPaperReq", + {171, nullptr}, //"sprmSDMPaperReq", //sep.dmPaperReq dm word - {172, 0}, //"??172", - {173, 0}, //"??173", - {174, 0}, //"??174", - {175, 0}, //"??175", - {176, 0}, //"??176", - {177, 0}, //"??177", - {178, 0}, //"??178", - {179, 0}, //"??179", - {180, 0}, //"??180", - {181, 0}, //"??181", - {182, 0}, //"sprmTJc", tap.jc jc word + {172, nullptr}, //"??172", + {173, nullptr}, //"??173", + {174, nullptr}, //"??174", + {175, nullptr}, //"??175", + {176, nullptr}, //"??176", + {177, nullptr}, //"??177", + {178, nullptr}, //"??178", + {179, nullptr}, //"??179", + {180, nullptr}, //"??180", + {181, nullptr}, //"??181", + {182, nullptr}, //"sprmTJc", tap.jc jc word //(low order byte is //significant) - {183, 0}, //"sprmTDxaLeft", + {183, nullptr}, //"sprmTDxaLeft", //tap.rgdxaCenter dxa word - {184, 0}, //"sprmTDxaGapHalf", + {184, nullptr}, //"sprmTDxaGapHalf", //tap.dxaGapHalf, //tap.rgdxaCenter dxa word - {185, 0}, //"sprmTFCantSplit" + {185, nullptr}, //"sprmTFCantSplit" //tap.fCantSplit 1 or 0 byte - {186, 0}, //"sprmTTableHeader", + {186, nullptr}, //"sprmTTableHeader", //tap.fTableHeader 1 or 0 byte - {187, 0}, //"sprmTTableBorders", + {187, nullptr}, //"sprmTTableBorders", //tap.rgbrcTable complex //12 bytes - {188, 0}, //"sprmTDefTable10", + {188, nullptr}, //"sprmTDefTable10", //tap.rgdxaCenter, tap.rgtc //complex variable length - {189, 0}, //"sprmTDyaRowHeight", + {189, nullptr}, //"sprmTDyaRowHeight", //tap.dyaRowHeight dya word - {190, 0}, //"?sprmTDefTable", tap.rgtc + {190, nullptr}, //"?sprmTDefTable", tap.rgtc //complex - {191, 0}, //"?sprmTDefTableShd", + {191, nullptr}, //"?sprmTDefTableShd", //tap.rgshd complex - {192, 0}, //"sprmTTlp", tap.tlp TLP + {192, nullptr}, //"sprmTTlp", tap.tlp TLP //4 bytes - {193, 0}, //"sprmTSetBrc", + {193, nullptr}, //"sprmTSetBrc", //tap.rgtc[].rgbrc complex //5 bytes - {194, 0}, //"sprmTInsert", + {194, nullptr}, //"sprmTInsert", //tap.rgdxaCenter, //tap.rgtc complex 4 bytes - {195, 0}, //"sprmTDelete", + {195, nullptr}, //"sprmTDelete", //tap.rgdxaCenter, //tap.rgtc complex word - {196, 0}, //"sprmTDxaCol", + {196, nullptr}, //"sprmTDxaCol", //tap.rgdxaCenter complex //4 bytes - {197, 0}, //"sprmTMerge", + {197, nullptr}, //"sprmTMerge", //tap.fFirstMerged, //tap.fMerged complex word - {198, 0}, //"sprmTSplit", + {198, nullptr}, //"sprmTSplit", //tap.fFirstMerged, //tap.fMerged complex word - {199, 0}, //"sprmTSetBrc10", + {199, nullptr}, //"sprmTSetBrc10", //tap.rgtc[].rgbrc complex //5 bytes - {200, 0}, //"sprmTSetShd", tap.rgshd + {200, nullptr}, //"sprmTSetShd", tap.rgshd //complex 4 bytes - {207, 0}, //dunno + {207, nullptr}, //dunno }; static wwSprmDispatcher aSprmSrch(aSprms, sizeof(aSprms) / sizeof(aSprms[0])); @@ -5608,20 +5608,20 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() { static SprmReadInfo aSprms[] = { - {0, 0}, // "0" Default bzw. Error + {0, nullptr}, // "0" Default bzw. Error {0x4600, &SwWW8ImplReader::Read_StyleCode}, //"sprmPIstd" pap.istd;istd //(style code);short; - {0xC601, 0}, //"sprmPIstdPermute" pap.istd; + {0xC601, nullptr}, //"sprmPIstdPermute" pap.istd; //permutation vector; //variable length; - {0x2602, 0}, //"sprmPIncLvl" pap.istd, + {0x2602, nullptr}, //"sprmPIncLvl" pap.istd, //pap.lvl;difference between //istd of base PAP and istd of //PAP to be produced; byte; {0x2403, &SwWW8ImplReader::Read_Justify}, //"sprmPJc" pap.jc;jc //(justification);byte; - {0x2404, 0}, //"sprmPFSideBySide" + {0x2404, nullptr}, //"sprmPFSideBySide" //pap.fSideBySide;0 or 1;byte; {0x2405, &SwWW8ImplReader::Read_KeepLines}, //"sprmPFKeep" pap.fKeep;0 or //1;byte; @@ -5630,9 +5630,9 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() {0x2407, &SwWW8ImplReader::Read_BreakBefore},//"sprmPFPageBreakBefore" //pap.fPageBreakBefore;0 or 1; //byte; - {0x2408, 0}, //"sprmPBrcl" pap.brcl;brcl; + {0x2408, nullptr}, //"sprmPBrcl" pap.brcl;brcl; //byte; - {0x2409, 0}, //"sprmPBrcp" pap.brcp;brcp; + {0x2409, nullptr}, //"sprmPBrcp" pap.brcp;brcp; //byte; {0x260A, &SwWW8ImplReader::Read_ListLevel}, //"sprmPIlvl" pap.ilvl;ilvl; //byte; @@ -5648,7 +5648,7 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() //dxa;word; {0x840F, &SwWW8ImplReader::Read_LR}, //Apparently Word 97 version of "sprmPDxaLeft" pap.dxaLeft; //dxa;word; - {0x4610, 0}, //"sprmPNest" pap.dxaLeft; + {0x4610, nullptr}, //"sprmPNest" pap.dxaLeft; //dxa;word; {0x8411, &SwWW8ImplReader::Read_LR}, //Word 97 version of "sprmPDxaLeft1" pap.dxaLeft1; //dxa;word; @@ -5662,36 +5662,36 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() //pap.dyaBefore;dya;word; {0xA414, &SwWW8ImplReader::Read_UL}, //"sprmPDyaAfter" pap.dyaAfter; //dya;word; - {0xC615, 0}, //"sprmPChgTabs" pap.itbdMac, + {0xC615, nullptr}, //"sprmPChgTabs" pap.itbdMac, //pap.rgdxaTab, pap.rgtbd; //complex;variable length; - {0x2416, 0}, //"sprmPFInTable" pap.fInTable; + {0x2416, nullptr}, //"sprmPFInTable" pap.fInTable; //0 or 1;byte; {0x2417, &SwWW8ImplReader::Read_TabRowEnd}, //"sprmPFTtp" pap.fTtp;0 or 1; //byte; - {0x8418, 0}, //"sprmPDxaAbs" pap.dxaAbs;dxa; + {0x8418, nullptr}, //"sprmPDxaAbs" pap.dxaAbs;dxa; //word; - {0x8419, 0}, //"sprmPDyaAbs" pap.dyaAbs;dya; + {0x8419, nullptr}, //"sprmPDyaAbs" pap.dyaAbs;dya; //word; - {0x841A, 0}, //"sprmPDxaWidth" pap.dxaWidth; + {0x841A, nullptr}, //"sprmPDxaWidth" pap.dxaWidth; //dxa;word; {0x261B, &SwWW8ImplReader::Read_ApoPPC}, //"sprmPPc" pap.pcHorz, //pap.pcVert;complex;byte; - {0x461C, 0}, //"sprmPBrcTop10" pap.brcTop; + {0x461C, nullptr}, //"sprmPBrcTop10" pap.brcTop; //BRC10;word; - {0x461D, 0}, //"sprmPBrcLeft10" pap.brcLeft; + {0x461D, nullptr}, //"sprmPBrcLeft10" pap.brcLeft; //BRC10;word; - {0x461E, 0}, //"sprmPBrcBottom10" + {0x461E, nullptr}, //"sprmPBrcBottom10" //pap.brcBottom;BRC10;word; - {0x461F, 0}, //"sprmPBrcRight10" + {0x461F, nullptr}, //"sprmPBrcRight10" //pap.brcRight;BRC10;word; - {0x4620, 0}, //"sprmPBrcBetween10" + {0x4620, nullptr}, //"sprmPBrcBetween10" //pap.brcBetween;BRC10;word; - {0x4621, 0}, //"sprmPBrcBar10" pap.brcBar; + {0x4621, nullptr}, //"sprmPBrcBar10" pap.brcBar; //BRC10;word; - {0x4622, 0}, //"sprmPDxaFromText10" + {0x4622, nullptr}, //"sprmPDxaFromText10" //pap.dxaFromText;dxa;word; - {0x2423, 0}, //"sprmPWr" pap.wr;wr;byte; + {0x2423, nullptr}, //"sprmPWr" pap.wr;wr;byte; {0x6424, &SwWW8ImplReader::Read_Border}, //"sprmPBrcTop80" pap.brcTop;BRC; //long; {0x6425, &SwWW8ImplReader::Read_Border}, //"sprmPBrcLeft80" pap.brcLeft; @@ -5702,68 +5702,68 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() //BRC;long; {0x6428, &SwWW8ImplReader::Read_Border}, //"sprmPBrcBetween80" //pap.brcBetween;BRC;long; - {0x6629, 0}, //"sprmPBrcBar" pap.brcBar;BRC; + {0x6629, nullptr}, //"sprmPBrcBar" pap.brcBar;BRC; //long; {0x242A, &SwWW8ImplReader::Read_Hyphenation},//"sprmPFNoAutoHyph" //pap.fNoAutoHyph;0 or 1;byte; - {0x442B, 0}, //"sprmPWHeightAbs" + {0x442B, nullptr}, //"sprmPWHeightAbs" //pap.wHeightAbs;w;word; - {0x442C, 0}, //"sprmPDcs" pap.dcs;DCS;short; + {0x442C, nullptr}, //"sprmPDcs" pap.dcs;DCS;short; {0x442D, &SwWW8ImplReader::Read_Shade}, //"sprmPShd" pap.shd;SHD;word; - {0x842E, 0}, //"sprmPDyaFromText" + {0x842E, nullptr}, //"sprmPDyaFromText" //pap.dyaFromText;dya;word; - {0x842F, 0}, //"sprmPDxaFromText" + {0x842F, nullptr}, //"sprmPDxaFromText" //pap.dxaFromText;dxa;word; - {0x2430, 0}, //"sprmPFLocked" pap.fLocked; + {0x2430, nullptr}, //"sprmPFLocked" pap.fLocked; //0 or 1;byte; {0x2431, &SwWW8ImplReader::Read_WidowControl},//"sprmPFWidowControl" //pap.fWidowControl;0 or 1;byte - {0xC632, 0}, //"sprmPRuler" variable length; + {0xC632, nullptr}, //"sprmPRuler" variable length; {0x2433, &SwWW8ImplReader::Read_BoolItem}, //"sprmPFKinsoku" pap.fKinsoku; //0 or 1;byte; - {0x2434, 0}, //"sprmPFWordWrap" + {0x2434, nullptr}, //"sprmPFWordWrap" //pap.fWordWrap;0 or 1;byte; {0x2435, &SwWW8ImplReader::Read_BoolItem}, //"sprmPFOverflowPunct" //pap.fOverflowPunct; 0 or 1; //byte; - {0x2436, 0}, //"sprmPFTopLinePunct" + {0x2436, nullptr}, //"sprmPFTopLinePunct" //pap.fTopLinePunct;0 or 1;byte {0x2437, &SwWW8ImplReader::Read_BoolItem}, //"sprmPFAutoSpaceDE" //pap.fAutoSpaceDE;0 or 1;byte; - {0x2438, 0}, //"sprmPFAutoSpaceDN" + {0x2438, nullptr}, //"sprmPFAutoSpaceDN" //pap.fAutoSpaceDN;0 or 1;byte; {NS_sprm::LN_PWAlignFont, &SwWW8ImplReader::Read_AlignFont}, //"sprmPWAlignFont" //pap.wAlignFont;iFa; word; - {0x443A, 0}, //"sprmPFrameTextFlow" + {0x443A, nullptr}, //"sprmPFrameTextFlow" //pap.fVertical pap.fBackward //pap.fRotateFont;complex; word - {0x243B, 0}, //"sprmPISnapBaseLine" obsolete + {0x243B, nullptr}, //"sprmPISnapBaseLine" obsolete //not applicable in Word97 //and later versions;;byte; {0xC63E, &SwWW8ImplReader::Read_ANLevelDesc},//"sprmPAnld" pap.anld;; //variable length; - {0xC63F, 0}, //"sprmPPropRMark" + {0xC63F, nullptr}, //"sprmPPropRMark" //pap.fPropRMark;complex; //variable length; {0x2640, &SwWW8ImplReader::Read_POutLvl}, //"sprmPOutLvl" pap.lvl;has no //effect if pap.istd is < 1 or //is > 9;byte; {0x2441, &SwWW8ImplReader::Read_ParaBiDi}, //"sprmPFBiDi" ;;byte; - {0x2443, 0}, //"sprmPFNumRMIns" + {0x2443, nullptr}, //"sprmPFNumRMIns" //pap.fNumRMIns;1 or 0;bit; - {0x2444, 0}, //"sprmPCrLf" ;;byte; - {0xC645, 0}, //"sprmPNumRM" pap.numrm;; + {0x2444, nullptr}, //"sprmPCrLf" ;;byte; + {0xC645, nullptr}, //"sprmPNumRM" pap.numrm;; //variable length; - {0x6645, 0}, //"sprmPHugePapx" ;fc in the + {0x6645, nullptr}, //"sprmPHugePapx" ;fc in the //data stream to locate the //huge grpprl; long; - {0x6646, 0}, //"sprmPHugePapx" ;fc in the + {0x6646, nullptr}, //"sprmPHugePapx" ;fc in the //data stream to locate the //huge grpprl; long; {0x2447, &SwWW8ImplReader::Read_UsePgsuSettings},//"sprmPFUsePgsuSettings" //pap.fUsePgsuSettings;1 or 0; //byte; - {0x2448, 0}, //"sprmPFAdjustRight" + {0x2448, nullptr}, //"sprmPFAdjustRight" //pap.fAdjustRight;1 or 0;byte; {0x0800, &SwWW8ImplReader::Read_CFRMarkDel}, //"sprmCFRMarkDel" //chp.fRMarkDel;1 or 0;bit; @@ -5775,14 +5775,14 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() //and chp.fSpec;variable //length, length recorded is //always 4; - {0x4804, 0}, //"sprmCIbstRMark" + {0x4804, nullptr}, //"sprmCIbstRMark" //chp.ibstRMark;index into //sttbRMark;short; - {0x6805, 0}, //"sprmCDttmRMark" + {0x6805, nullptr}, //"sprmCDttmRMark" //chp.dttmRMark;DTTM;long; - {0x0806, 0}, //"sprmCFData" chp.fData;1 or + {0x0806, nullptr}, //"sprmCFData" chp.fData;1 or //0;bit; - {0x4807, 0}, //"sprmCIdslRMark" + {0x4807, nullptr}, //"sprmCIdslRMark" //chp.idslRMReason;an index to //a table of strings defined in //Word 6.0 executables;short; @@ -5807,12 +5807,12 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() //0x2A10, ? ? ?, //"sprmCFFtcAsciSymb" {0x4A30, &SwWW8ImplReader::Read_CColl}, //"sprmCIstd" chp.istd;istd, //short; - {0xCA31, 0}, //"sprmCIstdPermute" chp.istd; + {0xCA31, nullptr}, //"sprmCIstdPermute" chp.istd; //permutation vector; variable //length; - {0x2A32, 0}, //"sprmCDefault" whole CHP;none + {0x2A32, nullptr}, //"sprmCDefault" whole CHP;none //;variable length; - {0x2A33, 0}, //"sprmCPlain" whole CHP;none; + {0x2A33, nullptr}, //"sprmCPlain" whole CHP;none; //Laenge: 0; {0x2A34, &SwWW8ImplReader::Read_Emphasis}, //"sprmCKcd" {0x0835, &SwWW8ImplReader::Read_BoldUsw}, //"sprmCFBold" chp.fBold;0,1, @@ -5836,7 +5836,7 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() //used internally, never //stored in file;word; {0x2A3E, &SwWW8ImplReader::Read_Underline}, //"sprmCKul" chp.kul;kul;byte; - {0xEA3F, 0}, //"sprmCSizePos" chp.hps, + {0xEA3F, nullptr}, //"sprmCSizePos" chp.hps, //chp.hpsPos;3 bytes; {0x8840, &SwWW8ImplReader::Read_Kern}, //"sprmCDxaSpace" chp.dxaSpace; //dxa;word; @@ -5844,10 +5844,10 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() //internally never stored;word; {0x2A42, &SwWW8ImplReader::Read_TextColor}, //"sprmCIco" chp.ico;ico;byte; {0x4A43, &SwWW8ImplReader::Read_FontSize}, //"sprmCHps" chp.hps;hps;byte; - {0x2A44, 0}, //"sprmCHpsInc" chp.hps;byte; + {0x2A44, nullptr}, //"sprmCHpsInc" chp.hps;byte; {0x4845, &SwWW8ImplReader::Read_SubSuperProp},//"sprmCHpsPos" chp.hpsPos; //hps; byte; - {0x2A46, 0}, //"sprmCHpsPosAdj" chp.hpsPos; + {0x2A46, nullptr}, //"sprmCHpsPosAdj" chp.hpsPos; //hps; byte; {0xCA47, &SwWW8ImplReader::Read_Majority}, //"sprmCMajority" chp.fBold, //chp.fItalic, chp.fSmallCaps, @@ -5859,10 +5859,10 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() //length, length byte plus //size of following grpprl; {0x2A48, &SwWW8ImplReader::Read_SubSuper}, //"sprmCIss" chp.iss;iss;byte; - {0xCA49, 0}, //"sprmCHpsNew50" chp.hps;hps; + {0xCA49, nullptr}, //"sprmCHpsNew50" chp.hps;hps; //variable width, length //always recorded as 2; - {0xCA4A, 0}, //"sprmCHpsInc1" chp.hps; + {0xCA4A, nullptr}, //"sprmCHpsInc1" chp.hps; //complex; variable width, //length always recorded as 2; {0x484B, &SwWW8ImplReader::Read_FontKern}, //"sprmCHpsKern" chp.hpsKern; @@ -5874,9 +5874,9 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() //chp.hpsPos, chp.kul, //chp.dxaSpace, chp.ico; //complex; variable length; - {0x4A4D, 0}, //"sprmCHpsMul" chp.hps; + {0x4A4D, nullptr}, //"sprmCHpsMul" chp.hps; //percentage to grow hps;short; - {0x484E, 0}, //"sprmCYsri" chp.ysri;ysri; + {0x484E, nullptr}, //"sprmCYsri" chp.ysri;ysri; //short; {0x4A4F, &SwWW8ImplReader::Read_FontCode}, //"sprmCRgFtc0" chp.rgftc[0]; //ftc for ASCII text; short; @@ -5905,36 +5905,36 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() {0x2859, &SwWW8ImplReader::Read_TextAnim}, //"sprmCSfxText" chp.sfxtText; //text animation;byte; {0x085A, &SwWW8ImplReader::Read_Bidi}, //"sprmCFBiDi" - {0x085B, 0}, //"sprmCFDiacColor" + {0x085B, nullptr}, //"sprmCFDiacColor" {0x085C, &SwWW8ImplReader::Read_BoldBiDiUsw},//"sprmCFBoldBi" {0x085D, &SwWW8ImplReader::Read_BoldBiDiUsw},//"sprmCFItalicBi" {0x4A5E, &SwWW8ImplReader::Read_FontCode}, //"sprmCFtcBi" {0x485F, &SwWW8ImplReader::Read_Language}, //"sprmCLidBi" //0x4A60, ? ? ?, //"sprmCIcoBi", {0x4A61, &SwWW8ImplReader::Read_FontSize}, //"sprmCHpsBi" - {0xCA62, 0}, //"sprmCDispFieldRMark" + {0xCA62, nullptr}, //"sprmCDispFieldRMark" //chp.fDispFieldRMark, //chp.ibstDispFieldRMark, //chp.dttmDispFieldRMark ; //Complex;variable length //always recorded as 39 bytes; - {0x4863, 0}, //"sprmCIbstRMarkDel" + {0x4863, nullptr}, //"sprmCIbstRMarkDel" //chp.ibstRMarkDel;index into //sttbRMark;short; - {NS_sprm::LN_CDttmRMarkDel, 0}, + {NS_sprm::LN_CDttmRMarkDel, nullptr}, //chp.dttmRMarkDel;DTTM;long; {0x6865, &SwWW8ImplReader::Read_CharBorder}, //"sprmCBrc80" chp.brc;BRC;long; {0xca72, &SwWW8ImplReader::Read_CharBorder}, //"sprmCBrc" chp.brc;BRC;long; {0x4866, &SwWW8ImplReader::Read_CharShadow}, //"sprmCShd80" chp.shd;SHD;short; - {0x4867, 0}, //"sprmCIdslRMarkDel" + {0x4867, nullptr}, //"sprmCIdslRMarkDel" //chp.idslRMReasonDel;an index //to a table of strings //defined in Word 6.0 //executables;short; - {0x0868, 0}, //"sprmCFUsePgsuSettings" + {0x0868, nullptr}, //"sprmCFUsePgsuSettings" //chp.fUsePgsuSettings; 1 or 0; //bit; - {0x486B, 0}, //"sprmCCpg" ;;word; + {0x486B, nullptr}, //"sprmCCpg" ;;word; {0x486D, &SwWW8ImplReader::Read_Language}, //"sprmCRgLid0_80" chp.rglid[0]; //LID: for non-Far East text; //word; @@ -5942,102 +5942,102 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() //LID: for Far East text;word; {0x286F, &SwWW8ImplReader::Read_IdctHint}, //"sprmCIdctHint" chp.idctHint; //IDCT: byte; - {0x2E00, 0}, //"sprmPicBrcl" pic.brcl;brcl + {0x2E00, nullptr}, //"sprmPicBrcl" pic.brcl;brcl //(see PIC structure //definition);byte; - {0xCE01, 0}, //"sprmPicScale" pic.mx, + {0xCE01, nullptr}, //"sprmPicScale" pic.mx, //pic.my, pic.dxaCropleft, //pic.dyaCropTop //pic.dxaCropRight, //pic.dyaCropBottom;Complex; //length byte plus 12 bytes; - {0x6C02, 0}, //"sprmPicBrcTop80" pic.brcTop; + {0x6C02, nullptr}, //"sprmPicBrcTop80" pic.brcTop; //BRC;long; - {0x6C03, 0}, //"sprmPicBrcLeft80" pic.brcLeft; + {0x6C03, nullptr}, //"sprmPicBrcLeft80" pic.brcLeft; //BRC;long; - {0x6C04, 0}, //"sprmPicBrcBottom80" + {0x6C04, nullptr}, //"sprmPicBrcBottom80" //pic.brcBottom;BRC;long; - {0x6C05, 0}, //"sprmPicBrcRight80" + {0x6C05, nullptr}, //"sprmPicBrcRight80" //pic.brcRight;BRC;long; - {0x3000, 0}, //"sprmScnsPgn" sep.cnsPgn;cns; + {0x3000, nullptr}, //"sprmScnsPgn" sep.cnsPgn;cns; //byte; - {0x3001, 0}, //"sprmSiHeadingPgn" + {0x3001, nullptr}, //"sprmSiHeadingPgn" //sep.iHeadingPgn;heading //number level;byte; {0xD202, &SwWW8ImplReader::Read_OLST}, //"sprmSOlstAnm" sep.olstAnm; //OLST;variable length; - {0xF203, 0}, //"sprmSDxaColWidth" + {0xF203, nullptr}, //"sprmSDxaColWidth" //sep.rgdxaColWidthSpacing; //complex; 3 bytes; - {0xF204, 0}, //"sprmSDxaColSpacing" + {0xF204, nullptr}, //"sprmSDxaColSpacing" //sep.rgdxaColWidthSpacing; //complex; 3 bytes; - {0x3005, 0}, //"sprmSFEvenlySpaced" + {0x3005, nullptr}, //"sprmSFEvenlySpaced" //sep.fEvenlySpaced; 1 or 0; //byte; - {0x3006, 0}, //"sprmSFProtected" + {0x3006, nullptr}, //"sprmSFProtected" //sep.fUnlocked;1 or 0;byte; - {0x5007, 0}, //"sprmSDmBinFirst" + {0x5007, nullptr}, //"sprmSDmBinFirst" //sep.dmBinFirst;;word; - {0x5008, 0}, //"sprmSDmBinOther" + {0x5008, nullptr}, //"sprmSDmBinOther" //sep.dmBinOther;;word; - {0x3009, 0}, //"sprmSBkc" sep.bkc;bkc;byte; - {0x300A, 0}, //"sprmSFTitlePage" + {0x3009, nullptr}, //"sprmSBkc" sep.bkc;bkc;byte; + {0x300A, nullptr}, //"sprmSFTitlePage" //sep.fTitlePage;0 or 1;byte; - {0x500B, 0}, //"sprmSCcolumns" sep.ccolM1; + {0x500B, nullptr}, //"sprmSCcolumns" sep.ccolM1; //# of cols - 1;word; - {0x900C, 0}, //"sprmSDxaColumns" + {0x900C, nullptr}, //"sprmSDxaColumns" //sep.dxaColumns;dxa;word; - {0x300D, 0}, //"sprmSFAutoPgn" sep.fAutoPgn; + {0x300D, nullptr}, //"sprmSFAutoPgn" sep.fAutoPgn; //obsolete;byte; - {0x300E, 0}, //"sprmSNfcPgn" sep.nfcPgn;nfc; + {0x300E, nullptr}, //"sprmSNfcPgn" sep.nfcPgn;nfc; //byte; - {0xB00F, 0}, //"sprmSDyaPgn" sep.dyaPgn;dya; + {0xB00F, nullptr}, //"sprmSDyaPgn" sep.dyaPgn;dya; //short; - {0xB010, 0}, //"sprmSDxaPgn" sep.dxaPgn;dya; + {0xB010, nullptr}, //"sprmSDxaPgn" sep.dxaPgn;dya; //short; - {0x3011, 0}, //"sprmSFPgnRestart" + {0x3011, nullptr}, //"sprmSFPgnRestart" //sep.fPgnRestart;0 or 1;byte; - {0x3012, 0}, //"sprmSFEndnote" sep.fEndnote; + {0x3012, nullptr}, //"sprmSFEndnote" sep.fEndnote; //0 or 1;byte; - {0x3013, 0}, //"sprmSLnc" sep.lnc;lnc;byte; - {0x3014, 0}, //"sprmSGprfIhdt" sep.grpfIhdt; + {0x3013, nullptr}, //"sprmSLnc" sep.lnc;lnc;byte; + {0x3014, nullptr}, //"sprmSGprfIhdt" sep.grpfIhdt; //grpfihdt; byte; - {0x5015, 0}, //"sprmSNLnnMod" sep.nLnnMod; + {0x5015, nullptr}, //"sprmSNLnnMod" sep.nLnnMod; //non-neg int.;word; - {0x9016, 0}, //"sprmSDxaLnn" sep.dxaLnn;dxa; + {0x9016, nullptr}, //"sprmSDxaLnn" sep.dxaLnn;dxa; //word; - {0xB017, 0}, //"sprmSDyaHdrTop" + {0xB017, nullptr}, //"sprmSDyaHdrTop" //sep.dyaHdrTop;dya;word; - {0xB018, 0}, //"sprmSDyaHdrBottom" + {0xB018, nullptr}, //"sprmSDyaHdrBottom" //sep.dyaHdrBottom;dya;word; - {0x3019, 0}, //"sprmSLBetween" + {0x3019, nullptr}, //"sprmSLBetween" //sep.fLBetween;0 or 1;byte; {0x301A, &SwWW8ImplReader::Read_TextVerticalAdjustment}, //"sprmSVjc" sep.vjc;vjc;byte; - {0x501B, 0}, //"sprmSLnnMin" sep.lnnMin;lnn; + {0x501B, nullptr}, //"sprmSLnnMin" sep.lnnMin;lnn; //word; - {0x501C, 0}, //"sprmSPgnStart" sep.pgnStart; + {0x501C, nullptr}, //"sprmSPgnStart" sep.pgnStart; //pgn;word; - {0x301D, 0}, //"sprmSBOrientation" + {0x301D, nullptr}, //"sprmSBOrientation" //sep.dmOrientPage;dm;byte; //0x301E, ? ? ?, //"sprmSBCustomize" - {0xB01F, 0}, //"sprmSXaPage" sep.xaPage;xa; + {0xB01F, nullptr}, //"sprmSXaPage" sep.xaPage;xa; //word; - {0xB020, 0}, //"sprmSYaPage" sep.yaPage;ya; + {0xB020, nullptr}, //"sprmSYaPage" sep.yaPage;ya; //word; - {0x2205, 0}, //"sprmSDxaLeft" sep.dxaLeft; + {0x2205, nullptr}, //"sprmSDxaLeft" sep.dxaLeft; //dxa;word; - {0xB022, 0}, //"sprmSDxaRight" sep.dxaRight; + {0xB022, nullptr}, //"sprmSDxaRight" sep.dxaRight; //dxa;word; - {0x9023, 0}, //"sprmSDyaTop" sep.dyaTop;dya; + {0x9023, nullptr}, //"sprmSDyaTop" sep.dyaTop;dya; //word; - {0x9024, 0}, //"sprmSDyaBottom" + {0x9024, nullptr}, //"sprmSDyaBottom" //sep.dyaBottom;dya;word; - {0xB025, 0}, //"sprmSDzaGutter" + {0xB025, nullptr}, //"sprmSDzaGutter" //sep.dzaGutter;dza;word; - {0x5026, 0}, //"sprmSDmPaperReq" + {0x5026, nullptr}, //"sprmSDmPaperReq" //sep.dmPaperReq;dm;word; - {0xD227, 0}, //"sprmSPropRMark" + {0xD227, nullptr}, //"sprmSPropRMark" //sep.fPropRMark, //sep.ibstPropRMark, //sep.dttmPropRMark ;complex; @@ -6045,148 +6045,148 @@ const wwSprmDispatcher *GetWW8SprmDispatcher() //recorded as 7 bytes; //0x3228, ? ? ?, //"sprmSFBiDi", //0x3229, ? ? ?, //"sprmSFFacingCol" - {0x322A, 0}, //"sprmSFRTLGutter", set to 1 + {0x322A, nullptr}, //"sprmSFRTLGutter", set to 1 //if gutter is on the right. - {0x702B, 0}, //"sprmSBrcTop80" sep.brcTop;BRC; + {0x702B, nullptr}, //"sprmSBrcTop80" sep.brcTop;BRC; //long; - {0x702C, 0}, //"sprmSBrcLeft80" sep.brcLeft; + {0x702C, nullptr}, //"sprmSBrcLeft80" sep.brcLeft; //BRC;long; - {0x702D, 0}, //"sprmSBrcBottom80" + {0x702D, nullptr}, //"sprmSBrcBottom80" //sep.brcBottom;BRC;long; - {0x702E, 0}, //"sprmSBrcRight80" sep.brcRight; + {0x702E, nullptr}, //"sprmSBrcRight80" sep.brcRight; //BRC;long; - {0x522F, 0}, //"sprmSPgbProp" sep.pgbProp; + {0x522F, nullptr}, //"sprmSPgbProp" sep.pgbProp; //word; - {0x7030, 0}, //"sprmSDxtCharSpace" + {0x7030, nullptr}, //"sprmSDxtCharSpace" //sep.dxtCharSpace;dxt;long; - {0x9031, 0}, //"sprmSDyaLinePitch" + {0x9031, nullptr}, //"sprmSDyaLinePitch" //sep.dyaLinePitch;dya; //WRONG:long; RIGHT:short; ! //0x5032, ? ? ?, //"sprmSClm" - {0x5033, 0}, //"sprmSTextFlow" + {0x5033, nullptr}, //"sprmSTextFlow" //sep.wTextFlow;complex ;short - {0x5400, 0}, //"sprmTJc90" tap.jc;jc;word (low + {0x5400, nullptr}, //"sprmTJc90" tap.jc;jc;word (low //order byte is significant); - {0x9601, 0}, //"sprmTDxaLeft" + {0x9601, nullptr}, //"sprmTDxaLeft" //tap.rgdxaCenter; dxa; word; - {0x9602, 0}, //"sprmTDxaGapHalf" + {0x9602, nullptr}, //"sprmTDxaGapHalf" //tap.dxaGapHalf, //tap.rgdxaCenter; dxa; word; - {0x3403, 0}, //"sprmTFCantSplit" + {0x3403, nullptr}, //"sprmTFCantSplit" //tap.fCantSplit;1 or 0;byte; - {0x3404, 0}, //"sprmTTableHeader" + {0x3404, nullptr}, //"sprmTTableHeader" //tap.fTableHeader;1 or 0;byte; - {0x3466, 0}, //"sprmTFCantSplit90" + {0x3466, nullptr}, //"sprmTFCantSplit90" //tap.fCantSplit90;1 or 0;byte; - {0xD605, 0}, //"sprmTTableBorders80" + {0xD605, nullptr}, //"sprmTTableBorders80" //tap.rgbrcTable;complex; //24 bytes; - {0xD606, 0}, //"sprmTDefTable10" + {0xD606, nullptr}, //"sprmTDefTable10" //tap.rgdxaCenter, //tap.rgtc;complex; variable //length; - {0x9407, 0}, //"sprmTDyaRowHeight" + {0x9407, nullptr}, //"sprmTDyaRowHeight" //tap.dyaRowHeight;dya;word; - {0xD608, 0}, //"sprmTDefTable" + {0xD608, nullptr}, //"sprmTDefTable" //tap.rgtc;complex - {0xD609, 0}, //"sprmTDefTableShd80" + {0xD609, nullptr}, //"sprmTDefTableShd80" //tap.rgshd;complex - {0x740A, 0}, //"sprmTTlp" tap.tlp;TLP; + {0x740A, nullptr}, //"sprmTTlp" tap.tlp;TLP; //4 bytes; //0x560B, ? ? ?, //"sprmTFBiDi" //0x740C, ? ? ?, //"sprmTHTMLProps" - {0xD620, 0}, //"sprmTSetBrc80" + {0xD620, nullptr}, //"sprmTSetBrc80" //tap.rgtc[].rgbrc;complex; //5 bytes; - {0x7621, 0}, //"sprmTInsert" + {0x7621, nullptr}, //"sprmTInsert" //tap.rgdxaCenter, //tap.rgtc;complex ;4 bytes; - {0x5622, 0}, //"sprmTDelete" + {0x5622, nullptr}, //"sprmTDelete" //tap.rgdxaCenter, //tap.rgtc;complex ;word; - {0x7623, 0}, //"sprmTDxaCol" + {0x7623, nullptr}, //"sprmTDxaCol" //tap.rgdxaCenter;complex; //4 bytes; - {0x5624, 0}, //"sprmTMerge" + {0x5624, nullptr}, //"sprmTMerge" //tap.fFirstMerged, //tap.fMerged;complex; word; - {0x5625, 0}, //"sprmTSplit" + {0x5625, nullptr}, //"sprmTSplit" //tap.fFirstMerged, //tap.fMerged;complex ;word; - {0xD626, 0}, //"sprmTSetBrc10" + {0xD626, nullptr}, //"sprmTSetBrc10" //tap.rgtc[].rgbrc;complex; //5 bytes; - {0x7627, 0}, //"sprmTSetShd80" tap.rgshd; + {0x7627, nullptr}, //"sprmTSetShd80" tap.rgshd; //complex; 4 bytes; - {0x7628, 0}, //"sprmTSetShdOdd80" + {0x7628, nullptr}, //"sprmTSetShdOdd80" //tap.rgshd;complex;4 bytes; - {0x7629, 0}, //"sprmTTextFlow" + {0x7629, nullptr}, //"sprmTTextFlow" //tap.rgtc[].fVertical //tap.rgtc[].fBackward //tap.rgtc[].fRotateFont //0 or 10 or 10 or 1;word; //0xD62A, ? ? ? , //"sprmTDiagLine" - {0xD62B, 0}, //"sprmTVertMerge" + {0xD62B, nullptr}, //"sprmTVertMerge" //tap.rgtc[].vertMerge;complex; //variable length always //recorded as 2 bytes; - {0xD62C, 0}, //"sprmTVertAlign" + {0xD62C, nullptr}, //"sprmTVertAlign" //tap.rgtc[].vertAlign;complex //variable length always //recorded as 3 byte; {NS_sprm::LN_CFELayout, &SwWW8ImplReader::Read_DoubleLine_Rotate}, - {0x6649, 0}, //undocumented - {0xF614, 0}, //"sprmTTableWidth" + {0x6649, nullptr}, //undocumented + {0xF614, nullptr}, //"sprmTTableWidth" //recorded as 3 bytes; - {0xD612, 0}, //"sprmTCellShd" - {0xD613, 0}, //"sprmTTableBorders" - {0xD61A, 0}, //undocumented - {0xD61B, 0}, //undocumented - {0xD61C, 0}, //undocumented - {0xD61D, 0}, //undocumented - {0xD634, 0}, //undocumented - {0xD632, 0}, //undocumented - {0xD238, 0}, //undocumented sep + {0xD612, nullptr}, //"sprmTCellShd" + {0xD613, nullptr}, //"sprmTTableBorders" + {0xD61A, nullptr}, //undocumented + {0xD61B, nullptr}, //undocumented + {0xD61C, nullptr}, //undocumented + {0xD61D, nullptr}, //undocumented + {0xD634, nullptr}, //undocumented + {0xD632, nullptr}, //undocumented + {0xD238, nullptr}, //undocumented sep {0xC64E, &SwWW8ImplReader::Read_Border}, //"sprmPBrcTop" {0xC64F, &SwWW8ImplReader::Read_Border}, //"sprmPBrcLeft" {0xC650, &SwWW8ImplReader::Read_Border}, //"sprmPBrcBottom" {0xC651, &SwWW8ImplReader::Read_Border}, //"sprmPBrcRight" {0xC652, &SwWW8ImplReader::Read_Border}, //"sprmPBorderBetween" - {0xF661, 0}, //undocumented + {0xF661, nullptr}, //undocumented {0x4873, &SwWW8ImplReader::Read_Language}, //"sprmCRgLid0" chp.rglid[0]; //LID: for non-Far East text; //(like a duplicate of 486D) - {0x4874, 0}, //"sprmCRgLid1" chp.rglid[1]; + {0x4874, nullptr}, //"sprmCRgLid1" chp.rglid[1]; //LID: for Far East text //(like a duplicate of 486E) - {0x6463, 0}, //undocumented + {0x6463, nullptr}, //undocumented {0x2461, &SwWW8ImplReader::Read_RTLJustify}, //undoc, must be asian version //of "sprmPJc" {0x845E, &SwWW8ImplReader::Read_LR}, //Apparently post-Word 97 version of "sprmPDxaLeft" {0x8460, &SwWW8ImplReader::Read_LR}, //Post-Word 97 version of "sprmPDxaLeft1" {0x845D, &SwWW8ImplReader::Read_LR}, //Post-Word 97 version of "sprmPDxaRight" - {0x3615, 0}, //undocumented - {0x360D, 0}, //undocumented - {0x940E, 0}, //undocumented - {0x940F, 0}, //undocumented - {0x9410, 0}, //undocumented - {0x703A, 0}, //undocumented - {0x303B, 0}, //undocumented + {0x3615, nullptr}, //undocumented + {0x360D, nullptr}, //undocumented + {0x940E, nullptr}, //undocumented + {0x940F, nullptr}, //undocumented + {0x9410, nullptr}, //undocumented + {0x703A, nullptr}, //undocumented + {0x303B, nullptr}, //undocumented {0x244B, &SwWW8ImplReader::Read_TabCellEnd}, //undocumented, must be //subtable "sprmPFInTable" {0x244C, &SwWW8ImplReader::Read_TabRowEnd}, //undocumented, must be // subtable "sprmPFTtp" - {0x6815, 0}, //undocumented - {0x6816, 0}, //undocumented + {0x6815, nullptr}, //undocumented + {0x6816, nullptr}, //undocumented {NS_sprm::LN_CCv, &SwWW8ImplReader::Read_TextForeColor}, {NS_sprm::LN_CCvUl, &SwWW8ImplReader::Read_UnderlineColor}, {0xC64D, &SwWW8ImplReader::Read_ParaBackColor}, - {0x6467, 0}, //undocumented - {0xF617, 0}, //undocumented - {0xD660, 0}, //undocumented - {0xD670, 0}, //undocumented + {0x6467, nullptr}, //undocumented + {0xF617, nullptr}, //undocumented + {0xD660, nullptr}, //undocumented + {0xD670, nullptr}, //undocumented {0xCA71, &SwWW8ImplReader::Read_TextBackColor},//"sprmCShd" - {0x303C, 0}, //undocumented + {0x303C, nullptr}, //undocumented {0x245B, &SwWW8ImplReader::Read_ParaAutoBefore},//undocumented, para {0x245C, &SwWW8ImplReader::Read_ParaAutoAfter},//undocumented, para {0x246D, &SwWW8ImplReader::Read_ParaContextualSpacing} //"sprmPFContextualSpacing" @@ -6209,7 +6209,7 @@ const SprmReadInfo& SwWW8ImplReader::GetSprmReadInfo(sal_uInt16 nId) const else pDispatcher = GetWW8SprmDispatcher(); - SprmReadInfo aSrch = {0, 0}; + SprmReadInfo aSrch = {0, nullptr}; aSrch.nId = nId; const SprmReadInfo* pFound = pDispatcher->search(aSrch); @@ -6231,7 +6231,7 @@ void SwWW8ImplReader::EndSprm( sal_uInt16 nId ) const SprmReadInfo& rSprm = GetSprmReadInfo( nId ); if (rSprm.pReadFnc) - (this->*rSprm.pReadFnc)( nId, 0, -1 ); + (this->*rSprm.pReadFnc)( nId, nullptr, -1 ); } short SwWW8ImplReader::ImportSprm(const sal_uInt8* pPos,sal_uInt16 nId) diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 1faafca00c94..350d9abc9d49 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -791,7 +791,7 @@ wwSprmParser::wwSprmParser(ww::WordVersion eVersion) : meVersion(eVersion) SprmInfo wwSprmParser::GetSprmInfo(sal_uInt16 nId) const { const SprmInfo* pFound = mpKnownSprms->search(nId); - if (pFound != 0) + if (pFound != nullptr) { return *pFound; } @@ -909,7 +909,7 @@ void WW8SprmIter::UpdateMyMembers() if (!bValid) { nAktId = 0; - pAktParams = 0; + pAktParams = nullptr; nAktSize = 0; nRemLen = 0; } @@ -924,7 +924,7 @@ const sal_uInt8* WW8SprmIter::FindSprm(sal_uInt16 nId) advance(); } - return 0; // SPRM _not_ found + return nullptr; // SPRM _not_ found } // temporary test @@ -970,7 +970,7 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p) { // PLCF fully processed p->nStartPos = p->nEndPos = WW8_CP_MAX; - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; return; } @@ -985,7 +985,7 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p) { // Invalid Index p->nStartPos = p->nEndPos = WW8_CP_MAX; - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; return; } @@ -1013,7 +1013,7 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p) } else { - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; sal_uInt8 nSprmListIdx = (sal_uInt8)((nPrm & 0xfe) >> 1); if( nSprmListIdx ) @@ -1498,12 +1498,12 @@ WW8_FC WW8ScannerBase::WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode, WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF ) { if ( ((8 > pWw8Fib->nVersion) && !pWwF->fComplex) || !pWwF->lcbClx ) - return NULL; + return nullptr; WW8_FC nClxPos = pWwF->fcClx; if (!checkSeek(*pStr, nClxPos)) - return NULL; + return nullptr; sal_Int32 nClxLen = pWwF->lcbClx; sal_Int32 nLeft = nClxLen; @@ -1519,19 +1519,19 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF ) pStr->ReadUInt16( nLen ); nLeft -= 2 + nLen; if( nLeft < 0 ) - return NULL; // gone wrong + return nullptr; // gone wrong if( 1 == clxt ) // clxtGrpprl ? { if (aPieceGrpprls.size() == SHRT_MAX) - return NULL; + return nullptr; if (nLen > pStr->remainingSize()) - return NULL; + return nullptr; sal_uInt8* p = new sal_uInt8[nLen+2]; // allocate ShortToSVBT16(nLen, p); // add length if (!checkRead(*pStr, p+2, nLen)) // read grpprl { delete[] p; - return NULL; + return nullptr; } aPieceGrpprls.push_back(p); // add to array } @@ -1561,9 +1561,9 @@ void WW8ScannerBase::DeletePieceTable() WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTableSt, SvStream* pDataSt, WW8Fib* pWwFib ) - : pWw8Fib(pWwFib), pMainFdoa(0), pHdFtFdoa(0), pMainTxbx(0), - pMainTxbxBkd(0), pHdFtTxbx(0), pHdFtTxbxBkd(0), pMagicTables(0), - pSubdocs(0), pExtendedAtrds(0) + : pWw8Fib(pWwFib), pMainFdoa(nullptr), pHdFtFdoa(nullptr), pMainTxbx(nullptr), + pMainTxbxBkd(nullptr), pHdFtTxbx(nullptr), pHdFtTxbxBkd(nullptr), pMagicTables(nullptr), + pSubdocs(nullptr), pExtendedAtrds(nullptr) { pPiecePLCF = OpenPieceTable( pTableSt, pWw8Fib ); // Complex if( pPiecePLCF ) @@ -1576,9 +1576,9 @@ WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTableSt, } else { - pPieceIter = 0; - pPLCFx_PCD = 0; - pPLCFx_PCDAttrs = 0; + pPieceIter = nullptr; + pPLCFx_PCD = nullptr; + pPLCFx_PCDAttrs = nullptr; } // pChpPLCF and pPapPLCF may NOT be created before pPLCFx_PCD !! @@ -1949,7 +1949,7 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, sal_uInt32 nFilePos, if( nStruct ) // Pointer to content array pPLCF_Contents = reinterpret_cast<sal_uInt8*>(&pPLCF_PosArray[nIMax + 1]); else - pPLCF_Contents = 0; // no content + pPLCF_Contents = nullptr; // no content pSt->Seek(nOldPos); } @@ -2037,7 +2037,7 @@ bool WW8PLCFspecial::GetData(long nInIdx, WW8_CP& rPos, void*& rpValue) const return false; } rPos = pPLCF_PosArray[nInIdx]; - rpValue = pPLCF_Contents ? static_cast<void*>(&pPLCF_Contents[nInIdx * nStru]) : 0; + rpValue = pPLCF_Contents ? static_cast<void*>(&pPLCF_Contents[nInIdx * nStru]) : nullptr; return true; } @@ -2045,7 +2045,7 @@ bool WW8PLCFspecial::GetData(long nInIdx, WW8_CP& rPos, void*& rpValue) const // Ctor for *others* than Fkps // With nStartPos < 0, the first element of PLCFs will be taken WW8PLCF::WW8PLCF(SvStream& rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct, - WW8_CP nStartPos) : pPLCF_PosArray(0), nIdx(0), nStru(nStruct) + WW8_CP nStartPos) : pPLCF_PosArray(nullptr), nIdx(0), nStru(nStruct) { OSL_ENSURE( nPLCF, "WW8PLCF: nPLCF is zero!" ); @@ -2063,7 +2063,7 @@ WW8PLCF::WW8PLCF(SvStream& rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct, // lack of resources and for WordPad (W95). // With nStartPos < 0, the first element of the PLCFs is taken. WW8PLCF::WW8PLCF(SvStream& rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct, - WW8_CP nStartPos, sal_Int32 nPN, sal_Int32 ncpN): pPLCF_PosArray(0), nIdx(0), + WW8_CP nStartPos, sal_Int32 nPN, sal_Int32 ncpN): pPLCF_PosArray(nullptr), nIdx(0), nStru(nStruct) { nIMax = ( nPLCF - 4 ) / ( 4 + nStruct ); @@ -2547,7 +2547,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt, if (bOk) { const sal_uInt16 nOrigLen = bExpand ? aEntry.mnLen : 0; - sal_uInt8 *pOrigData = bExpand ? aEntry.mpData : 0; + sal_uInt8 *pOrigData = bExpand ? aEntry.mpData : nullptr; aEntry.mnLen = nLen; aEntry.mpData = @@ -2695,7 +2695,7 @@ sal_uInt8* WW8PLCFx_Fc_FKP::WW8Fkp::Get(WW8_FC& rStart, WW8_FC& rEnd, sal_Int32& if (mnIdx >= mnIMax) { rStart = WW8_FC_MAX; - return 0; + return nullptr; } rStart = maEntries[mnIdx].mnFC; @@ -2724,7 +2724,7 @@ sal_uInt8* WW8PLCFx_Fc_FKP::WW8Fkp::GetLenAndIStdAndSprms(sal_Int32& rLen) const const sal_uInt8* WW8PLCFx_Fc_FKP::WW8Fkp::HasSprm( sal_uInt16 nId ) { if (mnIdx >= mnIMax) - return 0; + return nullptr; sal_Int32 nLen; sal_uInt8* pSprms = GetLenAndIStdAndSprms( nLen ); @@ -2757,7 +2757,7 @@ void WW8PLCFx::GetSprms( WW8PLCFxDesc* p ) { OSL_ENSURE( false, "Called wrong GetSprms" ); p->nStartPos = p->nEndPos = WW8_CP_MAX; - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; p->bRealLineEnd = false; return; @@ -2832,7 +2832,7 @@ bool WW8PLCFx_Fc_FKP::NewFkp() if (!pPLCF->Get( nPLCFStart, nPLCFEnd, pPage )) { - pFkp = 0; + pFkp = nullptr; return false; // PLCF completely processed } pPLCF->advance(); @@ -2872,7 +2872,7 @@ bool WW8PLCFx_Fc_FKP::NewFkp() WW8PLCFx_Fc_FKP::WW8PLCFx_Fc_FKP(SvStream* pSt, SvStream* pTableSt, SvStream* pDataSt, const WW8Fib& rFib, ePLCFT ePl, WW8_FC nStartFcL) : WW8PLCFx(rFib.GetFIBVersion(), true), pFKPStrm(pSt), pDataStrm(pDataSt), - pFkp(0), ePLCF(ePl), pPCDAttrs(0) + pFkp(nullptr), ePLCF(ePl), pPCDAttrs(nullptr) { SetStartFc(nStartFcL); long nLenStruct = (8 > rFib.nVersion) ? 2 : 4; @@ -2910,7 +2910,7 @@ void WW8PLCFx_Fc_FKP::SetIdx( sal_uLong nIdx ) if( !( nIdx & 0xffffff00L ) ) { pPLCF->SetIdx( nIdx >> 8 ); - pFkp = 0; + pFkp = nullptr; } else { // there was a Fkp @@ -2940,7 +2940,7 @@ bool WW8PLCFx_Fc_FKP::SeekPos(WW8_FC nFcPos) long nPo = SVBT16ToShort( static_cast<sal_uInt8 *>(pPage) ); nPo <<= 9; // shift as LONG if (nPo != pFkp->GetFilePos()) - pFkp = 0; + pFkp = nullptr; else pFkp->SeekPos( nFcPos ); } @@ -2958,7 +2958,7 @@ WW8_FC WW8PLCFx_Fc_FKP::Where() if( nP != WW8_FC_MAX ) return nP; - pFkp = 0; // FKP finished -> get new + pFkp = nullptr; // FKP finished -> get new return Where(); // easiest way: do it recursively } @@ -2970,12 +2970,12 @@ sal_uInt8* WW8PLCFx_Fc_FKP::GetSprmsAndPos(WW8_FC& rStart, WW8_FC& rEnd, sal_Int if( !pFkp ) // Fkp not there ? { if( !NewFkp() ) - return 0; + return nullptr; } - sal_uInt8* pPos = pFkp ? pFkp->Get( rStart, rEnd, rLen ) : NULL; + sal_uInt8* pPos = pFkp ? pFkp->Get( rStart, rEnd, rLen ) : nullptr; if( rStart == WW8_FC_MAX ) //Not found - return 0; + return nullptr; return pPos; } @@ -3002,7 +3002,7 @@ sal_uInt16 WW8PLCFx_Fc_FKP::GetIstd() const void WW8PLCFx_Fc_FKP::GetPCDSprms( WW8PLCFxDesc& rDesc ) { - rDesc.pMemPos = 0; + rDesc.pMemPos = nullptr; rDesc.nSprmsLen = 0; if( pPCDAttrs ) { @@ -3024,11 +3024,11 @@ const sal_uInt8* WW8PLCFx_Fc_FKP::HasSprm( sal_uInt16 nId ) OSL_FAIL( "+Motz: HasSprm: NewFkp needed ( no const possible )" ); // happens in BugDoc 31722 if( !NewFkp() ) - return 0; + return nullptr; } if (!pFkp) - return 0; + return nullptr; const sal_uInt8* pRes = pFkp->HasSprm( nId ); @@ -3091,7 +3091,7 @@ WW8PLCFx_Cp_FKP::WW8PLCFx_Cp_FKP( SvStream* pSt, SvStream* pTableSt, ResetAttrStartEnd(); pPcd = rSBase.pPiecePLCF ? new WW8PLCFx_PCD(GetFIBVersion(), - rBase.pPiecePLCF, 0, IsSevenMinus(GetFIBVersion())) : 0; + rBase.pPiecePLCF, 0, IsSevenMinus(GetFIBVersion())) : nullptr; /* Make a copy of the piece attributes for so that the calls to HasSprm on a @@ -3102,7 +3102,7 @@ WW8PLCFx_Cp_FKP::WW8PLCFx_Cp_FKP( SvStream* pSt, SvStream* pTableSt, if (pPcd) { pPCDAttrs = rSBase.pPLCFx_PCDAttrs ? new WW8PLCFx_PCDAttrs( - rSBase.pWw8Fib->GetFIBVersion(), pPcd, &rSBase) : 0; + rSBase.pWw8Fib->GetFIBVersion(), pPcd, &rSBase) : nullptr; } pPieceIter = rSBase.pPieceIter; @@ -3232,7 +3232,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p) character is at the FKP FC minus 1. */ WW8_CP nCpStart, nCpEnd; - void* pData=NULL; + void* pData=nullptr; bool bOk = pPieceIter->Get(nCpStart, nCpEnd, pData); if (!bOk) @@ -3377,7 +3377,7 @@ WW8PLCFx_SEPX::WW8PLCFx_SEPX(SvStream* pSt, SvStream* pTableSt, pPLCF = rFib.lcbPlcfsed ? new WW8PLCF(*pTableSt, rFib.fcPlcfsed, rFib.lcbPlcfsed, GetFIBVersion() <= ww::eWW2 ? 6 : 12, nStartCp) - : 0; + : nullptr; pSprms = new sal_uInt8[nArrMax]; // maximum length } @@ -3418,7 +3418,7 @@ void WW8PLCFx_SEPX::GetSprms(WW8PLCFxDesc* p) if (!pPLCF->Get( p->nStartPos, p->nEndPos, pData )) { p->nStartPos = p->nEndPos = WW8_CP_MAX; // PLCF completely processed - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; } else @@ -3427,7 +3427,7 @@ void WW8PLCFx_SEPX::GetSprms(WW8PLCFxDesc* p) if (nPo == 0xFFFFFFFF) { p->nStartPos = p->nEndPos = WW8_CP_MAX; // Sepx empty - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; } else @@ -3478,7 +3478,7 @@ const sal_uInt8* WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId ) const const sal_uInt8* WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, const sal_uInt8* pOtherSprms, long nOtherSprmSiz ) const { - const sal_uInt8 *pRet = 0; + const sal_uInt8 *pRet = nullptr; if (pPLCF) { WW8SprmIter aIter(pOtherSprms, nOtherSprmSiz, maSprmParser); @@ -3494,10 +3494,10 @@ bool WW8PLCFx_SEPX::Find4Sprms(sal_uInt16 nId1,sal_uInt16 nId2,sal_uInt16 nId3,s return false; bool bFound = false; - p1 = 0; - p2 = 0; - p3 = 0; - p4 = 0; + p1 = nullptr; + p2 = nullptr; + p3 = nullptr; + p4 = nullptr; sal_uInt8* pSp = pSprms; sal_uInt16 i=0; @@ -3528,7 +3528,7 @@ bool WW8PLCFx_SEPX::Find4Sprms(sal_uInt16 nId1,sal_uInt16 nId2,sal_uInt16 nId3,s const sal_uInt8* WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, sal_uInt8 n2nd ) const { if( !pPLCF ) - return 0; + return nullptr; sal_uInt8* pSp = pSprms; @@ -3549,13 +3549,13 @@ const sal_uInt8* WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, sal_uInt8 n2nd ) const pSp += x; } - return 0; // Sprm not found + return nullptr; // Sprm not found } WW8PLCFx_SubDoc::WW8PLCFx_SubDoc(SvStream* pSt, ww::WordVersion eVersion, WW8_CP nStartCp, long nFcRef, long nLenRef, long nFcText, long nLenText, long nStruct) - : WW8PLCFx(eVersion, true), pRef(0), pText(0) + : WW8PLCFx(eVersion, true), pRef(nullptr), pText(nullptr) { if( nLenRef && nLenText ) { @@ -3601,7 +3601,7 @@ WW8_CP WW8PLCFx_SubDoc::Where() void WW8PLCFx_SubDoc::GetSprms(WW8PLCFxDesc* p) { p->nStartPos = p->nEndPos = WW8_CP_MAX; - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; p->bRealLineEnd = false; @@ -3646,7 +3646,7 @@ void WW8PLCFx_SubDoc::advance() // fields WW8PLCFx_FLD::WW8PLCFx_FLD( SvStream* pSt, const WW8Fib& rMyFib, short nType) - : WW8PLCFx(rMyFib.GetFIBVersion(), true), pPLCF(0), rFib(rMyFib) + : WW8PLCFx(rMyFib.GetFIBVersion(), true), pPLCF(nullptr), rFib(rMyFib) { long nFc, nLen; @@ -3751,7 +3751,7 @@ bool WW8PLCFx_FLD::EndPosIsFieldEnd(WW8_CP& nCP) void WW8PLCFx_FLD::GetSprms(WW8PLCFxDesc* p) { p->nStartPos = p->nEndPos = WW8_CP_MAX; - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; p->bRealLineEnd = false; @@ -3946,7 +3946,7 @@ WW8PLCFx_Book::WW8PLCFx_Book(SvStream* pTableSt, const WW8Fib& rFib) if( !rFib.fcPlcfbkf || !rFib.lcbPlcfbkf || !rFib.fcPlcfbkl || !rFib.lcbPlcfbkl || !rFib.fcSttbfbkmk || !rFib.lcbSttbfbkmk ) { - pBook[0] = pBook[1] = 0; + pBook[0] = pBook[1] = nullptr; nIMax = 0; } else @@ -4062,7 +4062,7 @@ void WW8PLCFx_Book::advance() else { const void * p = pBook[0]->GetData(pBook[0]->GetIdx()); - long nPairFor = (p == NULL)? 0L : SVBT16ToShort(*static_cast<SVBT16 const *>(p)); + long nPairFor = (p == nullptr)? 0L : SVBT16ToShort(*static_cast<SVBT16 const *>(p)); if (nPairFor == pBook[1]->GetIdx()) nIsEnd = 0; else @@ -4201,7 +4201,7 @@ bool WW8PLCFx_Book::MapName(OUString& rName) const OUString* WW8PLCFx_Book::GetName() const { - const OUString *pRet = 0; + const OUString *pRet = nullptr; if (!nIsEnd && (pBook[0]->GetIdx() < nIMax)) pRet = &(aBookNames[pBook[0]->GetIdx()]); return pRet; @@ -4213,7 +4213,7 @@ WW8PLCFx_AtnBook::WW8PLCFx_AtnBook(SvStream* pTableSt, const WW8Fib& rFib) { if (!rFib.fcPlcfAtnbkf || !rFib.lcbPlcfAtnbkf || !rFib.fcPlcfAtnbkl || !rFib.lcbPlcfAtnbkl) { - m_pBook[0] = m_pBook[1] = 0; + m_pBook[0] = m_pBook[1] = nullptr; nIMax = 0; } else @@ -4309,7 +4309,7 @@ void WW8PLCFx_AtnBook::advance() else { const void * p = m_pBook[0]->GetData(m_pBook[0]->GetIdx()); - long nPairFor = (p == NULL)? 0L : SVBT16ToShort(*static_cast<SVBT16 const *>(p)); + long nPairFor = (p == nullptr)? 0L : SVBT16ToShort(*static_cast<SVBT16 const *>(p)); if (nPairFor == m_pBook[1]->GetIdx()) m_bIsEnd = false; else @@ -4487,9 +4487,9 @@ WW8PLCFMan::WW8PLCFMan(WW8ScannerBase* pBase, ManTypes nType, long nStartCp, pFootnote = &aD[3]; pAnd = &aD[4]; - pPcd = ( pBase->pPLCFx_PCD ) ? &aD[5] : 0; + pPcd = ( pBase->pPLCFx_PCD ) ? &aD[5] : nullptr; //pPcdA index == pPcd index + 1 - pPcdA = ( pBase->pPLCFx_PCDAttrs ) ? &aD[6] : 0; + pPcdA = ( pBase->pPLCFx_PCDAttrs ) ? &aD[6] : nullptr; pChp = &aD[7]; pPap = &aD[8]; @@ -4509,17 +4509,17 @@ WW8PLCFMan::WW8PLCFMan(WW8ScannerBase* pBase, ManTypes nType, long nStartCp, // search order of the attributes nPLCF = 7; pField = &aD[0]; - pBkm = ( pBase->pBook ) ? &aD[1] : 0; + pBkm = ( pBase->pBook ) ? &aD[1] : nullptr; - pPcd = ( pBase->pPLCFx_PCD ) ? &aD[2] : 0; + pPcd = ( pBase->pPLCFx_PCD ) ? &aD[2] : nullptr; //pPcdA index == pPcd index + 1 - pPcdA= ( pBase->pPLCFx_PCDAttrs ) ? &aD[3] : 0; + pPcdA= ( pBase->pPLCFx_PCDAttrs ) ? &aD[3] : nullptr; pChp = &aD[4]; pPap = &aD[5]; pSep = &aD[6]; // Dummy - pAnd = pAtnBkm = pFootnote = pEdn = 0; // not used at SpezText + pAnd = pAtnBkm = pFootnote = pEdn = nullptr; // not used at SpezText } pChp->pPLCFx = pBase->pChpPLCF; @@ -4545,27 +4545,27 @@ WW8PLCFMan::WW8PLCFMan(WW8ScannerBase* pBase, ManTypes nType, long nStartCp, break; case MAN_FTN: pField->pPLCFx = pBase->pFieldFootnotePLCF; - pFdoa = pTxbx = pTxbxBkd = 0; + pFdoa = pTxbx = pTxbxBkd = nullptr; break; case MAN_EDN: pField->pPLCFx = pBase->pFieldEdnPLCF; - pFdoa = pTxbx = pTxbxBkd = 0; + pFdoa = pTxbx = pTxbxBkd = nullptr; break; case MAN_AND: pField->pPLCFx = pBase->pFieldAndPLCF; - pFdoa = pTxbx = pTxbxBkd = 0; + pFdoa = pTxbx = pTxbxBkd = nullptr; break; case MAN_TXBX: pField->pPLCFx = pBase->pFieldTxbxPLCF; pTxbx = pBase->pMainTxbx; pTxbxBkd = pBase->pMainTxbxBkd; - pFdoa = 0; + pFdoa = nullptr; break; case MAN_TXBX_HDFT: pField->pPLCFx = pBase->pFieldTxbxHdFtPLCF; pTxbx = pBase->pHdFtTxbx; pTxbxBkd = pBase->pHdFtTxbxBkd; - pFdoa = 0; + pFdoa = nullptr; break; default: pField->pPLCFx = pBase->pFieldPLCF; @@ -4601,7 +4601,7 @@ WW8PLCFMan::WW8PLCFMan(WW8ScannerBase* pBase, ManTypes nType, long nStartCp, p->nCp2OrIdx = 0; p->bFirstSprm = false; - p->pIdStk = 0; + p->pIdStk = nullptr; if ((p == pChp) || (p == pPap)) p->nStartPos = p->nEndPos = nStartCp; @@ -4626,7 +4626,7 @@ WW8PLCFMan::WW8PLCFMan(WW8ScannerBase* pBase, ManTypes nType, long nStartCp, if ((p == pChp) || (p == pPap)) { WW8_CP nTemp = p->nEndPos+p->nCpOfs; - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; p->nStartPos = nTemp; if (!(*p->pPLCFx).SeekPos(p->nStartPos)) @@ -4696,7 +4696,7 @@ sal_uInt16 WW8PLCFMan::WhereIdx(bool* pbStart, long* pPos) const WW8_CP WW8PLCFMan::Where() const { long l; - WhereIdx(0, &l); + WhereIdx(nullptr, &l); return l; } @@ -4872,7 +4872,7 @@ void WW8PLCFMan::AdvSprm(short nIdx, bool bStart) if (p->nSprmsLen < maSprmParser.MinSprmLen()) { // preventively set to 0, because the end follows! - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; } else @@ -4892,7 +4892,7 @@ void WW8PLCFMan::AdvSprm(short nIdx, bool bStart) { if ( (p == pChp) || (p == pPap) ) { - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; p->nStartPos = p->nOrigEndPos+p->nCpOfs; @@ -4947,7 +4947,7 @@ void WW8PLCFMan::AdvSprm(short nIdx, bool bStart) else { p->pPLCFx->advance(); // next Group of Sprms - p->pMemPos = 0; // !!! + p->pMemPos = nullptr; // !!! p->nSprmsLen = 0; GetNewSprms( *p ); } @@ -4986,7 +4986,7 @@ void WW8PLCFMan::AdvNoSprm(short nIdx, bool bStart) */ if (pTemp->GetClipStart() == -1) p->pPLCFx->advance(); - p->pMemPos = 0; + p->pMemPos = nullptr; p->nSprmsLen = 0; GetNewSprms( aD[nIdx+1] ); GetNewNoSprms( *p ); @@ -5007,7 +5007,7 @@ void WW8PLCFMan::AdvNoSprm(short nIdx, bool bStart) else { // NoSprm without end p->pPLCFx->advance(); - p->pMemPos = 0; // MemPos invalid + p->pMemPos = nullptr; // MemPos invalid p->nSprmsLen = 0; GetNewNoSprms( *p ); } @@ -6205,7 +6205,7 @@ WW8Style::WW8Style(SvStream& rStream, WW8Fib& rFibPara) // it will return a null pointer. WW8_STD* WW8Style::Read1STDFixed( short& rSkip, short* pcbStd ) { - WW8_STD* pStd = 0; + WW8_STD* pStd = nullptr; sal_uInt16 cbStd(0); rSt.ReadUInt16( cbStd ); // read length @@ -6467,7 +6467,7 @@ namespace } WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib ) - : pFontA(0), nMax(0) + : pFontA(nullptr), nMax(0) { // Attention: MacWord-Documents have their Fontnames // always in ANSI, even if eStructCharSet == CHARSET_MAC !! @@ -6721,7 +6721,7 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib ) const WW8_FFN* WW8Fonts::GetFont( sal_uInt16 nNum ) const { if( !pFontA || nNum >= nMax ) - return 0; + return nullptr; return &pFontA[ nNum ]; } @@ -7654,7 +7654,7 @@ sal_uInt8* wwSprmParser::findSprmData(sal_uInt16 nId, sal_uInt8* pSprms, nLen -= nSize; } // Sprm not found - return 0; + return nullptr; } SEPr::SEPr() : diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index c74624ab2103..b0ec865217e5 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -82,7 +82,7 @@ public: SprmInfo const * search(sal_uInt16 id) const { Map::const_iterator i(map_.find(id)); - return i == map_.end() ? 0 : &i->second; + return i == map_.end() ? nullptr : &i->second; } private: @@ -170,7 +170,7 @@ class WW8PLCFx_PCD; */ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen, sal_uInt16 nExtraLen, rtl_TextEncoding eCS, ::std::vector<OUString> &rArray, - ::std::vector<ww::bytes>* pExtraArray = 0, ::std::vector<OUString>* pValueArray = 0); + ::std::vector<ww::bytes>* pExtraArray = nullptr, ::std::vector<OUString>* pValueArray = nullptr); struct WW8FieldDesc { @@ -228,7 +228,7 @@ public: const void* GetData( long nInIdx ) const { - return ( nInIdx >= nIMax ) ? 0 + return ( nInIdx >= nIMax ) ? nullptr : static_cast<const void*>(&pPLCF_Contents[nInIdx * nStru]); } sal_Int32 GetPos( long nInIdx ) const @@ -263,7 +263,7 @@ public: const sal_uInt8* FindSprm(sal_uInt16 nId); void advance(); const sal_uInt8* GetSprms() const - { return ( pSprms && (0 < nRemLen) ) ? pSprms : 0; } + { return ( pSprms && (0 < nRemLen) ) ? pSprms : nullptr; } const sal_uInt8* GetAktParams() const { return pAktParams; } sal_uInt16 GetAktId() const { return nAktId; } @@ -314,7 +314,7 @@ public: const void* GetData( sal_Int32 nInIdx ) const { - return ( nInIdx >= nIMax ) ? 0 : + return ( nInIdx >= nIMax ) ? nullptr : static_cast<const void*>(&pPLCF_Contents[nInIdx * nStru]); } }; @@ -491,7 +491,7 @@ public: sal_uInt16 mnIStd; // only for Fkp.Papx (actually Style-Nr) bool mbMustDelete; - explicit Entry(WW8_FC nFC) : mnFC(nFC), mpData(0), mnLen(0), + explicit Entry(WW8_FC nFC) : mnFC(nFC), mpData(nullptr), mnLen(0), mnIStd(0), mbMustDelete(false) {} Entry(const Entry &rEntry); ~Entry(); @@ -596,7 +596,7 @@ public: void GetPCDSprms( WW8PLCFxDesc& rDesc ); const sal_uInt8* HasSprm( sal_uInt16 nId ); bool HasSprm(sal_uInt16 nId, std::vector<const sal_uInt8 *> &rResult); - bool HasFkp() const { return (0 != pFkp); } + bool HasFkp() const { return (nullptr != pFkp); } }; /// iterator for Piece Table Exceptions of Fkps works on CPs (high-level) @@ -685,7 +685,7 @@ public: // returns reference descriptors const void* GetData( long nIdx = -1 ) const { - return pRef ? pRef->GetData( -1L == nIdx ? pRef->GetIdx() : nIdx ) : 0; + return pRef ? pRef->GetData( -1L == nIdx ? pRef->GetIdx() : nIdx ) : nullptr; } virtual void GetSprms(WW8PLCFxDesc* p) override; @@ -851,9 +851,9 @@ struct WW8PLCFxDesc //GetSprms will not search for the sprms, but instead take the //existing ones. WW8PLCFxDesc() - : pPLCFx(0) - , pIdStk(0) - , pMemPos(0) + : pPLCFx(nullptr) + , pIdStk(nullptr) + , pMemPos(nullptr) , nOrigSprmsLen(0) , nStartPos(WW8_CP_MAX) , nEndPos(WW8_CP_MAX) @@ -896,7 +896,7 @@ private: const WW8Fib* pWwFib; - sal_uInt16 WhereIdx(bool* pbStart=0, long* pPos=0) const; + sal_uInt16 WhereIdx(bool* pbStart=nullptr, long* pPos=nullptr) const; void AdjustEnds(WW8PLCFxDesc& rDesc); void GetNewSprms(WW8PLCFxDesc& rDesc); static void GetNewNoSprms(WW8PLCFxDesc& rDesc); @@ -1024,8 +1024,8 @@ public: //given that we never write fastsaved files you can use it, otherwise //I will beat you with a stick WW8_CP WW8Fc2Cp(WW8_FC nFcPos) const ; - WW8_FC WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode = 0, - WW8_CP* pNextPieceCp = 0, bool* pTestFlag = 0) const; + WW8_FC WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode = nullptr, + WW8_CP* pNextPieceCp = nullptr, bool* pTestFlag = nullptr) const; sal_Int32 WW8ReadString(SvStream& rStrm, OUString& rStr, WW8_CP nAktStartCp, long nTotalLen, rtl_TextEncoding eEnc ) const; diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx index 98754fd82551..5d0f0fc0e010 100644 --- a/sw/source/filter/ww8/ww8struc.hxx +++ b/sw/source/filter/ww8/ww8struc.hxx @@ -311,7 +311,7 @@ struct WW8_BRC // BoRder Code (WW8 version) explicit WW8_BRC(const WW8_BRCVer6& brcVer6); // Returns LO border width in twips=1/20pt, taking into account brcType - short DetermineBorderProperties(short *pSpace=0) const; + short DetermineBorderProperties(short *pSpace=nullptr) const; }; typedef WW8_BRC WW8_BRC5[5]; // 5 * Border Code @@ -363,7 +363,7 @@ struct WW8_BRCVer9 // BoRder Code (WW9 version) explicit WW8_BRCVer9(const WW8_BRC& brcVer8); // Returns LO border width in twips=1/20pt, taking into account brcType - short DetermineBorderProperties(short *pSpace=0) const; + short DetermineBorderProperties(short *pSpace=nullptr) const; }; typedef WW8_BRCVer9 WW8_BRCVer9_5[5]; // 5 * Border Code diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index 7f833e4256ad..c447e35e48d4 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -91,13 +91,13 @@ SwCTBWrapper::~SwCTBWrapper() Customization* SwCTBWrapper::GetCustomizaton( sal_Int16 index ) { if ( index < 0 || index >= static_cast<sal_Int16>( rCustomizations.size() ) ) - return NULL; + return nullptr; return &rCustomizations[ index ]; } SwCTB* SwCTBWrapper::GetCustomizationData( const OUString& sTBName ) { - SwCTB* pCTB = NULL; + SwCTB* pCTB = nullptr; for ( std::vector< Customization >::iterator it = rCustomizations.begin(); it != rCustomizations.end(); ++it ) { if ( it->GetCustomizationData() && it->GetCustomizationData()->GetName() == sTBName ) @@ -177,7 +177,7 @@ SwTBC* SwCTBWrapper::GetTBCAtOffset( sal_uInt32 nStreamOffset ) if ( (*it).GetOffset() == nStreamOffset ) return &(*it); } - return NULL; + return nullptr; } #if OSL_DEBUG_LEVEL > 1 @@ -832,7 +832,7 @@ Tcg255::~Tcg255() bool Tcg255::processSubStruct( sal_uInt8 nId, SvStream &rS ) { - Tcg255SubStruct* pSubStruct = NULL; + Tcg255SubStruct* pSubStruct = nullptr; switch ( nId ) { case 0x1: @@ -985,7 +985,7 @@ void PlfMcd::Print( FILE* fp ) PlfAcd::PlfAcd( bool bReadId ) : Tcg255SubStruct( bReadId ) ,iMac(0) -,rgacd(NULL) +,rgacd(nullptr) { } @@ -1037,7 +1037,7 @@ void PlfAcd::Print( FILE* fp ) PlfKme::PlfKme( bool bReadId ) : Tcg255SubStruct( bReadId ) ,iMac( 0 ) -,rgkme( NULL ) +,rgkme( nullptr ) { } @@ -1103,7 +1103,7 @@ void TcgSttbf::Print( FILE* fp ) TcgSttbfCore::TcgSttbfCore() : fExtend( 0 ) ,cData( 0 ) ,cbExtra( 0 ) -,dataItems( NULL ) +,dataItems( nullptr ) { } @@ -1151,7 +1151,7 @@ void TcgSttbfCore::Print( FILE* fp ) MacroNames::MacroNames( bool bReadId ) : Tcg255SubStruct( bReadId ) ,iMac( 0 ) -,rgNames( NULL ) +,rgNames( nullptr ) { } |