sw/qa/extras/htmlexport/data/img_with_border.fodt |   24 ++++++++++++++++++++++
 sw/qa/extras/htmlexport/htmlexport2.cxx           |   14 ++++++++++++
 sw/source/filter/html/htmlflywriter.cxx           |    3 ++
 3 files changed, 41 insertions(+)

New commits:
commit 75135c6c7d43b9d4f979a026cdd2529209cb9dea
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Fri Mar 7 16:55:18 2025 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Fri Mar 7 15:02:48 2025 +0100

    ReqIF export: avoid writing border properties
    
    Change-Id: I05e7ba3fda54300f99fd2121aaa5d167dd27851c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182617
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/sw/qa/extras/htmlexport/data/img_with_border.fodt 
b/sw/qa/extras/htmlexport/data/img_with_border.fodt
new file mode 100644
index 000000000000..fd3fbfe36dcd
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/img_with_border.fodt
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:styles>
+  <style:style style:name="Graphics" style:family="graphic">
+   <style:graphic-properties svg:x="0" svg:y="0" style:vertical-pos="top" 
style:vertical-rel="paragraph" style:horizontal-pos="center" 
style:horizontal-rel="paragraph" fo:padding="0.5mm" fo:border="0.06pt solid 
#000000"/>
+  </style:style>
+ </office:styles>
+ <office:body>
+  <office:text>
+   <text:p><draw:frame draw:style-name="Graphics" draw:name="1px" 
text:anchor-type="char" svg:width="1cm" svg:height="1cm"><draw:image 
draw:mime-type="image/png">
+      
<office:binary-data>iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1B
+       AACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAFBhaW50Lk5F
+       VCA1LjEuNBLfpoMAAAC2ZVhJZklJKgAIAAAABQAaAQUAAQAAAEoAAAAbAQUAAQAAAFIAAAAo
+       AQMAAQAAAAIAAAAxAQIAEAAAAFoAAABphwQAAQAAAGoAAAAAAAAAYAAAAAEAAABgAAAAAQAA
+       AFBhaW50Lk5FVCA1LjEuNAADAACQBwAEAAAAMDIzMAGgAwABAAAAAQAAAAWgBAABAAAAlAAA
+       AAAAAAACAAEAAgAEAAAAUjk4AAIABwAEAAAAMDEwMAAAAADX5rshveZftAAAAAxJREFUGFdj
+       +P//PwAF/gL+pzWBhAAAAABJRU5ErkJg
+      </office:binary-data>
+     </draw:image>
+    </draw:frame></text:p>
+  </office:text>
+ </office:body>
+</office:document>
\ No newline at end of file
diff --git a/sw/qa/extras/htmlexport/htmlexport2.cxx 
b/sw/qa/extras/htmlexport/htmlexport2.cxx
index 550c9644af97..75ee544f5875 100644
--- a/sw/qa/extras/htmlexport/htmlexport2.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport2.cxx
@@ -1622,6 +1622,20 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, 
testReqifNoTargetInA)
     assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:a", "target");
 }
 
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifNoObjectBorderExport)
+{
+    // Given a document with an image with black border
+    createSwDoc("img_with_border.fodt");
+
+    // When exporting to XHTML:
+    ExportToReqif();
+
+    // Check that there's no 'font' element that used to be exported, 
containing the border color:
+    xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile();
+    // Without the accompanying fix in place, this test would have failed
+    assertXPath(pXmlDoc, "//reqif-xhtml:font", 0);
+}
+
 } // end of anonymous namespace
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/filter/html/htmlflywriter.cxx 
b/sw/source/filter/html/htmlflywriter.cxx
index 0ff0183248e9..a67f71ee584a 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -1353,6 +1353,9 @@ SwHTMLWriter& OutHTML_ImageStart( HtmlWriter& rHtml, 
SwHTMLWriter& rWrt, const S
         }
     }
 
+    if (rWrt.mbReqIF)
+        nFrameOpts &= ~HtmlFrmOpts::Border;
+
     // <font color = ...>...<img ... >...</font>
     sal_uInt16 nBorderWidth = 0;
     const SvxBoxItem* pBoxItem;

Reply via email to