sw/qa/uibase/wrtsh/wrtsh.cxx | 4 sw/source/filter/ww8/docxattributeoutput.cxx | 16 +- sw/source/filter/ww8/rtfattributeoutput.cxx | 12 +- sw/source/filter/ww8/writerwordglue.cxx | 22 +-- sw/source/filter/ww8/writerwordglue.hxx | 8 - sw/source/filter/ww8/ww8atr.cxx | 12 +- sw/source/filter/ww8/ww8glsy.cxx | 30 ++--- sw/source/filter/ww8/ww8glsy.hxx | 14 +- sw/source/filter/ww8/ww8par.hxx | 14 +- sw/source/filter/ww8/ww8par2.cxx | 2 sw/source/filter/ww8/ww8par3.cxx | 154 +++++++++++++-------------- sw/source/filter/ww8/ww8par6.cxx | 10 - 12 files changed, 149 insertions(+), 149 deletions(-)
New commits: commit 42e88e3b34faf7b5fea116c91aa85a0c4043d359 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Mon May 23 08:32:40 2022 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon May 23 09:15:34 2022 +0200 sw: prefix members of SwWW8Shade, WW8Glossary, WW8ListManager and ... ... sw::util::HdFtDistanceGlue See tdf#94879 for motivation. And add a build-time test to ensure that wrtsh.hxx is self-contained. Change-Id: I493931eeeb8c57264c6f884b48b83881dda6632d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134748 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/sw/qa/uibase/wrtsh/wrtsh.cxx b/sw/qa/uibase/wrtsh/wrtsh.cxx index 3fd708bf2a48..65a41086dce4 100644 --- a/sw/qa/uibase/wrtsh/wrtsh.cxx +++ b/sw/qa/uibase/wrtsh/wrtsh.cxx @@ -7,7 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <swmodeltestbase.hxx> +#include <wrtsh.hxx> #include <optional> @@ -19,10 +19,10 @@ #include <sal/types.h> #include <comphelper/propertyvalue.hxx> +#include <swmodeltestbase.hxx> #include <doc.hxx> #include <docsh.hxx> #include <formatlinebreak.hxx> -#include <wrtsh.hxx> #include <ndtxt.hxx> #include <textcontentcontrol.hxx> #include <fmtanchr.hxx> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 65fc656ee13a..40ad41934480 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -7298,10 +7298,10 @@ void DocxAttributeOutput::SectionPageBorders( const SwFrameFormat* pFormat, cons editeng::WordPageMargins aMargins = m_pageMargins; HdFtDistanceGlue aGlue(pFormat->GetAttrSet()); if (aGlue.HasHeader()) - aMargins.nTop = aGlue.dyaHdrTop; + aMargins.nTop = aGlue.m_DyaHdrTop; // Ditto for bottom margin. if (aGlue.HasFooter()) - aMargins.nBottom = aGlue.dyaHdrBottom; + aMargins.nBottom = aGlue.m_DyaHdrBottom; if (pFormat->GetDoc()->getIDocumentSettingAccess().get(DocumentSettingId::GUTTER_AT_TOP)) { @@ -9416,7 +9416,7 @@ void DocxAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) sal_Int32 nHeader = 0; if ( aDistances.HasHeader() ) - nHeader = sal_Int32( aDistances.dyaHdrTop ); + nHeader = sal_Int32( aDistances.m_DyaHdrTop ); else if (m_rExport.m_pFirstPageFormat) { HdFtDistanceGlue aFirstPageDistances(m_rExport.m_pFirstPageFormat->GetAttrSet()); @@ -9425,16 +9425,16 @@ void DocxAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) // The follow page style has no header, but the first page style has. In Word terms, // this means that the header margin of "the" section is coming from the first page // style. - nHeader = sal_Int32(aFirstPageDistances.dyaHdrTop); + nHeader = sal_Int32(aFirstPageDistances.m_DyaHdrTop); } } // Page top - m_pageMargins.nTop = aDistances.dyaTop; + m_pageMargins.nTop = aDistances.m_DyaTop; sal_Int32 nFooter = 0; if ( aDistances.HasFooter() ) - nFooter = sal_Int32( aDistances.dyaHdrBottom ); + nFooter = sal_Int32( aDistances.m_DyaHdrBottom ); else if (m_rExport.m_pFirstPageFormat) { HdFtDistanceGlue aFirstPageDistances(m_rExport.m_pFirstPageFormat->GetAttrSet()); @@ -9443,12 +9443,12 @@ void DocxAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) // The follow page style has no footer, but the first page style has. In Word terms, // this means that the footer margin of "the" section is coming from the first page // style. - nFooter = sal_Int32(aFirstPageDistances.dyaHdrBottom); + nFooter = sal_Int32(aFirstPageDistances.m_DyaHdrBottom); } } // Page Bottom - m_pageMargins.nBottom = aDistances.dyaBottom; + m_pageMargins.nBottom = aDistances.m_DyaBottom; AddToAttrList( m_pSectionSpacingAttrList, 4, FSNS( XML_w, XML_header ), OString::number( nHeader ).getStr(), diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 645de35025ea..20e8e6fc907c 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3229,26 +3229,26 @@ void RtfAttributeOutput::FormatULSpace(const SvxULSpaceItem& rULSpace) ? *m_rExport.GetFirstPageItemSet() : *m_rExport.GetCurItemSet()); - if (aDistances.dyaTop) + if (aDistances.m_DyaTop) { m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGTSXN); - m_aSectionBreaks.append(static_cast<sal_Int32>(aDistances.dyaTop)); + m_aSectionBreaks.append(static_cast<sal_Int32>(aDistances.m_DyaTop)); } if (aDistances.HasHeader()) { m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_HEADERY); - m_aSectionBreaks.append(static_cast<sal_Int32>(aDistances.dyaHdrTop)); + m_aSectionBreaks.append(static_cast<sal_Int32>(aDistances.m_DyaHdrTop)); } - if (aDistances.dyaBottom) + if (aDistances.m_DyaBottom) { m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGBSXN); - m_aSectionBreaks.append(static_cast<sal_Int32>(aDistances.dyaBottom)); + m_aSectionBreaks.append(static_cast<sal_Int32>(aDistances.m_DyaBottom)); } if (aDistances.HasFooter()) { m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_FOOTERY); - m_aSectionBreaks.append(static_cast<sal_Int32>(aDistances.dyaHdrBottom)); + m_aSectionBreaks.append(static_cast<sal_Int32>(aDistances.m_DyaHdrBottom)); } if (!m_bBufferSectionBreaks) m_rExport.Strm().WriteOString(m_aSectionBreaks.makeStringAndClear()); diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index 3de62b243d08..ec46c3e35742 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -397,25 +397,25 @@ namespace sw { if (const SvxBoxItem *pBox = rPage.GetItem<SvxBoxItem>(RES_BOX)) { - dyaHdrTop = pBox->CalcLineSpace( SvxBoxItemLine::TOP, /*bEvenIfNoLine*/true ); - dyaHdrBottom = pBox->CalcLineSpace( SvxBoxItemLine::BOTTOM, /*bEvenIfNoLine*/true ); + m_DyaHdrTop = pBox->CalcLineSpace( SvxBoxItemLine::TOP, /*bEvenIfNoLine*/true ); + m_DyaHdrBottom = pBox->CalcLineSpace( SvxBoxItemLine::BOTTOM, /*bEvenIfNoLine*/true ); } else { - dyaHdrTop = dyaHdrBottom = 0; + m_DyaHdrTop = m_DyaHdrBottom = 0; } const SvxULSpaceItem &rUL = rPage.Get(RES_UL_SPACE); - dyaHdrTop += rUL.GetUpper(); - dyaHdrBottom += rUL.GetLower(); + m_DyaHdrTop += rUL.GetUpper(); + m_DyaHdrBottom += rUL.GetLower(); - dyaTop = dyaHdrTop; - dyaBottom = dyaHdrBottom; + m_DyaTop = m_DyaHdrTop; + m_DyaBottom = m_DyaHdrBottom; const SwFormatHeader *pHd = rPage.GetItem<SwFormatHeader>(RES_HEADER); if (pHd && pHd->IsActive() && pHd->GetHeaderFormat()) { mbHasHeader = true; - dyaTop = dyaTop + static_cast< sal_uInt16 >( (myImplHelpers::CalcHdDist(*(pHd->GetHeaderFormat()))) ); + m_DyaTop = m_DyaTop + static_cast< sal_uInt16 >( (myImplHelpers::CalcHdDist(*(pHd->GetHeaderFormat()))) ); } else mbHasHeader = false; @@ -424,7 +424,7 @@ namespace sw if (pFt && pFt->IsActive() && pFt->GetFooterFormat()) { mbHasFooter = true; - dyaBottom = dyaBottom + static_cast< sal_uInt16 >( (myImplHelpers::CalcFtDist(*(pFt->GetFooterFormat()))) ); + m_DyaBottom = m_DyaBottom + static_cast< sal_uInt16 >( (myImplHelpers::CalcFtDist(*(pFt->GetFooterFormat()))) ); } else mbHasFooter = false; @@ -437,7 +437,7 @@ namespace sw // both object don't have a header if (HasHeader() == rOther.HasHeader()) { - if (dyaTop != rOther.dyaTop) + if (m_DyaTop != rOther.m_DyaTop) return false; } @@ -445,7 +445,7 @@ namespace sw // both object don't have a footer if (HasFooter() == rOther.HasFooter()) { - if (dyaBottom != rOther.dyaBottom) + if (m_DyaBottom != rOther.m_DyaBottom) return false; } diff --git a/sw/source/filter/ww8/writerwordglue.hxx b/sw/source/filter/ww8/writerwordglue.hxx index 3b532356602a..a6714e97276f 100644 --- a/sw/source/filter/ww8/writerwordglue.hxx +++ b/sw/source/filter/ww8/writerwordglue.hxx @@ -117,10 +117,10 @@ namespace sw bool mbHasHeader; bool mbHasFooter; public: - sal_uInt16 dyaHdrTop; - sal_uInt16 dyaHdrBottom; - sal_uInt16 dyaTop; - sal_uInt16 dyaBottom; + sal_uInt16 m_DyaHdrTop; + sal_uInt16 m_DyaHdrBottom; + sal_uInt16 m_DyaTop; + sal_uInt16 m_DyaBottom; explicit HdFtDistanceGlue(const SfxItemSet &rPage); bool HasHeader() const { return mbHasHeader; } bool HasFooter() const { return mbHasFooter; } diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index c5dd0adb5ccc..b5f354e46d84 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -4213,25 +4213,25 @@ void WW8AttributeOutput::FormatULSpace( const SvxULSpaceItem& rUL ) { //sprmSDyaHdrTop m_rWW8Export.InsUInt16( NS_sprm::SDyaHdrTop::val ); - m_rWW8Export.InsUInt16( aDistances.dyaHdrTop ); + m_rWW8Export.InsUInt16( aDistances.m_DyaHdrTop ); } // sprmSDyaTop m_rWW8Export.InsUInt16( NS_sprm::SDyaTop::val ); - m_rWW8Export.InsUInt16( aDistances.dyaTop ); - m_pageMargins.nTop = aDistances.dyaTop; + m_rWW8Export.InsUInt16( aDistances.m_DyaTop ); + m_pageMargins.nTop = aDistances.m_DyaTop; if ( aDistances.HasFooter() ) { //sprmSDyaHdrBottom m_rWW8Export.InsUInt16( NS_sprm::SDyaHdrBottom::val ); - m_rWW8Export.InsUInt16( aDistances.dyaHdrBottom ); + m_rWW8Export.InsUInt16( aDistances.m_DyaHdrBottom ); } //sprmSDyaBottom m_rWW8Export.InsUInt16( NS_sprm::SDyaBottom::val ); - m_rWW8Export.InsUInt16( aDistances.dyaBottom ); - m_pageMargins.nBottom = aDistances.dyaBottom; + m_rWW8Export.InsUInt16( aDistances.m_DyaBottom ); + m_pageMargins.nBottom = aDistances.m_DyaBottom; } else { diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index 4384a4e69bdc..009ca4a79bdb 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -35,23 +35,23 @@ #include "ww8par.hxx" WW8Glossary::WW8Glossary(tools::SvRef<SotStorageStream> &refStrm, sal_uInt8 nVersion, SotStorage *pStg) - : rStrm(refStrm) - , xStg(pStg) - , nStrings(0) + : m_rStrm(refStrm) + , m_xStg(pStg) + , m_nStrings(0) { refStrm->SetEndian(SvStreamEndian::LITTLE); WW8Fib aWwFib(*refStrm, nVersion); if (aWwFib.m_nFibBack >= 0x6A) //Word97 { - xTableStream = pStg->OpenSotStream( + m_xTableStream = pStg->OpenSotStream( aWwFib.m_fWhichTableStm ? OUString(SL::a1Table) : OUString(SL::a0Table), StreamMode::STD_READ); - if (xTableStream.is() && ERRCODE_NONE == xTableStream->GetError()) + if (m_xTableStream.is() && ERRCODE_NONE == m_xTableStream->GetError()) { - xTableStream->SetEndian(SvStreamEndian::LITTLE); - xGlossary = std::make_shared<WW8GlossaryFib>(*refStrm, nVersion, aWwFib); + m_xTableStream->SetEndian(SvStreamEndian::LITTLE); + m_xGlossary = std::make_shared<WW8GlossaryFib>(*refStrm, nVersion, aWwFib); } } } @@ -191,22 +191,22 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, bool WW8Glossary::Load( SwTextBlocks &rBlocks, bool bSaveRelFile ) { bool bRet=false; - if (xGlossary && xGlossary->IsGlossaryFib() && rBlocks.StartPutMuchBlockEntries()) + if (m_xGlossary && m_xGlossary->IsGlossaryFib() && rBlocks.StartPutMuchBlockEntries()) { //read the names of the autotext entries std::vector<OUString> aStrings; std::vector<ww::bytes> aData; rtl_TextEncoding eStructCharSet = - WW8Fib::GetFIBCharset(xGlossary->m_chseTables, xGlossary->m_lid); + WW8Fib::GetFIBCharset(m_xGlossary->m_chseTables, m_xGlossary->m_lid); - WW8ReadSTTBF(true, *xTableStream, xGlossary->m_fcSttbfglsy, - xGlossary->m_lcbSttbfglsy, 0, eStructCharSet, aStrings, &aData ); + WW8ReadSTTBF(true, *m_xTableStream, m_xGlossary->m_fcSttbfglsy, + m_xGlossary->m_lcbSttbfglsy, 0, eStructCharSet, aStrings, &aData ); - rStrm->Seek(0); + m_rStrm->Seek(0); - nStrings = static_cast< sal_uInt16 >(aStrings.size()); - if ( 0 != nStrings ) + m_nStrings = static_cast< sal_uInt16 >(aStrings.size()); + if ( 0 != m_nStrings ) { SfxObjectShellLock xDocSh(new SwDocShell(SfxObjectCreateMode::INTERNAL)); if (xDocSh->DoInitNew()) @@ -224,7 +224,7 @@ bool WW8Glossary::Load( SwTextBlocks &rBlocks, bool bSaveRelFile ) aPamo.GetPoint()->nContent.Assign(aIdx.GetNode().GetContentNode(), 0); std::unique_ptr<SwWW8ImplReader> xRdr(new SwWW8ImplReader( - xGlossary->m_nVersion, xStg.get(), rStrm.get(), *pD, rBlocks.GetBaseURL(), + m_xGlossary->m_nVersion, m_xStg.get(), m_rStrm.get(), *pD, rBlocks.GetBaseURL(), true, false, *aPamo.GetPoint())); xRdr->LoadDoc(this); bRet = MakeEntries(pD, rBlocks, bSaveRelFile, aStrings, aData); diff --git a/sw/source/filter/ww8/ww8glsy.hxx b/sw/source/filter/ww8/ww8glsy.hxx index fd847de71269..bff76efedecd 100644 --- a/sw/source/filter/ww8/ww8glsy.hxx +++ b/sw/source/filter/ww8/ww8glsy.hxx @@ -64,19 +64,19 @@ public: bool Load( SwTextBlocks &rBlocks, bool bSaveRelFile ); std::shared_ptr<WW8GlossaryFib>& GetFib() { - return xGlossary; + return m_xGlossary; } sal_uInt16 GetNoStrings() const { - return nStrings; + return m_nStrings; } private: - std::shared_ptr<WW8GlossaryFib> xGlossary; - tools::SvRef<SotStorageStream> xTableStream; - tools::SvRef<SotStorageStream> &rStrm; - tools::SvRef<SotStorage> xStg; - sal_uInt16 nStrings; + std::shared_ptr<WW8GlossaryFib> m_xGlossary; + tools::SvRef<SotStorageStream> m_xTableStream; + tools::SvRef<SotStorageStream> &m_rStrm; + tools::SvRef<SotStorage> m_xStg; + sal_uInt16 m_nStrings; static bool MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, bool bSaveRelFile, const std::vector<OUString>& rStrings, diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index e59768e2788b..fc1b70d17eee 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -166,13 +166,13 @@ public: private: wwSprmParser maSprmParser; - SwWW8ImplReader& rReader; - SwDoc& rDoc; - const WW8Fib& rFib; - SvStream& rSt; + SwWW8ImplReader& m_rReader; + SwDoc& m_rDoc; + const WW8Fib& m_rFib; + SvStream& m_rSt; std::vector<std::unique_ptr<WW8LSTInfo>> maLSTInfos; std::vector<std::unique_ptr<WW8LFOInfo>> m_LFOInfos;// D. from PLF LFO, sorted exactly like in the WW8 Stream - sal_uInt16 nUniqueList; // current number for creating unique list names + sal_uInt16 m_nUniqueList; // current number for creating unique list names SprmResult GrpprlHasSprm(sal_uInt16 nId, sal_uInt8& rSprms, sal_uInt8 nLen); WW8LSTInfo* GetLSTByListId( sal_uInt32 nIdLst ) const; //the rParaSprms returns back the original word paragraph indent @@ -193,7 +193,7 @@ private: WW8ListManager(const WW8ListManager&) = delete; WW8ListManager& operator=(const WW8ListManager&) = delete; - sal_uInt16 nLastLFOPosition; + sal_uInt16 m_nLastLFOPosition; }; struct WW8FlyPara @@ -620,7 +620,7 @@ enum class eF_ResT { OK, TEXT, TAGIGN, READ_FSPA }; class SwWW8Shade { public: - Color aColor; + Color m_aColor; SwWW8Shade(bool bVer67, const WW8_SHD& rSHD); SwWW8Shade(Color nFore, Color nBack, sal_uInt16 nIndex) { diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 60021665ad42..5c7f3e2bc7c7 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -3103,7 +3103,7 @@ void WW8TabDesc::SetTabShades( SwTableBox* pBox, short nWwIdx ) return; SwWW8Shade aSh( m_pIo->m_bVer67, rSHD ); - pBox->GetFrameFormat()->SetFormatAttr(SvxBrushItem(aSh.aColor, RES_BACKGROUND)); + pBox->GetFrameFormat()->SetFormatAttr(SvxBrushItem(aSh.m_aColor, RES_BACKGROUND)); } } diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index f512d99fecd3..ee821eb75d11 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -684,10 +684,10 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet // 1. read LVLF - rSt.ReadInt32( aLVL.nStartAt ); - rSt.ReadUChar( aLVL.nNFC ); - rSt.ReadUChar( aBits1 ); - if( ERRCODE_NONE != rSt.GetError() ) return false; + m_rSt.ReadInt32( aLVL.nStartAt ); + m_rSt.ReadUChar( aLVL.nNFC ); + m_rSt.ReadUChar( aBits1 ); + if( ERRCODE_NONE != m_rSt.GetError() ) return false; aLVL.nAlign = (aBits1 & 0x03); if( aBits1 & 0x10 ) aLVL.bV6Prev = true; if( aBits1 & 0x20 ) aLVL.bV6PrSp = true; @@ -695,8 +695,8 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet bool bLVLOkB = true; for(sal_uInt8 nLevelB = 0; nLevelB < nMaxLevel; ++nLevelB) { - rSt.ReadUChar( aLVL.aOfsNumsXCH[ nLevelB ] ); - if( ERRCODE_NONE != rSt.GetError() ) + m_rSt.ReadUChar( aLVL.aOfsNumsXCH[ nLevelB ] ); + if( ERRCODE_NONE != m_rSt.GetError() ) { bLVLOkB = false; break; @@ -707,13 +707,13 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet return false; sal_uInt8 ixchFollow(0); - rSt.ReadUChar( ixchFollow ); - rSt.ReadInt32( aLVL.nV6DxaSpace ); - rSt.ReadInt32( aLVL.nV6Indent ); - rSt.ReadUChar( aLVL.nLenGrpprlChpx ); - rSt.ReadUChar( aLVL.nLenGrpprlPapx ); - rSt.SeekRel( 2 ); - if( ERRCODE_NONE != rSt.GetError()) return false; + m_rSt.ReadUChar( ixchFollow ); + m_rSt.ReadInt32( aLVL.nV6DxaSpace ); + m_rSt.ReadInt32( aLVL.nV6Indent ); + m_rSt.ReadUChar( aLVL.nLenGrpprlChpx ); + m_rSt.ReadUChar( aLVL.nLenGrpprlPapx ); + m_rSt.SeekRel( 2 ); + if( ERRCODE_NONE != m_rSt.GetError()) return false; // 2. read PAPx if needed and search for indent values @@ -721,7 +721,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet if( aLVL.nLenGrpprlPapx ) { sal_uInt8 aGrpprlPapx[ 255 ]; - if (aLVL.nLenGrpprlPapx != rSt.ReadBytes(&aGrpprlPapx, aLVL.nLenGrpprlPapx)) + if (aLVL.nLenGrpprlPapx != m_rSt.ReadBytes(&aGrpprlPapx, aLVL.nLenGrpprlPapx)) return false; // "sprmPDxaLeft" pap.dxaLeft;dxa;word; SprmResult aSprm = GrpprlHasSprm(0x840F,aGrpprlPapx[0],aLVL.nLenGrpprlPapx); @@ -822,7 +822,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet if( aLVL.nLenGrpprlChpx ) { sal_uInt8 aGrpprlChpx[ 255 ] = {}; - if (aLVL.nLenGrpprlChpx != rSt.ReadBytes(&aGrpprlChpx, aLVL.nLenGrpprlChpx)) + if (aLVL.nLenGrpprlChpx != m_rSt.ReadBytes(&aGrpprlChpx, aLVL.nLenGrpprlChpx)) return false; //For i120928,parse the graphic info of bullets @@ -838,42 +838,42 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet } // create new Itemset for character attributes - rpItemSet.reset(new SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>( rDoc.GetAttrPool() )); + rpItemSet.reset(new SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>( m_rDoc.GetAttrPool() )); // Set Reader-ItemSet-Pointer to the newly created set - rReader.SetCurrentItemSet(std::move(rpItemSet)); + m_rReader.SetCurrentItemSet(std::move(rpItemSet)); // Set Reader-Style to Style of this Level - sal_uInt16 nOldColl = rReader.GetCurrentColl(); + sal_uInt16 nOldColl = m_rReader.GetCurrentColl(); sal_uInt16 nNewColl = nLevelStyle; if (ww::stiNil == nNewColl) nNewColl = 0; - rReader.SetNCurrentColl( nNewColl ); + m_rReader.SetNCurrentColl( nNewColl ); // The Read_xy() methods in WW8PAR6.cxx are calling their respective // NewAttr() or GetFormatAttr() which can determine, by using the assigned // Reader-ItemSet-Pointer, whether this specific ItemSet is relevant // and not a Stack or Style! - sal_uInt16 nOldFlags1 = rReader.GetToggleAttrFlags(); - sal_uInt16 nOldFlags2 = rReader.GetToggleBiDiAttrFlags(); + sal_uInt16 nOldFlags1 = m_rReader.GetToggleAttrFlags(); + sal_uInt16 nOldFlags2 = m_rReader.GetToggleBiDiAttrFlags(); WW8SprmIter aSprmIter(&aGrpprlChpx[0], aLVL.nLenGrpprlChpx, maSprmParser); while (const sal_uInt8* pSprm = aSprmIter.GetSprms()) { - rReader.ImportSprm(pSprm, aSprmIter.GetRemLen(), aSprmIter.GetCurrentId()); + m_rReader.ImportSprm(pSprm, aSprmIter.GetRemLen(), aSprmIter.GetCurrentId()); aSprmIter.advance(); } // Reset Reader-ItemSet-Pointer and Reader-Style - rpItemSet = rReader.SetCurrentItemSet(nullptr); - rReader.SetNCurrentColl( nOldColl ); - rReader.SetToggleAttrFlags(nOldFlags1); - rReader.SetToggleBiDiAttrFlags(nOldFlags2); + rpItemSet = m_rReader.SetCurrentItemSet(nullptr); + m_rReader.SetNCurrentColl( nOldColl ); + m_rReader.SetToggleAttrFlags(nOldFlags1); + m_rReader.SetToggleBiDiAttrFlags(nOldFlags2); } // 4. Read numbering String. Results in prefix and postfix - OUString sNumString(sanitizeString(read_uInt16_PascalString(rSt))); + OUString sNumString(sanitizeString(read_uInt16_PascalString(m_rSt))); // 5. convert read values into Writer syntax @@ -1077,7 +1077,7 @@ void WW8ListManager::AdjustLVL( sal_uInt8 nLevel, SwNumRule& rNumRule, + "z" + OUString::number( nLevel ) ); // remove const by casting - pFormat = rDoc.MakeCharFormat(aName, rDoc.GetDfltCharFormat()); + pFormat = m_rDoc.MakeCharFormat(aName, m_rDoc.GetDfltCharFormat()); bNewCharFormatCreated = true; // Set Attributes pFormat->SetFormatAttr( *pThisLevelItemSet ); @@ -1126,12 +1126,12 @@ void WW8ListManager::AdjustLVL( sal_uInt8 nLevel, SwNumRule& rNumRule, SwNumRule* WW8ListManager::CreateNextRule(bool bSimple) { // Used to build the Style Name - const OUString sPrefix("WW8Num" + OUString::number(nUniqueList++)); + const OUString sPrefix("WW8Num" + OUString::number(m_nUniqueList++)); // #i86652# sal_uInt16 nRul = - rDoc.MakeNumRule( rDoc.GetUniqueNumRuleName(&sPrefix), nullptr, false, + m_rDoc.MakeNumRule( m_rDoc.GetUniqueNumRuleName(&sPrefix), nullptr, false, SvxNumberFormat::LABEL_ALIGNMENT ); - SwNumRule* pMyNumRule = rDoc.GetNumRuleTable()[nRul]; + SwNumRule* pMyNumRule = m_rDoc.GetNumRuleTable()[nRul]; pMyNumRule->SetAutoRule(false); pMyNumRule->SetContinusNum(bSimple); return pMyNumRule; @@ -1148,35 +1148,35 @@ SwNumRule* WW8ListManager::GetNumRule(size_t i) // public methods WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_) - : maSprmParser(rReader_.GetFib()), rReader(rReader_) - , rDoc(rReader.GetDoc()) - , rFib(rReader.GetFib()), rSt(rSt_) - , nUniqueList(1) - , nLastLFOPosition(USHRT_MAX) + : maSprmParser(rReader_.GetFib()), m_rReader(rReader_) + , m_rDoc(m_rReader.GetDoc()) + , m_rFib(m_rReader.GetFib()), m_rSt(rSt_) + , m_nUniqueList(1) + , m_nLastLFOPosition(USHRT_MAX) { // LST and LFO only since WW8 - if( ( 8 > rFib.m_nVersion ) - || ( rFib.m_fcPlcfLst == rFib.m_fcPlfLfo ) - || ( rFib.m_lcbPlcfLst < 2 ) - || ( rFib.m_lcbPlfLfo < 2) ) return; // no public lists + if( ( 8 > m_rFib.m_nVersion ) + || ( m_rFib.m_fcPlcfLst == m_rFib.m_fcPlfLfo ) + || ( m_rFib.m_lcbPlcfLst < 2 ) + || ( m_rFib.m_lcbPlfLfo < 2) ) return; // no public lists // create Arrays bool bLVLOk = true; - sal_uInt64 nOriginalPos = rSt.Tell(); + sal_uInt64 nOriginalPos = m_rSt.Tell(); // 1. read PLCF LST and create list templates in Writer - bool bOk = checkSeek(rSt, rFib.m_fcPlcfLst); + bool bOk = checkSeek(m_rSt, m_rFib.m_fcPlcfLst); if (!bOk) return; - sal_uInt32 nRemainingPlcfLst = rFib.m_lcbPlcfLst; + sal_uInt32 nRemainingPlcfLst = m_rFib.m_lcbPlcfLst; sal_uInt16 nListCount(0); - rSt.ReadUInt16( nListCount ); + m_rSt.ReadUInt16( nListCount ); nRemainingPlcfLst -= 2; bOk = nListCount > 0; @@ -1185,7 +1185,7 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_) // 1.1 read all LST const size_t nMinRecordSize = 10 + 2*nMaxLevel; - const size_t nMaxRecords = rSt.remainingSize() / nMinRecordSize; + const size_t nMaxRecords = m_rSt.remainingSize() / nMinRecordSize; if (nListCount > nMaxRecords) { SAL_WARN("sw.ww8", "Parsing error: " << nMaxRecords << @@ -1201,15 +1201,15 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_) // 1.1.1 read Data - rSt.ReadUInt32( aLST.nIdLst ); - rSt.ReadUInt32( aLST.nTplC ); + m_rSt.ReadUInt32( aLST.nIdLst ); + m_rSt.ReadUInt32( aLST.nTplC ); for (sal_uInt16 & nLevel : aLST.aIdSty) - rSt.ReadUInt16( nLevel ); + m_rSt.ReadUInt16( nLevel ); sal_uInt8 aBits1(0); - rSt.ReadUChar( aBits1 ); + m_rSt.ReadUChar( aBits1 ); - rSt.SeekRel( 1 ); + m_rSt.SeekRel( 1 ); if( aBits1 & 0x01 ) aLST.bSimpleList = true; @@ -1284,13 +1284,13 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_) // 2. read and save PLF LFO - bOk = checkSeek(rSt, rFib.m_fcPlfLfo); + bOk = checkSeek(m_rSt, m_rFib.m_fcPlfLfo); if (!bOk) return; sal_Int32 nLfoCount(0); - rSt.ReadInt32( nLfoCount ); + m_rSt.ReadInt32( nLfoCount ); bOk = nLfoCount > 0; if (!bOk) @@ -1304,14 +1304,14 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_) WW8LFO aLFO = {}; - rSt.ReadUInt32( aLFO.nIdLst ); - rSt.SeekRel( 8 ); - rSt.ReadUChar( aLFO.nLfoLvl ); - if (!rSt.good()) + m_rSt.ReadUInt32( aLFO.nIdLst ); + m_rSt.SeekRel( 8 ); + m_rSt.ReadUChar( aLFO.nLfoLvl ); + if (!m_rSt.good()) break; - rSt.SeekRel( 3 ); + m_rSt.SeekRel( 3 ); // as many Overrides as there are - if ((nMaxLevel < aLFO.nLfoLvl) || rSt.GetError()) + if ((nMaxLevel < aLFO.nLfoLvl) || m_rSt.GetError()) break; // get the Parent NumRule of the current List @@ -1368,18 +1368,18 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_) // (it contained the parent NumRule up to this point) // check if a Style is referencing this LFO - if( USHRT_MAX > rReader.StyleUsingLFO( nLfo ) ) + if( USHRT_MAX > m_rReader.StyleUsingLFO( nLfo ) ) { - sal_uInt16 nRul = rDoc.MakeNumRule( - rDoc.GetUniqueNumRuleName( &sPrefix ), pParentNumRule); - rLFOInfo.pNumRule = rDoc.GetNumRuleTable()[ nRul ]; + sal_uInt16 nRul = m_rDoc.MakeNumRule( + m_rDoc.GetUniqueNumRuleName( &sPrefix ), pParentNumRule); + rLFOInfo.pNumRule = m_rDoc.GetNumRuleTable()[ nRul ]; rLFOInfo.pNumRule->SetAutoRule(false); } else { - sal_uInt16 nRul = rDoc.MakeNumRule( - rDoc.GetUniqueNumRuleName(), pParentNumRule); - rLFOInfo.pNumRule = rDoc.GetNumRuleTable()[ nRul ]; + sal_uInt16 nRul = m_rDoc.MakeNumRule( + m_rDoc.GetUniqueNumRuleName(), pParentNumRule); + rLFOInfo.pNumRule = m_rDoc.GetNumRuleTable()[ nRul ]; rLFOInfo.pNumRule->SetAutoRule(true); // = default } @@ -1395,14 +1395,14 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_) //4 byte header, there might be more than one if //that header was 0xFFFFFFFF, e.g. #114412# ? sal_uInt32 nTest; - rSt.ReadUInt32( nTest ); + m_rSt.ReadUInt32( nTest ); do { nTest = 0; - rSt.ReadUInt32( nTest ); + m_rSt.ReadUInt32( nTest ); } while (nTest == 0xFFFFFFFF); - rSt.SeekRel(-4); + m_rSt.SeekRel(-4); for (sal_uInt8 nLevel = 0; nLevel < rLFOInfo.nLfoLvl; ++nLevel) { @@ -1411,11 +1411,11 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_) // 2.2.2.1 read LFOLVL - rSt.ReadInt32( aLFOLVL.nStartAt ); + m_rSt.ReadInt32( aLFOLVL.nStartAt ); sal_uInt8 aBits1(0); - rSt.ReadUChar( aBits1 ); - rSt.SeekRel( 3 ); - if (rSt.GetError()) + m_rSt.ReadUChar( aBits1 ); + m_rSt.SeekRel( 3 ); + if (m_rSt.GetError()) break; // Note: MS writes the Override-Level-Number into 4 bit. @@ -1477,7 +1477,7 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_) } } // and we're done! - rSt.Seek( nOriginalPos ); + m_rSt.Seek( nOriginalPos ); } void WW8ListManager::ImplDestroy() @@ -1491,7 +1491,7 @@ void WW8ListManager::ImplDestroy() if (rpInfo->pNumRule && !rpInfo->bUsedInDoc && rpInfo->pNumRule->IsAutoRule()) { - rDoc.DelNumRule(rpInfo->pNumRule->GetName()); + m_rDoc.DelNumRule(rpInfo->pNumRule->GetName()); } rpInfo.reset(); } @@ -1502,7 +1502,7 @@ void WW8ListManager::ImplDestroy() && !(*aIter)->bUsedInDoc && (*aIter)->pNumRule->IsAutoRule()) { - rDoc.DelNumRule( (*aIter)->pNumRule->GetName() ); + m_rDoc.DelNumRule( (*aIter)->pNumRule->GetName() ); } } } @@ -1559,14 +1559,14 @@ SwNumRule* WW8ListManager::GetNumRuleForActivation(sal_uInt16 nLFOPosition, // #i100132# - a number format does not have to exist on given list level SwNumFormat aFormat(rLFOInfo.pNumRule->Get(nLevel)); - if (rReader.IsRightToLeft() && nLastLFOPosition != nLFOPosition) { + if (m_rReader.IsRightToLeft() && m_nLastLFOPosition != nLFOPosition) { if ( aFormat.GetNumAdjust() == SvxAdjust::Right) aFormat.SetNumAdjust(SvxAdjust::Left); else if ( aFormat.GetNumAdjust() == SvxAdjust::Left) aFormat.SetNumAdjust(SvxAdjust::Right); rLFOInfo.pNumRule->Set(nLevel, aFormat); } - nLastLFOPosition = nLFOPosition; + m_nLastLFOPosition = nLFOPosition; /* #i1869# If this list has had its bits set in word 2000 to pretend that it is a diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 4795205762fa..306d8907cf38 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -4125,7 +4125,7 @@ void SwWW8ImplReader::Read_CharShadow( sal_uInt16, const sal_uInt8* pData, shor aSHD.SetWWValue( *reinterpret_cast<SVBT16 const *>(pData) ); SwWW8Shade aSh( m_bVer67, aSHD ); - NewAttr( SvxBrushItem( aSh.aColor, RES_CHRATR_BACKGROUND )); + NewAttr( SvxBrushItem( aSh.m_aColor, RES_CHRATR_BACKGROUND )); // Add a marker to the grabbag indicating that character background was imported from MSO shading SfxGrabBagItem aGrabBag = *static_cast<const SfxGrabBagItem*>(GetFormatAttr(RES_CHRATR_GRABBAG)); @@ -4958,7 +4958,7 @@ void SwWW8Shade::SetShade(Color nFore, Color nBack, sal_uInt16 nIndex) switch (nWW8BrushStyle) { case 0: // Null-Brush - aColor = nBack; + m_aColor = nBack; break; default: { @@ -4972,7 +4972,7 @@ void SwWW8Shade::SetShade(Color nFore, Color nBack, sal_uInt16 nIndex) nGreen += aBackColor.GetGreen()* (1000 - nWW8BrushStyle); nBlue += aBackColor.GetBlue() * (1000 - nWW8BrushStyle); - aColor = Color( nRed/1000, nGreen/1000, nBlue/1000 ); + m_aColor = Color( nRed/1000, nGreen/1000, nBlue/1000 ); } break; } @@ -4996,7 +4996,7 @@ void SwWW8ImplReader::Read_Shade( sal_uInt16, const sal_uInt8* pData, short nLen SwWW8Shade aSh( m_bVer67, aSHD ); NewAttr( XFillStyleItem(drawing::FillStyle_SOLID) ); - NewAttr( XFillColorItem(OUString(), aSh.aColor) ); + NewAttr( XFillColorItem(OUString(), aSh.m_aColor) ); } } @@ -5039,7 +5039,7 @@ Color SwWW8ImplReader::ExtractColour(const sal_uInt8* &rpData, bool bVer67) OSL_ENSURE(nBack == COL_AUTO || !nBack.IsTransparent(), "ww8: don't know what to do with such a transparent bg colour, report"); SwWW8Shade aShade(nFore, nBack, nIndex); - return aShade.aColor; + return aShade.m_aColor; } void SwWW8ImplReader::Read_TextVerticalAdjustment( sal_uInt16, const sal_uInt8* pData, short nLen )