diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-03-12 21:16:20 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-04-11 17:13:20 +0200 |
commit | af5bb01b9430b76ae8042b5ce6ebda65798bbb18 (patch) | |
tree | 85824489071d24e01462b3230cd72d931b096c32 /sc/inc/pivot/PivotTableFormats.hxx | |
parent | a180bf0c0f805462c2ba84abcdcc89c59d1e50fa (diff) |
pivot: forward pivot table format data into the pivot table model
The purpuse of this is to lay out the foundation for the support
of pivot table formatting. This adds the code to forward the
formatting information from the OOXML import into the pivot table
model and uses it in a use case to set the row and column labels
in the pivot table output (DPOutput). In the follow up commits the
support will be extended to support more use cases with tests.
Change-Id: Idf23884b32167bdbad69bc67358ccf7f14566db6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164710
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc/inc/pivot/PivotTableFormats.hxx')
-rw-r--r-- | sc/inc/pivot/PivotTableFormats.hxx | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/sc/inc/pivot/PivotTableFormats.hxx b/sc/inc/pivot/PivotTableFormats.hxx new file mode 100644 index 000000000000..09f181e7e178 --- /dev/null +++ b/sc/inc/pivot/PivotTableFormats.hxx @@ -0,0 +1,48 @@ +/* -*- 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 <memory> +#include <vector> +#include <rtl/ustring.hxx> + +namespace sc +{ +struct PivotTableFormat +{ + sal_Int32 nField; + sal_Int32 nDataIndex; + OUString aStyleName; + + PivotTableFormat(sal_Int32 _nField, sal_Int32 _nDataIndex, OUString _aStyleName) + : nField(_nField) + , nDataIndex(_nDataIndex) + , aStyleName(_aStyleName) + { + } +}; + +class PivotTableFormats +{ + std::vector<PivotTableFormat> maFormats; + +public: + void add(sal_Int32 nField, sal_Int32 nDataIndex, OUString const& rStyle) + { + maFormats.emplace_back(nField, nDataIndex, rStyle); + } + + size_t size() { return maFormats.size(); } + + std::vector<PivotTableFormat> const& getVector() { return maFormats; } +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |