sw/source/filter/ww8/escher.hxx | 4 - sw/source/filter/ww8/wrtw8esh.cxx | 58 ++++++++++++++-------------- sw/source/filter/ww8/wrtw8sty.cxx | 8 +-- sw/source/filter/ww8/ww8attributeoutput.hxx | 6 +- sw/source/filter/ww8/ww8par.hxx | 18 ++++---- sw/source/filter/ww8/ww8par2.cxx | 4 - sw/source/filter/ww8/ww8par6.cxx | 28 ++++++------- 7 files changed, 63 insertions(+), 63 deletions(-)
New commits: commit 507a8871c25aa9b7e5a02ceb86f5c60ebccc722b Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Mon May 30 08:44:55 2022 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon May 30 09:45:45 2022 +0200 sw: prefix members of CompareDrawObjs, SwBasicEscherEx, ... ... WW8AttributeOutput and wwSection See tdf#94879 for motivation. Change-Id: Iefc7aaf4caaaca5382ac0b28ea8e3ebe63250020 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135108 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/filter/ww8/escher.hxx b/sw/source/filter/ww8/escher.hxx index c11fda1ebf16..102d933702e8 100644 --- a/sw/source/filter/ww8/escher.hxx +++ b/sw/source/filter/ww8/escher.hxx @@ -95,8 +95,8 @@ class SwBasicEscherEx : public EscherEx private: void Init(); protected: - WW8Export& rWrt; - SvStream* pEscherStrm; + WW8Export& mrWrt; + SvStream* mpEscherStrm; tools::Long mnEmuMul, mnEmuDiv; virtual sal_Int32 WriteFlyFrameAttr(const SwFrameFormat& rFormat, MSO_SPT eShapeType, diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index a1193999f59c..edab0fccf69a 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -102,7 +102,7 @@ using ::com::sun::star::drawing::XShape; bool SwBasicEscherEx::IsRelUrl() const { bool bRelUrl = false; - SfxMedium * pMedium = rWrt.GetWriter().GetMedia(); + SfxMedium * pMedium = mrWrt.GetWriter().GetMedia(); if ( pMedium ) bRelUrl = pMedium->IsRemote() ? officecfg::Office::Common::Save::URL::Internet::get() @@ -113,7 +113,7 @@ bool SwBasicEscherEx::IsRelUrl() const OUString SwBasicEscherEx::GetBasePath() const { OUString sDocUrl; - SfxMedium * pMedium = rWrt.GetWriter().GetMedia(); + SfxMedium * pMedium = mrWrt.GetWriter().GetMedia(); if (pMedium) { const SfxItemSet* pPItemSet = pMedium->GetItemSet(); @@ -312,14 +312,14 @@ namespace class CompareDrawObjs { private: - const WW8Export& wrt; + const WW8Export& m_rWrt; public: - explicit CompareDrawObjs(const WW8Export& rWrt) : wrt(rWrt) {}; + explicit CompareDrawObjs(const WW8Export& rWrt) : m_rWrt(rWrt) {}; bool operator()(DrawObj const *a, DrawObj const *b) const { - sal_uLong aSort = lcl_getSdrOrderNumber(wrt, a); - sal_uLong bSort = lcl_getSdrOrderNumber(wrt, b); + sal_uLong aSort = lcl_getSdrOrderNumber(m_rWrt, a); + sal_uLong bSort = lcl_getSdrOrderNumber(m_rWrt, b); return aSort < bSort; } }; @@ -1481,11 +1481,11 @@ void SwEscherEx::WritePictures() if( SvStream* pPicStrm = static_cast< SwEscherExGlobal& >( *mxGlobal ).GetPictureStream() ) { // set the blip - entries to the correct stream pos - sal_Int32 nEndPos = rWrt.Strm().Tell(); + sal_Int32 nEndPos = mrWrt.Strm().Tell(); mxGlobal->SetNewBlipStreamOffset( nEndPos ); pPicStrm->Seek( 0 ); - rWrt.Strm().WriteStream( *pPicStrm ); + mrWrt.Strm().WriteStream( *pPicStrm ); } Flush(); } @@ -1509,7 +1509,7 @@ SvStream* SwEscherExGlobal::ImplQueryPictureStream() } SwBasicEscherEx::SwBasicEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) - : EscherEx( std::make_shared<SwEscherExGlobal>(), pStrm), rWrt(rWW8Wrt), pEscherStrm(pStrm) + : EscherEx( std::make_shared<SwEscherExGlobal>(), pStrm), mrWrt(rWW8Wrt), mpEscherStrm(pStrm) { Init(); } @@ -1583,7 +1583,7 @@ void SwBasicEscherEx::WriteGrfBullet(const Graphic& rGrf) aPropOpt.AddOpt( ESCHER_Prop_dxTextRight, 0 ); const Color aTmpColor( COL_WHITE ); std::shared_ptr<SvxBrushItem> aBrush(std::make_shared<SvxBrushItem>(aTmpColor, RES_BACKGROUND)); - const SvxBrushItem* pRet = rWrt.GetCurrentPageBgBrush(); + const SvxBrushItem* pRet = mrWrt.GetCurrentPageBgBrush(); if (pRet && (pRet->GetGraphic() ||( pRet->GetColor() != COL_TRANSPARENT))) aBrush.reset(pRet->Clone()); WriteBrushAttr(*aBrush, aPropOpt); @@ -2028,7 +2028,7 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat, else { // for unknown reasons, force exporting a non-transparent background on fly frames. - std::shared_ptr<SvxBrushItem> aBrush(rWrt.TrueFrameBgBrush(rFormat)); + std::shared_ptr<SvxBrushItem> aBrush(mrWrt.TrueFrameBgBrush(rFormat)); if(aBrush) { @@ -2116,7 +2116,7 @@ sal_Int32 SwEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat, MSO_SPT eS void SwBasicEscherEx::Init() { MapUnit eMap = MapUnit::MapTwip; - if (SwDrawModel *pModel = rWrt.m_rDoc.getIDocumentDrawModelAccess().GetDrawModel()) + if (SwDrawModel *pModel = mrWrt.m_rDoc.getIDocumentDrawModelAccess().GetDrawModel()) { // PPT works only with units of 576DPI // WW however is using twips, i.e 1440DPI. @@ -2129,7 +2129,7 @@ void SwBasicEscherEx::Init() mnEmuMul = aFact.GetNumerator(); mnEmuDiv = aFact.GetDenominator(); - SetHellLayerId(rWrt.m_rDoc.getIDocumentDrawModelAccess().GetHellId()); + SetHellLayerId(mrWrt.m_rDoc.getIDocumentDrawModelAccess().GetHellId()); } sal_Int32 SwBasicEscherEx::ToFract16(sal_Int32 nVal, sal_uInt32 nMax) @@ -2155,7 +2155,7 @@ sal_Int32 SwBasicEscherEx::ToFract16(sal_Int32 nVal, sal_uInt32 nMax) SdrLayerID SwBasicEscherEx::GetInvisibleHellId() const { - return rWrt.m_rDoc.getIDocumentDrawModelAccess().GetInvisibleHellId(); + return mrWrt.m_rDoc.getIDocumentDrawModelAccess().GetInvisibleHellId(); } void SwBasicEscherEx::WritePictures() @@ -2164,10 +2164,10 @@ void SwBasicEscherEx::WritePictures() { // set the blip - entries to the correct stream pos sal_Int32 nEndPos = pPicStrm->Tell(); - mxGlobal->WriteBlibStoreEntry(*pEscherStrm, 1, nEndPos); + mxGlobal->WriteBlibStoreEntry(*mpEscherStrm, 1, nEndPos); pPicStrm->Seek(0); - pEscherStrm->WriteStream( *pPicStrm ); + mpEscherStrm->WriteStream( *pPicStrm ); } } @@ -2190,18 +2190,18 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) CloseContainer(); // ESCHER_DggContainer sal_uInt8 i = 2; // for header/footer and the other - PlcDrawObj *pSdrObjs = rWrt.m_pHFSdrObjs.get(); - pTextBxs = rWrt.m_pHFTextBxs.get(); + PlcDrawObj *pSdrObjs = mrWrt.m_pHFSdrObjs.get(); + pTextBxs = mrWrt.m_pHFTextBxs.get(); // if no header/footer -> skip over if (!pSdrObjs->size()) { --i; - pSdrObjs = rWrt.m_pSdrObjs.get(); - pTextBxs = rWrt.m_pTextBxs.get(); + pSdrObjs = mrWrt.m_pSdrObjs.get(); + pTextBxs = mrWrt.m_pTextBxs.get(); } - for( ; i--; pSdrObjs = rWrt.m_pSdrObjs.get(), pTextBxs = rWrt.m_pTextBxs.get() ) + for( ; i--; pSdrObjs = mrWrt.m_pSdrObjs.get(), pTextBxs = mrWrt.m_pTextBxs.get() ) { // "dummy char" (or any Count ?) - why? Only Microsoft knows it. GetStream().WriteChar( i ); @@ -2210,7 +2210,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) EnterGroup(); - sal_uLong nSecondShapeId = pSdrObjs == rWrt.m_pSdrObjs.get() ? GenerateShapeId() : 0; + sal_uLong nSecondShapeId = pSdrObjs == mrWrt.m_pSdrObjs.get() ? GenerateShapeId() : 0; // write now all Writer-/DrawObjects DrawObjPointerVector aSorted; @@ -2274,7 +2274,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) nSecondShapeId ); EscherPropertyContainer aPropOpt; - const SwFrameFormat &rFormat = rWrt.m_rDoc.GetPageDesc(0).GetMaster(); + const SwFrameFormat &rFormat = mrWrt.m_rDoc.GetPageDesc(0).GetMaster(); if (const SvxBrushItem* pBrush = rFormat.GetItemIfSet(RES_BACKGROUND)) { WriteBrushAttr(*pBrush, aPropOpt); @@ -2310,10 +2310,10 @@ SwEscherEx::~SwEscherEx() void SwEscherEx::FinishEscher() { - pEscherStrm->Seek(0); - rWrt.m_pTableStrm->WriteStream( *pEscherStrm ); - delete pEscherStrm; - pEscherStrm = nullptr; + mpEscherStrm->Seek(0); + mrWrt.m_pTableStrm->WriteStream( *mpEscherStrm ); + delete mpEscherStrm; + mpEscherStrm = nullptr; } @@ -2906,7 +2906,7 @@ void SwEscherEx::WriteOCXControl( const SwFrameFormat& rFormat, sal_uInt32 nShap OpenContainer( ESCHER_SpContainer ); - SwDrawModel *pModel = rWrt.m_rDoc.getIDocumentDrawModelAccess().GetDrawModel(); + SwDrawModel *pModel = mrWrt.m_rDoc.getIDocumentDrawModelAccess().GetDrawModel(); OutputDevice *pDevice = Application::GetDefaultDevice(); OSL_ENSURE(pModel && pDevice, "no model or device"); @@ -2932,7 +2932,7 @@ void SwEscherEx::WriteOCXControl( const SwFrameFormat& rFormat, sal_uInt32 nShap void SwEscherEx::MakeZOrderArrAndFollowIds( std::vector<DrawObj>& rSrcArr, DrawObjPointerVector&rDstArr) { - ::lcl_makeZOrderArray(rWrt, rSrcArr, rDstArr); + ::lcl_makeZOrderArray(mrWrt, rSrcArr, rDstArr); //Now set up the follow IDs aFollowShpIds.clear(); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 6e9053401606..18c9e7d982e4 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -393,9 +393,9 @@ void WW8AttributeOutput::EndStyle() impl_SkipOdd( m_rWW8Export.m_pO, m_rWW8Export.m_pTableStrm->Tell() ); short nLen = m_rWW8Export.m_pO->size() - 2; // length of the style - sal_uInt8* p = m_rWW8Export.m_pO->data() + nPOPosStdLen1; + sal_uInt8* p = m_rWW8Export.m_pO->data() + m_nPOPosStdLen1; ShortToSVBT16( nLen, p ); // add - p = m_rWW8Export.m_pO->data() + nPOPosStdLen2; + p = m_rWW8Export.m_pO->data() + m_nPOPosStdLen2; ShortToSVBT16( nLen, p ); // also m_rWW8Export.m_pTableStrm->WriteBytes(m_rWW8Export.m_pO->data(), m_rWW8Export.m_pO->size()); @@ -432,12 +432,12 @@ void WW8AttributeOutput::StartStyle( const OUString& rName, StyleType eType, sal sal_uInt16 nLen = static_cast< sal_uInt16 >( ( pData - aWW8_STD ) + 1 + (2 * (rName.getLength() + 1)) ); // temporary - nPOPosStdLen1 = m_rWW8Export.m_pO->size(); // Adr1 for adding the length + m_nPOPosStdLen1 = m_rWW8Export.m_pO->size(); // Adr1 for adding the length SwWW8Writer::InsUInt16( *m_rWW8Export.m_pO, nLen ); m_rWW8Export.m_pO->insert( m_rWW8Export.m_pO->end(), aWW8_STD, pData ); - nPOPosStdLen2 = nPOPosStdLen1 + 8; // Adr2 for adding of "end of upx" + m_nPOPosStdLen2 = m_nPOPosStdLen1 + 8; // Adr2 for adding of "end of upx" // write names SwWW8Writer::InsUInt16( *m_rWW8Export.m_pO, rName.getLength() ); // length diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index f459a7bf8a9c..9ea43ef885b5 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -445,7 +445,7 @@ protected: /// /// We have to remember these positions between the StartStyle() and /// EndStyle(). - sal_uInt16 nPOPosStdLen1, nPOPosStdLen2; + sal_uInt16 m_nPOPosStdLen1, m_nPOPosStdLen2; /// For output of styles. /// @@ -475,8 +475,8 @@ public: : AttributeOutputBase(rWW8Export.GetWriter().GetMedia()->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE)) , m_rWW8Export(rWW8Export) - , nPOPosStdLen1(0) - , nPOPosStdLen2(0) + , m_nPOPosStdLen1(0) + , m_nPOPosStdLen2(0) , m_nStyleStartSize(0) , m_nStyleLenPos(0) , m_nStyleCountPos(0) diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index fc1b70d17eee..fa33b75b197b 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -778,16 +778,16 @@ class wwSection public: explicit wwSection(const SwPosition &rPos); SEPr maSep; - WW8_BRCVer9 brc[4]; + WW8_BRCVer9 m_brc[4]; SwNodeIndex maStart; SwSection *mpSection; SwPageDesc *mpPage; SvxFrameDirection meDir; - sal_uInt32 nPgWidth; - sal_uInt32 nPgLeft; - sal_uInt32 nPgRight; - sal_uInt32 nPgGutter; + sal_uInt32 m_nPgWidth; + sal_uInt32 m_nPgLeft; + sal_uInt32 m_nPgRight; + sal_uInt32 m_nPgGutter; bool m_bRtlGutter = false; css::drawing::TextVerticalAdjust mnVerticalAdjustment; @@ -803,12 +803,12 @@ public: sal_uInt16 PageStartAt() const { return maSep.pgnStart; } bool PageRestartNo() const { return maSep.fPgnRestart != 0; } bool IsBiDi() const { return maSep.fBiDi != 0; } - sal_uInt32 GetPageWidth() const { return nPgWidth; } + sal_uInt32 GetPageWidth() const { return m_nPgWidth; } sal_uInt32 GetTextAreaWidth() const - { return GetPageWidth() - GetPageLeft() - nPgGutter - GetPageRight(); } + { return GetPageWidth() - GetPageLeft() - m_nPgGutter - GetPageRight(); } sal_uInt32 GetPageHeight() const { return maSep.yaPage; } - sal_uInt32 GetPageLeft() const { return nPgLeft; } - sal_uInt32 GetPageRight() const { return nPgRight; } + sal_uInt32 GetPageLeft() const { return m_nPgLeft; } + sal_uInt32 GetPageRight() const { return m_nPgRight; } bool IsLandScape() const { return maSep.dmOrientPage != 0; } bool IsFixedHeightHeader() const { return maSep.dyaTop < 0; } bool IsFixedHeightFooter() const { return maSep.dyaBottom < 0; } diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 5c7f3e2bc7c7..b92f756b3abf 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -144,12 +144,12 @@ bool wwSectionManager::CurrentSectionIsProtected() const sal_uInt32 wwSectionManager::GetPageLeft() const { - return !maSegments.empty() ? maSegments.back().nPgLeft : 0; + return !maSegments.empty() ? maSegments.back().m_nPgLeft : 0; } sal_uInt32 wwSectionManager::GetPageRight() const { - return !maSegments.empty() ? maSegments.back().nPgRight : 0; + return !maSegments.empty() ? maSegments.back().m_nPgRight : 0; } sal_uInt32 wwSectionManager::GetPageWidth() const diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 306d8907cf38..96059da34cda 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -491,7 +491,7 @@ void wwSectionManager::SetLeftRight(wwSection &rSection) } // Left / Right - if ((rSection.nPgWidth - nWWLe - nWWRi) < MINLAY) + if ((rSection.m_nPgWidth - nWWLe - nWWRi) < MINLAY) { /* There are some label templates which are "broken", they specify @@ -506,12 +506,12 @@ void wwSectionManager::SetLeftRight(wwSection &rSection) it will add up the values to give a wider page than is actually being used. */ - nWWRi = rSection.nPgWidth - nWWLe - MINLAY; + nWWRi = rSection.m_nPgWidth - nWWLe - MINLAY; } - rSection.nPgLeft = nWWLe; - rSection.nPgRight = nWWRi; - rSection.nPgGutter = nWWGu; + rSection.m_nPgLeft = nWWLe; + rSection.m_nPgRight = nWWRi; + rSection.m_nPgGutter = nWWGu; } void wwSectionManager::SetPage(SwPageDesc &rInPageDesc, SwFrameFormat &rFormat, @@ -527,7 +527,7 @@ void wwSectionManager::SetPage(SwPageDesc &rInPageDesc, SwFrameFormat &rFormat, rFormat.SetFormatAttr(aSz); SvxLRSpaceItem aLR(rSection.GetPageLeft(), rSection.GetPageRight(), 0, 0, RES_LR_SPACE); - aLR.SetGutterMargin(rSection.nPgGutter); + aLR.SetGutterMargin(rSection.m_nPgGutter); rFormat.SetFormatAttr(aLR); SfxBoolItem aRtlGutter(RES_RTL_GUTTER, rSection.m_bRtlGutter); @@ -557,12 +557,12 @@ tools::Long SetBorderDistance(bool bFromEdge, SvxBoxItem& aBox, SvxBoxItemLine e void SwWW8ImplReader::SetPageBorder(SwFrameFormat &rFormat, const wwSection &rSection) { - if (!IsBorder(rSection.brc)) + if (!IsBorder(rSection.m_brc)) return; SfxItemSet aSet(rFormat.GetAttrSet()); short aSizeArray[5]={0}; - SetFlyBordersShadow(aSet, rSection.brc, &aSizeArray[0]); + SetFlyBordersShadow(aSet, rSection.m_brc, &aSizeArray[0]); SvxLRSpaceItem aLR(aSet.Get(RES_LR_SPACE)); SvxULSpaceItem aUL(aSet.Get(RES_UL_SPACE)); SvxBoxItem aBox(aSet.Get(RES_BOX)); @@ -825,10 +825,10 @@ wwSection::wwSection(const SwPosition &rPos) : maStart(rPos.nNode) , mpSection(nullptr) , mpPage(nullptr) , meDir(SvxFrameDirection::Horizontal_LR_TB) - , nPgWidth(SvxPaperInfo::GetPaperSize(PAPER_A4).Width()) - , nPgLeft(MM_250) - , nPgRight(MM_250) - , nPgGutter(0) + , m_nPgWidth(SvxPaperInfo::GetPaperSize(PAPER_A4).Width()) + , m_nPgLeft(MM_250) + , m_nPgRight(MM_250) + , m_nPgGutter(0) , mnVerticalAdjustment(drawing::TextVerticalAdjust_TOP) , mnBorders(0) , mbHasFootnote(false) @@ -1080,7 +1080,7 @@ void wwSectionManager::CreateSep(const tools::Long nTextPos) // 2. paper size aNewSection.maSep.xaPage = ReadUSprm(pSep, pIds[1], lLetterWidth); - aNewSection.nPgWidth = SvxPaperInfo::GetSloppyPaperDimension(aNewSection.maSep.xaPage); + aNewSection.m_nPgWidth = SvxPaperInfo::GetSloppyPaperDimension(aNewSection.maSep.xaPage); aNewSection.maSep.yaPage = ReadUSprm(pSep, pIds[2], lLetterHeight); @@ -1198,7 +1198,7 @@ void wwSectionManager::CreateSep(const tools::Long nTextPos) aNewSection.maSep.pgbPageDepth = (pgbProp & 0x0018) >> 3; aNewSection.maSep.pgbOffsetFrom = (pgbProp & 0x00E0) >> 5; - aNewSection.mnBorders = ::lcl_ReadBorders(false, aNewSection.brc, nullptr, nullptr, pSep); + aNewSection.mnBorders = ::lcl_ReadBorders(false, aNewSection.m_brc, nullptr, nullptr, pSep); } // check if Line Numbering must be activated or reset