summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-03-28 09:30:00 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-03-28 09:32:56 +0200
commitbef64b011337fa60b27339a00c30303143b4397d (patch)
tree157d7237fd35677b45f686118dfefff912b39f5f
parentf084ac6556ab2374e7cbde5c426feeca0c3b9b9d (diff)
add name attribute to chart's layout dumper
-rw-r--r--chart2/source/view/main/ChartView.cxx25
1 files changed, 17 insertions, 8 deletions
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index bb49dce71f12..77fe6aba9b42 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -3070,7 +3070,15 @@ void dumpXShape( uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlW
uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW );
uno::Sequence< rtl::OUString > aServiceNames = xServiceInfo->getSupportedServiceNames();
- sal_Int32 nServices = aServiceNames.getLength();
+
+ uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW);
+ uno::Any aAny = xPropSet->getPropertyValue("Name");
+ rtl::OUString aName;
+ if (aAny >>= aName)
+ {
+ if (!aName.isEmpty())
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr());
+ }
if (xServiceInfo->supportsService("com.sun.star.drawing.Text"))
{
uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY_THROW);
@@ -3078,19 +3086,20 @@ void dumpXShape( uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlW
if(!aText.isEmpty())
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr());
}
- for (sal_Int32 i = 0; i < nServices; ++i)
+ else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
{
- if (aServiceNames[i].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GroupShape")))
- {
- uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW);
- dumpXShapes(xShapes, xmlWriter);
- }
+ uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW);
+ dumpXShapes(xShapes, xmlWriter);
+ }
#if DEBUG_DUMPER
+ sal_Int32 nServices = aServiceNames.getLength();
+ for (sal_Int32 i = 0; i < nServices; ++i)
+ {
xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ServiceName" ));
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST( "name" ), "%s", rtl::OUStringToOString(aServiceNames[i], RTL_TEXTENCODING_UTF8).getStr());
xmlTextWriterEndElement( xmlWriter );
-#endif
}
+#endif
xmlTextWriterEndElement( xmlWriter );
}