diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-02-02 15:25:28 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-04-10 15:31:15 +0200 |
commit | 343a5786f946f45818c6d7d7aebf3b1972f4187d (patch) | |
tree | b15cc0739eac86143a20cbee15793fa196e7027e /sc/source/filter/inc | |
parent | b33359904ee64dc5e8d3eab881dc84d40756979c (diff) |
sc: support reading sparklines from OOXML document
Read sparklines and sparkline groups from the OOXML document and
add store it into a (temporary local) doc. model.
Change-Id: Id2d34db70300957735571875d6defb3d560fbb26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131161
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 04b3a9baf5731696418bc1a6db8c8b1bf65dc7c4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132546
Diffstat (limited to 'sc/source/filter/inc')
-rw-r--r-- | sc/source/filter/inc/SparklineFragment.hxx | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/sc/source/filter/inc/SparklineFragment.hxx b/sc/source/filter/inc/SparklineFragment.hxx new file mode 100644 index 000000000000..36a7b5ca9f05 --- /dev/null +++ b/sc/source/filter/inc/SparklineFragment.hxx @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include "excelhandlers.hxx" +#include <oox/core/contexthandler.hxx> + +#include <vector> +#include <memory> +#include <optional> + +namespace oox +{ +class AttributeList; +} + +namespace oox::xls +{ +class Sparkline +{ +public: + ScRangeList m_aInputRange; + ScRangeList m_aTargetRange; + Sparkline() {} +}; + +class SparklineGroup +{ +private: + std::vector<Sparkline> m_aSparklines; + +public: + Color m_aColorSeries; + Color m_aColorNegative; + Color m_aColorAxis; + Color m_aColorMarkers; + Color m_aColorFirst; + Color m_aColorLast; + Color m_aColorHigh; + Color m_aColorLow; + + OUString m_sMinAxisType; // individual, group, custom + OUString m_sMaxAxisType; + + double m_fLineWeight; // In pt + + OUString m_sType; // line, column, stacked + + bool m_bDateAxis; + + OUString m_sDisplayEmptyCellsAs; // span, gap, zero + + bool m_bMarkers; + bool m_bHigh; + bool m_bLow; + bool m_bFirst; + bool m_bLast; + bool m_bNegative; + bool m_bDisplayXAxis; + bool m_bDisplayHidden; + bool m_bRightToLeft; + + std::optional<double> m_aManualMax; + std::optional<double> m_aManualMin; + OUString m_sUID; + + std::vector<Sparkline>& getSparklines() { return m_aSparklines; } +}; + +class SparklineGroupsContext : public WorksheetContextBase +{ +private: + std::vector<SparklineGroup> m_aSparklineGroups; + +public: + explicit SparklineGroupsContext(WorksheetContextBase& rFragment); + + oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, + const AttributeList& rAttribs) override; + void onStartElement(const AttributeList& rAttribs) override; + void onCharacters(const OUString& rCharacters) override; + void onEndElement() override; +}; + +} //namespace oox::xls + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |