[Libreoffice-commits] core.git: sw/inc sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Feb 12 09:26:21 UTC 2018
sw/inc/docufld.hxx | 28 ++++++-------
sw/source/core/fields/docufld.cxx | 76 ++++++++++++++++++-------------------
sw/source/core/fields/macrofld.cxx | 64 +++++++++++++++----------------
3 files changed, 84 insertions(+), 84 deletions(-)
New commits:
commit 09d17c25d970e49eddda5a3a5078dca6d88fc559
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Feb 12 09:10:46 2018 +0100
sw: prefix members of SwJumpEditFieldType, SwMacroField and SwPageNumberField
Change-Id: Ib02b05dfa1f39c43c69bcb968806dec67d02082b
Reviewed-on: https://gerrit.libreoffice.org/49576
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 3f1f6b7c494c..4d133ff26cb0 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -124,8 +124,8 @@ enum SwJumpEditFormat
class SwPageNumberFieldType : public SwFieldType
{
- SvxNumType nNumberingType;
- bool bVirtuell;
+ SvxNumType m_nNumberingType;
+ bool m_bVirtual;
public:
SwPageNumberFieldType();
@@ -140,9 +140,9 @@ public:
// Page numbering.
class SW_DLLPUBLIC SwPageNumberField : public SwField
{
- OUString sUserStr;
- sal_uInt16 nSubType;
- short nOffset;
+ OUString m_sUserStr;
+ sal_uInt16 m_nSubType;
+ short m_nOffset;
// fdo#58074 store page number in SwField, not SwFieldType
sal_uInt16 m_nPageNumber;
sal_uInt16 m_nMaxPage;
@@ -166,8 +166,8 @@ public:
virtual bool QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) const override;
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich ) override;
- const OUString& GetUserString() const { return sUserStr; }
- void SetUserString( const OUString& rS ) { sUserStr = rS; }
+ const OUString& GetUserString() const { return m_sUserStr; }
+ void SetUserString( const OUString& rS ) { m_sUserStr = rS; }
};
class SwAuthorFieldType : public SwFieldType
@@ -376,7 +376,7 @@ public:
class SwMacroFieldType : public SwFieldType
{
- SwDoc* pDoc;
+ SwDoc* m_pDoc;
public:
SwMacroFieldType(SwDoc*);
@@ -386,9 +386,9 @@ public:
class SW_DLLPUBLIC SwMacroField : public SwField
{
- OUString aMacro;
- OUString aText;
- bool bIsScriptURL;
+ OUString m_aMacro;
+ OUString m_aText;
+ bool m_bIsScriptURL;
virtual OUString Expand() const override;
virtual SwField* Copy() const override;
@@ -398,7 +398,7 @@ public:
SwMacroField( SwMacroFieldType*, const OUString& rLibAndName,
const OUString& rText);
- const OUString& GetMacro() const { return aMacro; }
+ const OUString& GetMacro() const { return m_aMacro; }
OUString GetLibName() const;
OUString GetMacroName() const;
SvxMacro GetSvxMacro() const;
@@ -631,8 +631,8 @@ public:
// Field to jump to and edit.
class SwJumpEditFieldType : public SwFieldType
{
- SwDoc* pDoc;
- SwDepend aDep;
+ SwDoc* m_pDoc;
+ SwDepend m_aDep;
public:
SwJumpEditFieldType( SwDoc* pDoc );
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 174eb02afaab..249f3ccabcc8 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -98,8 +98,8 @@ using namespace nsSwDocInfoSubType;
SwPageNumberFieldType::SwPageNumberFieldType()
: SwFieldType( SwFieldIds::PageNumber ),
- nNumberingType( SVX_NUM_ARABIC ),
- bVirtuell( false )
+ m_nNumberingType( SVX_NUM_ARABIC ),
+ m_bVirtual( false )
{
}
@@ -107,10 +107,10 @@ OUString SwPageNumberFieldType::Expand( SvxNumType nFormat, short nOff,
sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage,
const OUString& rUserStr ) const
{
- SvxNumType nTmpFormat = (SVX_NUM_PAGEDESC == nFormat) ? nNumberingType : nFormat;
+ SvxNumType nTmpFormat = (SVX_NUM_PAGEDESC == nFormat) ? m_nNumberingType : nFormat;
int const nTmp = nPageNumber + nOff;
- if (0 > nTmp || SVX_NUM_NUMBER_NONE == nTmpFormat || (!bVirtuell && nTmp > nMaxPage))
+ if (0 > nTmp || SVX_NUM_NUMBER_NONE == nTmpFormat || (!m_bVirtual && nTmp > nMaxPage))
return OUString();
if( SVX_NUM_CHAR_SPECIAL == nTmpFormat )
@@ -123,8 +123,8 @@ SwFieldType* SwPageNumberFieldType::Copy() const
{
SwPageNumberFieldType *pTmp = new SwPageNumberFieldType();
- pTmp->nNumberingType = nNumberingType;
- pTmp->bVirtuell = bVirtuell;
+ pTmp->m_nNumberingType = m_nNumberingType;
+ pTmp->m_bVirtual = m_bVirtual;
return pTmp;
}
@@ -134,9 +134,9 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc,
const SvxNumType* pNumFormat )
{
if( pNumFormat )
- nNumberingType = *pNumFormat;
+ m_nNumberingType = *pNumFormat;
- bVirtuell = false;
+ m_bVirtual = false;
if (bVirt && pDoc)
{
// check the flag since the layout NEVER sets it back
@@ -152,12 +152,12 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc,
if( pNd )
{
if ( SwIterator<SwFrame,SwContentNode>(*pNd).First() )
- bVirtuell = true;
+ m_bVirtual = true;
}
else if( dynamic_cast< const SwFormat* >(pDesc->GetDefinedIn()) != nullptr)
{
SwAutoFormatGetDocNode aGetHt( &pDoc->GetNodes() );
- bVirtuell = !pDesc->GetDefinedIn()->GetInfo( aGetHt );
+ m_bVirtual = !pDesc->GetDefinedIn()->GetInfo( aGetHt );
break;
}
}
@@ -168,7 +168,7 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc,
SwPageNumberField::SwPageNumberField(SwPageNumberFieldType* pTyp,
sal_uInt16 nSub, sal_uInt32 nFormat, short nOff,
sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage)
- : SwField(pTyp, nFormat), nSubType(nSub), nOffset(nOff)
+ : SwField(pTyp, nFormat), m_nSubType(nSub), m_nOffset(nOff)
, m_nPageNumber(nPageNumber)
, m_nMaxPage(nMaxPage)
{
@@ -186,50 +186,50 @@ OUString SwPageNumberField::Expand() const
OUString sRet;
SwPageNumberFieldType* pFieldType = static_cast<SwPageNumberFieldType*>(GetTyp());
- if( PG_NEXT == nSubType && 1 != nOffset )
+ if( PG_NEXT == m_nSubType && 1 != m_nOffset )
{
- sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), 1, m_nPageNumber, m_nMaxPage, sUserStr);
+ sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), 1, m_nPageNumber, m_nMaxPage, m_sUserStr);
if (!sRet.isEmpty())
{
- sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), nOffset, m_nPageNumber, m_nMaxPage, sUserStr);
+ sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), m_nOffset, m_nPageNumber, m_nMaxPage, m_sUserStr);
}
}
- else if( PG_PREV == nSubType && -1 != nOffset )
+ else if( PG_PREV == m_nSubType && -1 != m_nOffset )
{
- sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), -1, m_nPageNumber, m_nMaxPage, sUserStr);
+ sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), -1, m_nPageNumber, m_nMaxPage, m_sUserStr);
if (!sRet.isEmpty())
{
- sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), nOffset, m_nPageNumber, m_nMaxPage, sUserStr);
+ sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), m_nOffset, m_nPageNumber, m_nMaxPage, m_sUserStr);
}
}
else
- sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), nOffset, m_nPageNumber, m_nMaxPage, sUserStr);
+ sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), m_nOffset, m_nPageNumber, m_nMaxPage, m_sUserStr);
return sRet;
}
SwField* SwPageNumberField::Copy() const
{
SwPageNumberField *pTmp = new SwPageNumberField(
- static_cast<SwPageNumberFieldType*>(GetTyp()), nSubType,
- GetFormat(), nOffset, m_nPageNumber, m_nMaxPage);
+ static_cast<SwPageNumberFieldType*>(GetTyp()), m_nSubType,
+ GetFormat(), m_nOffset, m_nPageNumber, m_nMaxPage);
pTmp->SetLanguage( GetLanguage() );
- pTmp->SetUserString( sUserStr );
+ pTmp->SetUserString( m_sUserStr );
return pTmp;
}
OUString SwPageNumberField::GetPar2() const
{
- return OUString::number(nOffset);
+ return OUString::number(m_nOffset);
}
void SwPageNumberField::SetPar2(const OUString& rStr)
{
- nOffset = static_cast<short>(rStr.toInt32());
+ m_nOffset = static_cast<short>(rStr.toInt32());
}
sal_uInt16 SwPageNumberField::GetSubType() const
{
- return nSubType;
+ return m_nSubType;
}
bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
@@ -240,21 +240,21 @@ bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
rAny <<= static_cast<sal_Int16>(GetFormat());
break;
case FIELD_PROP_USHORT1:
- rAny <<= nOffset;
+ rAny <<= m_nOffset;
break;
case FIELD_PROP_SUBTYPE:
{
text::PageNumberType eType;
eType = text::PageNumberType_CURRENT;
- if(nSubType == PG_PREV)
+ if(m_nSubType == PG_PREV)
eType = text::PageNumberType_PREV;
- else if(nSubType == PG_NEXT)
+ else if(m_nSubType == PG_NEXT)
eType = text::PageNumberType_NEXT;
rAny <<= eType;
}
break;
case FIELD_PROP_PAR1:
- rAny <<= sUserStr;
+ rAny <<= m_sUserStr;
break;
default:
@@ -278,26 +278,26 @@ bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
break;
case FIELD_PROP_USHORT1:
rAny >>= nSet;
- nOffset = nSet;
+ m_nOffset = nSet;
break;
case FIELD_PROP_SUBTYPE:
switch( static_cast<text::PageNumberType>(SWUnoHelper::GetEnumAsInt32( rAny )) )
{
case text::PageNumberType_CURRENT:
- nSubType = PG_RANDOM;
+ m_nSubType = PG_RANDOM;
break;
case text::PageNumberType_PREV:
- nSubType = PG_PREV;
+ m_nSubType = PG_PREV;
break;
case text::PageNumberType_NEXT:
- nSubType = PG_NEXT;
+ m_nSubType = PG_NEXT;
break;
default:
bRet = false;
}
break;
case FIELD_PROP_PAR1:
- rAny >>= sUserStr;
+ rAny >>= m_sUserStr;
break;
default:
@@ -2393,22 +2393,22 @@ bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
// field type to jump to and edit
SwJumpEditFieldType::SwJumpEditFieldType( SwDoc* pD )
- : SwFieldType( SwFieldIds::JumpEdit ), pDoc( pD ), aDep( this, nullptr )
+ : SwFieldType( SwFieldIds::JumpEdit ), m_pDoc( pD ), m_aDep( this, nullptr )
{
}
SwFieldType* SwJumpEditFieldType::Copy() const
{
- return new SwJumpEditFieldType( pDoc );
+ return new SwJumpEditFieldType( m_pDoc );
}
SwCharFormat* SwJumpEditFieldType::GetCharFormat()
{
- SwCharFormat* pFormat = pDoc->getIDocumentStylePoolAccess().GetCharFormatFromPool( RES_POOLCHR_JUMPEDIT );
+ SwCharFormat* pFormat = m_pDoc->getIDocumentStylePoolAccess().GetCharFormatFromPool( RES_POOLCHR_JUMPEDIT );
// not registered yet?
- if( !aDep.GetRegisteredIn() )
- pFormat->Add( &aDep ); // register
+ if( !m_aDep.GetRegisteredIn() )
+ pFormat->Add( &m_aDep ); // register
return pFormat;
}
diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx
index 787648806185..a0bd9edd5560 100644
--- a/sw/source/core/fields/macrofld.cxx
+++ b/sw/source/core/fields/macrofld.cxx
@@ -29,54 +29,54 @@ using namespace ::com::sun::star;
SwMacroFieldType::SwMacroFieldType(SwDoc* pDocument)
: SwFieldType( SwFieldIds::Macro ),
- pDoc(pDocument)
+ m_pDoc(pDocument)
{
}
SwFieldType* SwMacroFieldType::Copy() const
{
- SwMacroFieldType* pType = new SwMacroFieldType(pDoc);
+ SwMacroFieldType* pType = new SwMacroFieldType(m_pDoc);
return pType;
}
SwMacroField::SwMacroField(SwMacroFieldType* pInitType,
const OUString& rLibAndName, const OUString& rText) :
- SwField(pInitType), aMacro(rLibAndName), aText(rText), bIsScriptURL(false)
+ SwField(pInitType), m_aMacro(rLibAndName), m_aText(rText), m_bIsScriptURL(false)
{
- bIsScriptURL = isScriptURL(aMacro);
+ m_bIsScriptURL = isScriptURL(m_aMacro);
}
OUString SwMacroField::Expand() const
{
- return aText ;
+ return m_aText ;
}
SwField* SwMacroField::Copy() const
{
- return new SwMacroField(static_cast<SwMacroFieldType*>(GetTyp()), aMacro, aText);
+ return new SwMacroField(static_cast<SwMacroFieldType*>(GetTyp()), m_aMacro, m_aText);
}
OUString SwMacroField::GetFieldName() const
{
- return GetTyp()->GetName() + " " + aMacro;
+ return GetTyp()->GetName() + " " + m_aMacro;
}
OUString SwMacroField::GetLibName() const
{
// if it is a Scripting Framework macro return an empty string
- if (bIsScriptURL)
+ if (m_bIsScriptURL)
{
return OUString();
}
- if (!aMacro.isEmpty())
+ if (!m_aMacro.isEmpty())
{
- sal_Int32 nPos = aMacro.getLength();
+ sal_Int32 nPos = m_aMacro.getLength();
for (sal_Int32 i = 0; i < 3 && nPos > 0; i++)
- while (aMacro[--nPos] != '.' && nPos > 0) ;
+ while (m_aMacro[--nPos] != '.' && nPos > 0) ;
- return aMacro.copy(0, nPos);
+ return m_aMacro.copy(0, nPos);
}
OSL_FAIL("No LibName");
@@ -85,20 +85,20 @@ OUString SwMacroField::GetLibName() const
OUString SwMacroField::GetMacroName() const
{
- if (!aMacro.isEmpty())
+ if (!m_aMacro.isEmpty())
{
- if (bIsScriptURL)
+ if (m_bIsScriptURL)
{
- return aMacro;
+ return m_aMacro;
}
else
{
- sal_Int32 nPos = aMacro.getLength();
+ sal_Int32 nPos = m_aMacro.getLength();
for (sal_Int32 i = 0; i < 3 && nPos > 0; i++)
- while (aMacro[--nPos] != '.' && nPos > 0) ;
+ while (m_aMacro[--nPos] != '.' && nPos > 0) ;
- return aMacro.copy( ++nPos );
+ return m_aMacro.copy( ++nPos );
}
}
@@ -108,9 +108,9 @@ OUString SwMacroField::GetMacroName() const
SvxMacro SwMacroField::GetSvxMacro() const
{
- if (bIsScriptURL)
+ if (m_bIsScriptURL)
{
- return SvxMacro(aMacro, OUString(), EXTENDED_STYPE);
+ return SvxMacro(m_aMacro, OUString(), EXTENDED_STYPE);
}
else
{
@@ -121,26 +121,26 @@ SvxMacro SwMacroField::GetSvxMacro() const
/// LibName and MacroName
void SwMacroField::SetPar1(const OUString& rStr)
{
- aMacro = rStr;
- bIsScriptURL = isScriptURL(aMacro);
+ m_aMacro = rStr;
+ m_bIsScriptURL = isScriptURL(m_aMacro);
}
/// Get macro
OUString SwMacroField::GetPar1() const
{
- return aMacro;
+ return m_aMacro;
}
/// set macro text
void SwMacroField::SetPar2(const OUString& rStr)
{
- aText = rStr;
+ m_aText = rStr;
}
/// get macro text
OUString SwMacroField::GetPar2() const
{
- return aText;
+ return m_aText;
}
bool SwMacroField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
@@ -151,13 +151,13 @@ bool SwMacroField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
rAny <<= GetMacroName();
break;
case FIELD_PROP_PAR2:
- rAny <<= aText;
+ rAny <<= m_aText;
break;
case FIELD_PROP_PAR3:
rAny <<= GetLibName();
break;
case FIELD_PROP_PAR4:
- rAny <<= bIsScriptURL ? GetMacroName() : OUString();
+ rAny <<= m_bIsScriptURL ? GetMacroName() : OUString();
break;
default:
assert(false);
@@ -172,18 +172,18 @@ bool SwMacroField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
case FIELD_PROP_PAR1:
rAny >>= sTmp;
- CreateMacroString( aMacro, sTmp, GetLibName());
+ CreateMacroString( m_aMacro, sTmp, GetLibName());
break;
case FIELD_PROP_PAR2:
- rAny >>= aText;
+ rAny >>= m_aText;
break;
case FIELD_PROP_PAR3:
rAny >>= sTmp;
- CreateMacroString(aMacro, GetMacroName(), sTmp );
+ CreateMacroString(m_aMacro, GetMacroName(), sTmp );
break;
case FIELD_PROP_PAR4:
- rAny >>= aMacro;
- bIsScriptURL = isScriptURL(aMacro);
+ rAny >>= m_aMacro;
+ m_bIsScriptURL = isScriptURL(m_aMacro);
break;
default:
assert(false);
More information about the Libreoffice-commits
mailing list