diff options
-rw-r--r-- | cui/source/options/optgdlg.cxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/dataview.cxx | 1 | ||||
-rw-r--r-- | forms/source/solar/control/navtoolbar.cxx | 1 | ||||
-rw-r--r-- | include/sfx2/imgmgr.hxx | 67 | ||||
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/navipi/navipi.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/dlg/navigatr.cxx | 1 | ||||
-rw-r--r-- | sfx2/Library_sfx.mk | 1 | ||||
-rw-r--r-- | sfx2/inc/pch/precompiled_sfx.hxx | 1 | ||||
-rw-r--r-- | sfx2/source/appl/imagemgr.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/toolbox/imgmgr.cxx | 316 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/config/mailconfigpage.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/misc/num.cxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/inputwin.cxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/utlui/navipi.cxx | 1 |
18 files changed, 0 insertions, 399 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 07ed58006f65..8f4412a53d91 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -27,7 +27,6 @@ #include <svl/szitem.hxx> #include <sfx2/viewsh.hxx> #include <sfx2/viewfrm.hxx> -#include <sfx2/imgmgr.hxx> #include <vcl/configsettings.hxx> #include <vcl/layout.hxx> #include <vcl/mnemonic.hxx> diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx index d091404669fd..206d529d071f 100644 --- a/dbaccess/source/ui/browser/dataview.cxx +++ b/dbaccess/source/ui/browser/dataview.cxx @@ -24,7 +24,6 @@ #include <comphelper/types.hxx> #include <comphelper/namedvaluecollection.hxx> #include <sfx2/app.hxx> -#include <sfx2/imgmgr.hxx> #include <dbaccess/IController.hxx> #include "UITools.hxx" #include <sfx2/sfx.hrc> diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index ae15046a045d..66b910962c26 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -27,7 +27,6 @@ #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/form/runtime/FormFeature.hpp> -#include <sfx2/imgmgr.hxx> #include <vcl/fixed.hxx> #include <vcl/commandinfoprovider.hxx> diff --git a/include/sfx2/imgmgr.hxx b/include/sfx2/imgmgr.hxx deleted file mode 100644 index c65f19d3d24c..000000000000 --- a/include/sfx2/imgmgr.hxx +++ /dev/null @@ -1,67 +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_IMGMGR_HXX -#define INCLUDED_SFX2_IMGMGR_HXX - -#include <sal/config.h> -#include <sal/types.h> -#include <o3tl/typed_flags_set.hxx> -#include <sfx2/dllapi.h> -#include <vcl/image.hxx> - - -class ToolBox; -class SfxModule; -class SfxImageManager_Impl; - -enum class SfxToolboxFlags -{ - CHANGESYMBOLSET = 0x01, - CHANGEOUTSTYLE = 0x02, - ALL = CHANGESYMBOLSET | CHANGEOUTSTYLE, -}; -namespace o3tl -{ - template<> struct typed_flags<SfxToolboxFlags> : is_typed_flags<SfxToolboxFlags, 0x03> {}; -} - - -class SFX2_DLLPUBLIC SfxImageManager -{ - SfxImageManager_Impl* pImp; - -public: - static SfxImageManager* GetImageManager(SfxModule&); - - SfxImageManager(SfxModule& rModule); - ~SfxImageManager(); - - void RegisterToolBox( ToolBox *pBox, SfxToolboxFlags nFlags=SfxToolboxFlags::ALL); - void ReleaseToolBox( ToolBox *pBox ); - - Image GetImage( sal_uInt16 nId, bool bLarge ) const; - Image GetImage( sal_uInt16 nId) const; - Image SeekImage( sal_uInt16 nId, bool bLarge ) const; - Image SeekImage( sal_uInt16 nId ) const; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 3801cefffe86..9239398829aa 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -32,7 +32,6 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/event.hxx> -#include <sfx2/imgmgr.hxx> #include <stdlib.h> #include <editeng/scriptspaceitem.hxx> #include <editeng/scripttypeitem.hxx> diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index e48419208a5f..42187f8bda2e 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -22,7 +22,6 @@ #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/event.hxx> -#include <sfx2/imgmgr.hxx> #include <sfx2/navigat.hxx> #include <svl/stritem.hxx> #include <svl/urlbmk.hxx> diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index c1e19adbd8c5..042f06aa6ad7 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -21,7 +21,6 @@ #include <osl/file.hxx> #include <tools/urlobj.hxx> -#include <sfx2/imgmgr.hxx> #include <sfx2/fcontnr.hxx> #include <svl/eitem.hxx> #include <svl/stritem.hxx> diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index 647078f5f500..642e96031230 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -293,7 +293,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/sidebar/UnoSidebar \ sfx2/source/statbar/stbitem \ sfx2/source/styles/StyleManager \ - sfx2/source/toolbox/imgmgr \ sfx2/source/toolbox/tbxitem \ sfx2/source/uitest/sfx_uiobject \ sfx2/source/view/classificationcontroller \ diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx index d80b88a71aea..9dd2e27ebfa8 100644 --- a/sfx2/inc/pch/precompiled_sfx.hxx +++ b/sfx2/inc/pch/precompiled_sfx.hxx @@ -462,7 +462,6 @@ #include <sfx2/frmdescr.hxx> #include <sfx2/hintpost.hxx> #include <sfx2/imagemgr.hxx> -#include <sfx2/imgmgr.hxx> #include <sfx2/infobar.hxx> #include <sfx2/ipclient.hxx> #include <sfx2/linkmgr.hxx> diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx index 56862e94e601..ad59dccc7a3a 100644 --- a/sfx2/source/appl/imagemgr.cxx +++ b/sfx2/source/appl/imagemgr.cxx @@ -31,7 +31,6 @@ #include <comphelper/processfactory.hxx> #include <rtl/ustring.hxx> -#include <sfx2/imgmgr.hxx> #include <sfx2/app.hxx> #include <sfx2/unoctitm.hxx> #include <sfx2/dispatch.hxx> diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 6979b5ddfd5e..ce07b60f20eb 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -27,7 +27,6 @@ #include <sfx2/app.hxx> #include "sfxtypes.hxx" #include "panelist.hxx" -#include <sfx2/imgmgr.hxx> #include "srchdlg.hxx" #include <sfx2/sfxhelp.hxx> #include <svtools/treelistentry.hxx> diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 2d8d527b763d..fb562750e857 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -56,7 +56,6 @@ #include <sfx2/docfac.hxx> #include <sfx2/doctempl.hxx> #include <sfx2/module.hxx> -#include <sfx2/imgmgr.hxx> #include "helpid.hrc" #include "appdata.hxx" #include <sfx2/viewfrm.hxx> diff --git a/sfx2/source/toolbox/imgmgr.cxx b/sfx2/source/toolbox/imgmgr.cxx deleted file mode 100644 index 8b3d40113711..000000000000 --- a/sfx2/source/toolbox/imgmgr.cxx +++ /dev/null @@ -1,316 +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 <sfx2/imgmgr.hxx> -#include <sfx2/sfx.hrc> -#include <sfx2/app.hxx> -#include <sfx2/sfxresid.hxx> -#include <sfx2/bindings.hxx> -#include "statcach.hxx" -#include <sfx2/module.hxx> -#include <vcl/bitmap.hxx> -#include <vcl/toolbox.hxx> - -#include <tools/rcid.h> -#include <tools/link.hxx> -#include <svtools/miscopt.hxx> -#include <osl/mutex.hxx> -#include <rtl/instance.hxx> - -#include <comphelper/processfactory.hxx> - -#include <unordered_map> - -const sal_uInt32 IMAGELIST_COUNT = 4; // small, small-hi, large, large-hi - -struct ToolBoxInf_Impl -{ - VclPtr<ToolBox> pToolBox; - SfxToolboxFlags nFlags; -}; - -class SfxImageManager_Impl -{ -public: - SvtMiscOptions m_aOpt; - std::vector< ToolBoxInf_Impl* > m_aToolBoxes; - sal_Int16 m_nSymbolsSize; - ImageList* m_pImageList[IMAGELIST_COUNT]; - SfxModule& m_rModule; - bool m_bAppEventListener; - - ImageList* GetImageList( bool bBig ); - Image GetImage( sal_uInt16 nId, bool bBig ); - void SetSymbolsSize_Impl( sal_Int16 ); - - DECL_LINK( OptionsChanged_Impl, LinkParamNone*, void ); - DECL_LINK( SettingsChanged_Impl, VclSimpleEvent&, void ); - - explicit SfxImageManager_Impl(SfxModule& rModule); - ~SfxImageManager_Impl(); -}; - -namespace -{ - typedef std::unordered_map< SfxModule*, std::shared_ptr<SfxImageManager_Impl> > SfxImageManagerImplMap; - - class theImageManagerImplMap : - public rtl::Static<SfxImageManagerImplMap, theImageManagerImplMap> {}; -} - -static SfxImageManager_Impl* GetImageManager(SfxModule& rModule) -{ - SolarMutexGuard aGuard; - - SfxImageManagerImplMap &rImageManager_ImplMap = - theImageManagerImplMap::get(); - SfxImageManager_Impl* pImpl( nullptr ); - SfxModule* pModule(&rModule); - SfxImageManagerImplMap::const_iterator pIter = rImageManager_ImplMap.find(pModule); - if ( pIter != rImageManager_ImplMap.end() ) - pImpl = pIter->second.get(); - else - { - rImageManager_ImplMap[pModule].reset(new SfxImageManager_Impl(rModule)); - pImpl = rImageManager_ImplMap[pModule].get(); - } - return pImpl; -} - -static sal_Int16 impl_convertBools( bool bLarge ) -{ - sal_Int16 nIndex( 0 ); - if ( bLarge ) - nIndex += 1; - return nIndex; -} - -SfxImageManager_Impl::SfxImageManager_Impl(SfxModule& rModule) - : m_rModule(rModule) - , m_bAppEventListener(false) -{ - m_nSymbolsSize = m_aOpt.GetCurrentSymbolsSize(); - - for (ImageList* & rp : m_pImageList) - rp = nullptr; - - m_aOpt.AddListenerLink( LINK( this, SfxImageManager_Impl, OptionsChanged_Impl ) ); - Application::AddEventListener( LINK( this, SfxImageManager_Impl, SettingsChanged_Impl ) ); - m_bAppEventListener = true; -} - - -SfxImageManager_Impl::~SfxImageManager_Impl() -{ - m_aOpt.RemoveListenerLink( LINK( this, SfxImageManager_Impl, OptionsChanged_Impl ) ); - if (m_bAppEventListener) - Application::RemoveEventListener( LINK( this, SfxImageManager_Impl, SettingsChanged_Impl ) ); - for (ToolBoxInf_Impl* p : m_aToolBoxes) - delete p; -} - - -ImageList* SfxImageManager_Impl::GetImageList( bool bBig ) -{ - sal_Int32 nIndex = impl_convertBools( bBig ); - if ( !m_pImageList[nIndex] ) - { - m_pImageList[nIndex] = m_rModule.GetImageList_Impl( bBig ); - } - - return m_pImageList[nIndex]; -} - - -Image SfxImageManager_Impl::GetImage( sal_uInt16 nId, bool bBig ) -{ - ImageList* pImageList = GetImageList( bBig ); - if ( pImageList ) - return pImageList->GetImage( nId ); - return Image(); -} - - -void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize ) -{ - SolarMutexGuard aGuard; - - if ( nNewSymbolsSize != m_nSymbolsSize ) - { - m_nSymbolsSize = nNewSymbolsSize; - bool bLarge( m_nSymbolsSize == SFX_SYMBOLS_SIZE_LARGE ); - - for (ToolBoxInf_Impl* pInf : m_aToolBoxes) - { - if ( pInf->nFlags & SfxToolboxFlags::CHANGESYMBOLSET ) - { - ToolBox *pBox = pInf->pToolBox; - sal_uInt16 nCount = pBox->GetItemCount(); - for ( sal_uInt16 nPos=0; nPos<nCount; nPos++ ) - { - sal_uInt16 nId = pBox->GetItemId( nPos ); - if ( pBox->GetItemType(nPos) == ToolBoxItemType::BUTTON ) - { - pBox->SetItemImage( nId, GetImage( nId, bLarge ) ); - SfxStateCache *pCache = SfxViewFrame::Current()->GetBindings().GetStateCache( nId ); - if ( pCache ) - pCache->SetCachedState(false); - } - } - - if ( !pBox->IsFloatingMode() ) - { - Size aActSize( pBox->GetSizePixel() ); - Size aSize( pBox->CalcWindowSizePixel() ); - if ( pBox->IsHorizontal() ) - aSize.Width() = aActSize.Width(); - else - aSize.Height() = aActSize.Height(); - - pBox->SetSizePixel( aSize ); - } - } - } - } -} - - -IMPL_LINK_NOARG(SfxImageManager_Impl, OptionsChanged_Impl, LinkParamNone*, void) -{ - SetSymbolsSize_Impl( m_aOpt.GetCurrentSymbolsSize() ); -} - - -IMPL_LINK( SfxImageManager_Impl, SettingsChanged_Impl, VclSimpleEvent&, rEvent, void) -{ - switch (rEvent.GetId()) - { - case VclEventId::ObjectDying: - if (m_bAppEventListener) - { - Application::RemoveEventListener( LINK( this, SfxImageManager_Impl, SettingsChanged_Impl ) ); - m_bAppEventListener = false; - } - break; - case VclEventId::ApplicationDataChanged: - // Check if toolbar button size have changed and we have to use system settings - { - sal_Int16 nSymbolsSize = m_aOpt.GetCurrentSymbolsSize(); - if (m_nSymbolsSize != nSymbolsSize) - SetSymbolsSize_Impl(nSymbolsSize); - } - break; - default: - break; - } -} - -SfxImageManager::SfxImageManager(SfxModule& rModule) -{ - pImp = ::GetImageManager(rModule); -} - -SfxImageManager::~SfxImageManager() -{ -} - -namespace -{ - typedef std::unordered_map< SfxModule*, std::shared_ptr<SfxImageManager> > SfxImageManagerMap; - - class theImageManagerMap : - public rtl::Static<SfxImageManagerMap, theImageManagerMap> {}; -} - -SfxImageManager* SfxImageManager::GetImageManager(SfxModule& rModule) -{ - SolarMutexGuard aGuard; - SfxImageManager* pSfxImageManager(nullptr); - - SfxImageManagerMap &rImageManagerMap = theImageManagerMap::get(); - SfxModule* pModule = &rModule; - SfxImageManagerMap::const_iterator pIter = rImageManagerMap.find(pModule); - if ( pIter != rImageManagerMap.end() ) - pSfxImageManager = pIter->second.get(); - else - { - rImageManagerMap[pModule].reset(new SfxImageManager(rModule)); - pSfxImageManager = rImageManagerMap[pModule].get(); - } - return pSfxImageManager; -} - -Image SfxImageManager::GetImage( sal_uInt16 nId, bool bBig ) const -{ - ImageList* pImageList = pImp->GetImageList( bBig ); - if ( pImageList && pImageList->HasImageAtPos( nId ) ) - return pImageList->GetImage( nId ); - return Image(); -} - -Image SfxImageManager::GetImage( sal_uInt16 nId ) const -{ - bool bLarge = SvtMiscOptions().AreCurrentSymbolsLarge(); - return GetImage( nId, bLarge ); -} - -Image SfxImageManager::SeekImage( sal_uInt16 nId, bool bBig ) const -{ - ImageList* pImageList = pImp->GetImageList( bBig ); - if (pImageList && pImageList->HasImageAtPos(nId)) - return pImageList->GetImage( nId ); - return Image(); -} - -Image SfxImageManager::SeekImage( sal_uInt16 nId ) const -{ - bool bLarge = SvtMiscOptions().AreCurrentSymbolsLarge(); - return SeekImage( nId, bLarge ); -} - -void SfxImageManager::RegisterToolBox( ToolBox *pBox, SfxToolboxFlags nFlags ) -{ - SolarMutexGuard aGuard; - - ToolBoxInf_Impl* pInf = new ToolBoxInf_Impl; - pInf->pToolBox = pBox; - pInf->nFlags = nFlags; - pImp->m_aToolBoxes.push_back( pInf ); -} - - -void SfxImageManager::ReleaseToolBox( ToolBox *pBox ) -{ - SolarMutexGuard aGuard; - - for ( size_t n=0; n < pImp->m_aToolBoxes.size(); n++ ) - { - if ((pImp->m_aToolBoxes[n])->pToolBox == pBox ) - { - delete pImp->m_aToolBoxes[n]; - pImp->m_aToolBoxes.erase( pImp->m_aToolBoxes.begin() + n ); - return; - } - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index be206c88de7c..ab32b9267313 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -87,7 +87,6 @@ #include <sfx2/unoctitm.hxx> #include "helpid.hrc" #include "workwin.hxx" -#include <sfx2/imgmgr.hxx> #include <sfx2/imagemgr.hxx> #include <ctrlfactoryimpl.hxx> diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx index 8c2a72be8b9d..c1e6e8a69491 100644 --- a/sw/source/ui/config/mailconfigpage.cxx +++ b/sw/source/ui/config/mailconfigpage.cxx @@ -20,7 +20,6 @@ #include <swmodule.hxx> #include <swtypes.hxx> #include <mailconfigpage.hxx> -#include <sfx2/imgmgr.hxx> #include <svtools/svmedit.hxx> #include <svtools/svtabbx.hxx> #include <svtools/headbar.hxx> diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index ac2b5ad1728b..254d5905f08d 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -20,7 +20,6 @@ #include <hintids.hxx> #include <vcl/msgbox.hxx> #include <sfx2/app.hxx> -#include <sfx2/imgmgr.hxx> #include <svx/gallery.hxx> #include <editeng/brushitem.hxx> #include <editeng/lrspitem.hxx> diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index 64f7a6a8873a..63ea4fa7e15e 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -22,7 +22,6 @@ #include <comphelper/string.hxx> #include <officecfg/Office/Common.hxx> #include <tools/gen.hxx> -#include <sfx2/imgmgr.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> #include <svx/ruler.hxx> diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 30075f1169f3..e1e9adc8a222 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -28,7 +28,6 @@ #include <sot/formats.hxx> #include <sot/filelist.hxx> #include <sfx2/event.hxx> -#include <sfx2/imgmgr.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/dockwin.hxx> #include <sfx2/navigat.hxx> |