LibreOffice Module sw (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
sw::DocumentFieldsManager Class Referencefinal

#include <DocumentFieldsManager.hxx>

Inheritance diagram for sw::DocumentFieldsManager:
[legend]
Collaboration diagram for sw::DocumentFieldsManager:
[legend]

Public Member Functions

 DocumentFieldsManager (SwDoc &i_rSwdoc)
 
virtual const SwFieldTypesGetFieldTypes () const override
 
virtual SwFieldTypeInsertFieldType (const SwFieldType &) override
 Insert field types. More...
 
virtual SwFieldTypeGetSysFieldType (const SwFieldIds eWhich) const override
 
virtual SwFieldTypeGetFieldType (SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const override
 Find first type with ResId and name. More...
 
virtual void RemoveFieldType (size_t nField) override
 Remove field type. More...
 
virtual void UpdateFields (bool bCloseDB) override
 
virtual void InsDeletedFieldType (SwFieldType &) override
 
virtual void PutValueToField (const SwPosition &rPos, const css::uno::Any &rVal, sal_uInt16 nWhich) override
 Puts a value into a field at a certain position. More...
 
virtual bool UpdateField (SwTextField *rDstFormatField, SwField &rSrcField, bool bUpdateTableFields) override
 Updates a field. More...
 
virtual void UpdateRefFields () override
 Update reference and table fields. More...
 
virtual void UpdateTableFields (const SwTable *pTable) override
 
virtual void UpdateExpFields (SwTextField *pField, bool bUpdateRefFields) override
 
virtual void UpdateUsrFields () override
 Insert field type that was marked as deleted. More...
 
virtual void UpdatePageFields (const SwTwips) override
 
virtual void LockExpFields () override
 
virtual void UnlockExpFields () override
 
virtual bool IsExpFieldsLocked () const override
 
virtual SwDocUpdateFieldGetUpdateFields () const override
 
virtual bool SetFieldsDirty (bool b, const SwNode *pChk, SwNodeOffset nLen) override
 
virtual void SetFixFields (const DateTime *pNewDateTime) override
 
virtual void FieldsToCalc (SwCalc &rCalc, SwNodeOffset nLastNd, sal_Int32 nLastCnt) override
 
virtual void FieldsToCalc (SwCalc &rCalc, const SetGetExpField &rToThisField, SwRootFrame const *pLayout) override
 
virtual void FieldsToExpand (SwHashTable< HashStr > &rTable, const SetGetExpField &rToThisField, SwRootFrame const &rLayout) override
 
virtual bool IsNewFieldLst () const override
 
virtual void SetNewFieldLst (bool bFlag) override
 
virtual void InsDelFieldInFieldLst (bool bIns, const SwTextField &rField) override
 
virtual sal_Int32 GetRecordsPerDocument () const override
 
bool containsUpdatableFields ()
 
void GCFieldTypes ()
 Remove all unreferenced field types of a document. More...
 
void InitFieldTypes ()
 
void ClearFieldTypes ()
 
void UpdateDBNumFields (SwDBNameInfField &rDBField, SwCalc &rCalc)
 
virtual ~DocumentFieldsManager () override
 
virtual const SwFieldTypesGetFieldTypes () const =0
 
virtual SwFieldTypeInsertFieldType (const SwFieldType &)=0
 
virtual SwFieldTypeGetSysFieldType (const SwFieldIds eWhich) const =0
 
virtual SwFieldTypeGetFieldType (SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
 
virtual void RemoveFieldType (size_t nField)=0
 
virtual void UpdateFields (bool bCloseDB)=0
 
virtual void InsDeletedFieldType (SwFieldType &)=0
 
virtual void PutValueToField (const SwPosition &rPos, const css::uno::Any &rVal, sal_uInt16 nWhich)=0
 Puts a value into a field at a certain position. More...
 
virtual bool UpdateField (SwTextField *rDstFormatField, SwField &rSrcField, bool bUpdateTableFields)=0
 Updates a field. More...
 
virtual void UpdateRefFields ()=0
 
virtual void UpdateTableFields (const SwTable *pTable)=0
 
virtual void UpdateExpFields (SwTextField *pField, bool bUpdateRefFields)=0
 
virtual void UpdateUsrFields ()=0
 
virtual void UpdatePageFields (const SwTwips)=0
 
virtual void LockExpFields ()=0
 
virtual void UnlockExpFields ()=0
 
virtual bool IsExpFieldsLocked () const =0
 
virtual SwDocUpdateFieldGetUpdateFields () const =0
 
virtual bool SetFieldsDirty (bool b, const SwNode *pChk, SwNodeOffset nLen)=0
 
virtual void SetFixFields (const DateTime *pNewDateTime)=0
 
virtual void FieldsToCalc (SwCalc &rCalc, SwNodeOffset nLastNd, sal_Int32 nLastCnt)=0
 
virtual void FieldsToCalc (SwCalc &rCalc, const SetGetExpField &rToThisField, SwRootFrame const *pLayout)=0
 
virtual void FieldsToExpand (SwHashTable< HashStr > &rTable, const SetGetExpField &rToThisField, SwRootFrame const &rLayout)=0
 
virtual bool IsNewFieldLst () const =0
 
virtual void SetNewFieldLst (bool bFlag)=0
 
virtual void InsDelFieldInFieldLst (bool bIns, const SwTextField &rField)=0
 
virtual sal_Int32 GetRecordsPerDocument () const =0
 

Static Public Member Functions

static SwFieldGetFieldAtPos (const SwPosition &rPos)
 Returns the field at a certain position. More...
 
static SwTextFieldGetTextFieldAtPos (const SwPosition &rPos)
 Returns the field at a certain position. More...
 

Private Member Functions

 DocumentFieldsManager (DocumentFieldsManager const &)=delete
 
DocumentFieldsManageroperator= (DocumentFieldsManager const &)=delete
 
void UpdateExpFieldsImpl (SwTextField *pField, SwRootFrame const *pLayout)
 

Private Attributes

SwDocm_rDoc
 
bool mbNewFieldLst
 
std::unique_ptr< SwDocUpdateFieldmpUpdateFields
 
std::unique_ptr< SwFieldTypesmpFieldTypes
 
sal_Int8 mnLockExpField
 

Additional Inherited Members

- Protected Member Functions inherited from IDocumentFieldsAccess
virtual ~IDocumentFieldsAccess ()
 

Detailed Description

Definition at line 31 of file DocumentFieldsManager.hxx.

Constructor & Destructor Documentation

◆ DocumentFieldsManager() [1/2]

sw::DocumentFieldsManager::DocumentFieldsManager ( SwDoc i_rSwdoc)

Definition at line 190 of file DocumentFieldsManager.cxx.

◆ ~DocumentFieldsManager()

sw::DocumentFieldsManager::~DocumentFieldsManager ( )
overridevirtual

Definition at line 1789 of file DocumentFieldsManager.cxx.

References mpFieldTypes, and mpUpdateFields.

◆ DocumentFieldsManager() [2/2]

sw::DocumentFieldsManager::DocumentFieldsManager ( DocumentFieldsManager const &  )
privatedelete

Member Function Documentation

◆ ClearFieldTypes()

void sw::DocumentFieldsManager::ClearFieldTypes ( )

Definition at line 1746 of file DocumentFieldsManager.cxx.

References INIT_FLDTYPES, and mpFieldTypes.

Referenced by SwDoc::ClearDoc().

◆ containsUpdatableFields()

bool sw::DocumentFieldsManager::containsUpdatableFields ( )
Note
For simplicity assume that all field types have updatable contents so optimization currently only available when no fields exist.

Definition at line 1676 of file DocumentFieldsManager.cxx.

References mpFieldTypes.

◆ FieldsToCalc() [1/2]

void sw::DocumentFieldsManager::FieldsToCalc ( SwCalc rCalc,
const SetGetExpField rToThisField,
SwRootFrame const *  pLayout 
)
overridevirtual

◆ FieldsToCalc() [2/2]

void sw::DocumentFieldsManager::FieldsToCalc ( SwCalc rCalc,
SwNodeOffset  nLastNd,
sal_Int32  nLastCnt 
)
overridevirtual

◆ FieldsToExpand()

void sw::DocumentFieldsManager::FieldsToExpand ( SwHashTable< HashStr > &  rTable,
const SetGetExpField rToThisField,
SwRootFrame const &  rLayout 
)
overridevirtual

◆ GCFieldTypes()

void sw::DocumentFieldsManager::GCFieldTypes ( )

Remove all unreferenced field types of a document.

Definition at line 1689 of file DocumentFieldsManager.cxx.

References INIT_FLDTYPES, mpFieldTypes, n, and RemoveFieldType().

Referenced by SwFEShell::Copy().

◆ GetFieldAtPos()

SwField * sw::DocumentFieldsManager::GetFieldAtPos ( const SwPosition rPos)
static

Returns the field at a certain position.

Parameters
rPosposition to search at
Returns
pointer to field at the given position or NULL in case no field is found

Definition at line 1658 of file DocumentFieldsManager.cxx.

References SwFormatField::GetField(), SwTextAttr::GetFormatField(), and GetTextFieldAtPos().

Referenced by SwUndoFieldFromAPI::DoImpl(), PutValueToField(), and SwUndoFieldFromAPI::UndoImpl().

◆ GetFieldType()

SwFieldType * sw::DocumentFieldsManager::GetFieldType ( SwFieldIds  nResId,
const OUString &  rName,
bool  bDbFieldMatching 
) const
overridevirtual

◆ GetFieldTypes()

const SwFieldTypes * sw::DocumentFieldsManager::GetFieldTypes ( ) const
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 198 of file DocumentFieldsManager.cxx.

References mpFieldTypes.

◆ GetRecordsPerDocument()

sal_Int32 sw::DocumentFieldsManager::GetRecordsPerDocument ( ) const
overridevirtual

◆ GetSysFieldType()

SwFieldType * sw::DocumentFieldsManager::GetSysFieldType ( const SwFieldIds  eWhich) const
overridevirtual
Returns
the field type of the Doc

Implements IDocumentFieldsAccess.

Definition at line 283 of file DocumentFieldsManager.cxx.

References i, INIT_FLDTYPES, and mpFieldTypes.

Referenced by SetFixFields().

◆ GetTextFieldAtPos()

SwTextField * sw::DocumentFieldsManager::GetTextFieldAtPos ( const SwPosition rPos)
static

Returns the field at a certain position.

Parameters
rPosposition to search at
Returns
pointer to field at the given position or NULL in case no field is found

Definition at line 1665 of file DocumentFieldsManager.cxx.

References sw::Default, SwPosition::GetContentIndex(), SwTextNode::GetFieldTextAttrAt(), SwPosition::GetNode(), and SwNode::GetTextNode().

Referenced by SwDoc::ConvertFieldsToText(), SwUndoFieldFromDoc::DoImpl(), GetFieldAtPos(), and SwUndoFieldFromDoc::UndoImpl().

◆ GetUpdateFields()

SwDocUpdateField & sw::DocumentFieldsManager::GetUpdateFields ( ) const
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 1318 of file DocumentFieldsManager.cxx.

References mpUpdateFields.

Referenced by SetFieldsDirty().

◆ InitFieldTypes()

void sw::DocumentFieldsManager::InitFieldTypes ( )

◆ InsDeletedFieldType()

void sw::DocumentFieldsManager::InsDeletedFieldType ( SwFieldType rFieldTyp)
overridevirtual

◆ InsDelFieldInFieldLst()

void sw::DocumentFieldsManager::InsDelFieldInFieldLst ( bool  bIns,
const SwTextField rField 
)
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 1652 of file DocumentFieldsManager.cxx.

References SwDoc::IsInDtor(), m_rDoc, mbNewFieldLst, and mpUpdateFields.

◆ InsertFieldType()

SwFieldType * sw::DocumentFieldsManager::InsertFieldType ( const SwFieldType rFieldTyp)
overridevirtual

◆ IsExpFieldsLocked()

bool sw::DocumentFieldsManager::IsExpFieldsLocked ( ) const
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 1313 of file DocumentFieldsManager.cxx.

References mnLockExpField.

Referenced by UpdateExpFields(), and UpdateFields().

◆ IsNewFieldLst()

bool sw::DocumentFieldsManager::IsNewFieldLst ( ) const
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 1642 of file DocumentFieldsManager.cxx.

References mbNewFieldLst.

◆ LockExpFields()

void sw::DocumentFieldsManager::LockExpFields ( )
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 1301 of file DocumentFieldsManager.cxx.

References mnLockExpField.

◆ operator=()

DocumentFieldsManager & sw::DocumentFieldsManager::operator= ( DocumentFieldsManager const &  )
privatedelete

◆ PutValueToField()

void sw::DocumentFieldsManager::PutValueToField ( const SwPosition rPos,
const css::uno::Any &  rVal,
sal_uInt16  nWhich 
)
overridevirtual

Puts a value into a field at a certain position.

A missing field at the given position leads to a failure.

Parameters
rPositionposition of the field
rValthe value
nMId
Return values
trueputting of value was successful
falseelse

Implements IDocumentFieldsAccess.

Definition at line 478 of file DocumentFieldsManager.cxx.

References Any, GetFieldAtPos(), SwDoc::GetIDocumentUndoRedo(), m_rDoc, SwField::PutValue(), and SwField::QueryValue().

◆ RemoveFieldType()

void sw::DocumentFieldsManager::RemoveFieldType ( size_t  nField)
overridevirtual

◆ SetFieldsDirty()

bool sw::DocumentFieldsManager::SetFieldsDirty ( bool  b,
const SwNode pChk,
SwNodeOffset  nLen 
)
overridevirtual

◆ SetFixFields()

void sw::DocumentFieldsManager::SetFixFields ( const DateTime pNewDateTime)
overridevirtual

◆ SetNewFieldLst()

void sw::DocumentFieldsManager::SetNewFieldLst ( bool  bFlag)
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 1647 of file DocumentFieldsManager.cxx.

References mbNewFieldLst.

Referenced by UpdatePageFields().

◆ UnlockExpFields()

void sw::DocumentFieldsManager::UnlockExpFields ( )
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 1306 of file DocumentFieldsManager.cxx.

References mnLockExpField.

◆ UpdateDBNumFields()

void sw::DocumentFieldsManager::UpdateDBNumFields ( SwDBNameInfField rDBField,
SwCalc rCalc 
)

◆ UpdateExpFields()

void sw::DocumentFieldsManager::UpdateExpFields ( SwTextField pField,
bool  bUpdateRefFields 
)
overridevirtual

◆ UpdateExpFieldsImpl()

void sw::DocumentFieldsManager::UpdateExpFieldsImpl ( SwTextField pField,
SwRootFrame const *  pLayout 
)
private

Definition at line 849 of file DocumentFieldsManager.cxx.

References HashStr::aSetStr, SwSection::CalcHiddenFlag(), SwCalc::Calculate(), SwGetExpField::ChgExpStr(), SwSetExpField::ChgExpStr(), SwDBManager::CloseAll(), Database, DatabaseSetNumber, DbNextSet, DbNumSet, DbSetNumber, SwNode::EndOfSectionNode(), SwDBField::Evaluate(), SwDBSetNumberField::Evaluate(), SwHiddenTextField::Evaluate(), Expand, SwField::ExpandField(), SwDBManager::FillCalcWithMergeData(), SwHashTable< T >::Find(), SwFormatField::ForceUpdateTextNode(), SwSbxValue::GetBool(), SwSection::GetCondition(), SwDoc::GetDBManager(), SwSbxValue::GetDouble(), SwNodes::GetEndOfContent(), GetExp, SwSetExpField::GetExpStr(), SwFormatField::GetField(), SwTextAttr::GetFormatField(), SwFormulaField::GetFormula(), sw::mark::IBookmark::GetHideCondition(), SwDoc::getIDocumentRedlineAccess(), SwNodeIndex::GetIndex(), SwNode::GetIndex(), LocaleDataWrapper::getLanguageTag(), LanguageTag::getLanguageType(), SvtSysLocale::GetLocaleData(), SwFieldType::GetName(), SwSetExpFieldType::GetName(), SwNodeIndex::GetNode(), SwDoc::GetNodes(), SwDoc::GetNumberFormatter(), SwSetExpFieldType::GetOutlineLvl(), SwHiddenTextField::GetPar1(), SwHiddenParaField::GetPar1(), SwSectionFormat::GetParent(), SwSectionFormat::GetSection(), SwSectionFormat::GetSectionNode(), SwDoc::GetSections(), SwDBManager::GetSelectedRecordId(), SwDBSetNumberField::GetSetNumber(), SwField::GetSubType(), SwField::GetTyp(), SwFieldType::GetTypeStr(), nsSwGetSetExpType::GSE_STRING, HiddenPara, HiddenText, sw::mark::IBookmark::Hide(), SwCalc::IsCalcError(), SwDoc::IsClipBoard(), SwSection::IsCondHidden(), SwDBManager::IsDataSourceOpen(), SwRootFrame::IsHideRedlines(), SwGetExpField::IsInBodyText(), SwNode::IsSectionNode(), SwSetExpField::IsSequenceField(), SwSbxValue::IsVoidValue(), LANGUAGE_SYSTEM, SwTextInputField::LockNotifyContentChange(), LookString(), m_rDoc, MAXLEVEL, mpFieldTypes, mpUpdateFields, n, SwDBData::nCommandType, nLang, nPos, SbxValue::PutString(), SwDBData::sCommand, SwDBData::sDataSource, SwSetExpFieldType::SetChapter(), SwSection::SetCondHidden(), SwSection::SetCondition(), SetExp, SwHiddenParaField::SetHidden(), SwHiddenTextField::SetValue(), SwGetExpField::SetValue(), SwSetExpField::SetValue(), SwVectorModifyBase< Value >::size(), SwNode::StartOfSectionIndex(), SwTextInputField::UnlockNotifyContentChange(), UpdateDBNumFields(), User, value, SwCalc::VarChange(), and SwFieldType::Which().

Referenced by UpdateExpFields().

◆ UpdateField()

bool sw::DocumentFieldsManager::UpdateField ( SwTextField rDstFormatField,
SwField rSrcField,
bool  bUpdateTableFields 
)
overridevirtual

◆ UpdateFields()

void sw::DocumentFieldsManager::UpdateFields ( bool  bCloseDB)
overridevirtual

◆ UpdatePageFields()

void sw::DocumentFieldsManager::UpdatePageFields ( const SwTwips  nDocPos)
overridevirtual

◆ UpdateRefFields()

void sw::DocumentFieldsManager::UpdateRefFields ( )
overridevirtual

Update reference and table fields.

Implements IDocumentFieldsAccess.

Definition at line 587 of file DocumentFieldsManager.cxx.

References GetRef, and mpFieldTypes.

Referenced by UpdateExpFields(), and UpdateFields().

◆ UpdateTableFields()

void sw::DocumentFieldsManager::UpdateTableFields ( const SwTable pTable)
overridevirtual

◆ UpdateUsrFields()

void sw::DocumentFieldsManager::UpdateUsrFields ( )
overridevirtual

Insert field type that was marked as deleted.

Implements IDocumentFieldsAccess.

Definition at line 1227 of file DocumentFieldsManager.cxx.

References SwDoc::getIDocumentState(), SwUserFieldType::GetValue(), i, INIT_FLDTYPES, m_rDoc, mpFieldTypes, IDocumentState::SetModified(), User, and SwFieldType::Which().

Referenced by UpdateField().

Member Data Documentation

◆ m_rDoc

SwDoc& sw::DocumentFieldsManager::m_rDoc
private

◆ mbNewFieldLst

bool sw::DocumentFieldsManager::mbNewFieldLst
private

◆ mnLockExpField

sal_Int8 sw::DocumentFieldsManager::mnLockExpField
private

Definition at line 105 of file DocumentFieldsManager.hxx.

Referenced by IsExpFieldsLocked(), LockExpFields(), and UnlockExpFields().

◆ mpFieldTypes

std::unique_ptr<SwFieldTypes> sw::DocumentFieldsManager::mpFieldTypes
private

◆ mpUpdateFields

std::unique_ptr<SwDocUpdateField> sw::DocumentFieldsManager::mpUpdateFields
private

The documentation for this class was generated from the following files: