From 3a5c3dc392f451f9718ef2fe2076d41bdd9b87ee Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 6 Dec 2012 14:36:50 -0500 Subject: bnc#792528: Import static data series labels from xlsx correctly. Static data series label is a data series label whose value is a string value rather than a cell reference. Also, when inputting static string label in the UI, we don't have to manually check for quotes; the formula compiler will take care of that later. Change-Id: I1657fc9879a7f652bba84898e308c3a5d5ba87a3 --- oox/source/drawingml/chart/titlecontext.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'oox') diff --git a/oox/source/drawingml/chart/titlecontext.cxx b/oox/source/drawingml/chart/titlecontext.cxx index c05532ffeaf6..ea42cb863b0b 100644 --- a/oox/source/drawingml/chart/titlecontext.cxx +++ b/oox/source/drawingml/chart/titlecontext.cxx @@ -24,6 +24,8 @@ #include "oox/drawingml/chart/datasourcecontext.hxx" #include "oox/drawingml/chart/titlemodel.hxx" +#include "rtl/ustrbuf.hxx" + namespace oox { namespace drawingml { namespace chart { @@ -65,9 +67,13 @@ ContextHandlerRef TextContext::onCreateContext( sal_Int32 nElement, const Attrib void TextContext::onCharacters( const OUString& rChars ) { - // store as single string sequence element if( isCurrentElement( C_TOKEN( v ) ) ) - mrModel.mxDataSeq.create().maData[ 0 ] <<= rChars; + { + // Static text is stored as a single string formula token. + OUStringBuffer aBuf; + aBuf.append('"').append(rChars).append('"'); + mrModel.mxDataSeq.create().maFormula = aBuf.makeStringAndClear(); + } } // ============================================================================ -- cgit