Kaydet (Commit) a87145d3 authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: prefix members of SwSmartTagMgr, SwFormatPageDesc and SwTabCols

Change-Id: I0bb794f500793f6d248186b683e0adb88b3e5a33
Reviewed-on: https://gerrit.libreoffice.org/65922Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
üst da2d11d2
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
class SwSmartTagMgr : public SmartTagMgr class SwSmartTagMgr : public SmartTagMgr
{ {
private: private:
static SwSmartTagMgr* mpTheSwSmartTagMgr; static SwSmartTagMgr* spTheSwSmartTagMgr;
SwSmartTagMgr( const OUString& rModuleName ); SwSmartTagMgr( const OUString& rModuleName );
virtual ~SwSmartTagMgr() override; virtual ~SwSmartTagMgr() override;
......
...@@ -34,8 +34,8 @@ class IntlWrapper; ...@@ -34,8 +34,8 @@ class IntlWrapper;
class SW_DLLPUBLIC SwFormatPageDesc : public SfxPoolItem, public SwClient class SW_DLLPUBLIC SwFormatPageDesc : public SfxPoolItem, public SwClient
{ {
::boost::optional<sal_uInt16> oNumOffset; ///< Offset page number. ::boost::optional<sal_uInt16> m_oNumOffset; ///< Offset page number.
SwModify* pDefinedIn; /**< Points to the object in which the SwModify* m_pDefinedIn; /**< Points to the object in which the
attribute was set (ContentNode/Format). */ attribute was set (ContentNode/Format). */
protected: protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) override; virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) override;
...@@ -62,12 +62,12 @@ public: ...@@ -62,12 +62,12 @@ public:
SwPageDesc *GetPageDesc() { return static_cast<SwPageDesc*>(GetRegisteredIn()); } SwPageDesc *GetPageDesc() { return static_cast<SwPageDesc*>(GetRegisteredIn()); }
const SwPageDesc *GetPageDesc() const { return static_cast<const SwPageDesc*>(GetRegisteredIn()); } const SwPageDesc *GetPageDesc() const { return static_cast<const SwPageDesc*>(GetRegisteredIn()); }
const ::boost::optional<sal_uInt16>& GetNumOffset() const { return oNumOffset; } const ::boost::optional<sal_uInt16>& GetNumOffset() const { return m_oNumOffset; }
void SetNumOffset( const ::boost::optional<sal_uInt16>& oNum ) { oNumOffset = oNum; } void SetNumOffset( const ::boost::optional<sal_uInt16>& oNum ) { m_oNumOffset = oNum; }
/// Query / set where attribute is anchored. /// Query / set where attribute is anchored.
const SwModify* GetDefinedIn() const { return pDefinedIn; } const SwModify* GetDefinedIn() const { return m_pDefinedIn; }
void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = const_cast<SwModify*>(pNew); } void ChgDefinedIn( const SwModify* pNew ) { m_pDefinedIn = const_cast<SwModify*>(pNew); }
void RegisterToPageDesc( SwPageDesc& ); void RegisterToPageDesc( SwPageDesc& );
bool KnowsPageDesc() const; bool KnowsPageDesc() const;
void dumpAsXml(struct _xmlTextWriter* pWriter) const override; void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
......
...@@ -39,52 +39,52 @@ typedef std::vector< SwTabColsEntry > SwTabColsEntries; ...@@ -39,52 +39,52 @@ typedef std::vector< SwTabColsEntry > SwTabColsEntries;
class SW_DLLPUBLIC SwTabCols class SW_DLLPUBLIC SwTabCols
{ {
long nLeftMin, // Leftmost border (reference point) for long m_nLeftMin, // Leftmost border (reference point) for
// document coordinates. // document coordinates.
// All other values are relative to this point! // All other values are relative to this point!
nLeft, // Left border of table. m_nLeft, // Left border of table.
nRight, // Right border of table. m_nRight, // Right border of table.
nRightMax; // Maximum right border of table. m_nRightMax; // Maximum right border of table.
bool bLastRowAllowedToChange; // If the last row of the table frame bool m_bLastRowAllowedToChange; // If the last row of the table frame
// is split across pages, it may not // is split across pages, it may not
// change its size. // change its size.
SwTabColsEntries aData; SwTabColsEntries m_aData;
//For the CopyCTor. //For the CopyCTor.
const SwTabColsEntries& GetData() const { return aData; } const SwTabColsEntries& GetData() const { return m_aData; }
public: public:
SwTabCols( sal_uInt16 nSize = 0 ); SwTabCols( sal_uInt16 nSize = 0 );
SwTabCols( const SwTabCols& ); SwTabCols( const SwTabCols& );
SwTabCols &operator=( const SwTabCols& ); SwTabCols &operator=( const SwTabCols& );
long& operator[]( size_t nPos ) { return aData[nPos].nPos; } long& operator[]( size_t nPos ) { return m_aData[nPos].nPos; }
long operator[]( size_t nPos ) const { return aData[nPos].nPos; } long operator[]( size_t nPos ) const { return m_aData[nPos].nPos; }
size_t Count() const { return aData.size(); } size_t Count() const { return m_aData.size(); }
bool IsHidden( size_t nPos ) const { return aData[nPos].bHidden; } bool IsHidden( size_t nPos ) const { return m_aData[nPos].bHidden; }
void SetHidden( size_t nPos, bool bValue ) { aData[nPos].bHidden = bValue; } void SetHidden( size_t nPos, bool bValue ) { m_aData[nPos].bHidden = bValue; }
void Insert( long nValue, bool bValue, size_t nPos ); void Insert( long nValue, bool bValue, size_t nPos );
void Insert( long nValue, long nMin, long nMax, bool bValue, size_t nPos ); void Insert( long nValue, long nMin, long nMax, bool bValue, size_t nPos );
void Remove( size_t nPos, size_t nCount = 1 ); void Remove( size_t nPos, size_t nCount = 1 );
const SwTabColsEntry& GetEntry( size_t nPos ) const { return aData[nPos]; } const SwTabColsEntry& GetEntry( size_t nPos ) const { return m_aData[nPos]; }
SwTabColsEntry& GetEntry( size_t nPos ) { return aData[nPos]; } SwTabColsEntry& GetEntry( size_t nPos ) { return m_aData[nPos]; }
long GetLeftMin() const { return nLeftMin; } long GetLeftMin() const { return m_nLeftMin; }
long GetLeft() const { return nLeft; } long GetLeft() const { return m_nLeft; }
long GetRight() const { return nRight; } long GetRight() const { return m_nRight; }
long GetRightMax()const { return nRightMax;} long GetRightMax()const { return m_nRightMax;}
void SetLeftMin ( long nNew ) { nLeftMin = nNew; } void SetLeftMin ( long nNew ) { m_nLeftMin = nNew; }
void SetLeft ( long nNew ) { nLeft = nNew; } void SetLeft ( long nNew ) { m_nLeft = nNew; }
void SetRight ( long nNew ) { nRight = nNew; } void SetRight ( long nNew ) { m_nRight = nNew; }
void SetRightMax( long nNew ) { nRightMax = nNew;} void SetRightMax( long nNew ) { m_nRightMax = nNew;}
bool IsLastRowAllowedToChange() const { return bLastRowAllowedToChange; } bool IsLastRowAllowedToChange() const { return m_bLastRowAllowedToChange; }
void SetLastRowAllowedToChange( bool bNew ) { bLastRowAllowedToChange = bNew; } void SetLastRowAllowedToChange( bool bNew ) { m_bLastRowAllowedToChange = bNew; }
}; };
class SwTable; class SwTable;
......
...@@ -26,16 +26,16 @@ ...@@ -26,16 +26,16 @@
using namespace com::sun::star; using namespace com::sun::star;
using namespace com::sun::star::uno; using namespace com::sun::star::uno;
SwSmartTagMgr* SwSmartTagMgr::mpTheSwSmartTagMgr = nullptr; SwSmartTagMgr* SwSmartTagMgr::spTheSwSmartTagMgr = nullptr;
SwSmartTagMgr& SwSmartTagMgr::Get() SwSmartTagMgr& SwSmartTagMgr::Get()
{ {
if ( !mpTheSwSmartTagMgr ) if ( !spTheSwSmartTagMgr )
{ {
mpTheSwSmartTagMgr = new SwSmartTagMgr( SwDocShell::Factory().GetModuleName() ); spTheSwSmartTagMgr = new SwSmartTagMgr( SwDocShell::Factory().GetModuleName() );
mpTheSwSmartTagMgr->Init("Writer"); spTheSwSmartTagMgr->Init("Writer");
} }
return *mpTheSwSmartTagMgr; return *spTheSwSmartTagMgr;
} }
SwSmartTagMgr::SwSmartTagMgr( const OUString& rModuleName ) : SwSmartTagMgr::SwSmartTagMgr( const OUString& rModuleName ) :
......
...@@ -21,36 +21,36 @@ ...@@ -21,36 +21,36 @@
#include <limits.h> #include <limits.h>
SwTabCols::SwTabCols( sal_uInt16 nSize ) : SwTabCols::SwTabCols( sal_uInt16 nSize ) :
nLeftMin( 0 ), m_nLeftMin( 0 ),
nLeft( 0 ), m_nLeft( 0 ),
nRight( 0 ), m_nRight( 0 ),
nRightMax( 0 ), m_nRightMax( 0 ),
bLastRowAllowedToChange( true ) m_bLastRowAllowedToChange( true )
{ {
if ( nSize ) if ( nSize )
aData.reserve( nSize ); m_aData.reserve( nSize );
} }
SwTabCols::SwTabCols( const SwTabCols& rCpy ) : SwTabCols::SwTabCols( const SwTabCols& rCpy ) :
nLeftMin( rCpy.GetLeftMin() ), m_nLeftMin( rCpy.GetLeftMin() ),
nLeft( rCpy.GetLeft() ), m_nLeft( rCpy.GetLeft() ),
nRight( rCpy.GetRight() ), m_nRight( rCpy.GetRight() ),
nRightMax( rCpy.GetRightMax() ), m_nRightMax( rCpy.GetRightMax() ),
bLastRowAllowedToChange( rCpy.IsLastRowAllowedToChange() ), m_bLastRowAllowedToChange( rCpy.IsLastRowAllowedToChange() ),
aData( rCpy.GetData() ) m_aData( rCpy.GetData() )
{ {
} }
SwTabCols &SwTabCols::operator=( const SwTabCols& rCpy ) SwTabCols &SwTabCols::operator=( const SwTabCols& rCpy )
{ {
nLeftMin = rCpy.GetLeftMin(); m_nLeftMin = rCpy.GetLeftMin();
nLeft = rCpy.GetLeft(); m_nLeft = rCpy.GetLeft();
nRight = rCpy.GetRight(); m_nRight = rCpy.GetRight();
nRightMax= rCpy.GetRightMax(); m_nRightMax= rCpy.GetRightMax();
bLastRowAllowedToChange = rCpy.IsLastRowAllowedToChange(); m_bLastRowAllowedToChange = rCpy.IsLastRowAllowedToChange();
Remove( 0, Count() ); Remove( 0, Count() );
aData = rCpy.GetData(); m_aData = rCpy.GetData();
return *this; return *this;
} }
...@@ -63,7 +63,7 @@ void SwTabCols::Insert( long nValue, long nMin, long nMax, ...@@ -63,7 +63,7 @@ void SwTabCols::Insert( long nValue, long nMin, long nMax,
aEntry.nMin = nMin; aEntry.nMin = nMin;
aEntry.nMax = nMax; aEntry.nMax = nMax;
aEntry.bHidden = bValue; aEntry.bHidden = bValue;
aData.insert( aData.begin() + nPos, aEntry ); m_aData.insert( m_aData.begin() + nPos, aEntry );
} }
void SwTabCols::Insert( long nValue, bool bValue, size_t nPos ) void SwTabCols::Insert( long nValue, bool bValue, size_t nPos )
...@@ -73,7 +73,7 @@ void SwTabCols::Insert( long nValue, bool bValue, size_t nPos ) ...@@ -73,7 +73,7 @@ void SwTabCols::Insert( long nValue, bool bValue, size_t nPos )
aEntry.nMin = 0; aEntry.nMin = 0;
aEntry.nMax = LONG_MAX; aEntry.nMax = LONG_MAX;
aEntry.bHidden = bValue; aEntry.bHidden = bValue;
aData.insert( aData.begin() + nPos, aEntry ); m_aData.insert( m_aData.begin() + nPos, aEntry );
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
for ( const auto& rPos : aData ) for ( const auto& rPos : aData )
...@@ -85,8 +85,8 @@ void SwTabCols::Insert( long nValue, bool bValue, size_t nPos ) ...@@ -85,8 +85,8 @@ void SwTabCols::Insert( long nValue, bool bValue, size_t nPos )
void SwTabCols::Remove( size_t nPos, size_t nCount ) void SwTabCols::Remove( size_t nPos, size_t nCount )
{ {
SwTabColsEntries::iterator aStart = aData.begin() + nPos; SwTabColsEntries::iterator aStart = m_aData.begin() + nPos;
aData.erase( aStart, aStart + nCount ); m_aData.erase( aStart, aStart + nCount );
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -585,15 +585,15 @@ void SwFormatContent::dumpAsXml(xmlTextWriterPtr pWriter) const ...@@ -585,15 +585,15 @@ void SwFormatContent::dumpAsXml(xmlTextWriterPtr pWriter) const
SwFormatPageDesc::SwFormatPageDesc( const SwFormatPageDesc &rCpy ) SwFormatPageDesc::SwFormatPageDesc( const SwFormatPageDesc &rCpy )
: SfxPoolItem( RES_PAGEDESC ), : SfxPoolItem( RES_PAGEDESC ),
SwClient( const_cast<SwPageDesc*>(rCpy.GetPageDesc()) ), SwClient( const_cast<SwPageDesc*>(rCpy.GetPageDesc()) ),
oNumOffset( rCpy.oNumOffset ), m_oNumOffset( rCpy.m_oNumOffset ),
pDefinedIn( nullptr ) m_pDefinedIn( nullptr )
{ {
} }
SwFormatPageDesc::SwFormatPageDesc( const SwPageDesc *pDesc ) SwFormatPageDesc::SwFormatPageDesc( const SwPageDesc *pDesc )
: SfxPoolItem( RES_PAGEDESC ), : SfxPoolItem( RES_PAGEDESC ),
SwClient( const_cast<SwPageDesc*>(pDesc) ), SwClient( const_cast<SwPageDesc*>(pDesc) ),
pDefinedIn( nullptr ) m_pDefinedIn( nullptr )
{ {
} }
...@@ -601,8 +601,8 @@ SwFormatPageDesc &SwFormatPageDesc::operator=(const SwFormatPageDesc &rCpy) ...@@ -601,8 +601,8 @@ SwFormatPageDesc &SwFormatPageDesc::operator=(const SwFormatPageDesc &rCpy)
{ {
if (rCpy.GetPageDesc()) if (rCpy.GetPageDesc())
RegisterToPageDesc(*const_cast<SwPageDesc*>(rCpy.GetPageDesc())); RegisterToPageDesc(*const_cast<SwPageDesc*>(rCpy.GetPageDesc()));
oNumOffset = rCpy.oNumOffset; m_oNumOffset = rCpy.m_oNumOffset;
pDefinedIn = nullptr; m_pDefinedIn = nullptr;
return *this; return *this;
} }
...@@ -617,8 +617,8 @@ bool SwFormatPageDesc::KnowsPageDesc() const ...@@ -617,8 +617,8 @@ bool SwFormatPageDesc::KnowsPageDesc() const
bool SwFormatPageDesc::operator==( const SfxPoolItem& rAttr ) const bool SwFormatPageDesc::operator==( const SfxPoolItem& rAttr ) const
{ {
assert(SfxPoolItem::operator==(rAttr)); assert(SfxPoolItem::operator==(rAttr));
return ( pDefinedIn == static_cast<const SwFormatPageDesc&>(rAttr).pDefinedIn ) && return ( m_pDefinedIn == static_cast<const SwFormatPageDesc&>(rAttr).m_pDefinedIn ) &&
( oNumOffset == static_cast<const SwFormatPageDesc&>(rAttr).oNumOffset ) && ( m_oNumOffset == static_cast<const SwFormatPageDesc&>(rAttr).m_oNumOffset ) &&
( GetPageDesc() == static_cast<const SwFormatPageDesc&>(rAttr).GetPageDesc() ); ( GetPageDesc() == static_cast<const SwFormatPageDesc&>(rAttr).GetPageDesc() );
} }
...@@ -662,7 +662,7 @@ void SwFormatPageDesc::RegisterToPageDesc( SwPageDesc& rDesc ) ...@@ -662,7 +662,7 @@ void SwFormatPageDesc::RegisterToPageDesc( SwPageDesc& rDesc )
void SwFormatPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) void SwFormatPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{ {
if( !pDefinedIn ) if( !m_pDefinedIn )
return; return;
const sal_uInt16 nWhichId = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; const sal_uInt16 nWhichId = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
...@@ -671,15 +671,15 @@ void SwFormatPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ...@@ -671,15 +671,15 @@ void SwFormatPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
case RES_OBJECTDYING: case RES_OBJECTDYING:
//The Pagedesc where I'm registered dies, therefore I unregister //The Pagedesc where I'm registered dies, therefore I unregister
//from that format. During this I get deleted! //from that format. During this I get deleted!
if( typeid(SwFormat) == typeid( pDefinedIn )) if( typeid(SwFormat) == typeid( m_pDefinedIn ))
{ {
bool const bResult = bool const bResult =
static_cast<SwFormat*>(pDefinedIn)->ResetFormatAttr(RES_PAGEDESC); static_cast<SwFormat*>(m_pDefinedIn)->ResetFormatAttr(RES_PAGEDESC);
OSL_ENSURE( bResult, "FormatPageDesc not deleted" ); OSL_ENSURE( bResult, "FormatPageDesc not deleted" );
} }
else if( typeid(SwContentNode) == typeid( pDefinedIn )) else if( typeid(SwContentNode) == typeid( m_pDefinedIn ))
{ {
bool const bResult = static_cast<SwContentNode*>(pDefinedIn) bool const bResult = static_cast<SwContentNode*>(m_pDefinedIn)
->ResetAttr(RES_PAGEDESC); ->ResetAttr(RES_PAGEDESC);
OSL_ENSURE( bResult, "FormatPageDesc not deleted" ); OSL_ENSURE( bResult, "FormatPageDesc not deleted" );
} }
...@@ -768,8 +768,8 @@ void SwFormatPageDesc::dumpAsXml(xmlTextWriterPtr pWriter) const ...@@ -768,8 +768,8 @@ void SwFormatPageDesc::dumpAsXml(xmlTextWriterPtr pWriter) const
{ {
xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatPageDesc")); xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatPageDesc"));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
if (oNumOffset) if (m_oNumOffset)
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("oNumOffset"), BAD_CAST(OString::number(*oNumOffset).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("oNumOffset"), BAD_CAST(OString::number(*m_oNumOffset).getStr()));
else else
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("oNumOffset"), BAD_CAST("none")); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("oNumOffset"), BAD_CAST("none"));
xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("pPageDesc"), "%p", GetPageDesc()); xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("pPageDesc"), "%p", GetPageDesc());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment