diff options
author | Dennis Francis <dennisfrancis.in@gmail.com> | 2021-09-02 14:33:55 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-09-06 08:47:50 +0200 |
commit | f547cf17a179ebd7de5c2b4dd2d00d0027a25429 (patch) | |
tree | 764038da5e3280c93099d2ca3ef2731484ece324 /include/oox | |
parent | ba1e42f05e785c30d03553acd5647eebd7cdede6 (diff) |
[API CHANGE] oox: fix import of chart date categories
Before this fix, date categories imported in oox's DataSourceContext were
stored as formatted strings according to number format code in <c:formatCode>
under the <c:cat> tree. As a result chart2 could not recognize them
as dates. This causes problems like:
* The axis that is linked to date categories cannot use the
scaling/range-selection(min/max)/increments specs mentioned as axis
properties. This results in distorted/unreadable chart renders w.r.t
the date axis.
* No re-formatting is attempted as per the number format provided for axis.
This patch introduces a role qualifer argument to the XDataProvider
interface method createDataSequenceByValueArray to support categories of
date type via this method.
When exporting to oox, write date categories and format code under
<c:cat>
<c:numRef>
<c:numCache>
This patch also fixes some discrepancies in date axis interval
computation (auto mode) found by already existing unit tests.
Change-Id: Ibc53b0a56fdddba80ba452d5567ce98d80460ea7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121525
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include/oox')
-rw-r--r-- | include/oox/drawingml/chart/chartconverter.hxx | 3 | ||||
-rw-r--r-- | include/oox/drawingml/chart/datasourcemodel.hxx | 3 | ||||
-rw-r--r-- | include/oox/export/chartexport.hxx | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/include/oox/drawingml/chart/chartconverter.hxx b/include/oox/drawingml/chart/chartconverter.hxx index c293c48215bb..fcf3b2fee3fa 100644 --- a/include/oox/drawingml/chart/chartconverter.hxx +++ b/include/oox/drawingml/chart/chartconverter.hxx @@ -84,7 +84,8 @@ public: virtual css::uno::Reference<css::chart2::data::XDataSequence> createDataSequence( const css::uno::Reference<css::chart2::data::XDataProvider>& rxDataProvider, - const DataSequenceModel& rDataSeq, const OUString& rRole ); + const DataSequenceModel& rDataSeq, const OUString& rRole, + const OUString& aRoleQualifier ); private: ChartConverter( const ChartConverter& ) = delete; diff --git a/include/oox/drawingml/chart/datasourcemodel.hxx b/include/oox/drawingml/chart/datasourcemodel.hxx index dc8d253a7d11..49b8dcd90717 100644 --- a/include/oox/drawingml/chart/datasourcemodel.hxx +++ b/include/oox/drawingml/chart/datasourcemodel.hxx @@ -27,6 +27,8 @@ #include <rtl/ustring.hxx> #include <sal/types.h> +enum class SvNumFormatType : sal_Int16; + namespace oox::drawingml::chart { @@ -39,6 +41,7 @@ struct DataSequenceModel OUString maFormatCode; /// Number format for double values. sal_Int32 mnPointCount; /// Number of points in this series source. sal_Int32 mnLevelCount; /// Number of category levels. + SvNumFormatType meFormatType; /// Type of number format in maFormatCode. explicit DataSequenceModel(); ~DataSequenceModel(); diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx index c4440ae08419..3e12e5de725a 100644 --- a/include/oox/export/chartexport.hxx +++ b/include/oox/export/chartexport.hxx @@ -153,6 +153,7 @@ private: bool mbIs3DChart; bool mbStacked; bool mbPercent; + bool mbHasDateCategories; std::set<sal_Int32> maExportedAxis; |