/** helper class: parses value-type and associated value attributes */ class XMLValueImportHelper final
{
SvXMLImport& rImport;
XMLTextImportHelper& rHelper;
OUString sValue; /// string value (only valid if bStringValueOK) double fValue; /// double value (only valid if bFloatValueOK)
sal_Int32 nFormatKey; /// format key (only valid of bFormatOK)
OUString sFormula; /// formula string
OUString sDefault; /// default (see bStringDefault/bFormulaDef.) bool bIsDefaultLanguage;/// format (of nFormatKey) has system language?
bool bStringType; /// is this a string (or a float) type? bool bFormatOK; /// have we read a style:data-style-name attr.? bool bStringValueOK; /// have we read a string-value attr.? bool bFormulaOK; /// have we read the formula attribute?
constbool bSetType; /// should PrepareField set the SetExp subtype? constbool bSetValue; /// should PrepareField set content/value? constbool bSetStyle; /// should PrepareField set NumberFormat? constbool bSetFormula; /// should PrepareField set Formula?
public:
XMLValueImportHelper(
SvXMLImport& rImprt, /// XML Import
XMLTextImportHelper& rHlp, /// text import helper bool bType, /// process type (PrepareField) bool bStyle, /// process data style (P.F.) bool bValue, /// process value (Prep.Field) bool bFormula); /// process formula (Prep.F.)
/** *abstractparentclassforallvariablerelatedfields *-variable-set/get/decl(not-decls), *-user-field-get/decl(not-decls), *-sequence/-decl(not-decls), *-expression, *-text-input * *Processesthefollowingattributes: *-name *-formula *-display *-value,value-type,data-style-name(viaXMLValueImportHelper) *-description. * *Eachattributehasacorrespondingmember,aboolvariabletoindicate *whetheritwassetornot,andaboolvariablewhetheritshouldbeset *usingthestandardpropertyname. * *bValidissettrue,whennameisfound! *(Mostvariablerelatedfieldsarevalid,ifanameis *found.However,somearealwaysvalid.Inthiscase,settingbValid *doesnotmatter.)
*/ class XMLVarFieldImportContext : public XMLTextFieldImportContext
{ private:
OUString sName; /// name attribute
OUString sFormula; /// formula attribute
OUString sDescription; /// description
OUString sHelp; /// help text
OUString sHint; /// hint
XMLValueImportHelper aValueHelper; /// value, value-type, and style bool bDisplayFormula; /// display formula?(rather than value) bool bDisplayNone; /// hide field?
bool bFormulaOK; /// sFormula was set bool bDescriptionOK; /// sDescription was set bool bHelpOK; /// sHelp was set bool bHintOK; /// sHint was set bool bDisplayOK; /// sDisplayFormula/-None were set
bool bSetFormula; /// set Formula property bool bSetFormulaDefault; /// use content as default for formula bool bSetDescription; /// set sDescription with Hint-property bool bSetHelp; bool bSetHint; bool bSetVisible; /// set IsVisible bool bSetDisplayFormula; /// set DisplayFormula (sub type???) bool bSetPresentation; /// set presentation frm elem. content?
public:
XMLVarFieldImportContext( // for XMLTextFieldImportContext:
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// text import helper const OUString& pServiceName, /// name of SO API service // config variables for PrepareField behavior: bool bFormula, /// set Formula property bool bFormulaDefault, /// use content as default for formula bool bDescription, /// set sDescription with Hint-property bool bHelp, bool bHint, bool bVisible, /// set IsVisible (display attr) bool bDisplayFormula, /// set ??? (display attr.) bool bType, /// set value type with ???-property bool bStyle, /// set data style (NumberFormat-Prop.) bool bValue, /// set value with Content/Value-Prop. bool bPresentation); /// set presentation from elem. content
/** *upperclassforvariable/user-set,var/user-input,andsequencefields *indsfieldmasterofappropriatetypeandattachesfieldtoit.
*/ class XMLSetVarFieldImportContext : public XMLVarFieldImportContext
{ const VarType eFieldType;
public:
XMLSetVarFieldImportContext( // for XMLTextFieldImportContext:
SvXMLImport& rImport, /// see XMLTextFieldImportContext
XMLTextImportHelper& rHlp, /// see XMLTextFieldImportContext const OUString& pServiceName, /// see XMLTextFieldImportContext // for finding appropriate field master (see endFastElement())
VarType eVarType, /// variable type // config variables: bool bFormula, /// see XMLTextFieldImportContext bool bFormulaDefault, /// see XMLTextFieldImportContext bool bDescription, /// see XMLTextFieldImportContext bool bHelp, /// see XMLTextFieldImportContext bool bHint, /// see XMLTextFieldImportContext bool bVisible, /// see XMLTextFieldImportContext bool bDisplayFormula, /// see XMLTextFieldImportContext bool bType, /// see XMLTextFieldImportContext bool bStyle, /// see XMLTextFieldImportContext bool bValue, /// see XMLTextFieldImportContext bool bPresentation); /// see XMLTextFieldImportContext
protected:
/// create XTextField, attach master and insert into document; /// also calls PrepareTextField virtualvoid SAL_CALL endFastElement(sal_Int32 nElement) override;
/** *variablefielddeclarations *(variable-decl,user-field-decl,sequence-decl)
*/ class XMLVariableDeclImportContext final : public SvXMLImportContext
{ public:
XMLVariableDeclImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// text import helper
sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList> & xAttrList,/// list of element attributes enum VarType eVarType); /// variable type
/// get field master for name and rename if appropriate staticbool FindFieldMaster(css::uno::Reference<css::beans::XPropertySet> & xMaster,
SvXMLImport& rImport,
XMLTextImportHelper& rHelper, const OUString& sVarName, enum VarType eVarType);
};
/** import table formula fields (deprecated; for Writer 2.0 compatibility) */ class XMLTableFormulaImportContext final : public XMLTextFieldImportContext
{
XMLValueImportHelper aValueHelper;
bool bIsShowFormula;
public:
XMLTableFormulaImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp); /// text import helper
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.