diff --git a/source/text/sbasic/shared/03/sf_calc.xhp b/source/text/sbasic/shared/03/sf_calc.xhp
index 88a5c7de90..475cf0f496 100644
--- a/source/text/sbasic/shared/03/sf_calc.xhp
+++ b/source/text/sbasic/shared/03/sf_calc.xhp
@@ -8,21 +8,18 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
-->
-
SFDocuments.Calc service/text/sbasic/shared/03/sf_calc.xhp
-
Calc service
-
SFDocuments.Calc service
The SFDocuments shared library provides a number of methods and properties to facilitate the management and handling of %PRODUCTNAME documents.
@@ -41,12 +38,10 @@
This help page describes methods and properties that are applicable only to Calc documents.
-
Service invocation
Before using the Calc service the ScriptForge library needs to be loaded or imported:
-
- The Calc service is closely related to the UI service of the ScriptForge library. Below are a few examples of how the Calc service can be invoked.
+ The Calc service is closely related to the UI service of the ScriptForge library. Below are a few examples of how the Calc service can be invoked.The code snippet below creates a Calc service instance that corresponds to the currently active Calc document.
@@ -98,7 +93,6 @@
myDoc = CreateScriptService("Calc", bas.ThisComponent)The use of the prefix "SFDocuments." while calling the service is optional.
-
Definitions
Many methods require a "Sheet" or a "Range" as argument. Single cells are considered a special case of a Range.Both may be expressed either as a string or as a reference (= object) depending on the situation:
@@ -125,7 +119,6 @@
docB = ui.OpenDocument(r"C:\Documents\FileB.ods")docB.CopyToRange(docA.Range("SheetX.D4:F8"), "D2:F6")
-
SheetName
Either the sheet name as a string or an object produced by the .Sheet property.The shortcut "~" (tilde) represents the current sheet.
@@ -215,7 +208,6 @@
-
Properties
All the properties generic to any document are implicitly applicable also to Calc documents. For more information, read the Document service Help page.The properties specifically available for Calc documents are:
@@ -529,9 +521,7 @@
-
Visit %PRODUCTNAME API Documentation's website to learn more about XCellRange, XSheetCellCursor and XSpreadsheet UNO objects.
-
-
A1Style -----------------------------------------------------------------------------------------------
@@ -641,7 +631,6 @@
The method A1Style can be combined with any of the many properties and methods of the Calc service that require a range as argument, such as GetValue, GetFormula, ClearAll, etc.
-
Activate --------------------------------------------------------------------------------------------------------------------------
@@ -672,7 +661,6 @@
Activating a sheet makes sense only if it is performed on a Calc document. To make sure you have a Calc document at hand you can use the isCalc property of the document object, which returns True if it is a Calc document and False otherwise.
-
Charts ------------------------------------------------------------------------------------------------
@@ -721,7 +709,6 @@
bas.MsgBox(chart.ChartType)
-
ClearAll --------------------------------------------------------------------------------------------------------------------------
@@ -771,7 +758,6 @@
myDoc.ClearAll("SheetX.A1:J10", "=SUM(SheetX.A1:A10)>100", "COLUMN")
-
ClearFormats --------------------------------------------------------------------------------------------------------------------------
@@ -798,7 +784,6 @@
Refer to the ClearAll method documentation for examples on how to use the arguments filterformula and filterscope.
-
ClearValues --------------------------------------------------------------------------------------------------------------------------
@@ -825,7 +810,6 @@
Refer to the ClearAll method documentation for examples on how to use the arguments filterformula and filterscope.
-
CompactLeft -------------------------------------------------------------------------------------------
@@ -866,7 +850,6 @@
newrange = myDoc.CompactLeft("Sheet1.G1:L10", filterformula = '=(MOD(SUM(G1:G10);2)=1)')
-
CompactUp ---------------------------------------------------------------------------------------------
@@ -907,7 +890,6 @@
newrange = myDoc.CompactUp("Sheet1.G1:L10", filterformula = '=(MOD(SUM(G1:L1);2)=1)')
-
CopySheet --------------------------------------------------------------------------------------------------------------------------
@@ -949,7 +931,6 @@
To copy sheets between open documents, use CopySheet. To copy sheets from documents that are closed, use CopySheetFromFile.
-
CopySheetFromFile --------------------------------------------------------------------------------------------------------------------------
@@ -978,7 +959,6 @@
myDoc.CopySheetFromFile(r"C:\Documents\myFile.ods", "SheetX", "SheetY", 1)
-
CopyToCell --------------------------------------------------------------------------------------------------------------------------
@@ -1021,7 +1001,6 @@
To simulate a Copy/Paste from a range to a single cell, use CopyToCell. To simulate a Copy/Paste from a range to a larger range (with the same cells being replicated several times), use CopyToRange.
-
CopyToRange --------------------------------------------------------------------------------------------------------------------------
@@ -1069,7 +1048,6 @@
docB.CopyToRange(docA.Range("SheetX.A1:F10"), "SheetY.C5:J5")
-
CreateChart -------------------------------------------------------------------------------------------
@@ -1101,7 +1079,6 @@
Refer to the help page about ScriptForge's Chart service to learn more how to further manipulate chart objects. It is possible to change properties as the chart type, chart and axes titles and chart position.
-
CreatePivotTable ----------------------------------------------------------------------------------------
@@ -1162,7 +1139,6 @@
To learn more about Pivot Tables in %PRODUCTNAME Calc, read the Pivot Table help page.
-
DAvg, DCount, DMax, DMin, DSum --------------------------------------------------------------------------------------------------------------------------
@@ -1204,7 +1180,6 @@
Cells in the given range that contain text will be ignored by all of these functions. For example, the DCount method will not count cells with text, only numerical cells.
-
ExportRangeToFile ---------------------------------------------------------------------------------------
@@ -1237,7 +1212,6 @@
doc.ExportRangeToFile("SheetX.A1:D10", r"C:\Temp\image.png", "png", overwrite = True)
-
Forms -------------------------------------------------------------------------------------------
@@ -1279,7 +1253,6 @@
form_A = doc.Forms("Sheet1", "Form_A")
-
GetColumnName --------------------------------------------------------------------------------------------------------------------------
@@ -1306,7 +1279,6 @@
The maximum number of columns allowed on a Calc sheet is 16384.
-
GetFormula --------------------------------------------------------------------------------------------------------------------------
@@ -1332,7 +1304,6 @@
arrFormula = myDoc.GetFormula("~.A1:B3")
-
GetValue --------------------------------------------------------------------------------------------------------------------------
@@ -1357,7 +1328,6 @@
If a cell contains a date, the number corresponding to that date will be returned. To convert numeric values to dates in Basic scripts, use the Basic CDate builtin function. In Python scripts, use the CDate function from the Basic service.
-
ImportFromCSVFile --------------------------------------------------------------------------------------------------------------------------
@@ -1412,7 +1382,6 @@
To learn more about the CSV Filter Options, refer to the CSV Filter Options help page.
-
ImportFromDatabase --------------------------------------------------------------------------------------------------------------------------
@@ -1442,9 +1411,7 @@
myDoc.ImportFromDatabase(r"C:\Temp\myDbFile.odb", , "SheetY.C5", "SELECT * FROM [Employees] ORDER BY [LastName]")
-
-
InsertSheet --------------------------------------------------------------------------------------------------------------------------
@@ -1471,6 +1438,35 @@
+
+ Intersect --------------------------------------------------------------------------------------------------------------------------
+
+ Calc service;Intersect
+
+
Intersect
+ Returns the string representing the intersection between the two input ranges, or a zero-length string when the intersection is empty.
+
+
+ svc.Intersect(range1:str, range2: str): str
+
+
+ range1: The address string of range 1.
+ range2: The address string of range 2.
+
+ The following example intersects two ranges, and returns the common range between both of them:
+
+
+ Dim commonrange As String
+ commonrange = oDoc.Intersect("A1:D8", "C3:F4")
+ Print commonrange ' displays "$Sheet1.$C$3:$D$4"
+
+
+
+ common_range = myDoc.Intersect("A1:D8", "C3:F4")
+ print(common_range) # outputs '$Sheet1.$C$3:$D$4' to the Python shell
+
+
+
MoveRange --------------------------------------------------------------------------------------------------------------------------
@@ -1479,7 +1475,6 @@
MoveRange
Moves a specified source range to a destination range of cells. The method returns a string representing the modified range of cells. The dimension of the modified area is fully determined by the size of the source area.
-
svc.MoveRange(source: str, destination: str): str
@@ -1496,7 +1491,6 @@
myDoc.MoveRange("SheetX.A1:F10", "SheetY.C5")
-
MoveSheet --------------------------------------------------------------------------------------------------------------------------
@@ -1522,7 +1516,6 @@
myDoc.MoveSheet("SheetX", "SheetY")
-
Offset ------------------------------------------------------------------------------------------------
@@ -1557,7 +1550,6 @@
myDoc.Offset("A1", 2, 2, 5, 6)
-
OpenRangeSelector -------------------------------------------------------------------------------------
@@ -1587,7 +1579,6 @@
sRange = myDoc.OpenRangeSelector(title = "Select a range")
-
Printf ------------------------------------------------------------------------------------------------
@@ -1660,7 +1651,6 @@
myDoc.SetFormula("F1:F10", myDoc.Printf(sFormula, sRange))
-
PrintOut ----------------------------------------------------------------
@@ -1690,7 +1680,6 @@
# ...
-
RemoveDuplicates -------------------------------------------------------------------------------------
@@ -1727,7 +1716,6 @@
myDoc.RemoveDuplicates("A1:D10", columns = (1, 2), header = True, mode = "CLEAR")
-
RemoveSheet --------------------------------------------------------------------------------------------------------------------------
@@ -1751,7 +1739,6 @@
myDoc.RemoveSheet("SheetY")
-
RenameSheet --------------------------------------------------------------------------------------------------------------------------
@@ -1777,7 +1764,6 @@
mydoc.RenameSheet("~", "SheetY")
-
SetArray --------------------------------------------------------------------------------------------------------------------------
@@ -1818,7 +1804,6 @@
To dump the full contents of an array in a sheet, use SetArray. To dump the contents of an array only within the boundaries of the targeted range of cells, use SetValue.
-
SetCellStyle --------------------------------------------------------------------------------------------------------------------------
@@ -1848,7 +1833,6 @@
Refer to the ClearAll method documentation for examples on how to use the arguments filterformula and filterscope.
-
SetFormula --------------------------------------------------------------------------------------------------------------------------
@@ -1886,7 +1870,6 @@
myDoc.SetFormula("A1:D2", "=E1")
-
SetValue --------------------------------------------------------------------------------------------------------------------------
@@ -1933,7 +1916,6 @@
doc.SetValue(newRange, arrData)
-
ShiftDown ---------------------------------------------------------------------------------------------
@@ -1976,7 +1958,6 @@
bas.MsgBox(sNewRange)
-
ShiftLeft ---------------------------------------------------------------------------------------------
@@ -2011,7 +1992,6 @@
myDoc.ShiftLeft("A3:D6", WholeColumn = True)
-
ShiftUp -----------------------------------------------------------------------------------------------
@@ -2046,7 +2026,6 @@
myDoc.ShiftUp("A3:D6", wholerow = True)
-
ShiftRight ---------------------------------------------------------------------------------------------
@@ -2082,10 +2061,9 @@
myDoc.ShiftRight("A3:A6", wholecolumn = True)
-
SortRange --------------------------------------------------------------------------------------------------------------------------
-
+ Calc service;SortRange
SortRange
@@ -2101,7 +2079,7 @@
destinationcell: The destination cell of the sorted range of cells, as a string. If a range is given, only its top-left cell is considered. By default the source Range is overwritten.containsheader: When True, the first row/column is not sorted.casesensitive: Only for string comparisons. Default = False
- sortcolumns: When True, the columns are sorted from left to right. Default = False : rows are sorted from top to bottom.
+ sortcolumns: When True, the columns are sorted from left to right. Default = False: rows are sorted from top to bottom.
@@ -2113,7 +2091,6 @@
myDoc.SortRange("A2:J200", (1, 3), ("ASC", "DESC"), casesensitive = True)
-
@@ -2121,4 +2098,4 @@
-
+
\ No newline at end of file