chart2/qa/extras/chart2export.cxx   |   22 +++++++++++-----------
 chart2/qa/extras/chart2export2.cxx  |   36 ++++++++++++++++++------------------
 chart2/qa/extras/chart2export3.cxx  |    8 ++++----
 chart2/qa/extras/chart2geometry.cxx |    2 +-
 include/test/unoapi_test.hxx        |    5 ++---
 oox/qa/unit/export.cxx              |    8 ++++----
 sc/qa/unit/scshapetest.cxx          |    2 +-
 sc/qa/unit/uicalc/uicalc.cxx        |    2 +-
 sd/qa/unit/export-tests.cxx         |    4 ++--
 9 files changed, 44 insertions(+), 45 deletions(-)

New commits:
commit 2640796d90ad4c69f5093e7b3353d43b647901e1
Author:     Xisco Fauli <[email protected]>
AuthorDate: Thu Nov 3 17:20:11 2022 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Thu Nov 3 23:22:14 2022 +0100

    UnoApiTest: make mbSkipValidation private
    
    Change-Id: Icc292b40b3295e7890f81d448bb4907725f46970
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142245
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index f58796a3219c..f287577fb63a 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -354,7 +354,7 @@ void Chart2ExportTest::testTrendline()
 {
     // Validation fails with
     // Error: tag name "chart:symbol-image" is not allowed. Possible tag names 
are: <label-separator>
-    mbSkipValidation = true;
+    skipValidation();
     loadFromURL(u"ods/trendline.ods");
     checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
     saveAndReload("calc8");
@@ -594,7 +594,7 @@ void Chart2ExportTest::testAreaChartLoad()
     loadFromURL(u"docx/testAreaChartLoad.docx");
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML 
Text");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -652,7 +652,7 @@ void Chart2ExportTest::testPieChartWallLineStyle()
     loadFromURL(u"odt/testPieChartWallLineStyle.odt");
 
     // FIXME: validation error in OOXML export: Errors: 9
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open 
XML Text");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -920,7 +920,7 @@ void Chart2ExportTest::testDataLabelBordersDOCX()
     aTest.checkObject2(xChartDoc);
 
     // FIXME: validation error in OOXML export: Errors: 3
-    mbSkipValidation = true;
+    skipValidation();
 
     saveAndReload("Office Open XML Text");
 
@@ -938,7 +938,7 @@ void Chart2ExportTest::testDataLabel3DChartDOCX()
     CPPUNIT_ASSERT(xChartDoc.is());
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML 
Text");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -972,7 +972,7 @@ void Chart2ExportTest::testDataLabelClusteredBarChartDOCX()
     CPPUNIT_ASSERT(xChartDoc.is());
 
     // FIXME: validation error in OOXML export: Errors: 9
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML 
Text");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1004,7 +1004,7 @@ void Chart2ExportTest::testDataLabelDoughnutChartDOCX()
     CPPUNIT_ASSERT(xChartDoc.is());
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML 
Text");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1022,7 +1022,7 @@ void Chart2ExportTest::testDataLabelAreaChartDOCX()
     CPPUNIT_ASSERT(xChartDoc.is());
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML 
Text");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1060,7 +1060,7 @@ void Chart2ExportTest::testIndividualDataLabelProps()
     loadFromURL(u"xlsx/tdf122915.xlsx");
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open 
XML");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1090,7 +1090,7 @@ void Chart2ExportTest::testShapeFollowedByChart()
     loadFromURL(u"docx/FDO74430.docx");
 
     // FIXME: validation error in OOXML export: Errors: 5
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/document", "Office Open XML 
Text" );
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1106,7 +1106,7 @@ void Chart2ExportTest::testPieChartDataLabels()
     loadFromURL(u"docx/PieChartDataLabels.docx");
 
     // FIXME: validation error in OOXML export: Errors: 19
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open 
XML Text");
     CPPUNIT_ASSERT(pXmlDoc);
diff --git a/chart2/qa/extras/chart2export2.cxx 
b/chart2/qa/extras/chart2export2.cxx
index 1d79de8e119a..dd9cb1bd978b 100644
--- a/chart2/qa/extras/chart2export2.cxx
+++ b/chart2/qa/extras/chart2export2.cxx
@@ -247,7 +247,7 @@ void Chart2ExportTest2::testCombinedChartSecondaryAxisODS()
 void Chart2ExportTest2::testCrossBetweenXLSX()
 {
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     // Original files were created with MS Office
     {
@@ -333,7 +333,7 @@ void Chart2ExportTest2::testAxisCrossBetweenDOCX()
     loadFromURL(u"odt/axis-position.odt");
 
     // FIXME: validation error in OOXML export: Errors: 3
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open 
XML Text");
     assertXPath(pXmlDoc, "(//c:crossBetween)[1]", "val", "midCat");
@@ -504,7 +504,7 @@ void Chart2ExportTest2::testDataSeriesName()
 void Chart2ExportTest2::testCustomPositionofDataLabel()
 {
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     loadFromURL(u"xlsx/testCustomPosDataLabels.xlsx");
     {
@@ -639,7 +639,7 @@ void Chart2ExportTest2::testCustomDataLabelMultipleSeries()
 void Chart2ExportTest2::testLeaderLines()
 {
     // FIXME: validation error in OOXML export: Errors: 2
-    mbSkipValidation = true;
+    skipValidation();
 
     loadFromURL(u"xlsx/testTdf90749.xlsx");
     {
@@ -903,7 +903,7 @@ void Chart2ExportTest2::testTdf122031()
     loadFromURL(u"xlsx/tdf122031.xlsx");
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -935,7 +935,7 @@ void Chart2ExportTest2::testTdf134118()
     loadFromURL(u"xlsx/tdf134118.xlsx");
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -951,7 +951,7 @@ void Chart2ExportTest2::testTdf123206_customLabelText()
     CPPUNIT_ASSERT(xChartDoc.is());
 
     // FIXME: validation error in OOXML export: Errors: 2
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open 
XML Text");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -970,7 +970,7 @@ void Chart2ExportTest2::testCustomLabelText()
     CPPUNIT_ASSERT(xChartDoc.is());
 
     // FIXME: validation error in OOXML export: Errors: 3
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open 
XML Text");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1173,7 +1173,7 @@ void Chart2ExportTest2::testTdf131979()
 void Chart2ExportTest2::testTdf132076()
 {
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     {
         loadFromURL(u"ods/tdf132076.ods");
@@ -1217,7 +1217,7 @@ void Chart2ExportTest2::testTdf133190()
     loadFromURL(u"xlsx/tdf133190_tdf133191.xlsx");
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1238,7 +1238,7 @@ void Chart2ExportTest2::testTdf133191()
     loadFromURL(u"xlsx/tdf133190_tdf133191.xlsx");
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1274,7 +1274,7 @@ void Chart2ExportTest2::testTdf134255()
     CPPUNIT_ASSERT(bWrap);
 
     // FIXME: validation error in OOXML export: Errors: 11
-    mbSkipValidation = true;
+    skipValidation();
 
     // export test
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open 
XML Text");
@@ -1303,7 +1303,7 @@ void Chart2ExportTest2::testTdf134977()
     CPPUNIT_ASSERT_EQUAL(static_cast<float>(9), nFontSize);
 
     // FIXME: validation error in OOXML export: Errors: 2
-    mbSkipValidation = true;
+    skipValidation();
 
     //export test
     xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
@@ -1328,7 +1328,7 @@ void Chart2ExportTest2::testTdf136267()
     loadFromURL(u"xlsx/tdf136267.xlsx");
 
     // FIXME: validation error in OOXML export: Errors: 2
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1360,7 +1360,7 @@ void Chart2ExportTest2::testTdf137917()
     loadFromURL(u"xlsx/tdf137917.xlsx");
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1429,7 +1429,7 @@ void Chart2ExportTest2::testTdf138204()
     }
 
     // FIXME: validation error in OOXML export: Errors: 2
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1621,7 +1621,7 @@ void Chart2ExportTest2::testTdf143942()
     }
 
     // FIXME: validation error in OOXML export: Errors: 4
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -1660,7 +1660,7 @@ void Chart2ExportTest2::testDateCategoriesPPTX()
     loadFromURL(u"pptx/bnc889755.pptx");
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress Office 
Open XML");
     CPPUNIT_ASSERT(pXmlDoc);
diff --git a/chart2/qa/extras/chart2export3.cxx 
b/chart2/qa/extras/chart2export3.cxx
index 62e003f5efc0..dd081f8e5b9b 100644
--- a/chart2/qa/extras/chart2export3.cxx
+++ b/chart2/qa/extras/chart2export3.cxx
@@ -133,7 +133,7 @@ void Chart2ExportTest3::testTdf108107()
     loadFromURL(u"xlsx/tdf108107.xlsx");
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -264,7 +264,7 @@ void Chart2ExportTest3::testFdo83058dlblPos()
     loadFromURL(u"docx/fdo83058_dlblPos.docx");
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML 
Text");
     CPPUNIT_ASSERT(pXmlDoc);
@@ -322,7 +322,7 @@ void Chart2ExportTest3::testAxisNumberFormatXLSX()
 void Chart2ExportTest3::testDataPointLabelNumberFormatXLSX()
 {
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     loadFromURL(u"ods/tdf123774.ods");
     {
@@ -709,7 +709,7 @@ void Chart2ExportTest3::testTableOnPage3()
     loadFromURL(u"docx/TableOnPage3.docx");
 
     // FIXME: validation error in OOXML export: Errors: 2
-    mbSkipValidation = true;
+    skipValidation();
 
     saveAndReload("Office Open XML Text");
 
diff --git a/chart2/qa/extras/chart2geometry.cxx 
b/chart2/qa/extras/chart2geometry.cxx
index 873d00a7f33e..bab696a15e9b 100644
--- a/chart2/qa/extras/chart2geometry.cxx
+++ b/chart2/qa/extras/chart2geometry.cxx
@@ -413,7 +413,7 @@ void Chart2GeometryTest::testTdf135366LabelExport()
     loadFromURL(u"odt/tdf135366_data_label_export.odt");
 
     // FIXME: Error: unexpected attribute "loext:label-stroke-color"
-    mbSkipValidation = true;
+    skipValidation();
 
     xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "writer8");
     CPPUNIT_ASSERT(pXmlDoc);
diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index 8c27437d237d..2b29e50a5bfd 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -40,17 +40,16 @@ public:
     utl::TempFileNamed saveAndClose(const OUString& rFilter);
     utl::TempFileNamed saveAndReload(const OUString& rFilter);
 
+    void skipValidation() { mbSkipValidation = true; }
     void setFilterOptions(const OUString& rFilterOptions) { maFilterOptions = 
rFilterOptions; }
 
 protected:
     // reference to document component that we are testing
     css::uno::Reference<css::lang::XComponent> mxComponent;
 
-    bool mbSkipValidation; // if you set this flag for a new test I'm going to 
haunt you!
-
 private:
+    bool mbSkipValidation;
     OUString m_aBaseString;
-
     OUString maFilterOptions;
 };
 
diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx
index 3b01de830343..157e8cd60e87 100644
--- a/oox/qa/unit/export.cxx
+++ b/oox/qa/unit/export.cxx
@@ -67,7 +67,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRotatedShapePosition)
     loadFromURL(u"tdf141786_RotatedShapeInGroup.odt");
 
     // FIXME: validation error in OOXML export: Errors: 3
-    mbSkipValidation = true;
+    skipValidation();
 
     // When saving that to DOCX:
     utl::TempFileNamed aTempFile = save("Office Open XML Text");
@@ -89,7 +89,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlGroupshapePolygon)
     loadFromURL(u"dml-groupshape-polygon.docx");
 
     // FIXME: validation error in OOXML export: Errors: 9
-    mbSkipValidation = true;
+    skipValidation();
 
     // When saving that to DOCX:
     utl::TempFileNamed aTempFile = save("Office Open XML Text");
@@ -110,7 +110,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomShapeArrowExport)
     loadFromURL(u"tdf142602_CustomShapeArrows.odt");
 
     // FIXME: validation error in OOXML export: Errors: 11
-    mbSkipValidation = true;
+    skipValidation();
 
     // When saving that to DOCX:
     utl::TempFileNamed aTempFile = save("Office Open XML Text");
@@ -572,7 +572,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109169_OctagonBevel)
     loadFromURL(u"tdf109169_OctagonBevel.odt");
 
     // FIXME: validation error in OOXML export: Errors: 1
-    mbSkipValidation = true;
+    skipValidation();
 
     // Export to docx had not written a:fill or a:stroke attributes at all.
     utl::TempFileNamed aTempFile = save("Office Open XML Text");
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index e641822beca1..8a2e97312ea3 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -1040,7 +1040,7 @@ void ScShapeTest::testTdf115655_HideDetail()
 
     // FIXME: validation fails with
     // Error: unexpected attribute "drawooo:display"
-    mbSkipValidation = true;
+    skipValidation();
 
     // Save and reload
     saveAndReload("calc8");
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 93f0391b32e8..052a3a2922d6 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1015,7 +1015,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf144244)
 
     // FIXME: validation fails with
     // Error: unexpected attribute "drawooo:display"
-    mbSkipValidation = true;
+    skipValidation();
 
     // Without the fix in place, this test would have crashed
     saveAndReload("calc8");
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index b1b202a234b8..4397f4bef873 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -584,7 +584,7 @@ void SdExportTest::testOOoXMLAnimations()
     loadFromURL(u"sxi/ooo41061-1.sxi");
 
     // FIXME: Error: unexpected attribute "presentation:preset-property"
-    mbSkipValidation = true;
+    skipValidation();
 
     utl::TempFileNamed aTempFile = save("impress8");
 
@@ -654,7 +654,7 @@ void SdExportTest::testUnknownAttributes()
     loadFromURL(u"unknown-attribute.fodp");
 
     // FIXME: Error: unexpected attribute "foo:non-existent-att"
-    mbSkipValidation = true;
+    skipValidation();
 
     utl::TempFileNamed aTempFile = save("impress8");
 

Reply via email to