[Libreoffice-commits] core.git: sw/inc sw/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed Aug 12 20:38:22 UTC 2020
sw/inc/numrule.hxx | 8 +++----
sw/inc/tblafmt.hxx | 2 -
sw/inc/unodraw.hxx | 2 -
sw/source/core/bastyp/init.cxx | 2 -
sw/source/core/doc/number.cxx | 34 ++++++++++++++++----------------
sw/source/core/doc/tblafmt.cxx | 39 ++++++++++++++++++-------------------
sw/source/core/unocore/unodraw.cxx | 12 +++++------
7 files changed, 49 insertions(+), 50 deletions(-)
New commits:
commit 29eaf5c012ea52fe148ee7af7a56efeb6e3338a6
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Aug 12 17:43:59 2020 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Aug 12 22:37:42 2020 +0200
sw: prefix members of SwFmDrawPage, SwNumRule, SwTableAutoFormat and ...
... WriterSpecificAutoFormatBlock
See tdf#94879 for motivation.
Change-Id: Ie740f07e1c65a6def6ba673529144d0e111b056e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100610
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index 6152e6bee99f..dba69c701671 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -105,11 +105,11 @@ public:
private:
friend void FinitCore();
- static SwNumFormat* maBaseFormats [ RULE_END ][ MAXLEVEL ];
- static const sal_uInt16 maDefNumIndents[ MAXLEVEL ];
+ static SwNumFormat* saBaseFormats [ RULE_END ][ MAXLEVEL ];
+ static const sal_uInt16 saDefNumIndents[ MAXLEVEL ];
/// default list level properties for position-and-space mode LABEL_ALIGNMENT
- static SwNumFormat* maLabelAlignmentBaseFormats [ RULE_END ][ MAXLEVEL ];
- static sal_uInt16 mnRefCount;
+ static SwNumFormat* saLabelAlignmentBaseFormats [ RULE_END ][ MAXLEVEL ];
+ static sal_uInt16 snRefCount;
std::unique_ptr<SwNumFormat> maFormats[ MAXLEVEL ];
diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index f9073edff8c5..0a6866c3cb2a 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -153,7 +153,7 @@ class SW_DLLPUBLIC SwTableAutoFormat
{
friend class SwDocTest;
friend void FinitCore(); // To destroy default pointer.
- static SwBoxAutoFormat* pDfltBoxAutoFormat;
+ static SwBoxAutoFormat* s_pDefaultBoxAutoFormat;
css::uno::WeakReference<css::uno::XInterface> m_wXObject;
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index 599a3308e252..ecead00bf183 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -43,7 +43,7 @@ class SwXShape;
class SwFmDrawPage final : public SvxFmDrawPage
{
- SdrPageView* pPageView;
+ SdrPageView* m_pPageView;
std::vector<SwXShape*> m_vShapes;
public:
SwFmDrawPage( SdrPage* pPage );
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 79cea41a8cc0..1c5c1da46120 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -681,7 +681,7 @@ void FinitCore()
delete pCaseCollator;
// destroy default TableAutoFormat
- delete SwTableAutoFormat::pDfltBoxAutoFormat;
+ delete SwTableAutoFormat::s_pDefaultBoxAutoFormat;
delete SwSelPaintRects::s_pMapMode;
delete SwFntObj::pPixMap;
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 2dd071433192..43cbad07cb61 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -57,14 +57,14 @@
using namespace ::com::sun::star;
-sal_uInt16 SwNumRule::mnRefCount = 0;
-SwNumFormat* SwNumRule::maBaseFormats[ RULE_END ][ MAXLEVEL ] = {
+sal_uInt16 SwNumRule::snRefCount = 0;
+SwNumFormat* SwNumRule::saBaseFormats[ RULE_END ][ MAXLEVEL ] = {
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr } };
-SwNumFormat* SwNumRule::maLabelAlignmentBaseFormats[ RULE_END ][ MAXLEVEL ] = {
+SwNumFormat* SwNumRule::saLabelAlignmentBaseFormats[ RULE_END ][ MAXLEVEL ] = {
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr } };
-const sal_uInt16 SwNumRule::maDefNumIndents[ MAXLEVEL ] = {
+const sal_uInt16 SwNumRule::saDefNumIndents[ MAXLEVEL ] = {
//inch: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0
1440/4, 1440/2, 1440*3/4, 1440, 1440*5/4, 1440*3/2, 1440*7/4, 1440*2,
1440*9/4, 1440*5/2
@@ -81,8 +81,8 @@ const SwNumFormat& SwNumRule::Get( sal_uInt16 i ) const
return maFormats[ i ]
? *maFormats[ i ]
: ( meDefaultNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION
- ? *maBaseFormats[ meRuleType ][ i ]
- : *maLabelAlignmentBaseFormats[ meRuleType ][ i ] );
+ ? *saBaseFormats[ meRuleType ][ i ]
+ : *saLabelAlignmentBaseFormats[ meRuleType ][ i ] );
}
const SwNumFormat* SwNumRule::GetNumFormat( sal_uInt16 i ) const
@@ -160,13 +160,13 @@ void SwNumRule::SetNumRuleMap(std::unordered_map<OUString, SwNumRule *> *
sal_uInt16 SwNumRule::GetNumIndent( sal_uInt8 nLvl )
{
OSL_ENSURE( MAXLEVEL > nLvl, "NumLevel is out of range" );
- return maDefNumIndents[ nLvl ];
+ return saDefNumIndents[ nLvl ];
}
sal_uInt16 SwNumRule::GetBullIndent( sal_uInt8 nLvl )
{
OSL_ENSURE( MAXLEVEL > nLvl, "NumLevel is out of range" );
- return maDefNumIndents[ nLvl ];
+ return saDefNumIndents[ nLvl ];
}
static void lcl_SetRuleChgd( SwTextNode& rNd, sal_uInt8 nLevel )
@@ -371,7 +371,7 @@ SwNumRule::SwNumRule( const OUString& rNm,
meDefaultNumberFormatPositionAndSpaceMode( eDefaultNumberFormatPositionAndSpaceMode ),
msDefaultListId()
{
- if( !mnRefCount++ ) // for the first time, initialize
+ if( !snRefCount++ ) // for the first time, initialize
{
SwNumFormat* pFormat;
sal_uInt8 n;
@@ -387,7 +387,7 @@ SwNumRule::SwNumRule( const OUString& rNm,
pFormat->SetFirstLineOffset( lNumberFirstLineOffset );
pFormat->SetSuffix( "." );
pFormat->SetBulletChar( numfunc::GetBulletChar(n));
- SwNumRule::maBaseFormats[ NUM_RULE ][ n ] = pFormat;
+ SwNumRule::saBaseFormats[ NUM_RULE ][ n ] = pFormat;
}
// position-and-space mode LABEL_ALIGNMENT
// first line indent of general numbering in inch: -0,25 inch
@@ -410,7 +410,7 @@ SwNumRule::SwNumRule( const OUString& rNm,
pFormat->SetIndentAt( cIndentAt[ n ] );
pFormat->SetSuffix( "." );
pFormat->SetBulletChar( numfunc::GetBulletChar(n));
- SwNumRule::maLabelAlignmentBaseFormats[ NUM_RULE ][ n ] = pFormat;
+ SwNumRule::saLabelAlignmentBaseFormats[ NUM_RULE ][ n ] = pFormat;
}
// outline:
@@ -423,7 +423,7 @@ SwNumRule::SwNumRule( const OUString& rNm,
pFormat->SetStart( 1 );
pFormat->SetCharTextDistance( lOutlineMinTextDistance );
pFormat->SetBulletChar( numfunc::GetBulletChar(n));
- SwNumRule::maBaseFormats[ OUTLINE_RULE ][ n ] = pFormat;
+ SwNumRule::saBaseFormats[ OUTLINE_RULE ][ n ] = pFormat;
}
// position-and-space mode LABEL_ALIGNMENT:
for( n = 0; n < MAXLEVEL; ++n )
@@ -434,7 +434,7 @@ SwNumRule::SwNumRule( const OUString& rNm,
pFormat->SetStart( 1 );
pFormat->SetPositionAndSpaceMode( SvxNumberFormat::LABEL_ALIGNMENT );
pFormat->SetBulletChar( numfunc::GetBulletChar(n));
- SwNumRule::maLabelAlignmentBaseFormats[ OUTLINE_RULE ][ n ] = pFormat;
+ SwNumRule::saLabelAlignmentBaseFormats[ OUTLINE_RULE ][ n ] = pFormat;
}
}
OSL_ENSURE( !msName.isEmpty(), "NumRule without a name!" );
@@ -459,7 +459,7 @@ SwNumRule::SwNumRule( const SwNumRule& rNumRule )
meDefaultNumberFormatPositionAndSpaceMode( rNumRule.meDefaultNumberFormatPositionAndSpaceMode ),
msDefaultListId( rNumRule.msDefaultListId )
{
- ++mnRefCount;
+ ++snRefCount;
for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
if( rNumRule.maFormats[ n ] )
Set( n, *rNumRule.maFormats[ n ] );
@@ -475,10 +475,10 @@ SwNumRule::~SwNumRule()
mpNumRuleMap->erase(GetName());
}
- if( !--mnRefCount ) // the last one closes the door (?)
+ if( !--snRefCount ) // the last one closes the door (?)
{
// Numbering:
- SwNumFormat** ppFormats = &SwNumRule::maBaseFormats[0][0];
+ SwNumFormat** ppFormats = &SwNumRule::saBaseFormats[0][0];
int n;
for( n = 0; n < MAXLEVEL; ++n, ++ppFormats )
@@ -494,7 +494,7 @@ SwNumRule::~SwNumRule()
*ppFormats = nullptr;
}
- ppFormats = &SwNumRule::maLabelAlignmentBaseFormats[0][0];
+ ppFormats = &SwNumRule::saLabelAlignmentBaseFormats[0][0];
for( n = 0; n < MAXLEVEL; ++n, ++ppFormats )
{
delete *ppFormats;
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index ee25a5173150..0600e56070b7 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -95,7 +95,7 @@ const sal_uInt16 AUTOFORMAT_ID = AUTOFORMAT_ID_31005;
const sal_uInt16 AUTOFORMAT_DATA_ID = AUTOFORMAT_DATA_ID_31005;
const sal_uInt16 AUTOFORMAT_FILE_VERSION= SOFFICE_FILEFORMAT_50;
-SwBoxAutoFormat* SwTableAutoFormat::pDfltBoxAutoFormat = nullptr;
+SwBoxAutoFormat* SwTableAutoFormat::s_pDefaultBoxAutoFormat = nullptr;
#define AUTOTABLE_FORMAT_NAME "autotbl.fmt"
@@ -139,21 +139,20 @@ namespace
class WriterSpecificAutoFormatBlock
{
public:
- explicit WriterSpecificAutoFormatBlock(SvStream &rStream) : _rStream(rStream), _whereToWriteEndOfBlock(BeginSwBlock(rStream))
+ explicit WriterSpecificAutoFormatBlock(SvStream& rStream)
+ : mrStream(rStream)
+ , mnWhereToWriteEndOfBlock(BeginSwBlock(rStream))
{
}
- ~WriterSpecificAutoFormatBlock()
- {
- EndSwBlock(_rStream, _whereToWriteEndOfBlock);
- }
+ ~WriterSpecificAutoFormatBlock() { EndSwBlock(mrStream, mnWhereToWriteEndOfBlock); }
private:
WriterSpecificAutoFormatBlock(WriterSpecificAutoFormatBlock const&) = delete;
WriterSpecificAutoFormatBlock& operator=(WriterSpecificAutoFormatBlock const&) = delete;
- SvStream &_rStream;
- sal_uInt64 _whereToWriteEndOfBlock;
+ SvStream& mrStream;
+ sal_uInt64 mnWhereToWriteEndOfBlock;
};
/// Checks whether a writer-specific block exists (i.e. size is not zero)
@@ -464,9 +463,9 @@ const SwBoxAutoFormat& SwTableAutoFormat::GetBoxFormat( sal_uInt8 nPos ) const
else // else return the default
{
// If it doesn't exist yet:
- if( !pDfltBoxAutoFormat )
- pDfltBoxAutoFormat = new SwBoxAutoFormat;
- return *pDfltBoxAutoFormat;
+ if( !s_pDefaultBoxAutoFormat )
+ s_pDefaultBoxAutoFormat = new SwBoxAutoFormat;
+ return *s_pDefaultBoxAutoFormat;
}
}
@@ -478,19 +477,19 @@ SwBoxAutoFormat& SwTableAutoFormat::GetBoxFormat( sal_uInt8 nPos )
if( !*pFormat )
{
// If default doesn't exist yet:
- if( !pDfltBoxAutoFormat )
- pDfltBoxAutoFormat = new SwBoxAutoFormat();
- *pFormat = new SwBoxAutoFormat(*pDfltBoxAutoFormat);
+ if( !s_pDefaultBoxAutoFormat )
+ s_pDefaultBoxAutoFormat = new SwBoxAutoFormat();
+ *pFormat = new SwBoxAutoFormat(*s_pDefaultBoxAutoFormat);
}
return **pFormat;
}
const SwBoxAutoFormat& SwTableAutoFormat::GetDefaultBoxFormat()
{
- if(!pDfltBoxAutoFormat)
- pDfltBoxAutoFormat = new SwBoxAutoFormat();
+ if(!s_pDefaultBoxAutoFormat)
+ s_pDefaultBoxAutoFormat = new SwBoxAutoFormat();
- return *pDfltBoxAutoFormat;
+ return *s_pDefaultBoxAutoFormat;
}
void SwTableAutoFormat::UpdateFromSet( sal_uInt8 nPos,
@@ -839,9 +838,9 @@ bool SwTableAutoFormat::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
if( !pFormat ) // if not set -> write default
{
// If it doesn't exist yet:
- if( !pDfltBoxAutoFormat )
- pDfltBoxAutoFormat = new SwBoxAutoFormat;
- pFormat = pDfltBoxAutoFormat;
+ if( !s_pDefaultBoxAutoFormat )
+ s_pDefaultBoxAutoFormat = new SwBoxAutoFormat;
+ pFormat = s_pDefaultBoxAutoFormat;
}
bRet = pFormat->Save( rStream, fileVersion );
}
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 6a4db7dc8194..6b4f9688ac9b 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -249,7 +249,7 @@ public:
};
SwFmDrawPage::SwFmDrawPage( SdrPage* pPage ) :
- SvxFmDrawPage( pPage ), pPageView(nullptr)
+ SvxFmDrawPage( pPage ), m_pPageView(nullptr)
{
}
@@ -274,16 +274,16 @@ void SwFmDrawPage::PreUnGroup(const uno::Reference< drawing::XShapeGroup >& rSh
SdrPageView* SwFmDrawPage::GetPageView()
{
- if(!pPageView)
- pPageView = mpView->ShowSdrPage( mpPage );
- return pPageView;
+ if(!m_pPageView)
+ m_pPageView = mpView->ShowSdrPage( mpPage );
+ return m_pPageView;
}
void SwFmDrawPage::RemovePageView()
{
- if(pPageView && mpView)
+ if(m_pPageView && mpView)
mpView->HideSdrPage();
- pPageView = nullptr;
+ m_pPageView = nullptr;
}
uno::Reference<drawing::XShape> SwFmDrawPage::GetShape(SdrObject* pObj)
More information about the Libreoffice-commits
mailing list