diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-14 10:41:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-14 11:37:35 +0200 |
commit | 8303e7ed668fbcbd0ba75bd9dd259f03073ffd46 (patch) | |
tree | bfcbb0f58c0fd8cbd5c03d93fc5b1d4ab3ef817b /sd | |
parent | a64692944a0a22feeef4a943d45137b25494cf64 (diff) |
loplugin:unusedfields improvements
tighten up the only calling write-only methods part of the analysis
Change-Id: I5bc6fdf0ce51940653317e8a48c5241705c90d4c
Reviewed-on: https://gerrit.libreoffice.org/74022
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/Library_sd.mk | 1 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlideSorterController.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/inc/view/SlsFontProvider.hxx | 70 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsFontProvider.cxx | 82 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx | 1 |
5 files changed, 0 insertions, 156 deletions
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 85953e285575..87fd3332594f 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -390,7 +390,6 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ sd/source/ui/slidesorter/shell/SlideSorterService \ sd/source/ui/slidesorter/shell/SlideSorterViewShell \ sd/source/ui/slidesorter/view/SlideSorterView \ - sd/source/ui/slidesorter/view/SlsFontProvider \ sd/source/ui/slidesorter/view/SlsFramePainter \ sd/source/ui/slidesorter/view/SlsInsertAnimator \ sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay \ diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index bb4f44ce0649..8b36fbb7604e 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -39,7 +39,6 @@ #include <model/SlsPageDescriptor.hxx> #include <view/SlideSorterView.hxx> #include <view/SlsLayouter.hxx> -#include <view/SlsFontProvider.hxx> #include <view/SlsPageObjectLayouter.hxx> #include <view/SlsPageObjectPainter.hxx> #include <view/SlsTheme.hxx> @@ -568,7 +567,6 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent&, rEvent, vo // When the system font has changed a layout has to be done. mrView.Resize(); - FontProvider::Instance().Invalidate(); // Update theme colors. mrSlideSorter.GetProperties()->HandleDataChangeEvent(); diff --git a/sd/source/ui/slidesorter/inc/view/SlsFontProvider.hxx b/sd/source/ui/slidesorter/inc/view/SlsFontProvider.hxx deleted file mode 100644 index 3705546a8a56..000000000000 --- a/sd/source/ui/slidesorter/inc/view/SlsFontProvider.hxx +++ /dev/null @@ -1,70 +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 . - */ - -#ifndef INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_VIEW_SLSFONTPROVIDER_HXX -#define INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_VIEW_SLSFONTPROVIDER_HXX - -#include <tools/SdGlobalResourceContainer.hxx> - -#include <memory> - -namespace vcl { class Font; } - -namespace sd { namespace slidesorter { namespace view { - -/** This simple singleton class provides fonts that are scaled so that they - have a fixed height on the given device regardless of its map mode. -*/ -class FontProvider - : public SdGlobalResource -{ -public: - /** Return the single instance of this class. Throws a RuntimeException - when no instance can be created. - */ - static FontProvider& Instance(); - - /** Call this method to tell an object to release its currently used - font. The next call to GetFont() will then create a new one. - Typically called after a DataChange event when for instance a system - font has been modified. - */ - void Invalidate(); - -private: - static FontProvider* mpInstance; - - /** The font that was created by a previous call to GetFont(). It is - replaced by another one only when GetFont() is called with a device - with a different map mode or by a call to Invalidate(). - */ - std::shared_ptr<vcl::Font> maFont; - - FontProvider(); - virtual ~FontProvider() override; - - FontProvider (const FontProvider&) = delete; - FontProvider& operator= (const FontProvider&) = delete; -}; - -} } } // end of namespace ::sd::slidesorter::view - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/slidesorter/view/SlsFontProvider.cxx b/sd/source/ui/slidesorter/view/SlsFontProvider.cxx deleted file mode 100644 index 8bae88593d51..000000000000 --- a/sd/source/ui/slidesorter/view/SlsFontProvider.cxx +++ /dev/null @@ -1,82 +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 <memory> -#include <view/SlsFontProvider.hxx> - -#include <controller/SlideSorterController.hxx> - -#include <sfx2/app.hxx> -#include <osl/getglobalmutex.hxx> -#include <com/sun/star/uno/RuntimeException.hpp> - -using namespace ::sd::slidesorter; - -namespace sd { namespace slidesorter { namespace view { - -FontProvider* FontProvider::mpInstance = nullptr; - -FontProvider& FontProvider::Instance() -{ - if (mpInstance == nullptr) - { - ::osl::GetGlobalMutex aMutexFunctor; - ::osl::MutexGuard aGuard (aMutexFunctor()); - if (mpInstance == nullptr) - { - // Create an instance of the class and register it at the - // SdGlobalResourceContainer so that it is eventually released. - FontProvider* pInstance = new FontProvider(); - SdGlobalResourceContainer::Instance().AddResource ( - ::std::unique_ptr<SdGlobalResource>(pInstance)); - OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); - mpInstance = pInstance; - } - } - else - { - OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); - } - - // We throw an exception when for some strange reason no instance of - // this class exists. - if (mpInstance == nullptr) - throw css::uno::RuntimeException("com.sun.star.document.IndexedPropertyValues", - nullptr); - - return *mpInstance; -} - -FontProvider::FontProvider() - : maFont() -{ -} - -FontProvider::~FontProvider() -{ -} - -void FontProvider::Invalidate() -{ - maFont.reset(); -} - -} } } // end of namespace ::sd::slidesorter::view - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx index 93be4844ebbd..1c2edf958959 100644 --- a/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx +++ b/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx @@ -20,7 +20,6 @@ #include <view/SlsPageObjectLayouter.hxx> #include <model/SlsPageDescriptor.hxx> -#include <view/SlsFontProvider.hxx> #include <view/SlsTheme.hxx> #include <tools/IconCache.hxx> #include <Window.hxx> |