summaryrefslogtreecommitdiff
path: root/xmloff/source/chart/SchXMLExport.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-04-05 16:49:39 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-04-05 18:34:22 +0200
commit89bbc9286778df711f786f50c27f65315b29c39a (patch)
treeda9adfbc69b3900bdb9e4d7154e701ce19fae20b /xmloff/source/chart/SchXMLExport.cxx
parent2c59f12e5a9b062f91d6f0b85d4b6196728c689c (diff)
export label names that are strings, fdo#64722, cp#1000058
Change-Id: Id72e9778c70db02b942326c6f8b5f448acb28b41
Diffstat (limited to 'xmloff/source/chart/SchXMLExport.cxx')
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx28
1 files changed, 24 insertions, 4 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 859e4a5e6f5b..bd17360ac261 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -2553,6 +2553,14 @@ namespace
//no doubles and no texts
return false;
}
+
+ bool isString(const OUString& rString)
+ {
+ if(rString.startsWith("\"") && rString.endsWith("\""))
+ return true;
+
+ return false;
+ }
}
void SchXMLExportHelper_Impl::exportSeries(
@@ -2720,10 +2728,21 @@ void SchXMLExportHelper_Impl::exportSeries(
modifyLabelRange = true;
if (modifyLabelRange)
aRange = "label " + OUString::number(aRange.copy( OUString("label").getLength()).toInt32() - 1);
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_LABEL_CELL_ADDRESS,
- lcl_ConvertRange(
- aRange,
- xNewDoc ));
+
+ OUString aXMLRange = lcl_ConvertRange( aRange, xNewDoc );
+ if(aXMLRange.isEmpty() && !aRange.isEmpty())
+ {
+ // might just be a string
+ bool bIsString = isString(aRange);
+ if(bIsString)
+ {
+ mrExport.AddAttribute( XML_NAMESPACE_LO_EXT,
+ XML_LABEL_STRING, aRange );
+ }
+ }
+ else
+ mrExport.AddAttribute( XML_NAMESPACE_CHART,
+ XML_LABEL_CELL_ADDRESS, aXMLRange );
}
if( xLabelSeq.is() || xValuesSeq.is() )
aSeriesLabelValuesPair = tLabelValuesDataPair( xLabelSeq, xValuesSeq );
@@ -3138,6 +3157,7 @@ void SchXMLExportHelper_Impl::exportCandleStickSeries(
Reference< chart2::XChartDocument > xNewDoc( mrExport.GetModel(), uno::UNO_QUERY );
//@todo: export data points
+ //TODO: moggi: same code three times
// open
if( bJapaneseCandleSticks )
{