sw/source/filter/ww8/wrtw8esh.cxx | 76 ++++++++++---------- sw/source/filter/ww8/wrtw8nds.cxx | 138 +++++++++++++++++++------------------- sw/source/filter/ww8/wrtw8sty.cxx | 28 +++---- sw/source/filter/ww8/wrtww8.hxx | 44 ++++++------ 4 files changed, 143 insertions(+), 143 deletions(-)
New commits: commit 47d0a7f4fb08b994cfea83c5deba085d27f75ac2 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Wed Mar 16 08:07:12 2022 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed Mar 16 09:03:20 2022 +0100 sw: prefix members of MSWordAttrIter, MSWordSections, MSWord_SdrAttrIter ... ... and SwWW8AttrIter See tdf#94879 for motivation. Change-Id: Iaa5b84d7ae58ac4b20d3e0f419fbcb44f895b270 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131639 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 122910b037c6..bf7be6f5366f 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1012,43 +1012,43 @@ void WW8Export::AppendFlyInFlys(const ww8::Frame& rFrameFormat, MSWord_SdrAttrIter::MSWord_SdrAttrIter( MSWordExportBase& rWr, const EditTextObject& rEditObj, sal_uInt8 nTyp ) - : MSWordAttrIter( rWr ), pEditObj(&rEditObj), pEditPool(nullptr), mnTyp(nTyp) + : MSWordAttrIter( rWr ), m_pEditObj(&rEditObj), m_pEditPool(nullptr), mnTyp(nTyp) { NextPara( 0 ); } void MSWord_SdrAttrIter::NextPara( sal_Int32 nPar ) { - nPara = nPar; + m_nPara = nPar; // Ignore change of attribute at position 0, because we expect that // the attributes are outputted at start of a paragraph anyway. - aChrTextAtrArr.clear(); - aChrSetArr.clear(); - nCurrentSwPos = nTmpSwPos = 0; + m_aChrTextAtrArr.clear(); + m_aChrSetArr.clear(); + m_nCurrentSwPos = m_nTmpSwPos = 0; - SfxItemSet aSet( pEditObj->GetParaAttribs( nPara )); - pEditPool = aSet.GetPool(); - eNdChrSet = aSet.Get(EE_CHAR_FONTINFO).GetCharSet(); + SfxItemSet aSet( m_pEditObj->GetParaAttribs( m_nPara )); + m_pEditPool = aSet.GetPool(); + m_eNdChrSet = aSet.Get(EE_CHAR_FONTINFO).GetCharSet(); assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is()); - nScript = g_pBreakIt->GetBreakIter()->getScriptType( pEditObj->GetText(nPara), 0); + m_nScript = g_pBreakIt->GetBreakIter()->getScriptType( m_pEditObj->GetText(m_nPara), 0); - pEditObj->GetCharAttribs( nPara, aTextAtrArr ); - nCurrentSwPos = SearchNext( 1 ); + m_pEditObj->GetCharAttribs( m_nPara, m_aTextAtrArr ); + m_nCurrentSwPos = SearchNext( 1 ); } rtl_TextEncoding MSWord_SdrAttrIter::GetNextCharSet() const { - if( !aChrSetArr.empty() ) - return aChrSetArr.back(); - return eNdChrSet; + if( !m_aChrSetArr.empty() ) + return m_aChrSetArr.back(); + return m_eNdChrSet; } // the first parameter in SearchNext() returns if it's a TextAtr sal_Int32 MSWord_SdrAttrIter::SearchNext( sal_Int32 nStartPos ) { sal_Int32 nMinPos = SAL_MAX_INT32; - for(const auto& rTextAtr : aTextAtrArr) + for(const auto& rTextAtr : m_aTextAtrArr) { sal_Int32 nPos = rTextAtr.nStart; // first character attribute if( nPos >= nStartPos && nPos <= nMinPos ) @@ -1078,17 +1078,17 @@ void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart) if( bStart ) { rtl_TextEncoding eChrSet = static_cast<const SvxFontItem&>(rItem).GetCharSet(); - aChrSetArr.push_back( eChrSet ); - aChrTextAtrArr.push_back( &rAttr ); + m_aChrSetArr.push_back( eChrSet ); + m_aChrTextAtrArr.push_back( &rAttr ); } else { std::vector<const EECharAttrib*>::iterator it = - std::find( aChrTextAtrArr.begin(), aChrTextAtrArr.end(), &rAttr ); - if ( it != aChrTextAtrArr.end() ) + std::find( m_aChrTextAtrArr.begin(), m_aChrTextAtrArr.end(), &rAttr ); + if ( it != m_aChrTextAtrArr.end() ) { - aChrSetArr.erase( aChrSetArr.begin() + (it - aChrTextAtrArr.begin()) ); - aChrTextAtrArr.erase( it ); + m_aChrSetArr.erase( m_aChrSetArr.begin() + (it - m_aChrTextAtrArr.begin()) ); + m_aChrTextAtrArr.erase( it ); } } } @@ -1119,7 +1119,7 @@ void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos ) //duplicate attributes in docx export. Doesn't matter in doc //export as later props just override earlier ones. std::set<sal_uInt16> aUsedRunWhichs; - for(const auto& rTextAtr : aTextAtrArr) + for(const auto& rTextAtr : m_aTextAtrArr) { if (nSwPos >= rTextAtr.nStart && nSwPos < rTextAtr.nEnd) { @@ -1133,19 +1133,19 @@ void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos ) OutParaAttr(true, &aUsedRunWhichs); - if (aTextAtrArr.empty()) + if (m_aTextAtrArr.empty()) return; const sw::BroadcastingModify* pOldMod = m_rExport.m_pOutFormatNode; m_rExport.m_pOutFormatNode = nullptr; - const SfxItemPool* pSrcPool = pEditPool; + const SfxItemPool* pSrcPool = m_pEditPool; const SfxItemPool& rDstPool = m_rExport.m_rDoc.GetAttrPool(); - nTmpSwPos = nSwPos; + m_nTmpSwPos = nSwPos; // Did we already produce a <w:sz> element? m_rExport.m_bFontSizeWritten = false; - for(const auto& rTextAtr : aTextAtrArr) + for(const auto& rTextAtr : m_aTextAtrArr) { if (nSwPos >= rTextAtr.nStart && nSwPos < rTextAtr.nEnd) { @@ -1167,7 +1167,7 @@ void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos ) nWhich = rDstPool.GetWhich(nSlotId); if (nWhich && nWhich != nSlotId && nWhich < RES_UNKNOWNATR_BEGIN && - m_rExport.CollapseScriptsforWordOk(nScript,nWhich)) + m_rExport.CollapseScriptsforWordOk(m_nScript,nWhich)) { // use always the SW-Which Id ! std::unique_ptr<SfxPoolItem> pI(rTextAtr.pAttr->Clone()); @@ -1187,13 +1187,13 @@ void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos ) } m_rExport.m_bFontSizeWritten = false; - nTmpSwPos = 0; // HasTextItem only allowed in the above area + m_nTmpSwPos = 0; // HasTextItem only allowed in the above area m_rExport.m_pOutFormatNode = pOldMod; } bool MSWord_SdrAttrIter::IsTextAttr(sal_Int32 nSwPos) { - return std::any_of(aTextAtrArr.begin(), aTextAtrArr.end(), + return std::any_of(m_aTextAtrArr.begin(), m_aTextAtrArr.end(), [nSwPos](const EECharAttrib& rTextAtr) { return (nSwPos >= rTextAtr.nStart && nSwPos < rTextAtr.nEnd) && (rTextAtr.pAttr->Which() == EE_FEATURE_FIELD || @@ -1209,15 +1209,15 @@ bool MSWord_SdrAttrIter::IsTextAttr(sal_Int32 nSwPos) // The search is done with bDeep. const SfxPoolItem* MSWord_SdrAttrIter::HasTextItem(sal_uInt16 nWhich) const { - nWhich = sw::hack::TransformWhichBetweenPools(*pEditPool, + nWhich = sw::hack::TransformWhichBetweenPools(*m_pEditPool, m_rExport.m_rDoc.GetAttrPool(), nWhich); if (nWhich) { - for (const auto& rTextAtr : aTextAtrArr) + for (const auto& rTextAtr : m_aTextAtrArr) { - if (nWhich == rTextAtr.pAttr->Which() && nTmpSwPos >= rTextAtr.nStart && nTmpSwPos < rTextAtr.nEnd) + if (nWhich == rTextAtr.pAttr->Which() && m_nTmpSwPos >= rTextAtr.nStart && m_nTmpSwPos < rTextAtr.nEnd) return rTextAtr.pAttr; // Found - if (nTmpSwPos < rTextAtr.nStart) + if (m_nTmpSwPos < rTextAtr.nStart) return nullptr; } } @@ -1230,7 +1230,7 @@ const SfxPoolItem& MSWord_SdrAttrIter::GetItem( sal_uInt16 nWhich ) const const SfxPoolItem* pRet = HasTextItem(nWhich); if (!pRet) { - SfxItemSet aSet(pEditObj->GetParaAttribs(nPara)); + SfxItemSet aSet(m_pEditObj->GetParaAttribs(m_nPara)); nWhich = GetSetWhichFromSwDocWhich(aSet, m_rExport.m_rDoc, nWhich); OSL_ENSURE(nWhich, "Impossible, catastrophic failure imminent"); pRet = &aSet.Get(nWhich); @@ -1252,7 +1252,7 @@ void MSWord_SdrAttrIter::SetItemsThatDifferFromStandard(bool bCharAttr, SfxItemS if (SfxItemState::SET != rSet.GetItemState(nEEWhich, false)) { sal_uInt16 nSwWhich = sw::hack::TransformWhichBetweenPools(m_rExport.m_rDoc.GetAttrPool(), - *pEditPool, nEEWhich); + *m_pEditPool, nEEWhich); if (!nSwWhich) continue; bool bWanted = ( bCharAttr ? ( nSwWhich >= RES_CHRATR_BEGIN && nSwWhich < RES_TXTATR_END ) @@ -1270,7 +1270,7 @@ void MSWord_SdrAttrIter::SetItemsThatDifferFromStandard(bool bCharAttr, SfxItemS void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr, const std::set<sal_uInt16>* pWhichsToIgnore) { - SfxItemSet aSet( pEditObj->GetParaAttribs( nPara )); + SfxItemSet aSet( m_pEditObj->GetParaAttribs( m_nPara )); SetItemsThatDifferFromStandard(bCharAttr, aSet); @@ -1283,7 +1283,7 @@ void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr, const std::set<sal_uInt16>* SfxItemIter aIter( aSet ); const SfxPoolItem* pItem = aIter.GetCurItem(); - const SfxItemPool* pSrcPool = pEditPool, + const SfxItemPool* pSrcPool = m_pEditPool, * pDstPool = &m_rExport.m_rDoc.GetAttrPool(); do @@ -1303,7 +1303,7 @@ void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr, const std::set<sal_uInt16>* // use always the SW-Which Id ! std::unique_ptr<SfxPoolItem> pI(pItem->Clone()); pI->SetWhich( nWhich ); - if (m_rExport.CollapseScriptsforWordOk(nScript,nWhich)) + if (m_rExport.CollapseScriptsforWordOk(m_nScript,nWhich)) m_rExport.AttrOutput().OutputItem(*pI); } } while ((pItem = aIter.NextItem())); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 772d85008ded..be8518efabbb 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -167,14 +167,14 @@ lcl_getLinkChainName(const uno::Reference<beans::XPropertySet>& rPropertySet, } MSWordAttrIter::MSWordAttrIter( MSWordExportBase& rExport ) - : pOld( rExport.m_pChpIter ), m_rExport( rExport ) + : m_pOld( rExport.m_pChpIter ), m_rExport( rExport ) { m_rExport.m_pChpIter = this; } MSWordAttrIter::~MSWordAttrIter() { - m_rExport.m_pChpIter = pOld; + m_rExport.m_pChpIter = m_pOld; } namespace { @@ -200,11 +200,11 @@ void SwWW8AttrIter::IterToCurrent() SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTextNode& rTextNd) : MSWordAttrIter(rWr), - rNd(rTextNd), + m_rNode(rTextNd), maCharRuns(GetPseudoCharRuns(rTextNd)), - pCurRedline(nullptr), - nCurrentSwPos(0), - nCurRedlinePos(SwRedlineTable::npos), + m_pCurRedline(nullptr), + m_nCurrentSwPos(0), + m_nCurRedlinePos(SwRedlineTable::npos), mrSwFormatDrop(rTextNd.GetSwAttrSet().GetDrop()) { @@ -218,7 +218,7 @@ SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTextNode& rTextNd) : #i2916# Get list of any graphics which may be anchored from this paragraph. */ - maFlyFrames = GetFramesInNode(rWr.m_aFrames, rNd); + maFlyFrames = GetFramesInNode(rWr.m_aFrames, m_rNode); std::sort(maFlyFrames.begin(), maFlyFrames.end(), sortswflys()); /* @@ -237,11 +237,11 @@ SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTextNode& rTextNd) : if ( !m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty() ) { - SwPosition aPosition( rNd, SwIndex( const_cast<SwTextNode*>(&rNd) ) ); - pCurRedline = m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedline( aPosition, &nCurRedlinePos ); + SwPosition aPosition( m_rNode, SwIndex( const_cast<SwTextNode*>(&m_rNode) ) ); + m_pCurRedline = m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedline( aPosition, &m_nCurRedlinePos ); } - nCurrentSwPos = SearchNext(1); + m_nCurrentSwPos = SearchNext(1); } static sal_Int32 lcl_getMinPos( sal_Int32 pos1, sal_Int32 pos2 ) @@ -258,7 +258,7 @@ static sal_Int32 lcl_getMinPos( sal_Int32 pos1, sal_Int32 pos2 ) sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) { - const OUString aText = rNd.GetText(); + const OUString aText = m_rNode.GetText(); sal_Int32 fieldEndPos = aText.indexOf(CH_TXT_ATR_FIELDEND, nStartPos - 1); // HACK: for (so far) mysterious reasons the sdtContent element closes // too late in testDateFormField() unless an empty run is exported at @@ -283,10 +283,10 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) sal_Int32 nMinPos = (pos>=0) ? pos : SAL_MAX_INT32; // first the redline, then the attributes - if( pCurRedline ) + if( m_pCurRedline ) { - const SwPosition* pEnd = pCurRedline->End(); - if (pEnd->nNode == rNd) + const SwPosition* pEnd = m_pCurRedline->End(); + if (pEnd->nNode == m_rNode) { const sal_Int32 i = pEnd->nContent.GetIndex(); if ( i >= nStartPos && i < nMinPos ) @@ -296,11 +296,11 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) } } - if ( nCurRedlinePos < m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size() ) + if ( m_nCurRedlinePos < m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size() ) { // nCurRedlinePos point to the next redline - SwRedlineTable::size_type nRedLinePos = nCurRedlinePos; - if( pCurRedline ) + SwRedlineTable::size_type nRedLinePos = m_nCurRedlinePos; + if( m_pCurRedline ) ++nRedLinePos; for ( ; nRedLinePos < m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(); ++nRedLinePos ) @@ -310,7 +310,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) const SwPosition* pStt = pRedl->Start(); const SwPosition* pEnd = pRedl->End(); - if( pStt->nNode == rNd ) + if( pStt->nNode == m_rNode ) { const sal_Int32 i = pStt->nContent.GetIndex(); if( i >= nStartPos && i < nMinPos ) @@ -319,7 +319,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) else break; - if( pEnd->nNode == rNd ) + if( pEnd->nNode == m_rNode ) { const sal_Int32 i = pEnd->nContent.GetIndex(); if( i >= nStartPos && i < nMinPos ) @@ -330,12 +330,12 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) } } - if (mrSwFormatDrop.GetWholeWord() && nStartPos <= rNd.GetDropLen(0)) - nMinPos = rNd.GetDropLen(0); + if (mrSwFormatDrop.GetWholeWord() && nStartPos <= m_rNode.GetDropLen(0)) + nMinPos = m_rNode.GetDropLen(0); else if(nStartPos <= mrSwFormatDrop.GetChars()) nMinPos = mrSwFormatDrop.GetChars(); - if(const SwpHints* pTextAttrs = rNd.GetpSwpHints()) + if(const SwpHints* pTextAttrs = m_rNode.GetpSwpHints()) { // can be optimized if we consider that the TextAttrs are sorted by start position. @@ -406,19 +406,19 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool bWriteCombChars) TypedWhichId<SvxFontItem> nFontId = GetWhichOfScript( RES_CHRATR_FONT, GetScript() ); const SvxFontItem &rParentFont = - static_cast<const SwTextFormatColl&>(rNd.GetAnyFormatColl()).GetFormatAttr(nFontId); + static_cast<const SwTextFormatColl&>(m_rNode.GetAnyFormatColl()).GetFormatAttr(nFontId); const SvxFontItem *pFont = &rParentFont; const SfxPoolItem *pGrabBag = nullptr; - SfxItemSetFixed<RES_CHRATR_BEGIN, RES_TXTATR_END - 1> aExportSet(*rNd.GetSwAttrSet().GetPool()); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_TXTATR_END - 1> aExportSet(*m_rNode.GetSwAttrSet().GetPool()); //The hard formatting properties that affect the entire paragraph - if (rNd.HasSwAttrSet()) + if (m_rNode.HasSwAttrSet()) { // only copy hard attributes - bDeep = false - aExportSet.Set(rNd.GetSwAttrSet(), false/*bDeep*/); + aExportSet.Set(m_rNode.GetSwAttrSet(), false/*bDeep*/); // get the current font item. Use rNd.GetSwAttrSet instead of aExportSet: - const SvxFontItem &rNdFont = rNd.GetSwAttrSet().Get(nFontId); + const SvxFontItem &rNdFont = m_rNode.GetSwAttrSet().Get(nFontId); pFont = &rNdFont; aExportSet.ClearItem(nFontId); } @@ -426,7 +426,7 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool bWriteCombChars) //The additional hard formatting properties that affect this range in the //paragraph ww8::PoolItems aRangeItems; - if (const SwpHints* pTextAttrs = rNd.GetpSwpHints()) + if (const SwpHints* pTextAttrs = m_rNode.GetpSwpHints()) { for( size_t i = 0; i < pTextAttrs->Count(); ++i ) { @@ -503,7 +503,7 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool bWriteCombChars) ww8::PoolItems aExportItems; GetPoolItems( aExportSet, aExportItems, false ); - if( rNd.GetpSwpHints() == nullptr ) + if( m_rNode.GetpSwpHints() == nullptr ) m_rExport.SetCurItemSet(&aExportSet); for ( const auto& aRangeItem : aRangeItems ) @@ -514,7 +514,7 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool bWriteCombChars) if ( !aExportItems.empty() ) { const sw::BroadcastingModify* pOldMod = m_rExport.m_pOutFormatNode; - m_rExport.m_pOutFormatNode = &rNd; + m_rExport.m_pOutFormatNode = &m_rNode; m_rExport.m_aCurrentCharPropStarts.push( nSwPos ); // tdf#38778 Fix output of the font in DOC run for fields @@ -527,7 +527,7 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool bWriteCombChars) m_rExport.m_pOutFormatNode = pOldMod; } - if( rNd.GetpSwpHints() == nullptr ) + if( m_rNode.GetpSwpHints() == nullptr ) m_rExport.SetCurItemSet(nullptr); OSL_ENSURE( pFont, "must be *some* font associated with this txtnode" ); @@ -580,7 +580,7 @@ void SwWW8AttrIter::handleToggleProperty(SfxItemSet& rExportSet, const SwFormatC // get bold flag from specified paragraph style { - SwTextFormatColl& rTextColl = static_cast<SwTextFormatColl&>( rNd.GetAnyFormatColl() ); + SwTextFormatColl& rTextColl = static_cast<SwTextFormatColl&>( m_rNode.GetAnyFormatColl() ); sal_uInt16 nStyle = m_rExport.m_pStyles->GetSlot( &rTextColl ); nStyle = ( nStyle != 0xfff ) ? nStyle : 0; const SwFormat* pFormat = m_rExport.m_pStyles->GetSwFormat(nStyle); @@ -762,7 +762,7 @@ FlyProcessingState SwWW8AttrIter::OutFlys(sal_Int32 nSwPos) bool SwWW8AttrIter::IsTextAttr( sal_Int32 nSwPos ) const { // search for attrs with dummy character or content - if (const SwpHints* pTextAttrs = rNd.GetpSwpHints()) + if (const SwpHints* pTextAttrs = m_rNode.GetpSwpHints()) { for (size_t i = 0; i < pTextAttrs->Count(); ++i) { @@ -786,7 +786,7 @@ bool SwWW8AttrIter::IsTextAttr( sal_Int32 nSwPos ) const bool SwWW8AttrIter::IsExportableAttr(sal_Int32 nSwPos) const { - if (const SwpHints* pTextAttrs = rNd.GetpSwpHints()) + if (const SwpHints* pTextAttrs = m_rNode.GetpSwpHints()) { for (size_t i = 0; i < pTextAttrs->Count(); ++i) { @@ -815,7 +815,7 @@ bool SwWW8AttrIter::IsDropCap( int nSwPos ) bool bWholeWord = mrSwFormatDrop.GetWholeWord(); if (bWholeWord) { - const sal_Int32 nWordLen = rNd.GetDropLen(0); + const sal_Int32 nWordLen = m_rNode.GetDropLen(0); if(nSwPos == nWordLen && nSwPos != 0) return true; } @@ -830,7 +830,7 @@ bool SwWW8AttrIter::IsDropCap( int nSwPos ) bool SwWW8AttrIter::RequiresImplicitBookmark() { return std::any_of(m_rExport.m_aImplicitBookmarks.begin(), m_rExport.m_aImplicitBookmarks.end(), - [this](const aBookmarkPair& rBookmarkPair) { return rBookmarkPair.second == rNd.GetIndex(); }); + [this](const aBookmarkPair& rBookmarkPair) { return rBookmarkPair.second == m_rNode.GetIndex(); }); } //HasItem is for the summary of the double attributes: Underline and WordlineMode as TextItems. @@ -840,7 +840,7 @@ bool SwWW8AttrIter::RequiresImplicitBookmark() const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const { const SfxPoolItem* pRet = nullptr; - const SwpHints* pTextAttrs = rNd.GetpSwpHints(); + const SwpHints* pTextAttrs = m_rNode.GetpSwpHints(); if (pTextAttrs && !m_rExport.m_aCurrentCharPropStarts.empty()) { const sal_Int32 nTmpSwPos = m_rExport.m_aCurrentCharPropStarts.top(); @@ -886,7 +886,7 @@ void WW8Export::GetCurrentItems(ww::bytes &rItems) const const SfxPoolItem& SwWW8AttrIter::GetItem(sal_uInt16 nWhich) const { const SfxPoolItem* pRet = HasTextItem(nWhich); - return pRet ? *pRet : rNd.SwContentNode::GetAttr(nWhich); + return pRet ? *pRet : m_rNode.SwContentNode::GetAttr(nWhich); } void WW8AttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 /*nPos*/, const SwFormatRuby& rRuby ) @@ -1254,7 +1254,7 @@ void SwWW8AttrIter::SplitRun( sal_Int32 nSplitEndPos ) maCharRuns.insert( ++aIter, aNewEntry); maCharRunIter = maCharRuns.begin(); IterToCurrent(); - nCurrentSwPos = SearchNext(1); + m_nCurrentSwPos = SearchNext(1); } void WW8AttributeOutput::FieldVanish(const OUString& rText, ww::eField /*eType*/, OUString const*const /*pBookmarkName*/) @@ -1364,7 +1364,7 @@ void AttributeOutputBase::TOXMark( const SwTextNode& rNode, const SwTOXMark& rAt int SwWW8AttrIter::OutAttrWithRange(const SwTextNode& rNode, sal_Int32 nPos) { int nRet = 0; - if ( const SwpHints* pTextAttrs = rNd.GetpSwpHints() ) + if ( const SwpHints* pTextAttrs = m_rNode.GetpSwpHints() ) { m_rExport.m_aCurrentCharPropStarts.push( nPos ); const sal_Int32* pEnd; @@ -1379,7 +1379,7 @@ int SwWW8AttrIter::OutAttrWithRange(const SwTextNode& rNode, sal_Int32 nPos) pEnd = pHt->End(); if (nPos == *pEnd && nPos != pHt->GetStart()) { - if (m_rExport.AttrOutput().EndURL(nPos == rNd.Len())) + if (m_rExport.AttrOutput().EndURL(nPos == m_rNode.Len())) --nRet; } break; @@ -1419,7 +1419,7 @@ int SwWW8AttrIter::OutAttrWithRange(const SwTextNode& rNode, sal_Int32 nPos) pEnd = pHt->End(); if (nPos == *pEnd && nPos == pHt->GetStart()) { // special case: empty must be handled here - if (m_rExport.AttrOutput().EndURL(nPos == rNd.Len())) + if (m_rExport.AttrOutput().EndURL(nPos == m_rNode.Len())) --nRet; } break; @@ -1438,18 +1438,18 @@ int SwWW8AttrIter::OutAttrWithRange(const SwTextNode& rNode, sal_Int32 nPos) break; case RES_TXTATR_TOXMARK: if ( nPos == pHt->GetStart() ) - m_rExport.AttrOutput().TOXMark( rNd, *static_cast< const SwTOXMark* >( pItem ) ); + m_rExport.AttrOutput().TOXMark( m_rNode, *static_cast< const SwTOXMark* >( pItem ) ); break; case RES_TXTATR_CJK_RUBY: if ( nPos == pHt->GetStart() ) { - m_rExport.AttrOutput().StartRuby( rNd, nPos, *static_cast< const SwFormatRuby* >( pItem ) ); + m_rExport.AttrOutput().StartRuby( m_rNode, nPos, *static_cast< const SwFormatRuby* >( pItem ) ); ++nRet; } pEnd = pHt->End(); if (nPos == *pEnd && nPos == pHt->GetStart()) { // special case: empty must be handled here - m_rExport.AttrOutput().EndRuby( rNd, nPos ); + m_rExport.AttrOutput().EndRuby( m_rNode, nPos ); --nRet; } break; @@ -1465,7 +1465,7 @@ int SwWW8AttrIter::OutAttrWithRange(const SwTextNode& rNode, sal_Int32 nPos) bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) const { // search next Redline - for( SwRedlineTable::size_type nPos = nCurRedlinePos; + for( SwRedlineTable::size_type nPos = m_nCurRedlinePos; nPos < m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(); ++nPos ) { const SwRangeRedline *pRange = m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[nPos]; @@ -1476,7 +1476,7 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons // Here we find out if the para end marker we will emit is affected by // redlining, in which case it must be included by the range of character // attributes that contains the redlining information. - if (pEnd->nNode == rNd) + if (pEnd->nNode == m_rNode) { if (pEnd->nContent.GetIndex() == nEnd) { @@ -1488,7 +1488,7 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons } bBreak = false; } - if (pStart->nNode == rNd) + if (pStart->nNode == m_rNode) { if (pStart->nContent.GetIndex() == nEnd) { @@ -1500,7 +1500,7 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons } bBreak = false; } - if (pStart->nNode.GetIndex()-1 == rNd.GetIndex()) + if (pStart->nNode.GetIndex()-1 == m_rNode.GetIndex()) { if (pStart->nContent.GetIndex() == 0) { @@ -1520,14 +1520,14 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons const SwRedlineData* SwWW8AttrIter::GetParagraphLevelRedline( ) { - pCurRedline = nullptr; + m_pCurRedline = nullptr; // ToDo : this is not the most ideal ... should start maybe from 'nCurRedlinePos' for(SwRangeRedline* pRedl : m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()) { const SwPosition* pCheckedStt = pRedl->Start(); - if( pCheckedStt->nNode == rNd ) + if( pCheckedStt->nNode == m_rNode ) { // Maybe add here a check that also the start & end of the redline is the entire paragraph @@ -1535,8 +1535,8 @@ const SwRedlineData* SwWW8AttrIter::GetParagraphLevelRedline( ) if (pRedl->GetType() == RedlineType::ParagraphFormat) { // write data of this redline - pCurRedline = pRedl; - return &( pCurRedline->GetRedlineData() ); + m_pCurRedline = pRedl; + return &( m_pCurRedline->GetRedlineData() ); } } } @@ -1545,37 +1545,37 @@ const SwRedlineData* SwWW8AttrIter::GetParagraphLevelRedline( ) const SwRedlineData* SwWW8AttrIter::GetRunLevelRedline( sal_Int32 nPos ) { - if( pCurRedline ) + if( m_pCurRedline ) { - const SwPosition* pEnd = pCurRedline->End(); - if (pEnd->nNode != rNd || pEnd->nContent.GetIndex() > nPos) + const SwPosition* pEnd = m_pCurRedline->End(); + if (pEnd->nNode != m_rNode || pEnd->nContent.GetIndex() > nPos) { - switch( pCurRedline->GetType() ) + switch( m_pCurRedline->GetType() ) { case RedlineType::Insert: case RedlineType::Delete: case RedlineType::Format: // write data of this redline - return &( pCurRedline->GetRedlineData() ); + return &( m_pCurRedline->GetRedlineData() ); default: break; } } - pCurRedline = nullptr; - ++nCurRedlinePos; + m_pCurRedline = nullptr; + ++m_nCurRedlinePos; } - assert(!pCurRedline); + assert(!m_pCurRedline); // search next Redline - for( ; nCurRedlinePos < m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(); - ++nCurRedlinePos ) + for( ; m_nCurRedlinePos < m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(); + ++m_nCurRedlinePos ) { - const SwRangeRedline* pRedl = m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ nCurRedlinePos ]; + const SwRangeRedline* pRedl = m_rExport.m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ m_nCurRedlinePos ]; const SwPosition* pStt = pRedl->Start(); const SwPosition* pEnd = pRedl->End(); - if( pStt->nNode == rNd ) + if( pStt->nNode == m_rNode ) { if( pStt->nContent.GetIndex() >= nPos ) { @@ -1587,8 +1587,8 @@ const SwRedlineData* SwWW8AttrIter::GetRunLevelRedline( sal_Int32 nPos ) case RedlineType::Delete: case RedlineType::Format: // write data of this redline - pCurRedline = pRedl; - return &( pCurRedline->GetRedlineData() ); + m_pCurRedline = pRedl; + return &( m_pCurRedline->GetRedlineData() ); default: break; } @@ -1601,10 +1601,10 @@ const SwRedlineData* SwWW8AttrIter::GetRunLevelRedline( sal_Int32 nPos ) break; } - if( pEnd->nNode == rNd && + if( pEnd->nNode == m_rNode && pEnd->nContent.GetIndex() < nPos ) { - pCurRedline = pRedl; + m_pCurRedline = pRedl; break; } } diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 04646415b47e..feaa657bf8ff 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1074,11 +1074,11 @@ bool WW8_WrPlcSepx::HeaderFooterWritten() sal_uInt16 MSWordSections::CurrentNumberOfColumns( const SwDoc &rDoc ) const { - OSL_ENSURE( !aSects.empty(), "no segment inserted yet" ); - if ( aSects.empty() ) + OSL_ENSURE( !m_aSects.empty(), "no segment inserted yet" ); + if ( m_aSects.empty() ) return 1; - return NumberOfColumns( rDoc, aSects.back() ); + return NumberOfColumns( rDoc, m_aSects.back() ); } sal_uInt16 MSWordSections::NumberOfColumns( const SwDoc &rDoc, const WW8_SepInfo& rInfo ) @@ -1102,8 +1102,8 @@ sal_uInt16 MSWordSections::NumberOfColumns( const SwDoc &rDoc, const WW8_SepInfo const WW8_SepInfo* MSWordSections::CurrentSectionInfo() { - if ( !aSects.empty() ) - return &aSects.back(); + if ( !m_aSects.empty() ) + return &m_aSects.back(); return nullptr; } @@ -1114,8 +1114,8 @@ void MSWordSections::AppendSection( const SwPageDesc* pPd, if (HeaderFooterWritten()) { return; // #i117955# prevent new sections in endnotes } - aSects.emplace_back( pPd, pSectionFormat, nLnNumRestartNo, std::nullopt, nullptr, bIsFirstParagraph ); - NeedsDocumentProtected( aSects.back() ); + m_aSects.emplace_back( pPd, pSectionFormat, nLnNumRestartNo, std::nullopt, nullptr, bIsFirstParagraph ); + NeedsDocumentProtected( m_aSects.back() ); } void WW8_WrPlcSepx::AppendSep( WW8_CP nStartCp, const SwPageDesc* pPd, @@ -1137,7 +1137,7 @@ void MSWordSections::AppendSection( const SwFormatPageDesc& rPD, WW8_SepInfo aI( rPD.GetPageDesc(), pSectionFormat, nLnNumRestartNo, rPD.GetNumOffset(), &rNd ); - aSects.push_back( aI ); + m_aSects.push_back( aI ); NeedsDocumentProtected( aI ); } @@ -1278,7 +1278,7 @@ void MSWordSections::CheckForFacinPg( const WW8Export& rWrt ) const // Dop.fFacingPages == Header and Footer different // Dop.fSwapBordersFacingPgs == mirrored borders sal_uInt16 nEnd = 0; - for( const WW8_SepInfo& rSepInfo : aSects ) + for( const WW8_SepInfo& rSepInfo : m_aSects ) { if( !rSepInfo.pSectionFormat ) { @@ -1981,7 +1981,7 @@ bool WW8_WrPlcSepx::WriteKFText( WW8Export& rWrt ) unsigned int nOldIndex = rWrt.GetHdFtIndex(); rWrt.SetHdFtIndex( 0 ); - for (const WW8_SepInfo & rSepInfo : aSects) + for (const WW8_SepInfo & rSepInfo : m_aSects) { auto pAttrDesc = std::make_shared<WW8_PdAttrDesc>(); m_SectionAttributes.push_back(pAttrDesc); @@ -2021,7 +2021,7 @@ bool WW8_WrPlcSepx::WriteKFText( WW8Export& rWrt ) void WW8_WrPlcSepx::WriteSepx( SvStream& rStrm ) const { - OSL_ENSURE(m_SectionAttributes.size() == static_cast<size_t>(aSects.size()) + OSL_ENSURE(m_SectionAttributes.size() == static_cast<size_t>(m_aSects.size()) , "WriteSepx(): arrays out of sync!"); for (const auto & rSectionAttribute : m_SectionAttributes) // all sections { @@ -2037,12 +2037,12 @@ void WW8_WrPlcSepx::WriteSepx( SvStream& rStrm ) const void WW8_WrPlcSepx::WritePlcSed( WW8Export& rWrt ) const { - OSL_ENSURE(m_SectionAttributes.size() == static_cast<size_t>(aSects.size()) + OSL_ENSURE(m_SectionAttributes.size() == static_cast<size_t>(m_aSects.size()) , "WritePlcSed(): arrays out of sync!"); - OSL_ENSURE( aCps.size() == aSects.size() + 1, "WrPlcSepx: DeSync" ); + OSL_ENSURE( aCps.size() == m_aSects.size() + 1, "WrPlcSepx: DeSync" ); sal_uInt64 nFcStart = rWrt.pTableStrm->Tell(); - for( decltype(aSects)::size_type i = 0; i <= aSects.size(); i++ ) + for( decltype(m_aSects)::size_type i = 0; i <= m_aSects.size(); i++ ) { sal_uInt32 nP = aCps[i]; rWrt.pTableStrm->WriteUInt32(nP); diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 0b2c25ad6443..6cf8c86ae128 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -196,7 +196,7 @@ class MSWordSections { protected: bool mbDocumentIsProtected; - std::vector<WW8_SepInfo> aSects; + std::vector<WW8_SepInfo> m_aSects; void CheckForFacinPg( const WW8Export& rWrt ) const; void NeedsDocumentProtected(const WW8_SepInfo &rInfo); @@ -1436,7 +1436,7 @@ public: class MSWordAttrIter { private: - MSWordAttrIter* pOld; + MSWordAttrIter* m_pOld; MSWordAttrIter(const MSWordAttrIter&) = delete; MSWordAttrIter& operator=(const MSWordAttrIter&) = delete; protected: @@ -1453,16 +1453,16 @@ public: class MSWord_SdrAttrIter : public MSWordAttrIter { private: - const EditTextObject* pEditObj; - const SfxItemPool* pEditPool; - std::vector<EECharAttrib> aTextAtrArr; - std::vector<const EECharAttrib*> aChrTextAtrArr; - std::vector<rtl_TextEncoding> aChrSetArr; - sal_Int32 nPara; - sal_Int32 nCurrentSwPos; - sal_Int32 nTmpSwPos; // for HasItem() - rtl_TextEncoding eNdChrSet; - sal_uInt16 nScript; + const EditTextObject* m_pEditObj; + const SfxItemPool* m_pEditPool; + std::vector<EECharAttrib> m_aTextAtrArr; + std::vector<const EECharAttrib*> m_aChrTextAtrArr; + std::vector<rtl_TextEncoding> m_aChrSetArr; + sal_Int32 m_nPara; + sal_Int32 m_nCurrentSwPos; + sal_Int32 m_nTmpSwPos; // for HasItem() + rtl_TextEncoding m_eNdChrSet; + sal_uInt16 m_nScript; sal_uInt8 mnTyp; sal_Int32 SearchNext( sal_Int32 nStartPos ); @@ -1481,14 +1481,14 @@ public: bool IsTextAttr(sal_Int32 nSwPos); - void NextPos() { if ( nCurrentSwPos < SAL_MAX_INT32 ) nCurrentSwPos = SearchNext( nCurrentSwPos + 1 ); } + void NextPos() { if ( m_nCurrentSwPos < SAL_MAX_INT32 ) m_nCurrentSwPos = SearchNext( m_nCurrentSwPos + 1 ); } void OutAttr( sal_Int32 nSwPos ); virtual const SfxPoolItem* HasTextItem( sal_uInt16 nWhich ) const override; virtual const SfxPoolItem& GetItem( sal_uInt16 nWhich ) const override; - sal_Int32 WhereNext() const { return nCurrentSwPos; } + sal_Int32 WhereNext() const { return m_nCurrentSwPos; } rtl_TextEncoding GetNextCharSet() const; - rtl_TextEncoding GetNodeCharSet() const { return eNdChrSet; } + rtl_TextEncoding GetNodeCharSet() const { return m_eNdChrSet; } }; // class SwWW8AttrIter is a helper for constructing the Fkp.chpx. @@ -1501,7 +1501,7 @@ public: class SwWW8AttrIter : public MSWordAttrIter { private: - const SwTextNode& rNd; + const SwTextNode& m_rNode; sw::util::CharRuns maCharRuns; sw::util::CharRuns::const_iterator maCharRunIter; @@ -1510,9 +1510,9 @@ private: sal_uInt16 mnScript; bool mbCharIsRTL; - const SwRangeRedline* pCurRedline; - sal_Int32 nCurrentSwPos; - SwRedlineTable::size_type nCurRedlinePos; + const SwRangeRedline* m_pCurRedline; + sal_Int32 m_nCurrentSwPos; + SwRedlineTable::size_type m_nCurRedlinePos; bool mbParaIsRTL; @@ -1540,7 +1540,7 @@ public: bool IsDropCap( int nSwPos ); bool RequiresImplicitBookmark(); - void NextPos() { if ( nCurrentSwPos < SAL_MAX_INT32 ) nCurrentSwPos = SearchNext( nCurrentSwPos + 1 ); } + void NextPos() { if ( m_nCurrentSwPos < SAL_MAX_INT32 ) m_nCurrentSwPos = SearchNext( m_nCurrentSwPos + 1 ); } void OutAttr(sal_Int32 nSwPos, bool bWriteCombinedChars); virtual const SfxPoolItem* HasTextItem( sal_uInt16 nWhich ) const override; @@ -1551,7 +1551,7 @@ public: FlyProcessingState OutFlys(sal_Int32 nSwPos); bool HasFlysAt(sal_Int32 nSwPos) const; - sal_Int32 WhereNext() const { return nCurrentSwPos; } + sal_Int32 WhereNext() const { return m_nCurrentSwPos; } sal_uInt16 GetScript() const { return mnScript; } bool IsParaRTL() const { return mbParaIsRTL; } rtl_TextEncoding GetCharSet() const { return meChrSet; } @@ -1564,7 +1564,7 @@ public: void SplitRun( sal_Int32 nSplitEndPos ); - const SwTextNode& GetNode() const { return rNd; } + const SwTextNode& GetNode() const { return m_rNode; } }; /// Class to collect and output the styles table.