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
The following commit(s) were added to refs/heads/odf-devel by this push:
new 752f5d4053 test/odf-validate: fill in expected values for the fill and
grid-snap fixtures
752f5d4053 is described below
commit 752f5d4053629f0cfd1c453d17dc440d42e1035d
Author: Jim Jagielski <[email protected]>
AuthorDate: Fri Oct 23 10:32:50 2026 -0400
test/odf-validate: fill in expected values for the fill and grid-snap
fixtures
The grid-snap check leaves out StandardPageMode, which is not restored on
reload.
---
test/odf-validate/fixtures/fill-others/calc.json | 34 ++++++-
test/odf-validate/fixtures/fill-others/draw.json | 30 +++++-
.../odf-validate/fixtures/fill-others/impress.json | 46 ++++++++-
test/odf-validate/fixtures/fill-others/writer.json | 64 +++++++++++-
test/odf-validate/fixtures/grid-snap/checks.json | 22 ++++-
test/odf-validate/fixtures/page-fill/bitmap.json | 19 +++-
test/odf-validate/fixtures/page-fill/checks.json | 108 ++++++++++++++++++++-
7 files changed, 307 insertions(+), 16 deletions(-)
diff --git a/test/odf-validate/fixtures/fill-others/calc.json
b/test/odf-validate/fixtures/fill-others/calc.json
index add9a3ccd9..5d05a5243b 100644
--- a/test/odf-validate/fixtures/fill-others/calc.json
+++ b/test/odf-validate/fixtures/fill-others/calc.json
@@ -1,14 +1,42 @@
[
{
"name": "cell",
- "expr": "[(c.String, c.CellBackColor, c.IsCellBackgroundTransparent) for c
in [doc.Sheets.getByIndex(0).getCellByPosition(0,0),
doc.Sheets.getByIndex(0).getCellByPosition(2,2)]]"
+ "expr": "[(c.String, c.CellBackColor, c.IsCellBackgroundTransparent) for c
in [doc.Sheets.getByIndex(0).getCellByPosition(0,0),
doc.Sheets.getByIndex(0).getCellByPosition(2,2)]]",
+ "expect": [
+ [
+ "cell",
+ 16763904,
+ false
+ ],
+ [
+ "",
+ -1,
+ true
+ ]
+ ]
},
{
"name": "page_style",
- "expr": "[(s.BackColor, s.IsBackgroundTransparent) for s in
[doc.StyleFamilies.getByName('PageStyles').getByName('Default')]]"
+ "expr": "[(s.BackColor, s.IsBackgroundTransparent) for s in
[doc.StyleFamilies.getByName('PageStyles').getByName('Default')]]",
+ "expect": [
+ [
+ 14544639,
+ false
+ ]
+ ]
},
{
"name": "shapes",
- "expr": "[(s.String, s.FillStyle.value, s.FillColor,
s.FillGradient.StartColor, s.FillGradient.EndColor, s.FillTransparence) for i
in range(doc.Sheets.getByIndex(0).DrawPage.Count) for s in
[doc.Sheets.getByIndex(0).DrawPage.getByIndex(i)]]"
+ "expr": "[(s.String, s.FillStyle.value, s.FillColor,
s.FillGradient.StartColor, s.FillGradient.EndColor, s.FillTransparence) for i
in range(doc.Sheets.getByIndex(0).DrawPage.Count) for s in
[doc.Sheets.getByIndex(0).DrawPage.getByIndex(i)]]",
+ "expect": [
+ [
+ "calc shape",
+ "GRADIENT",
+ 13625333,
+ 16711680,
+ 255,
+ 0
+ ]
+ ]
}
]
\ No newline at end of file
diff --git a/test/odf-validate/fixtures/fill-others/draw.json
b/test/odf-validate/fixtures/fill-others/draw.json
index e27850cfe8..5a2f141e39 100644
--- a/test/odf-validate/fixtures/fill-others/draw.json
+++ b/test/odf-validate/fixtures/fill-others/draw.json
@@ -1,10 +1,36 @@
[
{
"name": "shapes",
- "expr": "[(s.String, s.FillStyle.value, s.FillColor,
s.FillGradient.StartColor, s.FillGradient.EndColor, s.FillTransparence) for i
in range(doc.DrawPages.getByIndex(0).Count) for s in
[doc.DrawPages.getByIndex(0).getByIndex(i)]]"
+ "expr": "[(s.String, s.FillStyle.value, s.FillColor,
s.FillGradient.StartColor, s.FillGradient.EndColor, s.FillTransparence) for i
in range(doc.DrawPages.getByIndex(0).Count) for s in
[doc.DrawPages.getByIndex(0).getByIndex(i)]]",
+ "expect": [
+ [
+ "draw solid",
+ "SOLID",
+ 3385941,
+ 8421504,
+ 16777215,
+ 0
+ ],
+ [
+ "draw grad",
+ "GRADIENT",
+ 13625333,
+ 16711680,
+ 255,
+ 0
+ ]
+ ]
},
{
"name": "background",
- "expr": "[(b.FillStyle.value, b.FillColor, b.FillGradient.StartColor,
b.FillGradient.EndColor) for b in [doc.DrawPages.getByIndex(0).Background]] if
doc.DrawPages.getByIndex(0).Background is not None else None"
+ "expr": "[(b.FillStyle.value, b.FillColor, b.FillGradient.StartColor,
b.FillGradient.EndColor) for b in [doc.DrawPages.getByIndex(0).Background]] if
doc.DrawPages.getByIndex(0).Background is not None else None",
+ "expect": [
+ [
+ "GRADIENT",
+ 13625333,
+ 0,
+ 16777215
+ ]
+ ]
}
]
\ No newline at end of file
diff --git a/test/odf-validate/fixtures/fill-others/impress.json
b/test/odf-validate/fixtures/fill-others/impress.json
index e27850cfe8..081d5230c6 100644
--- a/test/odf-validate/fixtures/fill-others/impress.json
+++ b/test/odf-validate/fixtures/fill-others/impress.json
@@ -1,10 +1,52 @@
[
{
"name": "shapes",
- "expr": "[(s.String, s.FillStyle.value, s.FillColor,
s.FillGradient.StartColor, s.FillGradient.EndColor, s.FillTransparence) for i
in range(doc.DrawPages.getByIndex(0).Count) for s in
[doc.DrawPages.getByIndex(0).getByIndex(i)]]"
+ "expr": "[(s.String, s.FillStyle.value, s.FillColor,
s.FillGradient.StartColor, s.FillGradient.EndColor, s.FillTransparence) for i
in range(doc.DrawPages.getByIndex(0).Count) for s in
[doc.DrawPages.getByIndex(0).getByIndex(i)]]",
+ "expect": [
+ [
+ "",
+ "NONE",
+ 13625333,
+ 0,
+ 16777215,
+ 0
+ ],
+ [
+ "",
+ "NONE",
+ 16777215,
+ 0,
+ 16777215,
+ 0
+ ],
+ [
+ "impress solid",
+ "SOLID",
+ 3385941,
+ 8421504,
+ 16777215,
+ 0
+ ],
+ [
+ "impress grad",
+ "GRADIENT",
+ 13625333,
+ 16711680,
+ 255,
+ 0
+ ]
+ ]
},
{
"name": "background",
- "expr": "[(b.FillStyle.value, b.FillColor, b.FillGradient.StartColor,
b.FillGradient.EndColor) for b in [doc.DrawPages.getByIndex(0).Background]] if
doc.DrawPages.getByIndex(0).Background is not None else None"
+ "expr": "[(b.FillStyle.value, b.FillColor, b.FillGradient.StartColor,
b.FillGradient.EndColor) for b in [doc.DrawPages.getByIndex(0).Background]] if
doc.DrawPages.getByIndex(0).Background is not None else None",
+ "expect": [
+ [
+ "SOLID",
+ 13430527,
+ 0,
+ 16777215
+ ]
+ ]
}
]
\ No newline at end of file
diff --git a/test/odf-validate/fixtures/fill-others/writer.json
b/test/odf-validate/fixtures/fill-others/writer.json
index b769f610e2..a5be1f28e3 100644
--- a/test/odf-validate/fixtures/fill-others/writer.json
+++ b/test/odf-validate/fixtures/fill-others/writer.json
@@ -1,18 +1,74 @@
[
{
"name": "frames",
- "expr": "[(f.Text.String, f.FillStyle.value, f.FillColor,
f.FillGradient.StartColor, f.FillGradient.EndColor, f.BackColor,
f.BackTransparent) for n in doc.TextFrames.ElementNames for f in
[doc.TextFrames.getByName(n)]]"
+ "expr": "[(f.Text.String, f.FillStyle.value, f.FillColor,
f.FillGradient.StartColor, f.FillGradient.EndColor, f.BackColor,
f.BackTransparent) for n in doc.TextFrames.ElementNames for f in
[doc.TextFrames.getByName(n)]]",
+ "expect": [
+ [
+ "frame solid",
+ "SOLID",
+ 3385941,
+ 0,
+ 16777215,
+ 3385941,
+ false
+ ],
+ [
+ "frame gradient",
+ "GRADIENT",
+ 13625333,
+ 16711680,
+ 255,
+ 8388736,
+ false
+ ]
+ ]
},
{
"name": "table",
- "expr": "[(c, t.getCellByName(c).BackColor,
t.getCellByName(c).BackTransparent) for t in [doc.TextTables.getByIndex(0)] for
c in ('A1','B1','A2')] + [doc.TextTables.getByIndex(0).BackColor]"
+ "expr": "[(c, t.getCellByName(c).BackColor,
t.getCellByName(c).BackTransparent) for t in [doc.TextTables.getByIndex(0)] for
c in ('A1','B1','A2')] + [doc.TextTables.getByIndex(0).BackColor]",
+ "expect": [
+ [
+ "A1",
+ 16763904,
+ false
+ ],
+ [
+ "B1",
+ 16755404,
+ false
+ ],
+ [
+ "A2",
+ -1,
+ true
+ ],
+ 13434828
+ ]
},
{
"name": "section",
- "expr": "[(s.BackColor, s.BackTransparent) for s in
[doc.TextSections.getByIndex(0)]]"
+ "expr": "[(s.BackColor, s.BackTransparent) for s in
[doc.TextSections.getByIndex(0)]]",
+ "expect": [
+ [
+ 13421823,
+ false
+ ]
+ ]
},
{
"name": "paras",
- "expr": "[(p.String, p.ParaBackColor, p.ParaBackTransparent) for e in
[doc.Text.createEnumeration()] for p in iter(lambda: e.nextElement() if
e.hasMoreElements() else None, None) if
p.supportsService('com.sun.star.text.Paragraph')]"
+ "expr": "[(p.String, p.ParaBackColor, p.ParaBackTransparent) for e in
[doc.Text.createEnumeration()] for p in iter(lambda: e.nextElement() if
e.hasMoreElements() else None, None) if
p.supportsService('com.sun.star.text.Paragraph')]",
+ "expect": [
+ [
+ "",
+ -3151883,
+ true
+ ],
+ [
+ "",
+ -3151883,
+ true
+ ]
+ ]
}
]
\ No newline at end of file
diff --git a/test/odf-validate/fixtures/grid-snap/checks.json
b/test/odf-validate/fixtures/grid-snap/checks.json
index a69da6680b..3d42a4efc0 100644
--- a/test/odf-validate/fixtures/grid-snap/checks.json
+++ b/test/odf-validate/fixtures/grid-snap/checks.json
@@ -1,6 +1,26 @@
[
{
"name": "page_grid",
- "expr": "[(n, ps.GridMode, ps.StandardPageMode, ps.GridBaseWidth,
ps.GridSnapToChars) for n in ('G_snap_on','G_snap_off','G_lines_off') for ps in
[doc.StyleFamilies.getByName('PageStyles').getByName(n)]]"
+ "expr": "[(n, ps.GridMode, ps.GridBaseWidth, ps.GridSnapToChars) for n in
('G_snap_on','G_snap_off','G_lines_off') for ps in
[doc.StyleFamilies.getByName('PageStyles').getByName(n)]]",
+ "expect": [
+ [
+ "G_snap_on",
+ 2,
+ 706,
+ true
+ ],
+ [
+ "G_snap_off",
+ 2,
+ 706,
+ false
+ ],
+ [
+ "G_lines_off",
+ 1,
+ 706,
+ false
+ ]
+ ]
}
]
diff --git a/test/odf-validate/fixtures/page-fill/bitmap.json
b/test/odf-validate/fixtures/page-fill/bitmap.json
index a7ef3362d8..59ba352e8f 100644
--- a/test/odf-validate/fixtures/page-fill/bitmap.json
+++ b/test/odf-validate/fixtures/page-fill/bitmap.json
@@ -1,6 +1,23 @@
[
{
"name": "page_bitmap",
- "expr": "[(pre or 'page', ('GraphicObject:0000' not in u and
'GraphicObject:' in u), g.getPropertyValue(pre+'FillStyle').value) for g in
[doc.StyleFamilies.getByName('PageStyles').getByName('P_bitmap')] for pre in
('', 'Header', 'Footer') for u in [g.getPropertyValue(pre+'BackGraphicURL')]]"
+ "expr": "[(pre or 'page', ('GraphicObject:0000' not in u and
'GraphicObject:' in u), g.getPropertyValue(pre+'FillStyle').value) for g in
[doc.StyleFamilies.getByName('PageStyles').getByName('P_bitmap')] for pre in
('', 'Header', 'Footer') for u in [g.getPropertyValue(pre+'BackGraphicURL')]]",
+ "expect": [
+ [
+ "page",
+ true,
+ "BITMAP"
+ ],
+ [
+ "Header",
+ true,
+ "BITMAP"
+ ],
+ [
+ "Footer",
+ true,
+ "BITMAP"
+ ]
+ ]
}
]
\ No newline at end of file
diff --git a/test/odf-validate/fixtures/page-fill/checks.json
b/test/odf-validate/fixtures/page-fill/checks.json
index f82b9e3c41..b3816b7277 100644
--- a/test/odf-validate/fixtures/page-fill/checks.json
+++ b/test/odf-validate/fixtures/page-fill/checks.json
@@ -1,14 +1,116 @@
[
{
"name": "page_fill",
- "expr": "[(n, s.BackColor, s.BackTransparent, s.FillStyle.value,
s.FillColor, s.FillTransparence) for n in
('P_solid','P_transp','P_grad','P_bitmap') for s in
[doc.StyleFamilies.getByName('PageStyles').getByName(n)]]"
+ "expr": "[(n, s.BackColor, s.BackTransparent, s.FillStyle.value,
s.FillColor, s.FillTransparence) for n in
('P_solid','P_transp','P_grad','P_bitmap') for s in
[doc.StyleFamilies.getByName('PageStyles').getByName(n)]]",
+ "expect": [
+ [
+ "P_solid",
+ 6737151,
+ false,
+ "SOLID",
+ 6737151,
+ 0
+ ],
+ [
+ "P_transp",
+ 1701235967,
+ false,
+ "SOLID",
+ 6737151,
+ 40
+ ],
+ [
+ "P_grad",
+ 8388736,
+ false,
+ "GRADIENT",
+ 8388736,
+ 0
+ ],
+ [
+ "P_bitmap",
+ -1,
+ true,
+ "BITMAP",
+ 13625333,
+ 0
+ ]
+ ]
},
{
"name": "hf_fill",
- "expr": "[(n, s.HeaderBackColor, s.HeaderFillStyle.value, s.HeaderFillColor,
s.HeaderFillTransparence, s.FooterBackColor, s.FooterFillStyle.value,
s.FooterFillColor, s.FooterFillTransparence) for n in
('P_solid','P_transp','P_grad','P_bitmap') for s in
[doc.StyleFamilies.getByName('PageStyles').getByName(n)]]"
+ "expr": "[(n, s.HeaderBackColor, s.HeaderFillStyle.value, s.HeaderFillColor,
s.HeaderFillTransparence, s.FooterBackColor, s.FooterFillStyle.value,
s.FooterFillColor, s.FooterFillTransparence) for n in
('P_solid','P_transp','P_grad','P_bitmap') for s in
[doc.StyleFamilies.getByName('PageStyles').getByName(n)]]",
+ "expect": [
+ [
+ "P_solid",
+ 13434726,
+ "SOLID",
+ 13434726,
+ 0,
+ 16737996,
+ "SOLID",
+ 16737996,
+ 0
+ ],
+ [
+ "P_transp",
+ 1707933542,
+ "SOLID",
+ 13434726,
+ 40,
+ 1711236812,
+ "SOLID",
+ 16737996,
+ 40
+ ],
+ [
+ "P_grad",
+ 8388736,
+ "GRADIENT",
+ 8388736,
+ 0,
+ 16777164,
+ "HATCH",
+ 16777164,
+ 0
+ ],
+ [
+ "P_bitmap",
+ -1,
+ "BITMAP",
+ 13625333,
+ 0,
+ -1,
+ "BITMAP",
+ 13625333,
+ 0
+ ]
+ ]
},
{
"name": "page_desc_names",
- "expr": "[(p.String, p.PageDescName) for e in [doc.Text.createEnumeration()]
for p in iter(lambda: e.nextElement() if e.hasMoreElements() else None, None)]"
+ "expr": "[(p.String, p.PageDescName) for e in [doc.Text.createEnumeration()]
for p in iter(lambda: e.nextElement() if e.hasMoreElements() else None, None)]",
+ "expect": [
+ [
+ "page P_solid",
+ "P_solid"
+ ],
+ [
+ "page P_transp",
+ "P_transp"
+ ],
+ [
+ "page P_grad",
+ "P_grad"
+ ],
+ [
+ "page P_bitmap",
+ "P_bitmap"
+ ],
+ [
+ "",
+ null
+ ]
+ ]
}
]
\ No newline at end of file