summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/odfexport/data/fdo86963.odtbin0 -> 39845 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx8
-rw-r--r--sw/source/core/unocore/unodraw.cxx13
3 files changed, 19 insertions, 2 deletions
diff --git a/sw/qa/extras/odfexport/data/fdo86963.odt b/sw/qa/extras/odfexport/data/fdo86963.odt
new file mode 100644
index 000000000000..72896e13995b
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/fdo86963.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index d7360ba7651a..2a706b656770 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -451,6 +451,14 @@ DECLARE_ODFEXPORT_TEST(testImageWithSpecialID, "document_with_two_images_with_sp
}
}
+DECLARE_ODFEXPORT_TEST(testFdo86963, "fdo86963.odt")
+{
+ // Export of this document failed with beans::UnknownPropertyException.
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount());
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index b4e0b0bbb68f..9b097640b2d4 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1764,8 +1764,17 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
const SdrObject* pObj = pFmt->FindRealSdrObject();
if (pObj)
{
- std::set<const SwFrmFmt*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pFmt->GetDoc());
- aRet <<= SwTextBoxHelper::getOrdNum(pObj, aTextBoxes);
+ bool bConvert = true;
+ if (SvxShape* pSvxShape = GetSvxShape())
+ // In case of group shapes, pSvxShape points to the child shape, while pObj points to the outermost group shape.
+ if (pSvxShape->GetSdrObject() != pObj)
+ // Textboxes are not expected inside group shapes, so no conversion is necessary there.
+ bConvert = false;
+ if (bConvert)
+ {
+ std::set<const SwFrmFmt*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pFmt->GetDoc());
+ aRet <<= SwTextBoxHelper::getOrdNum(pObj, aTextBoxes);
+ }
}
}
}