wizards/source/sfdocuments/SF_Calc.xba | 15 ++++++--------- wizards/source/sfdocuments/SF_Document.xba | 2 +- wizards/source/sfdocuments/script.xlb | 22 +++++++++++----------- 3 files changed, 18 insertions(+), 21 deletions(-)
New commits: commit 38bc68ba4b6e9f516983bec19d3b16b53223dbf0 Author: Jean-Pierre Ledure <[email protected]> AuthorDate: Mon Jan 12 12:36:33 2026 +0100 Commit: Jean-Pierre Ledure <[email protected]> CommitDate: Mon Jan 12 17:23:01 2026 +0100 ScriptForge (Calc) FormatRange() fix new formats New formats should not be deleted after use. Anyway they are stored in the document, not at install level. + A few typos in comments. No change in user documentation. Change-Id: I839fa0d86abdaf521a12b0d97978cf225cc8088e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197090 Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <[email protected]> diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba index fbec5e4873a1..9b920ad073d6 100644 --- a/wizards/source/sfdocuments/SF_Calc.xba +++ b/wizards/source/sfdocuments/SF_Calc.xba @@ -492,7 +492,7 @@ Public Function AlignRange(Optional ByVal TargetRange As Variant _ ''' Returns: ''' A string representing the updated range ''' Examples: -''' oDoc.AlignRange("SheetX.A1:J30", "Middle,Center", FilterFormula := "IsNumeric(A1), FilterScope := "CELL") +''' oDoc.AlignRange("SheetX.A1:J30", "Middle,Center", FilterFormula := "=IsNumeric(A1), FilterScope := "CELL") ''' ' Align to the middle of the cells, horizontally and vertically Dim sAlign As String ' Return value @@ -578,7 +578,7 @@ Public Function BorderRange(Optional ByVal TargetRange As Variant _ ''' Returns: ''' A string representing the updated range ''' Examples: -''' oDoc.BorderRange("SheetX.A1:J30", "HB", FilterFormula := "IsNumeric(A1), FilterScope := "CELL") +''' oDoc.BorderRange("SheetX.A1:J30", "HB", FilterFormula := "=IsNumeric(A1), FilterScope := "CELL") ''' ' Border with a bottom line, including the horizontal inner lines Dim sBorder As String ' Return value @@ -729,7 +729,7 @@ Public Function ColorizeRange(Optional ByVal TargetRange As Variant _ ''' Returns: ''' A string representing the updated range ''' Examples: -''' oDoc.ColorizeRange("SheetX.A1:J30", Background := RGB(255, 0, 0), FilterFormula := "IsNumeric(A1), FilterScope := "CELL") +''' oDoc.ColorizeRange("SheetX.A1:J30", Background := RGB(255, 0, 0), FilterFormula := "=IsNumeric(A1), FilterScope := "CELL") ''' ' Paint the cell(s) in red. Dim sColorize As String ' Return value @@ -1814,7 +1814,7 @@ Public Function DecorateFont(Optional ByVal TargetRange As Variant _ ''' Returns: ''' A string representing the updated range ''' Examples: -''' oDoc.DecorateFont("SheetX.A1:J30", FontSize := 15, Decoration := "BU", FilterFormula := "IsNumeric(A1), FilterScope := "CELL") +''' oDoc.DecorateFont("SheetX.A1:J30", FontSize := 15, Decoration := "BU", FilterFormula := "=IsNumeric(A1), FilterScope := "CELL") ''' ' Modify the font size and apply bold and underline properties to the numeric cells Dim sDecorate As String ' Return value @@ -2083,7 +2083,7 @@ Public Function FormatRange(Optional ByVal TargetRange As Variant _ ) As String ''' Apply a given number format to a cell or a range of cells. ''' The cells range may be filtered with a filter formula and its scope. -''' If the given format does not exist, it is created and suppressed immediately. +''' If the given format does not exist, it is created. ''' Args: ''' TargetRange : the cell or the range as a string that should receive the format ''' NumberFormat: the format to apply, as a string @@ -2096,7 +2096,7 @@ Public Function FormatRange(Optional ByVal TargetRange As Variant _ ''' Returns: ''' A string representing the updated range ''' Examples: -''' oDoc.FormatRange("SheetX.A1:J30", "0,00E+00", FilterFormula := "IsNumeric(A1), FilterScope := "CELL") +''' oDoc.FormatRange("SheetX.A1:J30", "0,00E+00", FilterFormula := "=IsNumeric(A1), FilterScope := "CELL") ''' ' Format only the cells containing a numeric value Dim sFormat As String ' Return value @@ -2156,9 +2156,6 @@ Try: For Each oFRange In vRanges oFRange.XCellRange.NumberFormat = lFormatID Next oFRange - - ' Delete the new format - If bNew Then .removeByKey(lFormatID) End With sFormat = oRange.RangeName diff --git a/wizards/source/sfdocuments/SF_Document.xba b/wizards/source/sfdocuments/SF_Document.xba index 4a4abd7870e9..d79296304fc2 100644 --- a/wizards/source/sfdocuments/SF_Document.xba +++ b/wizards/source/sfdocuments/SF_Document.xba @@ -2330,4 +2330,4 @@ Private Function _Repr() As String End Function ' SFDocuments.SF_Document._Repr REM ============================================ END OF SFDOCUMENTS.SF_DOCUMENT -</script:module> +</script:module> \ No newline at end of file diff --git a/wizards/source/sfdocuments/script.xlb b/wizards/source/sfdocuments/script.xlb index a1612cbe24d7..aaa2f8524e29 100644 --- a/wizards/source/sfdocuments/script.xlb +++ b/wizards/source/sfdocuments/script.xlb @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> <library:library xmlns:library="http://openoffice.org/2000/library" library:name="SFDocuments" library:readonly="false" library:passwordprotected="false"> - <library:element library:name="__License"/> - <library:element library:name="SF_Form"/> - <library:element library:name="SF_DocumentListener"/> - <library:element library:name="SF_Document"/> - <library:element library:name="SF_Calc"/> - <library:element library:name="SF_Writer"/> - <library:element library:name="SF_Register"/> - <library:element library:name="SF_Base"/> - <library:element library:name="SF_Shape"/> - <library:element library:name="SF_FormControl"/> - <library:element library:name="SF_FormDocument"/> <library:element library:name="SF_Chart"/> + <library:element library:name="SF_FormDocument"/> + <library:element library:name="SF_FormControl"/> + <library:element library:name="SF_Shape"/> + <library:element library:name="SF_Base"/> + <library:element library:name="SF_Register"/> + <library:element library:name="SF_Writer"/> + <library:element library:name="SF_Calc"/> + <library:element library:name="SF_Document"/> + <library:element library:name="SF_DocumentListener"/> + <library:element library:name="SF_Form"/> + <library:element library:name="__License"/> </library:library> \ No newline at end of file
