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 <rb.henschel@t-online.de>
This commit is contained in:
Regina Henschel
2026-01-08 22:13:57 +01:00
parent d5702c96a4
commit a8babea4ce
4 changed files with 30 additions and 0 deletions
+28
View File
@@ -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();
+2
View File
@@ -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());