diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-08-30 21:53:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-31 16:20:52 +0200 |
commit | 7955fe46e226d74732993454e18be6835659c11c (patch) | |
tree | a2026c97ba66668b31d1e2c176f6b750568c52be /sfx2 | |
parent | 8a45eac81686ccc06b7f028594770ad18ae66057 (diff) |
flatten SfxObjectShellArr_Impl
Change-Id: I97e3ea18ce17c63ae95d7755a32c602b88373370
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121337
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/Library_sfx.mk | 1 | ||||
-rw-r--r-- | sfx2/inc/pch/precompiled_sfx.hxx | 1 | ||||
-rw-r--r-- | sfx2/source/appl/app.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/appl/appdata.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/appl/appinit.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/appquit.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/appl/shellimpl.cxx | 57 | ||||
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/inc/appdata.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/inc/shellimpl.hxx | 53 | ||||
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 1 |
13 files changed, 10 insertions, 132 deletions
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index 18e25151250b..a47d57138d94 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -118,7 +118,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/appl/preventduplicateinteraction \ sfx2/source/appl/sfxhelp \ sfx2/source/appl/sfxpicklist \ - sfx2/source/appl/shellimpl \ sfx2/source/appl/shutdownicon \ sfx2/source/appl/workwin \ sfx2/source/appl/xpackcreator \ diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx index c3aa00c0b06d..a94cc108a281 100644 --- a/sfx2/inc/pch/precompiled_sfx.hxx +++ b/sfx2/inc/pch/precompiled_sfx.hxx @@ -469,7 +469,6 @@ #include <sfxpicklist.hxx> #include <sfxtypes.hxx> #include <sfxurlrelocator.hxx> -#include <shellimpl.hxx> #include <splitwin.hxx> #include <statcach.hxx> #include <workwin.hxx> diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index 342ee1aa2e70..f4027064494d 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -50,7 +50,6 @@ #include <sfx2/sfxdlg.hxx> #include <sfx2/stbitem.hxx> #include <sfx2/dockwin.hxx> -#include <shellimpl.hxx> #include <sidebar/ControllerFactory.hxx> #include <officecfg/Office/Common.hxx> @@ -384,9 +383,9 @@ std::vector<SfxViewShell*>& SfxApplication::GetViewShells_Impl() const return pImpl->maViewShells; } -SfxObjectShellArr_Impl& SfxApplication::GetObjectShells_Impl() const +std::vector<SfxObjectShell*>& SfxApplication::GetObjectShells_Impl() const { - return *pImpl->pObjShells; + return pImpl->maObjShells; } void SfxApplication::Invalidate( sal_uInt16 nId ) diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx index c711266c1f86..2dbe419c5911 100644 --- a/sfx2/source/appl/appdata.cxx +++ b/sfx2/source/appl/appdata.cxx @@ -32,7 +32,6 @@ #include <sfx2/sidebar/Theme.hxx> #include <sfx2/objsh.hxx> #include <appbaslib.hxx> -#include <shellimpl.hxx> #include <unoctitm.hxx> #include <svl/svdde.hxx> diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 8291239659b7..19483ac37705 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -46,7 +46,6 @@ #include <sfx2/msgpool.hxx> #include <nochaos.hxx> #include <sfxpicklist.hxx> -#include <shellimpl.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; @@ -208,7 +207,6 @@ void SfxApplication::Initialize_Impl() DBG_ASSERT( !pImpl->pAppDispat, "AppDispatcher already exists" ); pImpl->pAppDispat.reset(new SfxDispatcher); pImpl->pSlotPool.reset(new SfxSlotPool); - pImpl->pObjShells.reset(new SfxObjectShellArr_Impl); Registrations_Impl(); diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx index 8a1d3b780f2b..0cb8bd4412a5 100644 --- a/sfx2/source/appl/appquit.cxx +++ b/sfx2/source/appl/appquit.cxx @@ -35,7 +35,6 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/objsh.hxx> #include <appbaslib.hxx> -#include <shellimpl.hxx> #include <basic/basicmanagerrepository.hxx> using ::basic::BasicManagerRepository; @@ -90,7 +89,7 @@ void SfxApplication::Deinitialize() pImpl->maStbCtrlFactories.clear(); pImpl->maViewFrames.clear(); pImpl->maViewShells.clear(); - pImpl->pObjShells.reset(); + pImpl->maObjShells.clear(); //TODO/CLEANUP //ReleaseArgs could be used instead! diff --git a/sfx2/source/appl/shellimpl.cxx b/sfx2/source/appl/shellimpl.cxx deleted file mode 100644 index e2f41e5ef3d8..000000000000 --- a/sfx2/source/appl/shellimpl.cxx +++ /dev/null @@ -1,57 +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 <shellimpl.hxx> - -SfxObjectShellArr_Impl::iterator SfxObjectShellArr_Impl::begin() -{ - return maData.begin(); -} - -SfxObjectShellArr_Impl::iterator SfxObjectShellArr_Impl::end() -{ - return maData.end(); -} - -const SfxObjectShell* SfxObjectShellArr_Impl::operator[] ( size_t i ) const -{ - return maData[i]; -} - -SfxObjectShell* SfxObjectShellArr_Impl::operator[] ( size_t i ) -{ - return maData[i]; -} - -void SfxObjectShellArr_Impl::erase( const iterator& it ) -{ - maData.erase(it); -} - -void SfxObjectShellArr_Impl::push_back( SfxObjectShell* p ) -{ - maData.push_back(p); -} - -size_t SfxObjectShellArr_Impl::size() const -{ - return maData.size(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 70b2e1e2e486..0532c63e35ab 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -75,7 +75,6 @@ #include <appbaslib.hxx> #include <sfx2/sfxbasemodel.hxx> #include <sfx2/sfxuno.hxx> -#include <shellimpl.hxx> #include <sfx2/notebookbar/SfxNotebookBar.hxx> #include <sfx2/infobar.hxx> @@ -230,7 +229,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,m_bAllowModifiedBackAfterSigning( false ) { SfxObjectShell* pDoc = &_rDocShell; - SfxObjectShellArr_Impl &rArr = SfxGetpApp()->GetObjectShells_Impl(); + std::vector<SfxObjectShell*> &rArr = SfxGetpApp()->GetObjectShells_Impl(); rArr.push_back( pDoc ); } @@ -389,8 +388,8 @@ bool SfxObjectShell::CloseInternal() SfxApplication *pSfxApp = SfxApplication::Get(); if(pSfxApp) { - SfxObjectShellArr_Impl &rDocs = pSfxApp->GetObjectShells_Impl(); - SfxObjectShellArr_Impl::iterator it = std::find( rDocs.begin(), rDocs.end(), this ); + std::vector<SfxObjectShell*> &rDocs = pSfxApp->GetObjectShells_Impl(); + auto it = std::find( rDocs.begin(), rDocs.end(), this ); if ( it != rDocs.end() ) rDocs.erase( it ); } @@ -427,7 +426,7 @@ SfxObjectShell* SfxObjectShell::GetFirst bool bOnlyVisible ) { - SfxObjectShellArr_Impl &rDocs = SfxGetpApp()->GetObjectShells_Impl(); + std::vector<SfxObjectShell*> &rDocs = SfxGetpApp()->GetObjectShells_Impl(); // search for a SfxDocument of the specified type for (SfxObjectShell* pSh : rDocs) @@ -453,7 +452,7 @@ SfxObjectShell* SfxObjectShell::GetNext bool bOnlyVisible ) { - SfxObjectShellArr_Impl &rDocs = SfxGetpApp()->GetObjectShells_Impl(); + std::vector<SfxObjectShell*> &rDocs = SfxGetpApp()->GetObjectShells_Impl(); // refind the specified predecessor size_t nPos; diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx index cd5effc040f7..89ccc6b0b982 100644 --- a/sfx2/source/inc/appdata.hxx +++ b/sfx2/source/inc/appdata.hxx @@ -100,8 +100,8 @@ public: maStbCtrlFactories; std::vector<SfxViewFrame*> maViewFrames; std::vector<SfxViewShell*> maViewShells; - std::unique_ptr<SfxObjectShellArr_Impl> - pObjShells; + std::vector<SfxObjectShell*> + maObjShells; std::unique_ptr<SfxBasicManagerHolder> pBasicManager; std::unique_ptr<SfxBasicManagerCreationListener> diff --git a/sfx2/source/inc/shellimpl.hxx b/sfx2/source/inc/shellimpl.hxx deleted file mode 100644 index ccf015c23efc..000000000000 --- a/sfx2/source/inc/shellimpl.hxx +++ /dev/null @@ -1,53 +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_SFX2_SHELLIMPL_HXX -#define INCLUDED_SFX2_SHELLIMPL_HXX - -#include <cstdlib> -#include <vector> - -class SfxObjectShell; -class SfxViewFrame; -class SfxViewShell; - -class SfxObjectShellArr_Impl -{ - typedef std::vector<SfxObjectShell*> DataType; - DataType maData; - -public: - typedef DataType::iterator iterator; - - iterator begin(); - iterator end(); - - const SfxObjectShell* operator[](size_t i) const; - SfxObjectShell* operator[](size_t i); - - void erase(const iterator& it); - - void push_back(SfxObjectShell* p); - - size_t size() const; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 2918c51a49eb..a6c7d207865c 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -33,8 +33,6 @@ #include <editeng/outliner.hxx> #include <sfx2/msgpool.hxx> -#include <shellimpl.hxx> - #include <boost/property_tree/json_parser.hpp> using namespace com::sun::star; diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 795af1a5dffb..ada11bea9930 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -89,7 +89,6 @@ #include <svtools/strings.hrc> #include <svtools/svtresid.hxx> #include <framework/framelistanalyzer.hxx> -#include <shellimpl.hxx> #include <optional> diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index bcb60d6c20a4..ba1e54c4a661 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -83,7 +83,6 @@ #include <sfx2/objface.hxx> #include <sfx2/lokhelper.hxx> #include <openuriexternally.hxx> -#include <shellimpl.hxx> #include <vector> #include <libxml/xmlwriter.h> |