summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-06 15:25:54 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-08 13:39:50 +0000
commit204d1093d4954596cc7d7578e0630648f1f678f5 (patch)
treec21302318b0d0f0416418d3582cc21856255d83e /xmloff
parent6864e3fc586f31376ffa11ac79dd159c72150cf1 (diff)
only try to export text:p for elements that really support it
Change-Id: Ie2c072c67ecaa0c0ec45c804ebbd4b3bcd631a13 Reviewed-on: https://gerrit.libreoffice.org/15172 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/shapeexport.cxx36
1 files changed, 23 insertions, 13 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 7e2b5d64d4d7..2d0506c6afc0 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -121,6 +121,27 @@ using namespace ::com::sun::star;
using namespace ::xmloff::EnhancedCustomShapeToken;
using namespace ::xmloff::token;
+namespace {
+
+bool supportsText(XmlShapeType eShapeType)
+{
+ return eShapeType != XmlShapeTypePresChartShape &&
+ eShapeType != XmlShapeTypePresOLE2Shape &&
+ eShapeType != XmlShapeTypeDrawSheetShape &&
+ eShapeType != XmlShapeTypePresSheetShape &&
+ eShapeType != XmlShapeTypeDraw3DSceneObject &&
+ eShapeType != XmlShapeTypeDraw3DCubeObject &&
+ eShapeType != XmlShapeTypeDraw3DSphereObject &&
+ eShapeType != XmlShapeTypeDraw3DLatheObject &&
+ eShapeType != XmlShapeTypeDraw3DExtrudeObject &&
+ eShapeType != XmlShapeTypeDrawPageShape &&
+ eShapeType != XmlShapeTypePresPageShape &&
+ eShapeType != XmlShapeTypeDrawGroupShape;
+
+}
+
+}
+
XMLShapeExport::XMLShapeExport(SvXMLExport& rExp,
SvXMLExportPropertyMapper *pExtMapper )
: mrExport( rExp ),
@@ -267,18 +288,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap
// #i118485# enabled XmlShapeTypeDrawChartShape and XmlShapeTypeDrawOLE2Shape
// to have text
const bool bObjSupportsText =
- aShapeInfo.meShapeType != XmlShapeTypePresChartShape &&
- aShapeInfo.meShapeType != XmlShapeTypePresOLE2Shape &&
- aShapeInfo.meShapeType != XmlShapeTypeDrawSheetShape &&
- aShapeInfo.meShapeType != XmlShapeTypePresSheetShape &&
- aShapeInfo.meShapeType != XmlShapeTypeDraw3DSceneObject &&
- aShapeInfo.meShapeType != XmlShapeTypeDraw3DCubeObject &&
- aShapeInfo.meShapeType != XmlShapeTypeDraw3DSphereObject &&
- aShapeInfo.meShapeType != XmlShapeTypeDraw3DLatheObject &&
- aShapeInfo.meShapeType != XmlShapeTypeDraw3DExtrudeObject &&
- aShapeInfo.meShapeType != XmlShapeTypeDrawPageShape &&
- aShapeInfo.meShapeType != XmlShapeTypePresPageShape &&
- aShapeInfo.meShapeType != XmlShapeTypeDrawGroupShape;
+ supportsText(aShapeInfo.meShapeType);
const bool bObjSupportsStyle =
aShapeInfo.meShapeType != XmlShapeTypeDrawGroupShape;
@@ -2790,7 +2800,7 @@ void XMLShapeExport::ImpExportOLE2Shape(
if( !sClassId.isEmpty() )
mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_CLASS_ID, sClassId );
- if(eShapeType != XmlShapeTypePresChartShape && eShapeType != XmlShapeTypeDrawChartShape)
+ if(supportsText(eShapeType))
{
// #i118485# Add text export, the draw OLE shape allows text now
// fdo#58571 chart objects don't allow text:p