sw/qa/extras/uiwriter/data/tdf131124_Extruded_Shape_Selection.odt |binary
 sw/qa/extras/uiwriter/data/tdf131124_Fontwork_Selection.odt       |binary
 sw/qa/extras/uiwriter/uiwriter11.cxx                              |   28 
++++++++++
 sw/source/uibase/uno/unotxvw.cxx                                  |    2 
 4 files changed, 30 insertions(+)

New commits:
commit 61d5485b76a323acf1c8c2d7eedb2637edea3be6
Author:     Regina Henschel <[email protected]>
AuthorDate: Sat Jan 3 16:19:51 2026 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Jan 9 22:08:26 2026 +0100

    tdf#131124 Handle ExtrudedCustomShape and FontWork
    
    ShellMode::ExtrudedCustomShape and ShellMode::FontWork were missing in
    the switch. Thus mxShapes and mxShape in the Export dialog were empty
    and maSize was zero.
    
    Change-Id: If4c2137ce85a0aef0613d9d79979cc9a58b5c115
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196456
    Tested-by: Jenkins
    Reviewed-by: Regina Henschel <[email protected]>
    (cherry picked from commit a8babea4ce7f07f969e58594ab5a5afc2d190e69)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196881
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sw/qa/extras/uiwriter/data/tdf131124_Extruded_Shape_Selection.odt 
b/sw/qa/extras/uiwriter/data/tdf131124_Extruded_Shape_Selection.odt
new file mode 100644
index 000000000000..5d2d0ef7bd1a
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf131124_Extruded_Shape_Selection.odt differ
diff --git a/sw/qa/extras/uiwriter/data/tdf131124_Fontwork_Selection.odt 
b/sw/qa/extras/uiwriter/data/tdf131124_Fontwork_Selection.odt
new file mode 100644
index 000000000000..8b3090d1ae65
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf131124_Fontwork_Selection.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter11.cxx 
b/sw/qa/extras/uiwriter/uiwriter11.cxx
index cc642e56d600..dfe2c60ffee5 100644
--- a/sw/qa/extras/uiwriter/uiwriter11.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter11.cxx
@@ -397,6 +397,34 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest11, 
testTdf162120AutoRTL)
                          getProperty<short>(getRun(getParagraph(1), 1), 
u"WritingMode"_ustr));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest11, testFontworkSelection)
+{
+    // Load a document with a Fontwork shape and select the shape
+    createSwDoc("tdf131124_Fontwork_Selection.odt");
+    dispatchCommand(mxComponent, u".uno:JumpToNextFrame"_ustr, {});
+
+    // Make sure the CurrentSelection of the document is not empty.
+    uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> 
xSelections(xModel->getCurrentSelection(),
+                                                        uno::UNO_QUERY);
+    // Without fix, this test would have failed here
+    CPPUNIT_ASSERT(xSelections.is());
+}
+
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest11, testExtrudedShapeSelection)
+{
+    // Load a document with an extruded custom shape and select the shape
+    createSwDoc("tdf131124_Extruded_Shape_Selection.odt");
+    dispatchCommand(mxComponent, u".uno:JumpToNextFrame"_ustr, {});
+
+    // Make sure the CurrentSelection of the document is not empty.
+    uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> 
xSelections(xModel->getCurrentSelection(),
+                                                        uno::UNO_QUERY);
+    // Without fix, this test would have failed here
+    CPPUNIT_ASSERT(xSelections.is());
+}
+
 } // end of anonymous namespace
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index e8577548ac34..12e6f0c562dc 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -321,6 +321,8 @@ uno::Any SwXTextView::getSelection()
             case ShellMode::DrawForm        :
             case ShellMode::DrawText        :
             case ShellMode::Bezier          :
+            case ShellMode::ExtrudedCustomShape:
+            case ShellMode::FontWork:
             {
                 uno::Reference< drawing::XShapes >  xShCol = 
drawing::ShapeCollection::create(
                         comphelper::getProcessComponentContext());

Reply via email to