Created attachment 180768 [details] File used in the unit test. The test below should fail in "save" but it does not. Problem is, that the validator produces for the double attribute not a string with "Error", but a string with "Fatal". So line if( aContentOUString.indexOf("Error") != -1 ) [https://opengrok.libreoffice.org/xref/core/test/source/bootstrapfixture.cxx?r=5200a736#239] does not catch the failure. I guess the line should be if (aContentOUString.indexOf("Error") != -1 || aContentOUString.indexOf("Fatal") != -1) With that change the test fails as expected. But I don't know whether such change will produce problems somewhere else. For reproducing the problem, the following unit test has to be added to file core/xmloff/qa/unit/draw.cxx and the attached file to core/xmloff/qa/unit/data CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextRotationPlusPre) { // import getComponent() = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf149551_verticalText.pptx", "com.sun.star.presentation.PresentationDocument"); // The file has a shape with attribute vert="vert" in <bodyPr> element. That generates a // TextPreRotateAngle attribute in CustomShapeGeometry. // Add a TextRotateAngle attribute. uno::Reference<drawing::XShape> xShape(getShape(0)); uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aGeomSeq; xShapeProps->getPropertyValue("CustomShapeGeometry") >>= aGeomSeq; auto aGeomVec(comphelper::sequenceToContainer< std::vector<beans::PropertyValue> >(aGeomSeq)); aGeomVec.push_back(comphelper::makePropertyValue("TextRotateAngle", sal_Int32(45))); aGeomSeq = comphelper::containerToSequence(aGeomVec); xShapeProps->setPropertyValue("CustomShapeGeometry", uno::Any(aGeomSeq)); // Save to ODF. Without the fix, a file format error was produced, because attribute // draw:text-rotate-angle was written twice, one from TextPreRotateAngle and the other from // TextRotateAngle. utl::TempFile aTempFile; save("impress8", aTempFile); }
If I add 'Fatal', I get this failure: D:/Build_2020/core/test/source/bootstrapfixture.cxx(242) : error : Assertion Test name: testTdf113696WriterImage::Load_Verify_Reload_Verify forced failure - C:\cygwin64\tmp\lu66564ojlvv.tmp: Fatal: The ODF package 'file:///C:/cygwin64/tmp/lu66564ojlvv.tmp' shall be a ZIP fi le! org.odftoolkit.odfdom.pkg.OdfValidationException; The ODF package 'file:///C:/cygwin64/tmp/lu66564ojlvv.tmp' shall be a ZIP file!
Xisco, we need your help here
Hi Regina, Is this issue still valid? I see you already created the unittests for bug 149551 in 7d06665b7f5e7a7d1e9ac608c3bb827003fa3cb4 and 6c635fb11af389d88f36d4bf6b43421af062086a...
The issue is valid in principle. But because after my fix https://cgit.freedesktop.org/libreoffice/core/commit/?id=aca189d118d4351b293c089cb26584eb898e1849 for bug 149551 the produced file is valid, you can see the problem only if you have a build from before that patch. I don't know a scenario which produces double attributes in current builds. And if one is detected, it would surely be fixed immediately. I only come across the problem when I tested, that my unit test fails before my patch was applied.
With https://slice-masters.io to a more difficult level. You will never feel bored, and you will definitely want to come back to "hunt" for more points and unlock interesting features.