Age | Commit message (Collapse) | Author |
|
Change-Id: I5083765c879689d7f933bbe00ad70bb68e635a21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139042
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
in the internal method _GetFilterNames(), in an array
of PropertyValues, 2 indexes were hardcoded to
optimize their access.
The sequence of items has been changed in LO 7.4.
The search of the correct Name-Value pairs is reviewed
to make it independent of their position in the array.
No impact on documentation.
The function is of minor importance.
Patch for LO 7.4 to make only if bug reported in bugzilla.
Change-Id: I2d3147c9c7624bf79a4e077469223794dc2398bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138695
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Alignment with Calc support of 2^14 columns
as from LO 7.4 instead of 2^10.
Review of comments accordingly.
Minor optimization of internal method _GetColumnName()
More accurate control of boundaries in
internal method _Offset()
Change-Id: I590ae9a4fab0b90a6e9cc9bbacf6c1b582f9c6e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138666
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
A FilterFormula is a Calc formula that returns TRUE or FALSE
The formula is expressed in terms of
- the top-left cell of the range when FilterScope = "CELL"
- the topmost row of the range when FilterScope = "ROW"
- the leftmost column of the range when FilterScope = "COLUMN"
After pasting, the relative and absolute references
will be interpreted correctly.
The FilterScope indicates the way the formula is applied,
once by row, column or individual cell.
The requested action is done only on the rows/columns/cells
for which the FilterFormula returns True.
Next methods receive 2 new arguments:
=> FilterFormula and FilterScope:
ClearAll()
ClearFormats()
ClearValues()
SetCellStyle()
These changes are valid for Basic and Python user scripts.
Without these new arguments above methods behave as before.
The documentation needs to be adapted:
- inclusion of FilterFormula and FilterScope concepts in the
DEFINITIONS section of the SF_Calc help page
- new arguments to add in resp. methods
Change-Id: I657b231252106b91ed7e27a49ef3331c1fcee917
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138590
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: I6daee630eb433998711091780452dc0534398f79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138460
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I96ae7fabb65e44e6d70f0c4048609f93aed8be1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137722
Tested-by: Jenkins
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
|
|
This commit is mainly about the introduction of
a new internal method:
_ComputeFilter(range, filterformula, filterscope)
A FilterFormula is a Calc formula that returns TRUE or FALSE
The formula is expressed in terms of
- the top-left cell of the range when FilterScope = "CELL"
- the topmost row of the range when FilterScope = "ROW"
- the leftmost column of the range when FilterScope = "COLUMN"
After pasting, the relative and absolute references
will be interpreted correctly.
The FilterScope indicates the way the formula is applied,
once by row, column or individual cell.
The concept of FilterFormula was already used by CompactUp()
and CompactLeft(). Their implicit (Filter)scopes were resp.
"ROW" and "COLUMN".
The _ComputeFilter() method returns an array of subranges
contained in the initial range that match the filter.
The isolation the code for the management of filters
applied on ranges makes the later use of the concepts of
FilterFormula and FilterScope reusable for other methods.
CompactUp() and CompactLeft() are functionally unchanged.
No impact on documentation.
Change-Id: I7c4e890b54f315486f29b5434a3c236167e2f9ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138368
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Extract of the bug report (Rafael Lima)
This bug affects a method from the ScriptForge library,
more specifically the GetTempName method from
the FileSystem service, which relies on calling RANDBETWEEN.
Because of this bug, GetTempName only works in English,
but fails in other languages. Below is a sample code
for testing the GetTempName error.
Sub TestTempName
GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")
fs = CreateScriptService("FileSystem")
MsgBox fs.GetTempName()
End sub
Interestingly changing RANDBETWEEN for RANDBETWEEN.NV
in the macro above will work.
Occurrences of the use of RANDBETWEEN:
wizards/source/scriptforge/SF_FileSystem.xba
wizards/source/sfdocuments/SF_Calc.xba
Change-Id: Iea38f11acb7113aa5eaab1feff7a0e64a739aada
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137691
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Maybe just for completeness, it's removed from menu but might be
callable as macro.
Change-Id: Iade0be845186d3deb2f00f4aaa230c0b344cea72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137372
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
|
|
(patch https://gerrit.libreoffice.org/c/core/+/137084 cont'd)
In SF_PythonHelper._PythonDispatcher():
Force a hardcoded call of the methods in the Dialog
service which may potentially be invoked while the
dialog is displayed, bypassing the generic CallByName()
Basic builtin function:
Activate
Center
EndExecute
Resize
Execute => was missing in the list
Case when a parent dialog opens a child dialog
(Controls is already hardcoded because returning an array)
Change-Id: Ia12fccbb61362768301df6670161f258b32d3a78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137289
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
A dialog is started with the Execute() method.
During its life span user scripts may be executed
as a consequence of mouse clicks etc.
When those scripts contain errors and they are not
trapped;
- in the actual situation, the error is detected by
ScriptForge and considered as an internal error
- this new commit considers the error as a user error.
The help pages should be completed to promote the
use of errors trapping inside scripts triggered
by events.
Change-Id: Iba3eefc75d305c17e6e1d9d416496882e0f816bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137203
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
In SF_PythonHelper._PythonDispatcher():
Force a hardcoded call of the methods in the Dialog
service which may potentially be invoked while the
dialog is displayed, bypassing the generic CallByName()
Basic builtin function:
Activate
Center
EndExecute
Resize
(Controls is already hardcoded because returning an array)
Change-Id: I4931f43b37ae5f7337740d1c65b255f4a14ca069
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137084
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Normalize a pathname by collapsing redundant
separators and up-level references
so that A//B, A/B/, A/./B and A/foo/../B
all become A/B.
On Windows, it converts forward slashes
to backward slashes.
The Basic Normalize() method invokes the
_SF_FileSystem__Normalize() function located in
the ScriptForgeHelper.py module for execution
with the os.path builtin library
The os.path.normpath() function can easily be
executed directly from python user scripts.
However the FileSystem.Normalize() method is
proposed as well for Python scripts
- for compatibility Basic/Python reasons
- to manage the FileNaming notation
Change-Id: I1e089612432bd2c75b2e76ffa984289ef7f9d75c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136835
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: I05271bd76574c09683740204534ff8a6907fc784
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136522
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
The parsing of sheet names and range addresses
has been reviewed to include the exact rules for
sheet naming:
must not be empty
must not contain []*?:/\
must not use ' (apostrophe) as 1st and last character
Additionally (ScriptForge only) it must not contain "~"
which, by convention, indicates the active sheet.
The code accepts exotic sheet names like:
"$"
"$Sheet99"
"$Sheet'99"
"$.Sheet'99"
"!'@#$%^&()-_=+{}|;,<.>"""
and exotic addresses like:
"'$'.A1"
"'$Sheet99'.A1"
"'$Sheet''99'.A1"
"'$.Sheet''99'.A1"
"'!''@#$%^&()-_=+{}|;,<.>""'.A1"
Target is to match completely the Calc constraints for
writing formulas and sheet names..
The same rules are applicable evenly for user scripts
written either in Basic or in Python.
Change-Id: I759d7700152a3d811b89f156c4d9eee0071c2a7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136446
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
The quoting character (2nd argument of the method)
can be the single or the double quote.
The single quote was erroneously ignored.
Additionally comments are added in the code
about non-symmetrical escaping approaches:
"" or \'
(maybe to be added in help texts ?)
Commit to push to libreoffice-7-4 branch too.
Change-Id: Ifd8f66ee9e60310fdc292aa0f338e88d941b2e21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136292
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
When the name of a sheet contains a "." or a space, when passed
as an argument, the name must be surrounded with sinle quotes
(like in usual Calc formulas).
The validation of the sheet name goes thru the comparison with
the list of existing sheet names in the document.
The comparison compared erroneously the name with quotes and
sheet name without quotes.
Gave an unjustified user error.
Example:
calc.Sheet("'Commits 7.4'")
Actual commit should be pushed to LibreOffice 7.4 too.
Change-Id: I1ffd1dc42a0fd4a28fcea87de297c4cb02da6a5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136233
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Avoid using hardcoded release number. Use 'latest'.
Change-Id: I04f531ee736bcd94d058413634ddb49046bc6c5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135475
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|
|
similiar to commit 069f0eb13f7d26ce4b854160bbb9592c25609b38
Change-Id: I08577ced705df620d99781da53b6085398f52821
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135450
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Typos in comment lines
Minor improvements of test report layout
Change-Id: Ic19e55a84475b098959055ac1c573de629e21731
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135466
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|
|
Change-Id: Icc97a5fdf00c9b8f267a2015a72c050438452105
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135441
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
The "UnitTest" service is implemented as a new
Basic library called 'SFUnitTests'.
ScriptForge unit tests (SF_UnitTest class module)
======================
Class providing a framework to execute and check sets of unit tests.
The UnitTest unit testing framework was originally
inspired by unittest.py in Python
and has a similar flavor as major unit testing
frameworks in other languages.
It supports
- test automation
- sharing of setupand shutdown code
- aggregation of tests into collections.
Both the
- code describing the unit tests
- code to be tested
must be written exclusively in Basic
(the code might call functions written in other languages).
The code to be tested may be released as an extension.
It does not need to make use of ScriptForge services.
The test reporting device is the Console.
Definitions:
- Test Case: each test case is a Basic Sub.
- Test Suite: a collection of test cases stored in 1 Basic module.
- Unit test: a set of test suites stored in 1 library.
Two modes:
- the normal mode ("full mode"), using test suites and test cases
The UnitTest service is passed as argument to each test case.
- the "simple mode" limited to the use of the Assert...() methods.
Service invocation examples:
- In full mode, the service creation is external to test cases
Dim myUnitTest As Variant
myUnitTest = CreateScriptService("UnitTest", ThisComponent, "Tests")
' Test code is in the library "Tests"
' located in the current document
- In simple mode, the service creation is internal to every test case
Dim myUnitTest As Variant
myUnitTest = CreateScriptService("UnitTest")
With myUnitTest
If Not .AssertTrue(...) Then ...
' ...
.Dispose()
End With
Error handling
To support the debugging of the tested code, the UnitTest service, in cases of
- assertion failure
- Basic run-time error in the tested code
- Basic run-time error in the testing code (the unit tests)
will comment the error location and description in a message box and in the console log,
providing every test case (in either mode) implements an error handler
containing at least a call to the ReportError() method.
Change-Id: I9d9b889b148f172cd868af455493c8c696d1e953
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135365
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|
|
When the range to compact spans only 1 row (CompactUp)
or 1 column (CompactLeft), a GetValue() method returns
a scalar and not an array as expected in usual cases.
This caused an abort of the script when invoking the
UBound() value of the returned array with a Basic run-time error
Object variable not set
A test on being scalar or array of the result of
the GetValue() method avoids the error.
To be done in both CompactXXX() methods.
Impact only on Basic code. Python not involved.
No changes due in documentation.
Change-Id: I74cf2b274944b442f843e1f4b7ac3a05dd6eaae7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134352
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|
|
Fix mix-up of the definitions of the Left and Top arguments.
The patch changes mainly a few comment lines.
Additional changes:
the list of methods includes Center() and Resize(). (patchset 3)
Change-Id: Id049d42b053e5ef1971ee62fb2b8b9342053583f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134078
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|
|
In class _Module, the ProcStartLine item is defined
both as a property (by its presence in classProperties)
and as method
def ProcSTartLine (...):
This is of course irrelevant.
The property must be removed and the method kept as is.
Bug signalled by Paul M on Telegram.
Change-Id: I33bec829244543dbbd88b53e35cdff6c5468692f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133388
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|
|
The exception hierarchy described on page
https://docs.python.org/3.5/library/exceptions.html#exception-hierarchy
indicates that the default exception in bare
except:
statements is BaseException. This induces that the SystemExit,
KeyboardInterrupt and GeneratorExit are also handled by the
user script.
This is a not recommended practice.
Better is to use the explicit Exception built-in exception
except Exception:
Bug reported by Paul M on Telegram
Change-Id: Ie1ae1f732ebc60a881e7d40ba8141aa704e9cd5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133328
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|
|
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>
|
|
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>
|
|
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>
|
|
Change-Id: Idcb10d0cc0759473e95e47afec7ed69853628612
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132587
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
|
|
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>
|
|
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>
|
|
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>
|
|
Change-Id: Iccb89d32b83b7f7035557ad7c0634f66f4c947d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132082
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Change-Id: I50e8988c320c0068f7adf4a3429d7639df0cbcd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129596
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
|
|
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>
|
|
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>
|