diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-10 12:12:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-10 13:33:00 +0000 |
commit | 1b8a9af14d652115e1b17ecca79b647e94a63ef5 (patch) | |
tree | d087258eeb483b0f3c57874ed6fc5d813eacc989 | |
parent | 9e6ff03454c2c554fc81b5f5d453a02edd5245d1 (diff) |
Use officecfg instead of chart::ConfigAccess
Change-Id: I9bf7f05ab1d303bbf1de289b101989178f0421cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148601
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | chart2/Library_chartcore.mk | 1 | ||||
-rw-r--r-- | chart2/source/view/charttypes/AreaChart.cxx | 4 | ||||
-rw-r--r-- | chart2/source/view/charttypes/ConfigAccess.cxx | 74 | ||||
-rw-r--r-- | chart2/source/view/inc/ConfigAccess.hxx | 35 |
4 files changed, 2 insertions, 112 deletions
diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk index 4c93c6d2c3ec..54bc946766d8 100644 --- a/chart2/Library_chartcore.mk +++ b/chart2/Library_chartcore.mk @@ -87,7 +87,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\ chart2/source/view/charttypes/BubbleChart \ chart2/source/view/charttypes/CandleStickChart \ chart2/source/view/charttypes/CategoryPositionHelper \ - chart2/source/view/charttypes/ConfigAccess \ chart2/source/view/charttypes/NetChart \ chart2/source/view/charttypes/PieChart \ chart2/source/view/charttypes/Splines \ diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx index 9cb2e06ba761..e8af8c86c8b8 100644 --- a/chart2/source/view/charttypes/AreaChart.cxx +++ b/chart2/source/view/charttypes/AreaChart.cxx @@ -31,7 +31,6 @@ #include <Stripe.hxx> #include <DateHelper.hxx> #include <unonames.hxx> -#include <ConfigAccess.hxx> #include <com/sun/star/chart2/Symbol.hpp> #include <com/sun/star/chart/DataLabelPlacement.hpp> @@ -43,6 +42,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <officecfg/Office/Compatibility.hxx> +#include <officecfg/Office/Chart.hxx> #include <limits> @@ -635,7 +635,7 @@ void AreaChart::createShapes() } } - const bool bUseErrorRectangle = ConfigAccess::getUseErrorRectangle(); + const bool bUseErrorRectangle = officecfg::Office::Chart::ErrorProperties::ErrorRectangle::get(); sal_Int32 nZ=1; for( auto const& rZSlot : m_aZSlots ) diff --git a/chart2/source/view/charttypes/ConfigAccess.cxx b/chart2/source/view/charttypes/ConfigAccess.cxx deleted file mode 100644 index ce02c4817e0a..000000000000 --- a/chart2/source/view/charttypes/ConfigAccess.cxx +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- 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 <ConfigAccess.hxx> - -#include <unotools/configitem.hxx> -#include <o3tl/any.hxx> -#include <com/sun/star/uno/Sequence.hxx> - -namespace chart -{ -using namespace ::com::sun::star; - -namespace -{ -class ChartConfigItem : public ::utl::ConfigItem -{ -private: - virtual void ImplCommit() override; - -public: - ChartConfigItem(); - - bool getUseErrorRectangle(); - virtual void Notify(const uno::Sequence<OUString>& aPropertyNames) override; -}; -} - -ChartConfigItem::ChartConfigItem() - : ConfigItem("Office.Chart/ErrorProperties") -{ -} - -void ChartConfigItem::ImplCommit() {} -void ChartConfigItem::Notify(const uno::Sequence<OUString>&) {} - -bool ChartConfigItem::getUseErrorRectangle() -{ - uno::Sequence<OUString> aNames{ "ErrorRectangle" }; - - auto b = o3tl::tryAccess<bool>(GetProperties(aNames)[0]); - return b && *b; -} - -namespace ConfigAccess -{ -bool getUseErrorRectangle() -{ - //a ChartConfigItem Singleton - static ChartConfigItem SINGLETON; - bool bResult(SINGLETON.getUseErrorRectangle()); - return bResult; -} -} //namespace ConfigAccess - -} //namespace chart - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/inc/ConfigAccess.hxx b/chart2/source/view/inc/ConfigAccess.hxx deleted file mode 100644 index df59b16a3f75..000000000000 --- a/chart2/source/view/inc/ConfigAccess.hxx +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- 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 chart::ConfigAccess -{ -/** @descr Retrieve the setting for showing errors in charts from the registry - settings of the Calc application. - - If this setting is not found, it is set to false (the default setting). - - @return boolean UseErrorRectangle. - */ -bool getUseErrorRectangle(); - -} //namespace chart::ConfigAccess - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |