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

#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, SwMsgPoolItem *pMsgHint, bool bUpdateTableFields) override
 Updates a field. More...
 
virtual void UpdateRefFields () override
 Update reference and table fields. More...
 
virtual void UpdateTableFields (SfxPoolItem *pHt) 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 (SfxPoolItem *) 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, sal_uLong nLen) override
 
virtual void SetFixFields (const DateTime *pNewDateTime) override
 
virtual void FieldsToCalc (SwCalc &rCalc, sal_uLong nLastNd, sal_uInt16 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
 

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

sw::DocumentFieldsManager::DocumentFieldsManager ( SwDoc i_rSwdoc)

Definition at line 188 of file DocumentFieldsManager.cxx.

sw::DocumentFieldsManager::~DocumentFieldsManager ( )
overridevirtual

Definition at line 1864 of file DocumentFieldsManager.cxx.

References mpFieldTypes, and mpUpdateFields.

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

Member Function Documentation

void sw::DocumentFieldsManager::ClearFieldTypes ( )

Definition at line 1821 of file DocumentFieldsManager.cxx.

References INIT_FLDTYPES, and mpFieldTypes.

Referenced by SwDoc::ClearDoc().

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 1752 of file DocumentFieldsManager.cxx.

References SwIterator< TElementType, TSource, eMode >::First(), and mpFieldTypes.

void sw::DocumentFieldsManager::FieldsToCalc ( SwCalc rCalc,
sal_uLong  nLastNd,
sal_uInt16  nLastCnt 
)
overridevirtual
void sw::DocumentFieldsManager::FieldsToCalc ( SwCalc rCalc,
const SetGetExpField rToThisField,
SwRootFrame const *  pLayout 
)
overridevirtual
void sw::DocumentFieldsManager::FieldsToExpand ( SwHashTable< HashStr > &  rTable,
const SetGetExpField rToThisField,
SwRootFrame const &  rLayout 
)
overridevirtual
void sw::DocumentFieldsManager::GCFieldTypes ( )

Remove all unreferenced field types of a document.

Definition at line 1764 of file DocumentFieldsManager.cxx.

References INIT_FLDTYPES, mpFieldTypes, and RemoveFieldType().

Referenced by SwFEShell::Copy().

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 1734 of file DocumentFieldsManager.cxx.

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

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

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

Implements IDocumentFieldsAccess.

Definition at line 196 of file DocumentFieldsManager.cxx.

References mpFieldTypes.

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

Implements IDocumentFieldsAccess.

Definition at line 281 of file DocumentFieldsManager.cxx.

References i, INIT_FLDTYPES, and mpFieldTypes.

Referenced by SetFixFields().

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 1741 of file DocumentFieldsManager.cxx.

References SwTextNode::GetFieldTextAttrAt(), SwIndex::GetIndex(), SwNodeIndex::GetNode(), SwNode::GetTextNode(), SwPosition::nContent, and SwPosition::nNode.

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

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

Implements IDocumentFieldsAccess.

Definition at line 1395 of file DocumentFieldsManager.cxx.

References mpUpdateFields.

Referenced by SetFieldsDirty().

void sw::DocumentFieldsManager::InitFieldTypes ( )
void sw::DocumentFieldsManager::InsDeletedFieldType ( SwFieldType rFieldTyp)
overridevirtual
void sw::DocumentFieldsManager::InsDelFieldInFieldLst ( bool  bIns,
const SwTextField rField 
)
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 1728 of file DocumentFieldsManager.cxx.

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

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

Implements IDocumentFieldsAccess.

Definition at line 1390 of file DocumentFieldsManager.cxx.

References mnLockExpField.

Referenced by UpdateExpFields(), and UpdateFields().

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

Implements IDocumentFieldsAccess.

Definition at line 1718 of file DocumentFieldsManager.cxx.

References mbNewFieldLst.

void sw::DocumentFieldsManager::LockExpFields ( )
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 1378 of file DocumentFieldsManager.cxx.

References mnLockExpField.

DocumentFieldsManager& sw::DocumentFieldsManager::operator= ( DocumentFieldsManager const &  )
privatedelete
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 503 of file DocumentFieldsManager.cxx.

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

void sw::DocumentFieldsManager::RemoveFieldType ( size_t  nField)
overridevirtual
bool sw::DocumentFieldsManager::SetFieldsDirty ( bool  b,
const SwNode pChk,
sal_uLong  nLen 
)
overridevirtual
void sw::DocumentFieldsManager::SetFixFields ( const DateTime pNewDateTime)
overridevirtual
void sw::DocumentFieldsManager::SetNewFieldLst ( bool  bFlag)
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 1723 of file DocumentFieldsManager.cxx.

References mbNewFieldLst.

Referenced by UpdatePageFields().

void sw::DocumentFieldsManager::UnlockExpFields ( )
overridevirtual

Implements IDocumentFieldsAccess.

Definition at line 1383 of file DocumentFieldsManager.cxx.

References mnLockExpField.

void sw::DocumentFieldsManager::UpdateDBNumFields ( SwDBNameInfField rDBField,
SwCalc rCalc 
)
void sw::DocumentFieldsManager::UpdateExpFields ( SwTextField pField,
bool  bUpdateRefFields 
)
overridevirtual
void sw::DocumentFieldsManager::UpdateExpFieldsImpl ( SwTextField pField,
SwRootFrame const *  pLayout 
)
private

Definition at line 939 of file DocumentFieldsManager.cxx.

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

Referenced by UpdateExpFields().

bool sw::DocumentFieldsManager::UpdateField ( SwTextField rDstFormatField,
SwField rSrcField,
SwMsgPoolItem pMsgHint,
bool  bUpdateTableFields 
)
overridevirtual
void sw::DocumentFieldsManager::UpdateFields ( bool  bCloseDB)
overridevirtual
void sw::DocumentFieldsManager::UpdatePageFields ( SfxPoolItem pMsgHint)
overridevirtual
void sw::DocumentFieldsManager::UpdateRefFields ( )
overridevirtual

Update reference and table fields.

Implements IDocumentFieldsAccess.

Definition at line 619 of file DocumentFieldsManager.cxx.

References GetRef, and mpFieldTypes.

Referenced by UpdateExpFields(), and UpdateFields().

void sw::DocumentFieldsManager::UpdateTableFields ( SfxPoolItem pHt)
overridevirtual
void sw::DocumentFieldsManager::UpdateUsrFields ( )
overridevirtual

Insert field type that was marked as deleted.

Implements IDocumentFieldsAccess.

Definition at line 1304 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

SwDoc& sw::DocumentFieldsManager::m_rDoc
private
bool sw::DocumentFieldsManager::mbNewFieldLst
private
sal_Int8 sw::DocumentFieldsManager::mnLockExpField
private

Definition at line 105 of file DocumentFieldsManager.hxx.

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

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

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