diff options
Diffstat (limited to 'sw/source/filter')
117 files changed, 2638 insertions, 2638 deletions
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 918051dad19a..8fa82a85d96f 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -232,8 +232,8 @@ static Writer& OutASC_SwTextNode( Writer& rWrt, SwContentNode& rNode ) SwNodeFnTab aASCNodeFnTab = { /* RES_TXTNODE */ OutASC_SwTextNode, -/* RES_GRFNODE */ 0, -/* RES_OLENODE */ 0 +/* RES_GRFNODE */ nullptr, +/* RES_OLENODE */ nullptr }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index 98b78c36cbc3..db16166a2a02 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -143,7 +143,7 @@ sal_uLong SwASCIIParser::CallParser() ::StartProgress( STR_STATSTR_W4WREAD, 0, nFileSize, pDoc->GetDocShell() ); - SwPaM* pInsPam = 0; + SwPaM* pInsPam = nullptr; sal_Int32 nSttContent = 0; if (!bNewDoc) { @@ -152,7 +152,7 @@ sal_uLong SwASCIIParser::CallParser() nSttContent = pPam->GetPoint()->nContent.GetIndex(); } - SwTextFormatColl *pColl = 0; + SwTextFormatColl *pColl = nullptr; if (bNewDoc) { @@ -234,7 +234,7 @@ sal_uLong SwASCIIParser::CallParser() pDoc->getIDocumentContentOperations().InsertItemSet( *pInsPam, *pItemSet ); } } - delete pItemSet, pItemSet = 0; + delete pItemSet, pItemSet = nullptr; } delete pInsPam; @@ -245,7 +245,7 @@ sal_uLong SwASCIIParser::CallParser() sal_uLong SwASCIIParser::ReadChars() { - sal_Unicode *pStt = 0, *pEnd = 0, *pLastStt = 0; + sal_Unicode *pStt = nullptr, *pEnd = nullptr, *pLastStt = nullptr; long nReadCnt = 0, nLineLen = 0; sal_Unicode cLastCR = 0; bool bSwapUnicode = false; @@ -273,8 +273,8 @@ sal_uLong SwASCIIParser::ReadChars() pUseMe=&aEmpty; } - rtl_TextToUnicodeConverter hConverter=0; - rtl_TextToUnicodeContext hContext=0; + rtl_TextToUnicodeConverter hConverter=nullptr; + rtl_TextToUnicodeContext hContext=nullptr; rtl_TextEncoding currentCharSet = pUseMe->GetCharSet(); if (RTL_TEXTENCODING_UCS2 != currentCharSet) { diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 545a34f211cc..7e785aa9966e 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -61,7 +61,7 @@ using namespace utl; using namespace com::sun::star::uno; using namespace com::sun::star; -SwRead ReadAscii = 0, ReadHTML = 0, ReadXML = 0; +SwRead ReadAscii = nullptr, ReadHTML = nullptr, ReadXML = nullptr; Reader* GetRTFReader(); Reader* GetWW8Reader(); @@ -71,15 +71,15 @@ Reader* GetWW8Reader(); SwReaderWriterEntry aReaderWriter[] = { SwReaderWriterEntry( &::GetRTFReader, &::GetRTFWriter, true ), - SwReaderWriterEntry( 0, &::GetASCWriter, false ), + SwReaderWriterEntry( nullptr, &::GetASCWriter, false ), SwReaderWriterEntry( &::GetWW8Reader, nullptr, true ), SwReaderWriterEntry( &::GetWW8Reader, &::GetWW8Writer, true ), SwReaderWriterEntry( &::GetRTFReader, &::GetRTFWriter, true ), - SwReaderWriterEntry( 0, &::GetHTMLWriter, true ), - SwReaderWriterEntry( &::GetWW8Reader, 0, true ), - SwReaderWriterEntry( 0, &::GetXMLWriter, true ), - SwReaderWriterEntry( 0, &::GetASCWriter, false ), - SwReaderWriterEntry( 0, &::GetASCWriter, true ) + SwReaderWriterEntry( nullptr, &::GetHTMLWriter, true ), + SwReaderWriterEntry( &::GetWW8Reader, nullptr, true ), + SwReaderWriterEntry( nullptr, &::GetXMLWriter, true ), + SwReaderWriterEntry( nullptr, &::GetASCWriter, false ), + SwReaderWriterEntry( nullptr, &::GetASCWriter, true ) }; Reader* SwReaderWriterEntry::GetReader() @@ -91,7 +91,7 @@ Reader* SwReaderWriterEntry::GetReader() pReader = (*fnGetReader)(); return pReader; } - return NULL; + return nullptr; } void SwReaderWriterEntry::GetWriter( const OUString& rNm, const OUString& rBaseURL, WriterRef& xWrt ) const @@ -99,7 +99,7 @@ void SwReaderWriterEntry::GetWriter( const OUString& rNm, const OUString& rBaseU if ( fnGetWriter ) (*fnGetWriter)( rNm, rBaseURL, xWrt ); else - xWrt = WriterRef(0); + xWrt = WriterRef(nullptr); } SwRead SwGetReaderXML() // SW_DLLPUBLIC @@ -130,7 +130,7 @@ Filters::~Filters() { SwReaderWriterEntry& rEntry = aReaderWriter[n]; if( rEntry.bDelReader && rEntry.pReader ) - delete rEntry.pReader, rEntry.pReader = NULL; + delete rEntry.pReader, rEntry.pReader = nullptr; } } @@ -147,7 +147,7 @@ oslGenericFunction Filters::GetMswordLibSymbol( const char *pSymbol ) } if (msword_.is()) return msword_.getFunctionSymbol( OUString::createFromAscii( pSymbol ) ); - return NULL; + return nullptr; } #endif @@ -173,7 +173,7 @@ void GetWriter( const OUString& rFltName, const OUString& rBaseURL, WriterRef& x SwRead GetReader( const OUString& rFltName ) { - SwRead pRead = 0; + SwRead pRead = nullptr; for( int n = 0; n < MAXFILTER; ++n ) { if ( aFilterDetect[n].IsFilter( rFltName ) ) @@ -296,7 +296,7 @@ SwRelNumRuleSpaces::~SwRelNumRuleSpaces() void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor, SwTwips nPageWidth) { - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if( SfxItemState::SET != rFlySet.GetItemState( RES_FRM_SIZE, true, &pItem ) || MINFLY > static_cast<const SwFormatFrmSize*>(pItem)->GetWidth() ) { @@ -320,7 +320,7 @@ void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor, bool bOnlyOneNode = true; sal_uLong nMinFrm = 0; sal_uLong nMaxFrm = 0; - SwTextNode* pFirstTextNd = 0; + SwTextNode* pFirstTextNd = nullptr; SwNodeIndex aIdx( *pSttNd, 1 ); SwNodeIndex aEnd( *pSttNd->GetNode().EndOfSectionNode() ); while( aIdx < aEnd ) @@ -509,7 +509,7 @@ const CharSetNameMap *GetCharSetNameMap() IMPLENTRY(UCS4), IMPLENTRY(UCS2), IMPLENTRY(UNICODE), - {0,0} //Last + {0,nullptr} //Last }; return &aMapArr[0]; } @@ -655,7 +655,7 @@ Reader* GetRTFReader() if ( pFunction ) return (*pFunction)(); - return NULL; + return nullptr; #else return ImportRTF(); #endif @@ -670,7 +670,7 @@ void GetRTFWriter( const OUString& rFltName, const OUString& rBaseURL, WriterRef if ( pFunction ) (*pFunction)( rFltName, rBaseURL, xRet ); else - xRet = WriterRef(0); + xRet = WriterRef(nullptr); #else ExportRTF( rFltName, rBaseURL, xRet ); #endif @@ -684,7 +684,7 @@ Reader* GetWW8Reader() if ( pFunction ) return (*pFunction)(); - return NULL; + return nullptr; #else return ImportDOC(); #endif @@ -698,7 +698,7 @@ void GetWW8Writer( const OUString& rFltName, const OUString& rBaseURL, WriterRef if ( pFunction ) (*pFunction)( rFltName, rBaseURL, xRet ); else - xRet = WriterRef(0); + xRet = WriterRef(nullptr); #else ExportDOC( rFltName, rBaseURL, xRet ); #endif diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 9c563341ff45..8218236081c3 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -70,7 +70,7 @@ using namespace com::sun::star; static SwContentNode* GetContentNode(SwDoc* pDoc, SwNodeIndex& rIdx, bool bNext) { SwContentNode * pCNd = rIdx.GetNode().GetContentNode(); - if(!pCNd && 0 == (pCNd = bNext ? pDoc->GetNodes().GoNext(&rIdx) + if(!pCNd && nullptr == (pCNd = bNext ? pDoc->GetNodes().GoNext(&rIdx) : SwNodes::GoPrevious(&rIdx))) { pCNd = bNext ? SwNodes::GoPrevious(&rIdx) @@ -329,7 +329,7 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnde, long nHand, bool consumedByField) { - SwFltStackEntry *pRet = NULL; + SwFltStackEntry *pRet = nullptr; SwFltPosition aFltPos(rPos); @@ -516,7 +516,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, case RES_FLTR_ANCHOR: { SwFrameFormat* pFormat = static_cast<SwFltAnchor*>(rEntry.pAttr)->GetFrameFormat(); - if (pFormat != NULL) + if (pFormat != nullptr) { MakePoint(rEntry, pDoc, aRegion); SwFormatAnchor aAnchor(pFormat->GetAnchor()); @@ -621,7 +621,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, // test if on this node there had been a pagebreak BEFORE the // tox attribute was put on the stack SfxItemSet aBkSet( pDoc->GetAttrPool(), RES_PAGEDESC, RES_BREAK ); - SwContentNode* pNd = 0; + SwContentNode* pNd = nullptr; if( !pTOXAttr->HadBreakItem() || !pTOXAttr->HadPageDescItem() ) { pNd = pPoint->nNode.GetNode().GetContentNode(); @@ -669,7 +669,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, rFltRedline.nAutorNoPrev, rFltRedline.aStampPrev, OUString(), - 0 + nullptr ); pDoc->getIDocumentRedlineAccess().AppendRedline(new SwRangeRedline(aData, aRegion), true); } @@ -677,7 +677,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, rFltRedline.nAutorNo, rFltRedline.aStamp, OUString(), - 0 + nullptr ); pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline(aData, aRegion), true ); pDoc->getIDocumentRedlineAccess().SetRedlineMode((RedlineMode_t)( nsRedlineMode_t::REDLINE_NONE @@ -742,7 +742,7 @@ SfxPoolItem* SwFltControlStack::GetFormatStackAttr(sal_uInt16 nWhich, sal_uInt16 return rEntry.pAttr; // Ok, so stop } } - return 0; + return nullptr; } const SfxPoolItem* SwFltControlStack::GetOpenStackAttr(const SwPosition& rPos, sal_uInt16 nWhich) @@ -759,7 +759,7 @@ const SfxPoolItem* SwFltControlStack::GetOpenStackAttr(const SwPosition& rPos, s return rEntry.pAttr; } } - return 0; + return nullptr; } void SwFltControlStack::Delete(const SwPaM &rPam) @@ -896,11 +896,11 @@ void SwFltAnchorClient::Modify(const SfxPoolItem *, const SfxPoolItem * pNew) { const SwFormatChg * pFormatChg = dynamic_cast<const SwFormatChg *> (pNew); - if (pFormatChg != NULL) + if (pFormatChg != nullptr) { SwFrameFormat * pFrameFormat = dynamic_cast<SwFrameFormat *> (pFormatChg->pChangedFormat); - if (pFrameFormat != NULL) + if (pFrameFormat != nullptr) m_pFltAnchor->SetFrameFormat(pFrameFormat); } } diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx index 6b9819ef7a2b..ac2752d8adfc 100644 --- a/sw/source/filter/basflt/iodetect.cxx +++ b/sw/source/filter/basflt/iodetect.cxx @@ -84,7 +84,7 @@ const SfxFilter* SwIoSystem::GetFilterOfFormat(const OUString& rFormatNm, break; pFltCnt = &aCntSwWeb; } while( true ); - return 0; + return nullptr; } bool SwIoSystem::IsValidStgFilter( const css::uno::Reference < css::embed::XStorage >& rStg, const SfxFilter& rFilter) @@ -151,7 +151,7 @@ const SfxFilter* SwIoSystem::GetFileFilter(const OUString& rFileName) SfxFilterMatcherIter aIter( aMatcher ); const SfxFilter* pFilter = aIter.First(); if ( !pFilter ) - return 0; + return nullptr; if (SotStorage::IsStorageFile(rFileName)) { @@ -163,7 +163,7 @@ const SfxFilter* SwIoSystem::GetFileFilter(const OUString& rFileName) SfxMedium aMedium(aObj.GetMainURL(INetURLObject::NO_DECODE), STREAM_STD_READ); // templates should not get precedence over "normal" filters (#i35508, #i33168) - const SfxFilter* pTemplateFilter = 0; + const SfxFilter* pTemplateFilter = nullptr; if (aMedium.IsStorage()) { uno::Reference<embed::XStorage> const xStor = aMedium.GetStorage(); diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 500150427326..7c098122b840 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -68,11 +68,11 @@ sal_uLong SwReader::Read( const Reader& rOptions ) po->pStrm = pStrm; po->pStg = pStg; po->xStg = xStg; - po->bInsertMode = 0 != pCrsr; + po->bInsertMode = nullptr != pCrsr; po->bSkipImages = mbSkipImages; // if a Medium is selected, get its Stream - if( 0 != (po->pMedium = pMedium ) && + if( nullptr != (po->pMedium = pMedium ) && !po->SetStrmStgPtr() ) { po->SetReadUTF8( false ); @@ -110,7 +110,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) // Pams are connected like rings; stop when we return to the 1st element SwPaM *pEnd = pPam; - SwUndoInsDoc* pUndo = 0; + SwUndoInsDoc* pUndo = nullptr; bool bReadPageDescs = false; bool const bDocUndo = pDoc->GetIDocumentUndoRedo().DoesUndo(); @@ -126,7 +126,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) else { pDoc->GetIDocumentUndoRedo().ClearRedo(); - pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_INSDOKUMENT, NULL ); + pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_INSDOKUMENT, nullptr ); } } pDoc->GetIDocumentUndoRedo().DoUndo(false); @@ -148,7 +148,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) pDoc->getIDocumentRedlineAccess().SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE ); - SwPaM* pUndoPam = 0; + SwPaM* pUndoPam = nullptr; if( bDocUndo || pCrsr ) { // set Pam to the previous node, so that it is not also moved @@ -183,7 +183,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) { --aEndPos; pCNd = aEndPos.GetNode().GetContentNode(); - if( !pCNd && 0 == ( pCNd = SwNodes::GoPrevious( &aEndPos ) )) + if( !pCNd && nullptr == ( pCNd = SwNodes::GoPrevious( &aEndPos ) )) pCNd = pDoc->GetNodes().GoNext( &aEndPos ); pPam->GetPoint()->nNode = aEndPos; @@ -214,7 +214,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) pUndoPam->GetPoint()->nContent.Assign( static_cast<SwContentNode*>(&rNd), nSttContent ); else - pUndoPam->GetPoint()->nContent.Assign( 0, 0 ); + pUndoPam->GetPoint()->nContent.Assign( nullptr, 0 ); bool bChkHeaderFooter = rNd.FindHeaderStartNode() || rNd.FindFooterStartNode(); @@ -351,7 +351,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) if( bSaveUndo ) { pDoc->getIDocumentRedlineAccess().SetRedlineMode_intern( eOld ); - pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_INSDOKUMENT, NULL ); + pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_INSDOKUMENT, nullptr ); pDoc->getIDocumentRedlineAccess().SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE ); } } @@ -370,7 +370,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) eOld = static_cast<RedlineMode_t>( ePostReadRedlineMode & ~nsRedlineMode_t::REDLINE_IGNORE); - pDoc->getIDocumentFieldsAccess().SetFieldsDirty(false, NULL, 0); + pDoc->getIDocumentFieldsAccess().SetFieldsDirty(false, nullptr, 0); } pDoc->getIDocumentRedlineAccess().SetRedlineMode_intern( eOld ); @@ -397,7 +397,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) SwReader::SwReader(SfxMedium& rMedium, const OUString& rFileName, SwDoc *pDocument) - : SwDocFac(pDocument), pStrm(0), pMedium(&rMedium), pCrsr(0), + : SwDocFac(pDocument), pStrm(nullptr), pMedium(&rMedium), pCrsr(nullptr), aFileName(rFileName), mbSkipImages(false) { SetBaseURL( rMedium.GetBaseURL() ); @@ -407,30 +407,30 @@ SwReader::SwReader(SfxMedium& rMedium, const OUString& rFileName, SwDoc *pDocume // Read into an existing document SwReader::SwReader(SvStream& rStrm, const OUString& rFileName, const OUString& rBaseURL, SwPaM& rPam) - : SwDocFac(rPam.GetDoc()), pStrm(&rStrm), pMedium(0), pCrsr(&rPam), + : SwDocFac(rPam.GetDoc()), pStrm(&rStrm), pMedium(nullptr), pCrsr(&rPam), aFileName(rFileName), mbSkipImages(false) { SetBaseURL( rBaseURL ); } SwReader::SwReader(SfxMedium& rMedium, const OUString& rFileName, SwPaM& rPam) - : SwDocFac(rPam.GetDoc()), pStrm(0), pMedium(&rMedium), + : SwDocFac(rPam.GetDoc()), pStrm(nullptr), pMedium(&rMedium), pCrsr(&rPam), aFileName(rFileName), mbSkipImages(false) { SetBaseURL( rMedium.GetBaseURL() ); } SwReader::SwReader( const uno::Reference < embed::XStorage > &rStg, const OUString& rFilename, SwPaM &rPam ) - : SwDocFac(rPam.GetDoc()), pStrm(0), xStg( rStg ), pMedium(0), pCrsr(&rPam), aFileName(rFilename), mbSkipImages(false) + : SwDocFac(rPam.GetDoc()), pStrm(nullptr), xStg( rStg ), pMedium(nullptr), pCrsr(&rPam), aFileName(rFilename), mbSkipImages(false) { } Reader::Reader() - : pTemplate(0), + : pTemplate(nullptr), aDStamp( Date::EMPTY ), aTStamp( tools::Time::EMPTY ), aChkDateTime( DateTime::EMPTY ), - pStrm(0), pMedium(0), bInsertMode(false), + pStrm(nullptr), pMedium(nullptr), bInsertMode(false), bTmplBrowseMode(false), bReadUTF8(false), bBlockMode(false), bOrganizerMode(false), bHasAskTemplateName(false), bIgnoreHTMLComments(false), bSkipImages(false) { @@ -536,7 +536,7 @@ bool Reader::SetTemplate( SwDoc& rDoc ) { rDoc.RemoveAllFormatLanguageDependencies(); rDoc.ReplaceStyles( *pTemplate ); - rDoc.getIDocumentFieldsAccess().SetFixFields(false, NULL); + rDoc.getIDocumentFieldsAccess().SetFixFields(false, nullptr); bRet = true; } @@ -549,7 +549,7 @@ void Reader::ClearTemplate() { if( 0 == pTemplate->release() ) delete pTemplate; - pTemplate = 0; + pTemplate = nullptr; } } @@ -594,11 +594,11 @@ bool Reader::SetStrmStgPtr() if ( pStrm && SotStorage::IsStorageFile(pStrm) && (SW_STORAGE_READER & GetReaderType()) ) { pStg = new SotStorage( *pStrm ); - pStrm = NULL; + pStrm = nullptr; } else if ( !(SW_STREAM_READER & GetReaderType()) ) { - pStrm = NULL; + pStrm = nullptr; return false; } @@ -655,7 +655,7 @@ bool SwReader::HasGlossaries( const Reader& rOptions ) // if a Medium is selected, get its Stream bool bRet = false; - if( !( 0 != (po->pMedium = pMedium ) && !po->SetStrmStgPtr() )) + if( !( nullptr != (po->pMedium = pMedium ) && !po->SetStrmStgPtr() )) bRet = po->HasGlossaries(); return bRet; } @@ -671,7 +671,7 @@ bool SwReader::ReadGlossaries( const Reader& rOptions, // if a Medium is selected, get its Stream bool bRet = false; - if( !( 0 != (po->pMedium = pMedium ) && !po->SetStrmStgPtr() )) + if( !( nullptr != (po->pMedium = pMedium ) && !po->SetStrmStgPtr() )) bRet = po->ReadGlossaries( rBlocks, bSaveRelFiles ); return bRet; } @@ -700,36 +700,36 @@ int StgReader::GetReaderType() */ SwWriter::SwWriter(SvStream& rStrm, SwCrsrShell &rShell, bool bInWriteAll) - : pStrm(&rStrm), pMedium(0), pOutPam(0), pShell(&rShell), + : pStrm(&rStrm), pMedium(nullptr), pOutPam(nullptr), pShell(&rShell), rDoc(*rShell.GetDoc()), bWriteAll(bInWriteAll) { } SwWriter::SwWriter(SvStream& rStrm,SwDoc &rDocument) - : pStrm(&rStrm), pMedium(0), pOutPam(0), pShell(0), rDoc(rDocument), + : pStrm(&rStrm), pMedium(nullptr), pOutPam(nullptr), pShell(nullptr), rDoc(rDocument), bWriteAll(true) { } SwWriter::SwWriter(SvStream& rStrm, SwPaM& rPam, bool bInWriteAll) - : pStrm(&rStrm), pMedium(0), pOutPam(&rPam), pShell(0), + : pStrm(&rStrm), pMedium(nullptr), pOutPam(&rPam), pShell(nullptr), rDoc(*rPam.GetDoc()), bWriteAll(bInWriteAll) { } SwWriter::SwWriter( const uno::Reference < embed::XStorage >& rStg, SwDoc &rDocument) - : pStrm(0), xStg( rStg ), pMedium(0), pOutPam(0), pShell(0), rDoc(rDocument), bWriteAll(true) + : pStrm(nullptr), xStg( rStg ), pMedium(nullptr), pOutPam(nullptr), pShell(nullptr), rDoc(rDocument), bWriteAll(true) { } SwWriter::SwWriter(SfxMedium& rMedium, SwCrsrShell &rShell, bool bInWriteAll) - : pStrm(0), pMedium(&rMedium), pOutPam(0), pShell(&rShell), + : pStrm(nullptr), pMedium(&rMedium), pOutPam(nullptr), pShell(&rShell), rDoc(*rShell.GetDoc()), bWriteAll(bInWriteAll) { } SwWriter::SwWriter(SfxMedium& rMedium, SwDoc &rDocument) - : pStrm(0), pMedium(&rMedium), pOutPam(0), pShell(0), rDoc(rDocument), + : pStrm(nullptr), pMedium(&rMedium), pOutPam(nullptr), pShell(nullptr), rDoc(rDocument), bWriteAll(true) { } @@ -742,7 +742,7 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const OUString* pRealFileName ) bool bHasMark = false; SwPaM * pPam; - SwDoc *pDoc = 0; + SwDoc *pDoc = nullptr; if ( pShell && !bWriteAll && pShell->IsTableMode() ) { diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index a8e9502e78d7..0d1399a7f085 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -126,7 +126,7 @@ static Writer& OutCSS1_SwFootnoteInfo( Writer& rWrt, const SwEndNoteInfo& rInfo, SwDoc *pDoc, bool bHasNotes, bool bEndNote ); static void OutCSS1_SwFormatDropAttrs( SwHTMLWriter& rHWrt, const SwFormatDrop& rDrop, - const SfxItemSet *pCharFormatItemSet=0 ); + const SfxItemSet *pCharFormatItemSet=nullptr ); static Writer& OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( Writer& rWrt, const SvxUnderlineItem *pUItem, const SvxOverlineItem *pOItem, @@ -193,7 +193,7 @@ class SwCSS1OutMode public: SwCSS1OutMode( SwHTMLWriter& rHWrt, sal_uInt16 nMode, bool bStartFirst=true, - const OUString *pSelector=0 ) : + const OUString *pSelector=nullptr ) : rWrt( rHWrt ), nOldMode( rHWrt.m_nCSS1OutMode ) { @@ -480,25 +480,25 @@ void SwHTMLWriter::OutCSS1_SfxItemSet( const SfxItemSet& rItemSet, Out_SfxItemSet( aCSS1AttrFnTab, *this, rItemSet, bDeep ); // some Attributes require special treatment - const SfxPoolItem *pItem = 0; + const SfxPoolItem *pItem = nullptr; // Underline, Overline, CrossedOut and Blink form together a CSS1-Property // (doesn't work of course for Hints) if( !IsCSS1Source(CSS1_OUTMODE_HINT) ) { - const SvxUnderlineItem *pUnderlineItem = 0; + const SvxUnderlineItem *pUnderlineItem = nullptr; if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_UNDERLINE, bDeep, &pItem )) pUnderlineItem = static_cast<const SvxUnderlineItem *>(pItem); - const SvxOverlineItem *pOverlineItem = 0; + const SvxOverlineItem *pOverlineItem = nullptr; if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_OVERLINE, bDeep, &pItem )) pOverlineItem = static_cast<const SvxOverlineItem *>(pItem); - const SvxCrossedOutItem *pCrossedOutItem = 0; + const SvxCrossedOutItem *pCrossedOutItem = nullptr; if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_CROSSEDOUT, bDeep, &pItem )) pCrossedOutItem = static_cast<const SvxCrossedOutItem *>(pItem); - const SvxBlinkItem *pBlinkItem = 0; + const SvxBlinkItem *pBlinkItem = nullptr; if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_BLINK, bDeep, &pItem )) pBlinkItem = static_cast<const SvxBlinkItem *>(pItem); @@ -542,7 +542,7 @@ void SwHTMLWriter::OutStyleSheet( const SwPageDesc& rPageDesc, bool bUsed ) // Feature: PrintExt if( IsHTMLMode(HTMLMODE_PRINT_EXT) ) { - const SwPageDesc *pFirstPageDesc = 0; + const SwPageDesc *pFirstPageDesc = nullptr; sal_uInt16 nFirstRefPoolId = RES_POOLPAGE_HTML; m_bCSS1IgnoreFirstPageDesc = true; @@ -1002,7 +1002,7 @@ static sal_uInt16 GetCSS1Selector( const SwFormat *pFormat, OUString& rSelector, const SwFormat *SwHTMLWriter::GetTemplateFormat( sal_uInt16 nPoolFormatId, IDocumentStylePoolAccess* pTemplate /*SwDoc *pTemplate*/) { - const SwFormat *pRefFormat = 0; + const SwFormat *pRefFormat = nullptr; if( pTemplate ) { @@ -1020,7 +1020,7 @@ const SwFormat *SwHTMLWriter::GetTemplateFormat( sal_uInt16 nPoolFormatId, const SwFormat *SwHTMLWriter::GetParentFormat( const SwFormat& rFormat, sal_uInt16 nDeep ) { OSL_ENSURE( nDeep != USHRT_MAX, "Called GetParent for HTML-template!" ); - const SwFormat *pRefFormat = 0; + const SwFormat *pRefFormat = nullptr; if( nDeep > 0 ) { @@ -1030,7 +1030,7 @@ const SwFormat *SwHTMLWriter::GetParentFormat( const SwFormat& rFormat, sal_uInt pRefFormat = pRefFormat->DerivedFrom(); if( pRefFormat && pRefFormat->IsDefault() ) - pRefFormat = 0; + pRefFormat = nullptr; } return pRefFormat; @@ -1184,7 +1184,7 @@ void SwHTMLWriter::PrepareFontList( const SvxFontItem& rFontItem, if( !bContainsKeyword && bGeneric ) { - const sal_Char *pStr = 0; + const sal_Char *pStr = nullptr; switch( rFontItem.GetFamily() ) { case FAMILY_ROMAN: pStr = sCSS1_PV_serif; break; @@ -1220,7 +1220,7 @@ bool SwHTMLWriter::HasScriptDependentItems( const SfxItemSet& rItemSet, for( int i=0; aWhichIds[i]; i += 3 ) { - const SfxPoolItem *pItem = 0, *pItemCJK = 0, *pItemCTL = 0, *pTmp; + const SfxPoolItem *pItem = nullptr, *pItemCJK = nullptr, *pItemCTL = nullptr, *pTmp; int nItemCount = 0; if( SfxItemState::SET == rItemSet.GetItemState( aWhichIds[i], false, &pTmp ) ) @@ -1557,8 +1557,8 @@ static Writer& OutCSS1_SwFormat( Writer& rWrt, const SwFormat& rFormat, // not make a difference for any other bool bSetDefaults = true, bClearSame = true; - const SwFormat *pRefFormat = 0; - const SwFormat *pRefFormatScript = 0; + const SwFormat *pRefFormat = nullptr; + const SwFormat *pRefFormatScript = nullptr; switch( nDeep ) { case CSS1_FMT_ISTAG: @@ -1583,7 +1583,7 @@ static Writer& OutCSS1_SwFormat( Writer& rWrt, const SwFormat& rFormat, bSetDefaults, bClearSame, pRefFormatScript ? &pRefFormatScript->GetAttrSet() - : 0 ); + : nullptr ); if( !bCharFormat ) { @@ -1685,7 +1685,7 @@ static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc, { SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); - const SwPageDesc* pRefPageDesc = 0; + const SwPageDesc* pRefPageDesc = nullptr; if( !bExtRef ) pRefPageDesc = pDoc->GetPageDescFromPool( nRefPoolId, false ); else if( pTemplate ) @@ -1695,7 +1695,7 @@ static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc, if( bPseudo ) { - const sal_Char *pPseudo = 0; + const sal_Char *pPseudo = nullptr; switch( rPageDesc.GetPoolFormatId() ) { case RES_POOLPAGE_FIRST: pPseudo = sCSS1_first; break; @@ -2124,8 +2124,8 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat if( (nFrmOpts & HTML_FRMOPT_S_SPACE) && IsHTMLMode( HTMLMODE_FLY_MARGINS) ) { - const SvxLRSpaceItem *pLRItem = 0; - const SvxULSpaceItem *pULItem = 0; + const SvxLRSpaceItem *pLRItem = nullptr; + const SvxULSpaceItem *pULItem = nullptr; if( SfxItemState::SET == rItemSet.GetItemState( RES_LR_SPACE ) ) pLRItem = &aLRItem; if( SfxItemState::SET == rItemSet.GetItemState( RES_UL_SPACE ) ) @@ -2215,7 +2215,7 @@ static bool OutCSS1_FrameFormatBrush( SwHTMLWriter& rWrt, /// output brush of frame format, if its background color is not "no fill"/"auto fill" /// or it has a background graphic. if( rBrushItem.GetColor() != COL_TRANSPARENT || - 0 != rBrushItem.GetGraphicLink() || + nullptr != rBrushItem.GetGraphicLink() || 0 != rBrushItem.GetGraphicPos() ) { OutCSS1_SvxBrush( rWrt, rBrushItem, CSS1_BACKGROUND_FLY ); @@ -2266,7 +2266,7 @@ void SwHTMLWriter::OutCSS1_FrameFormatBackground( const SwFrameFormat& rFrameFor pLine->GetFrameFormat()->makeBackgroundBrushItem() ) ) return; pBox = pLine->GetUpper(); - pLine = pBox ? pBox->GetUpper() : 0; + pLine = pBox ? pBox->GetUpper() : nullptr; } // If there was none either, we use the background of the table. @@ -2319,7 +2319,7 @@ static Writer& OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( Writer& rWrt, SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); bool bNone = false; - const sal_Char *pUStr = 0; + const sal_Char *pUStr = nullptr; if( pUItem ) { switch( pUItem->GetLineStyle() ) @@ -2342,7 +2342,7 @@ static Writer& OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( Writer& rWrt, } } - const sal_Char *pOStr = 0; + const sal_Char *pOStr = nullptr; if( pOItem ) { switch( pOItem->GetLineStyle() ) @@ -2365,7 +2365,7 @@ static Writer& OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( Writer& rWrt, } } - const sal_Char *pCOStr = 0; + const sal_Char *pCOStr = nullptr; if( pCOItem ) { switch( pCOItem->GetStrikeout() ) @@ -2388,7 +2388,7 @@ static Writer& OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( Writer& rWrt, } } - const sal_Char *pBStr = 0; + const sal_Char *pBStr = nullptr; if( pBItem ) { if( !pBItem->GetValue() ) @@ -2493,7 +2493,7 @@ static Writer& OutCSS1_SvxCrossedOut( Writer& rWrt, const SfxPoolItem& rHt ) if( static_cast<SwHTMLWriter&>(rWrt).IsCSS1Source(CSS1_OUTMODE_HINT) ) OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( rWrt, - 0, 0, static_cast<const SvxCrossedOutItem *>(&rHt), 0 ); + nullptr, nullptr, static_cast<const SvxCrossedOutItem *>(&rHt), nullptr ); return rWrt; } @@ -2569,7 +2569,7 @@ static Writer& OutCSS1_SvxPosture( Writer& rWrt, const SfxPoolItem& rHt ) if( !rHTMLWrt.IsCSS1Script( nScript ) ) return rWrt; - const sal_Char *pStr = 0; + const sal_Char *pStr = nullptr; switch( static_cast<const SvxPostureItem&>(rHt).GetPosture() ) { case ITALIC_NONE: pStr = sCSS1_PV_normal; break; @@ -2663,7 +2663,7 @@ static Writer& OutCSS1_SvxUnderline( Writer& rWrt, const SfxPoolItem& rHt ) if( static_cast<SwHTMLWriter&>(rWrt).IsCSS1Source(CSS1_OUTMODE_HINT) ) OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( rWrt, - static_cast<const SvxUnderlineItem *>(&rHt), 0, 0, 0 ); + static_cast<const SvxUnderlineItem *>(&rHt), nullptr, nullptr, nullptr ); return rWrt; } @@ -2675,7 +2675,7 @@ static Writer& OutCSS1_SvxOverline( Writer& rWrt, const SfxPoolItem& rHt ) if( static_cast<SwHTMLWriter&>(rWrt).IsCSS1Source(CSS1_OUTMODE_HINT) ) OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( rWrt, - 0, static_cast<const SvxOverlineItem *>(&rHt), 0, 0 ); + nullptr, static_cast<const SvxOverlineItem *>(&rHt), nullptr, nullptr ); return rWrt; } @@ -2703,7 +2703,7 @@ static Writer& OutCSS1_SvxFontWeight( Writer& rWrt, const SfxPoolItem& rHt ) if( !rHTMLWrt.IsCSS1Script( nScript ) ) return rWrt; - const sal_Char *pStr = 0; + const sal_Char *pStr = nullptr; switch( static_cast<const SvxWeightItem&>(rHt).GetWeight() ) { case WEIGHT_ULTRALIGHT: pStr = sCSS1_PV_extra_light; break; @@ -2739,7 +2739,7 @@ static Writer& OutCSS1_SvxBlink( Writer& rWrt, const SfxPoolItem& rHt ) if( static_cast<SwHTMLWriter&>(rWrt).IsCSS1Source(CSS1_OUTMODE_HINT) ) OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( rWrt, - 0, 0, 0, static_cast<const SvxBlinkItem *>(&rHt) ); + nullptr, nullptr, nullptr, static_cast<const SvxBlinkItem *>(&rHt) ); return rWrt; } @@ -2807,7 +2807,7 @@ static Writer& OutCSS1_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt ) !rHTMLWrt.m_bNoAlign) return rWrt; - const sal_Char* pStr = 0; + const sal_Char* pStr = nullptr; switch( static_cast<const SvxAdjustItem&>(rHt).GetAdjust() ) { case SVX_ADJUST_LEFT: pStr = sCSS1_PV_left; break; @@ -3082,8 +3082,8 @@ static Writer& OutCSS1_SvxULSpace_SvxLRSpace( Writer& rWrt, const SfxItemSet& rItemSet, bool bDeep ) { - const SvxULSpaceItem *pULSpace = 0; - const SvxLRSpaceItem *pLRSpace = 0; + const SvxULSpaceItem *pULSpace = nullptr; + const SvxLRSpaceItem *pLRSpace = nullptr; const SfxPoolItem *pItem; if( SfxItemState::SET == rItemSet.GetItemState( RES_LR_SPACE, bDeep, &pItem ) ) pLRSpace = static_cast<const SvxLRSpaceItem *>(pItem); @@ -3107,8 +3107,8 @@ static Writer& OutCSS1_SvxFormatBreak_SwFormatPDesc_SvxFormatKeep( Writer& rWrt, if( !rHTMLWrt.IsHTMLMode(HTMLMODE_PRINT_EXT) ) return rWrt; - const sal_Char *pBreakBefore = 0; - const sal_Char *pBreakAfter = 0; + const sal_Char *pBreakBefore = nullptr; + const sal_Char *pBreakAfter = nullptr; if( pKeepItem ) { @@ -3170,11 +3170,11 @@ static Writer& OutCSS1_SvxFormatBreak_SwFormatPDesc_SvxFormatKeep( Writer& rWrt, { SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); const SfxPoolItem *pItem; - const SvxFormatBreakItem *pBreakItem = 0; + const SvxFormatBreakItem *pBreakItem = nullptr; if( SfxItemState::SET==rItemSet.GetItemState( RES_BREAK, bDeep, &pItem )) pBreakItem = static_cast<const SvxFormatBreakItem *>(pItem); - const SwFormatPageDesc *pPDescItem = 0; + const SwFormatPageDesc *pPDescItem = nullptr; if( ( !rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) || !rHTMLWrt.m_bCSS1IgnoreFirstPageDesc || rHTMLWrt.m_pStartNdIdx->GetIndex() != @@ -3182,7 +3182,7 @@ static Writer& OutCSS1_SvxFormatBreak_SwFormatPDesc_SvxFormatKeep( Writer& rWrt, SfxItemState::SET==rItemSet.GetItemState( RES_PAGEDESC, bDeep, &pItem )) pPDescItem = static_cast<const SwFormatPageDesc*>(pItem); - const SvxFormatKeepItem *pKeepItem = 0; + const SvxFormatKeepItem *pKeepItem = nullptr; if( SfxItemState::SET==rItemSet.GetItemState( RES_KEEP, bDeep, &pItem )) pKeepItem = static_cast<const SvxFormatKeepItem *>(pItem); @@ -3245,7 +3245,7 @@ static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt, return rWrt; // if necessary, add the orientation of the Graphic - const sal_Char *pRepeat = 0, *pHori = 0, *pVert = 0; + const sal_Char *pRepeat = nullptr, *pHori = nullptr, *pVert = nullptr; if( pGrf ) { if( GPOS_TILED==ePos ) @@ -3513,7 +3513,7 @@ static Writer& OutCSS1_SvxFrameDirection( Writer& rWrt, const SfxPoolItem& rHt ) sal_uInt16 nDir = static_cast< const SvxFrameDirectionItem& >( rHt ).GetValue(); - const sal_Char* pStr = NULL; + const sal_Char* pStr = nullptr; switch( nDir ) { case FRMDIR_HORI_LEFT_TOP: @@ -3543,25 +3543,25 @@ static Writer& OutCSS1_SvxFrameDirection( Writer& rWrt, const SfxPoolItem& rHt ) SwAttrFnTab aCSS1AttrFnTab = { /* RES_CHRATR_CASEMAP */ OutCSS1_SvxCaseMap, -/* RES_CHRATR_CHARSETCOLOR */ 0, +/* RES_CHRATR_CHARSETCOLOR */ nullptr, /* RES_CHRATR_COLOR */ OutCSS1_SvxColor, -/* RES_CHRATR_CONTOUR */ 0, +/* RES_CHRATR_CONTOUR */ nullptr, /* RES_CHRATR_CROSSEDOUT */ OutCSS1_SvxCrossedOut, -/* RES_CHRATR_ESCAPEMENT */ 0, +/* RES_CHRATR_ESCAPEMENT */ nullptr, /* RES_CHRATR_FONT */ OutCSS1_SvxFont, /* RES_CHRATR_FONTSIZE */ OutCSS1_SvxFontHeight, /* RES_CHRATR_KERNING */ OutCSS1_SvxKerning, /* RES_CHRATR_LANGUAGE */ OutCSS1_SvxLanguage, /* RES_CHRATR_POSTURE */ OutCSS1_SvxPosture, -/* RES_CHRATR_PROPORTIONALFONTSIZE*/0, -/* RES_CHRATR_SHADOWED */ 0, +/* RES_CHRATR_PROPORTIONALFONTSIZE*/nullptr, +/* RES_CHRATR_SHADOWED */ nullptr, /* RES_CHRATR_UNDERLINE */ OutCSS1_SvxUnderline, /* RES_CHRATR_WEIGHT */ OutCSS1_SvxFontWeight, -/* RES_CHRATR_WORDLINEMODE */ 0, -/* RES_CHRATR_AUTOKERN */ 0, +/* RES_CHRATR_WORDLINEMODE */ nullptr, +/* RES_CHRATR_AUTOKERN */ nullptr, /* RES_CHRATR_BLINK */ OutCSS1_SvxBlink, -/* RES_CHRATR_NOHYPHEN */ 0, // Neu: nicht trennen -/* RES_CHRATR_NOLINEBREAK */ 0, // Neu: nicht umbrechen +/* RES_CHRATR_NOHYPHEN */ nullptr, // Neu: nicht trennen +/* RES_CHRATR_NOLINEBREAK */ nullptr, // Neu: nicht umbrechen /* RES_CHRATR_BACKGROUND */ OutCSS1_SvxBrush, // Neu: Zeichenhintergrund /* RES_CHRATR_CJK_FONT */ OutCSS1_SvxFont, /* RES_CHRATR_CJK_FONTSIZE */ OutCSS1_SvxFontHeight, @@ -3573,131 +3573,131 @@ SwAttrFnTab aCSS1AttrFnTab = { /* RES_CHRATR_CTL_LANGUAGE */ OutCSS1_SvxLanguage, /* RES_CHRATR_CTL_POSTURE */ OutCSS1_SvxPosture, /* RES_CHRATR_CTL_WEIGHT */ OutCSS1_SvxFontWeight, -/* RES_CHRATR_ROTATE */ 0, -/* RES_CHRATR_EMPHASIS_MARK */ 0, -/* RES_CHRATR_TWO_LINES */ 0, -/* RES_CHRATR_SCALEW */ 0, -/* RES_CHRATR_RELIEF */ 0, +/* RES_CHRATR_ROTATE */ nullptr, +/* RES_CHRATR_EMPHASIS_MARK */ nullptr, +/* RES_CHRATR_TWO_LINES */ nullptr, +/* RES_CHRATR_SCALEW */ nullptr, +/* RES_CHRATR_RELIEF */ nullptr, /* RES_CHRATR_HIDDEN */ OutCSS1_SvxHidden, /* RES_CHRATR_OVERLINE */ OutCSS1_SvxOverline, -/* RES_CHRATR_RSID */ 0, +/* RES_CHRATR_RSID */ nullptr, /* RES_CHRATR_BOX */ OutCSS1_SvxBox, -/* RES_CHRATR_SHADOW */ 0, -/* RES_CHRATR_HIGHLIGHT */ 0, -/* RES_CHRATR_GRABBAG */ 0, -/* RES_CHRATR_BIDIRTL */ 0, -/* RES_CHRATR_IDCTHINT */ 0, - -/* RES_TXTATR_REFMARK */ 0, -/* RES_TXTATR_TOXMARK */ 0, -/* RES_TXTATR_META */ 0, -/* RES_TXTATR_METAFIELD */ 0, -/* RES_TXTATR_AUTOFMT */ 0, -/* RES_TXTATR_INETFMT */ 0, -/* RES_TXTATR_CHARFMT */ 0, -/* RES_TXTATR_CJK_RUBY */ 0, -/* RES_TXTATR_UNKNOWN_CONTAINER */ 0, -/* RES_TXTATR_INPUTFIELD */ 0, - -/* RES_TXTATR_FIELD */ 0, -/* RES_TXTATR_FLYCNT */ 0, -/* RES_TXTATR_FTN */ 0, -/* RES_TXTATR_ANNOTATION */ 0, -/* RES_TXTATR_DUMMY3 */ 0, -/* RES_TXTATR_DUMMY1 */ 0, // Dummy: -/* RES_TXTATR_DUMMY2 */ 0, // Dummy: +/* RES_CHRATR_SHADOW */ nullptr, +/* RES_CHRATR_HIGHLIGHT */ nullptr, +/* RES_CHRATR_GRABBAG */ nullptr, +/* RES_CHRATR_BIDIRTL */ nullptr, +/* RES_CHRATR_IDCTHINT */ nullptr, + +/* RES_TXTATR_REFMARK */ nullptr, +/* RES_TXTATR_TOXMARK */ nullptr, +/* RES_TXTATR_META */ nullptr, +/* RES_TXTATR_METAFIELD */ nullptr, +/* RES_TXTATR_AUTOFMT */ nullptr, +/* RES_TXTATR_INETFMT */ nullptr, +/* RES_TXTATR_CHARFMT */ nullptr, +/* RES_TXTATR_CJK_RUBY */ nullptr, +/* RES_TXTATR_UNKNOWN_CONTAINER */ nullptr, +/* RES_TXTATR_INPUTFIELD */ nullptr, + +/* RES_TXTATR_FIELD */ nullptr, +/* RES_TXTATR_FLYCNT */ nullptr, +/* RES_TXTATR_FTN */ nullptr, +/* RES_TXTATR_ANNOTATION */ nullptr, +/* RES_TXTATR_DUMMY3 */ nullptr, +/* RES_TXTATR_DUMMY1 */ nullptr, // Dummy: +/* RES_TXTATR_DUMMY2 */ nullptr, // Dummy: /* RES_PARATR_LINESPACING */ OutCSS1_SvxLineSpacing, /* RES_PARATR_ADJUST */ OutCSS1_SvxAdjust, /* RES_PARATR_SPLIT */ OutCSS1_SvxFormatSplit, /* RES_PARATR_ORPHANS */ OutCSS1_SvxOrphans, /* RES_PARATR_WIDOWS */ OutCSS1_SvxWidows, -/* RES_PARATR_TABSTOP */ 0, -/* RES_PARATR_HYPHENZONE*/ 0, +/* RES_PARATR_TABSTOP */ nullptr, +/* RES_PARATR_HYPHENZONE*/ nullptr, /* RES_PARATR_DROP */ OutCSS1_SwFormatDrop, -/* RES_PARATR_REGISTER */ 0, // neu: Registerhaltigkeit -/* RES_PARATR_NUMRULE */ 0, -/* RES_PARATR_SCRIPTSPACE */ 0, -/* RES_PARATR_HANGINGPUNCTUATION */ 0, -/* RES_PARATR_FORBIDDEN_RULES */ 0, // new -/* RES_PARATR_VERTALIGN */ 0, // new -/* RES_PARATR_SNAPTOGRID*/ 0, // new -/* RES_PARATR_CONNECT_TO_BORDER */ 0, // new -/* RES_PARATR_OUTLINELEVEL */ 0, // new since cws outlinelevel -/* RES_PARATR_RSID */ 0, // new -/* RES_PARATR_GRABBAG */ 0, - -/* RES_PARATR_LIST_ID */ 0, // new -/* RES_PARATR_LIST_LEVEL */ 0, // new -/* RES_PARATR_LIST_ISRESTART */ 0, // new -/* RES_PARATR_LIST_RESTARTVALUE */ 0, // new -/* RES_PARATR_LIST_ISCOUNTED */ 0, // new - -/* RES_FILL_ORDER */ 0, -/* RES_FRM_SIZE */ 0, -/* RES_PAPER_BIN */ 0, +/* RES_PARATR_REGISTER */ nullptr, // neu: Registerhaltigkeit +/* RES_PARATR_NUMRULE */ nullptr, +/* RES_PARATR_SCRIPTSPACE */ nullptr, +/* RES_PARATR_HANGINGPUNCTUATION */ nullptr, +/* RES_PARATR_FORBIDDEN_RULES */ nullptr, // new +/* RES_PARATR_VERTALIGN */ nullptr, // new +/* RES_PARATR_SNAPTOGRID*/ nullptr, // new +/* RES_PARATR_CONNECT_TO_BORDER */ nullptr, // new +/* RES_PARATR_OUTLINELEVEL */ nullptr, // new since cws outlinelevel +/* RES_PARATR_RSID */ nullptr, // new +/* RES_PARATR_GRABBAG */ nullptr, + +/* RES_PARATR_LIST_ID */ nullptr, // new +/* RES_PARATR_LIST_LEVEL */ nullptr, // new +/* RES_PARATR_LIST_ISRESTART */ nullptr, // new +/* RES_PARATR_LIST_RESTARTVALUE */ nullptr, // new +/* RES_PARATR_LIST_ISCOUNTED */ nullptr, // new + +/* RES_FILL_ORDER */ nullptr, +/* RES_FRM_SIZE */ nullptr, +/* RES_PAPER_BIN */ nullptr, /* RES_LR_SPACE */ OutCSS1_SvxLRSpace, /* RES_UL_SPACE */ OutCSS1_SvxULSpace, -/* RES_PAGEDESC */ 0, -/* RES_BREAK */ 0, -/* RES_CNTNT */ 0, -/* RES_HEADER */ 0, -/* RES_FOOTER */ 0, -/* RES_PRINT */ 0, -/* RES_OPAQUE */ 0, -/* RES_PROTECT */ 0, -/* RES_SURROUND */ 0, -/* RES_VERT_ORIENT */ 0, -/* RES_HORI_ORIENT */ 0, -/* RES_ANCHOR */ 0, +/* RES_PAGEDESC */ nullptr, +/* RES_BREAK */ nullptr, +/* RES_CNTNT */ nullptr, +/* RES_HEADER */ nullptr, +/* RES_FOOTER */ nullptr, +/* RES_PRINT */ nullptr, +/* RES_OPAQUE */ nullptr, +/* RES_PROTECT */ nullptr, +/* RES_SURROUND */ nullptr, +/* RES_VERT_ORIENT */ nullptr, +/* RES_HORI_ORIENT */ nullptr, +/* RES_ANCHOR */ nullptr, /* RES_BACKGROUND */ OutCSS1_SvxBrush, /* RES_BOX */ OutCSS1_SvxBox, -/* RES_SHADOW */ 0, -/* RES_FRMMACRO */ 0, -/* RES_COL */ 0, -/* RES_KEEP */ 0, -/* RES_URL */ 0, -/* RES_EDIT_IN_READONLY */ 0, -/* RES_LAYOUT_SPLIT */ 0, -/* RES_CHAIN */ 0, -/* RES_TEXTGRID */ 0, -/* RES_LINENUMBER */ 0, -/* RES_FTN_AT_TXTEND */ 0, -/* RES_END_AT_TXTEND */ 0, -/* RES_COLUMNBALANCE */ 0, +/* RES_SHADOW */ nullptr, +/* RES_FRMMACRO */ nullptr, +/* RES_COL */ nullptr, +/* RES_KEEP */ nullptr, +/* RES_URL */ nullptr, +/* RES_EDIT_IN_READONLY */ nullptr, +/* RES_LAYOUT_SPLIT */ nullptr, +/* RES_CHAIN */ nullptr, +/* RES_TEXTGRID */ nullptr, +/* RES_LINENUMBER */ nullptr, +/* RES_FTN_AT_TXTEND */ nullptr, +/* RES_END_AT_TXTEND */ nullptr, +/* RES_COLUMNBALANCE */ nullptr, /* RES_FRAMEDIR */ OutCSS1_SvxFrameDirection, -/* RES_HEADER_FOOTER_EAT_SPACING */ 0, -/* RES_ROW_SPLIT */ 0, -/* RES_FOLLOW_TEXT_FLOW */ 0, -/* RES_COLLAPSING_BORDERS */ 0, -/* RES_WRAP_INFLUENCE_ON_OBJPOS */ 0, -/* RES_AUTO_STYLE */ 0, -/* RES_FRMATR_STYLE_NAME */ 0, -/* RES_FRMATR_CONDITIONAL_STYLE_NAME */ 0, -/* RES_FRMATR_GRABBAG */ 0, -/* RES_TEXT_VERT_ADJUST */ 0, - -/* RES_GRFATR_MIRRORGRF */ 0, -/* RES_GRFATR_CROPGRF */ 0, -/* RES_GRFATR_ROTATION */ 0, -/* RES_GRFATR_LUMINANCE */ 0, -/* RES_GRFATR_CONTRAST */ 0, -/* RES_GRFATR_CHANNELR */ 0, -/* RES_GRFATR_CHANNELG */ 0, -/* RES_GRFATR_CHANNELB */ 0, -/* RES_GRFATR_GAMMA */ 0, -/* RES_GRFATR_INVERT */ 0, -/* RES_GRFATR_TRANSPARENCY */ 0, -/* RES_GRFATR_DRWAMODE */ 0, -/* RES_GRFATR_DUMMY1 */ 0, -/* RES_GRFATR_DUMMY2 */ 0, -/* RES_GRFATR_DUMMY3 */ 0, -/* RES_GRFATR_DUMMY4 */ 0, -/* RES_GRFATR_DUMMY5 */ 0, - -/* RES_BOXATR_FORMAT */ 0, -/* RES_BOXATR_FORMULA */ 0, -/* RES_BOXATR_VALUE */ 0 +/* RES_HEADER_FOOTER_EAT_SPACING */ nullptr, +/* RES_ROW_SPLIT */ nullptr, +/* RES_FOLLOW_TEXT_FLOW */ nullptr, +/* RES_COLLAPSING_BORDERS */ nullptr, +/* RES_WRAP_INFLUENCE_ON_OBJPOS */ nullptr, +/* RES_AUTO_STYLE */ nullptr, +/* RES_FRMATR_STYLE_NAME */ nullptr, +/* RES_FRMATR_CONDITIONAL_STYLE_NAME */ nullptr, +/* RES_FRMATR_GRABBAG */ nullptr, +/* RES_TEXT_VERT_ADJUST */ nullptr, + +/* RES_GRFATR_MIRRORGRF */ nullptr, +/* RES_GRFATR_CROPGRF */ nullptr, +/* RES_GRFATR_ROTATION */ nullptr, +/* RES_GRFATR_LUMINANCE */ nullptr, +/* RES_GRFATR_CONTRAST */ nullptr, +/* RES_GRFATR_CHANNELR */ nullptr, +/* RES_GRFATR_CHANNELG */ nullptr, +/* RES_GRFATR_CHANNELB */ nullptr, +/* RES_GRFATR_GAMMA */ nullptr, +/* RES_GRFATR_INVERT */ nullptr, +/* RES_GRFATR_TRANSPARENCY */ nullptr, +/* RES_GRFATR_DRWAMODE */ nullptr, +/* RES_GRFATR_DUMMY1 */ nullptr, +/* RES_GRFATR_DUMMY2 */ nullptr, +/* RES_GRFATR_DUMMY3 */ nullptr, +/* RES_GRFATR_DUMMY4 */ nullptr, +/* RES_GRFATR_DUMMY5 */ nullptr, + +/* RES_BOXATR_FORMAT */ nullptr, +/* RES_BOXATR_FORMULA */ nullptr, +/* RES_BOXATR_VALUE */ nullptr }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 5aa30dda24d2..c053eb298b77 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -87,7 +87,7 @@ HTMLOutEvent aAnchorEventTable[] = { OOO_STRING_SVTOOLS_HTML_O_SDonclick, OOO_STRING_SVTOOLS_HTML_O_onclick, SFX_EVENT_MOUSECLICK_OBJECT }, { OOO_STRING_SVTOOLS_HTML_O_SDonmouseover, OOO_STRING_SVTOOLS_HTML_O_onmouseover, SFX_EVENT_MOUSEOVER_OBJECT }, { OOO_STRING_SVTOOLS_HTML_O_SDonmouseout, OOO_STRING_SVTOOLS_HTML_O_onmouseout, SFX_EVENT_MOUSEOUT_OBJECT }, - { 0, 0, 0 } + { nullptr, nullptr, 0 } }; static Writer& OutHTML_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt ); @@ -232,8 +232,8 @@ SwHTMLFormatInfo::SwHTMLFormatInfo( const SwFormat *pF, SwDoc *pDoc, SwDoc *pTem LanguageType eDfltLang, sal_uInt16 nCSS1Script, bool bHardDrop ) : pFormat(pF) - , pRefFormat(0) - , pItemSet(0) + , pRefFormat(nullptr) + , pItemSet(nullptr) , nLeftMargin(0) , nRightMargin(0) , nFirstLineIndent(0) @@ -253,7 +253,7 @@ SwHTMLFormatInfo::SwHTMLFormatInfo( const SwFormat *pF, SwDoc *pDoc, SwDoc *pTem bool bTextColl = pFormat->Which() == RES_TXTFMTCOLL || pFormat->Which() == RES_CONDTXTFMTCOLL; - const SwFormat *pReferenceFormat = 0; // Vergleichs-Format + const SwFormat *pReferenceFormat = nullptr; // Vergleichs-Format if( nDeep != 0 ) { // Es ist eine HTML-Tag-Vorlage oder die Vorlage ist von einer @@ -316,7 +316,7 @@ SwHTMLFormatInfo::SwHTMLFormatInfo( const SwFormat *pF, SwDoc *pDoc, SwDoc *pTem if( !pItemSet->Count() ) { delete pItemSet; - pItemSet = 0; + pItemSet = nullptr; } } @@ -649,7 +649,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, } // soll ein ALIGN=... geschrieben werden? - const SfxPoolItem* pAdjItem = 0; + const SfxPoolItem* pAdjItem = nullptr; const SfxPoolItem* pItem; if( rInfo.pItemSet && @@ -821,7 +821,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, rHWrt.m_bOutOpts = true; OutHTML_SvxAdjust( rWrt, *pAdjItem ); rWrt.Strm().WriteChar( '>' ); - pAdjItem = 0; + pAdjItem = nullptr; rHWrt.m_bNoAlign = false; rInfo.bOutDiv = true; rHWrt.IncIndentLevel(); @@ -1017,7 +1017,7 @@ void OutHTML_SwFormatOff( Writer& rWrt, const SwHTMLTextCollOutputInfo& rInfo ) rHWrt.ChangeParaToken( 0 ); OutHTML_NumBulListEnd( rHWrt, rNextInfo ); } - else if( rNextInfo.GetNumRule() != 0 ) + else if( rNextInfo.GetNumRule() != nullptr ) rHWrt.ChangeParaToken( 0 ); return; @@ -1177,9 +1177,9 @@ public: sal_uInt16 nWeak=CSS1_OUTMODE_ANY_SCRIPT ); void OutStartAttrs( SwHTMLWriter& rHWrt, sal_Int32 nPos, - HTMLOutContext *pContext = 0 ); + HTMLOutContext *pContext = nullptr ); void OutEndAttrs( SwHTMLWriter& rHWrt, sal_Int32 nPos, - HTMLOutContext *pContext = 0 ); + HTMLOutContext *pContext = nullptr ); bool IsHTMLMode( sal_uLong nMode ) const { return (nHTMLMode & nMode) != 0; } }; @@ -1935,7 +1935,7 @@ void HTMLEndPosLst::OutStartAttrs( SwHTMLWriter& rHWrt, sal_Int32 nPos, // die Attribute in der Start-Liste sind aufsteigend sortiert for( HTMLStartEndPositions::size_type i=0; i< aStartLst.size(); ++i ) { - HTMLStartEndPos *pPos = 0; + HTMLStartEndPos *pPos = nullptr; if( nCharBoxIndex < aStartLst.size() ) { if( i == 0 ) @@ -1968,7 +1968,7 @@ void HTMLEndPosLst::OutStartAttrs( SwHTMLWriter& rHWrt, sal_Int32 nPos, if( pContext ) { HTMLOutFuncs::FlushToAscii( rHWrt.Strm(), *pContext ); - pContext = 0; // one time ony + pContext = nullptr; // one time ony } Out( aHTMLAttrFnTab, *pPos->GetItem(), rHWrt ); rHWrt.m_nCSS1Script = nCSS1Script; @@ -1993,7 +1993,7 @@ void HTMLEndPosLst::OutEndAttrs( SwHTMLWriter& rHWrt, sal_Int32 nPos, if( pContext ) { HTMLOutFuncs::FlushToAscii( rHWrt.Strm(), *pContext ); - pContext = 0; // one time ony + pContext = nullptr; // one time ony } // Skip closing span if next character span has the same border (border merge) bool bSkipOut = false; @@ -2330,7 +2330,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) { rHTMLWrt.OutFootEndNoteSym( *rHTMLWrt.m_pFormatFootnote, aFootEndNoteSym, aEndPosLst.GetScriptAtPos( aOutlineText.getLength(), rHTMLWrt.m_nCSS1Script ) ); - rHTMLWrt.m_pFormatFootnote = 0; + rHTMLWrt.m_pFormatFootnote = nullptr; } } @@ -2340,7 +2340,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) size_t nAttrPos = 0; sal_Int32 nStrPos = rHTMLWrt.pCurPam->GetPoint()->nContent.GetIndex(); - const SwTextAttr * pHt = 0; + const SwTextAttr * pHt = nullptr; const size_t nCntAttr = pNd->HasHints() ? pNd->GetSwpHints().Count() : 0; if( nCntAttr && nStrPos > ( pHt = pNd->GetSwpHints().Get(0) )->GetStart() ) { @@ -2409,7 +2409,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) } bool bOutChar = true; - const SwTextAttr * pTextHt = 0; + const SwTextAttr * pTextHt = nullptr; if( nAttrPos < nCntAttr && pHt->GetStart() == nStrPos && nStrPos != nEnd ) { @@ -2851,7 +2851,7 @@ static Writer& OutHTML_SvxEscapement( Writer& rWrt, const SfxPoolItem& rHt ) const SvxEscapement eEscape = (const SvxEscapement)static_cast<const SvxEscapementItem&>(rHt).GetEnumValue(); - const sal_Char *pStr = 0; + const sal_Char *pStr = nullptr; switch( eEscape ) { case SVX_ESCAPEMENT_SUPERSCRIPT: pStr = OOO_STRING_SVTOOLS_HTML_superscript; break; @@ -2899,7 +2899,7 @@ static Writer& OutHTML_SwFlyCnt( Writer& rWrt, const SfxPoolItem& rHt ) const SwFormatFlyCnt& rFlyCnt = static_cast<const SwFormatFlyCnt&>(rHt); const SwFrameFormat& rFormat = *rFlyCnt.GetFrameFormat(); - const SdrObject *pSdrObj = 0; + const SdrObject *pSdrObj = nullptr; SwHTMLFrmType eType = (SwHTMLFrmType)rHTMLWrt.GuessFrmType( rFormat, pSdrObj ); @@ -2935,7 +2935,7 @@ Writer& OutHTML_INetFormat( Writer& rWrt, const SwFormatINetFormat& rINetFormat, OUString aURL( rINetFormat.GetValue() ); const SvxMacroTableDtor *pMacTable = rINetFormat.GetMacroTable(); - bool bEvents = pMacTable != 0 && !pMacTable->empty(); + bool bEvents = pMacTable != nullptr && !pMacTable->empty(); // Anything to output at all? if( aURL.isEmpty() && !bEvents && rINetFormat.GetName().isEmpty() ) @@ -2976,7 +2976,7 @@ Writer& OutHTML_INetFormat( Writer& rWrt, const SwFormatINetFormat& rINetFormat, if( bScriptDependent ) { sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_class) + "=\""; - const sal_Char* pStr = 0; + const sal_Char* pStr = nullptr; switch( rHTMLWrt.m_nCSS1Script ) { case CSS1_OUTMODE_WESTERN: @@ -3177,7 +3177,7 @@ static Writer& OutHTML_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt ) return rWrt; const SvxAdjustItem& rAdjust = static_cast<const SvxAdjustItem&>(rHt); - const sal_Char* pStr = 0; + const sal_Char* pStr = nullptr; switch( rAdjust.GetAdjust() ) { case SVX_ADJUST_CENTER: pStr = OOO_STRING_SVTOOLS_HTML_AL_center; break; @@ -3206,9 +3206,9 @@ static Writer& OutHTML_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt ) SwAttrFnTab aHTMLAttrFnTab = { /* RES_CHRATR_CASEMAP */ OutHTML_CSS1Attr, -/* RES_CHRATR_CHARSETCOLOR */ 0, +/* RES_CHRATR_CHARSETCOLOR */ nullptr, /* RES_CHRATR_COLOR */ OutHTML_SvxColor, -/* RES_CHRATR_CONTOUR */ 0, +/* RES_CHRATR_CONTOUR */ nullptr, /* RES_CHRATR_CROSSEDOUT */ OutHTML_SwCrossedOut, /* RES_CHRATR_ESCAPEMENT */ OutHTML_SvxEscapement, /* RES_CHRATR_FONT */ OutHTML_SvxFont, @@ -3216,15 +3216,15 @@ SwAttrFnTab aHTMLAttrFnTab = { /* RES_CHRATR_KERNING */ OutHTML_CSS1Attr, /* RES_CHRATR_LANGUAGE */ OutHTML_SvxLanguage, /* RES_CHRATR_POSTURE */ OutHTML_SwPosture, -/* RES_CHRATR_PROPORTIONALFONTSIZE*/0, -/* RES_CHRATR_SHADOWED */ 0, +/* RES_CHRATR_PROPORTIONALFONTSIZE*/nullptr, +/* RES_CHRATR_SHADOWED */ nullptr, /* RES_CHRATR_UNDERLINE */ OutHTML_SwUnderline, /* RES_CHRATR_WEIGHT */ OutHTML_SwWeight, -/* RES_CHRATR_WORDLINEMODE */ 0, -/* RES_CHRATR_AUTOKERN */ 0, +/* RES_CHRATR_WORDLINEMODE */ nullptr, +/* RES_CHRATR_AUTOKERN */ nullptr, /* RES_CHRATR_BLINK */ OutHTML_SwBlink, -/* RES_CHRATR_NOHYPHEN */ 0, // Neu: nicht trennen -/* RES_CHRATR_NOLINEBREAK */ 0, // Neu: nicht umbrechen +/* RES_CHRATR_NOHYPHEN */ nullptr, // Neu: nicht trennen +/* RES_CHRATR_NOLINEBREAK */ nullptr, // Neu: nicht umbrechen /* RES_CHRATR_BACKGROUND */ OutHTML_CSS1Attr, // Neu: Zeichenhintergrund /* RES_CHRATR_CJK_FONT */ OutHTML_SvxFont, /* RES_CHRATR_CJK_FONTSIZE */ OutHTML_SvxFontHeight, @@ -3236,131 +3236,131 @@ SwAttrFnTab aHTMLAttrFnTab = { /* RES_CHRATR_CTL_LANGUAGE */ OutHTML_SvxLanguage, /* RES_CHRATR_CTL_POSTURE */ OutHTML_SwPosture, /* RES_CHRATR_CTL_WEIGHT */ OutHTML_SwWeight, -/* RES_CHRATR_ROTATE */ 0, -/* RES_CHRATR_EMPHASIS_MARK */ 0, -/* RES_CHRATR_TWO_LINES */ 0, -/* RES_CHRATR_SCALEW */ 0, -/* RES_CHRATR_RELIEF */ 0, +/* RES_CHRATR_ROTATE */ nullptr, +/* RES_CHRATR_EMPHASIS_MARK */ nullptr, +/* RES_CHRATR_TWO_LINES */ nullptr, +/* RES_CHRATR_SCALEW */ nullptr, +/* RES_CHRATR_RELIEF */ nullptr, /* RES_CHRATR_HIDDEN */ OutHTML_CSS1Attr, /* RES_CHRATR_OVERLINE */ OutHTML_CSS1Attr, -/* RES_CHRATR_RSID */ 0, +/* RES_CHRATR_RSID */ nullptr, /* RES_CHRATR_BOX */ OutHTML_CSS1Attr, -/* RES_CHRATR_SHADOW */ 0, -/* RES_CHRATR_HIGHLIGHT */ 0, -/* RES_CHRATR_GRABBAG */ 0, -/* RES_CHRATR_BIDIRTL */ 0, -/* RES_CHRATR_IDCTHINT */ 0, - -/* RES_TXTATR_REFMARK */ 0, -/* RES_TXTATR_TOXMARK */ 0, -/* RES_TXTATR_META */ 0, -/* RES_TXTATR_METAFIELD */ 0, -/* RES_TXTATR_AUTOFMT */ 0, +/* RES_CHRATR_SHADOW */ nullptr, +/* RES_CHRATR_HIGHLIGHT */ nullptr, +/* RES_CHRATR_GRABBAG */ nullptr, +/* RES_CHRATR_BIDIRTL */ nullptr, +/* RES_CHRATR_IDCTHINT */ nullptr, + +/* RES_TXTATR_REFMARK */ nullptr, +/* RES_TXTATR_TOXMARK */ nullptr, +/* RES_TXTATR_META */ nullptr, +/* RES_TXTATR_METAFIELD */ nullptr, +/* RES_TXTATR_AUTOFMT */ nullptr, /* RES_TXTATR_INETFMT */ OutHTML_SwFormatINetFormat, /* RES_TXTATR_CHARFMT */ OutHTML_SwTextCharFormat, -/* RES_TXTATR_CJK_RUBY */ 0, -/* RES_TXTATR_UNKNOWN_CONTAINER */ 0, +/* RES_TXTATR_CJK_RUBY */ nullptr, +/* RES_TXTATR_UNKNOWN_CONTAINER */ nullptr, /* RES_TXTATR_INPUTFIELD */ OutHTML_SwFormatField, /* RES_TXTATR_FIELD */ OutHTML_SwFormatField, /* RES_TXTATR_FLYCNT */ OutHTML_SwFlyCnt, /* RES_TXTATR_FTN */ OutHTML_SwFormatFootnote, /* RES_TXTATR_ANNOTATION */ OutHTML_SwFormatField, -/* RES_TXTATR_DUMMY3 */ 0, -/* RES_TXTATR_DUMMY1 */ 0, // Dummy: -/* RES_TXTATR_DUMMY2 */ 0, // Dummy: +/* RES_TXTATR_DUMMY3 */ nullptr, +/* RES_TXTATR_DUMMY1 */ nullptr, // Dummy: +/* RES_TXTATR_DUMMY2 */ nullptr, // Dummy: -/* RES_PARATR_LINESPACING */ 0, +/* RES_PARATR_LINESPACING */ nullptr, /* RES_PARATR_ADJUST */ OutHTML_SvxAdjust, -/* RES_PARATR_SPLIT */ 0, -/* RES_PARATR_WIDOWS */ 0, -/* RES_PARATR_ORPHANS */ 0, -/* RES_PARATR_TABSTOP */ 0, -/* RES_PARATR_HYPHENZONE*/ 0, +/* RES_PARATR_SPLIT */ nullptr, +/* RES_PARATR_WIDOWS */ nullptr, +/* RES_PARATR_ORPHANS */ nullptr, +/* RES_PARATR_TABSTOP */ nullptr, +/* RES_PARATR_HYPHENZONE*/ nullptr, /* RES_PARATR_DROP */ OutHTML_CSS1Attr, -/* RES_PARATR_REGISTER */ 0, // neu: Registerhaltigkeit -/* RES_PARATR_NUMRULE */ 0, // Dummy: -/* RES_PARATR_SCRIPTSPACE */ 0, // Dummy: -/* RES_PARATR_HANGINGPUNCTUATION */ 0, // Dummy: -/* RES_PARATR_FORBIDDEN_RULES */ 0, // new -/* RES_PARATR_VERTALIGN */ 0, // new -/* RES_PARATR_SNAPTOGRID*/ 0, // new -/* RES_PARATR_CONNECT_TO_BORDER */ 0, // new -/* RES_PARATR_OUTLINELEVEL */ 0, -/* RES_PARATR_RSID */ 0, -/* RES_PARATR_GRABBAG */ 0, - -/* RES_PARATR_LIST_ID */ 0, // new -/* RES_PARATR_LIST_LEVEL */ 0, // new -/* RES_PARATR_LIST_ISRESTART */ 0, // new -/* RES_PARATR_LIST_RESTARTVALUE */ 0, // new -/* RES_PARATR_LIST_ISCOUNTED */ 0, // new - -/* RES_FILL_ORDER */ 0, -/* RES_FRM_SIZE */ 0, -/* RES_PAPER_BIN */ 0, -/* RES_LR_SPACE */ 0, -/* RES_UL_SPACE */ 0, -/* RES_PAGEDESC */ 0, -/* RES_BREAK */ 0, -/* RES_CNTNT */ 0, -/* RES_HEADER */ 0, -/* RES_FOOTER */ 0, -/* RES_PRINT */ 0, -/* RES_OPAQUE */ 0, -/* RES_PROTECT */ 0, -/* RES_SURROUND */ 0, -/* RES_VERT_ORIENT */ 0, -/* RES_HORI_ORIENT */ 0, -/* RES_ANCHOR */ 0, -/* RES_BACKGROUND */ 0, -/* RES_BOX */ 0, -/* RES_SHADOW */ 0, -/* RES_FRMMACRO */ 0, -/* RES_COL */ 0, -/* RES_KEEP */ 0, -/* RES_URL */ 0, -/* RES_EDIT_IN_READONLY */ 0, -/* RES_LAYOUT_SPLIT */ 0, -/* RES_CHAIN */ 0, -/* RES_TEXTGRID */ 0, -/* RES_LINENUMBER */ 0, -/* RES_FTN_AT_TXTEND */ 0, -/* RES_END_AT_TXTEND */ 0, -/* RES_COLUMNBALANCE */ 0, -/* RES_FRAMEDIR */ 0, -/* RES_HEADER_FOOTER_EAT_SPACING */ 0, -/* RES_ROW_SPLIT */ 0, -/* RES_FOLLOW_TEXT_FLOW */ 0, -/* RES_COLLAPSING_BORDERS */ 0, -/* RES_WRAP_INFLUENCE_ON_OBJPOS */ 0, -/* RES_AUTO_STYLE */ 0, -/* RES_FRMATR_STYLE_NAME */ 0, -/* RES_FRMATR_CONDITIONAL_STYLE_NAME */ 0, -/* RES_FRMATR_GRABBAG */ 0, -/* RES_TEXT_VERT_ADJUST */ 0, - -/* RES_GRFATR_MIRRORGRF */ 0, -/* RES_GRFATR_CROPGRF */ 0, -/* RES_GRFATR_ROTATION */ 0, -/* RES_GRFATR_LUMINANCE */ 0, -/* RES_GRFATR_CONTRAST */ 0, -/* RES_GRFATR_CHANNELR */ 0, -/* RES_GRFATR_CHANNELG */ 0, -/* RES_GRFATR_CHANNELB */ 0, -/* RES_GRFATR_GAMMA */ 0, -/* RES_GRFATR_INVERT */ 0, -/* RES_GRFATR_TRANSPARENCY */ 0, -/* RES_GRFATR_DRWAMODE */ 0, -/* RES_GRFATR_DUMMY1 */ 0, -/* RES_GRFATR_DUMMY2 */ 0, -/* RES_GRFATR_DUMMY3 */ 0, -/* RES_GRFATR_DUMMY4 */ 0, -/* RES_GRFATR_DUMMY5 */ 0, - -/* RES_BOXATR_FORMAT */ 0, -/* RES_BOXATR_FORMULA */ 0, -/* RES_BOXATR_VALUE */ 0 +/* RES_PARATR_REGISTER */ nullptr, // neu: Registerhaltigkeit +/* RES_PARATR_NUMRULE */ nullptr, // Dummy: +/* RES_PARATR_SCRIPTSPACE */ nullptr, // Dummy: +/* RES_PARATR_HANGINGPUNCTUATION */ nullptr, // Dummy: +/* RES_PARATR_FORBIDDEN_RULES */ nullptr, // new +/* RES_PARATR_VERTALIGN */ nullptr, // new +/* RES_PARATR_SNAPTOGRID*/ nullptr, // new +/* RES_PARATR_CONNECT_TO_BORDER */ nullptr, // new +/* RES_PARATR_OUTLINELEVEL */ nullptr, +/* RES_PARATR_RSID */ nullptr, +/* RES_PARATR_GRABBAG */ nullptr, + +/* RES_PARATR_LIST_ID */ nullptr, // new +/* RES_PARATR_LIST_LEVEL */ nullptr, // new +/* RES_PARATR_LIST_ISRESTART */ nullptr, // new +/* RES_PARATR_LIST_RESTARTVALUE */ nullptr, // new +/* RES_PARATR_LIST_ISCOUNTED */ nullptr, // new + +/* RES_FILL_ORDER */ nullptr, +/* RES_FRM_SIZE */ nullptr, +/* RES_PAPER_BIN */ nullptr, +/* RES_LR_SPACE */ nullptr, +/* RES_UL_SPACE */ nullptr, +/* RES_PAGEDESC */ nullptr, +/* RES_BREAK */ nullptr, +/* RES_CNTNT */ nullptr, +/* RES_HEADER */ nullptr, +/* RES_FOOTER */ nullptr, +/* RES_PRINT */ nullptr, +/* RES_OPAQUE */ nullptr, +/* RES_PROTECT */ nullptr, +/* RES_SURROUND */ nullptr, +/* RES_VERT_ORIENT */ nullptr, +/* RES_HORI_ORIENT */ nullptr, +/* RES_ANCHOR */ nullptr, +/* RES_BACKGROUND */ nullptr, +/* RES_BOX */ nullptr, +/* RES_SHADOW */ nullptr, +/* RES_FRMMACRO */ nullptr, +/* RES_COL */ nullptr, +/* RES_KEEP */ nullptr, +/* RES_URL */ nullptr, +/* RES_EDIT_IN_READONLY */ nullptr, +/* RES_LAYOUT_SPLIT */ nullptr, +/* RES_CHAIN */ nullptr, +/* RES_TEXTGRID */ nullptr, +/* RES_LINENUMBER */ nullptr, +/* RES_FTN_AT_TXTEND */ nullptr, +/* RES_END_AT_TXTEND */ nullptr, +/* RES_COLUMNBALANCE */ nullptr, +/* RES_FRAMEDIR */ nullptr, +/* RES_HEADER_FOOTER_EAT_SPACING */ nullptr, +/* RES_ROW_SPLIT */ nullptr, +/* RES_FOLLOW_TEXT_FLOW */ nullptr, +/* RES_COLLAPSING_BORDERS */ nullptr, +/* RES_WRAP_INFLUENCE_ON_OBJPOS */ nullptr, +/* RES_AUTO_STYLE */ nullptr, +/* RES_FRMATR_STYLE_NAME */ nullptr, +/* RES_FRMATR_CONDITIONAL_STYLE_NAME */ nullptr, +/* RES_FRMATR_GRABBAG */ nullptr, +/* RES_TEXT_VERT_ADJUST */ nullptr, + +/* RES_GRFATR_MIRRORGRF */ nullptr, +/* RES_GRFATR_CROPGRF */ nullptr, +/* RES_GRFATR_ROTATION */ nullptr, +/* RES_GRFATR_LUMINANCE */ nullptr, +/* RES_GRFATR_CONTRAST */ nullptr, +/* RES_GRFATR_CHANNELR */ nullptr, +/* RES_GRFATR_CHANNELG */ nullptr, +/* RES_GRFATR_CHANNELB */ nullptr, +/* RES_GRFATR_GAMMA */ nullptr, +/* RES_GRFATR_INVERT */ nullptr, +/* RES_GRFATR_TRANSPARENCY */ nullptr, +/* RES_GRFATR_DRWAMODE */ nullptr, +/* RES_GRFATR_DUMMY1 */ nullptr, +/* RES_GRFATR_DUMMY2 */ nullptr, +/* RES_GRFATR_DUMMY3 */ nullptr, +/* RES_GRFATR_DUMMY4 */ nullptr, +/* RES_GRFATR_DUMMY5 */ nullptr, + +/* RES_BOXATR_FORMAT */ nullptr, +/* RES_BOXATR_FORMULA */ nullptr, +/* RES_BOXATR_VALUE */ nullptr }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx index 303d8e1e22d3..748985992dde 100644 --- a/sw/source/filter/html/htmlbas.cxx +++ b/sw/source/filter/html/htmlbas.cxx @@ -55,7 +55,7 @@ static HTMLOutEvent aBodyEventTable[] = { OOO_STRING_SVTOOLS_HTML_O_SDonunload, OOO_STRING_SVTOOLS_HTML_O_onunload, SFX_EVENT_PREPARECLOSEDOC }, { OOO_STRING_SVTOOLS_HTML_O_SDonfocus, OOO_STRING_SVTOOLS_HTML_O_onfocus, SFX_EVENT_ACTIVATEDOC }, { OOO_STRING_SVTOOLS_HTML_O_SDonblur, OOO_STRING_SVTOOLS_HTML_O_onblur, SFX_EVENT_DEACTIVATEDOC }, - { 0, 0, 0 } + { nullptr, nullptr, 0 } }; void SwHTMLParser::NewScript() diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index de9604d2005d..addae9ddf749 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -133,7 +133,7 @@ bool SwCSS1Parser::SetFormatBreak( SfxItemSet& rItemSet, SvxBreak eBreak = SVX_BREAK_NONE; bool bKeep = false; bool bSetKeep = false, bSetBreak = false, bSetPageDesc = false; - const SwPageDesc *pPageDesc = 0; + const SwPageDesc *pPageDesc = nullptr; switch( rPropInfo.ePageBreakBefore ) { case SVX_CSS1_PBREAK_ALWAYS: @@ -225,7 +225,7 @@ void SwCSS1Parser::SetLinkCharFormats() SvxCSS1MapEntry *pStyleEntry = GetTag( OOO_STRING_SVTOOLS_HTML_anchor ); - SwCharFormat *pUnvisited = 0, *pVisited = 0; + SwCharFormat *pUnvisited = nullptr, *pVisited = nullptr; if( pStyleEntry ) { SfxItemSet& rItemSet = pStyleEntry->GetItemSet(); @@ -353,7 +353,7 @@ void SwCSS1Parser::SetTableTextColl( bool bHeader ) sTag = OOO_STRING_SVTOOLS_HTML_tabledata; } - SwTextFormatColl *pColl = 0; + SwTextFormatColl *pColl = nullptr; // The following entries will never be used again and may be changed. SvxCSS1MapEntry *pStyleEntry = GetTag( sTag ); @@ -386,13 +386,13 @@ void SwCSS1Parser::SetPageDescAttrs( const SvxBrushItem *pBrush, SvxBrushItem aBrushItem( RES_BACKGROUND ); SvxBoxItem aBoxItem( RES_BOX ); SvxFrameDirectionItem aFrmDirItem(FRMDIR_ENVIRONMENT, RES_FRAMEDIR); - bool bSetBrush = pBrush!=0, bSetBox = false, bSetFrmDir = false; + bool bSetBrush = pBrush!=nullptr, bSetBox = false, bSetFrmDir = false; if( pBrush ) aBrushItem = *pBrush; if( pItemSet2 ) { - const SfxPoolItem *pItem = 0; + const SfxPoolItem *pItem = nullptr; if( SfxItemState::SET == pItemSet2->GetItemState( RES_BACKGROUND, false, &pItem ) ) { @@ -640,7 +640,7 @@ static CSS1SelectorType GetTokenAndClass( const CSS1Selector *pSelector, } static void RemoveScriptItems( SfxItemSet& rItemSet, sal_uInt16 nScript, - const SfxItemSet *pParentItemSet = 0 ) + const SfxItemSet *pParentItemSet = nullptr ) { static const sal_uInt16 aWhichIds[3][5] = { @@ -730,7 +730,7 @@ bool SwCSS1Parser::StyleParsed( const CSS1Selector *pSelector, if( pNext ) aName = pNext->GetString(); InsertPage( aName, - pNext != 0, + pNext != nullptr, rItemSet, rPropInfo ); } } @@ -825,7 +825,7 @@ bool SwCSS1Parser::StyleParsed( const CSS1Selector *pSelector, // Ein par Attribute muessen an der Seitenvorlage gesetzt werden, // und zwar die, die nicht vererbt werden - SetPageDescAttrs( 0, &rItemSet ); + SetPageDescAttrs( nullptr, &rItemSet ); // alle noch uebrigen Optionen koennen an der Standard-Vorlage // gesetzt werden und gelten dann automatisch als defaults @@ -986,7 +986,7 @@ bool SwCSS1Parser::StyleParsed( const CSS1Selector *pSelector, // Die Vorlage Suchen bzw. Anlegen SwTextFormatColl *pColl = GetTextFormatColl( nPoolCollId, aEmptyOUStr ); - SwTextFormatColl* pParentColl = 0; + SwTextFormatColl* pParentColl = nullptr; if( !aClass.isEmpty() ) { OUString aName( pColl->GetName() ); @@ -1001,7 +1001,7 @@ bool SwCSS1Parser::StyleParsed( const CSS1Selector *pSelector, { // nur die Attribute an der Vorlage setzen const SfxPoolItem *pItem; - const SvxBoxItem *pBoxItem = 0; + const SvxBoxItem *pBoxItem = nullptr; if( SfxItemState::SET == pColl->GetAttrSet().GetItemState(RES_BOX,true,&pItem) ) pBoxItem = static_cast<const SvxBoxItem *>(pItem); @@ -1014,7 +1014,7 @@ bool SwCSS1Parser::StyleParsed( const CSS1Selector *pSelector, { SfxItemSet aScriptItemSet( rItemSet ); RemoveScriptItems( aScriptItemSet, nScript, - pParentColl ? &pParentColl->GetAttrSet() : 0 ); + pParentColl ? &pParentColl->GetAttrSet() : nullptr ); SetTextCollAttrs( pColl, aScriptItemSet, rPropInfo, this ); } } @@ -1084,7 +1084,7 @@ bool SwCSS1Parser::StyleParsed( const CSS1Selector *pSelector, SwCharFormat *pCFormat = GetChrFormat( static_cast< sal_uInt16 >(nToken2), aEmptyOUStr ); if( pCFormat ) { - SwCharFormat *pParentCFormat = 0; + SwCharFormat *pParentCFormat = nullptr; if( !aClass.isEmpty() ) { OUString aName( pCFormat->GetName() ); @@ -1107,7 +1107,7 @@ bool SwCSS1Parser::StyleParsed( const CSS1Selector *pSelector, { SfxItemSet aScriptItemSet( rItemSet ); RemoveScriptItems( aScriptItemSet, nScript, - pParentCFormat ? &pParentCFormat->GetAttrSet() : 0 ); + pParentCFormat ? &pParentCFormat->GetAttrSet() : nullptr ); SetCharFormatAttrs( pCFormat, aScriptItemSet ); } return false; @@ -1123,7 +1123,7 @@ sal_uInt32 SwCSS1Parser::GetFontHeight( sal_uInt16 nSize ) const const FontList *SwCSS1Parser::GetFontList() const { - const FontList *pFList = 0; + const FontList *pFList = nullptr; SwDocShell *pDocSh = pDoc->GetDocShell(); if( pDocSh ) { @@ -1140,7 +1140,7 @@ SwCharFormat* SwCSS1Parser::GetChrFormat( sal_uInt16 nToken2, const OUString& rC { // die entsprechende Vorlage suchen sal_uInt16 nPoolId = 0; - const sal_Char* sName = 0; + const sal_Char* sName = nullptr; switch( nToken2 ) { case HTML_EMPHASIS_ON: nPoolId = RES_POOLCHR_HTML_EMPHASIS; break; @@ -1165,10 +1165,10 @@ SwCharFormat* SwCSS1Parser::GetChrFormat( sal_uInt16 nToken2, const OUString& rC // die Vorlage suchen oder anlegen (geht nur mit Namen) if( !nPoolId && !sName ) - return 0; + return nullptr; // Die Vorlage (ohne Class) suchen oder anlegen - SwCharFormat *pCFormat = 0; + SwCharFormat *pCFormat = nullptr; if( nPoolId ) { pCFormat = GetCharFormatFromPool( nPoolId ); @@ -1253,7 +1253,7 @@ SwCharFormat *SwCSS1Parser::GetCharFormatFromPool( sal_uInt16 nPoolId ) const SwTextFormatColl *SwCSS1Parser::GetTextFormatColl( sal_uInt16 nTextColl, const OUString& rClass ) { - SwTextFormatColl* pColl = 0; + SwTextFormatColl* pColl = nullptr; OUString aClass( rClass ); GetScriptFromClass( aClass, false ); @@ -1345,7 +1345,7 @@ static SwPageDesc *FindPageDesc(SwDoc *pDoc, sal_uInt16 nPoolId) pDoc->GetPageDesc(nPage).GetPoolFormatId() != nPoolId; ++nPage) ; - return nPage < nPageDescs ? &pDoc->GetPageDesc(nPage) : 0; + return nPage < nPageDescs ? &pDoc->GetPageDesc(nPage) : nullptr; } const SwPageDesc *SwCSS1Parser::GetPageDesc( sal_uInt16 nPoolId, bool bCreate ) @@ -1358,7 +1358,7 @@ const SwPageDesc *SwCSS1Parser::GetPageDesc( sal_uInt16 nPoolId, bool bCreate ) { // Die erste Seite wird aus der rechten Seite erzeugt, wenn es die // gibt. - SwPageDesc *pMasterPageDesc = 0; + SwPageDesc *pMasterPageDesc = nullptr; if( RES_POOLPAGE_FIRST == nPoolId ) pMasterPageDesc = FindPageDesc(pDoc, RES_POOLPAGE_RIGHT); if( !pMasterPageDesc ) @@ -1374,7 +1374,7 @@ const SwPageDesc *SwCSS1Parser::GetPageDesc( sal_uInt16 nPoolId, bool bCreate ) pDoc->CopyPageDesc( *pMasterPageDesc, *pNewPageDesc, false ); // Die Vorlagen an ihren neuen Zweck anpassen. - const SwPageDesc *pFollow = 0; + const SwPageDesc *pFollow = nullptr; bool bSetFollowFollow = false; switch( nPoolId ) { @@ -1509,7 +1509,7 @@ void SwCSS1Parser::FillDropCap( SwFormatDrop& rDrop, // Fuer alle anderen Attribute eine Zeichen-Vorlage anlegen if( rItemSet.Count() ) { - SwCharFormat *pCFormat = 0; + SwCharFormat *pCFormat = nullptr; OUString aName; if( pName ) { @@ -1545,7 +1545,7 @@ void SwCSS1Parser::FillDropCap( SwFormatDrop& rDrop, _HTMLAttr **SwHTMLParser::GetAttrTabEntry( sal_uInt16 nWhich ) { // den zu dem Item gehoehrenden Tabellen-Eintrag ermitteln ... - _HTMLAttr **ppAttr = 0; + _HTMLAttr **ppAttr = nullptr; switch( nWhich ) { case RES_CHRATR_BLINK: @@ -1721,7 +1721,7 @@ bool SwHTMLParser::FileDownload( const OUString& rURL, { // wurde der Import vom SFX abgebrochen? eState = SVPAR_ERROR; - pStream = 0; + pStream = nullptr; } // recreate View @@ -1729,7 +1729,7 @@ bool SwHTMLParser::FileDownload( const OUString& rURL, OSL_ENSURE( pOldVSh == pVSh, "FileDownload: SwViewShell changed on us" ); (void) pVSh; - return pStream!=0; + return pStream!=nullptr; } void SwHTMLParser::InsertLink() @@ -2131,7 +2131,7 @@ _HTMLAttrContext *SwHTMLParser::PopContext( sal_uInt16 nToken, sal_uInt16 nLimit { _HTMLAttrContexts::size_type nPos = m_aContexts.size(); if( nPos <= m_nContextStMin ) - return 0; + return nullptr; bool bFound = 0==nToken; if( nToken ) @@ -2156,7 +2156,7 @@ _HTMLAttrContext *SwHTMLParser::PopContext( sal_uInt16 nToken, sal_uInt16 nLimit nPos--; } - _HTMLAttrContext *pCntxt = 0; + _HTMLAttrContext *pCntxt = nullptr; if( bFound ) { pCntxt = m_aContexts[nPos]; @@ -2287,7 +2287,7 @@ void SwHTMLParser::InsertParaAttrs( const SfxItemSet& rItemSet ) if( RES_PARATR_BEGIN > nWhich ) (*ppAttr)->SetLikePara(); m_aParaAttrs.push_back( *ppAttr ); - bool bSuccess = EndAttr( *ppAttr, 0, false ); + bool bSuccess = EndAttr( *ppAttr, nullptr, false ); if (!bSuccess) m_aParaAttrs.pop_back(); } diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index e333bb78c52c..669a46862d44 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -62,7 +62,7 @@ class _HTMLAttrContext_SaveDoc public: _HTMLAttrContext_SaveDoc() : - pPos( 0 ), pAttrTab( 0 ), + pPos( nullptr ), pAttrTab( nullptr ), nContextStMin( SIZE_MAX ), nContextStAttrMin( SIZE_MAX ), bStripTrailingPara( false ), bKeepNumRules( false ), bFixHeaderDist( false ), bFixFooterDist( false ) @@ -120,7 +120,7 @@ _HTMLAttrContext_SaveDoc *_HTMLAttrContext::GetSaveDocContext( bool bCreate ) void _HTMLAttrContext::ClearSaveDocContext() { delete pSaveDocContext; - pSaveDocContext = 0; + pSaveDocContext = nullptr; } void SwHTMLParser::SplitAttrTab( const SwPosition& rNewPos ) @@ -212,7 +212,7 @@ void SwHTMLParser::SplitAttrTab( const SwPosition& rNewPos ) pAttr->nEndPara = rNewSttPara; pAttr->nSttContent = nNewSttCnt; pAttr->nEndContent = nNewSttCnt; - pAttr->pPrev = 0; + pAttr->pPrev = nullptr; pAttr = pNext; } @@ -522,7 +522,7 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet, const SfxPoolItem *pItem = aIter.FirstItem(); while( pItem ) { - _HTMLAttr **ppAttr = 0; + _HTMLAttr **ppAttr = nullptr; switch( pItem->Which() ) { @@ -589,7 +589,7 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet, aLRItem.SetTextLeft( nLeft ); aLRItem.SetRight( nRight ); NewAttr( &m_aAttrTab.pLRSpace, aLRItem ); - EndAttr( m_aAttrTab.pLRSpace, 0, false ); + EndAttr( m_aAttrTab.pLRSpace, nullptr, false ); } break; diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx index 4f47da9e8055..b6fa8fddc5b0 100644 --- a/sw/source/filter/html/htmldrawreader.cxx +++ b/sw/source/filter/html/htmldrawreader.cxx @@ -60,14 +60,14 @@ static HTMLOptionEnum aHTMLMarqBehaviorTable[] = { OOO_STRING_SVTOOLS_HTML_BEHAV_scroll, SDRTEXTANI_SCROLL }, { OOO_STRING_SVTOOLS_HTML_BEHAV_alternate, SDRTEXTANI_ALTERNATE }, { OOO_STRING_SVTOOLS_HTML_BEHAV_slide, SDRTEXTANI_SLIDE }, - { 0, 0 } + { nullptr, 0 } }; static HTMLOptionEnum aHTMLMarqDirectionTable[] = { { OOO_STRING_SVTOOLS_HTML_AL_left, SDRTEXTANI_LEFT }, { OOO_STRING_SVTOOLS_HTML_AL_right, SDRTEXTANI_RIGHT }, - { 0, 0 } + { nullptr, 0 } }; void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, @@ -561,7 +561,7 @@ void SwHTMLParser::EndMarquee() } m_aContents.clear(); - m_pMarquee = 0; + m_pMarquee = nullptr; } void SwHTMLParser::InsertMarqueeText() diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx index 0a84e1dc3ffd..f879cf3c7b17 100644 --- a/sw/source/filter/html/htmldrawwriter.cxx +++ b/sw/source/filter/html/htmldrawwriter.cxx @@ -66,7 +66,7 @@ const sal_uInt32 HTML_FRMOPTS_MARQUEE_CSS1 = const SdrObject *SwHTMLWriter::GetMarqueeTextObj( const SwDrawFrameFormat& rFormat ) { const SdrObject* pObj = rFormat.FindSdrObject(); - return (pObj && ::IsMarqueeTextObj( *pObj )) ? pObj : 0; + return (pObj && ::IsMarqueeTextObj( *pObj )) ? pObj : nullptr; } void SwHTMLWriter::GetEEAttrsFromDrwObj( SfxItemSet& rItemSet, @@ -158,7 +158,7 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt, SDRTEXTANI_SLIDE==eAniKind, "Text-Draw-Objekt nicht fuer Marquee geeignet" ); - const sal_Char *pStr = 0; + const sal_Char *pStr = nullptr; switch( eAniKind ) { case SDRTEXTANI_SCROLL: pStr = OOO_STRING_SVTOOLS_HTML_BEHAV_scroll; break; @@ -175,7 +175,7 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt, } // DIRECTION - pStr = 0; + pStr = nullptr; SdrTextAniDirection eAniDir = pTextObj->GetTextAniDirection(); switch( eAniDir ) { @@ -293,7 +293,7 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt, rWrt.Strm().WriteChar( '>' ); // Was jetzt kommt ist das Gegenstueck zu SdrTextObjectt::SetText() - Outliner aOutliner(0, OUTLINERMODE_TEXTOBJECT); + Outliner aOutliner(nullptr, OUTLINERMODE_TEXTOBJECT); aOutliner.SetUpdateMode( false ); aOutliner.SetText( *pOutlinerParaObj ); OUString aText( aOutliner.GetText( aOutliner.GetParagraph(0), diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index f6fcb5d261e0..b4930b16ceaa 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -54,7 +54,7 @@ static HTMLOptionEnum aHTMLFieldTypeTable[] = { OOO_STRING_SW_HTML_FT_docinfo, RES_DOCINFOFLD }, { OOO_STRING_SW_HTML_FT_docstat, RES_DOCSTATFLD }, { OOO_STRING_SW_HTML_FT_filename,RES_FILENAMEFLD }, - { 0, 0 } + { nullptr, 0 } }; static HTMLNumFormatTableEntry aHTMLDateFieldFormatTable[] = @@ -76,7 +76,7 @@ static HTMLNumFormatTableEntry aHTMLDateFieldFormatTable[] = { "MD", NF_DATE_DIN_MMDD }, { "YMD", NF_DATE_DIN_YYMMDD }, { "YYMD", NF_DATE_DIN_YYYYMMDD }, - { 0, NF_NUMERIC_START } + { nullptr, NF_NUMERIC_START } }; static HTMLNumFormatTableEntry aHTMLTimeFieldFormatTable[] = @@ -84,7 +84,7 @@ static HTMLNumFormatTableEntry aHTMLTimeFieldFormatTable[] = { "SYS", NF_TIME_HHMMSS }, { "SSMM24", NF_TIME_HHMM }, { "SSMM12", NF_TIME_HHMMAMPM }, - { 0, NF_NUMERIC_START } + { nullptr, NF_NUMERIC_START } }; static HTMLOptionEnum aHTMLPageNumFieldFormatTable[] = @@ -99,7 +99,7 @@ static HTMLOptionEnum aHTMLPageNumFieldFormatTable[] = { OOO_STRING_SW_HTML_FF_page, SVX_NUM_PAGEDESC }, { OOO_STRING_SW_HTML_FF_ulettern, SVX_NUM_CHARS_UPPER_LETTER_N }, { OOO_STRING_SW_HTML_FF_llettern, SVX_NUM_CHARS_LOWER_LETTER_N }, - { 0, 0 } + { nullptr, 0 } }; static HTMLOptionEnum aHTMLExtUsrFieldSubTable[] = @@ -119,14 +119,14 @@ static HTMLOptionEnum aHTMLExtUsrFieldSubTable[] = { OOO_STRING_SW_HTML_FS_fax, EU_FAX }, { OOO_STRING_SW_HTML_FS_email, EU_EMAIL }, { OOO_STRING_SW_HTML_FS_state, EU_STATE }, - { 0, 0 } + { nullptr, 0 } }; static HTMLOptionEnum aHTMLAuthorFieldFormatTable[] = { { OOO_STRING_SW_HTML_FF_name, AF_NAME }, { OOO_STRING_SW_HTML_FF_shortcut, AF_SHORTCUT }, - { 0, 0 } + { nullptr, 0 } }; static HTMLOptionEnum aHTMLPageNumFieldSubTable[] = @@ -134,7 +134,7 @@ static HTMLOptionEnum aHTMLPageNumFieldSubTable[] = { OOO_STRING_SW_HTML_FS_random, PG_RANDOM }, { OOO_STRING_SW_HTML_FS_next, PG_NEXT }, { OOO_STRING_SW_HTML_FS_prev, PG_PREV }, - { 0, 0 } + { nullptr, 0 } }; // UGLY: these are extensions of nsSwDocInfoSubType (in inc/docufld.hxx) @@ -158,7 +158,7 @@ static HTMLOptionEnum aHTMLDocInfoFieldSubTable[] = { OOO_STRING_SW_HTML_FS_custom, DI_CUSTOM }, { OOO_STRING_SW_HTML_FS_create, DI_CREATE }, { OOO_STRING_SW_HTML_FS_change, DI_CHANGE }, - { 0, 0 } + { nullptr, 0 } }; static HTMLOptionEnum aHTMLDocInfoFieldFormatTable[] = @@ -166,7 +166,7 @@ static HTMLOptionEnum aHTMLDocInfoFieldFormatTable[] = { OOO_STRING_SW_HTML_FF_author, DI_SUB_AUTHOR }, { OOO_STRING_SW_HTML_FF_time, DI_SUB_TIME }, { OOO_STRING_SW_HTML_FF_date, DI_SUB_DATE }, - { 0, 0 } + { nullptr, 0 } }; static HTMLOptionEnum aHTMLDocStatFieldSubTable[] = @@ -178,7 +178,7 @@ static HTMLOptionEnum aHTMLDocStatFieldSubTable[] = { OOO_STRING_SW_HTML_FS_tbl, DS_TBL }, { OOO_STRING_SW_HTML_FS_grf, DS_GRF }, { OOO_STRING_SW_HTML_FS_ole, DS_OLE }, - { 0, 0 } + { nullptr, 0 } }; static HTMLOptionEnum aHTMLFileNameFieldFormatTable[] = @@ -187,7 +187,7 @@ static HTMLOptionEnum aHTMLFileNameFieldFormatTable[] = { OOO_STRING_SW_HTML_FF_pathname, FF_PATHNAME }, { OOO_STRING_SW_HTML_FF_path, FF_PATH }, { OOO_STRING_SW_HTML_FF_name_noext, FF_NAME_NOEXT }, - { 0, 0 } + { nullptr, 0 } }; sal_uInt16 SwHTMLParser::GetNumType( const OUString& rStr, sal_uInt16 nDfltType ) @@ -212,7 +212,7 @@ void SwHTMLParser::NewField() bHasNumFormat = false, bHasNumValue = false; sal_uInt16 nType = 0; OUString aValue, aNumFormat, aNumValue, aName; - const HTMLOption *pSubOption=0, *pFormatOption=0; + const HTMLOption *pSubOption=nullptr, *pFormatOption=nullptr; const HTMLOptions& rHTMLOptions = GetOptions(); size_t i; @@ -285,7 +285,7 @@ void SwHTMLParser::NewField() nWhich = RES_DATETIMEFLD; SwFieldType* pType = m_pDoc->getIDocumentFieldsAccess().GetSysFieldType( nWhich ); - SwField *pNewField = 0; + SwField *pNewField = nullptr; bool bInsOnEndTag = false; switch( (RES_FIELDS)nType ) @@ -564,7 +564,7 @@ void SwHTMLParser::EndField() m_pDoc->getIDocumentContentOperations().InsertPoolItem( *m_pPam, SwFormatField(*m_pField) ); delete m_pField; - m_pField = 0; + m_pField = nullptr; } m_bInField = false; diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index d1847c56d26a..30c822fbdd3e 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -39,7 +39,7 @@ using namespace nsSwDocInfoSubType; const sal_Char *SwHTMLWriter::GetNumFormat( sal_uInt16 nFormat ) { - const sal_Char *pFormatStr = 0; + const sal_Char *pFormatStr = nullptr; switch( (SvxExtNumType)nFormat ) { @@ -69,9 +69,9 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, sal_uInt16 nField = pFieldTyp->Which(); sal_uLong nFormat = pField->GetFormat(); - const sal_Char *pTypeStr=0, // TYPE - *pSubStr=0, // SUBTYPE - *pFormatStr=0; // FORMAT (SW) + const sal_Char *pTypeStr=nullptr, // TYPE + *pSubStr=nullptr, // SUBTYPE + *pFormatStr=nullptr; // FORMAT (SW) OUString aValue; // VALUE (SW) bool bNumFormat=false; // SDNUM (Number-Formatter-Format) bool bNumValue=false; // SDVAL (Number-Formatter-Value) @@ -174,7 +174,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, case DI_CREATE: pSubStr = OOO_STRING_SW_HTML_FS_create; break; case DI_CHANGE: pSubStr = OOO_STRING_SW_HTML_FS_change; break; case DI_CUSTOM: pSubStr = OOO_STRING_SW_HTML_FS_custom; break; - default: pTypeStr = 0; break; + default: pTypeStr = nullptr; break; } if( DI_CUSTOM == nSubType ) { @@ -232,7 +232,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, case DS_TBL: pSubStr = OOO_STRING_SW_HTML_FS_tbl; break; case DS_GRF: pSubStr = OOO_STRING_SW_HTML_FS_grf; break; case DS_OLE: pSubStr = OOO_STRING_SW_HTML_FS_ole; break; - default: pTypeStr = 0; break; + default: pTypeStr = nullptr; break; } pFormatStr = SwHTMLWriter::GetNumFormat( static_cast< sal_uInt16 >(nFormat) ); } @@ -343,7 +343,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, { RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONTSIZE, RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT }; - sal_uInt16 *pRefWhichIds = 0; + sal_uInt16 *pRefWhichIds = nullptr; switch( rHTMLWrt.m_nCSS1Script ) { case CSS1_OUTMODE_WESTERN: @@ -369,7 +369,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, if( nScript != CSS1_OUTMODE_ANY_SCRIPT && /* #108791# */ nScript != rHTMLWrt.m_nCSS1Script ) { - sal_uInt16 *pWhichIds = 0; + sal_uInt16 *pWhichIds = nullptr; switch( nScript ) { case CSS1_OUTMODE_WESTERN: pWhichIds = aWesternWhichIds; break; @@ -523,7 +523,7 @@ Writer& OutHTML_SwFormatField( Writer& rWrt, const SfxPoolItem& rHt ) // sonst ist es der Script-Inhalt selbst. Da nur noh JavaScript // in Feldern landet, muss es sich um JavaSrript handeln ...:) HTMLOutFuncs::OutScript( rWrt.Strm(), rWrt.GetBaseURL(), aContents, rType, JAVASCRIPT, - aURL, 0, 0, rHTMLWrt.m_eDestEnc, &rHTMLWrt.m_aNonConvertableCharacters ); + aURL, nullptr, nullptr, rHTMLWrt.m_eDestEnc, &rHTMLWrt.m_aNonConvertableCharacters ); if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine( true ); diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 084bd97f6752..2defd045c41e 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -148,14 +148,14 @@ static HTMLOutEvent aImageEventTable[] = { OOO_STRING_SVTOOLS_HTML_O_SDonload, OOO_STRING_SVTOOLS_HTML_O_onload, SVX_EVENT_IMAGE_LOAD }, { OOO_STRING_SVTOOLS_HTML_O_SDonabort, OOO_STRING_SVTOOLS_HTML_O_onabort, SVX_EVENT_IMAGE_ABORT }, { OOO_STRING_SVTOOLS_HTML_O_SDonerror, OOO_STRING_SVTOOLS_HTML_O_onerror, SVX_EVENT_IMAGE_ERROR }, - { 0, 0, 0 } + { nullptr, nullptr, 0 } }; static HTMLOutEvent aIMapEventTable[] = { { OOO_STRING_SVTOOLS_HTML_O_SDonmouseover, OOO_STRING_SVTOOLS_HTML_O_onmouseover, SFX_EVENT_MOUSEOVER_OBJECT }, { OOO_STRING_SVTOOLS_HTML_O_SDonmouseout, OOO_STRING_SVTOOLS_HTML_O_onmouseout, SFX_EVENT_MOUSEOUT_OBJECT }, - { 0, 0, 0 } + { nullptr, nullptr, 0 } }; sal_uInt16 SwHTMLWriter::GuessFrmType( const SwFrameFormat& rFrameFormat, @@ -293,12 +293,12 @@ void SwHTMLWriter::CollectFlyFrms() OSL_ENSURE( HTML_CFG_MAX+1 == MAX_BROWSERS, "number of browser configurations has changed" ); - SwPosFlyFrms aFlyPos(pDoc->GetAllFlyFormats(bWriteAll ? 0 : pCurPam, true)); + SwPosFlyFrms aFlyPos(pDoc->GetAllFlyFormats(bWriteAll ? nullptr : pCurPam, true)); for(SwPosFlyFrms::const_iterator aIter(aFlyPos.begin()); aIter != aFlyPos.end(); ++aIter) { const SwFrameFormat& rFrameFormat = (*aIter)->GetFormat(); - const SdrObject *pSdrObj = 0; + const SdrObject *pSdrObj = nullptr; const SwPosition *pAPos; const SwContentNode *pACNd; SwHTMLFrmType eType = (SwHTMLFrmType)GuessFrmType( rFrameFormat, pSdrObj ); @@ -318,8 +318,8 @@ void SwHTMLWriter::CollectFlyFrms() // Absatz geschrieben, wenn der Absatz einen Abstand // hat. if( text::RelOrientation::FRAME == eHoriRel && - (pAPos = rAnchor.GetContentAnchor()) != 0 && - (pACNd = pAPos->nNode.GetNode().GetContentNode()) != 0 ) + (pAPos = rAnchor.GetContentAnchor()) != nullptr && + (pACNd = pAPos->nNode.GetNode().GetContentNode()) != nullptr ) { const SvxLRSpaceItem& rLRItem = static_cast<const SvxLRSpaceItem&>(pACNd->GetAttr(RES_LR_SPACE)); @@ -387,7 +387,7 @@ bool SwHTMLWriter::OutFlyFrm( sal_uLong nNdIdx, sal_Int32 nContentIdx, sal_uInt8 if( m_pHTMLPosFlyFrms->empty() ) { delete m_pHTMLPosFlyFrms; - m_pHTMLPosFlyFrms = 0; + m_pHTMLPosFlyFrms = nullptr; bRestart = true; // nicht wirklich, nur raus // aus der Schleife } @@ -395,7 +395,7 @@ bool SwHTMLWriter::OutFlyFrm( sal_uLong nNdIdx, sal_Int32 nContentIdx, sal_uInt8 if( pContext ) { HTMLOutFuncs::FlushToAscii(Strm(), *pContext ); - pContext = 0; // one time only + pContext = nullptr; // one time only } OutFrameFormat( pPosFly->GetOutMode(), pPosFly->GetFormat(), @@ -426,7 +426,7 @@ void SwHTMLWriter::OutFrameFormat( sal_uInt8 nMode, const SwFrameFormat& rFrameF { sal_uInt8 nCntnrMode = SwHTMLPosFlyFrm::GetOutCntnr( nMode ); sal_uInt8 nOutMode = SwHTMLPosFlyFrm::GetOutFn(nMode); - const sal_Char *pCntnrStr = 0; + const sal_Char *pCntnrStr = nullptr; if( HTML_CNTNR_NONE != nCntnrMode ) { @@ -468,13 +468,13 @@ void SwHTMLWriter::OutFrameFormat( sal_uInt8 nMode, const SwFrameFormat& rFrameF OutHTML_FrameFormatTableNode( *this, rFrameFormat ); break; case HTML_OUT_GRFNODE: // OK - OutHTML_FrameFormatGrfNode( *this, rFrameFormat, pCntnrStr != 0 ); + OutHTML_FrameFormatGrfNode( *this, rFrameFormat, pCntnrStr != nullptr ); break; case HTML_OUT_OLENODE: // OK - OutHTML_FrameFormatOLENode( *this, rFrameFormat, pCntnrStr != 0 ); + OutHTML_FrameFormatOLENode( *this, rFrameFormat, pCntnrStr != nullptr ); break; case HTML_OUT_OLEGRF: // OK - OutHTML_FrameFormatOLENodeGrf( *this, rFrameFormat, pCntnrStr != 0 ); + OutHTML_FrameFormatOLENodeGrf( *this, rFrameFormat, pCntnrStr != nullptr ); break; case HTML_OUT_DIV: case HTML_OUT_SPAN: @@ -482,7 +482,7 @@ void SwHTMLWriter::OutFrameFormat( sal_uInt8 nMode, const SwFrameFormat& rFrameF OutHTML_FrameFormatAsDivOrSpan( *this, rFrameFormat, HTML_OUT_SPAN==nOutMode ); break; case HTML_OUT_MULTICOL: // OK - OutHTML_FrameFormatAsMulticol( *this, rFrameFormat, pCntnrStr != 0 ); + OutHTML_FrameFormatAsMulticol( *this, rFrameFormat, pCntnrStr != nullptr ); break; case HTML_OUT_SPACER: // OK OSL_ENSURE( !pCntnrStr, "Spacer: Container ist hier nicht vorgesehen" ); @@ -491,7 +491,7 @@ void SwHTMLWriter::OutFrameFormat( sal_uInt8 nMode, const SwFrameFormat& rFrameF case HTML_OUT_CONTROL: // OK OutHTML_DrawFrameFormatAsControl( *this, static_cast<const SwDrawFrameFormat &>(rFrameFormat), dynamic_cast<const SdrUnoObj&>(*pSdrObject), - pCntnrStr != 0 ); + pCntnrStr != nullptr ); break; case HTML_OUT_AMARQUEE: OutHTML_FrameFormatAsMarquee( *this, rFrameFormat, *pSdrObject ); @@ -502,7 +502,7 @@ void SwHTMLWriter::OutFrameFormat( sal_uInt8 nMode, const SwFrameFormat& rFrameF static_cast<const SwDrawFrameFormat &>(rFrameFormat), *pSdrObject ); break; case HTML_OUT_GRFFRM: - OutHTML_FrameFormatAsImage( *this, rFrameFormat, pCntnrStr != 0 ); + OutHTML_FrameFormatAsImage( *this, rFrameFormat, pCntnrStr != nullptr ); break; } @@ -560,7 +560,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, } // ALIGN - const sal_Char *pStr = 0; + const sal_Char *pStr = nullptr; RndStdIds eAnchorId = rFrameFormat.GetAnchor().GetAnchorId(); if( (nFrmOpts & HTML_FRMOPT_ALIGN) && ((FLY_AT_PARA == eAnchorId) || (FLY_AT_CHAR == eAnchorId)) ) @@ -745,7 +745,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, { const SwFormatSurround* pSurround = static_cast<const SwFormatSurround*>(pItem); sal_Int16 eHoriOri = rFrameFormat.GetHoriOrient().GetHoriOrient(); - pStr = 0; + pStr = nullptr; SwSurround eSurround = pSurround->GetSurround(); bool bAnchorOnly = pSurround->IsAnchorOnly(); switch( eHoriOri ) @@ -832,7 +832,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma } // align - const sal_Char* pAlignString = 0; + const sal_Char* pAlignString = nullptr; RndStdIds eAnchorId = rFrameFormat.GetAnchor().GetAnchorId(); if( (nFrameOptions & HTML_FRMOPT_ALIGN) && ((FLY_AT_PARA == eAnchorId) || (FLY_AT_CHAR == eAnchorId)) ) @@ -1005,7 +1005,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma (FLY_AT_CHAR == rFrameFormat.GetAnchor().GetAnchorId())) && SfxItemState::SET == rItemSet.GetItemState( RES_SURROUND, true, &pItem )) { - const sal_Char* pSurroundString = 0; + const sal_Char* pSurroundString = nullptr; const SwFormatSurround* pSurround = static_cast<const SwFormatSurround*>(pItem); sal_Int16 eHoriOri = rFrameFormat.GetHoriOrient().GetHoriOrient(); @@ -1164,7 +1164,7 @@ OUString lclWriteOutImap(SwHTMLWriter& rHTMLWrt, const SfxItemSet& rItemSet, con rHTMLWrt.m_aImgMapNames.push_back(aIMapName); OString aIndMap, aIndArea; - const sal_Char *pIndArea = 0, *pIndMap = 0; + const sal_Char *pIndArea = nullptr, *pIndMap = nullptr; if (rHTMLWrt.m_bLFPossible) { @@ -1222,7 +1222,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrameFormat &rFrameFormat, const SfxPoolItem* pItem; const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); - const SwFormatURL* pURLItem = 0; + const SwFormatURL* pURLItem = nullptr; OUString aIMapName = lclWriteOutImap(rHTMLWrt, rItemSet, rFrameFormat, rRealSize, pAltImgMap, pURLItem); // put img into new line @@ -1238,7 +1238,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrameFormat &rFrameFormat, } // URL -> <a>...<img ... >...</a> - const SvxMacroItem *pMacItem = 0; + const SvxMacroItem *pMacItem = nullptr; if (SfxItemState::SET == rItemSet.GetItemState(RES_FRMMACRO, true, &pItem)) { pMacItem = static_cast<const SvxMacroItem *>(pItem); @@ -1298,7 +1298,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrameFormat &rFrameFormat, Size aTwipBorder( 0, 0 ); const SvxBoxItem* pBoxItem = static_cast<const SvxBoxItem*>(pItem); - const ::editeng::SvxBorderLine *pColBorderLine = 0; + const ::editeng::SvxBorderLine *pColBorderLine = nullptr; const ::editeng::SvxBorderLine *pBorderLine = pBoxItem->GetLeft(); if( pBorderLine ) { @@ -1609,7 +1609,7 @@ static Writer& OutHTML_FrameFormatAsDivOrSpan( Writer& rWrt, { SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); - const sal_Char *pStr = 0; + const sal_Char *pStr = nullptr; if( !bSpan ) { rHTMLWrt.ChangeParaToken( 0 ); @@ -1682,7 +1682,7 @@ static Writer & OutHTML_FrameFormatAsImage( Writer& rWrt, const SwFrameFormat& r Size aSz( 0, 0 ); OutHTML_Image( rWrt, rFrameFormat, aGraphic, rFrameFormat.GetName(), aSz, HTML_FRMOPTS_GENIMG, "frame", - aIMap.GetIMapObjectCount() ? &aIMap : 0 ); + aIMap.GetIMapObjectCount() ? &aIMap : nullptr ); return rWrt; } @@ -1916,10 +1916,10 @@ void SwHTMLWriter::CollectLinkTargets() { const SwTextNode* pTextNd; - if( 0 != (pINetFormat = static_cast<const SwFormatINetFormat*>(pDoc->GetAttrPool().GetItem2( + if( nullptr != (pINetFormat = static_cast<const SwFormatINetFormat*>(pDoc->GetAttrPool().GetItem2( RES_TXTATR_INETFMT, n ) ) ) && - 0 != ( pTextAttr = pINetFormat->GetTextINetFormat()) && - 0 != ( pTextNd = pTextAttr->GetpTextNode() ) && + nullptr != ( pTextAttr = pINetFormat->GetTextINetFormat()) && + nullptr != ( pTextNd = pTextAttr->GetpTextNode() ) && pTextNd->GetNodes().IsDocNodes() ) { AddLinkTarget( pINetFormat->GetValue() ); @@ -1930,7 +1930,7 @@ void SwHTMLWriter::CollectLinkTargets() nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_URL ); for( n = 0; n < nMaxItems; ++n ) { - if( 0 != (pURL = static_cast<const SwFormatURL*>(pDoc->GetAttrPool().GetItem2( + if( nullptr != (pURL = static_cast<const SwFormatURL*>(pDoc->GetAttrPool().GetItem2( RES_URL, n ) ) ) ) { AddLinkTarget( pURL->GetURL() ); diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index f9c5ded4e078..94794a79faa3 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -88,7 +88,7 @@ static HTMLOptionEnum aHTMLFormMethodTable[] = { { OOO_STRING_SVTOOLS_HTML_METHOD_get, FormSubmitMethod_GET }, { OOO_STRING_SVTOOLS_HTML_METHOD_post, FormSubmitMethod_POST }, - { 0, 0 } + { nullptr, 0 } }; static HTMLOptionEnum aHTMLFormEncTypeTable[] = @@ -96,7 +96,7 @@ static HTMLOptionEnum aHTMLFormEncTypeTable[] = { OOO_STRING_SVTOOLS_HTML_ET_url, FormSubmitEncoding_URL }, { OOO_STRING_SVTOOLS_HTML_ET_multipart, FormSubmitEncoding_MULTIPART }, { OOO_STRING_SVTOOLS_HTML_ET_text, FormSubmitEncoding_TEXT }, - { 0, 0 } + { nullptr, 0 } }; enum HTMLWordWrapMode { HTML_WM_OFF, HTML_WM_HARD, HTML_WM_SOFT }; @@ -108,7 +108,7 @@ static HTMLOptionEnum aHTMLTextAreaWrapTable[] = { OOO_STRING_SVTOOLS_HTML_WW_soft, HTML_WM_SOFT }, { OOO_STRING_SVTOOLS_HTML_WW_physical,HTML_WM_HARD }, { OOO_STRING_SVTOOLS_HTML_WW_virtual, HTML_WM_SOFT }, - { 0, 0 } + { nullptr, 0 } }; HTMLEventType aEventTypeTable[] = @@ -157,7 +157,7 @@ const sal_Char * aEventSDOptionTable[] = OOO_STRING_SVTOOLS_HTML_O_SDonclick, OOO_STRING_SVTOOLS_HTML_O_SDonclick, OOO_STRING_SVTOOLS_HTML_O_SDonchange, - 0 + nullptr }; const sal_Char * aEventOptionTable[] = @@ -169,7 +169,7 @@ const sal_Char * aEventOptionTable[] = OOO_STRING_SVTOOLS_HTML_O_onclick, OOO_STRING_SVTOOLS_HTML_O_onclick, OOO_STRING_SVTOOLS_HTML_O_onchange, - 0 + nullptr }; class SwHTMLForm_Impl @@ -200,7 +200,7 @@ class SwHTMLForm_Impl public: explicit SwHTMLForm_Impl( SwDocShell *pDSh ) : pDocSh( pDSh ), - pHeaderAttrs( pDSh ? pDSh->GetHeaderAttributes() : 0 ) + pHeaderAttrs( pDSh ? pDSh->GetHeaderAttributes() : nullptr ) { OSL_ENSURE( pDocSh, "Keine DocShell, keine Controls" ); } @@ -222,7 +222,7 @@ public: xFormComps = r; } - void ReleaseFormComps() { xFormComps = 0; xControlEventManager = 0; } + void ReleaseFormComps() { xFormComps = nullptr; xControlEventManager = nullptr; } const uno::Reference< beans::XPropertySet >& GetFCompPropSet() const { @@ -234,7 +234,7 @@ public: xFCompPropSet = r; } - void ReleaseFCompPropSet() { xFCompPropSet = 0; } + void ReleaseFCompPropSet() { xFCompPropSet = nullptr; } const uno::Reference< drawing::XShape >& GetShape() const { return xShape; } void SetShape( const uno::Reference< drawing::XShape >& r ) { xShape = r; } @@ -511,7 +511,7 @@ void SwHTMLImageWatcher::init( sal_Int32 Width, sal_Int32 Height ) SwXShape *pSwShape = xTunnel.is() ? reinterpret_cast< SwXShape * >( sal::static_int_cast< sal_IntPtr>( xTunnel->getSomething(SwXShape::getUnoTunnelId()) )) - : 0; + : nullptr; OSL_ENSURE( pSwShape, "Wo ist das SW-Shape?" ); if( pSwShape ) @@ -523,8 +523,8 @@ void SwHTMLImageWatcher::init( sal_Int32 Width, sal_Int32 Height ) SwNode *pANd; SwTableNode *pTableNd; if( pAPos && - 0 != (pANd = & pAPos->nNode.GetNode()) && - 0 != (pTableNd = pANd->FindTableNode()) ) + nullptr != (pANd = & pAPos->nNode.GetNode()) && + nullptr != (pTableNd = pANd->FindTableNode()) ) { const bool bLastGrf = !pTableNd->GetTable().DecGrfsThatResize(); SwHTMLTableLayout *pLayout = @@ -548,7 +548,7 @@ void SwHTMLImageWatcher::init( sal_Int32 Width, sal_Int32 Height ) // uns selbst abmelden und loeschen clear(); uno::Reference< awt::XImageConsumer > xTmp = static_cast<awt::XImageConsumer*>(this); - xThis = 0; + xThis = nullptr; } void SwHTMLImageWatcher::setColorModel( @@ -581,7 +581,7 @@ void SwHTMLImageWatcher::complete( sal_Int32 Status, // uns selbst abmelden und loeschen clear(); uno::Reference< awt::XImageConsumer > xTmp = static_cast<awt::XImageConsumer*>(this); - xThis = 0; + xThis = nullptr; } } @@ -595,14 +595,14 @@ void SwHTMLImageWatcher::disposing(const lang::EventObject& evt) throw ( uno::Ru { clear(); xTmp = static_cast<awt::XImageConsumer*>(this); - xThis = 0; + xThis = nullptr; } } void SwHTMLParser::DeleteFormImpl() { delete m_pFormImpl; - m_pFormImpl = 0; + m_pFormImpl = nullptr; } static void lcl_html_setFixedFontProperty( @@ -659,7 +659,7 @@ void SwHTMLParser::SetControlSize( const uno::Reference< drawing::XShape >& rSha { // if there is no hidden property in the MediaDescriptor it should be removed after loading const SfxBoolItem* pHiddenItem = SfxItemSet::GetItem<SfxBoolItem>(pDocSh->GetMedium()->GetItemSet(), SID_HIDDEN, false); - m_bRemoveHidden = ( pHiddenItem == NULL || !pHiddenItem->GetValue() ); + m_bRemoveHidden = ( pHiddenItem == nullptr || !pHiddenItem->GetValue() ); } m_pTempViewFrame = SfxViewFrame::LoadHiddenDocument( *pDocSh, 0 ); @@ -672,20 +672,20 @@ void SwHTMLParser::SetControlSize( const uno::Reference< drawing::XShape >& rSha SwXShape *pSwShape = xTunnel.is() ? reinterpret_cast< SwXShape *>( sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXShape::getUnoTunnelId()) )) - : 0; + : nullptr; OSL_ENSURE( pSwShape, "Wo ist das SW-Shape?" ); // es muss ein Draw-Format sein - SwFrameFormat *pFrameFormat = pSwShape ? pSwShape->GetFrameFormat() : NULL ; + SwFrameFormat *pFrameFormat = pSwShape ? pSwShape->GetFrameFormat() : nullptr ; OSL_ENSURE( pFrameFormat && RES_DRAWFRMFMT == pFrameFormat->Which(), "Kein DrawFrameFormat" ); // Schauen, ob es ein SdrObject dafuer gibt - const SdrObject *pObj = pFrameFormat ? pFrameFormat->FindSdrObject() : NULL; + const SdrObject *pObj = pFrameFormat ? pFrameFormat->FindSdrObject() : nullptr; OSL_ENSURE( pObj, "SdrObject nicht gefunden" ); OSL_ENSURE( pObj && FmFormInventor == pObj->GetObjInventor(), "falscher Inventor" ); - const SdrView* pDrawView = pVSh ? pVSh->GetDrawView() : 0; + const SdrView* pDrawView = pVSh ? pVSh->GetDrawView() : nullptr; const SdrUnoObj *pFormObj = dynamic_cast<const SdrUnoObj*>( pObj ); uno::Reference< awt::XControl > xControl; @@ -1397,7 +1397,7 @@ void SwHTMLParser::EndForm( bool bAppend ) void SwHTMLParser::InsertInput() { - assert(m_pPendStack == 0); + assert(m_pPendStack == nullptr); if( !m_pFormImpl || !m_pFormImpl->GetFormComps().is() ) return; @@ -1824,7 +1824,7 @@ void SwHTMLParser::InsertInput() { aSz.Width() = HTML_DFLT_IMG_WIDTH; bSetGrfWidth = true; - if( m_pTable != 0 ) + if( m_pTable != nullptr ) IncGrfsThatResizeTable(); } if( !aSz.Height() ) @@ -1878,7 +1878,7 @@ void SwHTMLParser::InsertInput() void SwHTMLParser::NewTextArea() { - assert(m_pPendStack == 0); + assert(m_pPendStack == nullptr); OSL_ENSURE( !m_bTextArea, "TextArea in TextArea???" ); OSL_ENSURE( !m_pFormImpl || !m_pFormImpl->GetFCompPropSet().is(), @@ -2161,7 +2161,7 @@ void SwHTMLParser::InsertTextAreaText( sal_uInt16 nToken ) void SwHTMLParser::NewSelect() { - assert(m_pPendStack == 0); + assert(m_pPendStack == nullptr); OSL_ENSURE( !m_bSelect, "Select in Select???" ); OSL_ENSURE( !m_pFormImpl || !m_pFormImpl->GetFCompPropSet().is(), @@ -2375,7 +2375,7 @@ void SwHTMLParser::NewSelect() void SwHTMLParser::EndSelect() { - assert(m_pPendStack == 0); + assert(m_pPendStack == nullptr); OSL_ENSURE( m_bSelect, "keine Select" ); OSL_ENSURE( m_pFormImpl && m_pFormImpl->GetFCompPropSet().is(), diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index f0c7c96573d8..37a8a73ee162 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -152,7 +152,7 @@ static void lcl_html_outEvents( SvStream& rStrm, sListener = sListener.getToken( nTok-1, '.' ); OUString sMethod( pDescs[i].EventMethod ); - const sal_Char *pOpt = 0; + const sal_Char *pOpt = nullptr; for( int j=0; aEventListenerTable[j]; j++ ) { if( sListener.equalsAscii( aEventListenerTable[j] ) && @@ -266,7 +266,7 @@ void SwHTMLWriter::OutForm( bool bTag_On, const SwStartNode *pStartNd ) // Tabelle/dem Bereich liegen uno::Reference< container::XIndexContainer > xCurrentFormComps;// die aktuelle Form in der Tabelle - const SwStartNode *pCurrentStNd = 0; // und der Start-Node eines Ctrls + const SwStartNode *pCurrentStNd = nullptr; // und der Start-Node eines Ctrls sal_Int32 nCurrentCtrls = 0; // und die in ihr gefundenen Controls sal_uInt32 nEndIdx = pStartNd->EndOfSectionIndex(); for( ; i < m_aHTMLControls.size() && @@ -500,7 +500,7 @@ void SwHTMLWriter::OutForm( bool bOn, { form::FormSubmitEncoding eEncType = *static_cast<form::FormSubmitEncoding const *>(aTmp.getValue()); - const sal_Char *pStr = 0; + const sal_Char *pStr = nullptr; switch( eEncType ) { case form::FormSubmitEncoding_MULTIPART: @@ -637,7 +637,7 @@ const SdrObject *SwHTMLWriter::GetHTMLControl( const SwDrawFrameFormat& rFormat // Schauen, ob es ein SdrObject dafuer gibt const SdrObject *pObj = rFormat.FindSdrObject(); if( !pObj || FmFormInventor != pObj->GetObjInventor() ) - return 0; + return nullptr; const SdrUnoObj& rFormObj = dynamic_cast<const SdrUnoObj&>(*pObj); uno::Reference< awt::XControlModel > xControlModel = @@ -645,13 +645,13 @@ const SdrObject *SwHTMLWriter::GetHTMLControl( const SwDrawFrameFormat& rFormat OSL_ENSURE( xControlModel.is(), "UNO-Control ohne Model" ); if( !xControlModel.is() ) - return 0; + return nullptr; uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY ); OUString sPropName("ClassId"); if( !xPropSet->getPropertySetInfo()->hasPropertyByName( sPropName ) ) - return 0; + return nullptr; uno::Any aTmp = xPropSet->getPropertyValue( sPropName ); if( aTmp.getValueType() == ::cppu::UnoType<sal_Int16>::get()&& @@ -660,7 +660,7 @@ const SdrObject *SwHTMLWriter::GetHTMLControl( const SwDrawFrameFormat& rFormat return pObj; } - return 0; + return nullptr; } static void GetControlSize(const SdrUnoObj& rFormObj, Size& rSz, SwDoc *pDoc) @@ -846,7 +846,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, (aTmp.getValueType() == cppu::UnoType<bool>::get() && !*static_cast<sal_Bool const *>(aTmp.getValue())) ) { - const sal_Char *pWrapStr = 0; + const sal_Char *pWrapStr = nullptr; aTmp = xPropSet->getPropertyValue( "HardLineBreaks" ); pWrapStr = (aTmp.getValueType() == cppu::UnoType<bool>::get() && @@ -1158,7 +1158,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, sal_Int32 nCnt = aList.getLength(); const OUString *pStrings = aList.getConstArray(); - const OUString *pValues = 0; + const OUString *pValues = nullptr; sal_Int32 nValCnt = 0; aTmp = xPropSet->getPropertyValue( "ListSource" ); uno::Sequence<OUString> aValList; @@ -1170,7 +1170,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, } uno::Any aSelTmp = xPropSet->getPropertyValue( "DefaultSelection" ); - const sal_Int16 *pSels = 0; + const sal_Int16 *pSels = nullptr; sal_Int32 nSel = 0; sal_Int32 nSelCnt = 0; uno::Sequence<sal_Int16> aSelList; diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx index 06a6aa837ef6..314a515f2e8a 100644 --- a/sw/source/filter/html/htmlftn.cxx +++ b/sw/source/filter/html/htmlftn.cxx @@ -228,12 +228,12 @@ void SwHTMLParser::InsertFootEndNoteText() void SwHTMLParser::DeleteFootEndNoteImpl() { delete m_pFootEndNoteImpl; - m_pFootEndNoteImpl = 0; + m_pFootEndNoteImpl = nullptr; } SwNodeIndex *SwHTMLParser::GetFootEndNoteSection( const OUString& rName ) { - SwNodeIndex *pStartNodeIdx = 0; + SwNodeIndex *pStartNodeIdx = nullptr; if( m_pFootEndNoteImpl ) { @@ -250,7 +250,7 @@ SwNodeIndex *SwHTMLParser::GetFootEndNoteSection( const OUString& rName ) if(m_pFootEndNoteImpl->aNames.empty()) { delete m_pFootEndNoteImpl; - m_pFootEndNoteImpl = 0; + m_pFootEndNoteImpl = nullptr; } break; @@ -386,7 +386,7 @@ void SwHTMLWriter::OutFootEndNotes() else m_nFootNote++; - m_pFormatFootnote = 0; + m_pFormatFootnote = nullptr; } } @@ -398,13 +398,13 @@ void SwHTMLWriter::OutFootEndNotes() #endif delete m_pFootEndNotes; - m_pFootEndNotes = 0; + m_pFootEndNotes = nullptr; m_nFootNote = m_nEndNote = 0; } OUString SwHTMLWriter::GetFootEndNoteSym( const SwFormatFootnote& rFormatFootnote ) { - const SwEndNoteInfo * pInfo = 0; + const SwEndNoteInfo * pInfo = nullptr; if( rFormatFootnote.GetNumStr().isEmpty() ) pInfo = rFormatFootnote.IsEndNote() ? &pDoc->GetEndNoteInfo() : &pDoc->GetFootnoteInfo(); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 8bc0b7cf83a2..35dbcf540ddf 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -75,7 +75,7 @@ HTMLOptionEnum aHTMLImgHAlignTable[] = { { OOO_STRING_SVTOOLS_HTML_AL_left, text::HoriOrientation::LEFT }, { OOO_STRING_SVTOOLS_HTML_AL_right, text::HoriOrientation::RIGHT }, - { 0, 0 } + { nullptr, 0 } }; HTMLOptionEnum aHTMLImgVAlignTable[] = @@ -88,7 +88,7 @@ HTMLOptionEnum aHTMLImgVAlignTable[] = { OOO_STRING_SVTOOLS_HTML_VA_bottom, text::VertOrientation::TOP }, { OOO_STRING_SVTOOLS_HTML_VA_baseline, text::VertOrientation::TOP }, { OOO_STRING_SVTOOLS_HTML_VA_absbottom, text::VertOrientation::LINE_BOTTOM }, - { 0, 0 } + { nullptr, 0 } }; ImageMap *SwHTMLParser::FindImageMap( const OUString& rName ) const @@ -119,7 +119,7 @@ void SwHTMLParser::ConnectImageMaps() while( m_nMissingImgMaps > 0 && nIdx < nEndIdx ) { SwNode *pNd = rNds[nIdx + 1]; - if( 0 != (pGrfNd = pNd->GetGrfNode()) ) + if( nullptr != (pGrfNd = pNd->GetGrfNode()) ) { SwFrameFormat *pFormat = pGrfNd->GetFlyFormat(); SwFormatURL aURL( pFormat->GetURL() ); @@ -154,7 +154,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( sal_Int16 eVertOri, const SvxCSS1PropertyInfo &rCSS1PropInfo, SfxItemSet& rFrmItemSet ) { - const SfxItemSet *pCntnrItemSet = 0; + const SfxItemSet *pCntnrItemSet = nullptr; auto i = m_aContexts.size(); while( !pCntnrItemSet && i > m_nContextStMin ) pCntnrItemSet = m_aContexts[--i]->GetFrmItemSet(); @@ -236,7 +236,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( sal_Int16 eVertOri, { NewAttr( &m_aAttrTab.pULSpace, SvxULSpaceItem( 0, nLower, RES_UL_SPACE ) ); m_aParaAttrs.push_back( m_aAttrTab.pULSpace ); - EndAttr( m_aAttrTab.pULSpace, 0, false ); + EndAttr( m_aAttrTab.pULSpace, nullptr, false ); } } @@ -293,7 +293,7 @@ void SwHTMLParser::GetDefaultScriptType( ScriptType& rType, { SwDocShell *pDocSh = m_pDoc->GetDocShell(); SvKeyValueIterator* pHeaderAttrs = pDocSh ? pDocSh->GetHeaderAttributes() - : 0; + : nullptr; rType = GetScriptType( pHeaderAttrs ); rTypeStr = GetScriptTypeString( pHeaderAttrs ); } @@ -507,8 +507,8 @@ IMAGE_SETEVENT: nVBorderWidth = (long)nBorder; SvxCSS1Parser::PixelToTwip( nVBorderWidth, nHBorderWidth ); - ::editeng::SvxBorderLine aHBorderLine( NULL, nHBorderWidth ); - ::editeng::SvxBorderLine aVBorderLine( NULL, nVBorderWidth ); + ::editeng::SvxBorderLine aHBorderLine( nullptr, nHBorderWidth ); + ::editeng::SvxBorderLine aVBorderLine( nullptr, nVBorderWidth ); if( m_aAttrTab.pINetFormat ) { @@ -601,7 +601,7 @@ IMAGE_SETEVENT: // Wenn die Grfik in einer Tabelle steht, wird sie gleich // angefordert, damit sie eventuell schon da ist, bevor die // Tabelle layoutet wird. - if( m_pTable!=0 && !nWidth ) + if( m_pTable!=nullptr && !nWidth ) { bRequestGrfNow = true; IncGrfsThatResizeTable(); @@ -724,7 +724,7 @@ IMAGE_SETEVENT: // passing empty sGrfNm here, means we don't want the graphic to be linked SwFrameFormat *pFlyFormat = m_pDoc->getIDocumentContentOperations().Insert( *m_pPam, sGrfNm, aEmptyOUStr, &aGraphic, - &aFrmSet, NULL, NULL ); + &aFrmSet, nullptr, nullptr ); SwGrfNode *pGrfNd = m_pDoc->GetNodes()[ pFlyFormat->GetContent().GetContentIdx() ->GetIndex()+1 ]->GetGrfNode(); @@ -776,7 +776,7 @@ IMAGE_SETEVENT: for( int n = 0; aEvents[ n ]; ++n ) { const SvxMacro *pMacro = rINetFormat.GetMacro( aEvents[ n ] ); - if( 0 != pMacro ) + if( nullptr != pMacro ) aMacroItem.SetMacro( aEvents[ n ], *pMacro ); } } @@ -974,11 +974,11 @@ void SwHTMLParser::InsertBodyOptions() SfxItemSet aItemSet( m_pDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() ); SvxCSS1PropertyInfo aPropInfo; OUString aDummy; - ParseStyleOptions( aStyle, aDummy, aDummy, aItemSet, aPropInfo, 0, &aDir ); + ParseStyleOptions( aStyle, aDummy, aDummy, aItemSet, aPropInfo, nullptr, &aDir ); // Ein par Attribute muessen an der Seitenvorlage gesetzt werden, // und zwar die, die nicht vererbit werden - m_pCSS1Parser->SetPageDescAttrs( bSetBrush ? &aBrushItem : 0, + m_pCSS1Parser->SetPageDescAttrs( bSetBrush ? &aBrushItem : nullptr, &aItemSet ); const SfxPoolItem *pItem; @@ -1407,7 +1407,7 @@ void SwHTMLParser::StripTrailingPara() break; } - m_pPam->GetPoint()->nContent.Assign( 0, 0 ); + m_pPam->GetPoint()->nContent.Assign( nullptr, 0 ); m_pPam->SetMark(); m_pPam->DeleteMark(); m_pDoc->GetNodes().Delete( m_pPam->GetPoint()->nNode ); @@ -1436,7 +1436,7 @@ void SwHTMLParser::StripTrailingPara() --nPos; bSetSmallFont = (CH_TXTATR_BREAKWORD == pTextNd->GetText()[nPos]) && - (0 != pTextNd->GetTextAttrForCharAt( nPos, RES_TXTATR_FLYCNT )); + (nullptr != pTextNd->GetTextAttrForCharAt( nPos, RES_TXTATR_FLYCNT )); } } diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx index d4b566a73412..840fd61e88bd 100644 --- a/sw/source/filter/html/htmlnum.cxx +++ b/sw/source/filter/html/htmlnum.cxx @@ -39,7 +39,7 @@ void SwHTMLNumRuleInfo::Set( const SwTextNode& rTextNd ) } else { - pNumRule = 0; + pNumRule = nullptr; nDeep = 0; bNumbered = bRestart = false; } diff --git a/sw/source/filter/html/htmlnum.hxx b/sw/source/filter/html/htmlnum.hxx index 555a644afdb2..6ef008b2dd0d 100644 --- a/sw/source/filter/html/htmlnum.hxx +++ b/sw/source/filter/html/htmlnum.hxx @@ -47,7 +47,7 @@ public: void Set( const SwTextNode& rTextNd ); SwHTMLNumRuleInfo() : - pNumRule( 0 ), nDeep( 0 ), + pNumRule( nullptr ), nDeep( 0 ), bRestart( false ), bNumbered( false ) { memset( &aNumStarts, 0xff, sizeof( aNumStarts ) ); @@ -101,7 +101,7 @@ inline void SwHTMLNumRuleInfo::Set( const SwHTMLNumRuleInfo& rInf ) inline void SwHTMLNumRuleInfo::Clear() { - pNumRule = 0; + pNumRule = nullptr; nDeep = 0; bRestart = bNumbered = false; memset( &aNumStarts, 0xff, sizeof( aNumStarts ) ); @@ -110,7 +110,7 @@ inline void SwHTMLNumRuleInfo::Clear() inline sal_uInt8 SwHTMLNumRuleInfo::GetLevel() const { return - (sal_uInt8)( pNumRule!=0 && nDeep != 0 + (sal_uInt8)( pNumRule!=nullptr && nDeep != 0 ? ( nDeep<=MAXLEVEL ? nDeep-1 : MAXLEVEL - 1 ) : 0 ); } diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx index 70d76983c627..05e9c4eb84af 100644 --- a/sw/source/filter/html/htmlnumreader.cxx +++ b/sw/source/filter/html/htmlnumreader.cxx @@ -48,7 +48,7 @@ static HTMLOptionEnum aHTMLULTypeTable[] = { OOO_STRING_SVTOOLS_HTML_ULTYPE_disc, HTML_BULLETCHAR_DISC }, { OOO_STRING_SVTOOLS_HTML_ULTYPE_circle, HTML_BULLETCHAR_CIRCLE }, { OOO_STRING_SVTOOLS_HTML_ULTYPE_square, HTML_BULLETCHAR_SQUARE }, - { 0, 0 } + { nullptr, 0 } }; @@ -77,7 +77,7 @@ void SwHTMLParser::NewNumBulList( int nToken ) // das Format anpassen, falls es fuer den Level noch nicht // geschehen ist! - bool bNewNumFormat = rInfo.GetNumRule()->GetNumFormat( nLevel ) == 0; + bool bNewNumFormat = rInfo.GetNumRule()->GetNumFormat( nLevel ) == nullptr; bool bChangeNumFormat = false; // das default Numerierungsformat erstellen @@ -227,7 +227,7 @@ void SwHTMLParser::NewNumBulList( int nToken ) aBrushItem.SetGraphicPos( GPOS_AREA ); // Die Groesse nur beachten, wenn Breite und Hoehe vorhanden sind - Size aTwipSz( nWidth, nHeight), *pTwipSz=0; + Size aTwipSz( nWidth, nHeight), *pTwipSz=nullptr; if( nWidth!=USHRT_MAX && nHeight!=USHRT_MAX ) { aTwipSz = @@ -239,7 +239,7 @@ void SwHTMLParser::NewNumBulList( int nToken ) // Die Ausrichtung auch nur beachten, wenn eine Ausrichtung // angegeben wurde aNumFormat.SetGraphicBrush( &aBrushItem, pTwipSz, - text::VertOrientation::NONE!=eVertOri ? &eVertOri : 0); + text::VertOrientation::NONE!=eVertOri ? &eVertOri : nullptr); // Und noch die Grafik merken, um sie in den Absaetzen nicht // einzufuegen @@ -352,7 +352,7 @@ void SwHTMLParser::EndNumBulList( int nToken ) AddParSpace(); // den aktuellen Kontext vom Stack holen - _HTMLAttrContext *pCntxt = nToken!=0 ? PopContext( static_cast< sal_uInt16 >(nToken & ~1) ) : 0; + _HTMLAttrContext *pCntxt = nToken!=0 ? PopContext( static_cast< sal_uInt16 >(nToken & ~1) ) : nullptr; // Keine Liste aufgrund eines Tokens beenden, wenn der Kontext // nie angelgt wurde oder nicht beendet werden darf. @@ -363,7 +363,7 @@ void SwHTMLParser::EndNumBulList( int nToken ) { // Die noch nicht angepassten Formate werden jetzt noch // angepasst, damit es sich besser Editieren laesst. - const SwNumFormat *pRefNumFormat = 0; + const SwNumFormat *pRefNumFormat = nullptr; bool bChanged = false; for( sal_uInt16 i=0; i<MAXLEVEL; i++ ) { @@ -558,7 +558,7 @@ void SwHTMLParser::EndNumBulListItem( int nToken, bool bSetColl, AppendTextNode( AM_NOSPACE ); // Kontext zu dem Token suchen und vom Stack holen - _HTMLAttrContext *pCntxt = 0; + _HTMLAttrContext *pCntxt = nullptr; auto nPos = m_aContexts.size(); nToken &= ~1; while( !pCntxt && nPos>m_nContextStMin ) diff --git a/sw/source/filter/html/htmlnumwriter.cxx b/sw/source/filter/html/htmlnumwriter.cxx index a3c1588c4e0f..a2f39ba1bb82 100644 --- a/sw/source/filter/html/htmlnumwriter.cxx +++ b/sw/source/filter/html/htmlnumwriter.cxx @@ -45,7 +45,7 @@ using namespace css; void SwHTMLWriter::FillNextNumInfo() { - m_pNextNumRuleInfo = 0; + m_pNextNumRuleInfo = nullptr; sal_uLong nPos = pCurPam->GetPoint()->nNode.GetIndex() + 1; @@ -90,7 +90,7 @@ void SwHTMLWriter::FillNextNumInfo() void SwHTMLWriter::ClearNextNumInfo() { delete m_pNextNumRuleInfo; - m_pNextNumRuleInfo = 0; + m_pNextNumRuleInfo = nullptr; } Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt, @@ -189,7 +189,7 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt, sOut += OString(OOO_STRING_SVTOOLS_HTML_unorderlist); // den Typ ueber das Bullet-Zeichen bestimmen - const sal_Char *pStr = 0; + const sal_Char *pStr = nullptr; switch( rNumFormat.GetBulletChar() ) { case HTML_BULLETCHAR_DISC: @@ -214,7 +214,7 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt, sOut += OString(OOO_STRING_SVTOOLS_HTML_unorderlist); rWrt.Strm().WriteOString( sOut ); OutHTML_BulletImage( rWrt, - 0, + nullptr, rNumFormat.GetBrush() ); } else diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 34a592a91adb..e0caa1610ae3 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -465,7 +465,7 @@ void SwHTMLParser::InsertEmbed() // und in das Dok einfuegen SwFrameFormat* pFlyFormat = - m_pDoc->getIDocumentContentOperations().Insert( *m_pPam, ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aFrmSet, NULL, NULL ); + m_pDoc->getIDocumentContentOperations().Insert( *m_pPam, ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aFrmSet, nullptr, nullptr ); // Namen am FrameFormat setzen if( !aName.isEmpty() ) @@ -600,7 +600,7 @@ void SwHTMLParser::NewObject() if( !bIsApplet ) { delete m_pAppletImpl; - m_pAppletImpl = 0; + m_pAppletImpl = nullptr; return; } @@ -640,8 +640,8 @@ void SwHTMLParser::EndObject() m_pDoc->getIDocumentContentOperations().Insert( *m_pPam, ::svt::EmbeddedObjectRef( m_pAppletImpl->GetApplet(), embed::Aspects::MSOLE_CONTENT ), &m_pAppletImpl->GetItemSet(), - NULL, - NULL ); + nullptr, + nullptr ); // den alternativen Namen setzen SwNoTextNode *pNoTextNd = @@ -653,7 +653,7 @@ void SwHTMLParser::EndObject() RegisterFlyFrm( pFlyFormat ); delete m_pAppletImpl; - m_pAppletImpl = 0; + m_pAppletImpl = nullptr; } #else (void) this; // Silence loplugin:staticmethods @@ -732,7 +732,7 @@ void SwHTMLParser::InsertApplet() if( aCode.isEmpty() ) { delete m_pAppletImpl; - m_pAppletImpl = 0; + m_pAppletImpl = nullptr; return; } @@ -774,8 +774,8 @@ void SwHTMLParser::EndApplet() m_pDoc->getIDocumentContentOperations().Insert( *m_pPam, ::svt::EmbeddedObjectRef( m_pAppletImpl->GetApplet(), embed::Aspects::MSOLE_CONTENT ), &m_pAppletImpl->GetItemSet(), - NULL, - NULL ); + nullptr, + nullptr ); // den alternativen Namen setzen SwNoTextNode *pNoTextNd = @@ -787,7 +787,7 @@ void SwHTMLParser::EndApplet() RegisterFlyFrm( pFlyFormat ); delete m_pAppletImpl; - m_pAppletImpl = 0; + m_pAppletImpl = nullptr; #else (void) this; #endif @@ -945,7 +945,7 @@ void SwHTMLParser::InsertFloatingFrame() // und in das Dok einfuegen SwFrameFormat* pFlyFormat = - m_pDoc->getIDocumentContentOperations().Insert( *m_pPam, ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aFrmSet, NULL, NULL ); + m_pDoc->getIDocumentContentOperations().Insert( *m_pPam, ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aFrmSet, nullptr, nullptr ); // den alternativen Namen setzen SwNoTextNode *pNoTextNd = diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index fc02fad11ed0..b40c3ce4bc50 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -259,11 +259,11 @@ void SwHTMLParser::NewDivision( int nToken ) bAppended = true; } } - _HTMLAttrs *pPostIts = bAppended ? 0 : new _HTMLAttrs; + _HTMLAttrs *pPostIts = bAppended ? nullptr : new _HTMLAttrs; SetAttr( true, true, pPostIts ); // Namen der Section eindeutig machen - const OUString aName( m_pDoc->GetUniqueSectionName( !aId.isEmpty() ? &aId : 0 ) ); + const OUString aName( m_pDoc->GetUniqueSectionName( !aId.isEmpty() ? &aId : nullptr ) ); if( !aHRef.isEmpty() ) { @@ -332,7 +332,7 @@ void SwHTMLParser::NewDivision( int nToken ) aItemSet.ClearItem( RES_FRAMEDIR ); } - m_pDoc->InsertSwSection( *m_pPam, aSection, 0, &aFrmItemSet, false ); + m_pDoc->InsertSwSection( *m_pPam, aSection, nullptr, &aFrmItemSet, false ); // ggfs. einen Bereich anspringen if( JUMPTO_REGION == m_eJumpTo && aName == m_sJmpMark ) @@ -342,7 +342,7 @@ void SwHTMLParser::NewDivision( int nToken ) } SwTextNode* pOldTextNd = - (bAppended) ? 0 : m_pPam->GetPoint()->nNode.GetNode().GetTextNode(); + (bAppended) ? nullptr : m_pPam->GetPoint()->nNode.GetNode().GetTextNode(); m_pPam->Move( fnMoveBackward ); @@ -358,7 +358,7 @@ void SwHTMLParser::NewDivision( int nToken ) // der Tabelle setzen InsertAttrs( *pPostIts ); delete pPostIts; - pPostIts = 0; + pPostIts = nullptr; } pCntxt->SetSpansSection( true ); @@ -388,7 +388,7 @@ void SwHTMLParser::EndDivision( int /*nToken*/ ) { // Stack-Eintrag zu dem Token suchen (weil wir noch den Div-Stack // haben unterscheiden wir erst einmal nicht zwischen DIV und CENTER - _HTMLAttrContext *pCntxt = 0; + _HTMLAttrContext *pCntxt = nullptr; auto nPos = m_aContexts.size(); while( !pCntxt && nPos>m_nContextStMin ) { @@ -591,7 +591,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) bool bInCntnr = false; auto i = m_aContexts.size(); while( !bInCntnr && i > m_nContextStMin ) - bInCntnr = 0 != m_aContexts[--i]->GetFrmItemSet(); + bInCntnr = nullptr != m_aContexts[--i]->GetFrmItemSet(); // Parse style sheets, but don't position anything by now. bool bStyleParsed = false; @@ -683,11 +683,11 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) bAppended = true; } } - _HTMLAttrs *pPostIts = bAppended ? 0 : new _HTMLAttrs; + _HTMLAttrs *pPostIts = bAppended ? nullptr : new _HTMLAttrs; SetAttr( true, true, pPostIts ); // Make section name unique. - OUString aName( m_pDoc->GetUniqueSectionName( !aId.isEmpty() ? &aId : 0 ) ); + OUString aName( m_pDoc->GetUniqueSectionName( !aId.isEmpty() ? &aId : nullptr ) ); SwSectionData aSection( CONTENT_SECTION, aName ); SfxItemSet aFrmItemSet( m_pDoc->GetAttrPool(), @@ -721,7 +721,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) aFrmItemSet.Put( *pItem ); aItemSet.ClearItem( RES_FRAMEDIR ); } - m_pDoc->InsertSwSection( *m_pPam, aSection, 0, &aFrmItemSet, false ); + m_pDoc->InsertSwSection( *m_pPam, aSection, nullptr, &aFrmItemSet, false ); // Jump to section, if this is requested. if( JUMPTO_REGION == m_eJumpTo && aName == m_sJmpMark ) @@ -731,7 +731,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) } SwTextNode* pOldTextNd = - (bAppended) ? 0 : m_pPam->GetPoint()->nNode.GetNode().GetTextNode(); + (bAppended) ? nullptr : m_pPam->GetPoint()->nNode.GetNode().GetTextNode(); m_pPam->Move( fnMoveBackward ); @@ -746,7 +746,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) // Move pending PostIts into the section. InsertAttrs( *pPostIts ); delete pPostIts; - pPostIts = 0; + pPostIts = nullptr; } pCntxt->SetSpansSection( true ); diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index b97f1fe306cb..53cb06bbd779 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -67,7 +67,7 @@ static HTMLOptionEnum aHTMLTableVAlignTable[] = { OOO_STRING_SVTOOLS_HTML_VA_top, text::VertOrientation::NONE }, { OOO_STRING_SVTOOLS_HTML_VA_middle, text::VertOrientation::CENTER }, { OOO_STRING_SVTOOLS_HTML_VA_bottom, text::VertOrientation::BOTTOM }, - { 0, 0 } + { nullptr, 0 } }; // table tags options @@ -121,8 +121,8 @@ public: _HTMLTableContext( SwPosition *pPs, size_t nCntxtStMin, size_t nCntxtStAttrMin ) : - pTableNd( 0 ), - pFrameFormat( 0 ), + pTableNd( nullptr ), + pFrameFormat( nullptr ), pPos( pPs ), nContextStAttrMin( nCntxtStAttrMin ), nContextStMin( nCntxtStMin ), @@ -257,7 +257,7 @@ public: sal_Int16 GetVertOri() const { return eVertOri; } // Is the cell filled or protected ? - bool IsUsed() const { return pContents!=0 || bProtected; } + bool IsUsed() const { return pContents!=nullptr || bProtected; } SwHTMLTableLayoutCell *CreateLayoutInfo(); @@ -471,7 +471,7 @@ class HTMLTable void FixFillerFrameFormat( SwTableBox *pBox, bool bRight ) const; // Create a table with the content (lines/boxes) - void _MakeTable( SwTableBox *pUpper=0 ); + void _MakeTable( SwTableBox *pUpper=nullptr ); // Gernerate a new SwTableBox, which contains a SwStartNode SwTableBox *NewTableBox( const SwStartNode *pStNd, @@ -592,7 +592,7 @@ public: void SetTable( const SwStartNode *pStNd, _HTMLTableContext *pCntxt, sal_uInt16 nLeft, sal_uInt16 nRight, - const SwTable *pSwTab=0, bool bFrcFrame=false ); + const SwTable *pSwTab=nullptr, bool bFrcFrame=false ); _HTMLTableContext *GetContext() const { return pContext; } @@ -619,20 +619,20 @@ public: void HTMLTableCnts::InitCtor() { - m_pNext = 0; - m_pLayoutInfo = 0; + m_pNext = nullptr; + m_pLayoutInfo = nullptr; m_bNoBreak = false; } HTMLTableCnts::HTMLTableCnts( const SwStartNode* pStNd ): - m_pStartNode(pStNd), m_pTable(0) + m_pStartNode(pStNd), m_pTable(nullptr) { InitCtor(); } HTMLTableCnts::HTMLTableCnts( HTMLTable* pTab ): - m_pStartNode(0), m_pTable(pTab) + m_pStartNode(nullptr), m_pTable(pTab) { InitCtor(); } @@ -664,8 +664,8 @@ SwHTMLTableLayoutCnts *HTMLTableCnts::CreateLayoutInfo() { if( !m_pLayoutInfo ) { - SwHTMLTableLayoutCnts *pNextInfo = m_pNext ? m_pNext->CreateLayoutInfo() : 0; - SwHTMLTableLayout *pTableInfo = m_pTable ? m_pTable->CreateLayoutInfo() : 0; + SwHTMLTableLayoutCnts *pNextInfo = m_pNext ? m_pNext->CreateLayoutInfo() : nullptr; + SwHTMLTableLayout *pTableInfo = m_pTable ? m_pTable->CreateLayoutInfo() : nullptr; m_pLayoutInfo = new SwHTMLTableLayoutCnts( m_pStartNode, pTableInfo, m_bNoBreak, pNextInfo ); @@ -675,8 +675,8 @@ SwHTMLTableLayoutCnts *HTMLTableCnts::CreateLayoutInfo() } HTMLTableCell::HTMLTableCell(): - pContents(0), - pBGBrush(0), + pContents(nullptr), + pBGBrush(nullptr), nNumFormat(0), nRowSpan(1), nColSpan(1), @@ -737,7 +737,7 @@ void HTMLTableCell::SetProtected() // sein, weil sie nicht geloescht werden!!! // Inhalt loeschen - pContents = 0; + pContents = nullptr; // Hintergrundfarbe kopieren. if( pBGBrush ) @@ -762,7 +762,7 @@ inline bool HTMLTableCell::GetValue( double& rValue ) const SwHTMLTableLayoutCell *HTMLTableCell::CreateLayoutInfo() { - SwHTMLTableLayoutCnts *pCntInfo = pContents ? pContents->CreateLayoutInfo() : 0; + SwHTMLTableLayoutCnts *pCntInfo = pContents ? pContents->CreateLayoutInfo() : nullptr; return new SwHTMLTableLayoutCell( pCntInfo, nRowSpan, nColSpan, nWidth, bRelWidth, bNoWrap ); @@ -775,7 +775,7 @@ HTMLTableRow::HTMLTableRow( sal_uInt16 nCells ): nEmptyRows(0), eAdjust(SVX_ADJUST_END), eVertOri(text::VertOrientation::TOP), - pBGBrush(0), + pBGBrush(nullptr), bBottomBorder(false) { for( sal_uInt16 i=0; i<nCells; i++ ) @@ -873,7 +873,7 @@ HTMLTableColumn::HTMLTableColumn(): bLeftBorder(false) { for( sal_uInt16 i=0; i<6; i++ ) - aFrameFormats[i] = 0; + aFrameFormats[i] = nullptr; } inline void HTMLTableColumn::SetWidth( sal_uInt16 nWdth, bool bRelWdth ) @@ -922,21 +922,21 @@ inline SwFrameFormat *HTMLTableColumn::GetFrameFormat( bool bBorderLine, void HTMLTable::InitCtor( const HTMLTableOptions *pOptions ) { - pResizeDrawObjs = 0; - pDrawObjPrcWidths = 0; + pResizeDrawObjs = nullptr; + pDrawObjPrcWidths = nullptr; pRows = new HTMLTableRows; pColumns = new HTMLTableColumns; nRows = 0; nCurRow = 0; nCurCol = 0; - pBox1 = 0; - pBoxFormat = 0; pLineFormat = 0; - pLineFrameFormatNoHeight = 0; - pInhBGBrush = 0; + pBox1 = nullptr; + pBoxFormat = nullptr; pLineFormat = nullptr; + pLineFrameFormatNoHeight = nullptr; + pInhBGBrush = nullptr; - pPrevStNd = 0; - pSwTable = 0; + pPrevStNd = nullptr; + pSwTable = nullptr; bTopBorder = false; bRightBorder = false; bTopAlwd = true; bRightAlwd = true; @@ -1034,11 +1034,11 @@ void HTMLTable::InitCtor( const HTMLTableOptions *pOptions ) bColSpec = false; pBGBrush = pParser->CreateBrushItem( - pOptions->bBGColor ? &(pOptions->aBGColor) : 0, + pOptions->bBGColor ? &(pOptions->aBGColor) : nullptr, pOptions->aBGImage, aEmptyOUStr, aEmptyOUStr, aEmptyOUStr ); - pContext = 0; - pParentContents = 0; + pContext = nullptr; + pParentContents = nullptr; aId = pOptions->aId; aClass = pOptions->aClass; @@ -1055,7 +1055,7 @@ HTMLTable::HTMLTable( SwHTMLParser* pPars, HTMLTable *pTopTab, nCellPadding( pOptions->nCellPadding ), nCellSpacing( pOptions->nCellSpacing ), nBoxes( 1 ), - pCaptionStartNode( 0 ), + pCaptionStartNode( nullptr ), bTableAdjustOfTag( !pTopTab && pOptions->bTableAdjust ), bIsParentHead( bParHead ), bHasParentSection( bHasParentSec ), @@ -1064,7 +1064,7 @@ HTMLTable::HTMLTable( SwHTMLParser* pPars, HTMLTable *pTopTab, bPrcWidth( pOptions->bPrcWidth ), pParser( pPars ), pTopTable( pTopTab ? pTopTab : this ), - pLayoutInfo( 0 ), + pLayoutInfo( nullptr ), nWidth( pOptions->nWidth ), nHeight( pTopTab ? 0 : pOptions->nHeight ), eTableAdjust( pOptions->eAdjust ), @@ -1183,7 +1183,7 @@ void HTMLTable::ProtectRowSpan( sal_uInt16 nRow, sal_uInt16 nCol, sal_uInt16 nRo // Suchen des SwStartNodes der letzten belegten Vorgaengerbox const SwStartNode* HTMLTable::GetPrevBoxStartNode( sal_uInt16 nRow, sal_uInt16 nCol ) const { - const HTMLTableCnts *pPrevCnts = 0; + const HTMLTableCnts *pPrevCnts = nullptr; if( 0==nRow ) { @@ -1330,9 +1330,9 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox, sal_uInt16 nRowSpan, sal_uInt16 nColSpan, bool bFirstPara, bool bLastPara ) const { - SwFrameFormat *pFrameFormat = 0; // frame::Frame-Format + SwFrameFormat *pFrameFormat = nullptr; // frame::Frame-Format sal_Int16 eVOri = text::VertOrientation::NONE; - const SvxBrushItem *pBGBrushItem = 0; // Hintergrund + const SvxBrushItem *pBGBrushItem = nullptr; // Hintergrund std::shared_ptr<SvxBoxItem> pBoxItem; bool bTopLine = false, bBottomLine = false, bLastBottomLine = false; bool bReUsable = false; // Format nochmals verwendbar? @@ -1497,7 +1497,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox, SfxItemSet aItemSet( *pFrameFormat->GetAttrSet().GetPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); SvxAdjust eAdjust = SVX_ADJUST_END; - SwContentNode *pCNd = 0; + SwContentNode *pCNd = nullptr; if( !bLock ) { const SwStartNode *pSttNd = pBox->GetSttNd(); @@ -1605,7 +1605,7 @@ SwTableBox *HTMLTable::NewTableBox( const SwStartNode *pStNd, // entspricht nehmen wir diese Box pBox = pTopTable->pBox1; pBox->SetUpper( pUpper ); - pTopTable->pBox1 = 0; + pTopTable->pBox1 = nullptr; } else pBox = new SwTableBox( pBoxFormat, *pStNd, pUpper ); @@ -1637,7 +1637,7 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper, HTMLTableRow *pTopRow = &(*pRows)[nTopRow]; sal_uInt16 nRowHeight = pTopRow->GetHeight(); - const SvxBrushItem *pBGBrushItem = 0; + const SvxBrushItem *pBGBrushItem = nullptr; if( this == pTopTable || nTopRow>0 || nBottomRow<nRows ) { // An der Line eine Frabe zu setzen macht keinen Sinn, wenn sie @@ -1705,7 +1705,7 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper, OSL_ENSURE((nCol != nRightCol-1) || bSplit, "Split-Flag wrong"); if( bSplit ) { - SwTableBox* pBox = 0; + SwTableBox* pBox = nullptr; HTMLTableCell *pCell2 = GetCell( nTopRow, nStartCol ); if( pCell2->GetColSpan() == (nCol+1-nStartCol) ) { @@ -1827,7 +1827,7 @@ SwTableBox *HTMLTable::MakeTableBox( SwTableLine *pUpper, pLine ); pCnts->SetTableBox( pCntBox ); FixFrameFormat( pCntBox, nTopRow, nLeftCol, nRowSpan, nColSpan, - bFirstPara, 0==pCnts->Next() ); + bFirstPara, nullptr==pCnts->Next() ); pLine->GetTabBoxes().push_back( pCntBox ); rLines.push_back( pLine ); @@ -1998,7 +1998,7 @@ void HTMLTable::SetBorders() pCell->GetRowSpan(), pCell->GetColSpan(), bFirstPara, - 0==pCnts->Next() ); + nullptr==pCnts->Next() ); pTable->SetBorders(); } bFirstPara = false; @@ -2407,7 +2407,7 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail, OSL_ENSURE( nRows>0 && nCols>0 && nCurRow==nRows, "Wurde CloseTable nicht aufgerufen?" ); - OSL_ENSURE( (pLayoutInfo==0) == (this==pTopTable), + OSL_ENSURE( (pLayoutInfo==nullptr) == (this==pTopTable), "Top-Tabelle hat keine Layout-Info oder umgekehrt" ); if( this==pTopTable ) @@ -2932,7 +2932,7 @@ SvxBrushItem* SwHTMLParser::CreateBrushItem( const Color *pColor, const OUString& rId, const OUString& rClass ) { - SvxBrushItem *pBrushItem = 0; + SvxBrushItem *pBrushItem = nullptr; if( !rStyle.isEmpty() || !rId.isEmpty() || !rClass.isEmpty() ) { @@ -2957,7 +2957,7 @@ SvxBrushItem* SwHTMLParser::CreateBrushItem( const Color *pColor, } m_pCSS1Parser->ParseStyleOption( rStyle, aItemSet, aPropInfo ); - const SfxPoolItem *pItem = 0; + const SfxPoolItem *pItem = nullptr; if( SfxItemState::SET == aItemSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) { @@ -3005,7 +3005,7 @@ public: _SectionSaveStruct::_SectionSaveStruct( SwHTMLParser& rParser ) : m_nBaseFontStMinSave(0), m_nFontStMinSave(0), m_nFontStHeadStartSave(0), m_nDefListDeepSave(0), m_nContextStMinSave(0), m_nContextStAttrMinSave(0), - m_pTable( 0 ) + m_pTable( nullptr ) { // Font-Stacks einfrieren m_nBaseFontStMinSave = rParser.m_nBaseFontStMin; @@ -3101,8 +3101,8 @@ public: void AddContents( HTMLTableCnts *pNewCnts ); HTMLTableCnts *GetFirstContents() { return pCnts; } - void ClearIsInSection() { pCurrCnts = 0; } - bool IsInSection() const { return pCurrCnts!=0; } + void ClearIsInSection() { pCurrCnts = nullptr; } + bool IsInSection() const { return pCurrCnts!=nullptr; } void InsertCell( SwHTMLParser& rParser, HTMLTable *pCurTable ); @@ -3116,9 +3116,9 @@ public: _CellSaveStruct::_CellSaveStruct( SwHTMLParser& rParser, HTMLTable *pCurTable, bool bHd, bool bReadOpt ) : _SectionSaveStruct( rParser ), - pCnts( 0 ), - pCurrCnts( 0 ), - pNoBreakEndParaIdx( 0 ), + pCnts( nullptr ), + pCurrCnts( nullptr ), + pNoBreakEndParaIdx( nullptr ), nValue( 0.0 ), nNumFormat( 0 ), nRowSpan( 1 ), @@ -3315,7 +3315,7 @@ void _CellSaveStruct::InsertCell( SwHTMLParser& rParser, // jetzt muessen wir noch die Zelle an der aktuellen Position einfuegen SvxBrushItem *pBrushItem = - rParser.CreateBrushItem( bBGColor ? &aBGColor : 0, aBGImage, + rParser.CreateBrushItem( bBGColor ? &aBGColor : nullptr, aBGImage, aStyle, aId, aClass ); pCurTable->InsertCell( pCnts, nRowSpan, nColSpan, nWidth, bPrcWidth, nHeight, eVertOri, pBrushItem, m_pBoxItem, @@ -3451,7 +3451,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, delete m_pPendStack; m_pPendStack = pTmp; nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken(); - bPending = SVPAR_ERROR == eState && m_pPendStack != 0; + bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr; SaveState( nToken ); } @@ -3490,8 +3490,8 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, pCurTable->GetId(), pCurTable->GetClass(), aItemSet, aPropInfo, - 0, &pCurTable->GetDirection() ); - const SfxPoolItem *pItem = 0; + nullptr, &pCurTable->GetDirection() ); + const SfxPoolItem *pItem = nullptr; if( bStyleParsed ) { if( SfxItemState::SET == aItemSet.GetItemState( @@ -3517,7 +3517,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, GetMarginsFromContextWithNumBul( nLeftSpace, nRightSpace, nIndent ); // die aktuelle Position an die wir irgendwann zurueckkehren - SwPosition *pSavePos = 0; + SwPosition *pSavePos = nullptr; bool bForceFrame = false; bool bAppended = false; bool bParentLFStripped = false; @@ -3625,7 +3625,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, // alle noch offenen Attribute beenden und hinter der Tabelle // neu aufspannen - _HTMLAttrs *pPostIts = 0; + _HTMLAttrs *pPostIts = nullptr; if( !bForceFrame && (bTopTable || pCurTable->HasParentSection()) ) { SplitAttrTab( pTCntxt->aAttrTab, bTopTable ); @@ -3782,7 +3782,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, // der Tabelle setzen InsertAttrs( *pPostIts ); delete pPostIts; - pPostIts = 0; + pPostIts = nullptr; } pTCntxt->SetTableNode( const_cast<SwTableNode *>(pNd->FindTableNode()) ); @@ -3813,7 +3813,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, // aktuellen Absatzes schieben InsertAttrs( *pPostIts ); delete pPostIts; - pPostIts = 0; + pPostIts = nullptr; } } @@ -4170,7 +4170,7 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, bool bReadOptions, delete m_pPendStack; m_pPendStack = pTmp; nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken(); - bPending = SVPAR_ERROR == eState && m_pPendStack != 0; + bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr; SaveState( nToken ); } @@ -4228,7 +4228,7 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, bool bReadOptions, InsertBookmark( aId ); SvxBrushItem *pBrushItem = - CreateBrushItem( bBGColor ? &aBGColor : 0, aBGImage, aStyle, + CreateBrushItem( bBGColor ? &aBGColor : nullptr, aBGImage, aStyle, aId, aClass ); pCurTable->OpenRow( eAdjust, eVertOri, pBrushItem ); // ist beim ersten GetNextToken schon pending, muss bei @@ -4375,7 +4375,7 @@ void SwHTMLParser::BuildTableSection( HTMLTable *pCurTable, delete m_pPendStack; m_pPendStack = pTmp; nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken(); - bPending = SVPAR_ERROR == eState && m_pPendStack != 0; + bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr; SaveState( nToken ); } @@ -4562,7 +4562,7 @@ void SwHTMLParser::BuildTableColGroup( HTMLTable *pCurTable, delete m_pPendStack; m_pPendStack = pTmp; nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken(); - bPending = SVPAR_ERROR == eState && m_pPendStack != 0; + bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr; SaveState( nToken ); } @@ -4982,7 +4982,7 @@ _TableSaveStruct::~_TableSaveStruct() void _TableSaveStruct::MakeTable( sal_uInt16 nWidth, SwPosition& rPos, SwDoc *pDoc ) { - m_pCurrentTable->MakeTable(0, nWidth); + m_pCurrentTable->MakeTable(nullptr, nWidth); _HTMLTableContext *pTCntxt = m_pCurrentTable->GetContext(); OSL_ENSURE( pTCntxt, "Wo ist der Tabellen-Kontext" ); @@ -5155,7 +5155,7 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust, bool bHasToFly ) { if( !IsParserWorking() && !m_pPendStack ) - return 0; + return nullptr; int nToken = 0; bool bPending = false; @@ -5169,13 +5169,13 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust, delete m_pPendStack; m_pPendStack = pTmp; nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken(); - bPending = SVPAR_ERROR == eState && m_pPendStack != 0; + bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr; SaveState( nToken ); } else { - m_pTable = 0; + m_pTable = nullptr; HTMLTableOptions *pTableOptions = new HTMLTableOptions( GetOptions(), eParentAdjust ); @@ -5296,7 +5296,7 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust, { m_pPendStack = new SwPendingStack( HTML_TABLE_ON, m_pPendStack ); m_pPendStack->pData = pSaveStruct; - return 0; + return nullptr; } _HTMLTableContext *pTCntxt = pCurTable->GetContext(); @@ -5368,7 +5368,7 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust, m_pPam->SetMark(); m_pPam->DeleteMark(); m_pDoc->getIDocumentContentOperations().DeleteSection( const_cast<SwStartNode *>(pCapStNd) ); - m_pTable->SetCaption( 0, false ); + m_pTable->SetCaption( nullptr, false ); } // SwTable aufbereiten @@ -5418,15 +5418,15 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust, m_pPam->SetMark(); m_pPam->DeleteMark(); m_pDoc->getIDocumentContentOperations().DeleteSection( const_cast<SwStartNode *>(pCapStNd) ); - pCurTable->SetCaption( 0, false ); + pCurTable->SetCaption( nullptr, false ); } } if( m_pTable == pCurTable ) { delete pSaveStruct->m_pCurrentTable; - pSaveStruct->m_pCurrentTable = 0; - m_pTable = 0; + pSaveStruct->m_pCurrentTable = nullptr; + m_pTable = nullptr; } HTMLTable* pRetTable = pSaveStruct->m_pCurrentTable; diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index 2dd195f152d7..3b3c8a457ce6 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -89,8 +89,8 @@ public: explicit SwHTMLWrtTable( const SwHTMLTableLayout *pLayoutInfo ); void Write( SwHTMLWriter& rWrt, sal_Int16 eAlign=text::HoriOrientation::NONE, - bool bTHead=false, const SwFrameFormat *pFrameFormat=0, - const OUString *pCaption=0, bool bTopCaption=false, + bool bTHead=false, const SwFrameFormat *pFrameFormat=nullptr, + const OUString *pCaption=nullptr, bool bTopCaption=false, sal_uInt16 nHSpace=0, sal_uInt16 nVSpace=0 ) const; }; @@ -98,13 +98,13 @@ SwHTMLWrtTable::SwHTMLWrtTable( const SwTableLines& rLines, long nWidth, sal_uInt32 nBWidth, bool bRel, sal_uInt16 nLSub, sal_uInt16 nRSub, sal_uInt16 nNumOfRowsToRepeat ) - : SwWriteTable(NULL, rLines, nWidth, nBWidth, bRel, MAX_DEPTH, nLSub, nRSub, nNumOfRowsToRepeat) + : SwWriteTable(nullptr, rLines, nWidth, nBWidth, bRel, MAX_DEPTH, nLSub, nRSub, nNumOfRowsToRepeat) { PixelizeBorders(); } SwHTMLWrtTable::SwHTMLWrtTable( const SwHTMLTableLayout *pLayoutInfo ) - : SwWriteTable(NULL, pLayoutInfo) + : SwWriteTable(nullptr, pLayoutInfo) { // Einige Twip-Werte an Pixel-Grenzen anpassen if( bCollectBorderWidth ) @@ -414,7 +414,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, rWrt.m_bTextAttr = false; rWrt.m_bOutOpts = true; - const SvxBrushItem *pBrushItem = 0; + const SvxBrushItem *pBrushItem = nullptr; if( SfxItemState::SET==rItemSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) { pBrushItem = static_cast<const SvxBrushItem *>(pItem); @@ -1110,7 +1110,7 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode, { SwViewShell *pSh = rWrt.pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); if ( pSh && pSh->GetViewOptions()->IsTest1() ) - pLayout = 0; + pLayout = nullptr; } #endif diff --git a/sw/source/filter/html/parcss1.cxx b/sw/source/filter/html/parcss1.cxx index b5042edc18ad..2b14d4195a7b 100644 --- a/sw/source/filter/html/parcss1.cxx +++ b/sw/source/filter/html/parcss1.cxx @@ -392,7 +392,7 @@ CSS1Token CSS1Parser::GetNextToken() aIdent += sTmpBuffer2.makeStringAndClear(); // Ist es eine Einheit? - const sal_Char *pCmp1 = 0, *pCmp2 = 0, *pCmp3 = 0; + const sal_Char *pCmp1 = nullptr, *pCmp2 = nullptr, *pCmp3 = nullptr; double nScale1 = 1., nScale2 = 1.; CSS1Token nToken1 = CSS1_LENGTH, nToken2 = CSS1_LENGTH, @@ -826,10 +826,10 @@ void CSS1Parser::ParseRule() CSS1Selector *CSS1Parser::ParseSelector() { - CSS1Selector *pRoot = 0, *pLast = 0; + CSS1Selector *pRoot = nullptr, *pLast = nullptr; bool bDone = false; - CSS1Selector *pNew = 0; + CSS1Selector *pNew = nullptr; LOOP_CHECK_DECL @@ -927,7 +927,7 @@ CSS1Selector *CSS1Parser::ParseSelector() // falls ein Selektor angelegt wurd, ihn speichern if( pNew ) { - OSL_ENSURE( (pRoot!=0) == (pLast!=0), + OSL_ENSURE( (pRoot!=nullptr) == (pLast!=nullptr), "Root-Selektor, aber kein Last" ); if( pLast ) pLast->SetNext( pNew ); @@ -935,7 +935,7 @@ CSS1Selector *CSS1Parser::ParseSelector() pRoot = pNew; pLast = pNew; - pNew = 0; + pNew = nullptr; } if( bNextToken && !bDone ) @@ -993,7 +993,7 @@ CSS1Selector *CSS1Parser::ParseSelector() // beruecksichtigt und wird auf nValue angewendet! CSS1Expression *CSS1Parser::ParseDeclaration( OUString& rProperty ) { - CSS1Expression *pRoot = 0, *pLast = 0; + CSS1Expression *pRoot = nullptr, *pLast = nullptr; // property if( CSS1_IDENT != nToken ) @@ -1018,7 +1018,7 @@ CSS1Expression *CSS1Parser::ParseDeclaration( OUString& rProperty ) // Problem sein bool bDone = false; sal_Unicode cSign = 0, cOp = 0; - CSS1Expression *pNew = 0; + CSS1Expression *pNew = nullptr; LOOP_CHECK_DECL @@ -1074,7 +1074,7 @@ CSS1Expression *CSS1Parser::ParseDeclaration( OUString& rProperty ) // falls ein Expression angelegt wurde, diesen speichern if( pNew ) { - OSL_ENSURE( (pRoot!=0) == (pLast!=0), + OSL_ENSURE( (pRoot!=nullptr) == (pLast!=nullptr), "Root-Selektor, aber kein Last" ); if( pLast ) pLast->SetNext( pNew ); @@ -1082,7 +1082,7 @@ CSS1Expression *CSS1Parser::ParseDeclaration( OUString& rProperty ) pRoot = pNew; pLast = pNew; - pNew = 0; + pNew = nullptr; } if( !bDone ) diff --git a/sw/source/filter/html/parcss1.hxx b/sw/source/filter/html/parcss1.hxx index cbe524c44b70..a1fdba12f0e4 100644 --- a/sw/source/filter/html/parcss1.hxx +++ b/sw/source/filter/html/parcss1.hxx @@ -93,7 +93,7 @@ class CSS1Selector public: CSS1Selector( CSS1SelectorType eTyp, const OUString &rSel ) - : eType(eTyp), aSelector( rSel ), pNext( 0 ) + : eType(eTyp), aSelector( rSel ), pNext( nullptr ) {} ~CSS1Selector(); @@ -123,7 +123,7 @@ struct CSS1Expression public: CSS1Expression( CSS1Token eTyp, const OUString &rVal, double nVal, sal_Unicode cO = 0 ) - : cOp(cO), eType(eTyp), aValue(rVal), nValue(nVal), pNext(0) + : cOp(cO), eType(eTyp), aValue(rVal), nValue(nVal), pNext(nullptr) {} ~CSS1Expression(); @@ -148,7 +148,7 @@ public: inline void CSS1Expression::Set( CSS1Token eTyp, const OUString &rVal, double nVal, sal_Unicode cO ) { - cOp = cO; eType = eTyp; aValue = rVal; nValue = nVal; pNext = 0; + cOp = cO; eType = eTyp; aValue = rVal; nValue = nVal; pNext = nullptr; } inline sal_uInt32 CSS1Expression::GetULength() const diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index bdd1bee2cbeb..23919ccbe5c2 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -72,7 +72,7 @@ static CSS1PropertyEnum const aFontSizeTable[] = { "large", 4 }, { "x-large", 5 }, { "xx-large", 6 }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aFontWeightTable[] = @@ -87,7 +87,7 @@ static CSS1PropertyEnum const aFontWeightTable[] = { "extra-bold", WEIGHT_BOLD }, // WEIGHT_ULTRABOLD (OBS) { "bolder", WEIGHT_BOLD }, { "lighter", WEIGHT_NORMAL }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aFontStyleTable[] = @@ -95,14 +95,14 @@ static CSS1PropertyEnum const aFontStyleTable[] = { "normal", ITALIC_NONE }, { "italic", ITALIC_NORMAL }, { "oblique", ITALIC_NORMAL }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aFontVariantTable[] = { { "normal", SVX_CASEMAP_NOT_MAPPED }, { "small-caps", SVX_CASEMAP_KAPITAELCHEN }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aTextTransformTable[] = @@ -110,7 +110,7 @@ static CSS1PropertyEnum const aTextTransformTable[] = { "uppercase", SVX_CASEMAP_VERSALIEN }, { "lowercase", SVX_CASEMAP_GEMEINE }, { "capitalize", SVX_CASEMAP_TITEL }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aDirectionTable[] = @@ -118,7 +118,7 @@ static CSS1PropertyEnum const aDirectionTable[] = { "ltr", FRMDIR_HORI_LEFT_TOP }, { "rtl", FRMDIR_HORI_RIGHT_TOP }, { "inherit", FRMDIR_ENVIRONMENT }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aBGRepeatTable[] = @@ -127,7 +127,7 @@ static CSS1PropertyEnum const aBGRepeatTable[] = { "repeat-x", GPOS_TILED }, { "repeat-y", GPOS_TILED }, { "no-repeat", GPOS_NONE }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aBGHoriPosTable[] = @@ -135,7 +135,7 @@ static CSS1PropertyEnum const aBGHoriPosTable[] = { "left", GPOS_LT }, { "center", GPOS_MT }, { "right", GPOS_RT }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aBGVertPosTable[] = @@ -143,7 +143,7 @@ static CSS1PropertyEnum const aBGVertPosTable[] = { "top", GPOS_LT }, { "middle", GPOS_LM }, { "bottom", GPOS_LB }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aTextAlignTable[] = @@ -152,7 +152,7 @@ static CSS1PropertyEnum const aTextAlignTable[] = { "center", SVX_ADJUST_CENTER }, { "right", SVX_ADJUST_RIGHT }, { "justify", SVX_ADJUST_BLOCK }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aBorderWidthTable[] = @@ -160,7 +160,7 @@ static CSS1PropertyEnum const aBorderWidthTable[] = { "thin", 0 }, // DEF_LINE_WIDTH_0 / DEF_DOUBLE_LINE0 { "medium", 1 }, // DEF_LINE_WIDTH_1 / DEF_DOUBLE_LINE1 { "thick", 2 }, // DEF_LINE_WIDTH_2 / DEF_DOUBLE_LINE2 - { 0, 0 } + { nullptr, 0 } }; enum CSS1BorderStyle { CSS1_BS_NONE, CSS1_BS_SINGLE, CSS1_BS_DOUBLE, CSS1_BS_DOTTED, CSS1_BS_DASHED, CSS1_BS_GROOVE, CSS1_BS_RIDGE, CSS1_BS_INSET, CSS1_BS_OUTSET }; @@ -176,7 +176,7 @@ static CSS1PropertyEnum const aBorderStyleTable[] = { "ridge", CSS1_BS_RIDGE }, { "inset", CSS1_BS_INSET }, { "outset", CSS1_BS_OUTSET }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aFloatTable[] = @@ -184,7 +184,7 @@ static CSS1PropertyEnum const aFloatTable[] = { "left", SVX_ADJUST_LEFT }, { "right", SVX_ADJUST_RIGHT }, { "none", SVX_ADJUST_END }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aPositionTable[] = @@ -192,7 +192,7 @@ static CSS1PropertyEnum const aPositionTable[] = { "absolute", SVX_CSS1_POS_ABSOLUTE }, { "relative", SVX_CSS1_POS_RELATIVE }, { "static", SVX_CSS1_POS_STATIC }, - { 0, 0 } + { nullptr, 0 } }; // Feature: PrintExt @@ -201,7 +201,7 @@ static CSS1PropertyEnum const aSizeTable[] = { "auto", SVX_CSS1_STYPE_AUTO }, { "landscape", SVX_CSS1_STYPE_LANDSCAPE }, { "portrait", SVX_CSS1_STYPE_PORTRAIT }, - { 0, 0 } + { nullptr, 0 } }; static CSS1PropertyEnum const aPageBreakTable[] = @@ -211,7 +211,7 @@ static CSS1PropertyEnum const aPageBreakTable[] = { "avoid", SVX_CSS1_PBREAK_AVOID }, { "left", SVX_CSS1_PBREAK_LEFT }, { "right", SVX_CSS1_PBREAK_RIGHT }, - { 0, 0 } + { nullptr, 0 } }; @@ -291,7 +291,7 @@ void SvxCSS1BorderInfo::SetBorderLine( SvxBoxItemLine nLine, SvxBoxItem &rBoxIte if( CSS1_BS_NONE==eStyle || nAbsWidth==0 || (nAbsWidth==USHRT_MAX && nNamedWidth==USHRT_MAX) ) { - rBoxItem.SetLine( 0, nLine ); + rBoxItem.SetLine( nullptr, nLine ); return; } @@ -341,7 +341,7 @@ void SvxCSS1BorderInfo::SetBorderLine( SvxBoxItemLine nLine, SvxBoxItem &rBoxIte SvxCSS1PropertyInfo::SvxCSS1PropertyInfo() { for( size_t i=0; i<SAL_N_ELEMENTS(aBorderInfos); ++i ) - aBorderInfos[i] = 0; + aBorderInfos[i] = nullptr; Clear(); } @@ -377,7 +377,7 @@ SvxCSS1PropertyInfo::SvxCSS1PropertyInfo( const SvxCSS1PropertyInfo& rProp ) : for( size_t i=0; i<SAL_N_ELEMENTS(aBorderInfos); ++i ) aBorderInfos[i] = rProp.aBorderInfos[i] ? new SvxCSS1BorderInfo( *rProp.aBorderInfos[i] ) - : 0; + : nullptr; } SvxCSS1PropertyInfo::~SvxCSS1PropertyInfo() @@ -390,7 +390,7 @@ void SvxCSS1PropertyInfo::DestroyBorderInfos() for( size_t i=0; i<SAL_N_ELEMENTS(aBorderInfos); ++i ) { delete aBorderInfos[i]; - aBorderInfos[i] = 0; + aBorderInfos[i] = nullptr; } } @@ -568,7 +568,7 @@ void SvxCSS1PropertyInfo::SetBoxItem( SfxItemSet& rItemSet, nRightBorderDistance != USHRT_MAX; for( size_t i=0; !bChg && i<SAL_N_ELEMENTS(aBorderInfos); ++i ) - bChg = aBorderInfos[i]!=0; + bChg = aBorderInfos[i]!=nullptr; if( !bChg ) return; @@ -697,10 +697,10 @@ SvxCSS1Parser::SvxCSS1Parser( SfxItemPool& rPool, const OUString& rBaseURL, sal_ sal_uInt16 *pWhichIds, sal_uInt16 nWhichIds ) : CSS1Parser(), sBaseURL( rBaseURL ), - pSheetItemSet(0), - pItemSet(0), - pSearchEntry( 0 ), - pPropInfo( 0 ), + pSheetItemSet(nullptr), + pItemSet(nullptr), + pSearchEntry( nullptr ), + pPropInfo( nullptr ), nMinFixLineSpace( nMinFixLineSp ), eDfltEnc( RTL_TEXTENCODING_DONTKNOW ), nScriptFlags( CSS1_SCRIPT_ALL ), @@ -838,8 +838,8 @@ bool SvxCSS1Parser::ParseStyleSheet( const OUString& rIn ) pSheetItemSet->ClearItem(); pSheetPropInfo->Clear(); - pItemSet = 0; - pPropInfo = 0; + pItemSet = nullptr; + pPropInfo = nullptr; return bSuccess; } @@ -854,8 +854,8 @@ bool SvxCSS1Parser::ParseStyleOption( const OUString& rIn, bool bSuccess = CSS1Parser::ParseStyleOption( rIn ); rItemSet.ClearItem( aItemIds.nDirection ); - pItemSet = 0; - pPropInfo = 0; + pItemSet = nullptr; + pPropInfo = nullptr; return bSuccess; } @@ -874,7 +874,7 @@ bool SvxCSS1Parser::GetEnum( const CSS1PropertyEnum *pPropTable, if( pPropTable->pName ) rEnum = pPropTable->nEnum; - return (pPropTable->pName != 0); + return (pPropTable->pName != nullptr); } void SvxCSS1Parser::PixelToTwip( long &rWidth, long &rHeight ) @@ -911,7 +911,7 @@ sal_uInt32 SvxCSS1Parser::GetFontHeight( sal_uInt16 nSize ) const const FontList *SvxCSS1Parser::GetFontList() const { - return 0; + return nullptr; } void SvxCSS1Parser::InsertMapEntry( const OUString& rKey, @@ -1089,7 +1089,7 @@ static void ParseCSS1_font_family( const CSS1Expression *pExpr, if( !bFound && pFList ) { sal_Handle hFont = pFList->GetFirstFontInfo( aIdent ); - if( 0 != hFont ) + if( nullptr != hFont ) { const vcl::FontInfo& rFInfo = FontList::GetFontInfo( hFont ); if( RTL_TEXTENCODING_DONTKNOW != rFInfo.GetCharSet() ) @@ -3165,10 +3165,10 @@ void SvxCSS1Parser::ParseProperty( const OUString& rProperty, CSS1PropEntry aSrch; aSrch.pName = &aTmp; - aSrch.pFunc = 0; + aSrch.pFunc = nullptr; void* pFound; - if( 0 != ( pFound = bsearch( &aSrch, + if( nullptr != ( pFound = bsearch( &aSrch, static_cast<void*>(aCSS1PropFnTab), sizeof( aCSS1PropFnTab ) / sizeof( CSS1PropEntry ), sizeof( CSS1PropEntry ), diff --git a/sw/source/filter/html/svxcss1.hxx b/sw/source/filter/html/svxcss1.hxx index d35f8ef1a64a..47619ad42e5b 100644 --- a/sw/source/filter/html/svxcss1.hxx +++ b/sw/source/filter/html/svxcss1.hxx @@ -145,7 +145,7 @@ public: void CopyBorderInfo( sal_uInt16 nCount, sal_uInt16 nWhat ); void SetBoxItem( SfxItemSet& rItemSet, sal_uInt16 nMinBorderDist, - const SvxBoxItem* pDflt=0, bool bTable = false ); + const SvxBoxItem* pDflt=nullptr, bool bTable = false ); }; @@ -242,7 +242,7 @@ public: SvxCSS1Parser( SfxItemPool& rPool, const OUString& rBaseURL, sal_uInt16 nMinFixLineSp, - sal_uInt16 *pWhichIds=0, sal_uInt16 nWhichIds=0 ); + sal_uInt16 *pWhichIds=nullptr, sal_uInt16 nWhichIds=0 ); virtual ~SvxCSS1Parser(); bool IsIgnoreFontFamily() const { return bIgnoreFontFamily; } diff --git a/sw/source/filter/html/swcss1.hxx b/sw/source/filter/html/swcss1.hxx index abe6ae7acf9d..fedcbb395794 100644 --- a/sw/source/filter/html/swcss1.hxx +++ b/sw/source/filter/html/swcss1.hxx @@ -109,7 +109,7 @@ public: // werden aus dem Item-Set geloescht ). Wird fuer's BODY-Tag // aufgerufen. void SetPageDescAttrs( const SvxBrushItem *pBrush, - SfxItemSet *pItemSet=0 ); + SfxItemSet *pItemSet=nullptr ); void ChgPageDesc( const SwPageDesc *pPageDesc, const SwPageDesc& rNewPageDesc ); @@ -120,7 +120,7 @@ public: // Fuellen eines DropCap-Attributs void FillDropCap( SwFormatDrop& rDrop, SfxItemSet& rItemSet, - const OUString *pName=0 ); + const OUString *pName=nullptr ); bool SetFormatBreak( SfxItemSet& rItemSet, const SvxCSS1PropertyInfo& rPropInfo ); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index e1dbe40902b4..7e2ea5721b2d 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -134,7 +134,7 @@ HTMLOptionEnum aHTMLPAlignTable[] = { OOO_STRING_SVTOOLS_HTML_AL_right, SVX_ADJUST_RIGHT }, { OOO_STRING_SVTOOLS_HTML_AL_justify, SVX_ADJUST_BLOCK }, { OOO_STRING_SVTOOLS_HTML_AL_char, SVX_ADJUST_LEFT }, - { 0, 0 } + { nullptr, 0 } }; // <SPACER TYPE=...> @@ -143,7 +143,7 @@ static HTMLOptionEnum aHTMLSpacerTypeTable[] = { OOO_STRING_SVTOOLS_HTML_SPTYPE_block, HTML_SPTYPE_BLOCK }, { OOO_STRING_SVTOOLS_HTML_SPTYPE_horizontal, HTML_SPTYPE_HORI }, { OOO_STRING_SVTOOLS_HTML_SPTYPE_vertical, HTML_SPTYPE_VERT }, - { 0, 0 } + { nullptr, 0 } }; HTMLReader::HTMLReader() @@ -240,23 +240,23 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCrsr, SvStream& rIn, SfxMedium* pMed, bool bReadUTF8, bool bNoHTMLComments ) : SfxHTMLParser( rIn, bReadNewDoc, pMed ), - SwClient( 0 ), + SwClient( nullptr ), m_aPathToFile( rPath ), m_sBaseURL( rBaseURL ), - m_pAppletImpl( 0 ), - m_pCSS1Parser( 0 ), + m_pAppletImpl( nullptr ), + m_pCSS1Parser( nullptr ), m_pNumRuleInfo( new SwHTMLNumRuleInfo ), - m_pPendStack( 0 ), + m_pPendStack( nullptr ), m_pDoc( pD ), - m_pActionViewShell( 0 ), - m_pSttNdIdx( 0 ), - m_pTable(0), - m_pFormImpl( 0 ), - m_pMarquee( 0 ), - m_pField( 0 ), - m_pImageMap( 0 ), + m_pActionViewShell( nullptr ), + m_pSttNdIdx( nullptr ), + m_pTable(nullptr), + m_pFormImpl( nullptr ), + m_pMarquee( nullptr ), + m_pField( nullptr ), + m_pImageMap( nullptr ), m_pImageMaps(nullptr), - m_pFootEndNoteImpl( 0 ), + m_pFootEndNoteImpl( nullptr ), m_nScriptStartLineNr( 0 ), m_nBaseFontStMin( 0 ), m_nFontStMin( 0 ), @@ -297,9 +297,9 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCrsr, SvStream& rIn, m_bInFootEndNoteSymbol( false ), m_bIgnoreHTMLComments( bNoHTMLComments ), m_bRemoveHidden( false ), - m_pTempViewFrame(0) + m_pTempViewFrame(nullptr) { - m_nEventId = 0; + m_nEventId = nullptr; m_bUpperSpace = m_bViewCreated = m_bChkJumpMark = m_bSetCrsr = false; @@ -475,7 +475,7 @@ SwHTMLParser::~SwHTMLParser() { // keiner will mehr das Doc haben, also weg damit delete m_pDoc; - m_pDoc = NULL; + m_pDoc = nullptr; } if ( m_pTempViewFrame ) @@ -490,7 +490,7 @@ SwHTMLParser::~SwHTMLParser() IMPL_LINK_NOARG_TYPED( SwHTMLParser, AsyncCallback, void*, void ) { - m_nEventId=0; + m_nEventId=nullptr; // #i47907# - If the document has already been destructed, // the parser should be aware of this: @@ -501,7 +501,7 @@ IMPL_LINK_NOARG_TYPED( SwHTMLParser, AsyncCallback, void*, void ) eState = SVPAR_ERROR; } - GetAsynchCallLink().Call(0); + GetAsynchCallLink().Call(nullptr); } SvParserState SwHTMLParser::CallParser() @@ -540,7 +540,7 @@ SvParserState SwHTMLParser::CallParser() else { m_bViewCreated = true; - m_nEventId = 0; + m_nEventId = nullptr; } } @@ -764,7 +764,7 @@ if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound( false ).nNode.GetIndex() ) SwViewShell *pVSh = CheckActionViewShell(); SwCrsrShell *pCrsrSh = pVSh && dynamic_cast< const SwCrsrShell *>( pVSh ) != nullptr ? static_cast < SwCrsrShell * >( pVSh ) - : 0; + : nullptr; if( pCrsrSh && pCrsrSh->GetCrsr()->GetPoint() ->nNode.GetIndex() == nNodeIdx ) @@ -773,13 +773,13 @@ if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound( false ).nNode.GetIndex() ) pCrsrSh->SetMark(); pCrsrSh->ClearMark(); } - m_pPam->GetBound().nContent.Assign( 0, 0 ); - m_pPam->GetBound(false).nContent.Assign( 0, 0 ); + m_pPam->GetBound().nContent.Assign( nullptr, 0 ); + m_pPam->GetBound(false).nContent.Assign( nullptr, 0 ); m_pDoc->GetNodes().Delete( m_pPam->GetPoint()->nNode ); } } } - else if( 0 != ( pAktNd = m_pDoc->GetNodes()[ nNodeIdx ]->GetTextNode()) && !bHasFlysOrMarks ) + else if( nullptr != ( pAktNd = m_pDoc->GetNodes()[ nNodeIdx ]->GetTextNode()) && !bHasFlysOrMarks ) { if( pAktNd->CanJoinNext( &pPos->nNode )) { @@ -790,7 +790,7 @@ if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound( false ).nNode.GetIndex() ) } else if (pAktNd->GetText().isEmpty()) { - pPos->nContent.Assign( 0, 0 ); + pPos->nContent.Assign( nullptr, 0 ); m_pPam->SetMark(); m_pPam->DeleteMark(); m_pDoc->GetNodes().Delete( pPos->nNode ); m_pPam->Move( fnMoveBackward ); @@ -857,7 +857,7 @@ if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound( false ).nNode.GetIndex() ) } if( SVPAR_PENDING != GetStatus() ) - delete m_pSttNdIdx, m_pSttNdIdx = 0; + delete m_pSttNdIdx, m_pSttNdIdx = nullptr; // sollte der Parser der Letzte sein, der das Doc haelt, dann braucht // man hier auch nichts mehr tun, Doc wird gleich zerstoert! @@ -1264,7 +1264,7 @@ void SwHTMLParser::NextToken( int nToken ) InsertBodyOptions(); // If there is a template for the first or the right page, // it is set here. - const SwPageDesc *pPageDesc = 0; + const SwPageDesc *pPageDesc = nullptr; if( m_pCSS1Parser->IsSetFirstPageDesc() ) pPageDesc = m_pCSS1Parser->GetFirstPageDesc(); else if( m_pCSS1Parser->IsSetRightPageDesc() ) @@ -1317,7 +1317,7 @@ void SwHTMLParser::NextToken( int nToken ) case HTML_META: { - SvKeyValueIterator *pHTTPHeader = 0; + SvKeyValueIterator *pHTTPHeader = nullptr; if( IsNewDoc() ) { SwDocShell *pDocSh = m_pDoc->GetDocShell(); @@ -1385,20 +1385,20 @@ void SwHTMLParser::NextToken( int nToken ) case HTML_OBJECT_ON: #if HAVE_FEATURE_JAVA NewObject(); - m_bCallNextToken = m_pAppletImpl!=0 && m_pTable!=0; + m_bCallNextToken = m_pAppletImpl!=nullptr && m_pTable!=nullptr; #endif break; case HTML_APPLET_ON: #if HAVE_FEATURE_JAVA InsertApplet(); - m_bCallNextToken = m_pAppletImpl!=0 && m_pTable!=0; + m_bCallNextToken = m_pAppletImpl!=nullptr && m_pTable!=nullptr; #endif break; case HTML_IFRAME_ON: InsertFloatingFrame(); - m_bCallNextToken = m_bInFloatingFrame && m_pTable!=0; + m_bCallNextToken = m_bInFloatingFrame && m_pTable!=nullptr; break; case HTML_LINEBREAK: @@ -1441,7 +1441,7 @@ void SwHTMLParser::NextToken( int nToken ) if( !m_pTable && !m_pDoc->IsInHeaderFooter( m_pPam->GetPoint()->nNode ) ) { NewAttr( &m_aAttrTab.pBreak, SvxFormatBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK) ); - EndAttr( m_aAttrTab.pBreak, 0, false ); + EndAttr( m_aAttrTab.pBreak, nullptr, false ); } break; @@ -1508,7 +1508,7 @@ void SwHTMLParser::NextToken( int nToken ) case HTML_NOEMBED_ON: m_bInNoEmbed = true; - m_bCallNextToken = m_pTable!=0; + m_bCallNextToken = m_pTable!=nullptr; ReadRawData( OOO_STRING_SVTOOLS_HTML_noembed ); break; @@ -1579,7 +1579,7 @@ void SwHTMLParser::NextToken( int nToken ) case HTML_MARQUEE_ON: NewMarquee(); - m_bCallNextToken = m_pMarquee!=0 && m_pTable!=0; + m_bCallNextToken = m_pMarquee!=nullptr && m_pTable!=nullptr; break; case HTML_FORM_ON: @@ -1855,7 +1855,7 @@ void SwHTMLParser::NextToken( int nToken ) case HTML_SDFIELD_ON: NewField(); - m_bCallNextToken = m_bInField && m_pTable!=0; + m_bCallNextToken = m_bInField && m_pTable!=nullptr; break; case HTML_EMPHASIS_OFF: @@ -1907,9 +1907,9 @@ void SwHTMLParser::NextToken( int nToken ) SvxCSS1PropertyInfo aPropInfo; OUString aDummy; ParseStyleOptions( aDummy, aDummy, aDummy, aItemSet, - aPropInfo, 0, &rDir ); + aPropInfo, nullptr, &rDir ); - m_pCSS1Parser->SetPageDescAttrs( 0, &aItemSet ); + m_pCSS1Parser->SetPageDescAttrs( nullptr, &aItemSet ); break; } } @@ -1922,12 +1922,12 @@ void SwHTMLParser::NextToken( int nToken ) case HTML_TEXTAREA_ON: NewTextArea(); - m_bCallNextToken = m_bTextArea && m_pTable!=0; + m_bCallNextToken = m_bTextArea && m_pTable!=nullptr; break; case HTML_SELECT_ON: NewSelect(); - m_bCallNextToken = m_bSelect && m_pTable!=0; + m_bCallNextToken = m_bSelect && m_pTable!=nullptr; break; case HTML_ANCHOR_ON: @@ -1974,14 +1974,14 @@ void SwHTMLParser::NextToken( int nToken ) else { delete m_pImageMap; - m_pImageMap = 0; + m_pImageMap = nullptr; } break; case HTML_MAP_OFF: // there is no ImageMap anymore (don't delete IMap, because it's // already contained in the array!) - m_pImageMap = 0; + m_pImageMap = nullptr; break; case HTML_AREA: @@ -2546,7 +2546,7 @@ SwViewShell *SwHTMLParser::CallStartAction( SwViewShell *pVSh, bool bChkPtr ) #if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( !pVSh || !pOldVSh || pOldVSh == pVSh, "CallStartAction: Wer hat die SwViewShell ausgetauscht?" ); if( pOldVSh && !pVSh ) - pVSh = 0; + pVSh = nullptr; #endif } m_pActionViewShell = pVSh; @@ -2571,10 +2571,10 @@ SwViewShell *SwHTMLParser::CallEndAction( bool bChkAction, bool bChkPtr ) "CallEndAction: Wer hat die SwViewShell ausgetauscht?" ); #if OSL_DEBUG_LEVEL > 0 if( m_pActionViewShell && !pVSh ) - pVSh = 0; + pVSh = nullptr; #endif if( pVSh != m_pActionViewShell ) - m_pActionViewShell = 0; + m_pActionViewShell = nullptr; } if( !m_pActionViewShell || (bChkAction && !m_pActionViewShell->ActionPend()) ) @@ -2623,7 +2623,7 @@ SwViewShell *SwHTMLParser::CallEndAction( bool bChkAction, bool bChkPtr ) } SwViewShell *pVSh = m_pActionViewShell; - m_pActionViewShell = 0; + m_pActionViewShell = nullptr; return pVSh; } @@ -2635,10 +2635,10 @@ SwViewShell *SwHTMLParser::CheckActionViewShell() "CheckActionViewShell: Wer hat die SwViewShell ausgetauscht?" ); #if OSL_DEBUG_LEVEL > 0 if( m_pActionViewShell && !pVSh ) - pVSh = 0; + pVSh = nullptr; #endif if( pVSh != m_pActionViewShell ) - m_pActionViewShell = 0; + m_pActionViewShell = nullptr; return m_pActionViewShell; } @@ -3008,7 +3008,7 @@ bool SwHTMLParser::EndAttr( _HTMLAttr* pAttr, _HTMLAttr **ppDepAttr, // WIrd das zueltzt gestartete oder ein frueher gestartetes Attribut // beendet? - _HTMLAttr *pLast = 0; + _HTMLAttr *pLast = nullptr; if( ppHead && pAttr != *ppHead ) { // Es wird nicht das zuletzt gestartete Attribut beendet @@ -3179,7 +3179,7 @@ void SwHTMLParser::DeleteAttr( _HTMLAttr* pAttr ) // Wird das zueltzt gestartete oder ein frueher gestartetes Attribut // entfernt? - _HTMLAttr *pLast = 0; + _HTMLAttr *pLast = nullptr; if( ppHead && pAttr != *ppHead ) { // Es wird nicht das zuletzt gestartete Attribut beendet @@ -3244,7 +3244,7 @@ void SwHTMLParser::SaveAttrTab( _HTMLAttrTable& rNewAttrTab ) pAttr = pAttr->GetNext(); } - *pHTMLAttributes = 0; + *pHTMLAttributes = nullptr; } } @@ -3289,7 +3289,7 @@ void SwHTMLParser::SplitAttrTab( _HTMLAttrTable& rNewAttrTab, for (auto nCnt = sizeof(_HTMLAttrTable) / sizeof(_HTMLAttr*); nCnt--; (++pHTMLAttributes, ++pSaveAttributes)) { _HTMLAttr *pAttr = *pHTMLAttributes; - *pSaveAttributes = 0; + *pSaveAttributes = nullptr; while( pAttr ) { _HTMLAttr *pNext = pAttr->GetNext(); @@ -3350,7 +3350,7 @@ void SwHTMLParser::SplitAttrTab( _HTMLAttrTable& rNewAttrTab, pAttr = pNext; } - *pHTMLAttributes = 0; + *pHTMLAttributes = nullptr; } } @@ -3393,7 +3393,7 @@ void SwHTMLParser::RestoreAttrTab( _HTMLAttrTable& rNewAttrTab, pAttr = pAttr->GetNext(); } - *pSaveAttributes = 0; + *pSaveAttributes = nullptr; } } @@ -3756,7 +3756,7 @@ void SwHTMLParser::NewFontAttr( int nToken ) if( !aFace.isEmpty() && !m_pCSS1Parser->IsIgnoreFontFamily() ) { - const FontList *pFList = 0; + const FontList *pFList = nullptr; SwDocShell *pDocSh = m_pDoc->GetDocShell(); if( pDocSh ) { @@ -3777,7 +3777,7 @@ void SwHTMLParser::NewFontAttr( int nToken ) if( !bFound && pFList ) { sal_Handle hFont = pFList->GetFirstFontInfo( aFName ); - if( 0 != hFont ) + if( nullptr != hFont ) { const vcl::FontInfo& rFInfo = FontList::GetFontInfo( hFont ); if( RTL_TEXTENCODING_DONTKNOW != rFInfo.GetCharSet() ) @@ -3935,7 +3935,7 @@ void SwHTMLParser::NewPara() PushContext( pCntxt ); // die aktuelle Vorlage oder deren Attribute setzen - SetTextCollAttrs( !aClass.isEmpty() ? pCntxt : 0 ); + SetTextCollAttrs( !aClass.isEmpty() ? pCntxt : nullptr ); // Laufbalkenanzeige ShowStatline(); @@ -4086,7 +4086,7 @@ void SwHTMLParser::EndHeading() AddParSpace(); // Kontext zu dem Token suchen und vom Stack holen - _HTMLAttrContext *pCntxt = 0; + _HTMLAttrContext *pCntxt = nullptr; auto nPos = m_aContexts.size(); while( !pCntxt && nPos>m_nContextStMin ) { @@ -4419,7 +4419,7 @@ void SwHTMLParser::EndDefListItem( int nToken, bool bSetColl, // Kontext zu dem Token suchen und vom Stack holen nToken &= ~1; - _HTMLAttrContext *pCntxt = 0; + _HTMLAttrContext *pCntxt = nullptr; auto nPos = m_aContexts.size(); while( !pCntxt && nPos>m_nContextStMin ) { @@ -4539,8 +4539,8 @@ const SwFormatColl *SwHTMLParser::GetCurrFormatColl() const void SwHTMLParser::SetTextCollAttrs( _HTMLAttrContext *pContext ) { - SwTextFormatColl *pCollToSet = 0; // die zu setzende Vorlage - SfxItemSet *pItemSet = 0; // der Set fuer harte Attrs + SwTextFormatColl *pCollToSet = nullptr; // die zu setzende Vorlage + SfxItemSet *pItemSet = nullptr; // der Set fuer harte Attrs sal_uInt16 nTopColl = pContext ? pContext->GetTextFormatColl() : 0; const OUString& rTopClass = pContext ? pContext->GetClass() : aEmptyOUStr; sal_uInt16 nDfltColl = RES_POOLCOLL_TEXT; @@ -4747,7 +4747,7 @@ void SwHTMLParser::SetTextCollAttrs( _HTMLAttrContext *pContext ) NewAttr( &m_aAttrTab.pLRSpace, aLRItem ); m_aAttrTab.pLRSpace->SetLikePara(); m_aParaAttrs.push_back( m_aAttrTab.pLRSpace ); - EndAttr( m_aAttrTab.pLRSpace, 0, false ); + EndAttr( m_aAttrTab.pLRSpace, nullptr, false ); } } @@ -4920,7 +4920,7 @@ void SwHTMLParser::InsertSpacer() } // einen Absatz-Abstand setzen - SwTextNode *pTextNode = 0; + SwTextNode *pTextNode = nullptr; if( !m_pPam->GetPoint()->nContent.GetIndex() ) { // den unteren Absatz-Abstand des vorherigen Nodes aendern, @@ -4948,7 +4948,7 @@ void SwHTMLParser::InsertSpacer() else { NewAttr( &m_aAttrTab.pULSpace, SvxULSpaceItem( 0, (sal_uInt16)nSize, RES_UL_SPACE ) ); - EndAttr( m_aAttrTab.pULSpace, 0, false ); + EndAttr( m_aAttrTab.pULSpace, nullptr, false ); AppendTextNode(); // nicht am Abstand drehen! } @@ -4981,7 +4981,7 @@ void SwHTMLParser::InsertSpacer() aLRItem.SetTextFirstLineOfst( nIndent ); NewAttr( &m_aAttrTab.pLRSpace, aLRItem ); - EndAttr( m_aAttrTab.pLRSpace, 0, false ); + EndAttr( m_aAttrTab.pLRSpace, nullptr, false ); } else { @@ -5178,7 +5178,7 @@ void SwHTMLParser::InsertLineBreak() if( bBreakItem && SVX_BREAK_PAGE_AFTER==aBreakItem.GetBreak() ) { NewAttr( &m_aAttrTab.pBreak, aBreakItem ); - EndAttr( m_aAttrTab.pBreak, 0, false ); + EndAttr( m_aAttrTab.pBreak, nullptr, false ); } if( !bCleared && !bBreakItem ) @@ -5200,7 +5200,7 @@ void SwHTMLParser::InsertLineBreak() if( bBreakItem && SVX_BREAK_PAGE_BEFORE==aBreakItem.GetBreak() ) { NewAttr( &m_aAttrTab.pBreak, aBreakItem ); - EndAttr( m_aAttrTab.pBreak, 0, false ); + EndAttr( m_aAttrTab.pBreak, nullptr, false ); } } @@ -5450,8 +5450,8 @@ _HTMLAttr::_HTMLAttr( const SwPosition& rPos, const SfxPoolItem& rItem, bLikePara( false ), bValid( true ), nCount( 1 ), - pNext( 0 ), - pPrev( 0 ), + pNext( nullptr ), + pPrev( nullptr ), ppHead( ppHd ) { pItem = rItem.Clone(); @@ -5467,8 +5467,8 @@ _HTMLAttr::_HTMLAttr( const _HTMLAttr &rAttr, const SwNodeIndex &rEndPara, bLikePara( rAttr.bLikePara ), bValid( rAttr.bValid ), nCount( rAttr.nCount ), - pNext( 0 ), - pPrev( 0 ), + pNext( nullptr ), + pPrev( nullptr ), ppHead( ppHd ) { pItem = rAttr.pItem->Clone(); @@ -5500,8 +5500,8 @@ void _HTMLAttr::Reset(const SwNodeIndex& rSttPara, sal_Int32 nSttCnt, nEndContent = nSttCnt; // den Head korrigieren und die Verkettungen aufheben - pNext = 0; - pPrev = 0; + pNext = nullptr; + pPrev = nullptr; ppHead = ppHd; } @@ -5509,11 +5509,11 @@ void _HTMLAttr::InsertPrev( _HTMLAttr *pPrv ) { OSL_ENSURE( !pPrv->pNext || pPrv->pNext == this, "_HTMLAttr::InsertPrev: pNext falsch" ); - pPrv->pNext = 0; + pPrv->pNext = nullptr; - OSL_ENSURE( 0 == pPrv->ppHead || ppHead == pPrv->ppHead, + OSL_ENSURE( nullptr == pPrv->ppHead || ppHead == pPrv->ppHead, "_HTMLAttr::InsertPrev: ppHead falsch" ); - pPrv->ppHead = 0; + pPrv->ppHead = nullptr; _HTMLAttr *pAttr = this; while( pAttr->GetPrev() ) @@ -5543,7 +5543,7 @@ void SwHTMLParser::AddMetaUserDefined( OUString const & i_rMetaName ) (m_InfoNames[0].isEmpty() ? &m_InfoNames[0] : (m_InfoNames[1].isEmpty() ? &m_InfoNames[1] : (m_InfoNames[2].isEmpty() ? &m_InfoNames[2] : - (m_InfoNames[3].isEmpty() ? &m_InfoNames[3] : 0 )))); + (m_InfoNames[3].isEmpty() ? &m_InfoNames[3] : nullptr )))); if (pName) { (*pName) = i_rMetaName; diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 8957feac177c..4429254e7489 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -88,7 +88,7 @@ class _HTMLAttr _HTMLAttr **ppHead; // der Listenkopf _HTMLAttr( const SwPosition& rPos, const SfxPoolItem& rItem, - _HTMLAttr **pHd=0 ); + _HTMLAttr **pHd=nullptr ); _HTMLAttr( const _HTMLAttr &rAttr, const SwNodeIndex &rEndPara, sal_Int32 nEndCnt, _HTMLAttr **pHd ); @@ -122,7 +122,7 @@ public: _HTMLAttr *GetPrev() const { return pPrev; } void InsertPrev( _HTMLAttr *pPrv ); - void ClearPrev() { pPrev = 0; } + void ClearPrev() { pPrev = nullptr; } void SetHead( _HTMLAttr **ppHd ) { ppHead = ppHd; } @@ -233,8 +233,8 @@ public: _HTMLAttrContext( sal_uInt16 nTokn, sal_uInt16 nPoolId, const OUString& rClass, bool bDfltColl=false ) : aClass( rClass ), - pSaveDocContext( 0 ), - pFrmItemSet( 0 ), + pSaveDocContext( nullptr ), + pFrmItemSet( nullptr ), nToken( nTokn ), nTextFormatColl( nPoolId ), nLeftMargin( 0 ), @@ -255,8 +255,8 @@ public: {} explicit _HTMLAttrContext( sal_uInt16 nTokn ) : - pSaveDocContext( 0 ), - pFrmItemSet( 0 ), + pSaveDocContext( nullptr ), + pFrmItemSet( nullptr ), nToken( nTokn ), nTextFormatColl( 0 ), nLeftMargin( 0 ), @@ -305,7 +305,7 @@ public: void SetPopStack( bool bSet ) { bPopStack = bSet; } bool GetPopStack() const { return bPopStack; } - bool HasSaveDocContext() const { return pSaveDocContext!=0; } + bool HasSaveDocContext() const { return pSaveDocContext!=nullptr; } _HTMLAttrContext_SaveDoc *GetSaveDocContext( bool bCreate=false ); const SfxItemSet *GetFrmItemSet() const { return pFrmItemSet; } @@ -484,7 +484,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient void DocumentDetected(); void Show(); void ShowStatline(); - SwViewShell *CallStartAction( SwViewShell *pVSh = 0, bool bChkPtr = true ); + SwViewShell *CallStartAction( SwViewShell *pVSh = nullptr, bool bChkPtr = true ); SwViewShell *CallEndAction( bool bChkAction = false, bool bChkPtr = true ); SwViewShell *CheckActionViewShell(); @@ -493,7 +493,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient // Attribute am Dok setzen void _SetAttr( bool bChkEnd, bool bBeforeTable, _HTMLAttrs *pPostIts ); inline void SetAttr( bool bChkEnd = true, bool bBeforeTable = false, - _HTMLAttrs *pPostIts = 0 ) + _HTMLAttrs *pPostIts = nullptr ) { if( !m_aSetAttrTab.empty() || !m_aMoveFlyFrms.empty() ) _SetAttr( bChkEnd, bBeforeTable, pPostIts ); @@ -509,7 +509,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient // ppDepAttr gibt einen Attribut-Tabellen-Eintrag an, dessen Attribute // gesetzt sein muessen, bevor das Attribut beendet werden darf void NewAttr( _HTMLAttr **ppAttr, const SfxPoolItem& rItem ); - bool EndAttr( _HTMLAttr *pAttr, _HTMLAttr **ppDepAttr=0, + bool EndAttr( _HTMLAttr *pAttr, _HTMLAttr **ppDepAttr=nullptr, bool bChkEmpty=true ); void DeleteAttr( _HTMLAttr* pAttr ); @@ -552,7 +552,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient // Verwalten von Absatz-Vorlagen // die Vorlagen auf dem Stack bzw. deren Attribute setzen - void SetTextCollAttrs( _HTMLAttrContext *pContext = 0 ); + void SetTextCollAttrs( _HTMLAttrContext *pContext = nullptr ); void InsertParaAttrs( const SfxItemSet& rItemSet ); @@ -606,7 +606,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient void NewMultiCol( sal_uInt16 columnsFromCss=0 ); // <MARQUEE> - void NewMarquee( HTMLTable *pCurTable=0 ); + void NewMarquee( HTMLTable *pCurTable=nullptr ); void EndMarquee(); void InsertMarqueeText(); @@ -633,8 +633,8 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient void NewStdAttr( int nToken ); void NewStdAttr( int nToken, _HTMLAttr **ppAttr, const SfxPoolItem & rItem, - _HTMLAttr **ppAttr2=0, const SfxPoolItem *pItem2=0, - _HTMLAttr **ppAttr3=0, const SfxPoolItem *pItem3=0 ); + _HTMLAttr **ppAttr2=nullptr, const SfxPoolItem *pItem2=nullptr, + _HTMLAttr **ppAttr3=nullptr, const SfxPoolItem *pItem3=nullptr ); void EndTag( int nToken ); // Font-Attribute behandeln @@ -731,8 +731,8 @@ private: // eine Bookmark einfuegen void InsertBookmark( const OUString& rName ); - void InsertCommentText( const sal_Char *pTag = 0 ); - void InsertComment( const OUString& rName, const sal_Char *pTag = 0 ); + void InsertCommentText( const sal_Char *pTag = nullptr ); + void InsertComment( const OUString& rName, const sal_Char *pTag = nullptr ); // sind im aktuellen Absatz Bookmarks vorhanden? bool HasCurrentParaBookmarks( bool bIgnoreStack=false ) const; @@ -756,12 +756,12 @@ private: void EndStyle(); static inline bool HasStyleOptions( const OUString &rStyle, const OUString &rId, - const OUString &rClass, const OUString *pLang=0, - const OUString *pDir=0 ); + const OUString &rClass, const OUString *pLang=nullptr, + const OUString *pDir=nullptr ); bool ParseStyleOptions( const OUString &rStyle, const OUString &rId, const OUString &rClass, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, - const OUString *pLang=0, const OUString *pDir=0 ); + const OUString *pLang=nullptr, const OUString *pDir=nullptr ); // Inserting Controls and Forms (htmlform.cxx) @@ -890,7 +890,7 @@ public: const OUString& rFileName, const OUString& rBaseURL, bool bReadNewDoc = true, - SfxMedium* pMed = 0, bool bReadUTF8 = false, + SfxMedium* pMed = nullptr, bool bReadUTF8 = false, bool bIgnoreHTMLComments = false ); virtual SvParserState CallParser() override; @@ -916,7 +916,7 @@ struct SwPendingStack SwPendingStack* pNext; SwPendingStack( int nTkn, SwPendingStack* pNxt ) - : nToken( nTkn ), pData( 0 ), pNext( pNxt ) + : nToken( nTkn ), pData( nullptr ), pNext( pNxt ) {} }; diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 2f9fd0936cc9..28f7c8f23786 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -91,18 +91,18 @@ static sal_Char sIndentTabs[MAX_INDENT_LEVEL+2] = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; SwHTMLWriter::SwHTMLWriter( const OUString& rBaseURL ) - : m_pHTMLPosFlyFrms(NULL) + : m_pHTMLPosFlyFrms(nullptr) , m_pNumRuleInfo(new SwHTMLNumRuleInfo) - , m_pNextNumRuleInfo(NULL) + , m_pNextNumRuleInfo(nullptr) , m_nHTMLMode(0) , m_eCSS1Unit(FUNIT_NONE) - , m_pFootEndNotes(NULL) + , m_pFootEndNotes(nullptr) , mxFormComps() - , m_pTemplate(NULL) - , m_pDfltColor(NULL) - , m_pStartNdIdx(NULL) - , m_pCurrPageDesc(NULL) - , m_pFormatFootnote(NULL) + , m_pTemplate(nullptr) + , m_pDfltColor(nullptr) + , m_pStartNdIdx(nullptr) + , m_pCurrPageDesc(nullptr) + , m_pFormatFootnote(nullptr) , m_nWarn(0) , m_nLastLFPos(0) , m_nLastParaToken(0) @@ -169,7 +169,7 @@ SwHTMLWriter::~SwHTMLWriter() void SwHTMLWriter::SetupFilterOptions(SfxMedium& rMedium) { const SfxItemSet* pSet = rMedium.GetItemSet(); - if (pSet == NULL) + if (pSet == nullptr) return; const SfxPoolItem* pItem; @@ -204,7 +204,7 @@ sal_uLong SwHTMLWriter::WriteStream() // ueberhaupt Styles ausgeben // (dann auch obere und untere Absatz-Abstaende) m_nExportMode = rHtmlOptions.GetExportMode(); - m_nHTMLMode = GetHtmlMode(0); + m_nHTMLMode = GetHtmlMode(nullptr); if( HTML_CFG_WRITER == m_nExportMode || HTML_CFG_NS40 == m_nExportMode ) m_nHTMLMode |= HTMLMODE_BLOCK_SPACER; @@ -281,9 +281,9 @@ sal_uLong SwHTMLWriter::WriteStream() ::StartProgress( STR_STATSTR_W4WWRITE, 0, pDoc->GetNodes().Count(), pDoc->GetDocShell()); - m_pDfltColor = 0; - m_pFootEndNotes = 0; - m_pFormatFootnote = 0; + m_pDfltColor = nullptr; + m_pFootEndNotes = nullptr; + m_pFormatFootnote = nullptr; m_bOutTable = m_bOutHeader = m_bOutFooter = m_bOutFlyFrame = false; mxFormComps.clear(); m_nFormCntrlCnt = 0; @@ -327,7 +327,7 @@ sal_uLong SwHTMLWriter::WriteStream() m_nWarn = 0; GetNumInfo().Clear(); - m_pNextNumRuleInfo = 0; + m_pNextNumRuleInfo = nullptr; OString aStartTags; @@ -378,7 +378,7 @@ sal_uLong SwHTMLWriter::WriteStream() // Tabelle fuer die freifliegenden Rahmen erzeugen, aber nur wenn // das gesamte Dokument geschrieben wird - m_pHTMLPosFlyFrms = 0; + m_pHTMLPosFlyFrms = nullptr; CollectFlyFrms(); m_nLastParaToken = 0; GetControls(); @@ -443,7 +443,7 @@ sal_uLong SwHTMLWriter::WriteStream() { m_pHTMLPosFlyFrms->DeleteAndDestroyAll(); delete m_pHTMLPosFlyFrms; - m_pHTMLPosFlyFrms = 0; + m_pHTMLPosFlyFrms = nullptr; } m_aHTMLControls.DeleteAndDestroyAll(); @@ -469,17 +469,17 @@ sal_uLong SwHTMLWriter::WriteStream() m_aScriptTextStyles.clear(); delete m_pDfltColor; - m_pDfltColor = 0; + m_pDfltColor = nullptr; delete m_pStartNdIdx; - m_pStartNdIdx = 0; + m_pStartNdIdx = nullptr; mxFormComps.clear(); OSL_ENSURE( !m_pFootEndNotes, "SwHTMLWriter::Write: Footnotes nicht durch OutFootEndNotes geloescht" ); - m_pCurrPageDesc = 0; + m_pCurrPageDesc = nullptr; ClearNextNumInfo(); @@ -513,7 +513,7 @@ sal_uLong SwHTMLWriter::WriteStream() if( 0 == m_pTemplate->release() ) delete m_pTemplate; - m_pTemplate = 0; + m_pTemplate = nullptr; } return m_nWarn; @@ -522,7 +522,7 @@ sal_uLong SwHTMLWriter::WriteStream() static const SwFormatCol *lcl_html_GetFormatCol( const SwSection& rSection, const SwSectionFormat& rFormat ) { - const SwFormatCol *pCol = 0; + const SwFormatCol *pCol = nullptr; const SfxPoolItem* pItem; if( FILE_LINK_SECTION != rSection.GetType() && @@ -684,10 +684,10 @@ static Writer& OutHTML_Section( Writer& rWrt, const SwSectionNode& rSectNd ) bool bStartTag = true; bool bEndTag = true; - const SwSectionFormat *pSurrFormat = 0; - const SwSectionNode *pSurrSectNd = 0; - const SwSection *pSurrSection = 0; - const SwFormatCol *pSurrCol = 0; + const SwSectionFormat *pSurrFormat = nullptr; + const SwSectionNode *pSurrSectNd = nullptr; + const SwSection *pSurrSection = nullptr; + const SwFormatCol *pSurrCol = nullptr; sal_uInt32 nSectSttIdx = rSectNd.GetIndex(); sal_uInt32 nSectEndIdx = rSectNd.EndOfSectionIndex(); @@ -792,7 +792,7 @@ void SwHTMLWriter::Out_SwDoc( SwPaM* pPam ) } else if( rNd.IsTableNode() ) { - OutHTML_SwTableNode( *this, *rNd.GetTableNode(), 0 ); + OutHTML_SwTableNode( *this, *rNd.GetTableNode(), nullptr ); m_nBkmkTabPos = bWriteAll ? FindPos_Bkmk( *pCurPam->GetPoint() ) : -1; } else if( rNd.IsSectionNode() ) @@ -833,16 +833,16 @@ void SwHTMLWriter::Out_SwDoc( SwPaM* pPam ) static void OutBodyColor( const sal_Char* pTag, const SwFormat *pFormat, SwHTMLWriter& rHWrt ) { - const SwFormat *pRefFormat = 0; + const SwFormat *pRefFormat = nullptr; if( rHWrt.m_pTemplate ) pRefFormat = SwHTMLWriter::GetTemplateFormat( pFormat->GetPoolFormatId(), &rHWrt.m_pTemplate->getIDocumentStylePoolAccess() ); - const SvxColorItem *pColorItem = 0; + const SvxColorItem *pColorItem = nullptr; const SfxItemSet& rItemSet = pFormat->GetAttrSet(); - const SfxPoolItem *pRefItem = 0, *pItem = 0; + const SfxPoolItem *pRefItem = nullptr, *pItem = nullptr; bool bItemSet = SfxItemState::SET == rItemSet.GetItemState( RES_CHRATR_COLOR, true, &pItem); bool bRefItemSet = pRefFormat && @@ -900,9 +900,9 @@ sal_uInt16 SwHTMLWriter::OutHeaderAttrs() sal_uLong nIdx = pCurPam->GetPoint()->nNode.GetIndex(); sal_uLong nEndIdx = pCurPam->GetMark()->nNode.GetIndex(); - SwTextNode *pTextNd = 0; + SwTextNode *pTextNd = nullptr; while( nIdx<=nEndIdx && - 0==(pTextNd=pDoc->GetNodes()[nIdx]->GetTextNode()) ) + nullptr==(pTextNd=pDoc->GetNodes()[nIdx]->GetTextNode()) ) nIdx++; OSL_ENSURE( pTextNd, "Kein Text-Node gefunden" ); @@ -980,7 +980,7 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs ) OutFootEndNoteInfo(); } - const SwPageDesc *pPageDesc = 0; + const SwPageDesc *pPageDesc = nullptr; // In Nicht-HTML-Dokumenten wird die erste gesetzte Seitenvorlage // exportiert und wenn keine gesetzt ist die Standard-Vorlage @@ -1081,7 +1081,7 @@ void SwHTMLWriter::OutAnchor( const OUString& rName ) void SwHTMLWriter::OutBookmarks() { // hole das aktuelle Bookmark - const ::sw::mark::IMark* pBookmark = NULL; + const ::sw::mark::IMark* pBookmark = nullptr; IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); if(m_nBkmkTabPos != -1) pBookmark = (pMarkAccess->getAllMarksBegin() + m_nBkmkTabPos)->get(); @@ -1410,14 +1410,14 @@ HTMLSaveData::HTMLSaveData(SwHTMLWriter& rWriter, sal_uLong nStt, : rWrt(rWriter) , pOldPam(rWrt.pCurPam) , pOldEnd(rWrt.GetEndPaM()) - , pOldNumRuleInfo(0) - , pOldNextNumRuleInfo(0) + , pOldNumRuleInfo(nullptr) + , pOldNextNumRuleInfo(nullptr) , nOldDefListLvl(rWrt.m_nDefListLvl) , nOldDirection(rWrt.m_nDirection) , bOldOutHeader(rWrt.m_bOutHeader) , bOldOutFooter(rWrt.m_bOutFooter) , bOldOutFlyFrame(rWrt.m_bOutFlyFrame) - , pOldFlyFormat(NULL) + , pOldFlyFormat(nullptr) { bOldWriteAll = rWrt.bWriteAll; @@ -1444,7 +1444,7 @@ HTMLSaveData::HTMLSaveData(SwHTMLWriter& rWriter, sal_uLong nStt, { pOldNumRuleInfo = new SwHTMLNumRuleInfo( rWrt.GetNumInfo() ); pOldNextNumRuleInfo = rWrt.GetNextNumInfo(); - rWrt.SetNextNumInfo( 0 ); + rWrt.SetNextNumInfo( nullptr ); } else { diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index f8dc35c01000..9a2704af74a4 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -230,8 +230,8 @@ struct SwHTMLFormatInfo // Konstruktor fuer einen Dummy zum Suchen explicit SwHTMLFormatInfo( const SwFormat *pF ) : pFormat( pF ), - pRefFormat(0), - pItemSet( 0 ), + pRefFormat(nullptr), + pItemSet( nullptr ), nLeftMargin( 0 ), nRightMargin( 0 ), nFirstLineIndent(0), @@ -417,11 +417,11 @@ public: // gebe die evt. an der akt. Position stehenden FlyFrame aus. bool OutFlyFrm( sal_uLong nNdIdx, sal_Int32 nContentIdx, - sal_uInt8 nPos, HTMLOutContext *pContext = 0 ); + sal_uInt8 nPos, HTMLOutContext *pContext = nullptr ); void OutFrameFormat( sal_uInt8 nType, const SwFrameFormat& rFormat, const SdrObject *pSdrObj ); - void OutForm( bool bTagOn=true, const SwStartNode *pStNd=0 ); + void OutForm( bool bTagOn=true, const SwStartNode *pStNd=nullptr ); void OutHiddenForms(); void OutHiddenForm( const css::uno::Reference<css::form::XForm>& rForm ); @@ -478,8 +478,8 @@ public: void OutCSS1_TableCellBorderHack(const SwFrameFormat& rFrameFormat); void OutCSS1_SectionFormatOptions( const SwFrameFormat& rFrameFormat, const SwFormatCol *pCol ); void OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat, sal_uInt32 nFrmOpts, - const SdrObject *pSdrObj=0, - const SfxItemSet *pItemSet=0 ); + const SdrObject *pSdrObj=nullptr, + const SfxItemSet *pItemSet=nullptr ); void OutCSS1_FrameFormatBackground( const SwFrameFormat& rFrameFormat ); void ChangeParaToken( sal_uInt16 nNew ); @@ -534,7 +534,7 @@ public: static const SdrObject* GetMarqueeTextObj( const SwDrawFrameFormat& rFormat ); static sal_uInt16 GetCSS1Selector( const SwFormat *pFormat, OString& rToken, OUString& rClass, sal_uInt16& rRefPoolId, - OUString *pPseudo=0 ); + OUString *pPseudo=nullptr ); static const SwFormat *GetTemplateFormat( sal_uInt16 nPoolId, IDocumentStylePoolAccess* /*SwDoc*/ pTemplate ); static const SwFormat *GetParentFormat( const SwFormat& rFormat, sal_uInt16 nDeep ); @@ -543,7 +543,7 @@ public: const SfxItemSet& rRefItemSet, bool bSetDefaults, bool bClearSame = true, - const SfxItemSet *pRefScriptItemSet=0 ); + const SfxItemSet *pRefScriptItemSet=nullptr ); static bool HasScriptDependentItems( const SfxItemSet& rItemSet, bool bCheckDropCap ); @@ -590,19 +590,19 @@ inline bool SwHTMLWriter::IsCSS1Script( sal_uInt16 n ) const inline void SwHTMLWriter::OutCSS1_PropertyAscii( const sal_Char *pProp, const sal_Char *pVal ) { - OutCSS1_Property( pProp, pVal, 0 ); + OutCSS1_Property( pProp, pVal, nullptr ); } inline void SwHTMLWriter::OutCSS1_PropertyAscii( const sal_Char *pProp, const OString& rVal ) { - OutCSS1_Property( pProp, rVal.getStr(), 0 ); + OutCSS1_Property( pProp, rVal.getStr(), nullptr ); } inline void SwHTMLWriter::OutCSS1_Property( const sal_Char *pProp, const OUString& rVal ) { - OutCSS1_Property( pProp, 0, &rVal ); + OutCSS1_Property( pProp, nullptr, &rVal ); } // Struktur speichert die aktuellen Daten des Writers zwischen, um @@ -628,7 +628,7 @@ struct HTMLSaveData HTMLSaveData( SwHTMLWriter&, sal_uLong nStt, sal_uLong nEnd, bool bSaveNum=true, - const SwFrameFormat *pFrameFormat=0 ); + const SwFrameFormat *pFrameFormat=nullptr ); ~HTMLSaveData(); }; @@ -640,7 +640,7 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rForma Writer& OutHTML_SwTextNode( Writer&, const SwContentNode& ); Writer& OutHTML_SwTableNode( Writer& , SwTableNode &, const SwFrameFormat *, - const OUString* pCaption=0, bool bTopCaption=false ); + const OUString* pCaption=nullptr, bool bTopCaption=false ); Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, const SwDrawFrameFormat& rFormat, const SdrUnoObj& rSdrObj, bool bInCntnr ); @@ -653,8 +653,8 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat, Writer& OutHTML_Image( Writer&, const SwFrameFormat& rFormat, Graphic& rGraphic, const OUString& rAlternateText, const Size& rRealSize, sal_uInt32 nFrmOpts, - const sal_Char *pMarkType = 0, - const ImageMap *pGenImgMap = 0 ); + const sal_Char *pMarkType = nullptr, + const ImageMap *pGenImgMap = nullptr ); Writer& OutHTML_BulletImage( Writer& rWrt, const sal_Char *pTag, const SvxBrushItem* pBrush ); diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index 572baff5eba0..002990df6143 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -178,7 +178,7 @@ public: void StealAttr(const SwNodeIndex& rNode, sal_uInt16 nAttrId = 0); void MarkAllAttrsOld(); void KillUnlockedAttrs(const SwPosition& pPos); - SfxPoolItem* GetFormatStackAttr(sal_uInt16 nWhich, sal_uInt16 * pPos = 0); + SfxPoolItem* GetFormatStackAttr(sal_uInt16 nWhich, sal_uInt16 * pPos = nullptr); const SfxPoolItem* GetOpenStackAttr(const SwPosition& rPos, sal_uInt16 nWhich); void Delete(const SwPaM &rPam); @@ -203,7 +203,7 @@ public: // "pure virtual Methoden" vom SfxPoolItem virtual bool operator==(const SfxPoolItem&) const override; - virtual SfxPoolItem* Clone(SfxItemPool* = 0) const override; + virtual SfxPoolItem* Clone(SfxItemPool* = nullptr) const override; void SetFrameFormat(SwFrameFormat * _pFrameFormat); const SwFrameFormat* GetFrameFormat() const { return pFrameFormat;} SwFrameFormat* GetFrameFormat() { return pFrameFormat;} @@ -234,7 +234,7 @@ public: const DateTime& rStamp_, RedlineType_t eTypePrev_ = nsRedlineType_t::REDLINE_INSERT, sal_uInt16 nAutorNoPrev_ = USHRT_MAX, - const DateTime* pStampPrev_ = 0) + const DateTime* pStampPrev_ = nullptr) : SfxPoolItem(RES_FLTR_REDLINE), aStamp(rStamp_), aStampPrev( DateTime::EMPTY ), eType(eType_), @@ -255,7 +255,7 @@ public: {} // "pure virtual Methoden" vom SfxPoolItem virtual bool operator==(const SfxPoolItem& rItem) const override; - virtual SfxPoolItem* Clone(SfxItemPool* = 0) const override; + virtual SfxPoolItem* Clone(SfxItemPool* = nullptr) const override; }; class SW_DLLPUBLIC SwFltBookmark : public SfxPoolItem @@ -276,7 +276,7 @@ public: // "pure virtual Methoden" vom SfxPoolItem virtual bool operator==(const SfxPoolItem&) const override; - virtual SfxPoolItem* Clone(SfxItemPool* = 0) const override; + virtual SfxPoolItem* Clone(SfxItemPool* = nullptr) const override; long GetHandle() const { return mnHandle; } const OUString& GetName() const { return maName; } @@ -298,7 +298,7 @@ public: SwFltTOX(const SwFltTOX&); // "pure virtual Methoden" vom SfxPoolItem virtual bool operator==(const SfxPoolItem&) const override; - virtual SfxPoolItem* Clone(SfxItemPool* = 0) const override; + virtual SfxPoolItem* Clone(SfxItemPool* = nullptr) const override; SwTOXBase* GetBase() { return pTOXBase; } void SetHadBreakItem( bool bVal ) { bHadBreakItem = bVal; } void SetHadPageDescItem( bool bVal ) { bHadPageDescItem = bVal; } diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 429e3f65b20e..7e2ef5ebcfec 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -49,7 +49,7 @@ sal_uLong SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rP // We want to work in an empty paragraph. // Step 1: XTextRange will be updated when content is inserted, so we know // the end position. - const uno::Reference<text::XTextRange> xInsertPosition = SwXTextRange::CreateXTextRange(rDoc, *rPam.GetPoint(), 0); + const uno::Reference<text::XTextRange> xInsertPosition = SwXTextRange::CreateXTextRange(rDoc, *rPam.GetPoint(), nullptr); std::shared_ptr<SwNodeIndex> pSttNdIdx(new SwNodeIndex(rDoc.GetNodes())); const SwPosition* pPos = rPam.GetPoint(); @@ -75,7 +75,7 @@ sal_uLong SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rP xImporter->setTargetDocument(xDstDoc); const uno::Reference<text::XTextRange> xInsertTextRange = - SwXTextRange::CreateXTextRange(rDoc, *rPam.GetPoint(), 0); + SwXTextRange::CreateXTextRange(rDoc, *rPam.GetPoint(), nullptr); uno::Reference<document::XFilter> xFilter(xInterface, uno::UNO_QUERY_THROW); uno::Sequence<beans::PropertyValue> aDescriptor(3); diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index 0274d5b35959..6eff01aecd90 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -74,7 +74,7 @@ struct Writer_Impl }; Writer_Impl::Writer_Impl() - : m_pStream(0) + : m_pStream(nullptr) { } @@ -119,7 +119,7 @@ void Writer_Impl::InsertBkmk(const ::sw::mark::IMark& rBkmk) Writer::Writer() : m_pImpl(o3tl::make_unique<Writer_Impl>()) - , pOrigPam(0), pOrigFileName(0), pDoc(0), pCurPam(0) + , pOrigPam(nullptr), pOrigFileName(nullptr), pDoc(nullptr), pCurPam(nullptr) { bWriteAll = bShowProgress = bUCS2_WithStartChar = true; bASCII_NoLastLineEnd = bASCII_ParaAsBlanc = bASCII_ParaAsCR = @@ -151,9 +151,9 @@ void Writer::ResetWriter() delete pCurPam->GetNext(); delete pCurPam; } - pCurPam = 0; - pOrigFileName = 0; - pDoc = 0; + pCurPam = nullptr; + pOrigFileName = nullptr; + pDoc = nullptr; bShowProgress = bUCS2_WithStartChar = true; bASCII_NoLastLineEnd = bASCII_ParaAsBlanc = bASCII_ParaAsCR = @@ -200,7 +200,7 @@ Writer::NewSwPaM(SwDoc & rDoc, sal_uLong const nStartIdx, sal_uLong const nEndId SwNodeIndex aStt( *pNds, nStartIdx ); SwContentNode* pCNode = aStt.GetNode().GetContentNode(); - if( !pCNode && 0 == pNds->GoNext( &aStt ) ) + if( !pCNode && nullptr == pNds->GoNext( &aStt ) ) { OSL_FAIL( "No more ContentNode at StartPos" ); } @@ -320,7 +320,7 @@ void Writer::PutNumFormatFontsInAttrPool() if( SVX_NUM_CHAR_SPECIAL == (pFormat = &pRule->Get( nLvl ))->GetNumberingType() || SVX_NUM_BITMAP == pFormat->GetNumberingType() ) { - if( 0 == ( pFont = pFormat->GetBulletFont() ) ) + if( nullptr == ( pFont = pFormat->GetBulletFont() ) ) pFont = pDefFont; if( bCheck ) @@ -356,12 +356,12 @@ void Writer::_AddFontItems( SfxItemPool& rPool, sal_uInt16 nW ) const SvxFontItem* pFont = static_cast<const SvxFontItem*>(&rPool.GetDefaultItem( nW )); _AddFontItem( rPool, *pFont ); - if( 0 != ( pFont = static_cast<const SvxFontItem*>(rPool.GetPoolDefaultItem( nW ))) ) + if( nullptr != ( pFont = static_cast<const SvxFontItem*>(rPool.GetPoolDefaultItem( nW ))) ) _AddFontItem( rPool, *pFont ); sal_uInt32 nMaxItem = rPool.GetItemCount2( nW ); for( sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet ) - if( 0 != (pFont = static_cast<const SvxFontItem*>(rPool.GetItem2( nW, nGet ))) ) + if( nullptr != (pFont = static_cast<const SvxFontItem*>(rPool.GetItem2( nW, nGet ))) ) _AddFontItem( rPool, *pFont ); } @@ -448,7 +448,7 @@ sal_uLong StgWriter::WriteStream() sal_uLong StgWriter::Write( SwPaM& rPaM, SotStorage& rStg, const OUString* pFName ) { - SetStream(0); + SetStream(nullptr); pStg = &rStg; pDoc = rPaM.GetDoc(); pOrigFileName = pFName; @@ -460,7 +460,7 @@ sal_uLong StgWriter::Write( SwPaM& rPaM, SotStorage& rStg, const OUString* pFNam sal_uLong nRet = WriteStorage(); - pStg = NULL; + pStg = nullptr; ResetWriter(); return nRet; @@ -468,8 +468,8 @@ sal_uLong StgWriter::Write( SwPaM& rPaM, SotStorage& rStg, const OUString* pFNam sal_uLong StgWriter::Write( SwPaM& rPaM, const uno::Reference < embed::XStorage >& rStg, const OUString* pFName, SfxMedium* pMedium ) { - SetStream(0); - pStg = 0; + SetStream(nullptr); + pStg = nullptr; xStg = rStg; pDoc = rPaM.GetDoc(); pOrigFileName = pFName; @@ -481,7 +481,7 @@ sal_uLong StgWriter::Write( SwPaM& rPaM, const uno::Reference < embed::XStorage sal_uLong nRet = pMedium ? WriteMedium( *pMedium ) : WriteStorage(); - pStg = NULL; + pStg = nullptr; ResetWriter(); return nRet; diff --git a/sw/source/filter/writer/wrt_fn.cxx b/sw/source/filter/writer/wrt_fn.cxx index de5a7c17e1bc..48adecc576c4 100644 --- a/sw/source/filter/writer/wrt_fn.cxx +++ b/sw/source/filter/writer/wrt_fn.cxx @@ -30,7 +30,7 @@ Writer& Out( const SwAttrFnTab pTab, const SfxPoolItem& rHt, Writer & rWrt ) sal_uInt16 nId = rHt.Which(); OSL_ENSURE( nId < POOLATTR_END && nId >= POOLATTR_BEGIN, "SwAttrFnTab::Out()" ); FnAttrOut pOut; - if( 0 != ( pOut = pTab[ nId - RES_CHRATR_BEGIN] )) + if( nullptr != ( pOut = pTab[ nId - RES_CHRATR_BEGIN] )) (*pOut)( rWrt, rHt ); return rWrt; @@ -47,12 +47,12 @@ Writer& Out_SfxItemSet( const SwAttrFnTab pTab, Writer& rWrt, { if( !bDeep ) return rWrt; - while( 0 != ( pSet = pSet->GetParent() ) && !pSet->Count() ) + while( nullptr != ( pSet = pSet->GetParent() ) && !pSet->Count() ) ; if( !pSet ) return rWrt; } - const SfxPoolItem* pItem(0); + const SfxPoolItem* pItem(nullptr); FnAttrOut pOut; if( !bDeep || !pSet->GetParent() ) { @@ -61,9 +61,9 @@ Writer& Out_SfxItemSet( const SwAttrFnTab pTab, Writer& rWrt, pItem = aIter.GetCurItem(); do { // pTab only covers POOLATTR_BEGIN..POOLATTR_END. - if( pItem->Which() <= POOLATTR_END && 0 != ( pOut = pTab[ pItem->Which() - RES_CHRATR_BEGIN] )) + if( pItem->Which() <= POOLATTR_END && nullptr != ( pOut = pTab[ pItem->Which() - RES_CHRATR_BEGIN] )) (*pOut)( rWrt, *pItem ); - } while( !aIter.IsAtEnd() && 0 != ( pItem = aIter.NextItem() ) ); + } while( !aIter.IsAtEnd() && nullptr != ( pItem = aIter.NextItem() ) ); } else { @@ -76,7 +76,7 @@ Writer& Out_SfxItemSet( const SwAttrFnTab pTab, Writer& rWrt, *pItem != rPool.GetDefaultItem( nWhich ) || ( pSet->GetParent() && *pItem != pSet->GetParent()->Get( nWhich )) - )) && 0 != ( pOut = pTab[ nWhich - RES_CHRATR_BEGIN] )) + )) && nullptr != ( pOut = pTab[ nWhich - RES_CHRATR_BEGIN] )) (*pOut)( rWrt, *pItem ); nWhich = aIter.NextWhich(); } @@ -108,7 +108,7 @@ Writer& Out( const SwNodeFnTab pTab, SwNode& rNode, Writer & rWrt ) break; } FnNodeOut pOut; - if( 0 != ( pOut = pTab[ nId - RES_NODE_BEGIN ] )) + if( nullptr != ( pOut = pTab[ nId - RES_NODE_BEGIN ] )) (*pOut)( rWrt, *pCNd ); return rWrt; } diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx index 0dadce9a5b1b..a9475d2e68b6 100644 --- a/sw/source/filter/writer/wrtswtbl.cxx +++ b/sw/source/filter/writer/wrtswtbl.cxx @@ -52,7 +52,7 @@ sal_Int16 SwWriteTableCell::GetVertOri() const } SwWriteTableRow::SwWriteTableRow( long nPosition, bool bUseLayoutHeights ) - : pBackground(0), nPos(nPosition), mbUseLayoutHeights(bUseLayoutHeights), + : pBackground(nullptr), nPos(nPosition), mbUseLayoutHeights(bUseLayoutHeights), nTopBorder(USHRT_MAX), nBottomBorder(USHRT_MAX), bTopBorder(true), bBottomBorder(true) { @@ -174,17 +174,17 @@ const SvxBrushItem *SwWriteTable::GetLineBrush( const SwTableBox *pBox, { if( !pRow->GetBackground() ) pRow->SetBackground( static_cast<const SvxBrushItem *>(pItem) ); - pItem = 0; + pItem = nullptr; } return static_cast<const SvxBrushItem *>(pItem); } pBox = pLine->GetUpper(); - pLine = pBox ? pBox->GetUpper() : 0; + pLine = pBox ? pBox->GetUpper() : nullptr; } - return 0; + return nullptr; } void SwWriteTable::MergeBorders( const SvxBorderLine* pBorderLine, @@ -362,7 +362,7 @@ long SwWriteTable::GetAbsHeight(long nRawHeight, size_t const nRow, // Additional subtract in the first column CELLSPACING and // line thickness once again. - const SwWriteTableRow *pRow = 0; + const SwWriteTableRow *pRow = nullptr; if( nRow==0 ) { nRawHeight -= nCellSpacing; @@ -607,7 +607,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow, if( bOutAtRow ) { pRow->SetBackground( pLineBrush ); - pBrushItem = 0; + pBrushItem = nullptr; } else pBrushItem = pLineBrush; @@ -615,7 +615,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow, else { pRow->SetBackground( pLineBrush ); - pBrushItem = 0; + pBrushItem = nullptr; } const SwTableBoxes::size_type nBoxes = rBoxes.size(); @@ -750,7 +750,7 @@ SwWriteTable::SwWriteTable(const SwTable* pTable, const SwTableLines& rLines, lo // and is highly coupled to CollectTableRowsCols - sadly. bUseLayoutHeights = true; // And now fill with life - FillTableRowsCols( 0, 0, 0, 0, 0, nParentWidth, rLines, 0, nMaxDepth - 1, static_cast< sal_uInt16 >(nNumOfRowsToRepeat) ); + FillTableRowsCols( 0, 0, 0, 0, 0, nParentWidth, rLines, nullptr, nMaxDepth - 1, static_cast< sal_uInt16 >(nNumOfRowsToRepeat) ); // Adjust some Twip values to pixel boundaries if( !nBorder ) 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 ) { } diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index 099d0c6e8318..73b6d293d3f3 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -55,7 +55,7 @@ static SwDoc* lcl_GetDocViaTunnel( Reference<XTextCursor> & rCursor ) OTextCursorHelper *const pXCursor = ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xTunnel); OSL_ENSURE( pXCursor, "OTextCursorHelper missing" ); - return (pXCursor) ? pXCursor->GetDoc() : 0; + return (pXCursor) ? pXCursor->GetDoc() : nullptr; } static SwDoc* lcl_GetDocViaTunnel( Reference<XTextRange> & rRange ) @@ -66,7 +66,7 @@ static SwDoc* lcl_GetDocViaTunnel( Reference<XTextRange> & rRange ) ::sw::UnoTunnelGetImplementation<SwXTextRange>(xTunnel); // #i115174#: this may be a SvxUnoTextRange // OSL_ENSURE( pXRange, "SwXTextRange missing" ); - return (pXRange) ? &pXRange->GetDoc() : 0; + return (pXRange) ? &pXRange->GetDoc() : nullptr; } // XTextRangeOrNodeIndexPosition: store a position into the text @@ -97,8 +97,8 @@ public: }; XTextRangeOrNodeIndexPosition::XTextRangeOrNodeIndexPosition() : - xRange(NULL), - pIndex(NULL) + xRange(nullptr), + pIndex(nullptr) { } @@ -110,21 +110,21 @@ XTextRangeOrNodeIndexPosition::~XTextRangeOrNodeIndexPosition() void XTextRangeOrNodeIndexPosition::Set( Reference<XTextRange> & rRange ) { xRange = rRange->getStart(); // set bookmark - if (NULL != pIndex) + if (nullptr != pIndex) { delete pIndex; - pIndex = NULL; + pIndex = nullptr; } } void XTextRangeOrNodeIndexPosition::Set( SwNodeIndex& rIndex ) { - if (NULL != pIndex) + if (nullptr != pIndex) delete pIndex; pIndex = new SwNodeIndex(rIndex); (*pIndex)-- ; // previous node!!! - xRange = NULL; + xRange = nullptr; } void XTextRangeOrNodeIndexPosition::SetAsNodeIndex( @@ -154,7 +154,7 @@ XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos, SwDoc & rDoc) OSL_ENSURE(IsValid(), "Can't get Position"); // create PAM from start cursor (if no node index is present) - if (NULL == pIndex) + if (nullptr == pIndex) { SwUnoInternalPaM aUnoPaM(rDoc); bool bSuccess = ::sw::XTextRangeToSwPaM(aUnoPaM, xRange); @@ -174,12 +174,12 @@ SwDoc* XTextRangeOrNodeIndexPosition::GetDoc() { OSL_ENSURE(IsValid(), "Can't get Doc"); - return (NULL != pIndex) ? pIndex->GetNodes().GetDoc() : lcl_GetDocViaTunnel(xRange); + return (nullptr != pIndex) ? pIndex->GetNodes().GetDoc() : lcl_GetDocViaTunnel(xRange); } bool XTextRangeOrNodeIndexPosition::IsValid() { - return ( xRange.is() || (pIndex != NULL) ); + return ( xRange.is() || (pIndex != nullptr) ); } // RedlineInfo: temporary storage for redline data @@ -224,8 +224,8 @@ RedlineInfo::RedlineInfo() : bMergeLastParagraph( false ), aAnchorStart(), aAnchorEnd(), - pContentIndex(NULL), - pNextRedline(NULL), + pContentIndex(nullptr), + pNextRedline(nullptr), bNeedsAdjustment( false ) { } @@ -428,7 +428,7 @@ void XMLRedlineImportHelper::Add( // find last element RedlineInfo* pInfoChain; for( pInfoChain = aRedlineMap[rId]; - NULL != pInfoChain->pNextRedline; + nullptr != pInfoChain->pNextRedline; pInfoChain = pInfoChain->pNextRedline) ; // empty loop // insert as last element @@ -456,7 +456,7 @@ Reference<XTextCursor> XMLRedlineImportHelper::CreateRedlineTextSection( { OSL_TRACE("XMLRedlineImportHelper::CreateRedlineTextSection: " "no SwDoc => cannot create section."); - return 0; + return nullptr; } // create text section for redline @@ -577,7 +577,7 @@ inline bool XMLRedlineImportHelper::IsReady(RedlineInfo* pRedline) void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo) { - OSL_ENSURE(NULL != pRedlineInfo, "need redline info"); + OSL_ENSURE(nullptr != pRedlineInfo, "need redline info"); OSL_ENSURE(IsReady(pRedlineInfo), "redline info not complete yet!"); // this method will modify the document directly -> lock SolarMutex @@ -615,7 +615,7 @@ void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo) // a) bIgnoreRedline (e.g. insert mode) // b) illegal PaM range (CheckNodesRange()) // 3) normal case: insert redline - if( !aPaM.HasMark() && (pRedlineInfo->pContentIndex == NULL) ) + if( !aPaM.HasMark() && (pRedlineInfo->pContentIndex == nullptr) ) { // these redlines have no function, and will thus be ignored (just as // in sw3io), so no action here @@ -632,7 +632,7 @@ void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo) pDoc->getIDocumentContentOperations().DeleteRange(aPaM); // And what about the "deleted nodes"? // They have to be deleted as well (#i80689)! - if( bIgnoreRedlines && pRedlineInfo->pContentIndex != NULL ) + if( bIgnoreRedlines && pRedlineInfo->pContentIndex != nullptr ) { SwNodeIndex aIdx( *pRedlineInfo->pContentIndex ); const SwNode* pEnd = aIdx.GetNode().EndOfSectionNode(); @@ -663,7 +663,7 @@ void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo) } // set content node (if necessary) - if (NULL != pRedlineInfo->pContentIndex) + if (nullptr != pRedlineInfo->pContentIndex) { sal_uLong nPoint = aPaM.GetPoint()->nNode.GetIndex(); if( nPoint < pRedlineInfo->pContentIndex->GetIndex() || @@ -688,7 +688,7 @@ SwRedlineData* XMLRedlineImportHelper::ConvertRedline( { // convert info: // 1) Author String -> Author ID (default to zero) - sal_uInt16 nAuthorId = (NULL == pDoc) ? 0 : + sal_uInt16 nAuthorId = (nullptr == pDoc) ? 0 : pDoc->getIDocumentRedlineAccess().InsertRedlineAuthor( pRedlineInfo->sAuthor ); // 2) util::DateTime -> DateTime @@ -703,8 +703,8 @@ SwRedlineData* XMLRedlineImportHelper::ConvertRedline( // 3) recursively convert next redline // ( check presence and sanity of hierarchical redline info ) - SwRedlineData* pNext = NULL; - if ( (NULL != pRedlineInfo->pNextRedline) && + SwRedlineData* pNext = nullptr; + if ( (nullptr != pRedlineInfo->pNextRedline) && (nsRedlineType_t::REDLINE_DELETE == pRedlineInfo->eType) && (nsRedlineType_t::REDLINE_INSERT == pRedlineInfo->pNextRedline->eType) ) { @@ -716,7 +716,7 @@ SwRedlineData* XMLRedlineImportHelper::ConvertRedline( nAuthorId, aDT, pRedlineInfo->sComment, pNext, // next data (if available) - NULL); // no extra data + nullptr); // no extra data return pData; } diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index c0a265443363..1812e511639d 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -85,7 +85,7 @@ using namespace ::com::sun::star::lang; static void lcl_EnsureValidPam( SwPaM& rPam ) { - if( rPam.GetContentNode() != NULL ) + if( rPam.GetContentNode() != nullptr ) { // set proper point content if( rPam.GetContentNode() != rPam.GetPoint()->nContent.GetIdxReg() ) @@ -95,7 +95,7 @@ static void lcl_EnsureValidPam( SwPaM& rPam ) // else: point was already valid // if mark is invalid, we delete it - if( ( rPam.GetContentNode( false ) == NULL ) || + if( ( rPam.GetContentNode( false ) == nullptr ) || ( rPam.GetContentNode( false ) != rPam.GetMark()->nContent.GetIdxReg() ) ) { rPam.DeleteMark(); @@ -139,7 +139,7 @@ sal_Int32 ReadThroughComponent( OSL_ENSURE(xInputStream.is(), "input stream missing"); OSL_ENSURE(xModelComponent.is(), "document missing"); OSL_ENSURE(rxContext.is(), "factory missing"); - OSL_ENSURE(NULL != pFilterName,"I need a service name for the component!"); + OSL_ENSURE(nullptr != pFilterName,"I need a service name for the component!"); // prepare ParserInputSrouce xml::sax::InputSource aParserInput; @@ -288,7 +288,7 @@ sal_Int32 ReadThroughComponent( bool bMustBeSuccessfull) { OSL_ENSURE(xStorage.is(), "Need storage!"); - OSL_ENSURE(NULL != pStreamName, "Please, please, give me a name!"); + OSL_ENSURE(nullptr != pStreamName, "Please, please, give me a name!"); // open stream (and set parser input) OUString sStreamName = OUString::createFromAscii(pStreamName); @@ -307,7 +307,7 @@ sal_Int32 ReadThroughComponent( // if no stream can be opened, return immediately with OK signal // do we even have an alternative name? - if ( NULL == pCompatibilityStreamName ) + if ( nullptr == pCompatibilityStreamName ) return 0; // if so, does the stream exist? @@ -398,7 +398,7 @@ static void lcl_AdjustOutlineStylesForOOo(SwDoc& _rDoc) for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i ) { aOutlineLevelAssigned[ i ] = false; - aCreatedDefaultOutlineStyles[ i ] = 0L; + aCreatedDefaultOutlineStyles[ i ] = nullptr; } } @@ -415,7 +415,7 @@ static void lcl_AdjustOutlineStylesForOOo(SwDoc& _rDoc) for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i ) { - if ( aCreatedDefaultOutlineStyles[ i ] == 0L && + if ( aCreatedDefaultOutlineStyles[ i ] == nullptr && pColl->GetName() == aDefOutlStyleNames[i] ) { aCreatedDefaultOutlineStyles[ i ] = pColl; @@ -433,7 +433,7 @@ static void lcl_AdjustOutlineStylesForOOo(SwDoc& _rDoc) // Do not change assignment of already created default outline style // to a certain outline level. if ( !aOutlineLevelAssigned[ i ] && - aCreatedDefaultOutlineStyles[ i ] != 0 && + aCreatedDefaultOutlineStyles[ i ] != nullptr && ! aCreatedDefaultOutlineStyles[ i ]->IsAssignedToListLevelOfOutlineStyle() ) { // apply outline level at created default outline style @@ -498,9 +498,9 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c uno::Reference< io::XActiveDataSource > xSource; uno::Reference< XInterface > xPipe; uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; - SvXMLGraphicHelper *pGraphicHelper = 0; + SvXMLGraphicHelper *pGraphicHelper = nullptr; uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver; - SvXMLEmbeddedObjectHelper *pObjectHelper = 0; + SvXMLEmbeddedObjectHelper *pObjectHelper = nullptr; // get the input stream (storage or stream) uno::Reference<io::XInputStream> xInputStream; @@ -721,14 +721,14 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c else if( bInsertMode ) { const uno::Reference<text::XTextRange> xInsertTextRange = - SwXTextRange::CreateXTextRange(rDoc, *rPaM.GetPoint(), 0); + SwXTextRange::CreateXTextRange(rDoc, *rPaM.GetPoint(), nullptr); xInfoSet->setPropertyValue( "TextInsertModeRange", makeAny(xInsertTextRange) ); } else { - 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); } if( IsBlockMode() ) @@ -851,14 +851,14 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c bInsertMode) ) { nWarn2 = ReadThroughComponent( - xStorage, xModelComp, "settings.xml", NULL, xContext, + xStorage, xModelComp, "settings.xml", nullptr, xContext, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsImporter" : "com.sun.star.comp.Writer.XMLSettingsImporter"), aFilterArgs, rName, false ); } nRet = ReadThroughComponent( - xStorage, xModelComp, "styles.xml", NULL, xContext, + xStorage, xModelComp, "styles.xml", nullptr, xContext, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisStylesImporter" : "com.sun.star.comp.Writer.XMLStylesImporter"), aFilterArgs, rName, true ); @@ -923,10 +923,10 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c if( pGraphicHelper ) SvXMLGraphicHelper::Destroy( pGraphicHelper ); - xGraphicResolver = 0; + xGraphicResolver = nullptr; if( pObjectHelper ) SvXMLEmbeddedObjectHelper::Destroy( pObjectHelper ); - xObjectResolver = 0; + xObjectResolver = nullptr; (void)rDoc.release(); if ( !bOASIS ) diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index c7bdb8367088..0f5392f39b0c 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -80,9 +80,9 @@ sal_uInt32 SwXMLWriter::_Write( const uno::Reference < task::XStatusIndicator >& uno::Reference< io::XOutputStream > xOut; tools::SvRef<SotStorageStream> xDocStream; uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; - SvXMLGraphicHelper *pGraphicHelper = 0; + SvXMLGraphicHelper *pGraphicHelper = nullptr; uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver; - SvXMLEmbeddedObjectHelper *pObjectHelper = 0; + SvXMLEmbeddedObjectHelper *pObjectHelper = nullptr; OSL_ENSURE( xStg.is(), "Where is my storage?" ); pGraphicHelper = SvXMLGraphicHelper::Create( xStg, @@ -393,11 +393,11 @@ sal_uInt32 SwXMLWriter::_Write( const uno::Reference < task::XStatusIndicator >& if( pGraphicHelper ) SvXMLGraphicHelper::Destroy( pGraphicHelper ); - xGraphicResolver = 0; + xGraphicResolver = nullptr; if( pObjectHelper ) SvXMLEmbeddedObjectHelper::Destroy( pObjectHelper ); - xObjectResolver = 0; + xObjectResolver = nullptr; // restore redline mode aAny = xInfoSet->getPropertyValue( sShowChanges ); @@ -469,8 +469,8 @@ bool SwXMLWriter::WriteThroughComponent( const Sequence<beans::PropertyValue> & rMediaDesc ) { OSL_ENSURE( xStg.is(), "Need storage!" ); - OSL_ENSURE( NULL != pStreamName, "Need stream name!" ); - OSL_ENSURE( NULL != pServiceName, "Need service name!" ); + OSL_ENSURE( nullptr != pStreamName, "Need stream name!" ); + OSL_ENSURE( nullptr != pServiceName, "Need service name!" ); SAL_INFO( "sw.filter", "SwXMLWriter::WriteThroughComponent : stream " << pStreamName ); // open stream @@ -529,7 +529,7 @@ bool SwXMLWriter::WriteThroughComponent( { OSL_ENSURE( xOutputStream.is(), "I really need an output stream!" ); OSL_ENSURE( xComponent.is(), "Need component!" ); - OSL_ENSURE( NULL != pServiceName, "Need component name!" ); + OSL_ENSURE( nullptr != pServiceName, "Need component name!" ); // get component uno::Reference< xml::sax::XWriter > xSaxWriter = xml::sax::Writer::create(rxContext); diff --git a/sw/source/filter/xml/wrtxml.hxx b/sw/source/filter/xml/wrtxml.hxx index 78bf7b0208a3..a9a45bcfec15 100644 --- a/sw/source/filter/xml/wrtxml.hxx +++ b/sw/source/filter/xml/wrtxml.hxx @@ -51,7 +51,7 @@ public: SwXMLWriter( const OUString& rBaseURL ); virtual ~SwXMLWriter(); - virtual sal_uLong Write( SwPaM&, SfxMedium&, const OUString* = 0 ) override; + virtual sal_uLong Write( SwPaM&, SfxMedium&, const OUString* = nullptr ) override; private: diff --git a/sw/source/filter/xml/xmlbrsh.cxx b/sw/source/filter/xml/xmlbrsh.cxx index 4e07c24a1fe2..9b1bcc5960c0 100644 --- a/sw/source/filter/xml/xmlbrsh.cxx +++ b/sw/source/filter/xml/xmlbrsh.cxx @@ -115,7 +115,7 @@ SvXMLImportContext *SwXMLBrushItemImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; if( xmloff::token::IsXMLToken( rLocalName, xmloff::token::XML_BINARY_DATA ) ) { @@ -146,7 +146,7 @@ void SwXMLBrushItemImportContext::EndElement() if( xBase64Stream.is() ) { const OUString sURL( GetImport().ResolveGraphicObjectURLFromBase64( xBase64Stream ) ); - xBase64Stream = 0; + xBase64Stream = nullptr; SvXMLImportItemMapper::PutXMLValue( *pItem, sURL, MID_GRAPHIC_LINK, GetImport().GetMM100UnitConverter() ); } diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 67289a7b40ae..dfce3ca52921 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -87,12 +87,12 @@ SwXMLExport::SwXMLExport( OUString const & implementationName, SvXMLExportFlags nExportFlags) : SvXMLExport( util::MeasureUnit::INCH, rContext, implementationName, XML_TEXT, nExportFlags ), - pTableItemMapper( 0 ), - pTableLines( 0 ), + pTableItemMapper( nullptr ), + pTableLines( nullptr ), bBlock( false ), bShowProgress( true ), bSavedShowChanges( false ), - doc( NULL ), + doc( nullptr ), sNumberFormat("NumberFormat"), sIsProtected("IsProtected"), sCell("Cell") @@ -163,7 +163,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) for( sal_uInt32 i = 0; i < nItems; ++i ) { const SfxPoolItem* const pItem = rPool.GetItem2( nWhichId , i ); - if( 0 != pItem ) + if( nullptr != pItem ) { const SvXMLAttrContainerItem *pUnknown = dynamic_cast<const SvXMLAttrContainerItem*>( pItem ); @@ -250,7 +250,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) // we don't need it here. // else: keep default pClass that we received - SvXMLGraphicHelper *pGraphicResolver = 0; + SvXMLGraphicHelper *pGraphicResolver = nullptr; if( !GetGraphicResolver().is() ) { pGraphicResolver = SvXMLGraphicHelper::Create( GRAPHICHELPER_MODE_WRITE ); @@ -258,7 +258,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) SetGraphicResolver( xGraphicResolver ); } - SvXMLEmbeddedObjectHelper *pEmbeddedResolver = 0; + SvXMLEmbeddedObjectHelper *pEmbeddedResolver = nullptr; if( !GetEmbeddedResolver().is() ) { SfxObjectShell *pPersist = pDoc->GetPersist(); @@ -523,7 +523,7 @@ sal_Int64 SAL_CALL SwXMLExport::getSomething( const Sequence< sal_Int8 >& rId ) SwDoc* SwXMLExport::getDoc() { - if( doc != NULL ) + if( doc != nullptr ) return doc; Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); Reference < XText > xText = xTextDoc->getText(); @@ -531,9 +531,9 @@ SwDoc* SwXMLExport::getDoc() assert( xTextTunnel.is()); SwXText *pText = reinterpret_cast< SwXText *>( sal::static_int_cast< sal_IntPtr >( xTextTunnel->getSomething( SwXText::getUnoTunnelId() ))); - assert( pText != NULL ); + assert( pText != nullptr ); doc = pText->GetDoc(); - assert( doc != NULL ); + assert( doc != nullptr ); return doc; } diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index 637ec9e17a83..c556a4da7983 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -149,7 +149,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, } if( dynamic_cast<const SvXMLAttrContainerItem*>( &rItem) != nullptr ) { - SvXMLNamespaceMap *pNewNamespaceMap = 0; + SvXMLNamespaceMap *pNewNamespaceMap = nullptr; const SvXMLNamespaceMap *pNamespaceMap = &rNamespaceMap; const SvXMLAttrContainerItem *pUnknown = @@ -274,7 +274,7 @@ const SfxPoolItem* SvXMLExportItemMapper::GetItem( const SfxItemSet& rSet, } else { - return NULL; + return nullptr; } } @@ -594,8 +594,8 @@ bool SvXMLExportItemMapper::QueryXMLValue( case TOP_BORDER: case BOTTOM_BORDER: { - bool bEqual = ( NULL == pTop && NULL == pBottom && - NULL == pLeft && NULL == pRight ) || + bool bEqual = ( nullptr == pTop && nullptr == pBottom && + nullptr == pLeft && nullptr == pRight ) || ( pTop && pBottom && pLeft && pRight && *pTop == *pBottom && *pTop == *pLeft && *pTop == *pRight ); @@ -617,10 +617,10 @@ bool SvXMLExportItemMapper::QueryXMLValue( if( !pTop && !pBottom && !pLeft && !pRight ) return false; - bool bEqual = NULL != pTop && - NULL != pBottom && - NULL != pLeft && - NULL != pRight; + bool bEqual = nullptr != pTop && + nullptr != pBottom && + nullptr != pLeft && + nullptr != pRight; if( bEqual ) { @@ -651,25 +651,25 @@ bool SvXMLExportItemMapper::QueryXMLValue( return false; break; case LEFT_BORDER_LINE_WIDTH: - if( bEqual || NULL == pLeft || + if( bEqual || nullptr == pLeft || 0 == pLeft->GetDistance() || !lcl_isOdfDoubleLine( pLeft ) ) return false; break; case RIGHT_BORDER_LINE_WIDTH: - if( bEqual || NULL == pRight || + if( bEqual || nullptr == pRight || 0 == pRight->GetDistance() || !lcl_isOdfDoubleLine( pRight ) ) return false; break; case TOP_BORDER_LINE_WIDTH: - if( bEqual || NULL == pTop || + if( bEqual || nullptr == pTop || 0 == pTop->GetDistance() || !lcl_isOdfDoubleLine( pTop ) ) return false; break; case BOTTOM_BORDER_LINE_WIDTH: - if( bEqual || NULL == pBottom || + if( bEqual || nullptr == pBottom || 0 == pBottom->GetDistance() || !lcl_isOdfDoubleLine( pBottom ) ) return false; @@ -721,11 +721,11 @@ bool SvXMLExportItemMapper::QueryXMLValue( pLine = pBottom; break; default: - pLine = NULL; + pLine = nullptr; break; } - if( NULL != pLine ) + if( nullptr != pLine ) { sal_Int32 nWidth = pLine->GetWidth(); diff --git a/sw/source/filter/xml/xmlexpit.hxx b/sw/source/filter/xml/xmlexpit.hxx index 4ae4612d1dc1..66ab4202b52f 100644 --- a/sw/source/filter/xml/xmlexpit.hxx +++ b/sw/source/filter/xml/xmlexpit.hxx @@ -82,7 +82,7 @@ public: const SfxPoolItem& rItem, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, - const SfxItemSet *pSet = NULL ) const; + const SfxItemSet *pSet = nullptr ) const; /** this method is called for every item that has the MID_SW_FLAG_NO_ITEM_EXPORT flag set */ diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index f8e9e33ddc0b..acf62efd26a6 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -316,7 +316,7 @@ SwXMLTextStyleContext_Impl::SwXMLTextStyleContext_Impl( SwXMLImport& rImport, sal_uInt16 nFamily, SvXMLStylesContext& rStyles ) : XMLTextStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ), - pConditions( 0 ) + pConditions( nullptr ) { } @@ -339,7 +339,7 @@ SvXMLImportContext *SwXMLTextStyleContext_Impl::CreateChildContext( const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLocalName, XML_MAP ) ) { @@ -374,7 +374,7 @@ void SwXMLTextStyleContext_Impl::Finish( bool bOverwrite ) if( !xStyle.is() ) return; - const SwXStyle* pStyle = 0; + const SwXStyle* pStyle = nullptr; uno::Reference<lang::XUnoTunnel> xStyleTunnel( xStyle, uno::UNO_QUERY); if( xStyleTunnel.is() ) { @@ -510,7 +510,7 @@ SvXMLImportContext *SwXMLItemSetStyleContext_Impl::CreateItemSetContext( OSL_ENSURE( !pItemSet, "SwXMLItemSetStyleContext_Impl::CreateItemSetContext: item set exists" ); - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; SwDoc* pDoc = SwImport::GetDocFromXMLImport( GetSwImport() ); @@ -541,7 +541,7 @@ SvXMLImportContext *SwXMLItemSetStyleContext_Impl::CreateItemSetContext( if( !pContext ) { delete pItemSet; - pItemSet = 0; + pItemSet = nullptr; } return pContext; @@ -555,8 +555,8 @@ SwXMLItemSetStyleContext_Impl::SwXMLItemSetStyleContext_Impl( SwXMLImport& rImpo SvXMLStylesContext& rStylesC, sal_uInt16 nFamily ) : SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, nFamily ), - pItemSet( 0 ), - pTextStyle( 0 ), + pItemSet( nullptr ), + pTextStyle( nullptr ), rStyles( rStylesC ), bHasMasterPageName( false ), bPageDescConnected( false ), @@ -580,7 +580,7 @@ SvXMLImportContext *SwXMLItemSetStyleContext_Impl::CreateChildContext( const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; if( XML_NAMESPACE_STYLE == nPrefix ) { @@ -653,7 +653,7 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc() } const SfxPoolItem *pItem; - SwFormatPageDesc *pFormatPageDesc = 0; + SwFormatPageDesc *pFormatPageDesc = nullptr; if( SfxItemState::SET == pItemSet->GetItemState( RES_PAGEDESC, false, &pItem ) ) { @@ -750,7 +750,7 @@ SvXMLStyleContext *SwXMLStylesContext_Impl::CreateStyleStyleChildContext( sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLStyleContext *pStyle = 0; + SvXMLStyleContext *pStyle = nullptr; switch( nFamily ) { @@ -786,7 +786,7 @@ SvXMLStyleContext *SwXMLStylesContext_Impl::CreateDefaultStyleStyleChildContext( sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLStyleContext *pStyle = 0; + SvXMLStyleContext *pStyle = nullptr; switch( nFamily ) { @@ -1041,7 +1041,7 @@ bool SwXMLImport::FindAutomaticStyle( const SfxItemSet **ppItemSet, OUString *pParent ) const { - SwXMLItemSetStyleContext_Impl *pStyle = 0; + SwXMLItemSetStyleContext_Impl *pStyle = nullptr; if( GetAutoStyles() ) { pStyle = const_cast<SwXMLItemSetStyleContext_Impl*>(dynamic_cast< const SwXMLItemSetStyleContext_Impl* >( @@ -1072,7 +1072,7 @@ bool SwXMLImport::FindAutomaticStyle( } } - return pStyle != 0; + return pStyle != nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/xml/xmlfonte.cxx b/sw/source/filter/xml/xmlfonte.cxx index a59ae3a3aa15..73bee7ba6d89 100644 --- a/sw/source/filter/xml/xmlfonte.cxx +++ b/sw/source/filter/xml/xmlfonte.cxx @@ -58,7 +58,7 @@ SwXMLFontAutoStylePool_Impl::SwXMLFontAutoStylePool_Impl( sal_uInt32 nItems = rPool.GetItemCount2( nWhichId ); for( sal_uInt32 j = 0; j < nItems; ++j ) { - if( 0 != (pItem = rPool.GetItem2( nWhichId, j ) ) ) + if( nullptr != (pItem = rPool.GetItem2( nWhichId, j ) ) ) { const SvxFontItem *pFont = static_cast<const SvxFontItem *>(pItem); diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index bd8d5538e209..78ee5864f0fa 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -196,7 +196,7 @@ SvXMLImportContext *SwXMLDocContext_Impl::CreateChildContext( const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; const SvXMLTokenMap& rTokenMap = GetSwImport().GetDocElemTokenMap(); switch( rTokenMap.Get( nPrefix, rLocalName ) ) @@ -368,7 +368,7 @@ SvXMLImportContext *SwXMLImport::CreateContext( const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; // #i69629# - own subclasses for <office:document> and <office:document-styles> if( XML_NAMESPACE_OFFICE==nPrefix && @@ -406,13 +406,13 @@ SwXMLImport::SwXMLImport( const uno::Reference< uno::XComponentContext >& rContext, OUString const & implementationName, SvXMLImportFlags nImportFlags) : SvXMLImport( rContext, implementationName, nImportFlags ), - pSttNdIdx( 0 ), - pTableItemMapper( 0 ), - pDocElemTokenMap( 0 ), - pTableElemTokenMap( 0 ), - pTableCellAttrTokenMap( 0 ), - pGraphicResolver( 0 ), - pEmbeddedResolver( 0 ), + pSttNdIdx( nullptr ), + pTableItemMapper( nullptr ), + pDocElemTokenMap( nullptr ), + pTableElemTokenMap( nullptr ), + pTableCellAttrTokenMap( nullptr ), + pGraphicResolver( nullptr ), + pEmbeddedResolver( nullptr ), nStyleFamilyMask( SFX_STYLE_FAMILY_ALL ), bLoadDoc( true ), bInsert( false ), @@ -421,7 +421,7 @@ SwXMLImport::SwXMLImport( bOrganizerMode( false ), bInititedXForms( false ), bPreserveRedlineMode( true ), - doc( NULL ) + doc( nullptr ) { _InitItemImport(); @@ -491,7 +491,7 @@ static OTextCursorHelper *lcl_xml_GetSwXTextCursor( const Reference < XTextCurso Reference<XUnoTunnel> xCrsrTunnel( rTextCursor, UNO_QUERY ); OSL_ENSURE( xCrsrTunnel.is(), "missing XUnoTunnel for Cursor" ); if( !xCrsrTunnel.is() ) - return 0; + return nullptr; OTextCursorHelper *pTextCrsr = reinterpret_cast< OTextCursorHelper *>( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); OSL_ENSURE( pTextCrsr, "SwXTextCursor missing" ); @@ -596,7 +596,7 @@ void SwXMLImport::startDocument() // We also might change into the insert mode later, so we have to make // sure to first set the insert mode and then create the text import // helper. Otherwise it won't have the insert flag set! - OTextCursorHelper *pTextCrsr = 0; + OTextCursorHelper *pTextCrsr = nullptr; Reference < XTextCursor > xTextCursor; if( HasTextImport() ) xTextCursor = GetTextImport()->GetCursor(); @@ -605,8 +605,8 @@ void SwXMLImport::startDocument() Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); Reference < XText > xText = xTextDoc->getText(); xTextCursor = xText->createTextCursor(); - SwCrsrShell *pCrsrSh = 0; - SwDoc *pDoc = 0; + SwCrsrShell *pCrsrSh = nullptr; + SwDoc *pDoc = nullptr; if( SvXMLImportFlags::ALL == getImportFlags() ) { pTextCrsr = lcl_xml_GetSwXTextCursor( xTextCursor ); @@ -629,10 +629,10 @@ void SwXMLImport::startDocument() { const uno::Reference<text::XTextRange> xInsertTextRange( SwXTextRange::CreateXTextRange( - *pDoc, *pCrsrSh->GetCrsr()->GetPoint(), 0 ) ); + *pDoc, *pCrsrSh->GetCrsr()->GetPoint(), nullptr ) ); setTextInsertMode( xInsertTextRange ); xTextCursor = GetTextImport()->GetCursor(); - pTextCrsr = 0; + pTextCrsr = nullptr; } else GetTextImport()->SetCursor( xTextCursor ); @@ -730,7 +730,7 @@ void SwXMLImport::endDocument() if( HasShapeImport() ) ClearShapeImport(); - SwDoc *pDoc = 0; + SwDoc *pDoc = nullptr; if( (getImportFlags() & SvXMLImportFlags::CONTENT) && !IsStylesOnlyMode() ) { Reference<XUnoTunnel> xCrsrTunnel( GetTextImport()->GetCursor(), @@ -819,13 +819,13 @@ void SwXMLImport::endDocument() if( pCNd && pCNd->StartOfSectionIndex()+2 < pCNd->EndOfSectionIndex() ) { - pPaM->GetBound().nContent.Assign( 0, 0 ); - pPaM->GetBound(false).nContent.Assign( 0, 0 ); + pPaM->GetBound().nContent.Assign( nullptr, 0 ); + pPaM->GetBound(false).nContent.Assign( nullptr, 0 ); pDoc->GetNodes().Delete( pPaM->GetPoint()->nNode ); } } } - else if( 0 != (pCurrNd = pDoc->GetNodes()[nNodeIdx]->GetTextNode()) ) + else if( nullptr != (pCurrNd = pDoc->GetNodes()[nNodeIdx]->GetTextNode()) ) { // Id we're in insert mode, the empty node is joined with // the next and the previous one. @@ -846,7 +846,7 @@ void SwXMLImport::endDocument() } else if (pCurrNd->GetText().isEmpty()) { - pPos->nContent.Assign( 0, 0 ); + pPos->nContent.Assign( nullptr, 0 ); pPaM->SetMark(); pPaM->DeleteMark(); pDoc->GetNodes().Delete( pPos->nNode ); pPaM->Move( fnMoveBackward ); @@ -870,7 +870,7 @@ void SwXMLImport::endDocument() GetTextImport()->ResetCursor(); delete pSttNdIdx; - pSttNdIdx = 0; + pSttNdIdx = nullptr; // SJ: #i49801# -> now permitting repaints if ( pDoc ) @@ -1168,10 +1168,10 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC bool bPropLineSpacingShrinksFirstLine = false; bool bSubtractFlysAnchoredAtFlys = false; - const PropertyValue* currentDatabaseDataSource = NULL; - const PropertyValue* currentDatabaseCommand = NULL; - const PropertyValue* currentDatabaseCommandType = NULL; - const PropertyValue* embeddedDatabaseName = 0; + const PropertyValue* currentDatabaseDataSource = nullptr; + const PropertyValue* currentDatabaseCommand = nullptr; + const PropertyValue* currentDatabaseCommandType = nullptr; + const PropertyValue* embeddedDatabaseName = nullptr; while( nCount-- ) { @@ -1274,11 +1274,11 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC try { - if( currentDatabaseDataSource != NULL ) + if( currentDatabaseDataSource != nullptr ) xProps->setPropertyValue( currentDatabaseDataSource->Name, currentDatabaseDataSource->Value ); - if( currentDatabaseCommand != NULL ) + if( currentDatabaseCommand != nullptr ) xProps->setPropertyValue( currentDatabaseCommand->Name, currentDatabaseCommand->Value ); - if( currentDatabaseCommandType != NULL ) + if( currentDatabaseCommandType != nullptr ) xProps->setPropertyValue( currentDatabaseCommandType->Name, currentDatabaseCommandType->Value ); if (embeddedDatabaseName) xProps->setPropertyValue(embeddedDatabaseName->Name, embeddedDatabaseName->Value); @@ -1530,7 +1530,7 @@ void SwXMLImport::initXForms() return; SwXTextDocument* pXTextDocument = reinterpret_cast<SwXTextDocument*>( xDocTunnel->getSomething( SwXTextDocument::getUnoTunnelId() ) ); - if( pXTextDocument == NULL ) + if( pXTextDocument == nullptr ) return; SwDoc *pDoc = pXTextDocument->GetDocShell()->GetDoc(); @@ -1545,7 +1545,7 @@ void SwXMLImport::initXForms() SwDoc* SwXMLImport::getDoc() { - if( doc != NULL ) + if( doc != nullptr ) return doc; Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); Reference < XText > xText = xTextDoc->getText(); @@ -1553,9 +1553,9 @@ SwDoc* SwXMLImport::getDoc() assert( xTextTunnel.is()); SwXText *pText = reinterpret_cast< SwXText *>( sal::static_int_cast< sal_IntPtr >( xTextTunnel->getSomething( SwXText::getUnoTunnelId() ))); - assert( pText != NULL ); + assert( pText != nullptr ); doc = pText->GetDoc(); - assert( doc != NULL ); + assert( doc != nullptr ); return doc; } diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx index c5e461445c7c..28ea68aeb946 100644 --- a/sw/source/filter/xml/xmlimp.hxx +++ b/sw/source/filter/xml/xmlimp.hxx @@ -166,8 +166,8 @@ public: bool FindAutomaticStyle( sal_uInt16 nFamily, const OUString& rName, - const SfxItemSet **ppItemSet=0, - OUString *pParent=0 ) const; + const SfxItemSet **ppItemSet=nullptr, + OUString *pParent=nullptr ) const; virtual void SetStatistics( const css::uno::Sequence< css::beans::NamedValue> & i_rStats) override; diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index 90a17b7c2c73..2a0d155f9f93 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -83,7 +83,7 @@ void SvXMLImportItemMapper::importXML( SfxItemSet& rSet, { sal_Int16 nAttr = xAttrList->getLength(); - SvXMLAttrContainerItem *pUnknownItem = 0; + SvXMLAttrContainerItem *pUnknownItem = nullptr; for( sal_Int16 i=0; i < nAttr; i++ ) { const OUString& rAttrName = xAttrList->getNameByIndex( i ); @@ -106,7 +106,7 @@ void SvXMLImportItemMapper::importXML( SfxItemSet& rSet, MID_SW_FLAG_ELEMENT_ITEM_IMPORT)) ) { // first get item from itemset - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; SfxItemState eState = rSet.GetItemState( pEntry->nWhichId, true, &pItem ); @@ -154,7 +154,7 @@ void SvXMLImportItemMapper::importXML( SfxItemSet& rSet, { if( !pUnknownItem ) { - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if( SfxItemState::SET == rSet.GetItemState( nUnknownWhich, true, &pItem ) ) { @@ -231,14 +231,14 @@ struct BoxHolder : private boost::noncopyable explicit BoxHolder(SvxBoxItem& rBox) { - pTop = rBox.GetTop() == NULL ? - NULL : new SvxBorderLine( *rBox.GetTop() ); - pBottom = rBox.GetBottom() == NULL ? - NULL : new SvxBorderLine( *rBox.GetBottom() ); - pLeft = rBox.GetLeft() == NULL ? - NULL : new SvxBorderLine( *rBox.GetLeft() ); - pRight = rBox.GetRight() == NULL ? - NULL : new SvxBorderLine( *rBox.GetRight() ); + pTop = rBox.GetTop() == nullptr ? + nullptr : new SvxBorderLine( *rBox.GetTop() ); + pBottom = rBox.GetBottom() == nullptr ? + nullptr : new SvxBorderLine( *rBox.GetBottom() ); + pLeft = rBox.GetLeft() == nullptr ? + nullptr : new SvxBorderLine( *rBox.GetLeft() ); + pRight = rBox.GetRight() == nullptr ? + nullptr : new SvxBorderLine( *rBox.GetRight() ); } ~BoxHolder() @@ -932,7 +932,7 @@ bool SvXMLImportItemMapper::PutXMLValue( const XMLPropertyHandler* pWritingModeHandler = XMLPropertyHandlerFactory::CreatePropertyHandler( XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT ); - if( pWritingModeHandler != NULL ) + if( pWritingModeHandler != nullptr ) { Any aAny; bOk = pWritingModeHandler->importXML( rValue, aAny, diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx index 2b28b352f7df..538e720388cb 100644 --- a/sw/source/filter/xml/xmliteme.cxx +++ b/sw/source/filter/xml/xmliteme.cxx @@ -75,7 +75,7 @@ public: const SfxPoolItem& rItem, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, - const SfxItemSet *pSet = NULL ) const override; + const SfxItemSet *pSet = nullptr ) const override; virtual void handleElementItem( SvXMLExport& rExport, diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx index ddecdccc0c35..b2030a6ad5c5 100644 --- a/sw/source/filter/xml/xmlitemi.cxx +++ b/sw/source/filter/xml/xmlitemi.cxx @@ -212,7 +212,7 @@ void SwXMLImportTableItemMapper_Impl::finished( continue; // already read fo:margin-top etc. } // first get item from itemset - SfxPoolItem const* pItem = 0; + SfxPoolItem const* pItem = nullptr; SfxItemState eState = rSet.GetItemState(Ids[i][0], true, &pItem); @@ -294,7 +294,7 @@ SvXMLImportContext *SwXMLItemSetContext_Impl::CreateChildContext( const SvXMLItemMapEntry& rEntry, const SvXMLUnitConverter& _rUnitConv ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; switch( rEntry.nWhichId ) { diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx index 2ad46ab74ee5..9d57fb6c7cd4 100644 --- a/sw/source/filter/xml/xmlithlp.cxx +++ b/sw/source/filter/xml/xmlithlp.cxx @@ -165,11 +165,11 @@ bool sw_frmitems_setXMLBorder( SvxBorderLine*& rpLine, if( (bHasStyle && API_LINE_NONE == nStyle) || (bHasWidth && USHRT_MAX == nNamedWidth && 0 == nWidth) ) { - bool bRet = 0 != rpLine; + bool bRet = nullptr != rpLine; if( rpLine ) { delete rpLine; - rpLine = 0; + rpLine = nullptr; } return bRet; diff --git a/sw/source/filter/xml/xmlitmap.hxx b/sw/source/filter/xml/xmlitmap.hxx index d9738a83c7c3..00c7fcac027d 100644 --- a/sw/source/filter/xml/xmlitmap.hxx +++ b/sw/source/filter/xml/xmlitmap.hxx @@ -66,7 +66,7 @@ public: SvXMLItemMapEntry* getByName( sal_uInt16 nNameSpace, const OUString& rString, - SvXMLItemMapEntry* pStartAt = NULL ) const; + SvXMLItemMapEntry* pStartAt = nullptr ) const; SvXMLItemMapEntry& getByIndex( sal_uInt16 nIndex ) const; sal_uInt16 getCount() const; diff --git a/sw/source/filter/xml/xmlitmpr.cxx b/sw/source/filter/xml/xmlitmpr.cxx index 7a119e7d0885..cec6e645f8fb 100644 --- a/sw/source/filter/xml/xmlitmpr.cxx +++ b/sw/source/filter/xml/xmlitmpr.cxx @@ -64,7 +64,7 @@ SvXMLItemMapEntry* SvXMLItemMapEntries::getByName( sal_uInt16 nNameSpace, pMap++; } - return (pMap && (pMap->eLocalName != XML_TOKEN_INVALID)) ? pMap : NULL; + return (pMap && (pMap->eLocalName != XML_TOKEN_INVALID)) ? pMap : nullptr; } SvXMLItemMapEntry& SvXMLItemMapEntries::getByIndex( sal_uInt16 nIndex ) const diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx index 9a201702688f..b79dcc5a2764 100644 --- a/sw/source/filter/xml/xmlmeta.cxx +++ b/sw/source/filter/xml/xmlmeta.cxx @@ -46,7 +46,7 @@ SwXMLImport::GetDocumentProperties() const if (IsOrganizerMode() || IsStylesOnlyMode() || IsBlockMode() || IsInsertMode()) { - return 0; + return nullptr; } uno::Reference<document::XDocumentPropertiesSupplier> const xDPS( GetModel(), UNO_QUERY_THROW); @@ -56,7 +56,7 @@ SwXMLImport::GetDocumentProperties() const SvXMLImportContext *SwXMLImport::CreateMetaContext( const OUString& rLocalName ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; if (getImportFlags() & SvXMLImportFlags::META) { @@ -94,15 +94,15 @@ struct statistic { }; static const struct statistic s_stats [] = { - { XML_TOK_META_STAT_TABLE, "TableCount", &SwDocStat::nTable, 0 }, - { XML_TOK_META_STAT_IMAGE, "ImageCount", &SwDocStat::nGrf, 0 }, - { XML_TOK_META_STAT_OLE, "ObjectCount", &SwDocStat::nOLE, 0 }, - { XML_TOK_META_STAT_PAGE, "PageCount", 0, &SwDocStat::nPage }, - { XML_TOK_META_STAT_PARA, "ParagraphCount", 0, &SwDocStat::nPara }, - { XML_TOK_META_STAT_WORD, "WordCount", 0, &SwDocStat::nWord }, - { XML_TOK_META_STAT_CHAR, "CharacterCount", 0, &SwDocStat::nChar }, - { XML_TOK_META_STAT_NON_WHITE_SPACE_CHAR, "NonWhitespaceCharacterCount", 0, &SwDocStat::nCharExcludingSpaces }, - { XML_TOK_META_STAT_END, 0, 0, 0 } + { XML_TOK_META_STAT_TABLE, "TableCount", &SwDocStat::nTable, nullptr }, + { XML_TOK_META_STAT_IMAGE, "ImageCount", &SwDocStat::nGrf, nullptr }, + { XML_TOK_META_STAT_OLE, "ObjectCount", &SwDocStat::nOLE, nullptr }, + { XML_TOK_META_STAT_PAGE, "PageCount", nullptr, &SwDocStat::nPage }, + { XML_TOK_META_STAT_PARA, "ParagraphCount", nullptr, &SwDocStat::nPara }, + { XML_TOK_META_STAT_WORD, "WordCount", nullptr, &SwDocStat::nWord }, + { XML_TOK_META_STAT_CHAR, "CharacterCount", nullptr, &SwDocStat::nChar }, + { XML_TOK_META_STAT_NON_WHITE_SPACE_CHAR, "NonWhitespaceCharacterCount", nullptr, &SwDocStat::nCharExcludingSpaces }, + { XML_TOK_META_STAT_END, nullptr, nullptr, nullptr } }; void SwXMLImport::SetStatistics( @@ -119,12 +119,12 @@ void SwXMLImport::SetStatistics( sal_uInt32 nTokens = 0; for (sal_Int32 i = 0; i < i_rStats.getLength(); ++i) { - for (struct statistic const* pStat = s_stats; pStat->name != 0; + for (struct statistic const* pStat = s_stats; pStat->name != nullptr; ++pStat) { if (i_rStats[i].Name.equalsAscii(pStat->name)) { sal_Int32 val = 0; if (i_rStats[i].Value >>= val) { - if (pStat->target16 != 0) { + if (pStat->target16 != nullptr) { aDocStat.*(pStat->target16) = static_cast<sal_uInt16> (val); } else { diff --git a/sw/source/filter/xml/xmlscript.cxx b/sw/source/filter/xml/xmlscript.cxx index 39b8dda5a884..7b514596fcb8 100644 --- a/sw/source/filter/xml/xmlscript.cxx +++ b/sw/source/filter/xml/xmlscript.cxx @@ -29,7 +29,7 @@ using namespace ::com::sun::star; SvXMLImportContext *SwXMLImport::CreateScriptContext( const OUString& rLocalName ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; if( !(IsStylesOnlyMode() || IsInsertMode()) ) { diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 66b1388b377c..1852787fb193 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -191,9 +191,9 @@ bool SwXMLTableFrameFormatsSort_Impl::AddRow( SwFrameFormat& rFrameFormat, const OUString& rNamePrefix, sal_uInt32 nLine ) { - const SwFormatFrmSize *pFrmSize = 0; - const SwFormatRowSplit* pRowSplit = 0; - const SvxBrushItem *pBrush = 0; + const SwFormatFrmSize *pFrmSize = nullptr; + const SwFormatRowSplit* pRowSplit = nullptr; + const SvxBrushItem *pBrush = nullptr; const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); const SfxPoolItem *pItem; @@ -215,9 +215,9 @@ bool SwXMLTableFrameFormatsSort_Impl::AddRow( SwFrameFormat& rFrameFormat, SwXMLFrameFormats_Impl::iterator i; for( i = aFormatList.begin(); i < aFormatList.end(); ++i ) { - const SwFormatFrmSize *pTestFrmSize = 0; - const SwFormatRowSplit* pTestRowSplit = 0; - const SvxBrushItem *pTestBrush = 0; + const SwFormatFrmSize *pTestFrmSize = nullptr; + const SwFormatRowSplit* pTestRowSplit = nullptr; + const SvxBrushItem *pTestBrush = nullptr; const SwFrameFormat *pTestFormat = *i; const SfxItemSet& rTestSet = pTestFormat->GetAttrSet(); if( SfxItemState::SET == rTestSet.GetItemState( RES_FRM_SIZE, false, @@ -307,11 +307,11 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, const OUString& rNamePrefix, sal_uInt32 nCol, sal_uInt32 nRow, bool bTop ) { - const SwFormatVertOrient *pVertOrient = 0; - const SvxBrushItem *pBrush = 0; - const SvxBoxItem *pBox = 0; - const SwTableBoxNumFormat *pNumFormat = 0; - const SvxFrameDirectionItem *pFrameDir = 0; + const SwFormatVertOrient *pVertOrient = nullptr; + const SvxBrushItem *pBrush = nullptr; + const SvxBoxItem *pBox = nullptr; + const SwTableBoxNumFormat *pNumFormat = nullptr; + const SvxFrameDirectionItem *pFrameDir = nullptr; const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); const SfxPoolItem *pItem; @@ -346,11 +346,11 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, SwXMLFrameFormats_Impl::iterator i; for( i = aFormatList.begin(); i < aFormatList.end(); ++i ) { - const SwFormatVertOrient *pTestVertOrient = 0; - const SvxBrushItem *pTestBrush = 0; - const SvxBoxItem *pTestBox = 0; - const SwTableBoxNumFormat *pTestNumFormat = 0; - const SvxFrameDirectionItem *pTestFrameDir = 0; + const SwFormatVertOrient *pTestVertOrient = nullptr; + const SvxBrushItem *pTestBrush = nullptr; + const SvxBoxItem *pTestBox = nullptr; + const SwTableBoxNumFormat *pTestNumFormat = nullptr; + const SvxFrameDirectionItem *pTestFrameDir = nullptr; const SwFrameFormat* pTestFormat = *i; const SfxItemSet& rTestSet = pTestFormat->GetAttrSet(); if( SfxItemState::SET == rTestSet.GetItemState( RES_VERT_ORIENT, false, @@ -948,7 +948,7 @@ void SwXMLExport::ExportTableLines( const SwTableLines& rLines, if( !pTableLines || pTableLines->empty() ) return; - SwXMLTableLines_Impl* pLines = NULL; + SwXMLTableLines_Impl* pLines = nullptr; size_t nInfoPos; for( nInfoPos=0; nInfoPos < pTableLines->size(); nInfoPos++ ) { @@ -972,7 +972,7 @@ void SwXMLExport::ExportTableLines( const SwTableLines& rLines, if( pTableLines->empty() ) { delete pTableLines ; - pTableLines = NULL; + pTableLines = nullptr; } // pass 2: export columns @@ -980,12 +980,12 @@ void SwXMLExport::ExportTableLines( const SwTableLines& rLines, size_t nColumn = 0U; const size_t nColumns = rCols.size(); sal_Int32 nColRep = 1; - SwXMLTableColumn_Impl *pColumn = (nColumns > 0) ? rCols[0U] : 0; + SwXMLTableColumn_Impl *pColumn = (nColumns > 0) ? rCols[0U] : nullptr; while( pColumn ) { nColumn++; SwXMLTableColumn_Impl *pNextColumn = - (nColumn < nColumns) ? rCols[nColumn] : 0; + (nColumn < nColumns) ? rCols[nColumn] : nullptr; if( pNextColumn && pNextColumn->GetStyleName() == pColumn->GetStyleName() ) { @@ -1128,7 +1128,7 @@ void SwXMLTextParagraphExport::exportTable( OSL_ENSURE( xTextTable.is(), "text table missing" ); if( xTextTable.is() ) { - const SwXTextTable *pXTable = 0; + const SwXTextTable *pXTable = nullptr; Reference<XUnoTunnel> xTableTunnel( rTextContent, UNO_QUERY); if( xTableTunnel.is() ) { diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 386326a22f88..8999e9c7c285 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -188,7 +188,7 @@ public: SwXMLTableCell_Impl( sal_uInt32 nRSpan=1UL, sal_uInt32 nCSpan=1UL ) : dValue( 0.0 ), - pStartNode( 0 ), + pStartNode( nullptr ), nRowSpan( nRSpan ), nColSpan( nCSpan ), bProtected( false ), @@ -208,7 +208,7 @@ public: OUString const*const pStringValue, OUString const& i_rXmlId); - bool IsUsed() const { return pStartNode!=0 || + bool IsUsed() const { return pStartNode!=nullptr || xSubTable.Is() || bProtected;} sal_uInt32 GetRowSpan() const { return nRowSpan; } @@ -222,7 +222,7 @@ public: bool IsCovered() const { return mbCovered; } bool HasStringValue() const { return m_bHasStringValue; } OUString const* GetStringValue() const { - return (m_bHasStringValue) ? &m_StringValue : 0; + return (m_bHasStringValue) ? &m_StringValue : nullptr; } const SwStartNode *GetStartNode() const { return pStartNode; } @@ -257,7 +257,7 @@ inline void SwXMLTableCell_Impl::Set( const OUString& rStyleName, { m_StringValue = *pStringValue; } - m_bHasStringValue = (pStringValue != 0); + m_bHasStringValue = (pStringValue != nullptr); bProtected = bProtect; if (!mbCovered) // ensure uniqueness @@ -266,7 +266,7 @@ inline void SwXMLTableCell_Impl::Set( const OUString& rStyleName, } // set formula, if valid - if (pFormula != NULL) + if (pFormula != nullptr) { sFormula = *pFormula; } @@ -275,7 +275,7 @@ inline void SwXMLTableCell_Impl::Set( const OUString& rStyleName, inline void SwXMLTableCell_Impl::SetStartNode( const SwStartNode *pSttNd ) { pStartNode = pSttNd; - xSubTable = 0; + xSubTable = nullptr; } inline SwXMLTableContext *SwXMLTableCell_Impl::GetSubTable() const @@ -286,7 +286,7 @@ inline SwXMLTableContext *SwXMLTableCell_Impl::GetSubTable() const inline void SwXMLTableCell_Impl::Dispose() { if( xSubTable.Is() ) - xSubTable = 0; + xSubTable = nullptr; } class SwXMLTableRow_Impl @@ -300,7 +300,7 @@ class SwXMLTableRow_Impl public: SwXMLTableRow_Impl( const OUString& rStyleName, sal_uInt32 nCells, - const OUString *pDfltCellStyleName = 0, + const OUString *pDfltCellStyleName = nullptr, const OUString& i_rXmlId = OUString() ); ~SwXMLTableRow_Impl() {} @@ -576,14 +576,14 @@ SwXMLTableCellContext_Impl::~SwXMLTableCellContext_Impl() inline void SwXMLTableCellContext_Impl::_InsertContent() { - SwStartNode const*const pStartNode( GetTable()->InsertTableSection(0, + SwStartNode const*const pStartNode( GetTable()->InsertTableSection(nullptr, (m_bHasStringValue && m_bValueTypeIsString && - !aStyleName.isEmpty()) ? & aStyleName : 0) ); + !aStyleName.isEmpty()) ? & aStyleName : nullptr) ); GetTable()->InsertCell( aStyleName, nRowSpan, nColSpan, pStartNode, mXmlId, - NULL, bProtect, &sFormula, bHasValue, fValue, - (m_bHasStringValue && m_bValueTypeIsString) ? &m_StringValue : 0); + nullptr, bProtect, &sFormula, bHasValue, fValue, + (m_bHasStringValue && m_bValueTypeIsString) ? &m_StringValue : nullptr); } inline void SwXMLTableCellContext_Impl::InsertContent() @@ -602,7 +602,7 @@ inline void SwXMLTableCellContext_Impl::InsertContentIfNotThere() inline void SwXMLTableCellContext_Impl::InsertContent( SwXMLTableContext *pTable ) { - GetTable()->InsertCell( aStyleName, nRowSpan, nColSpan, 0, mXmlId, pTable, bProtect ); + GetTable()->InsertCell( aStyleName, nRowSpan, nColSpan, nullptr, mXmlId, pTable, bProtect ); bHasTableContent = true; } @@ -611,7 +611,7 @@ SvXMLImportContext *SwXMLTableCellContext_Impl::CreateChildContext( const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; OUString sXmlId; bool bSubTable = false; @@ -793,7 +793,7 @@ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl( if( !aStyleName.isEmpty() ) { const SfxPoolItem *pItem; - const SfxItemSet *pAutoItemSet = 0; + const SfxItemSet *pAutoItemSet = nullptr; if( GetSwImport().FindAutomaticStyle( XML_STYLE_FAMILY_TABLE_COLUMN, aStyleName, &pAutoItemSet ) && @@ -859,7 +859,7 @@ SvXMLImportContext *SwXMLTableColsContext_Impl::CreateChildContext( const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; if( XML_NAMESPACE_TABLE == nPrefix && IsXMLToken( rLocalName, XML_TABLE_COLUMN ) && @@ -970,7 +970,7 @@ SvXMLImportContext *SwXMLTableRowContext_Impl::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; if( XML_NAMESPACE_TABLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix ) { @@ -1040,7 +1040,7 @@ SvXMLImportContext *SwXMLTableRowsContext_Impl::CreateChildContext( const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; if( XML_NAMESPACE_TABLE == nPrefix && IsXMLToken( rLocalName, XML_TABLE_ROW ) && @@ -1163,7 +1163,7 @@ static OUString lcl_GenerateFieldTypeName(const OUString& sPrefix, SwTableNode* ++nCount; sName = sPrefixStr + OUString::number(nCount); } - while (NULL != pTableNode->GetDoc()->getIDocumentFieldsAccess().GetFieldType(RES_DDEFLD, sName, false)); + while (nullptr != pTableNode->GetDoc()->getIDocumentFieldsAccess().GetFieldType(RES_DDEFLD, sName, false)); return sName; } @@ -1186,7 +1186,7 @@ static SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext, OUString sName(pContext->GetConnectionName()); // field type to be returned - SwDDEFieldType* pType = NULL; + SwDDEFieldType* pType = nullptr; // valid name? if (sName.isEmpty()) @@ -1198,7 +1198,7 @@ static SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext, { // check for existing DDE field type with the same name SwDDEFieldType* pOldType = static_cast<SwDDEFieldType*>(pTableNode->GetDoc()->getIDocumentFieldsAccess().GetFieldType(RES_DDEFLD, sName, false)); - if (NULL != pOldType) + if (nullptr != pOldType) { // same values -> return old type if ( (pOldType->GetCmd() == sCommand) && @@ -1218,7 +1218,7 @@ static SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext, } // create new field type (unless we already have one) - if (NULL == pType) + if (nullptr == pType) { // create new field type and return SwDDEFieldType aDDEFieldType(sName, sCommand, nType); @@ -1226,7 +1226,7 @@ static SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext, GetDoc()->getIDocumentFieldsAccess().InsertFieldType(aDDEFieldType)); } - OSL_ENSURE(NULL != pType, "We really want a SwDDEFieldType here!"); + OSL_ENSURE(nullptr != pType, "We really want a SwDDEFieldType here!"); return pType; } @@ -1280,15 +1280,15 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, const OUString& rLName, const Reference< xml::sax::XAttributeList > & xAttrList ) : XMLTextTableContext( rImport, nPrfx, rLName ), - pColumnDefaultCellStyleNames( 0 ), + pColumnDefaultCellStyleNames( nullptr ), m_pRows( new SwXMLTableRows_Impl ), - pTableNode( 0 ), - pBox1( 0 ), - pSttNd1( 0 ), - pBoxFormat( 0 ), - pLineFormat( 0 ), - pSharedBoxFormats(NULL), - pDDESource(NULL), + pTableNode( nullptr ), + pBox1( nullptr ), + pSttNd1( nullptr ), + pBoxFormat( nullptr ), + pLineFormat( nullptr ), + pSharedBoxFormats(nullptr), + pDDESource(nullptr), bFirstSection( true ), bRelWidth( true ), bHasSubTables( false ), @@ -1346,7 +1346,7 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, } Reference< XTextTable > xTable; - const SwXTextTable *pXTable = 0; + const SwXTextTable *pXTable = nullptr; Reference<XMultiServiceFactory> xFactory( GetImport().GetModel(), UNO_QUERY ); OSL_ENSURE( xFactory.is(), "factory missing" ); @@ -1370,7 +1370,7 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, } catch( IllegalArgumentException& ) { - xTable = 0; + xTable = nullptr; } } @@ -1420,16 +1420,16 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, const Reference< xml::sax::XAttributeList > &, SwXMLTableContext *pTable ) : XMLTextTableContext( rImport, nPrfx, rLName ), - pColumnDefaultCellStyleNames( 0 ), + pColumnDefaultCellStyleNames( nullptr ), m_pRows( new SwXMLTableRows_Impl ), pTableNode( pTable->pTableNode ), - pBox1( 0 ), - pSttNd1( 0 ), - pBoxFormat( 0 ), - pLineFormat( 0 ), - pSharedBoxFormats(NULL), + pBox1( nullptr ), + pSttNd1( nullptr ), + pBoxFormat( nullptr ), + pLineFormat( nullptr ), + pSharedBoxFormats(nullptr), xParentTable( pTable ), - pDDESource(NULL), + pDDESource(nullptr), bFirstSection( false ), bRelWidth( true ), bHasSubTables( false ), @@ -1454,7 +1454,7 @@ SvXMLImportContext *SwXMLTableContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; const SvXMLTokenMap& rTokenMap = GetSwImport().GetTableElemTokenMap(); bool bHeader = false; @@ -1491,7 +1491,7 @@ SvXMLImportContext *SwXMLTableContext::CreateChildContext( sal_uInt16 nPrefix, // save context for later processing (discard old context, if approp.) if( IsValid() ) { - if (pDDESource != NULL) + if (pDDESource != nullptr) { pDDESource->ReleaseRef(); } @@ -1730,7 +1730,7 @@ void SwXMLTableContext::InsertRepRows( sal_uInt32 nCount ) pSrcCell->GetColSpan(), InsertTableSection(), OUString(), - 0, pSrcCell->IsProtected(), + nullptr, pSrcCell->IsProtected(), &pSrcCell->GetFormula(), pSrcCell->HasValue(), pSrcCell->GetValue(), pSrcCell->GetStringValue() ); @@ -1757,7 +1757,7 @@ void SwXMLTableContext::FinishRow() const SwStartNode *SwXMLTableContext::GetPrevStartNode( sal_uInt32 nRow, sal_uInt32 nCol ) const { - const SwXMLTableCell_Impl *pPrevCell = 0; + const SwXMLTableCell_Impl *pPrevCell = nullptr; if( GetColumnCount() == nCol ) { // The last cell is the right one here. @@ -1774,7 +1774,7 @@ const SwStartNode *SwXMLTableContext::GetPrevStartNode( sal_uInt32 nRow, pPrevCell = GetCell( nRow-1UL, GetColumnCount()-1UL ); } - const SwStartNode *pSttNd = 0; + const SwStartNode *pSttNd = nullptr; if( pPrevCell ) { if( pPrevCell->GetStartNode() ) @@ -1784,7 +1784,7 @@ const SwStartNode *SwXMLTableContext::GetPrevStartNode( sal_uInt32 nRow, else if ( pPrevCell->GetSubTable() ) pSttNd = pPrevCell->GetSubTable()->GetLastStartNode(); - OSL_ENSURE( pSttNd != 0, + OSL_ENSURE( pSttNd != nullptr, "table corrupt" ); } @@ -1803,7 +1803,7 @@ void SwXMLTableContext::FixRowSpan( sal_uInt32 nRow, sal_uInt32 nCol, while( pCell && pCell->GetRowSpan() > 1UL ) { pCell->SetRowSpan( nRowSpan++ ); - pCell = j > 0UL ? GetCell( --j, i ) : 0; + pCell = j > 0UL ? GetCell( --j, i ) : nullptr; } } } @@ -1844,7 +1844,7 @@ SwTableBox *SwXMLTableContext::NewTableBox( const SwStartNode *pStNd, // created box, we use this box pBox = pBox1; pBox->SetUpper( pUpper ); - pBox1 = 0; + pBox1 = nullptr; } else pBox = new SwTableBox( pBoxFormat, *pStNd, pUpper ); @@ -1861,7 +1861,7 @@ SwTableBoxFormat* SwXMLTableContext::GetSharedBoxFormat( bool& bNew, bool* pModifyLocked ) { - if ( pSharedBoxFormats == NULL ) + if ( pSharedBoxFormats == nullptr ) pSharedBoxFormats = new map_BoxFormat(); SwTableBoxFormat* pBoxFormat2; @@ -1897,7 +1897,7 @@ SwTableBoxFormat* SwXMLTableContext::GetSharedBoxFormat( } // lock format (if so desired) - if ( pModifyLocked != NULL ) + if ( pModifyLocked != nullptr ) { (*pModifyLocked) = pBoxFormat2->IsModifyLocked(); pBoxFormat2->LockModify(); @@ -2039,7 +2039,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( if ( bNew ) { // set style - const SfxItemSet *pAutoItemSet = 0; + const SfxItemSet *pAutoItemSet = nullptr; if( pCell->GetStartNode() && !sStyleName.isEmpty() && GetSwImport().FindAutomaticStyle( XML_STYLE_FAMILY_TABLE_CELL, sStyleName, &pAutoItemSet ) ) @@ -2078,13 +2078,13 @@ SwTableBox *SwXMLTableContext::MakeTableBox( !sStyleName.isEmpty() ) { // default num format? - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; if( pBoxFormat2->GetItemState( RES_BOXATR_FORMAT, false, &pItem ) == SfxItemState::SET ) { const SwTableBoxNumFormat* pNumFormat = static_cast<const SwTableBoxNumFormat*>( pItem ); - if( ( pNumFormat != NULL ) && ( pNumFormat->GetValue() == 0 ) ) + if( ( pNumFormat != nullptr ) && ( pNumFormat->GetValue() == 0 ) ) { // only one text node? SwNodeIndex aNodeIndex( *(pCell->GetStartNode()), 1 ); @@ -2092,7 +2092,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( aNodeIndex.GetNode().StartOfSectionIndex() ) == 2 ) { SwTextNode* pTextNode= aNodeIndex.GetNode().GetTextNode(); - if( pTextNode != NULL ) + if( pTextNode != nullptr ) { // check text: does it look like some form of 0.0? const OUString& rText = pTextNode->GetText(); @@ -2133,16 +2133,16 @@ SwTableBox *SwXMLTableContext::MakeTableBox( // No value but a non-textual format, i.e. a number format // Solution: the number format will be removed, // the cell gets the default text format. - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; if( pBoxFormat->GetItemState( RES_BOXATR_FORMAT, false, &pItem ) == SfxItemState::SET ) { const SwDoc* pDoc = pBoxFormat->GetDoc(); const SvNumberFormatter* pNumberFormatter = pDoc ? - pDoc->GetNumberFormatter() : 0; + pDoc->GetNumberFormatter() : nullptr; const SwTableBoxNumFormat* pNumFormat = static_cast<const SwTableBoxNumFormat*>( pItem ); - if( pNumFormat != NULL && pNumberFormatter && + if( pNumFormat != nullptr && pNumberFormatter && !pNumberFormatter->GetEntry( pNumFormat->GetValue() )->IsTextFormat() ) pBoxFormat->ResetFormatAttr( RES_BOXATR_FORMAT ); } @@ -2199,7 +2199,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper, pFrameFormat->ResetAllFormatAttr(); // #i73790# - method renamed pFrameFormat->SetFormatAttr( aFillOrder ); - const SfxItemSet *pAutoItemSet = 0; + const SfxItemSet *pAutoItemSet = nullptr; const OUString& rStyleName = (*m_pRows)[nTopRow]->GetStyleName(); if( 1UL == (nBottomRow - nTopRow) && !rStyleName.isEmpty() && @@ -2266,7 +2266,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper, SwXMLTableCell_Impl *pCell = GetCell(nTopRow,nCol); // #i95726# - some fault tolerance - if ( pCell == 0 ) + if ( pCell == nullptr ) { OSL_FAIL( "table seems to be corrupt." ); break; @@ -2297,7 +2297,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper, if( bSplit ) { - SwTableBox* pBox = 0; + SwTableBox* pBox = nullptr; SwXMLTableCell_Impl *pCell = GetCell( nTopRow, nStartCol ); // #i95726# - some fault tolerance if( ( !bHasSubTables || ( pCell->GetRowSpan() == (nBottomRow-nTopRow) ) ) && @@ -2646,9 +2646,9 @@ void SwXMLTableContext::MakeTable() { OSL_FAIL("invalid table: no cells; deleting..."); pTableNode->GetDoc()->getIDocumentContentOperations().DeleteSection( pTableNode ); - pTableNode = 0; - pBox1 = 0; - pSttNd1 = 0; + pTableNode = nullptr; + pBox1 = nullptr; + pSttNd1 = nullptr; return; } @@ -2664,14 +2664,14 @@ void SwXMLTableContext::MakeTable() pTableNode->GetTable().SetRowsToRepeat( nHeaderRows ); pTableNode->GetTable().SetTableModel( !bHasSubTables ); - const SfxItemSet *pAutoItemSet = 0; + const SfxItemSet *pAutoItemSet = nullptr; if( !aStyleName.isEmpty() && rSwImport.FindAutomaticStyle( XML_STYLE_FAMILY_TABLE_TABLE, aStyleName, &pAutoItemSet ) && pAutoItemSet ) { const SfxPoolItem *pItem; - const SvxLRSpaceItem *pLRSpace = 0; + const SvxLRSpaceItem *pLRSpace = nullptr; if( SfxItemState::SET == pAutoItemSet->GetItemState( RES_LR_SPACE, false, &pItem ) ) pLRSpace = static_cast<const SvxLRSpaceItem *>(pItem); @@ -2705,7 +2705,7 @@ void SwXMLTableContext::MakeTable() bSetHoriOrient = true; } - const SwFormatFrmSize *pSize = 0; + const SwFormatFrmSize *pSize = nullptr; if( SfxItemState::SET == pAutoItemSet->GetItemState( RES_FRM_SIZE, false, &pItem ) ) pSize = static_cast<const SwFormatFrmSize *>(pItem); @@ -2788,7 +2788,7 @@ void SwXMLTableContext::MakeTable() (*m_pRows)[i]->Dispose(); // now that table is complete, change into DDE table (if appropriate) - if (NULL != pDDESource) + if (nullptr != pDDESource) { // change existing table into DDE table: // 1) Get DDE field type (get data from dde-source context), @@ -2876,7 +2876,7 @@ const SwStartNode *SwXMLTableContext::InsertTableSection( pStNd = pDoc->GetNodes().MakeTextSection( aIdx, SwTableBoxStartNode, pColl ); // Consider the case that a table is defined without a row. - if( !pPrevSttNd && pBox1 != NULL ) + if( !pPrevSttNd && pBox1 != nullptr ) { pBox1->m_pStartNode = pStNd; @@ -2886,7 +2886,7 @@ const SwStartNode *SwXMLTableContext::InsertTableSection( aPos.nContent.Assign( pCNd, 0U ); const uno::Reference< text::XTextRange > xTextRange = - SwXTextRange::CreateXTextRange( *pDoc, aPos, 0 ); + SwXTextRange::CreateXTextRange( *pDoc, aPos, nullptr ); Reference < XText > xText = xTextRange->getText(); Reference < XTextCursor > xTextCursor = xText->createTextCursorByRange( xTextRange ); diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx index a8662e8864a8..ff23336ce92d 100644 --- a/sw/source/filter/xml/xmltbli.hxx +++ b/sw/source/filter/xml/xmltbli.hxx @@ -103,7 +103,7 @@ class SwXMLTableContext : public XMLTextTableContext sal_uInt32 nTopRow, sal_uInt32 nLeftCol, sal_uInt32 nBottomRow, sal_uInt32 nRightCol ); - void _MakeTable( SwTableBox *pBox=0 ); + void _MakeTable( SwTableBox *pBox=nullptr ); void MakeTable( SwTableBox *pBox, sal_Int32 nWidth ); void MakeTable(); @@ -146,7 +146,7 @@ public: SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); } void InsertColumn( sal_Int32 nWidth, bool bRelWidth, - const OUString *pDfltCellStyleName = 0 ); + const OUString *pDfltCellStyleName = nullptr ); sal_Int32 GetColumnWidth( sal_uInt32 nCol, sal_uInt32 nColSpan=1UL ) const; OUString GetColumnDefaultCellStyleName( sal_uInt32 nCol ) const; inline sal_uInt32 GetColumnCount() const; @@ -155,18 +155,18 @@ public: bool IsInsertCellPossible() const { return nCurCol < GetColumnCount(); } bool IsInsertColPossible() const { return nCurCol < USHRT_MAX; } bool IsInsertRowPossible() const { return nCurRow < USHRT_MAX; } - bool IsValid() const { return pTableNode != 0; } + bool IsValid() const { return pTableNode != nullptr; } void InsertCell( const OUString& rStyleName, sal_uInt32 nRowSpan=1U, sal_uInt32 nColSpan=1U, - const SwStartNode *pStNd=0, + const SwStartNode *pStNd=nullptr, const OUString & i_rXmlId = OUString(), - SwXMLTableContext *pTable=0, + SwXMLTableContext *pTable=nullptr, bool bIsProtected = false, - const OUString *pFormula=0, + const OUString *pFormula=nullptr, bool bHasValue = false, double fValue = 0.0, - OUString const*const pStringValue = 0); + OUString const*const pStringValue = nullptr); void InsertRow( const OUString& rStyleName, const OUString& rDfltCellStyleName, bool bInHead, @@ -175,8 +175,8 @@ public: void InsertRepRows( sal_uInt32 nCount ); const SwXMLTableCell_Impl *GetCell( sal_uInt32 nRow, sal_uInt32 nCol ) const; SwXMLTableCell_Impl *GetCell( sal_uInt32 nRow, sal_uInt32 nCol ); - const SwStartNode *InsertTableSection(const SwStartNode *pPrevSttNd = 0, - OUString const* pStringValueStyleName = 0); + const SwStartNode *InsertTableSection(const SwStartNode *pPrevSttNd = nullptr, + OUString const* pStringValueStyleName = nullptr); virtual void EndElement() override; @@ -200,7 +200,7 @@ inline const SwStartNode *SwXMLTableContext::GetLastStartNode() const inline bool SwXMLTableContext::HasColumnDefaultCellStyleNames() const { - return pColumnDefaultCellStyleNames != 0; + return pColumnDefaultCellStyleNames != nullptr; } #endif diff --git a/sw/source/filter/xml/xmltext.cxx b/sw/source/filter/xml/xmltext.cxx index debc85c5fd6e..e20a181cb769 100644 --- a/sw/source/filter/xml/xmltext.cxx +++ b/sw/source/filter/xml/xmltext.cxx @@ -58,7 +58,7 @@ SvXMLImportContext *SwXMLBodyContentContext_Impl::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; pContext = GetSwImport().GetTextImport()->CreateTextChildContext( GetImport(), nPrefix, rLocalName, xAttrList, @@ -78,7 +78,7 @@ void SwXMLBodyContentContext_Impl::EndElement() SvXMLImportContext *SwXMLImport::CreateBodyContentContext( const OUString& rLocalName ) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; if( !IsStylesOnlyMode() ) pContext = new SwXMLBodyContentContext_Impl( *this, XML_NAMESPACE_OFFICE, diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index fe2a0730b91d..1091ddd46739 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -83,7 +83,7 @@ void SwXMLTextParagraphExport::exportStyleContent( const Reference< XStyle > & rStyle ) { - const SwXStyle* pStyle = 0; + const SwXStyle* pStyle = nullptr; Reference<XUnoTunnel> xStyleTunnel( rStyle, UNO_QUERY); if( xStyleTunnel.is() ) { @@ -326,7 +326,7 @@ void SwXMLTextParagraphExport::_collectTextEmbeddedAutoStyles( if( !rObjRef.is() ) return; - const XMLPropertyState *aStates[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + const XMLPropertyState *aStates[8] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; SvGlobalName aClassId( rObjRef->getClassID() ); if( aIFrameClassId == aClassId ) @@ -395,7 +395,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( aAny >>= sStyle; } - const XMLPropertyState *aStates[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + const XMLPropertyState *aStates[8] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; switch( nType ) { case SV_EMBEDDED_FRAME: diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index deaf437e6ca9..7f7a3481ac9d 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -91,11 +91,11 @@ const XMLServiceMapEntry_Impl aServiceMap[] = SERVICE_MAP_ENTRY( IMPRESS, SIMPRESS ), SERVICE_MAP_ENTRY( CHART, SCH ), SERVICE_MAP_ENTRY( MATH, SM ), - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + { nullptr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet, sal_Int32 nHeight, sal_Int32 nWidth, - long *pTwipHeight=0, long *pTwipWidth=0 ) + long *pTwipHeight=nullptr, long *pTwipWidth=nullptr ) { if( nWidth > 0 && nHeight > 0 ) { @@ -151,7 +151,7 @@ SwXMLTextImportHelper::SwXMLTextImportHelper( bool /*bPreserveRedlineMode*/ ) : XMLTextImportHelper( rModel, rImport, bInsertM, bStylesOnlyM, _bProgress, bBlockM, bOrganizerM ), - pRedlineHelper( NULL ) + pRedlineHelper( nullptr ) { uno::Reference<XPropertySet> xDocPropSet( rModel, UNO_QUERY ); pRedlineHelper = new XMLRedlineImportHelper( @@ -189,14 +189,14 @@ bool SwXMLTextImportHelper::IsInHeaderFooter() const OTextCursorHelper *pTextCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); SAL_WARN_IF(!pTextCrsr, "sw.uno", "SwXTextCursor missing"); - SwDoc *pDoc = pTextCrsr ? pTextCrsr->GetDoc() : NULL; + SwDoc *pDoc = pTextCrsr ? pTextCrsr->GetDoc() : nullptr; return pDoc && pDoc->IsInHeaderFooter( pTextCrsr->GetPaM()->GetPoint()->nNode ); } static SwOLENode *lcl_GetOLENode( const SwFrameFormat *pFrameFormat ) { - SwOLENode *pOLENd = 0; + SwOLENode *pOLENd = nullptr; if( pFrameFormat ) { const SwFormatContent& rContent = pFrameFormat->GetContent(); @@ -242,8 +242,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( lcl_putHeightAndWidth( aItemSet, nHeight, nWidth, &aTwipSize.Height(), &aTwipSize.Width() ); - SwFrameFormat *pFrameFormat = 0; - SwOLENode *pOLENd = 0; + SwFrameFormat *pFrameFormat = nullptr; + SwOLENode *pOLENd = nullptr; if( rHRef.copy( 0, nPos ) == "vnd.sun.star.ServiceName" ) { bool bInsert = false; @@ -291,8 +291,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCrsr->GetPaM(), ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aItemSet, - NULL, - NULL ); + nullptr, + nullptr ); pOLENd = lcl_GetOLENode( pFrameFormat ); } @@ -344,7 +344,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( // TODO/LATER: Actually it should be set here if( pTextCrsr ) { - pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( *pTextCrsr->GetPaM(), aName, embed::Aspects::MSOLE_CONTENT, &aItemSet, NULL, NULL ); + pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( *pTextCrsr->GetPaM(), aName, embed::Aspects::MSOLE_CONTENT, &aItemSet, nullptr, nullptr ); pOLENd = lcl_GetOLENode( pFrameFormat ); } aObjName = aName; @@ -445,7 +445,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( } sal_Int64 nDrawAspect = 0; - const XMLPropStyleContext *pStyle = 0; + const XMLPropStyleContext *pStyle = nullptr; bool bHasSizeProps = false; if( !rStyleName.isEmpty() ) { @@ -596,8 +596,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCrsr->GetPaM(), ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aItemSet, - NULL, - NULL ); + nullptr, + nullptr ); // TODO/LATER: in future may need a way to set replacement image url to the link ( may be even to the object ), needs oasis cws??? @@ -658,8 +658,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet( SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCrsr->GetPaM(), ::svt::EmbeddedObjectRef( aAppletImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT ), &aAppletImpl.GetItemSet(), - NULL, - NULL); + nullptr, + nullptr); xPropSet.set(SwXTextEmbeddedObject::CreateXTextEmbeddedObject( *pDoc, pFrameFormat), uno::UNO_QUERY); if( pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) @@ -733,8 +733,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin( SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCrsr->GetPaM(), ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aItemSet, - NULL, - NULL); + nullptr, + nullptr); xPropSet.set(SwXTextEmbeddedObject::CreateXTextEmbeddedObject( *pDoc, pFrameFormat), uno::UNO_QUERY); if( pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) @@ -775,7 +775,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra bool bHasBorder = false; bool bIsBorderSet = false; Size aMargin( SIZE_NOT_SET, SIZE_NOT_SET ); - const XMLPropStyleContext *pStyle = 0; + const XMLPropStyleContext *pStyle = nullptr; if( !rStyleName.isEmpty() ) { pStyle = FindAutoFrameStyle( rStyleName ); @@ -886,8 +886,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCrsr->GetPaM(), ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aItemSet, - NULL, - NULL); + nullptr, + nullptr); xPropSet.set(SwXTextEmbeddedObject::CreateXTextEmbeddedObject( *pDoc, pFrameFormat), uno::UNO_QUERY); if( pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) @@ -976,8 +976,8 @@ void SwXMLTextImportHelper::RedlineAdd( bool bMergeLastPara) { // create redline helper on demand - OSL_ENSURE(NULL != pRedlineHelper, "helper should have been created in constructor"); - if (NULL != pRedlineHelper) + OSL_ENSURE(nullptr != pRedlineHelper, "helper should have been created in constructor"); + if (nullptr != pRedlineHelper) pRedlineHelper->Add(rType, rId, rAuthor, rComment, rDateTime, bMergeLastPara); } @@ -988,7 +988,7 @@ uno::Reference<XTextCursor> SwXMLTextImportHelper::RedlineCreateText( { uno::Reference<XTextCursor> xRet; - if (NULL != pRedlineHelper) + if (nullptr != pRedlineHelper) { xRet = pRedlineHelper->CreateRedlineTextSection(rOldCursor, rId); } @@ -1001,7 +1001,7 @@ void SwXMLTextImportHelper::RedlineSetCursor( bool bStart, bool bIsOutsideOfParagraph) { - if (NULL != pRedlineHelper) { + if (nullptr != pRedlineHelper) { uno::Reference<XTextRange> xTextRange( GetCursor()->getStart() ); pRedlineHelper->SetCursor(rId, bStart, xTextRange, bIsOutsideOfParagraph); @@ -1013,7 +1013,7 @@ void SwXMLTextImportHelper::RedlineAdjustStartNodeCursor( bool bStart) { OUString rId = GetOpenRedlineId(); - if ((NULL != pRedlineHelper) && !rId.isEmpty()) + if ((nullptr != pRedlineHelper) && !rId.isEmpty()) { uno::Reference<XTextRange> xTextRange( GetCursor()->getStart() ); pRedlineHelper->AdjustStartNodeCursor(rId, bStart, xTextRange ); @@ -1024,20 +1024,20 @@ void SwXMLTextImportHelper::RedlineAdjustStartNodeCursor( void SwXMLTextImportHelper::SetShowChanges( bool bShowChanges ) { - if ( NULL != pRedlineHelper ) + if ( nullptr != pRedlineHelper ) pRedlineHelper->SetShowChanges( bShowChanges ); } void SwXMLTextImportHelper::SetRecordChanges( bool bRecordChanges ) { - if ( NULL != pRedlineHelper ) + if ( nullptr != pRedlineHelper ) pRedlineHelper->SetRecordChanges( bRecordChanges ); } void SwXMLTextImportHelper::SetChangesProtectionKey( const Sequence<sal_Int8> & rKey ) { - if ( NULL != pRedlineHelper ) + if ( nullptr != pRedlineHelper ) pRedlineHelper->SetProtectionKey( rKey ); } |