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

sw: prefix members of SwGetExpField and SwGetRefField

Change-Id: I703357694eb2f880fa9cc5240fcc5610bd34e924
Reviewed-on: https://gerrit.libreoffice.org/57950Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins
üst fbd79e4b
...@@ -85,11 +85,11 @@ protected: ...@@ -85,11 +85,11 @@ protected:
class SW_DLLPUBLIC SwGetExpField : public SwFormulaField class SW_DLLPUBLIC SwGetExpField : public SwFormulaField
{ {
OUString sExpand; OUString m_sExpand;
bool bIsInBodyText; bool m_bIsInBodyText;
sal_uInt16 nSubType; sal_uInt16 m_nSubType;
bool bLateInitialization; // #i82544# bool m_bLateInitialization; // #i82544#
virtual OUString Expand() const override; virtual OUString Expand() const override;
virtual std::unique_ptr<SwField> Copy() const override; virtual std::unique_ptr<SwField> Copy() const override;
...@@ -126,19 +126,19 @@ public: ...@@ -126,19 +126,19 @@ public:
static sal_Int32 GetReferenceTextPos( const SwFormatField& rFormat, SwDoc& rDoc, sal_Int32 nHint = 0); static sal_Int32 GetReferenceTextPos( const SwFormatField& rFormat, SwDoc& rDoc, sal_Int32 nHint = 0);
// #i82544# // #i82544#
void SetLateInitialization() { bLateInitialization = true;} void SetLateInitialization() { m_bLateInitialization = true;}
}; };
inline void SwGetExpField::ChgExpStr(const OUString& rExpand) inline void SwGetExpField::ChgExpStr(const OUString& rExpand)
{ sExpand = rExpand;} { m_sExpand = rExpand;}
/// Called by formatting. /// Called by formatting.
inline bool SwGetExpField::IsInBodyText() const inline bool SwGetExpField::IsInBodyText() const
{ return bIsInBodyText; } { return m_bIsInBodyText; }
/// Set by UpdateExpFields where node position is known. /// Set by UpdateExpFields where node position is known.
inline void SwGetExpField::ChgBodyTextFlag( bool bIsInBody ) inline void SwGetExpField::ChgBodyTextFlag( bool bIsInBody )
{ bIsInBodyText = bIsInBody; } { m_bIsInBodyText = bIsInBody; }
class SwSetExpField; class SwSetExpField;
......
...@@ -61,7 +61,7 @@ enum REFERENCEMARK ...@@ -61,7 +61,7 @@ enum REFERENCEMARK
class SwGetRefFieldType : public SwFieldType class SwGetRefFieldType : public SwFieldType
{ {
SwDoc* pDoc; SwDoc* m_pDoc;
protected: protected:
/// Overlay in order to update all ref-fields. /// Overlay in order to update all ref-fields.
virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) override; virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) override;
...@@ -69,7 +69,7 @@ public: ...@@ -69,7 +69,7 @@ public:
SwGetRefFieldType(SwDoc* pDoc ); SwGetRefFieldType(SwDoc* pDoc );
virtual SwFieldType* Copy() const override; virtual SwFieldType* Copy() const override;
SwDoc* GetDoc() const { return pDoc; } SwDoc* GetDoc() const { return m_pDoc; }
void MergeWithOtherDoc( SwDoc& rDestDoc ); void MergeWithOtherDoc( SwDoc& rDestDoc );
...@@ -81,11 +81,11 @@ public: ...@@ -81,11 +81,11 @@ public:
class SW_DLLPUBLIC SwGetRefField : public SwField class SW_DLLPUBLIC SwGetRefField : public SwField
{ {
private: private:
OUString sSetRefName; OUString m_sSetRefName;
OUString sSetReferenceLanguage; OUString m_sSetReferenceLanguage;
OUString sText; OUString m_sText;
sal_uInt16 nSubType; sal_uInt16 m_nSubType;
sal_uInt16 nSeqNo; sal_uInt16 m_nSeqNo;
virtual OUString Expand() const override; virtual OUString Expand() const override;
virtual std::unique_ptr<SwField> Copy() const override; virtual std::unique_ptr<SwField> Copy() const override;
...@@ -103,7 +103,7 @@ public: ...@@ -103,7 +103,7 @@ public:
virtual OUString GetFieldName() const override; virtual OUString GetFieldName() const override;
const OUString& GetSetRefName() const { return sSetRefName; } const OUString& GetSetRefName() const { return m_sSetRefName; }
// #i81002# // #i81002#
/** The <SwTextField> instance, which represents the text attribute for the /** The <SwTextField> instance, which represents the text attribute for the
...@@ -114,7 +114,7 @@ public: ...@@ -114,7 +114,7 @@ public:
no update for these reference format types. */ no update for these reference format types. */
void UpdateField( const SwTextField* pFieldTextAttr ); void UpdateField( const SwTextField* pFieldTextAttr );
void SetExpand( const OUString& rStr ) { sText = rStr; } void SetExpand( const OUString& rStr ) { m_sText = rStr; }
/// Get/set sub type. /// Get/set sub type.
virtual sal_uInt16 GetSubType() const override; virtual sal_uInt16 GetSubType() const override;
...@@ -128,8 +128,8 @@ public: ...@@ -128,8 +128,8 @@ public:
OUString GetExpandedTextOfReferencedTextNode() const; OUString GetExpandedTextOfReferencedTextNode() const;
/// Get/set SequenceNo (of interest only for REF_SEQUENCEFLD). /// Get/set SequenceNo (of interest only for REF_SEQUENCEFLD).
sal_uInt16 GetSeqNo() const { return nSeqNo; } sal_uInt16 GetSeqNo() const { return m_nSeqNo; }
void SetSeqNo( sal_uInt16 n ) { nSeqNo = n; } void SetSeqNo( sal_uInt16 n ) { m_nSeqNo = n; }
// Name of reference. // Name of reference.
virtual OUString GetPar1() const override; virtual OUString GetPar1() const override;
......
...@@ -284,25 +284,25 @@ void SwGetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* pNew ) ...@@ -284,25 +284,25 @@ void SwGetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* pNew )
SwGetExpField::SwGetExpField(SwGetExpFieldType* pTyp, const OUString& rFormel, SwGetExpField::SwGetExpField(SwGetExpFieldType* pTyp, const OUString& rFormel,
sal_uInt16 nSub, sal_uLong nFormat) sal_uInt16 nSub, sal_uLong nFormat)
: SwFormulaField( pTyp, nFormat, 0.0 ), : SwFormulaField( pTyp, nFormat, 0.0 ),
bIsInBodyText( true ), m_bIsInBodyText( true ),
nSubType(nSub), m_nSubType(nSub),
bLateInitialization( false ) m_bLateInitialization( false )
{ {
SetFormula( rFormel ); SetFormula( rFormel );
} }
OUString SwGetExpField::Expand() const OUString SwGetExpField::Expand() const
{ {
if(nSubType & nsSwExtendedSubType::SUB_CMD) if(m_nSubType & nsSwExtendedSubType::SUB_CMD)
return GetFormula(); return GetFormula();
return sExpand; return m_sExpand;
} }
OUString SwGetExpField::GetFieldName() const OUString SwGetExpField::GetFieldName() const
{ {
const sal_uInt16 nType = static_cast<sal_uInt16>( const sal_uInt16 nType = static_cast<sal_uInt16>(
(nsSwGetSetExpType::GSE_FORMULA & nSubType) (nsSwGetSetExpType::GSE_FORMULA & m_nSubType)
? TYP_FORMELFLD ? TYP_FORMELFLD
: TYP_GETFLD); : TYP_GETFLD);
...@@ -312,13 +312,13 @@ OUString SwGetExpField::GetFieldName() const ...@@ -312,13 +312,13 @@ OUString SwGetExpField::GetFieldName() const
std::unique_ptr<SwField> SwGetExpField::Copy() const std::unique_ptr<SwField> SwGetExpField::Copy() const
{ {
std::unique_ptr<SwGetExpField> pTmp(new SwGetExpField(static_cast<SwGetExpFieldType*>(GetTyp()), std::unique_ptr<SwGetExpField> pTmp(new SwGetExpField(static_cast<SwGetExpFieldType*>(GetTyp()),
GetFormula(), nSubType, GetFormat())); GetFormula(), m_nSubType, GetFormat()));
pTmp->SetLanguage(GetLanguage()); pTmp->SetLanguage(GetLanguage());
pTmp->SwValueField::SetValue(GetValue()); pTmp->SwValueField::SetValue(GetValue());
pTmp->sExpand = sExpand; pTmp->m_sExpand = m_sExpand;
pTmp->bIsInBodyText = bIsInBodyText; pTmp->m_bIsInBodyText = m_bIsInBodyText;
pTmp->SetAutomaticLanguage(IsAutomaticLanguage()); pTmp->SetAutomaticLanguage(IsAutomaticLanguage());
if( bLateInitialization ) if( m_bLateInitialization )
pTmp->SetLateInitialization(); pTmp->SetLateInitialization();
return std::unique_ptr<SwField>(pTmp.release()); return std::unique_ptr<SwField>(pTmp.release());
...@@ -326,7 +326,7 @@ std::unique_ptr<SwField> SwGetExpField::Copy() const ...@@ -326,7 +326,7 @@ std::unique_ptr<SwField> SwGetExpField::Copy() const
void SwGetExpField::ChangeExpansion( const SwFrame& rFrame, const SwTextField& rField ) void SwGetExpField::ChangeExpansion( const SwFrame& rFrame, const SwTextField& rField )
{ {
if( bIsInBodyText ) // only fields in Footer, Header, FootNote, Flys if( m_bIsInBodyText ) // only fields in Footer, Header, FootNote, Flys
return; return;
OSL_ENSURE( !rFrame.IsInDocBody(), "Flag incorrect, frame is in DocBody" ); OSL_ENSURE( !rFrame.IsInDocBody(), "Flag incorrect, frame is in DocBody" );
...@@ -344,12 +344,12 @@ void SwGetExpField::ChangeExpansion( const SwFrame& rFrame, const SwTextField& r ...@@ -344,12 +344,12 @@ void SwGetExpField::ChangeExpansion( const SwFrame& rFrame, const SwTextField& r
if(!pTextNode) if(!pTextNode)
return; return;
// #i82544# // #i82544#
if( bLateInitialization ) if( m_bLateInitialization )
{ {
SwFieldType* pSetExpField = rDoc.getIDocumentFieldsAccess().GetFieldType(SwFieldIds::SetExp, GetFormula(), false); SwFieldType* pSetExpField = rDoc.getIDocumentFieldsAccess().GetFieldType(SwFieldIds::SetExp, GetFormula(), false);
if( pSetExpField ) if( pSetExpField )
{ {
bLateInitialization = false; m_bLateInitialization = false;
if( !(GetSubType() & nsSwGetSetExpType::GSE_STRING) && if( !(GetSubType() & nsSwGetSetExpType::GSE_STRING) &&
static_cast< SwSetExpFieldType* >(pSetExpField)->GetType() == nsSwGetSetExpType::GSE_STRING ) static_cast< SwSetExpFieldType* >(pSetExpField)->GetType() == nsSwGetSetExpType::GSE_STRING )
SetSubType( nsSwGetSetExpType::GSE_STRING ); SetSubType( nsSwGetSetExpType::GSE_STRING );
...@@ -361,7 +361,7 @@ void SwGetExpField::ChangeExpansion( const SwFrame& rFrame, const SwTextField& r ...@@ -361,7 +361,7 @@ void SwGetExpField::ChangeExpansion( const SwFrame& rFrame, const SwTextField& r
{ {
SwHashTable<HashStr> aHashTable(0); SwHashTable<HashStr> aHashTable(0);
rDoc.getIDocumentFieldsAccess().FieldsToExpand( aHashTable, aEndField ); rDoc.getIDocumentFieldsAccess().FieldsToExpand( aHashTable, aEndField );
sExpand = LookString( aHashTable, GetFormula() ); m_sExpand = LookString( aHashTable, GetFormula() );
} }
else else
{ {
...@@ -373,7 +373,7 @@ void SwGetExpField::ChangeExpansion( const SwFrame& rFrame, const SwTextField& r ...@@ -373,7 +373,7 @@ void SwGetExpField::ChangeExpansion( const SwFrame& rFrame, const SwTextField& r
SetValue(aCalc.Calculate(GetFormula()).GetDouble()); SetValue(aCalc.Calculate(GetFormula()).GetDouble());
// analyse based on format // analyse based on format
sExpand = static_cast<SwValueFieldType*>(GetTyp())->ExpandValue( m_sExpand = static_cast<SwValueFieldType*>(GetTyp())->ExpandValue(
GetValue(), GetFormat(), GetLanguage()); GetValue(), GetFormat(), GetLanguage());
} }
} }
...@@ -390,17 +390,17 @@ void SwGetExpField::SetPar2(const OUString& rStr) ...@@ -390,17 +390,17 @@ void SwGetExpField::SetPar2(const OUString& rStr)
sal_uInt16 SwGetExpField::GetSubType() const sal_uInt16 SwGetExpField::GetSubType() const
{ {
return nSubType; return m_nSubType;
} }
void SwGetExpField::SetSubType(sal_uInt16 nType) void SwGetExpField::SetSubType(sal_uInt16 nType)
{ {
nSubType = nType; m_nSubType = nType;
} }
void SwGetExpField::SetLanguage(LanguageType nLng) void SwGetExpField::SetLanguage(LanguageType nLng)
{ {
if (nSubType & nsSwExtendedSubType::SUB_CMD) if (m_nSubType & nsSwExtendedSubType::SUB_CMD)
SwField::SetLanguage(nLng); SwField::SetLanguage(nLng);
else else
SwValueField::SetLanguage(nLng); SwValueField::SetLanguage(nLng);
...@@ -417,7 +417,7 @@ bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ...@@ -417,7 +417,7 @@ bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
rAny <<= static_cast<sal_Int32>(GetFormat()); rAny <<= static_cast<sal_Int32>(GetFormat());
break; break;
case FIELD_PROP_USHORT1: case FIELD_PROP_USHORT1:
rAny <<= static_cast<sal_Int16>(nSubType); rAny <<= static_cast<sal_Int16>(m_nSubType);
break; break;
case FIELD_PROP_PAR1: case FIELD_PROP_PAR1:
rAny <<= GetFormula(); rAny <<= GetFormula();
...@@ -429,10 +429,10 @@ bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ...@@ -429,10 +429,10 @@ bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
} }
break; break;
case FIELD_PROP_BOOL2: case FIELD_PROP_BOOL2:
rAny <<= 0 != (nSubType & nsSwExtendedSubType::SUB_CMD); rAny <<= 0 != (m_nSubType & nsSwExtendedSubType::SUB_CMD);
break; break;
case FIELD_PROP_PAR4: case FIELD_PROP_PAR4:
rAny <<= sExpand; rAny <<= m_sExpand;
break; break;
default: default:
return SwField::QueryValue(rAny, nWhichId); return SwField::QueryValue(rAny, nWhichId);
...@@ -454,7 +454,7 @@ bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ...@@ -454,7 +454,7 @@ bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
break; break;
case FIELD_PROP_USHORT1: case FIELD_PROP_USHORT1:
rAny >>= nTmp; rAny >>= nTmp;
nSubType = static_cast<sal_uInt16>(nTmp); m_nSubType = static_cast<sal_uInt16>(nTmp);
break; break;
case FIELD_PROP_PAR1: case FIELD_PROP_PAR1:
{ {
...@@ -470,9 +470,9 @@ bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ...@@ -470,9 +470,9 @@ bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
break; break;
case FIELD_PROP_BOOL2: case FIELD_PROP_BOOL2:
if(*o3tl::doAccess<bool>(rAny)) if(*o3tl::doAccess<bool>(rAny))
nSubType |= nsSwExtendedSubType::SUB_CMD; m_nSubType |= nsSwExtendedSubType::SUB_CMD;
else else
nSubType &= (~nsSwExtendedSubType::SUB_CMD); m_nSubType &= (~nsSwExtendedSubType::SUB_CMD);
break; break;
case FIELD_PROP_PAR4: case FIELD_PROP_PAR4:
{ {
...@@ -874,7 +874,7 @@ void SwSetExpField::SetValue( const double& rAny ) ...@@ -874,7 +874,7 @@ void SwSetExpField::SetValue( const double& rAny )
void SwGetExpField::SetValue( const double& rAny ) void SwGetExpField::SetValue( const double& rAny )
{ {
SwValueField::SetValue(rAny); SwValueField::SetValue(rAny);
sExpand = static_cast<SwValueFieldType*>(GetTyp())->ExpandValue( rAny, GetFormat(), m_sExpand = static_cast<SwValueFieldType*>(GetTyp())->ExpandValue( rAny, GetFormat(),
GetLanguage()); GetLanguage());
} }
......
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