schema,sw: enable ODF validation in all sw tests

Validate every ODT file that is exported via "reload" or "save".

Change-Id: I010965191159605924b89fe21b0b3d47123c13bd
Reviewed-on: https://gerrit.libreoffice.org/56607
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
This commit is contained in:
Michael Stahl
2018-06-28 16:05:30 +02:00
committed by Thorsten Behrens
parent 42edc8004f
commit 720d53ee66
3 changed files with 20 additions and 12 deletions

View File

@@ -2263,6 +2263,16 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
</rng:optional> </rng:optional>
</rng:define> </rng:define>
<!-- TODO no proposal -->
<rng:define name="draw-custom-shape-attlist" combine="interleave">
<rng:ref name="common-draw-rel-size-attlist"/>
</rng:define>
<!-- TODO no proposal -->
<rng:define name="style-page-layout-properties-attlist" combine="interleave">
<rng:ref name="style-graphic-fill-properties-attlist"/>
</rng:define>
<!-- just a test-case for user-defined attributes, move along, nothing to see here... --> <!-- just a test-case for user-defined attributes, move along, nothing to see here... -->
<rng:define name="style-table-cell-properties-attlist" combine="interleave"> <rng:define name="style-table-cell-properties-attlist" combine="interleave">
<rng:optional> <rng:optional>

View File

@@ -796,7 +796,8 @@ protected:
{ {
CPPUNIT_ASSERT_MESSAGE("Password set but not requested", xInteractionHandler->wasPasswordRequested()); CPPUNIT_ASSERT_MESSAGE("Password set but not requested", xInteractionHandler->wasPasswordRequested());
} }
if (mustValidate(filename)) if (mustValidate(filename) || aFilterName == "writer8"
|| aFilterName == "OpenDocument Text Flat XML")
{ {
if(aFilterName == "Office Open XML Text") if(aFilterName == "Office Open XML Text")
{ {
@@ -806,7 +807,6 @@ protected:
else if(aFilterName == "writer8" else if(aFilterName == "writer8"
|| aFilterName == "OpenDocument Text Flat XML") || aFilterName == "OpenDocument Text Flat XML")
{ {
// still a few validation errors
validate(maTempFile.GetFileName(), test::ODF); validate(maTempFile.GetFileName(), test::ODF);
} }
else if(aFilterName == "MS Word 97") else if(aFilterName == "MS Word 97")
@@ -838,6 +838,12 @@ protected:
if (!maFilterOptions.isEmpty()) if (!maFilterOptions.isEmpty())
aMediaDescriptor["FilterOptions"] <<= maFilterOptions; aMediaDescriptor["FilterOptions"] <<= maFilterOptions;
xStorable->storeToURL(rTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); xStorable->storeToURL(rTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
// TODO: for now, validate only ODF here
if (aFilterName == "writer8"
|| aFilterName == "OpenDocument Text Flat XML")
{
validate(rTempFile.GetFileName(), test::ODF);
}
} }
void finish() void finish()

View File

@@ -52,17 +52,9 @@ public:
return OString(filename).endsWith(".odt"); return OString(filename).endsWith(".odt");
} }
bool mustValidate(const char* filename) const override bool mustValidate(const char* /*filename*/) const override
{ {
std::vector<const char*> aBlacklist = { return true;
// These are known problems, they should be fixed one by one.
"fdo86963.odt",
"shape-relsize.odt",
"fdo60769.odt",
"fdo38244.odt"
};
return std::find(aBlacklist.begin(), aBlacklist.end(), filename) == aBlacklist.end();
} }
virtual std::unique_ptr<Resetter> preTest(const char* pFilename) override virtual std::unique_ptr<Resetter> preTest(const char* pFilename) override