20#include <config_features.h>
21#include <config_fuzzers.h>
23#include <osl/diagnose.h>
49 return o3tl::narrowing<sal_uInt16>(pFieldTypes->size());
54 for(
const auto & pFieldType : *pFieldTypes)
57 if(pFieldType->Which() == nResId)
70 return (*pFieldTypes)[nField].get();
74 for(
const auto & pFieldType : *pFieldTypes)
77 if(pFieldType->Which() == nResId)
80 return pFieldType.get();
103 const SwFieldTypes::size_type nSize = pFieldTypes->size();
108 for(SwFieldTypes::size_type
i = 0;
i < nSize; ++
i)
112 if( pFieldType->
Which() == nResId )
125 if( !pType->HasWriterListeners() )
134 pType->CallSwClientNotify(aHint);
152 bool bSuccess(
false);
156 OSL_ENSURE( bSuccess,
"Doc->Insert(Field) failed");
176 auto pFormatField =
dynamic_cast<const SwFormatField*
>(pItem);
177 if( pFormatField && pFormatField->GetField() == &rField )
179 pTField =
const_cast<SwFormatField*
>(pFormatField)->GetTextField();
185 &&
static_cast<const SwSetExpField&
>(rField).GetInputFlag() )
189 auto pFormatField =
dynamic_cast<const SwFormatField*
>(pItem);
190 if( pFormatField && pFormatField->GetField() == &rField )
192 pTField =
const_cast<SwFormatField*
>(pFormatField)->GetTextField();
217 if (pTextField !=
nullptr)
230 bool bTableSelBreak =
false;
237 if( rPaM.HasMark() && bOkay )
240 SwPaM aCurPam( *rPaM.GetMark(), *rPaM.GetPoint() );
241 SwPaM aPam( *rPaM.GetPoint() );
263 if(
nullptr != pTextField )
303 std::vector<OUString>
const * pAllDBNames )
309 const OUString& rNewName )
322#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
331#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
388 for(
const auto & pFieldType : *pFieldTypes)
392 switch(pFieldType->Which())
399 std::vector<SwFormatField*> vFields;
400 pFieldType->GatherFields(vFields);
401 return vFields.size();
OUString lowercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
virtual SwFieldType * InsertFieldType(const SwFieldType &)=0
virtual const SwFieldTypes * GetFieldTypes() const =0
virtual void LockExpFields()=0
virtual void RemoveFieldType(size_t nField)=0
virtual bool IsExpFieldsLocked() const =0
virtual bool UpdateField(SwTextField *rDstFormatField, SwField &rSrcField, bool bUpdateTableFields)=0
Updates a field.
virtual void UpdateExpFields(SwTextField *pField, bool bUpdateRefFields)=0
virtual void UnlockExpFields()=0
virtual void setFieldUpdateFlags(SwFieldUpdateFlags nMode)=0
Set the current field update mode.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual SwFieldUpdateFlags getFieldUpdateFlags(bool bGlobalSettings) const =0
Get the current field update mode.
virtual void SetModified()=0
Must be called manually at changes of format.
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
bool Pop(PopMode, ::std::optional< SwCallLink > &roLink)
static SwTextField * GetTextFieldAtPos(const SwPosition *pPos, ::sw::GetTextAttrMode eMode)
void Push()
store a copy of the current cursor on the cursor stack
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
void CloseAll(bool bIncludingMerge=true)
close all data sources - after fields were updated
SwDBData const & GetDBData()
void ChangeAuthorityData(const SwAuthEntry *pNewData)
IDocumentState const & getIDocumentState() const
SwDBManager * GetDBManager() const
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
const SwAttrPool & GetAttrPool() const
void ChgDBData(const SwDBData &rNewData)
void GetAllUsedDB(std::vector< OUString > &rDBNameList, const std::vector< OUString > *pAllDBNames=nullptr)
::sw::DocumentSettingManager & GetDocumentSettingManager()
void ChangeDBFields(const std::vector< OUString > &rOldNames, const OUString &rNewName)
bool InsertField(SwField const &, const bool bForceExpandHints)
add a field at the cursor position
void StartAllAction()
For all views of this document.
size_t GetFieldTypeCount(SwFieldIds nResId=SwFieldIds::Unknown) const
count field types with a ResId, if SwFieldIds::Unknown count all
void ChgDBData(const SwDBData &SwDBData)
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
SwDBManager * GetDBManager() const
For evaluation of DB fields (new DB-manager).
void RemoveFieldType(size_t nField)
delete field type
void ChangeAuthorityData(const SwAuthEntry *pNewData)
void SetFieldUpdateFlags(SwFieldUpdateFlags eFlags)
void FieldToText(SwFieldType const *pType)
bool IsExpFieldsLocked() const
void ChangeDBFields(const std::vector< OUString > &rOldNames, const OUString &rNewName)
SwFieldUpdateFlags GetFieldUpdateFlags() const
bool IsAnyDatabaseFieldInDoc() const
SwFieldType * GetFieldType(size_t nField, SwFieldIds nResId=SwFieldIds::Unknown) const
get field types with a ResId, if 0 get all
void UpdateOneField(SwField &)
One single field.
SwDBData const & GetDBData() const
Database information.
void GetAllUsedDB(std::vector< OUString > &rDBNameList, std::vector< OUString > const *pAllDBNames)
SwFieldType * InsertFieldType(const SwFieldType &)
insert field type
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
void SetLabelDoc(bool bFlag)
Labels: Synchronize ranges.
void UpdateExpFields(bool bCloseDB=false)
only every expression fields update
bool IsUsed(const sw::BroadcastingModify &) const
Query if the paragraph-/character-/frame-/page-style is used.
Instances of SwFields and those derived from it occur 0 to n times.
virtual OUString GetName() const
Only in derived classes.
Base class of all fields.
SwFieldType * GetTyp() const
SwFieldIds Which() const
ResId.
PaM is Point and Mark: a selection of the document model.
bool IsMultiSelection() const
const SwPosition * End() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
sal_uInt16 GetType() const
bool GetInputFlag() const
const SwFormatField & GetFormatField() const
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document setting interface.
SwRootFrame * GetLayout() const
virtual void set(DocumentSettingId id, bool value) override
Set the specified document setting.
ring_container GetRingContainer()
static SwTextField * lcl_FindInputField(SwDoc *pDoc, const SwField &rField)
Are the PaMs positioned on fields?
@ Database
For old documents the Field-Which IDs must be preserved !!!
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
CharClass & GetAppCharClass()
const SwGetSetExpType GSE_STRING
String.
bool FindAttrImpl(SwPaM &rSearchPam, const SfxPoolItem &rAttr, SwMoveFnCollection const &fnMove, const SwPaM &rRegion, bool bInReadOnly, SwRootFrame const *const pLayout)
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Marks a position in the document model.
sal_Int32 GetContentIndex() const
void AdjustContent(sal_Int32 nDelta)
Adjust content index, only valid to call this if the position points to a SwContentNode subclass.
@ FORCEHINTEXPAND
Force hint expand (only matters for hints with CH_TXTATR).