From 978ff8f55cfa47b6ced80a6adc3d92327e0303f4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 13 Jan 2017 11:58:14 +0200 Subject: inline InitGuard since it is only used in one place Change-Id: Ie541a255ddbe71105f6b58f02f372f4f45667d7a --- toolkit/source/controls/grid/initguard.hxx | 56 ---------------------- .../source/controls/grid/sortablegriddatamodel.cxx | 18 +++++-- 2 files changed, 14 insertions(+), 60 deletions(-) delete mode 100644 toolkit/source/controls/grid/initguard.hxx (limited to 'toolkit') diff --git a/toolkit/source/controls/grid/initguard.hxx b/toolkit/source/controls/grid/initguard.hxx deleted file mode 100644 index 75d84c0f0c75..000000000000 --- a/toolkit/source/controls/grid/initguard.hxx +++ /dev/null @@ -1,56 +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_TOOLKIT_SOURCE_CONTROLS_GRID_INITGUARD_HXX -#define INCLUDED_TOOLKIT_SOURCE_CONTROLS_GRID_INITGUARD_HXX - -#include - -#include - - -namespace toolkit -{ - - - //= InitGuard - - template < class IMPL > - class InitGuard : public ::comphelper::ComponentGuard - { - public: - InitGuard( IMPL& i_component, ::cppu::OBroadcastHelper & i_broadcastHelper ) - :comphelper::ComponentGuard( i_component, i_broadcastHelper ) - { - if ( !i_component.isInitialized() ) - throw css::lang::NotInitializedException( OUString(), *&i_component ); - } - - ~InitGuard() - { - } - }; - - -} // namespace toolkit - - -#endif // INCLUDED_TOOLKIT_SOURCE_CONTROLS_GRID_INITGUARD_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index af7898d07554..59463e8696b5 100644 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -17,13 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "initguard.hxx" - #include #include #include #include #include +#include #include #include #include @@ -33,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -45,12 +45,11 @@ using namespace css::i18n; using namespace css::lang; using namespace css::ucb; using namespace css::uno; -using namespace toolkit; namespace { class SortableGridDataModel; -typedef InitGuard< SortableGridDataModel > MethodGuard; +class MethodGuard; typedef ::cppu::WeakComponentImplHelper < css::awt::grid::XSortableMutableGridDataModel , css::lang::XServiceInfo @@ -197,6 +196,17 @@ private: ::std::vector< ::sal_Int32 > m_privateToPublicRowIndex; }; +class MethodGuard : public ::comphelper::ComponentGuard +{ +public: + MethodGuard( SortableGridDataModel& i_component, ::cppu::OBroadcastHelper & i_broadcastHelper ) + :comphelper::ComponentGuard( i_component, i_broadcastHelper ) + { + if ( !i_component.isInitialized() ) + throw css::lang::NotInitializedException( OUString(), *&i_component ); + } +}; + namespace { template< class STLCONTAINER > -- cgit