22#include <libxml/xmlwriter.h>
131 rAny <<= static_cast<sal_Int32>(
GetFormat());
144 if(*o3tl::doAccess<bool>(rAny))
150 if(*o3tl::doAccess<bool>(rAny))
170 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwUserField"));
171 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nSubType"), BAD_CAST(OString::number(
m_nSubType).getStr()));
173 (void)xmlTextWriterEndElement(pWriter);
219 if (rHint.
GetId() == SfxHintId::SwLegacyModify)
222 if (!pLegacy->m_pOld && !pLegacy->m_pNew)
226 CallSwClientNotify(rHint);
228 if (!IsModifyLocked())
241 if(!rCalc.
Push(
this ))
287 OUString sFormattedValue;
288 const Color* pCol =
nullptr;
293 return sFormattedValue;
310 if (
GetDoc()->IsNumberFormat(rStr, nFormat, fValue))
313 LanguageTag aContentLanguage(GetFieldTypeLanguage());
354 LanguageTag aContentLanguage(GetFieldTypeLanguage());
363 if(*o3tl::doAccess<bool>(rAny))
389 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwUserFieldType"));
390 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nValue"), BAD_CAST(OString::number(
m_nValue).getStr()));
391 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"aContent"), BAD_CAST(
m_aContent.toUtf8().getStr()));
392 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"aContentLang"), BAD_CAST(
m_aContentLang.toUtf8().getStr()));
394 (void)xmlTextWriterEndElement(pWriter);
const LanguageTag & getLanguageTag() const
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual void SetModified()=0
Must be called manually at changes of format.
virtual bool IsModified() const =0
Changes of document?
LanguageType getLanguageType(bool bResolveSystem=true) const
const OUString & getBcp47(bool bResolveSystem=true) const
void SetCalcError(SwCalcError eErr)
const CharClass * GetCharClass() const
void SetCharClass(const LanguageTag &rLanguageTag)
SwSbxValue Calculate(const OUString &rStr)
bool Push(const SwUserFieldType *pUserFieldType)
IDocumentState const & getIDocumentState() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
virtual void UpdateFields()
virtual OUString GetName() const
Only in derived classes.
static const OUString & GetTypeStr(SwFieldTypesEnum nTypeId)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
bool IsAutomaticLanguage() const
void SetFormat(sal_uInt32 const nSet)
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhichId) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhichId)
SwFieldType * GetTyp() const
LanguageType GetLanguage() const
Language at field position.
const OUString & GetTitle() const
The root element of a Writer document layout.
The shared part of a user field.
OUString m_aContentLang
Language used by m_aContents.
OUString Expand(sal_uInt32 nFormat, sal_uInt16 nSubType, LanguageType nLng)
virtual OUString GetName() const override
Only in derived classes.
void SetValue(const double nVal)
OUString GetContent(sal_uInt32 nFormat=0) const
virtual void QueryValue(css::uno::Any &rVal, sal_uInt16 nMId) const override
void dumpAsXml(xmlTextWriterPtr pWriter) const override
OUString m_aContent
String value type.
void SetContent(const OUString &rStr, sal_uInt32 nFormat=0)
virtual void PutValue(const css::uno::Any &rVal, sal_uInt16 nMId) override
virtual std::unique_ptr< SwFieldType > Copy() const override
double m_nValue
Float value type.
OUString GetInputOrDateTime(sal_uInt32 nFormat) const
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
SwUserFieldType(SwDoc *pDocPtr, const OUString &)
virtual OUString GetPar2() const override
Get content.
virtual sal_uInt16 GetSubType() const override
virtual OUString GetPar1() const override
Get name.
virtual double GetValue() const override
virtual void SetSubType(sal_uInt16 nSub) override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhichId) const override
void dumpAsXml(xmlTextWriterPtr pWriter) const override
SwUserField(SwUserFieldType *, sal_uInt16 nSub, sal_uInt32 nFormat)
virtual std::unique_ptr< SwField > Copy() const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhichId) override
virtual OUString GetFieldName() const override
get name or content
virtual void SetValue(const double &rVal) override
virtual void SetPar2(const OUString &rStr) override
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Fields containing values that have to be formatted via number formatter.
OUString ExpandValue(const double &rVal, sal_uInt32 nFormat, LanguageType nLng) const
return value formatted as string
OUString DoubleToString(const double &rVal, LanguageType eLng) const
void EnableFormat(bool bFormat=true)
void dumpAsXml(xmlTextWriterPtr pWriter) const override
struct _xmlTextWriter * xmlTextWriterPtr
virtual OUString GetName() const override
const SwExtendedSubType SUB_CMD
Show command.
const SwExtendedSubType SUB_INVISIBLE
Invisible.
const SwGetSetExpType GSE_EXPR
Expression.
const SwGetSetExpType GSE_STRING
String.
#define FIELD_PROP_FORMAT
#define FIELD_PROP_DOUBLE