From af5bb01b9430b76ae8042b5ce6ebda65798bbb18 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Tue, 12 Mar 2024 21:16:20 +0900 Subject: pivot: forward pivot table format data into the pivot table model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sc/inc/pivot/PivotTableFormats.hxx | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 sc/inc/pivot/PivotTableFormats.hxx (limited to 'sc/inc/pivot/PivotTableFormats.hxx') 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 +#include +#include + +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 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 const& getVector() { return maFormats; } +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit