summaryrefslogtreecommitdiff
path: root/sw/inc/expfld.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/inc/expfld.hxx')
-rw-r--r--sw/inc/expfld.hxx184
1 files changed, 95 insertions, 89 deletions
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index 4a2e654f131a..e80b2c264578 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -25,8 +25,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _EXPFLD_HXX
-#define _EXPFLD_HXX
+#ifndef SW_EXPFLD_HXX
+#define SW_EXPFLD_HXX
#include <svl/svarray.hxx>
#include "swdllapi.h"
@@ -47,14 +47,14 @@ class SwEditShell;
const SwTxtNode* GetBodyTxtNode( const SwDoc& pDoc, SwPosition& rPos,
const SwFrm& rFrm );
-void ReplacePoint(String& sTmpName, BOOL bWithCommandType = FALSE);
+void ReplacePoint(String& sTmpName, sal_Bool bWithCommandType = sal_False);
struct _SeqFldLstElem
{
String sDlgEntry;
- USHORT nSeqNo;
+ sal_uInt16 nSeqNo;
- _SeqFldLstElem( const String& rStr, USHORT nNo )
+ _SeqFldLstElem( const String& rStr, sal_uInt16 nNo )
: sDlgEntry( rStr ), nSeqNo( nNo )
{}
};
@@ -65,8 +65,8 @@ class SW_DLLPUBLIC SwSeqFldList : public _SwSeqFldList
public:
SwSeqFldList() : _SwSeqFldList( 10, 10 ) {}
- BOOL InsertSort( _SeqFldLstElem* );
- BOOL SeekEntry( const _SeqFldLstElem& , USHORT* pPos = 0 );
+ sal_Bool InsertSort( _SeqFldLstElem* );
+ sal_Bool SeekEntry( const _SeqFldLstElem& , sal_uInt16* pPos = 0 );
};
class SwGetExpFieldType : public SwValueFieldType
@@ -84,46 +84,46 @@ public:
class SW_DLLPUBLIC SwGetExpField : public SwFormulaField
{
String sExpand;
- BOOL bIsInBodyTxt;
- USHORT nSubType;
+ sal_Bool bIsInBodyTxt;
+ sal_uInt16 nSubType;
bool bLateInitialization; // #i82544#
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
SwGetExpField( SwGetExpFieldType*, const String& rFormel,
- USHORT nSubType = nsSwGetSetExpType::GSE_EXPR, ULONG nFmt = 0);
+ sal_uInt16 nSubType = nsSwGetSetExpType::GSE_EXPR, sal_uLong nFmt = 0);
virtual void SetValue( const double& rVal );
- virtual void SetLanguage(USHORT nLng);
-
- virtual String Expand() const;
- virtual SwField* Copy() const;
+ virtual void SetLanguage(sal_uInt16 nLng);
inline const String& GetExpStr() const;
inline void ChgExpStr(const String& rExpand);
// Called by formating.
- inline BOOL IsInBodyTxt() const;
+ inline sal_Bool IsInBodyTxt() const;
// Set by UpdateExpFlds where node position is known.
- inline void ChgBodyTxtFlag( BOOL bIsInBody );
+ inline void ChgBodyTxtFlag( sal_Bool bIsInBody );
// For fields in header/footer/footnotes/flys:
// Only called by formating!!
void ChangeExpansion( const SwFrm&, const SwTxtFld& );
- virtual String GetCntnt(BOOL bName = FALSE) const;
+ virtual String GetFieldName() const;
// Change formula.
virtual String GetPar2() const;
virtual void SetPar2(const String& rStr);
- virtual USHORT GetSubType() const;
- virtual void SetSubType(USHORT nType);
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
- virtual bool PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
+ virtual sal_uInt16 GetSubType() const;
+ virtual void SetSubType(sal_uInt16 nType);
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
- static USHORT GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc);
+ static sal_uInt16 GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc);
// #i82544#
void SetLateInitialization() { bLateInitialization = true;}
};
@@ -135,11 +135,11 @@ inline const String& SwGetExpField::GetExpStr() const
{ return sExpand; }
// Called by formating.
-inline BOOL SwGetExpField::IsInBodyTxt() const
+inline sal_Bool SwGetExpField::IsInBodyTxt() const
{ return bIsInBodyTxt; }
// Set by UpdateExpFlds where node position is known.
-inline void SwGetExpField::ChgBodyTxtFlag( BOOL bIsInBody )
+inline void SwGetExpField::ChgBodyTxtFlag( sal_Bool bIsInBody )
{ bIsInBodyTxt = bIsInBody; }
class SwSetExpField;
@@ -149,39 +149,39 @@ class SW_DLLPUBLIC SwSetExpFieldType : public SwValueFieldType
String sName;
const SwNode* pOutlChgNd;
String sDelim;
- USHORT nType;
- BYTE nLevel;
- BOOL bDeleted;
+ sal_uInt16 nType;
+ sal_uInt8 nLevel;
+ sal_Bool bDeleted;
public:
SwSetExpFieldType( SwDoc* pDoc, const String& rName,
- USHORT nType = nsSwGetSetExpType::GSE_EXPR );
+ sal_uInt16 nType = nsSwGetSetExpType::GSE_EXPR );
virtual SwFieldType* Copy() const;
virtual const String& GetName() const;
- inline void SetType(USHORT nTyp);
- inline USHORT GetType() const;
+ inline void SetType(sal_uInt16 nTyp);
+ inline sal_uInt16 GetType() const;
- void SetSeqFormat(ULONG nFormat);
- ULONG GetSeqFormat();
+ void SetSeqFormat(sal_uLong nFormat);
+ sal_uLong GetSeqFormat();
- BOOL IsDeleted() const { return bDeleted; }
- void SetDeleted( BOOL b ) { bDeleted = b; }
+ sal_Bool IsDeleted() const { return bDeleted; }
+ void SetDeleted( sal_Bool b ) { bDeleted = b; }
// Overlay, because set-field takes care for its being updated by itself.
virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
inline const String& GetSetRefName() const;
- USHORT SetSeqRefNo( SwSetExpField& rFld );
+ sal_uInt16 SetSeqRefNo( SwSetExpField& rFld );
- USHORT GetSeqFldList( SwSeqFldList& rList );
- String MakeSeqName( USHORT nSeqNo );
+ sal_uInt16 GetSeqFldList( SwSeqFldList& rList );
+ String MakeSeqName( sal_uInt16 nSeqNo );
// Number sequence fields chapterwise if required.
const String& GetDelimiter() const { return sDelim; }
void SetDelimiter( const String& s ) { sDelim = s; }
- BYTE GetOutlineLvl() const { return nLevel; }
- void SetOutlineLvl( BYTE n ) { nLevel = n; }
+ sal_uInt8 GetOutlineLvl() const { return nLevel; }
+ void SetOutlineLvl( sal_uInt8 n ) { nLevel = n; }
void SetChapter( SwSetExpField& rFld, const SwNode& rNd );
// Member only for SwDoc::UpdateExpFld.
@@ -189,17 +189,17 @@ public:
const SwNode* GetOutlineChgNd() const { return pOutlChgNd; }
void SetOutlineChgNd( const SwNode* p ) { pOutlChgNd = p; }
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
- virtual bool PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
};
-inline void SwSetExpFieldType::SetType( USHORT nTyp )
+inline void SwSetExpFieldType::SetType( sal_uInt16 nTyp )
{
nType = nTyp;
EnableFormat( !(nType & (nsSwGetSetExpType::GSE_SEQ|nsSwGetSetExpType::GSE_STRING)));
}
-inline USHORT SwSetExpFieldType::GetType() const
+inline sal_uInt16 SwSetExpFieldType::GetType() const
{ return nType; }
inline const String& SwSetExpFieldType::GetSetRefName() const
@@ -211,18 +211,18 @@ class SW_DLLPUBLIC SwSetExpField : public SwFormulaField
String sExpand;
String aPText;
String aSeqText;
- BOOL bInput;
- USHORT nSeqNo;
- USHORT nSubType;
+ sal_Bool bInput;
+ sal_uInt16 nSeqNo;
+ sal_uInt16 nSubType;
+
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
public:
- SwSetExpField(SwSetExpFieldType*, const String& rFormel, ULONG nFmt = 0);
+ SwSetExpField(SwSetExpFieldType*, const String& rFormel, sal_uLong nFmt = 0);
virtual void SetValue( const double& rVal );
- virtual String Expand() const;
- virtual SwField* Copy() const;
-
inline const String& GetExpStr() const;
inline void ChgExpStr( const String& rExpand );
@@ -230,18 +230,19 @@ public:
inline void SetPromptText(const String& rStr);
inline const String& GetPromptText() const;
- inline void SetInputFlag(BOOL bInp);
- inline BOOL GetInputFlag() const;
+ inline void SetInputFlag(sal_Bool bInp);
+ inline sal_Bool GetInputFlag() const;
+
+ virtual String GetFieldName() const;
- virtual String GetCntnt(BOOL bName = FALSE) const;
- virtual USHORT GetSubType() const;
- virtual void SetSubType(USHORT nType);
+ virtual sal_uInt16 GetSubType() const;
+ virtual void SetSubType(sal_uInt16 nType);
- inline BOOL IsSequenceFld() const;
+ inline sal_Bool IsSequenceFld() const;
// Logical number, sequence fields.
- inline void SetSeqNumber( USHORT n ) { nSeqNo = n; }
- inline USHORT GetSeqNumber() const { return nSeqNo; }
+ inline void SetSeqNumber( sal_uInt16 n ) { nSeqNo = n; }
+ inline sal_uInt16 GetSeqNumber() const { return nSeqNo; }
// Query name only.
virtual const String& GetPar1() const;
@@ -249,8 +250,8 @@ public:
// Query formula.
virtual String GetPar2() const;
virtual void SetPar2(const String& rStr);
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
- virtual bool PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
};
inline const String& SwSetExpField::GetExpStr() const
@@ -265,13 +266,13 @@ inline void SwSetExpField::SetPromptText(const String& rStr)
inline const String& SwSetExpField::GetPromptText() const
{ return aPText; }
-inline void SwSetExpField::SetInputFlag(BOOL bInp)
+inline void SwSetExpField::SetInputFlag(sal_Bool bInp)
{ bInput = bInp; }
-inline BOOL SwSetExpField::GetInputFlag() const
+inline sal_Bool SwSetExpField::GetInputFlag() const
{ return bInput; }
-inline BOOL SwSetExpField::IsSequenceFld() const
+inline sal_Bool SwSetExpField::IsSequenceFld() const
{ return 0 != (nsSwGetSetExpType::GSE_SEQ & ((SwSetExpFieldType*)GetTyp())->GetType()); }
@@ -293,16 +294,18 @@ class SW_DLLPUBLIC SwInputField : public SwField
String aPText;
String aHelp;
String aToolTip;
- USHORT nSubType;
+ sal_uInt16 nSubType;
+
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
// Direct input via dialog; delete old value.
SwInputField(SwInputFieldType*, const String& rContent ,
- const String& rPrompt, USHORT nSubType = 0,
- ULONG nFmt = 0);
+ const String& rPrompt, sal_uInt16 nSubType = 0,
+ sal_uLong nFmt = 0);
- virtual String GetCntnt(BOOL bName = FALSE) const;
- virtual String Expand() const;
- virtual SwField* Copy() const;
+ virtual String GetFieldName() const;
// Content
virtual const String& GetPar1() const;
@@ -318,12 +321,12 @@ public:
virtual String GetToolTip() const;
virtual void SetToolTip(const String & rStr);
- virtual BOOL isFormField() const;
+ virtual sal_Bool isFormField() const;
- virtual USHORT GetSubType() const;
- virtual void SetSubType(USHORT nSub);
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
- virtual bool PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
+ virtual sal_uInt16 GetSubType() const;
+ virtual void SetSubType(sal_uInt16 nSub);
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
};
/*--------------------------------------------------------------------
@@ -333,20 +336,20 @@ public:
class SwInputFieldList
{
public:
- SwInputFieldList( SwEditShell* pShell, BOOL bBuildTmpLst = FALSE );
+ SwInputFieldList( SwEditShell* pShell, sal_Bool bBuildTmpLst = sal_False );
~SwInputFieldList();
- USHORT Count() const;
- SwField* GetField(USHORT nId);
+ sal_uInt16 Count() const;
+ SwField* GetField(sal_uInt16 nId);
- void GotoFieldPos(USHORT nId);
+ void GotoFieldPos(sal_uInt16 nId);
void PushCrsr();
void PopCrsr();
// Put all that are new into SortLst for updating. Returns count.
// (For Glossary: only update its input-fields).
// Compare TmpLst with current fields.
- USHORT BuildSortLst();
+ sal_uInt16 BuildSortLst();
void RemoveUnselectedFlds();
@@ -368,36 +371,39 @@ public:
class SwTblField : public SwValueField, public SwTableFormula
{
String sExpand;
- USHORT nSubType;
+ sal_uInt16 nSubType;
+
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
// Search TextNode containing the field.
virtual const SwNode* GetNodeOfFormula() const;
+ String GetCommand();
+
public:
SwTblField( SwTblFieldType*, const String& rFormel,
- USHORT nSubType = 0, ULONG nFmt = 0);
+ sal_uInt16 nSubType = 0, sal_uLong nFmt = 0);
virtual void SetValue( const double& rVal );
- virtual USHORT GetSubType() const;
- virtual void SetSubType(USHORT nType);
- virtual String Expand() const;
- virtual SwField* Copy() const;
+ virtual sal_uInt16 GetSubType() const;
+ virtual void SetSubType(sal_uInt16 nType);
const String& GetExpStr() const { return sExpand; }
void ChgExpStr(const String& rStr) { sExpand = rStr; }
void CalcField( SwTblCalcPara& rCalcPara );
- virtual String GetCntnt(BOOL bName = FALSE) const;
+ virtual String GetFieldName() const;
// The formula.
virtual String GetPar2() const;
virtual void SetPar2(const String& rStr);
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
- virtual bool PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
};
-#endif // _EXPFLD_HXX
+#endif // SW_EXPFLD_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */