diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-12-06 14:36:50 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-12-06 23:03:37 -0500 |
commit | 3a5c3dc392f451f9718ef2fe2076d41bdd9b87ee (patch) | |
tree | 1850d24c4c2f64c19bc7ce1b1ccae527f86b7a81 /oox | |
parent | 9c46411ebd5ba696347dc9025c3b045f65f74205 (diff) |
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
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/chart/titlecontext.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
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(); + } } // ============================================================================ |