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:04:22 -0500 |
commit | 6cf3d295d8955058dc1128ecf46b09d88926a0db (patch) | |
tree | d6f6496cece45c3bcfccff3191f930ced41ab089 /oox | |
parent | 4cdda4670684f567287bc434af0c69fbddd54d26 (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(); + } } // ============================================================================ |