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 <jp@ledure.be>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user