This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch odf-devel
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 405b633a16bf98dccb6be6f484fa009c051bc774
Author: Jim Jagielski <[email protected]>
AuthorDate: Fri Oct 23 07:29:13 2026 -0400

    test/odf-validate: add fixtures for the DDE link and empty chart table fixes
---
 .../fixtures/chart-empty/AddInChart.ods            | Bin 0 -> 18045 bytes
 test/odf-validate/fixtures/chart-empty/checks.json |  10 ++++++
 test/odf-validate/fixtures/dde-link/Calc_Link.sxc  | Bin 0 -> 5410 bytes
 .../fixtures/dde-link/Calc_Link_cached.sxc         | Bin 0 -> 5403 bytes
 test/odf-validate/fixtures/dde-link/checks.json    |  14 +++++++++
 .../fixtures/normal-values5b/checks.json           |   5 +++
 test/odf-validate/fixtures/normal-values5b/make.py |  35 +++++++++++++++++++++
 .../fixtures/normal-values5b/normal5b.ods          | Bin 0 -> 20883 bytes
 8 files changed, 64 insertions(+)

diff --git a/test/odf-validate/fixtures/chart-empty/AddInChart.ods 
b/test/odf-validate/fixtures/chart-empty/AddInChart.ods
new file mode 100644
index 0000000000..01708ed7ba
Binary files /dev/null and 
b/test/odf-validate/fixtures/chart-empty/AddInChart.ods differ
diff --git a/test/odf-validate/fixtures/chart-empty/checks.json 
b/test/odf-validate/fixtures/chart-empty/checks.json
new file mode 100644
index 0000000000..e6b4e19c7e
--- /dev/null
+++ b/test/odf-validate/fixtures/chart-empty/checks.json
@@ -0,0 +1,10 @@
+[
+ {
+  "name": "chart_summary",
+  "expr": "[(n, o.EmbeddedObject.HasMainTitle, o.EmbeddedObject.Title.String, 
o.EmbeddedObject.hasInternalDataProvider(), o.EmbeddedObject.Diagram is not 
None) for sh in [doc.Sheets.getByIndex(0)] for n in sh.Charts.ElementNames for 
o in [sh.Charts.getByName(n)]]"
+ },
+ {
+  "name": "chart_ranges",
+  "expr": "[(n, [(a.Sheet,a.StartColumn,a.StartRow,a.EndColumn,a.EndRow) for a 
in sh.Charts.getByName(n).Ranges]) for sh in [doc.Sheets.getByIndex(0)] for n 
in sh.Charts.ElementNames]"
+ }
+]
\ No newline at end of file
diff --git a/test/odf-validate/fixtures/dde-link/Calc_Link.sxc 
b/test/odf-validate/fixtures/dde-link/Calc_Link.sxc
new file mode 100644
index 0000000000..086c04fe04
Binary files /dev/null and b/test/odf-validate/fixtures/dde-link/Calc_Link.sxc 
differ
diff --git a/test/odf-validate/fixtures/dde-link/Calc_Link_cached.sxc 
b/test/odf-validate/fixtures/dde-link/Calc_Link_cached.sxc
new file mode 100644
index 0000000000..d8d84cf32a
Binary files /dev/null and 
b/test/odf-validate/fixtures/dde-link/Calc_Link_cached.sxc differ
diff --git a/test/odf-validate/fixtures/dde-link/checks.json 
b/test/odf-validate/fixtures/dde-link/checks.json
new file mode 100644
index 0000000000..19de0f9905
--- /dev/null
+++ b/test/odf-validate/fixtures/dde-link/checks.json
@@ -0,0 +1,14 @@
+[
+ {
+  "name": "dde_links",
+  "expr": "[(n, doc.DDELinks.getByName(n).Application, 
doc.DDELinks.getByName(n).Topic, doc.DDELinks.getByName(n).Item) for n in 
doc.DDELinks.ElementNames]"
+ },
+ {
+  "name": "dde_cells",
+  "expr": "[(r,c,doc.Sheets.getByIndex(0).getCellByPosition(c,r).Formula) for 
r in range(8) for c in range(4) if 
doc.Sheets.getByIndex(0).getCellByPosition(c,r).Formula.startswith('=DDE')]"
+ },
+ {
+  "name": "dde_cell_result",
+  "expr": "[(cl.String, cl.Value, cl.getError()) for cl in 
[doc.Sheets.getByIndex(0).getCellByPosition(0,4)]]"
+ }
+]
\ No newline at end of file
diff --git a/test/odf-validate/fixtures/normal-values5b/checks.json 
b/test/odf-validate/fixtures/normal-values5b/checks.json
new file mode 100644
index 0000000000..42e0d4889a
--- /dev/null
+++ b/test/odf-validate/fixtures/normal-values5b/checks.json
@@ -0,0 +1,5 @@
+[
+ {"name": "series", "expr": "[(n, [(str(s.Symbol.Style.value), 
s.Symbol.Graphic is not None, [list(q.Values.getData()) for q in 
s.getDataSequences()]) for s in 
sh.Charts.getByName(n).EmbeddedObject.getFirstDiagram().getCoordinateSystems()[0].getChartTypes()[0].getDataSeries()])
 for sh in [doc.Sheets.getByIndex(0)] for n in sh.Charts.ElementNames]"},
+ {"name": "col_c_visible", "expr": 
"doc.Sheets.getByIndex(0).getColumns().getByIndex(2).IsVisible"},
+ {"name": "cells", "expr": 
"[[doc.Sheets.getByIndex(0).getCellByPosition(c,r).String for c in range(3)] 
for r in range(4)]"}
+]
diff --git a/test/odf-validate/fixtures/normal-values5b/make.py 
b/test/odf-validate/fixtures/normal-values5b/make.py
new file mode 100644
index 0000000000..ac3959b50d
--- /dev/null
+++ b/test/odf-validate/fixtures/normal-values5b/make.py
@@ -0,0 +1,35 @@
+# usage: runpy.sh fixtures/normal-values5b/make.py <port> <out.ods> 
<symbol.png>
+import sys, uno
+from unohelp import connect, desktop, pv
+from com.sun.star.awt import Rectangle
+from com.sun.star.table import CellRangeAddress
+
+port, out, png = int(sys.argv[1]), sys.argv[2], sys.argv[3]
+ctx = connect(port)
+d = desktop(ctx)
+doc = d.loadComponentFromURL("private:factory/scalc", "_blank", 0, 
(pv("Hidden", True),))
+sh = doc.Sheets.getByIndex(0)
+for r, row in enumerate([["", "a", "b"], ["x", 1, 2], ["y", 3, 5], ["z", 4, 
8]]):
+    for c, v in enumerate(row):
+        cell = sh.getCellByPosition(c, r)
+        if isinstance(v, str): cell.String = v
+        else: cell.Value = v
+rng = sh.getCellRangeByName("A1:C4").getRangeAddress()
+r = Rectangle(); r.X, r.Y, r.Width, r.Height = 8000, 1000, 9000, 7000
+sh.Charts.addNewByName("c1", r, (rng,), True, True)
+m = sh.Charts.getByName("c1").EmbeddedObject
+gp = 
ctx.ServiceManager.createInstanceWithContext("com.sun.star.graphic.GraphicProvider",
 ctx)
+g = gp.queryGraphic((pv("URL", uno.systemPathToFileUrl(png)),))
+series = 
m.getFirstDiagram().getCoordinateSystems()[0].getChartTypes()[0].getDataSeries()
+s = series[0]
+sym = s.Symbol
+sym.Style = uno.Enum("com.sun.star.chart2.SymbolStyle", "GRAPHIC")
+sym.Graphic = g
+s.Symbol = sym
+print("readback", s.Symbol.Style, s.Symbol.Graphic, g, s.SymbolBitmapURL if 
hasattr(s,"SymbolBitmapURL") else None)
+sh.getColumns().getByIndex(2).IsVisible = False
+rng2 = sh.getCellRangeByName("A1:C4").getRangeAddress()
+r2 = Rectangle(); r2.X, r2.Y, r2.Width, r2.Height = 8000, 9000, 9000, 7000
+sh.Charts.addNewByName("c2", r2, (rng2,), True, True)
+doc.storeToURL(uno.systemPathToFileUrl(out), (pv("FilterName", "calc8"),))
+doc.close(True)
diff --git a/test/odf-validate/fixtures/normal-values5b/normal5b.ods 
b/test/odf-validate/fixtures/normal-values5b/normal5b.ods
new file mode 100644
index 0000000000..3905aeee6b
Binary files /dev/null and 
b/test/odf-validate/fixtures/normal-values5b/normal5b.ods differ

Reply via email to