summaryrefslogtreecommitdiff
path: root/oovbaapi
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2022-11-09 17:02:03 -0500
committerMiklos Vajna <vmiklos@collabora.com>2022-11-21 11:25:41 +0100
commita76cf059f0f99b216b3c54f9b8613999b69bf804 (patch)
tree799f6c6f0c62bf845f8f8754025f761ebd764b19 /oovbaapi
parent709973084ef694f98076e6d4cbac7135722a8517 (diff)
tdf#151548 vba FormFields: Add basic word::XFormField support
Squashed commit including followups from various people. Unit tests will come in the following commits that represent actual FormFields that have content/results. This lays the foundation for adding Checkboxes, Textinputs, and Dropdowns. Change-Id: If85ae25f881198d5a0699b3350a7eb20b1735c45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142507 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com> private field 'm_xModel' is not used [-Werror,-Wunused-private-field] ever since commit 2a26f136a36791c06caa895d5a25f4633fd10651 Author: Justin Luth <justin.luth@collabora.com> Date: Wed Nov 9 17:02:03 2022 -0500 tdf#151548 vba FormFields: Add basic word::XFormField support Plus, this code is std::move'ing a value into a "&" field, which is very wrong Change-Id: Ia8bbf6e0eaa524ca0f5bbf7624f4b9555920f993 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142545 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Fix typos Change-Id: Id924e4747d6a3d81b69da28910c8e096565b9b68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142538 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Clean up some seeming copy/paste mistakes ...all introduced with 2a26f136a36791c06caa895d5a25f4633fd10651 "tdf#151548 vba FormFields: Add basic word::XFormField support": For the SwVbaFormField ctor, std::move of a const lvalue has no effect here. (And I just don't bother applying the move-from-pass-by-value-param optimization here.) For FormFieldCollectionHelper, consistently make the data members non-const (a const css::uno::Reference wouldn't make that much sense anyway, as it doesn't transitively apply const'ness also to the referenced object) and non-reference, and make the FormFieldCollectionHelper params non-const (and non-reference) to make the move-from-pass-by-value-param optimization actually work here. (I came across this code with an upcoming loplugin:constmove that flags suspicious uses of std::move involving const-qualified types.) Change-Id: Ib41d4671b33871eddff41bc20ea38de02d616046 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142568 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142644 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'oovbaapi')
-rw-r--r--oovbaapi/ooo/vba/word/XFormField.idl50
-rw-r--r--oovbaapi/ooo/vba/word/XFormFields.idl7
2 files changed, 55 insertions, 2 deletions
diff --git a/oovbaapi/ooo/vba/word/XFormField.idl b/oovbaapi/ooo/vba/word/XFormField.idl
index f8a4f411d44f..2b879fb6c652 100644
--- a/oovbaapi/ooo/vba/word/XFormField.idl
+++ b/oovbaapi/ooo/vba/word/XFormField.idl
@@ -27,12 +27,60 @@ module ooo { module vba { module word {
interface XFormField
{
interface ooo::vba::XHelperInterface;
+ interface com::sun::star::script::XDefaultProperty;
+ /// Default member: returns the field type from WdFieldType
+ [attribute, readonly] long Type;
+
+ /**
+ * Returns or sets true if references to the specified form field
+ * are automatically updated whenever the field is exited.
+ */
+ [attribute] boolean CalculateOnExit;
+ /// Returns or sets a string that represents the result of the specified form field
[attribute] string Result;
+ /// Returns or sets true if a form field is enabled
[attribute] boolean Enabled;
+ /// Returns or sets the macro name that runs on keyboard (tab) navigation into the field
+ [attribute] string EntryMacro;
+ /// Returns or sets an exit macro name that runs on keyboard (tab) navigation out of the field
+ [attribute] string ExitMacro;
+ /**
+ * Returns or sets the text that's displayed in a message box
+ * when the form field has the focus and the user presses F1.
+ *
+ * When OwnHelp is False, HelpText specifies the name of an AutoText entry
+ * that contains help text for the form field
+ */
+ [attribute] string HelpText;
+ /**
+ * Returns or sets the specifies the source of the F1 text that's displayed in a message box
+ * If True, the text specified by the HelpText property is displayed.
+ * If False, the text in the AutoText entry specified by the HelpText property is displayed.
+ */
+ [attribute] boolean OwnHelp;
+ /// returns or sets the name of the specified object.
+ [attribute] string Name;
+ /// Returns or sets the text that is displayed in the status bar when a form field has the focus
+ [attribute] string StatusText;
+ /** OwnStatus:
+ * If True, the text specified by the StatusText property is displayed.
+ * If False, the text of the AutoText entry specified by the StatusText property is displayed.
+ */
+ [attribute] boolean OwnStatus;
any CheckBox();
-
+ any DropDown();
+ any TextInput();
+ /// Returns the next form field in the collection.
+ any Next();
+ /// returns the previous form field in the collection.
+ any Previous();
+ /**
+ * Represents a contiguous area in a document.
+ * Each Range object is defined by a starting and ending character position.
+ */
+ any Range();
};
}; }; };
diff --git a/oovbaapi/ooo/vba/word/XFormFields.idl b/oovbaapi/ooo/vba/word/XFormFields.idl
index 42191375955e..4d266909cb77 100644
--- a/oovbaapi/ooo/vba/word/XFormFields.idl
+++ b/oovbaapi/ooo/vba/word/XFormFields.idl
@@ -28,10 +28,15 @@
module ooo { module vba { module word {
-
+interface XFormField;
interface XFormFields
{
interface ::ooo::vba::XCollection;
+
+ ///Returns and sets if shading is applied to form XFormFields
+ [attribute] boolean Shaded;
+ /// Returns a FormField object that represents a new WdFieldType added at a range
+ //XFormField Add( [in] any Range, [in] long Type ) raises ( com::sun::star::script::BasicErrorException );
};
}; }; };