summaryrefslogtreecommitdiff
path: root/wizards
AgeCommit message (Collapse)Author
2022-04-18ScriptForge - (SF_Calc) new CreatePivotTable() methodJean-Pierre Ledure
Create a new pivot table with the properties defined by the arguments. If a pivot table with the same name exists already in the targeted sheet, it will be erased without warning. Parameters: PivotTableName: The user-defined name of the new pivottable SourceRange: The range as a string containing the raw data. The first row of the range is presumed to contain the field names of the new pivot table TargetCell: the top left cell or the range as a string where to locate the pivot table. Only the top left cell of the range will be considered. DataFields: A single string or an array of field name + function to apply, formatted like: Array("FieldName[;Function]", ...) The allowed functions are: Sum, Count, Average, Max, Min, Product, CountNums, StDev, StDevP, Var, VarP and Median. The default function is: When the values are all numerical, Sum is used, otherwise Count. RowFields: A single string or an array of the field names heading the pivot table rows ColumnFields: A single string or an array of the field names heading the pivot table columns FilterButton: When True (default), display a "Filter" button above the pivot table RowTotals: When True (default), display a separate column for row totals ColumnTotals: When True (default), display a separate row for column totals Returns: Return the range where the new pivot table is deployed. The method may be used in Basic and Python user scripts. Change-Id: I99df23e1b1b97b17a747ae15a079d7e2f5655b41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133131 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-04-13Update remaining DevGuide wiki links.Ilmari Lauhakangas
My Kate editor decided to do some whitespace cleanup, but maybe it's fine as the main changes are not targeting functional bits anyway. Change-Id: I5292e77e43055f94a6256a7f72d49fd59287d194 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132928 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-04-10ScriptForge - (SF_Calc) new CompactUp() and CompactLeft() methodsJean-Pierre Ledure
The CompactUp(CompactLeft) method: Delete the rows(columns) of a specified range matching a filter expressed as a formula applied on each row(column). The deleted cells can span whole rows(columns) or be limited to the width(height) of the range. The execution of the method has no effect on the current selection. Args: Range: the range in which cells have to be erased, as a string WholeRow(WholeColumn): when True (default = False), erase whole rows(columns) FilterFormula: the formula to be applied on each row(column). The row(column) is erased when the formula results in True. The formula shall probably involve one or more cells of the first row(column) of the range.. By default, a row is erased when all the cells of the row(column) are empty, i.e. suppose the range is "A1:J200" (width = 10), the default value [for CompactUp] becomes "=(COUNTBLANK(A1:J1)=10)" Returns: A string representing the location of the initial range after compaction, or the zero-length string if the whole range has been deleted. Examples for CompactUp(): newrange = oDoc.CompactUp("SheetX.G1:L10") ' All empty rows of the range are suppressed newrange = oDoc.CompactUp("SheetX.G1:L10", WholeRow := True, _ FilterFormula := "=(G1=""X"")") ' The rows having a "X" in column G are completely suppressed Both methods are available for use from Basic and Python scripts. Change-Id: Ib1269b22bcd189ca86a1bd3bda2c67e895598cb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132783 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-04-05Fix typosAndrea Gelmini
Change-Id: Idcb10d0cc0759473e95e47afec7ed69853628612 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132587 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2022-04-05ScriptForge - (SF_Utils) new _VarTypeObj() methodJean-Pierre Ledure
The method is for internal use by the ScriptForge core only. The only argument is an object with VarType() = V_OBJECT. The purpose is to inspect thoroughly the argument and to return a Type _ObjectDescriptor iVarType As Integer sObjectType As String End Type The iVarType indicates if the object is either - a UNO object => sObjectType contains the UNO type ("com.sun.star. ...") - a ScriptForge class instance => sObjectType contains the class - another Basic object - Nothing (different from Null) Several existing methods benefit from the new method and are part of the commit. No effect on help pages. No effect on Python code. Change-Id: I69565d335b3aeb7c08c48cbccfc13d3d82f11ae1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132525 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-04-05Fix typosAndrea Gelmini
Change-Id: I77ad3b01dbb2e8f8438b6f4a30ca2239490fb8f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132537 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-04-01ScriptForge - (SF_Dialog) new Resize() and Center() methodsJean-Pierre Ledure
The "dialog" service receives 2 new methods for easy move/resize of the concerned dialog. Resize(left, top, widt, height) Move the topleft corner of a dialog to new coordinates and/or modify its dimensions All distances are expressed in 1/100th mm Without arguments, the method resets the initial width and height Center(window) Center the actual dialog instance in the middle of a parent window Without arguments, the method centers the dialog in the middle of the active window The Parent argument can be either - a ScriptForge dialog object - a ScriptForge document (Calc, Base, ...) object Both methods are available from Basic and Python user scripts Change-Id: Ic3680739c9d518da3d76d3588943ae5ce6bad8ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132418 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-03-24Fix typosAndrea Gelmini
Change-Id: Iccb89d32b83b7f7035557ad7c0634f66f4c947d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132082 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-03-24ScriptForge - (SF_Region) new service in the core libraryJean-Pierre Ledure
Singleton class implementing the "ScriptForge.Region" service Implemented as a usual Basic module A collection of functions about languages, countries and timezones - Locales - Currencies - Numbers and dates formatting - Calendars - Timezones conversions - Numbers transformed to text in local language Definitions: Locale or Region A combination of a language (2 or 3 lower case characters) and a country (2 upper case characters) Most properties and methods require a locale as argument. Some of them accept either the complete locale or only the language or country parts. Timezone Specified as "Region/City" name like "Europe/Berlin", or a custom time zone ID such as "UTC" or "GMT-8:00". The time offset between the timezone and the Greenwich Meridian Time (GMT) is expressed in minutes. The Daylight Saving Time (DST) is an additional offset. Both offsets can be positive or negative. Properties: Currency Language Country DatePatterns DateSeparator ThousandSeparator DecimalPoint TimeSeparator ListSeparator DayNames DayAbbrevNames DayNarrowNames MonthNames MonthAbbrevNames MonthNarrowNames Methods UTCDateTime UTCNow LocalDateTime TimeZoneOffset DSTOffset Number2Text Change-Id: Iabf31ea0e6c235e960fcca5b1e7a9d928cf8cd0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132068 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-03-16ScriptForge - (SF_Form) fix use of BaseFormJean-Pierre Ledure
Context: Base documents. In a form or formcontrol event, a user script might need the name of the form document in which the form or control is located, f.i. to close it. The name of the form document is supposed to be found in the SF_Form.BaseForm property. The property is set correctly when the Base form document to form/formcontrol path is taken (top-down), not when the opposite path is taken (bottom-up), typically in events. In the latter case BaseForm is equal to an empty string. The actual commit initializes correctly the BaseForm property with the hierarchical name of the form document. Change-Id: Icdee6ee9909f577f6c01ba96864fe3d6eaf3e750 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131618 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-03-13ScriptForge - (UI) size and position of the active windowJean-Pierre Ledure
The UI service receives next 4 new properties: Height Width X Y They all return a Long value representing the size or position of the active window. The active window does not need to be a document, it may f.i. be the Basic IDE. Those properties are read-only. To modify the size or the position of the window, use the the Resize() method. They are implemented for use from Basic and Python scripts. Change-Id: I0021663e39612f411cefa5c7ec9ec594a4cb6f39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131444 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-03-10ScriptForge - (SF_Root) differ loading of the localized interfaceJean-Pierre Ledure
So far, the loading of the user interface in the user's own language was done at the first invocation of ScriptForge, usually via - a CreateScriptService() method - a direct call to any method, f.i. SF_Array.Append() Now the same loading of the user interface in memory is done at the first request of a localized text or message. Due to the fact that since last commit https://gerrit.libreoffice.org/c/core/+/131255 only error messages contain localized texts, the benefit is that correct scripts will not load any unnecessary texts anymore. The "Interface" variable has be renamed "LocalizedInterface" for clarity in the SF_Root class module No impact on documentation or Python scripts. Change-Id: Ie654625540c0c8f8442e9ba36d38ecaab00c0eb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131313 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-03-10ScriptForge - Console + progress bar receive a Close iconJean-Pierre Ledure
Next dialogs: - dlgConsole (modal or non-modal) - dlgProgress (non-modal) had a Close button with label "Close" or a translation. The "Close" text is replaced with a "Cancel" icon. Objective: make console and progress bar user-language independent. No impact either on user documentation or on Python part. Change-Id: Ib1c2370986d47ccab49c6d42500231fd73b9ff3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131255 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-03-08ScriptForge - 'SF_Root) load user interface from code when locale=enJean-Pierre Ledure
The user interface is loaded in the user's language at the first use of Scriptforge during the LO session. So far the labels were always loaded from the relevant .po file. Now they are loaded in memory by code when the user's language = "en". Objective = gain in performance. Additionally the default language is set to SF_Platform.OfficeLocale i.o. SF_Platform.SystemLocale Internal change, no impact on documentation Change-Id: Ia0d1235f8ca6a42141a5481fe80b5bec1d53a7e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131214 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-03-07ScriptForge - (SF_Document) new Import/ExportFilters propertiesJean-Pierre Ledure
The ImportFilters and ExportFilters properties of the Document, Calc and Writer services return a zero-based array (Basic) or a list (Python) of all filters available for the current document instance. These properties are NOT applicable to Base documents. ImportFilter contains the filters flagged for import or for Import/Export. Idem for ExportFilters. Both lists overlap each other partially. The filter selection is done thanks to the - filter type, to be compared with the Identifier of the document's component - filter flags, last 2 bits determine the import or export orientation The filter names are potential arguments of the OpenDocument() and SaveAs() methods (and alike). Both properties are callable from Basic and Python user scripts. Change-Id: I8ce5312a58a013bc7e1e68101ff9f50f3233155d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131106 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-03-02ScriptForge - (SF_Calc) new ExportRangeToFile() methodJean-Pierre Ledure
The Calc service offers the possibility to export a range, given as a string, to a file in several different image formats. Supported formats: pdf, jpeg, png. Arguments: - Range: a sheet name or a range of cells - Filename: the file to export to in FileSystem notation - ImageType: the expected output format - Overwrite: True when the output file may be overwritten New error message: RANGEEXPORTERROR Error is introduced in po files. The method is available both in Basic and Python user scripts. Change-Id: Ibd297ec2da1b48fca3dee7d8e03bd2ee4815957a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130835 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-02-27ScriptForge - (SF_Platform) add the FilterNames propertyJean-Pierre Ledure
The FilterNames property returns, as an unsorted zero-based array of strings, the list of available/installed import and export filters for components. The property can serve as support for the FilterName argument used for opening and saving documents. The FilterNames property is available both from Basic and Python user scripts. Change-Id: I607500b56836ceeb6716b10d39d22638b0741f3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130624 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-02-17ScriptForge - (L10N): add new arguments to the service creationJean-Pierre Ledure
Actual arguments: - FolderName: the folder containing the PO-files - Locale: in the form la-CO (language-COUNTRY) - Encoding: The character set that should be used New arguments introduced by this commit: - Locale2: fallback Locale to select if Locale po file does not exist - Encoding2: Encoding of the 2nd Locale file Both new arguments are optional => no regression on existing scripts The arguments are available in Basic and Python equally. They may be passed as keyworg arguments in Python only. The default locale is now set to the "OfficeLocale", which is the locale in the user interface. NB: the distinction between SystemLocale and OfficeLocale is new in version 7.4. Change-Id: Ie3bc5d30193df35a8c6c1ec706e13eaea0050981 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130074 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-02-17ScriptForge - (SF_UI) Fix omission of ServiceNameJean-Pierre Ledure
The ServiceName property is part of the standard norm for ScriptForge services. It is used only internally. Its omission in SF_UI caused the tree in construction for help files to contain wrong redirections. Change-Id: I51f1966ef463fffe62c9495dbc2ea0c152fa9667 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130004 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-02-15ScriptForge - (scriptforge.py) get lists of properties and methodsJean-Pierre Ledure
To allow object introspection and some help files automatic generation (see Telegram discussions), the possibility to make the list of properties and methods used in Basic available in Python has been requested. These changes are for internal use only. Main changes: - the SFServices parent class receives new basicproperties() and basicmethods() methods - Basic PythonDispatcher() is adapted to provide the lists to the Python caller - Methods lists are reviewed in SFDocuments to NOT include the methods implemented in the parent SF_Document class, to avoid redundant entries in the list Change-Id: I80758e225b039426b46f52dd67efe54c50f9f31e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129969 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-02-10ScriptForge - (SF_Utils) review optional argument of _Repr()Jean-Pierre Ledure
As from LO 7.3, optional missing arguments must not be used in assignments and comparisons. The Basic interpreter tolerated it before 7.3. Probable commit having changed Basic behaviour: https://gerrit.libreoffice.org/c/core/+/121794 A unique case of this singularity was found in the SF_Utils._Repr() method. The bad consequence was that the commonly used SF_Exception.DebugPrint() method calls above method. This broke in fact the whole ScriptForge library. Change-Id: Iba8792b92c73c992429de4382bd8a3dc4b58a94f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129728 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-02-09Fix typosAndrea Gelmini
Change-Id: I50e8988c320c0068f7adf4a3429d7639df0cbcd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129596 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2022-02-07ScriptForge - (SF_Platform,SF_FileSystem) Manage extensionsJean-Pierre Ledure
New properties and methods -------------------------- SF_Platform.Extensions : (property) provide a list of the installed extensions as an array of strings SF_FileSystem.ExtensionFolder(Extension as string) : (method) provides the location in FileNaming notation of the folder where the given extension is installed The SF_FileSystem.ExtensionsFolder (notice the additional "s") is kept as a property providing the folder containing the extensions installed by the user. All methods and properties are available with an identical syntax and semantics both from Basic and Python scripts. The difference between a propert or a method is irrelevant for Basic but is essential in Python: a property must not have brackets, a method must have them. Hence the distinction between ExtensionFolder being a method requiring an argument ExtensionsFolder being a property without argument Change-Id: Idd18a5624f4abd84095d146e467e8fdcf497bd0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129572 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-02-04ScriptForge - (SF_UI) Import RunCommand() from SF_SessionJean-Pierre Ledure
Functionally SF_UI groups methods impacting the user interface, while the Session service groups general-purpose actions. The RunCommand() method (newly introduced in 7.4) simulates menu commands applied on the active window. RunCommand() fits better in the UI service. It is removed from SF_Session. Change-Id: Ia72150efea2f50de13d15a4c1f5fea79777d1760 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129453 Tested-by: Jenkins Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-02-03ScriptForge - (SF_Calc) FIX range parsing error when leading $Jean-Pierre Ledure
When sheet name contains - a leading $ - surrounding single quotes an error message was errorneously displayed to the user. Corrected in the SF_Calc._ParseAddress() function Change-Id: I8abd4908a4c92bd6e569b95be58ab21e16ffc169 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129408 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-02-01ScriptForge - (SF_Platform) refine localesJean-Pierre Ledure
So far, only SF_Platform.Locale was supported, returning the locale of the operating system. Now, 3 different locales may be considered: - SystemLocale: identical to Locale (still supported) - OfficeLocale: the locale associated with the LibreOffice installation - FormatLocale: the locale associated with how numbers and dates are formatted. Of course, in many cases all locales are identical. Anyway a distinction can be made. All these properties are read-only. Those properties are supported in Basic and Python evenly. Change-Id: I0792d49a052b1441a30ac231d61eda997dc4216a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129297 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-02-01ScriptForge - (SF_Exception) error messages give access to help pageJean-Pierre Ledure
When ScriptForge detects an error in a user script, a message box is displayed with a summary of the syntax and validation rules the invoked method should respect, and/or any other reason the library has identified. Now the error message is completed with - the sentence "Do you want to receive more information about the '%1' method ?" - 2 buttons Yes/No (No being the default) When the Yes button is pressed the local browser opens the help page/anchor of the invoked service/method. The pot template and the english po files are modified. There is no difference between Basic and Python in this matter. Change-Id: Ie6210b9d108c9a1e98a46173504680e3985125b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129232 Tested-by: Jenkins Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-01-31Fix typoAndrea Gelmini
Change-Id: I472190c743dd26e88e3400f323ab52fa05c187d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129215 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2022-01-30ScriptForge - (SF_Session, SF_Document) add arguments to RunCommand()Jean-Pierre Ledure
Next wiki page https://wiki.documentfoundation.org/Development/DispatchCommands facilitates the use of commands with the DispatchHelper service, including with arguments This commit - adds the RunCommand() method in the Session service - extends the scope of existing RunCommand() methods for the Document, Base, Calc and Writer services with the addition of command arguments Syntax by examples: (Basic) session.RunCommand("BasicIDEAppear", _ "Document", "LibreOffice Macros & Dialogs", _ "LibName", "ScriptForge", _ "Name", "SF_Session", _ "Line", 100) (Python) (1) session.RunCommand("BasicIDEAppear", "Document", "LibreOffice Macros & Dialogs", "LibName", "ScriptForge", "Name", "SF_Session", "Line", 100) (Python) (2) session.RunCommand("BasicIDEAppear", Document = "LibreOffice Macros & Dialogs", LibName = "ScriptForge", Name = "SF_Session", Line = 100) Change-Id: I60cd5eb1ed0a057420215ce7aebe92b2aafabd53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129175 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-12-30Fix case for "ByVal", "Variant", "UCase"Julien Nabet
Change-Id: I136d292cd535d4208457ef91a7773fc7ac00d5c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127716 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2021-12-22Access2Base - Fix argument check in OpenDatabase()Jean-Pierre Ledure
Read Mike Kaganski's comment in https://gerrit.libreoffice.org/c/core/+/9303 Change-Id: I8d89d9dd93dd6c31438418847d4073568baf11f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127312 Tested-by: Jenkins Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-12-10Generally determine Rdb content from gb_*_set_componentfile callsStephan Bergmann
...instead of by listing the content somewhat redundantly in the Rdb_*.mk files, to avoid duplication of logic for components that are only built conditionally (and thus should only be included conditionally in the corresponding Rdb). To achieve that, add an "rdb" parameter to gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros that internally call gb_ComponentTarget_ComponentTarget), which is used to make the appropriate gb_Rdb_add_component call internally from within gb_ComponentTarget_ComponentTarget. (As a special case, gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that has already been done by the corresponding gb_Library_set_componentfile call, so allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to support that special case.) Most Rdb_*.mk files are thus mostly empty now. One exception is i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as needed during the build in CustomTarget_i18npool/localedata. 1c9a40299d328c78c035ca63ccdf22c5c669a03b "gbuild: create services.rdb from built components" had already tried to do something similar (in addition to other things) under a new --enable-services-rdb-from-build option. However, that approach had four drawbacks that this approach here addresses (and which thus partly reverts 1c9a40299d328c78c035ca63ccdf22c5c669a03b): 1 Rdb_services shall not contain the component files of all libraries that are built. While that commit filtered out the component files that go into Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files that go into others like Rdb_postgresql-sdbc (connectivity/Rdb_postgresql-sdbc.mk). 2 The code added by that commit to Makefile.gbuild codified the knowledge that there is an Rdb_services, which is brittle. 3 The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge (for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle. 4 Introducing an --enable-services-rdb-from-build option needlessly provided two different ways how the content of Rdb_services is assembled. The changes done here would leave --enable-services-rdb-from-build as a misnomer, as it no longer controls how Rdb_services is assembled. I thus renamed it to --enable-customtarget-components, as that is apparently what it still does now. Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-08Simplify some Optional handlingMike Kaganski
Change-Id: I2ba326faa47531c1d7c71ac05a8dd211cebac199 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126513 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-08Fix wrong missing variable checkMike Kaganski
... ever since commit 0aa1eda1a2af438d7061ba2a6d53866141f5fda6 author Behrend Cornelius <bc@openoffice.org> Fri May 04 14:15:30 2001 +0000 ## several changes Change-Id: I97a761919b3f3faabc87b1804ef10a231ad1df96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126512 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-08ScriptForge - (SF_Utils) language may have a length > 2 in localesJean-Pierre Ledure
The vaste majority of language codes are 2 characters long. However it is not the norm. A length of 3 is admitted for less spread languages Change-Id: Iabdf6a6cf453169419d0a4a7a3ab6ea80ae4753e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126531 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-12-06Fix typosAndrea Gelmini
Change-Id: I16d59aa3a3f17764a848428a2e6b206dc57a480a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126325 Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-12-03ScriptForge - (SFWidgets) new SF_Menu serviceJean-Pierre Ledure
Display a menu in the menubar of a document (form document to be done) After use, the menu will not be saved neither in the application settings, nor in the document. The menu setting does not affect the modified status of the document. The menu will be displayed, as usual, when its header in the menubar is clicked. When one of its items is selected, there are 3 alternative options: - a UNO command (like ".uno:About") is triggered - a user script is run receiving a standard argument defined in this service - one of above combined with a toggle of the status of the item The menu is described from top to bottom. Each menu item receives a numeric and a string identifier. Each menu item may be decorated with a tooltip and/or an icon. The AddItem(), AddCheckBox() and AddRadioButton() methods, when coompared with their equivalents in the SF_PopupMenu service, receive 2 additional arguments: Command and Script. The various document services receive 2 additional methods: CreateMenu(), returning a Menu service instance RemoveMenu() Very short example: menu = doc.CreateMenu("My menu", Before := "Help") menu.AddItem("First Item", Command := "About") menu.AddItem('2nd Item", Script := "... URI notation ...") menu.Dispose() ' Once set the menu object may ve erased, listeners stay tuned Later in the lifecycle of the document, one may run: doc.RemoveMenu("My menu") ' doc.RemoveMenu("File") works as well !!! All the functionalities are available both in Basic and Python user scripts. Change-Id: Iabd157573693e9648fcb06d36c90af9a22b17a6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126309 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-11-27ScriptForge - (SF_Calc) fix ShiftXXX() methods with negative offsetJean-Pierre Ledure
Example: oCalc.ShiftDown("A10:D15", , -1) gives an "Objectvariable not set" Basic runtime error. Fixed by replacing 4x '= 0' by '<= 0' test in If statements checking the argument value. Change-Id: I272112a1addd303b7b38d3d9eb2ef73034e28727 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125939 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-11-25ScriptForge - (SF_Platform) fix Locale should return the OS localeJean-Pierre Ledure
So far it returned the LO locale. Discussed on Telegram Change-Id: I2cf66ca3acebe695354de9185e0698ffa4d8cf05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125820 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-11-18Fix typosAndrea Gelmini
Change-Id: Idd21ee0026d8a36653f0fb25b350dae37315f603 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125336 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-15ScriptForge - (SF_Calc) new OpenRangeSelector() methodJean-Pierre Ledure
The method activates the Calc document, opens a non-modal dialog with a text box, let the user make a selection in the current or another sheet and returns the selected area as a string. This method does not change the current selection. Arguments: Title: the title to display on the top of the dialog Selection: a default preselection as a String. When absent, the first element of the current selection is preselected. SingleCell: When True, only a single cell may be selected. Default = False CloseAfterSelect: When True (default-, the dialog is closed immediately after the selection. When False, the user may change his/her mind and must close the dialog manually. Returns: The selected range as a string, or the empty string when the user cancelled the request (close window button) Example: Dim sSelect As String, vValues As Variant sSelect = oDoc.OpenRangeSelector("Select a range ...") If sSelect = "" Then Exit Function vValues = oDoc.GetValue(sSelect) The implementation requires a new module: SF_DocumentListener.xba The method is available for Basic and Python user scripts. Change-Id: I2d67a9c900ea8ac661cd6b6fb43bb4a34e6abd8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125201 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-11-11ScriptForge - (SF_Calc) new Printf() methodJean-Pierre Ledure
Returns the input string after substitution of its tokens by their values in the given range This method is usually used in combination with SetFormula() The accepted tokens are: - %S The sheet name containing the range, including single quotes when necessary - %R1 The row number of the top-left part of the range - %C1 The column letter of the top-left part of the range - %R2 The row number of the bottom-right part of the range - %C2 The column letter of the bottom-right part of the range The default token character (%) may be modified. The method is available both for Basic and Python user scripts Change-Id: If9c3a042abf22ba760d1410b105b04716d092418 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125044 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-11-11ScriptForge - (SFWidgets) fix New PopupMenu without eventJean-Pierre Ledure
Invoking the service without an event object was supposed to work. For instance: Dim myPopup As Object Set myPopup = CreateScriptService("PopupMenu", , 300, 300) This would create the PopupMenu in position (300, 300) without an event object... however this does not work. Getting an error saying that "Event is EMPTY" => Add an IsEmpty() test. Change-Id: I86a1baf83264921088facbd35bf8fa299a5aa132 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125005 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-11-09ScriptForge - (SF_Calc) First/Last * Row/Column/Cell accept sheets and rangesJean-Pierre Ledure
The methods FirstCell FirstColumn FirstRow LastCell LastColumn LastRow SheetName accept uniformly either a sheet name or a range name. They return a single cell as an absolute address (First/LastCell), a String (SheetName) or a Long. The range name is to be understood as the extended notation for ranges. FirstCell/Column/Row accept sheet names. However they will then always return either the "A1" cell or the value 1. The LastCell/Column/Row return the real last xxx for ranges, and the last USED xxx when the argument is a sheet. The A1Style() method surrounds from now on sheet names with single quotes only when necessary. The GetRangeAddress() method has been dropped as redundant with the actual methods. (Was new in 7.3 => no effect on upward compatibiity) Change-Id: Iff1ce437ee27dfb8481361f648b3f7a33ae2c4b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124904 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-11-04ScriptForge - (SF_Calc) _ParseAddress() reuse last parsed addressJean-Pierre Ledure
Implementation to improve performance of a simple cache of the last already parsed range. The address is reused when the sheet name is explicit and that the range to parse, as a string, is identical to the previous parsing request. Change-Id: I0137689e9697686e76e07e037129983baba6ecfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124711 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-11-04ScriptForge - (SF_PopupMenu) Fix com.sun.star.awt.MenuItemStyle.AUTOCHECKJean-Pierre Ledure
To have checkboxes displayed correctly in KDE, it is necessary to use com.sun.star.awt.MenuItemStyle.CHECKABLE instead. No regression in behaviour observed so far in other environments. Change-Id: If15b2ff597f1cdffe2df65fe2352ffef0f770cb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124639 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-11-04Resolves: tdf#97046 ensure build system variables start with gb_Sabyasachi Bhoi
Change the variable name: var2file to gb_var2file Change-Id: Ib7d64b76cfe10e6c2df1a176674a360b28704070 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124666 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01Fix typoAndrea Gelmini
Change-Id: Ida6978ed843615504fac7ce0a0a6a08a66f10367 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124320 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-11-01ScriptForge - (SF_Calc) new GetRangeAddress() methodJean-Pierre Ledure
The GetRangeAddress() method accepts 2 arguments: GetRangeAddress(Range, AddressItem) - a range as a string, to be understood as the extended definition described in the help pages - the item to be extracted from the given range, either: firstrow firstcol lastrow lastcol sheet The returned value is either: - a Long - a String when sheet is requested - an array of all these values when no item is given The method is available for both Basic and Python user scripts Change-Id: I6156b176e29cf47207a079d10552443467dd2f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124551 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-10-31ScriptForge - (SF_Calc) new ShiftDown, ShiftLeft, ShiftRight, ShiftUp methodsJean-Pierre Ledure
ShiftRight()/ShiftDown() insert empty cells at the left/on the top of a given range and move all cells at the right/bottom of the range accordingly. They are similar to the Insert Cells ... menu commands ShiftLeft()/ShiftUp() delete cells at the left/top of a given range and move all cells at the right/below the range accordingly. They are similar to the Delete Cells ... menu commands The insertion/deletion may be done for a whole column/row. The number of columns/rows to insert/delete may be chosen. All methods are available in Basic and Python user scripts. Change-Id: I14555a3966c26054925dd71b0696f3dfc773fc21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124530 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>