sw/qa/extras/docbookexport/data/tdf169122_Docbook_Example.xml |   37 ++++++++++
 sw/qa/extras/docbookexport/docbookexport.cxx                  |    9 ++
 xmloff/source/draw/sdpropls.cxx                               |   11 ++
 3 files changed, 57 insertions(+)

New commits:
commit a9cdf33f7c21a519dc53ee07b2df87c2137cdc50
Author:     Regina Henschel <[email protected]>
AuthorDate: Sat Nov 22 23:46:57 2025 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Nov 24 14:17:18 2025 +0100

    tdf#169122 no TextWritingMode if GraphicWritingMode2
    
    TextWritingMode and ControlWritingMode are suppressed when
    ShapeWritingMode exists.
    With commit c70ee4a6b9071468255e5d4fdb893e9c9bdf4fad we have in addition
    GraphicWritingMode2. Thus suppress them in that case too to avoid
    duplicate attributes.
    
    Change-Id: Ie7064e2dcea3a6dccc081f03bf027c1e7a261bfa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194371
    Reviewed-by: Regina Henschel <[email protected]>
    Tested-by: Jenkins
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194417

diff --git a/sw/qa/extras/docbookexport/data/tdf169122_Docbook_Example.xml 
b/sw/qa/extras/docbookexport/data/tdf169122_Docbook_Example.xml
new file mode 100644
index 000000000000..9077d6d242cc
--- /dev/null
+++ b/sw/qa/extras/docbookexport/data/tdf169122_Docbook_Example.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article
+  PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd";>
+<article lang="">
+   <para>Docbook: Borked?</para>
+   <para>Most indeedly<footnote>
+         <para>Yep, that's not a word.</para>
+      </footnote>, good sire</para>
+   <sect1>
+      <title>A Heading</title>
+      <para>This is a normal paragraph under a heading 1.</para>
+      <sect2>
+         <title>A 2nd-level Heading</title>
+         <para>This is a normal paragraph under a heading 2.</para>
+         <itemizedlist mark="disc">
+            <listitem>
+               <para>Bullet lists?</para>
+            </listitem>
+            <listitem>
+               <para>Bullet lists!</para>
+            </listitem>
+         </itemizedlist>
+      </sect2>
+      <sect2>
+         <title>Another 2nd-level Heading</title>
+         <para>This is yet another normal paragraph under a heading 3.</para>
+         <orderedlist>
+            <listitem>
+               <para>Numbered lists?</para>
+            </listitem>
+            <listitem>
+               <para>NUMBERED LISTS! WOO!</para>
+            </listitem>
+         </orderedlist>
+      </sect2>
+   </sect1>
+</article>
\ No newline at end of file
diff --git a/sw/qa/extras/docbookexport/docbookexport.cxx 
b/sw/qa/extras/docbookexport/docbookexport.cxx
index e7543d99577e..9f2191ef81d0 100644
--- a/sw/qa/extras/docbookexport/docbookexport.cxx
+++ b/sw/qa/extras/docbookexport/docbookexport.cxx
@@ -38,6 +38,15 @@ CPPUNIT_TEST_FIXTURE(DocbookExportTest, testtdf91095)
     CPPUNIT_ASSERT(pDoc);
 }
 
+CPPUNIT_TEST_FIXTURE(DocbookExportTest, testtdf169122_resave_docbook)
+{
+    // Without fix, resave of a docbook was not possible due to duplicate 
attributes.
+    createSwDoc("tdf169122_Docbook_Example.xml");
+    save(mpFilter);
+    xmlDocUniquePtr pDoc = parseXml(maTempFile);
+    CPPUNIT_ASSERT(pDoc);
+}
+
 } // end of anonymous namespace
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 2a987ad78e6c..b647867a2b32 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -1624,6 +1624,17 @@ void XMLShapeExportPropertyMapper::ContextFilter(
             }
         }
     }
+    else if (pGraphicWritingMode2) // tdf#169122
+    {
+        sal_Int16 eGraphicWritingMode;
+        if (pGraphicWritingMode2->maValue >>= eGraphicWritingMode)
+        {
+            if (pTextWritingMode)
+                pTextWritingMode->mnIndex = -1;
+            if (pControlWritingMode)
+                pControlWritingMode->mnIndex = -1;
+        }
+    }
 
     // do not export visual area for internal ole objects
     if( pOLEIsInternal )

Reply via email to