diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-04-14 15:57:01 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-04-15 01:35:09 +0200 |
commit | 32e38ec654cfd467aad74da59366bd41142b3bdc (patch) | |
tree | 347098774ccce5171bec2810382bb0ecd0b2c0aa /oox | |
parent | ee76783d2b2718a66bceefc6f8a71019daa7cc5b (diff) |
oox: move DataTable{Context,Model} into own file, prop. "showKeys"
Move DataTableContext and DataTableModel into its own files and
add the missing "showKeys" property of the data table (dTable).
Change-Id: I44fb436000c7f00a596fc9b12489d15ea1368e68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133021
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/Library_oox.mk | 1 | ||||
-rw-r--r-- | oox/inc/drawingml/chart/datatablecontext.hxx | 42 | ||||
-rw-r--r-- | oox/inc/drawingml/chart/datatablemodel.hxx | 41 | ||||
-rw-r--r-- | oox/inc/drawingml/chart/plotareacontext.hxx | 15 | ||||
-rw-r--r-- | oox/inc/drawingml/chart/plotareamodel.hxx | 9 | ||||
-rw-r--r-- | oox/source/drawingml/chart/datatablecontext.cxx | 68 | ||||
-rw-r--r-- | oox/source/drawingml/chart/plotareacontext.cxx | 32 | ||||
-rw-r--r-- | oox/source/drawingml/chart/plotareamodel.cxx | 7 |
8 files changed, 154 insertions, 61 deletions
diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk index ca88ab100039..01da0aa4374d 100644 --- a/oox/Library_oox.mk +++ b/oox/Library_oox.mk @@ -100,6 +100,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\ oox/source/drawingml/chart/datasourcecontext \ oox/source/drawingml/chart/datasourceconverter \ oox/source/drawingml/chart/datasourcemodel \ + oox/source/drawingml/chart/datatablecontext \ oox/source/drawingml/chart/modelbase \ oox/source/drawingml/chart/objectformatter \ oox/source/drawingml/chart/plotareacontext \ diff --git a/oox/inc/drawingml/chart/datatablecontext.hxx b/oox/inc/drawingml/chart/datatablecontext.hxx new file mode 100644 index 000000000000..01a75c6e634d --- /dev/null +++ b/oox/inc/drawingml/chart/datatablecontext.hxx @@ -0,0 +1,42 @@ +/* -*- 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <drawingml/chart/chartcontextbase.hxx> + +namespace oox::drawingml::chart +{ +struct DataTableModel; + +/** Handler for a data table context (c:dTable element). + */ +class DataTableContext final : public ContextBase<DataTableModel> +{ +public: + explicit DataTableContext(::oox::core::ContextHandler2Helper& rParent, DataTableModel& rModel); + virtual ~DataTableContext() override; + + virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, + const AttributeList& rAttribs) override; +}; + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/inc/drawingml/chart/datatablemodel.hxx b/oox/inc/drawingml/chart/datatablemodel.hxx new file mode 100644 index 000000000000..5c7fe7901200 --- /dev/null +++ b/oox/inc/drawingml/chart/datatablemodel.hxx @@ -0,0 +1,41 @@ +/* -*- 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +namespace oox::drawingml::chart +{ +struct DataTableModel +{ + bool mbShowHBorder : 1; /// Show Horizontal Border + bool mbShowVBorder : 1; /// Show Vertical Border + bool mbShowOutline : 1; /// Show outline + bool mbShowKeys : 1; + + DataTableModel() + : mbShowHBorder(false) + , mbShowVBorder(false) + , mbShowOutline(false) + , mbShowKeys(false) + { + } +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/inc/drawingml/chart/plotareacontext.hxx b/oox/inc/drawingml/chart/plotareacontext.hxx index 05984449f9d0..2b3fae932161 100644 --- a/oox/inc/drawingml/chart/plotareacontext.hxx +++ b/oox/inc/drawingml/chart/plotareacontext.hxx @@ -53,21 +53,6 @@ public: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; }; - -struct DataTableModel; - -/** Handler for a data table context (c:dTable element). - */ -class DataTableContext final : public ContextBase< DataTableModel > -{ -public: - explicit DataTableContext( ::oox::core::ContextHandler2Helper& rParent, DataTableModel& rModel ); - virtual ~DataTableContext() override; - - virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; -}; - - struct PlotAreaModel; /** Handler for a chart plot area context (c:plotArea element). diff --git a/oox/inc/drawingml/chart/plotareamodel.hxx b/oox/inc/drawingml/chart/plotareamodel.hxx index ad7a2495b714..11990095378f 100644 --- a/oox/inc/drawingml/chart/plotareamodel.hxx +++ b/oox/inc/drawingml/chart/plotareamodel.hxx @@ -24,6 +24,7 @@ #include <drawingml/chart/axismodel.hxx> #include <drawingml/chart/seriesmodel.hxx> #include <drawingml/chart/typegroupmodel.hxx> +#include <drawingml/chart/datatablemodel.hxx> namespace oox::drawingml::chart { @@ -51,14 +52,6 @@ struct WallFloorModel ~WallFloorModel(); }; -struct DataTableModel -{ - bool mbShowHBorder; /// Show Horizontal Border - bool mbShowVBorder; /// Show Vertical Border - bool mbShowOutline; /// Show outline - explicit DataTableModel(); -}; - struct PlotAreaModel { typedef ModelVector< TypeGroupModel > TypeGroupVector; diff --git a/oox/source/drawingml/chart/datatablecontext.cxx b/oox/source/drawingml/chart/datatablecontext.cxx new file mode 100644 index 000000000000..c40a4f782450 --- /dev/null +++ b/oox/source/drawingml/chart/datatablecontext.cxx @@ -0,0 +1,68 @@ +/* -*- 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include <drawingml/chart/datatablecontext.hxx> + +#include <drawingml/chart/plotareamodel.hxx> +#include <oox/core/xmlfilterbase.hxx> +#include <oox/helper/attributelist.hxx> +#include <oox/token/namespaces.hxx> +#include <oox/token/tokens.hxx> + +namespace oox::drawingml::chart +{ +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +DataTableContext::DataTableContext(ContextHandler2Helper& rParent, DataTableModel& rModel) + : ContextBase<DataTableModel>(rParent, rModel) +{ +} + +DataTableContext::~DataTableContext() {} + +ContextHandlerRef DataTableContext::onCreateContext(sal_Int32 nElement, + const AttributeList& rAttribs) +{ + switch (getCurrentElement()) + { + case C_TOKEN(dTable): + switch (nElement) + { + case C_TOKEN(showHorzBorder): + mrModel.mbShowHBorder = rAttribs.getBool(XML_val, false); + break; + case C_TOKEN(showVertBorder): + mrModel.mbShowVBorder = rAttribs.getBool(XML_val, false); + break; + case C_TOKEN(showOutline): + mrModel.mbShowOutline = rAttribs.getBool(XML_val, false); + break; + case C_TOKEN(showKeys): + //mrModel.mbShowKeys = rAttribs.getBool( XML_val, false ); + break; + } + break; + } + return nullptr; +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx index 4f231e0eda35..4afddee4700c 100644 --- a/oox/source/drawingml/chart/plotareacontext.cxx +++ b/oox/source/drawingml/chart/plotareacontext.cxx @@ -24,6 +24,7 @@ #include <drawingml/chart/plotareamodel.hxx> #include <drawingml/chart/seriescontext.hxx> #include <drawingml/chart/typegroupcontext.hxx> +#include <drawingml/chart/datatablecontext.hxx> #include <oox/core/xmlfilterbase.hxx> #include <oox/helper/attributelist.hxx> #include <oox/token/namespaces.hxx> @@ -106,37 +107,6 @@ ContextHandlerRef WallFloorContext::onCreateContext( sal_Int32 nElement, const A return nullptr; } -DataTableContext::DataTableContext( ContextHandler2Helper& rParent, DataTableModel& rModel ) : - ContextBase< DataTableModel >( rParent, rModel ) -{ -} - -DataTableContext::~DataTableContext() -{ -} - -ContextHandlerRef DataTableContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs) -{ - switch( getCurrentElement() ) - { - case C_TOKEN( dTable ): - switch( nElement ) - { - case C_TOKEN( showHorzBorder ): - mrModel.mbShowHBorder = rAttribs.getBool( XML_val, false ); - break; - case C_TOKEN( showVertBorder ): - mrModel.mbShowVBorder = rAttribs.getBool( XML_val, false ); - break; - case C_TOKEN( showOutline ): - mrModel.mbShowOutline = rAttribs.getBool( XML_val, false ); - break; - } - break; - } - return nullptr; -} - PlotAreaContext::PlotAreaContext( ContextHandler2Helper& rParent, PlotAreaModel& rModel ) : ContextBase< PlotAreaModel >( rParent, rModel ) { diff --git a/oox/source/drawingml/chart/plotareamodel.cxx b/oox/source/drawingml/chart/plotareamodel.cxx index ba949572a950..cb4f6383ddfa 100644 --- a/oox/source/drawingml/chart/plotareamodel.cxx +++ b/oox/source/drawingml/chart/plotareamodel.cxx @@ -38,13 +38,6 @@ WallFloorModel::~WallFloorModel() { } -DataTableModel::DataTableModel() : - mbShowHBorder(false), - mbShowVBorder(false), - mbShowOutline(false) -{ -} - PlotAreaModel::PlotAreaModel() { mxShapeProp.create().getFillProperties().moFillType = XML_noFill; |