sw/source/filter/ww8/wrtww8.cxx | 60 ++++++++++++++++++++-------------------- sw/source/filter/ww8/wrtww8.hxx | 26 ++++++++--------- 2 files changed, 43 insertions(+), 43 deletions(-)
New commits: commit fe672dc74231c275a0b5593448f26d26b658743b Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Mon Apr 25 08:19:12 2022 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Apr 25 09:10:42 2022 +0200 sw: prefix members of WW8_WrPct, WW8_WrPlc1, WW8_WrPlcField and ... ... WW8_WrPlcFootnoteEdn See tdf#94879 for motivation. Change-Id: Ie49a167ca443216322a2038d4d6568d43736019a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133361 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 44196f0207d9..7cc40d97713c 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -793,9 +793,9 @@ const SfxPoolItem& MSWordExportBase::GetItem(sal_uInt16 nWhich) const } WW8_WrPlc1::WW8_WrPlc1( sal_uInt16 nStructSz ) - : pData( new sal_uInt8[ 16 * nStructSz ] ), - nDataLen(16 * nStructSz), - nStructSiz( nStructSz ) + : m_pData( new sal_uInt8[ 16 * nStructSz ] ), + m_nDataLen(16 * nStructSz), + m_nStructSiz( nStructSz ) { } @@ -805,43 +805,43 @@ WW8_WrPlc1::~WW8_WrPlc1() WW8_CP WW8_WrPlc1::Prev() const { - bool b = !aPos.empty(); + bool b = !m_aPos.empty(); OSL_ENSURE(b,"Prev called on empty list"); - return b ? aPos.back() : 0; + return b ? m_aPos.back() : 0; } void WW8_WrPlc1::Append( WW8_CP nCp, const void* pNewData ) { - sal_uLong nInsPos = aPos.size() * nStructSiz; - aPos.push_back( nCp ); - if( nDataLen < nInsPos + nStructSiz ) + sal_uLong nInsPos = m_aPos.size() * m_nStructSiz; + m_aPos.push_back( nCp ); + if( m_nDataLen < nInsPos + m_nStructSiz ) { - sal_uInt8* pNew = new sal_uInt8[ 2 * nDataLen ]; - memcpy( pNew, pData.get(), nDataLen ); - pData.reset(pNew); - nDataLen *= 2; + sal_uInt8* pNew = new sal_uInt8[ 2 * m_nDataLen ]; + memcpy( pNew, m_pData.get(), m_nDataLen ); + m_pData.reset(pNew); + m_nDataLen *= 2; } - memcpy( pData.get() + nInsPos, pNewData, nStructSiz ); + memcpy( m_pData.get() + nInsPos, pNewData, m_nStructSiz ); } void WW8_WrPlc1::Finish( sal_uLong nLastCp, sal_uLong nSttCp ) { - if( !aPos.empty() ) + if( !m_aPos.empty() ) { - aPos.push_back( nLastCp ); + m_aPos.push_back( nLastCp ); if( nSttCp ) - for(WW8_CP & rCp : aPos) + for(WW8_CP & rCp : m_aPos) rCp -= nSttCp; } } void WW8_WrPlc1::Write( SvStream& rStrm ) { - decltype(aPos)::size_type i; - for( i = 0; i < aPos.size(); ++i ) - SwWW8Writer::WriteLong( rStrm, aPos[i] ); + decltype(m_aPos)::size_type i; + for( i = 0; i < m_aPos.size(); ++i ) + SwWW8Writer::WriteLong( rStrm, m_aPos[i] ); if( i ) - rStrm.WriteBytes(pData.get(), (i-1) * nStructSiz); + rStrm.WriteBytes(m_pData.get(), (i-1) * m_nStructSiz); } // Class WW8_WrPlcField for fields @@ -853,7 +853,7 @@ void WW8_WrPlcField::Write( WW8Export& rWrt ) WW8_FC *pfc; sal_Int32 *plc; - switch (nTextTyp) + switch (m_nTextTyp) { case TXT_MAINTEXT: pfc = &rWrt.m_pFib->m_fcPlcffldMom; @@ -1328,9 +1328,9 @@ WW8_FC WW8_WrFkp::GetEndFc() const // Method for managing the piece table WW8_WrPct::WW8_WrPct(WW8_FC nfcMin) - : nOldFc(nfcMin) + : m_nOldFc(nfcMin) { - AppendPc(nOldFc); + AppendPc(m_nOldFc); } WW8_WrPct::~WW8_WrPct() @@ -1340,14 +1340,14 @@ WW8_WrPct::~WW8_WrPct() // Fill the piece and create a new one void WW8_WrPct::AppendPc(WW8_FC nStartFc) { - WW8_CP nStartCp = nStartFc - nOldFc; // subtract the beginning of the text + WW8_CP nStartCp = nStartFc - m_nOldFc; // subtract the beginning of the text if ( !nStartCp && !m_Pcts.empty()) { OSL_ENSURE(1 == m_Pcts.size(), "empty Piece!"); m_Pcts.pop_back(); } - nOldFc = nStartFc; // remember StartFc as old + m_nOldFc = nStartFc; // remember StartFc as old nStartCp >>= 1; // for Unicode: number of characters / 2 @@ -1375,7 +1375,7 @@ void WW8_WrPct::WritePc( WW8Export& rWrt ) } // calculate the last Pos - sal_uLong nStartCp = rWrt.m_pFib->m_fcMac - nOldFc; + sal_uLong nStartCp = rWrt.m_pFib->m_fcMac - m_nOldFc; nStartCp >>= 1; // For Unicode: number of characters / 2 nStartCp += m_Pcts.back()->GetStartCp(); SwWW8Writer::WriteLong( *rWrt.m_pTableStrm, nStartCp ); @@ -1407,10 +1407,10 @@ void WW8_WrPct::SetParaBreak() WW8_CP WW8_WrPct::Fc2Cp( sal_uLong nFc ) const { - OSL_ENSURE( nFc >= o3tl::make_unsigned(nOldFc), "FilePos lies in front of last piece" ); + OSL_ENSURE( nFc >= o3tl::make_unsigned(m_nOldFc), "FilePos lies in front of last piece" ); OSL_ENSURE( ! m_Pcts.empty(), "Fc2Cp no piece available" ); - nFc -= nOldFc; + nFc -= m_nOldFc; nFc /= 2; // Unicode return nFc + m_Pcts.back()->GetStartCp(); } @@ -3974,7 +3974,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT sal_uInt32 GetSaveWarningOfMSVBAStorage_ww8( Sf bool WW8_WrPlcFootnoteEdn::WriteText( WW8Export& rWrt ) { bool bRet = false; - if (TXT_FTN == nTyp) + if (TXT_FTN == m_nTyp) { bRet = WriteGenericText( rWrt, TXT_FTN, rWrt.m_pFib->m_ccpFootnote ); rWrt.m_pFieldFootnote->Finish( rWrt.Fc2Cp( rWrt.Strm().Tell() ), @@ -3992,7 +3992,7 @@ bool WW8_WrPlcFootnoteEdn::WriteText( WW8Export& rWrt ) void WW8_WrPlcFootnoteEdn::WritePlc( WW8Export& rWrt ) const { - if( TXT_FTN == nTyp ) + if( TXT_FTN == m_nTyp ) { WriteGenericPlc( rWrt, TXT_FTN, rWrt.m_pFib->m_fcPlcffndText, rWrt.m_pFib->m_lcbPlcffndText, rWrt.m_pFib->m_fcPlcffndRef, diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 7e3046214fdd..b798b99a6b75 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -282,7 +282,7 @@ public: class WW8_WrPct { std::vector<std::unique_ptr<WW8_WrPc>> m_Pcts; - WW8_FC nOldFc; + WW8_FC m_nOldFc; public: explicit WW8_WrPct(WW8_FC nStartFc); ~WW8_WrPct(); @@ -1239,12 +1239,12 @@ protected: class WW8_WrPlcFootnoteEdn : public WW8_WrPlcSubDoc { private: - sal_uInt8 nTyp; + sal_uInt8 m_nTyp; WW8_WrPlcFootnoteEdn(const WW8_WrPlcFootnoteEdn&) = delete; WW8_WrPlcFootnoteEdn& operator=(WW8_WrPlcFootnoteEdn const &) = delete; public: - explicit WW8_WrPlcFootnoteEdn( sal_uInt8 nTTyp ) : nTyp( nTTyp ) {} + explicit WW8_WrPlcFootnoteEdn( sal_uInt8 nTTyp ) : m_nTyp( nTTyp ) {} bool WriteText( WW8Export& rWrt ); void WritePlc( WW8Export& rWrt ) const; @@ -1336,15 +1336,15 @@ public: class WW8_WrPlc1 { private: - std::vector<WW8_CP> aPos; - std::unique_ptr<sal_uInt8[]> pData; // content ( structures ) - sal_uLong nDataLen; - sal_uInt16 nStructSiz; + std::vector<WW8_CP> m_aPos; + std::unique_ptr<sal_uInt8[]> m_pData; // content ( structures ) + sal_uLong m_nDataLen; + sal_uInt16 m_nStructSiz; WW8_WrPlc1(const WW8_WrPlc1&) = delete; WW8_WrPlc1& operator=(const WW8_WrPlc1&) = delete; protected: - sal_uInt16 Count() const { return aPos.size(); } + sal_uInt16 Count() const { return m_aPos.size(); } void Write( SvStream& rStrm ); WW8_CP Prev() const; public: @@ -1358,18 +1358,18 @@ public: class WW8_WrPlcField : public WW8_WrPlc1 { private: - sal_uInt8 nTextTyp; - sal_uInt16 nResults; + sal_uInt8 m_nTextTyp; + sal_uInt16 m_nResults; WW8_WrPlcField(const WW8_WrPlcField&) = delete; WW8_WrPlcField& operator=(const WW8_WrPlcField&) = delete; public: WW8_WrPlcField( sal_uInt16 nStructSz, sal_uInt8 nTTyp ) - : WW8_WrPlc1( nStructSz ), nTextTyp( nTTyp ), nResults(0) + : WW8_WrPlc1( nStructSz ), m_nTextTyp( nTTyp ), m_nResults(0) {} void Write( WW8Export& rWrt ); - void ResultAdded() { ++nResults; } - sal_uInt16 ResultCount() const { return nResults; } + void ResultAdded() { ++m_nResults; } + sal_uInt16 ResultCount() const { return m_nResults; } }; class WW8_WrMagicTable : public WW8_WrPlc1