diff options
Diffstat (limited to 'framework')
19 files changed, 72 insertions, 171 deletions
diff --git a/framework/inc/classes/addonsoptions.hxx b/framework/inc/classes/addonsoptions.hxx index eef01ef79467..ae13b40dc226 100644 --- a/framework/inc/classes/addonsoptions.hxx +++ b/framework/inc/classes/addonsoptions.hxx @@ -313,9 +313,9 @@ class AddonsOptions @onerror An empty image *//*-*****************************************************************************************************/ - Image GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig, sal_Bool bHiContrast, sal_Bool bNoScale ) const; + Image GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig, sal_Bool bNoScale ) const; - Image GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig, sal_Bool bHiContrast ) const; + Image GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig ) const; //------------------------------------------------------------------------------------------------------------- // private methods //------------------------------------------------------------------------------------------------------------- diff --git a/framework/inc/classes/menumanager.hxx b/framework/inc/classes/menumanager.hxx index 2c55f287e82f..dc9c06e3af12 100644 --- a/framework/inc/classes/menumanager.hxx +++ b/framework/inc/classes/menumanager.hxx @@ -102,7 +102,7 @@ class MenuManager : public ThreadHelpBase , const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getServiceFactory(); static void UpdateSpecialWindowMenu( Menu* pMenu ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,IMutex& _rMutex); - static void FillMenuImages(::com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame,Menu* _pMenu,sal_Bool bIsHiContrast,sal_Bool bShowMenuImages); + static void FillMenuImages(::com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame,Menu* _pMenu,sal_Bool bShowMenuImages); protected: DECL_LINK( Highlight, Menu * ); @@ -144,7 +144,6 @@ class MenuManager : public ThreadHelpBase , sal_Bool m_bDeleteChildren; sal_Bool m_bActive; sal_Bool m_bIsBookmarkMenu; - sal_Bool m_bWasHiContrast; sal_Bool m_bShowMenuImages; ::rtl::OUString m_aMenuItemCommand; Menu* m_pVCLMenu; diff --git a/framework/inc/helper/imageproducer.hxx b/framework/inc/helper/imageproducer.hxx index 9b998fdf0b35..4efe9ae53df5 100644 --- a/framework/inc/helper/imageproducer.hxx +++ b/framework/inc/helper/imageproducer.hxx @@ -43,8 +43,7 @@ namespace framework typedef Image ( *pfunc_getImage)( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, - BOOL bBig, - BOOL bHiContrast + BOOL bBig ); pfunc_getImage SAL_CALL SetImageProducer( pfunc_getImage pGetImageFunc ); @@ -52,8 +51,7 @@ pfunc_getImage SAL_CALL SetImageProducer( pfunc_getImage pGetImageFunc ); Image SAL_CALL GetImageFromURL( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, - BOOL bBig, - BOOL bHiContrast + BOOL bBig ); } diff --git a/framework/inc/uielement/controlmenucontroller.hxx b/framework/inc/uielement/controlmenucontroller.hxx index 3bbc0ba9b055..9d307bba4af5 100644 --- a/framework/inc/uielement/controlmenucontroller.hxx +++ b/framework/inc/uielement/controlmenucontroller.hxx @@ -106,8 +106,7 @@ namespace framework void updateImagesPopupMenu( PopupMenu* pPopupMenu ); void fillPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu ); - sal_Bool m_bWasHiContrast : 1, - m_bShowMenuImages : 1; + sal_Bool m_bShowMenuImages : 1; PopupMenu* m_pResPopupMenu; UrlToDispatchMap m_aURLToDispatchMap; }; diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx index 3555ea9fc7df..bc9c422dd24d 100644 --- a/framework/inc/uielement/menubarmanager.hxx +++ b/framework/inc/uielement/menubarmanager.hxx @@ -248,7 +248,6 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener m_bDeleteChildren : 1, m_bActive : 1, m_bIsBookmarkMenu : 1, - m_bWasHiContrast : 1, m_bShowMenuImages : 1; sal_Bool m_bRetrieveImages : 1, m_bAcceleratorCfg : 1; diff --git a/framework/inc/uielement/newmenucontroller.hxx b/framework/inc/uielement/newmenucontroller.hxx index 628f360e506d..e89002ff19ae 100644 --- a/framework/inc/uielement/newmenucontroller.hxx +++ b/framework/inc/uielement/newmenucontroller.hxx @@ -113,12 +113,11 @@ namespace framework std::vector< KeyCode >& aMenuShortCuts ); void setAccelerators( PopupMenu* pPopupMenu ); void determineAndSetNewDocAccel( PopupMenu* pPopupMenu, const KeyCode& rKeyCode ); - void setMenuImages( PopupMenu* pPopupMenu, sal_Bool bSetImages, sal_Bool bHiContrast ); + void setMenuImages( PopupMenu* pPopupMenu, sal_Bool bSetImages ); private: // members sal_Bool m_bShowImages : 1, - m_bHiContrast : 1, m_bNewMenu : 1, m_bModuleIdentified : 1, m_bAcceleratorCfg : 1; diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx index f09ec6b6db75..0fbd7b6d3e6b 100644 --- a/framework/inc/uielement/toolbarmanager.hxx +++ b/framework/inc/uielement/toolbarmanager.hxx @@ -200,7 +200,7 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener sal_uInt16 ConvertStyleToToolboxItemBits( sal_Int32 nStyle ); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetModelFromFrame() const; sal_Bool IsPluginMode() const; - Image QueryAddonsImage( const ::rtl::OUString& aCommandURL, bool bBigImages, bool bHiContrast ); + Image QueryAddonsImage( const ::rtl::OUString& aCommandURL, bool bBigImages ); long HandleClick(void ( SAL_CALL ::com::sun::star::frame::XToolbarController::*_pClick )( )); void setToolBarImage(const Image& _aImage,const CommandToInfoMap::const_iterator& _pIter); void impl_elementChanged(bool _bRemove,const ::com::sun::star::ui::ConfigurationEvent& Event ); @@ -215,7 +215,6 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener typedef ::std::hash_map< sal_uInt16, ::com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > > MenuDescriptionMap; sal_Bool m_bDisposed : 1, - m_bIsHiContrast : 1, m_bSmallSymbols : 1, m_bModuleIdentified : 1, m_bAddedToTaskPaneList : 1, diff --git a/framework/source/classes/addonsoptions.cxx b/framework/source/classes/addonsoptions.cxx index 1ebb6588974a..31ae9a943b6d 100644 --- a/framework/source/classes/addonsoptions.cxx +++ b/framework/source/classes/addonsoptions.cxx @@ -269,7 +269,7 @@ class AddonsOptions_Impl : public ConfigItem const Sequence< Sequence< PropertyValue > >& GetAddonsToolBarPart ( sal_uInt32 nIndex ) const ; const ::rtl::OUString GetAddonsToolbarResourceName( sal_uInt32 nIndex ) const; const Sequence< Sequence< PropertyValue > >& GetAddonsHelpMenu () const ; - Image GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig, sal_Bool bHiContrast, sal_Bool bNoScale ) const; + Image GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig, sal_Bool bNoScale ) const; const MergeMenuInstructionContainer& GetMergeMenuInstructions() const; bool GetMergeToolbarInstructions( const ::rtl::OUString& rToolbarName, MergeToolbarInstructionContainer& rToolbarInstructions ) const; @@ -292,13 +292,9 @@ class AddonsOptions_Impl : public ConfigItem { Image aImageSmall; Image aImageBig; - Image aImageSmallHC; - Image aImageBigHC; Image aImageSmallNoScale; Image aImageBigNoScale; - Image aImageSmallHCNoScale; - Image aImageBigHCNoScale; }; typedef std::hash_map< ::rtl::OUString, ImageEntry, OUStringHashCode, ::std::equal_to< ::rtl::OUString > > ImageManager; @@ -607,27 +603,17 @@ bool AddonsOptions_Impl::GetMergeToolbarInstructions( //***************************************************************************************************************** // public method //***************************************************************************************************************** -Image AddonsOptions_Impl::GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig, sal_Bool bHiContrast, sal_Bool bNoScale ) const +Image AddonsOptions_Impl::GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig, sal_Bool bNoScale ) const { Image aImage; ImageManager::const_iterator pIter = m_aImageManager.find( aURL ); if ( pIter != m_aImageManager.end() ) { - if ( !bHiContrast ) - { - if ( bNoScale ) - aImage = ( bBig ? pIter->second.aImageBigNoScale : pIter->second.aImageSmallNoScale ); - if ( !aImage ) - aImage = ( bBig ? pIter->second.aImageBig : pIter->second.aImageSmall ); - } - else - { - if ( bNoScale ) - aImage = ( bBig ? pIter->second.aImageBigHCNoScale : pIter->second.aImageSmallHCNoScale ); - if ( !aImage ) - aImage = ( bBig ? pIter->second.aImageBigHC : pIter->second.aImageSmallHC ); - } + if ( bNoScale ) + aImage = ( bBig ? pIter->second.aImageBigNoScale : pIter->second.aImageSmallNoScale ); + if ( !aImage ) + aImage = ( bBig ? pIter->second.aImageBig : pIter->second.aImageSmall ); } return aImage; @@ -1406,8 +1392,8 @@ void AddonsOptions_Impl::ReadImageFromURL( ImageSize nImageSize, const ::rtl::OU //***************************************************************************************************************** void AddonsOptions_Impl::ReadAndAssociateImages( const ::rtl::OUString& aURL, const ::rtl::OUString& aImageId ) { - const int MAX_NUM_IMAGES = 4; - const char* aExtArray[MAX_NUM_IMAGES] = { "_16", "_26", "_16h", "_26h" }; + const int MAX_NUM_IMAGES = 2; + const char* aExtArray[MAX_NUM_IMAGES] = { "_16", "_26" }; const char* pBmpExt = ".bmp"; if ( aImageId.getLength() == 0 ) @@ -1442,14 +1428,6 @@ void AddonsOptions_Impl::ReadAndAssociateImages( const ::rtl::OUString& aURL, co aImageEntry.aImageBig = aImage; aImageEntry.aImageBigNoScale = aImageNoScale; break; - case 2: - aImageEntry.aImageSmallHC = aImage; - aImageEntry.aImageSmallHCNoScale = aImageNoScale; - break; - case 3: - aImageEntry.aImageBigHC = aImage; - aImageEntry.aImageBigHCNoScale = aImageNoScale; - break; } } } @@ -1482,8 +1460,7 @@ AddonsOptions_Impl::ImageEntry* AddonsOptions_Impl::ReadImageData( const ::rtl:: if (( aPropertyData[i] >>= aImageDataSeq ) && aImageDataSeq.getLength() > 0 && ( CreateImageFromSequence( aImage, - (( i == OFFSET_IMAGES_BIG ) || - ( i == OFFSET_IMAGES_BIGHC )), + ( i == OFFSET_IMAGES_BIG ), aImageDataSeq )) ) { if ( !pEntry ) @@ -1493,10 +1470,6 @@ AddonsOptions_Impl::ImageEntry* AddonsOptions_Impl::ReadImageData( const ::rtl:: pEntry->aImageSmall = aImage; else if ( i == OFFSET_IMAGES_BIG ) pEntry->aImageBig = aImage; - else if ( i == OFFSET_IMAGES_SMALLHC ) - pEntry->aImageSmallHC = aImage; - else - pEntry->aImageBigHC = aImage; } } else @@ -1523,21 +1496,11 @@ AddonsOptions_Impl::ImageEntry* AddonsOptions_Impl::ReadImageData( const ::rtl:: pEntry->aImageSmall = aImage; pEntry->aImageSmallNoScale = aImageNoScale; } - else if ( i == OFFSET_IMAGES_BIG_URL && !pEntry->aImageBig ) + else if ( !pEntry->aImageBig ) { pEntry->aImageBig = aImage; pEntry->aImageBigNoScale = aImageNoScale; } - else if ( i == OFFSET_IMAGES_SMALLHC_URL && !pEntry->aImageSmallHC ) - { - pEntry->aImageSmallHC = aImage; - pEntry->aImageSmallHCNoScale = aImageNoScale; - } - else if ( !pEntry->aImageBigHC ) - { - pEntry->aImageBigHC = aImage; - pEntry->aImageBigHCNoScale = aImageNoScale; - } } } } @@ -1806,18 +1769,18 @@ bool AddonsOptions::GetMergeToolbarInstructions( //***************************************************************************************************************** // public method //***************************************************************************************************************** -Image AddonsOptions::GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig, sal_Bool bHiContrast, sal_Bool bNoScale ) const +Image AddonsOptions::GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig, sal_Bool bNoScale ) const { MutexGuard aGuard( GetOwnStaticMutex() ); - return m_pDataContainer->GetImageFromURL( aURL, bBig, bHiContrast, bNoScale ); + return m_pDataContainer->GetImageFromURL( aURL, bBig, bNoScale ); } //***************************************************************************************************************** // public method //***************************************************************************************************************** -Image AddonsOptions::GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig, sal_Bool bHiContrast ) const +Image AddonsOptions::GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig ) const { - return GetImageFromURL( aURL, bBig, bHiContrast, sal_False ); + return GetImageFromURL( aURL, bBig, sal_False ); } //***************************************************************************************************************** diff --git a/framework/source/classes/bmkmenu.cxx b/framework/source/classes/bmkmenu.cxx index 2910cd65bd07..30202361d2f8 100644 --- a/framework/source/classes/bmkmenu.cxx +++ b/framework/source/classes/bmkmenu.cxx @@ -171,8 +171,6 @@ void BmkMenu::Initialize() ::rtl::OUString aTargetFrame; ::rtl::OUString aImageId; - BOOL bIsHiContrastMode = rSettings.GetHighContrastMode(); - UINT32 i, nCount = aDynamicMenuEntries.getLength(); for ( i = 0; i < nCount; ++i ) { @@ -192,7 +190,7 @@ void BmkMenu::Initialize() { if ( aImageId.getLength() > 0 ) { - Image aImage = GetImageFromURL( m_xFrame, aImageId, FALSE, bIsHiContrastMode ); + Image aImage = GetImageFromURL( m_xFrame, aImageId, FALSE ); if ( !!aImage ) { bImageSet = sal_True; @@ -202,7 +200,7 @@ void BmkMenu::Initialize() if ( !bImageSet ) { - Image aImage = GetImageFromURL( m_xFrame, aURL, FALSE, bIsHiContrastMode ); + Image aImage = GetImageFromURL( m_xFrame, aURL, FALSE ); if ( !aImage ) InsertItem( nId, aTitle ); else diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx index 2275a1d7eb82..df4e72a8dc18 100644 --- a/framework/source/classes/menumanager.cxx +++ b/framework/source/classes/menumanager.cxx @@ -152,7 +152,6 @@ MenuManager::MenuManager( SAL_STATIC_CAST( ::com::sun::star::uno::XInterface*, (OWeakObject*)this )->acquire(); const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - m_bWasHiContrast = rSettings.GetHighContrastMode(); m_bShowMenuImages = rSettings.GetUseImagesInMenus(); sal_Int32 nAddonsURLPrefixLength = ADDONSPOPUPMENU_URL_PREFIX.getLength(); @@ -212,7 +211,7 @@ MenuManager::MenuManager( // Set image for the addon popup menu item if ( bShowMenuImages && !pPopupMenu->GetItemImage( ITEMID_ADDONLIST )) { - Image aImage = GetImageFromURL( rFrame, aItemCommand, FALSE, m_bWasHiContrast ); + Image aImage = GetImageFromURL( rFrame, aItemCommand, FALSE ); if ( !!aImage ) pPopupMenu->SetItemImage( ITEMID_ADDONLIST, aImage ); } @@ -239,7 +238,7 @@ MenuManager::MenuManager( AddMenu(pSubMenu,::rtl::OUString(),nItemId,sal_True,sal_False); if ( bShowMenuImages && !pMenu->GetItemImage( nItemId )) { - Image aImage = GetImageFromURL( rFrame, aItemCommand, FALSE, m_bWasHiContrast ); + Image aImage = GetImageFromURL( rFrame, aItemCommand, FALSE ); if ( !!aImage ) pMenu->SetItemImage( nItemId, aImage ); } @@ -261,7 +260,7 @@ MenuManager::MenuManager( if ( bShowMenuImages && !pMenu->GetItemImage( nItemId )) { - Image aImage = GetImageFromURL( rFrame, aItemCommand, FALSE, m_bWasHiContrast ); + Image aImage = GetImageFromURL( rFrame, aItemCommand, FALSE ); if ( !!aImage ) pMenu->SetItemImage( nItemId, aImage ); } @@ -282,14 +281,14 @@ MenuManager::MenuManager( if ( pMenuAttributes && pMenuAttributes->aImageId.getLength() > 0 ) { // Retrieve image id from menu attributes - aImage = GetImageFromURL( rFrame, aImageId, FALSE, m_bWasHiContrast ); + aImage = GetImageFromURL( rFrame, aImageId, FALSE ); } if ( !aImage ) { - aImage = GetImageFromURL( rFrame, aItemCommand, FALSE, m_bWasHiContrast ); + aImage = GetImageFromURL( rFrame, aItemCommand, FALSE ); if ( !aImage ) - aImage = AddonsOptions().GetImageFromURL( aItemCommand, FALSE, m_bWasHiContrast ); + aImage = AddonsOptions().GetImageFromURL( aItemCommand, FALSE ); } if ( !!aImage ) @@ -297,7 +296,7 @@ MenuManager::MenuManager( } else if ( !pMenu->GetItemImage( nItemId )) { - Image aImage = GetImageFromURL( rFrame, aItemCommand, FALSE, m_bWasHiContrast ); + Image aImage = GetImageFromURL( rFrame, aItemCommand, FALSE ); if ( !!aImage ) pMenu->SetItemImage( nItemId, aImage ); } @@ -824,15 +823,10 @@ IMPL_LINK( MenuManager, Activate, Menu *, pMenu ) aCommand == aSpecialWindowCommand ) UpdateSpecialWindowMenu( pMenu,getServiceFactory(),m_aLock ); - // Check if some modes have changed so we have to update our menu images - sal_Bool bIsHiContrast = rSettings.GetHighContrastMode(); - - if ( m_bWasHiContrast != bIsHiContrast || bShowMenuImages != m_bShowMenuImages ) + if ( bShowMenuImages != m_bShowMenuImages ) { - // The mode changed so we have to replace all images - m_bWasHiContrast = bIsHiContrast; m_bShowMenuImages = bShowMenuImages; - FillMenuImages(m_xFrame,pMenu,bIsHiContrast,bShowMenuImages); + FillMenuImages(m_xFrame,pMenu,bShowMenuImages); } if ( m_bInitialized ) @@ -1028,7 +1022,7 @@ USHORT MenuManager::FillItemCommand(::rtl::OUString& _rItemCommand,Menu* _pMenu, } return nItemId; } -void MenuManager::FillMenuImages(Reference< XFrame >& _xFrame,Menu* _pMenu,sal_Bool bIsHiContrast,sal_Bool bShowMenuImages) +void MenuManager::FillMenuImages(Reference< XFrame >& _xFrame,Menu* _pMenu,sal_Bool bShowMenuImages) { AddonsOptions aAddonOptions; @@ -1058,7 +1052,7 @@ void MenuManager::FillMenuImages(Reference< XFrame >& _xFrame,Menu* _pMenu,sal_B if ( aImageId.getLength() > 0 ) { - Image aImage = GetImageFromURL( _xFrame, aImageId, FALSE, bIsHiContrast ); + Image aImage = GetImageFromURL( _xFrame, aImageId, FALSE ); if ( !!aImage ) { bImageSet = sal_True; @@ -1069,9 +1063,9 @@ void MenuManager::FillMenuImages(Reference< XFrame >& _xFrame,Menu* _pMenu,sal_B if ( !bImageSet ) { rtl::OUString aMenuItemCommand = _pMenu->GetItemCommand( nId ); - Image aImage = GetImageFromURL( _xFrame, aMenuItemCommand, FALSE, bIsHiContrast ); + Image aImage = GetImageFromURL( _xFrame, aMenuItemCommand, FALSE ); if ( !aImage ) - aImage = aAddonOptions.GetImageFromURL( aMenuItemCommand, FALSE, bIsHiContrast ); + aImage = aAddonOptions.GetImageFromURL( aMenuItemCommand, FALSE ); _pMenu->SetItemImage( nId, aImage ); } diff --git a/framework/source/helper/actiontriggerhelper.cxx b/framework/source/helper/actiontriggerhelper.cxx index 3506e0590af9..a5e0a1438a1e 100644 --- a/framework/source/helper/actiontriggerhelper.cxx +++ b/framework/source/helper/actiontriggerhelper.cxx @@ -115,9 +115,6 @@ void InsertSubMenuItems( Menu* pSubMenu, USHORT& nItemId, Reference< XIndexConta if ( xIndexAccess.is() ) { AddonsOptions aAddonOptions; - const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - sal_Bool bHiContrast = rSettings.GetHighContrastMode(); - OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); for ( sal_Int32 i = 0; i < xIndexAccess->getCount(); i++ ) @@ -221,7 +218,7 @@ void InsertSubMenuItems( Menu* pSubMenu, USHORT& nItemId, Reference< XIndexConta else { // Support add-on images for context menu interceptors - Image aImage = aAddonOptions.GetImageFromURL( aCommandURL, sal_False, bHiContrast, sal_True ); + Image aImage = aAddonOptions.GetImageFromURL( aCommandURL, sal_False, sal_True ); if ( !!aImage ) pSubMenu->SetItemImage( nNewItemId, aImage ); } diff --git a/framework/source/helper/imageproducer.cxx b/framework/source/helper/imageproducer.cxx index e404be304d99..e6435d822e06 100644 --- a/framework/source/helper/imageproducer.cxx +++ b/framework/source/helper/imageproducer.cxx @@ -48,12 +48,11 @@ pfunc_getImage SAL_CALL SetImageProducer( pfunc_getImage pNewGetImageFunc ) Image SAL_CALL GetImageFromURL( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, - BOOL bBig, - BOOL bHiContrast + BOOL bBig ) { if ( _pGetImageFunc ) - return _pGetImageFunc( rFrame, aURL, bBig, bHiContrast ); + return _pGetImageFunc( rFrame, aURL, bBig ); else return Image(); } diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index 73514daf6ad0..cb140c049917 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -142,25 +142,24 @@ static sal_Bool IsCorrectContext( const ::rtl::OUString& rModuleIdentifier, cons static Image RetrieveImage( Reference< com::sun::star::frame::XFrame >& rFrame, const rtl::OUString& aImageId, const rtl::OUString& aURL, - BOOL bBigImage, - BOOL bHiContrast ) + BOOL bBigImage ) { Image aImage; if ( aImageId.getLength() > 0 ) { - aImage = framework::AddonsOptions().GetImageFromURL( aImageId, bBigImage, bHiContrast ); + aImage = framework::AddonsOptions().GetImageFromURL( aImageId, bBigImage ); if ( !!aImage ) return aImage; else - aImage = GetImageFromURL( rFrame, aImageId, bBigImage, bHiContrast ); + aImage = GetImageFromURL( rFrame, aImageId, bBigImage ); if ( !!aImage ) return aImage; } - aImage = framework::AddonsOptions().GetImageFromURL( aURL, bBigImage, bHiContrast ); + aImage = framework::AddonsOptions().GetImageFromURL( aURL, bBigImage ); if ( !aImage ) - aImage = GetImageFromURL( rFrame, aImageId, bBigImage, bHiContrast ); + aImage = GetImageFromURL( rFrame, aImageId, bBigImage ); return aImage; } @@ -218,8 +217,7 @@ void AddonsToolBarManager::RefreshImages() m_pToolBar->SetItemImage( nId, RetrieveImage( m_xFrame, aImageId, aCommandURL, - bBigImages, - m_bIsHiContrast )); + bBigImages )); } } } @@ -298,7 +296,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue m_pToolBar->InsertItem( nId, aTitle ); - Image aImage = RetrieveImage( m_xFrame, aImageId, aURL, !m_bSmallSymbols, m_bIsHiContrast ); + Image aImage = RetrieveImage( m_xFrame, aImageId, aURL, !m_bSmallSymbols ); if ( !!aImage ) m_pToolBar->SetItemImage( nId, aImage ); diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx index 7b02594e8e61..3211d6aea91a 100644 --- a/framework/source/uielement/controlmenucontroller.cxx +++ b/framework/source/uielement/controlmenucontroller.cxx @@ -219,7 +219,6 @@ ControlMenuController::ControlMenuController( const ::com::sun::star::uno::Refer m_pResPopupMenu( 0 ) { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - m_bWasHiContrast = rSettings.GetHighContrastMode(); m_bShowMenuImages = rSettings.GetUseImagesInMenus(); } @@ -361,14 +360,11 @@ void SAL_CALL ControlMenuController::activate( const css::awt::MenuEvent& ) thro // Check if some modes have changed so we have to update our menu images const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - sal_Bool bIsHiContrast = rSettings.GetHighContrastMode(); sal_Bool bShowMenuImages = rSettings.GetUseImagesInMenus(); - sal_Bool bUpdateImages = (( m_bWasHiContrast != bIsHiContrast ) || ( bShowMenuImages != m_bShowMenuImages )); + sal_Bool bUpdateImages = (bShowMenuImages != m_bShowMenuImages); if ( bUpdateImages ) { - // The mode has changed or the complete menu so we have to retrieve all images again - m_bWasHiContrast = bIsHiContrast; m_bShowMenuImages = bShowMenuImages; VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( m_xPopupMenu ); diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx index fc99b77451c6..705dc9020b32 100644 --- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx @@ -136,9 +136,8 @@ ImageButtonToolbarController::ImageButtonToolbarController( ComplexToolbarController( rServiceManager, rFrame, pToolbar, nID, aCommand ) { sal_Bool bBigImages( SvtMiscOptions().AreCurrentSymbolsLarge() ); - sal_Bool bHiContrast( pToolbar->GetSettings().GetStyleSettings().GetHighContrastMode() ); - Image aImage = AddonsOptions().GetImageFromURL( aCommand, bBigImages, bHiContrast, sal_True ); + Image aImage = AddonsOptions().GetImageFromURL( aCommand, bBigImages, sal_True ); // Height will be controlled by scaling according to button height m_pToolbar->SetItemImage( m_nID, aImage ); diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index d6a6c0473656..e08968c15ecf 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -188,13 +188,11 @@ const ::rtl::OUString aSpecialWindowCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno: const ::rtl::OUString UNO_COMMAND( RTL_CONSTASCII_USTRINGPARAM( ".uno:" )); -static sal_Int16 getImageTypeFromBools( sal_Bool bBig, sal_Bool bHighContrast ) +static sal_Int16 getImageTypeFromBools( sal_Bool bBig ) { sal_Int16 n( 0 ); if ( bBig ) n |= ::com::sun::star::ui::ImageType::SIZE_LARGE; - if ( bHighContrast ) - n |= ::com::sun::star::ui::ImageType::COLOR_HIGHCONTRAST; return n; } @@ -458,7 +456,7 @@ throw (RuntimeException) return; sal_Int16 nImageType = sal_Int16(); - sal_Int16 nCurrentImageType = getImageTypeFromBools( sal_False, m_bWasHiContrast ); + sal_Int16 nCurrentImageType = getImageTypeFromBools( sal_False ); if (( Event.aInfo >>= nImageType ) && ( nImageType == nCurrentImageType )) RequestImages(); @@ -869,20 +867,16 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu ) MenuManager::UpdateSpecialWindowMenu( pMenu,getServiceFactory(),m_aLock ); // Check if some modes have changed so we have to update our menu images - sal_Bool bIsHiContrast = rSettings.GetHighContrastMode(); sal_Int16 nSymbolsStyle = SvtMiscOptions().GetCurrentSymbolsStyle(); if ( m_bRetrieveImages || - m_bWasHiContrast != bIsHiContrast || bShowMenuImages != m_bShowMenuImages || nSymbolsStyle != m_nSymbolsStyle ) { - // The mode changed so we have to replace all images - m_bWasHiContrast = bIsHiContrast; m_bShowMenuImages = bShowMenuImages; m_bRetrieveImages = sal_False; m_nSymbolsStyle = nSymbolsStyle; - MenuManager::FillMenuImages(m_xFrame,pMenu,bIsHiContrast,bShowMenuImages); + MenuManager::FillMenuImages(m_xFrame,pMenu,bShowMenuImages); } // Try to map commands to labels @@ -1266,7 +1260,6 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF m_xDispatchProvider = rDispatchProvider; const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - m_bWasHiContrast = rSettings.GetHighContrastMode(); m_bShowMenuImages = rSettings.GetUseImagesInMenus(); m_bRetrieveImages = sal_False; @@ -1431,7 +1424,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF if ( bItemShowMenuImages && !pPopup->GetItemImage( ITEMID_ADDONLIST )) { Reference< XFrame > xTemp( rFrame ); - Image aImage = GetImageFromURL( xTemp, aItemCommand, FALSE, m_bWasHiContrast ); + Image aImage = GetImageFromURL( xTemp, aItemCommand, FALSE ); if ( !!aImage ) pPopup->SetItemImage( ITEMID_ADDONLIST, aImage ); } @@ -1461,14 +1454,14 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF if ( pMenuAttributes && pMenuAttributes->aImageId.getLength() > 0 ) { // Retrieve image id from menu attributes - aImage = GetImageFromURL( m_xFrame, aImageId, FALSE, m_bWasHiContrast ); + aImage = GetImageFromURL( m_xFrame, aImageId, FALSE ); } if ( !aImage ) { - aImage = GetImageFromURL( m_xFrame, aItemCommand, FALSE, m_bWasHiContrast ); + aImage = GetImageFromURL( m_xFrame, aItemCommand, FALSE ); if ( !aImage ) - aImage = AddonsOptions().GetImageFromURL( aItemCommand, FALSE, m_bWasHiContrast ); + aImage = AddonsOptions().GetImageFromURL( aItemCommand, FALSE ); } if ( !!aImage ) @@ -2066,9 +2059,6 @@ void MenuBarManager::Init(const Reference< XFrame >& rFrame,AddonMenu* pAddonMen getServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.PopupMenuControllerFactory" ))), UNO_QUERY ); - const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - m_bWasHiContrast = rSettings.GetHighContrastMode(); - Reference< XStatusListener > xStatusListener; Reference< XDispatch > xDispatch; USHORT nItemCount = pAddonMenu->GetItemCount(); diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index a89daf163cf2..6cd3318eb19a 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -94,7 +94,7 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( NewMenuController DEFINE_INIT_SERVICE ( NewMenuController, {} ) -void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, sal_Bool bSetImages, sal_Bool bHiContrast ) +void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, sal_Bool bSetImages ) { USHORT nItemCount = pPopupMenu->GetItemCount(); Image aImage; @@ -116,7 +116,7 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, sal_Bool bSetImage if ( aImageId.getLength() > 0 ) { - aImage = GetImageFromURL( xFrame, aImageId, FALSE, bHiContrast ); + aImage = GetImageFromURL( xFrame, aImageId, FALSE ); if ( !!aImage ) { bImageSet = sal_True; @@ -128,7 +128,7 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, sal_Bool bSetImage { String aCmd( pPopupMenu->GetItemCommand( nItemId ) ); if ( aCmd.Len() ) - aImage = GetImageFromURL( xFrame, aCmd, FALSE, bHiContrast ); + aImage = GetImageFromURL( xFrame, aCmd, FALSE ); if ( !!aImage ) pPopupMenu->SetItemImage( nItemId, aImage ); @@ -328,7 +328,6 @@ void NewMenuController::retrieveShortcutsFromConfiguration( NewMenuController::NewMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) : svt::PopupMenuControllerBase( xServiceManager ), m_bShowImages( sal_True ), - m_bHiContrast( sal_False ), m_bNewMenu( sal_False ), m_bModuleIdentified( sal_False ), m_bAcceleratorCfg( sal_False ), @@ -388,7 +387,7 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup } if ( m_bShowImages ) - setMenuImages( pVCLPopupMenu, m_bShowImages, m_bHiContrast ); + setMenuImages( pVCLPopupMenu, m_bShowImages ); delete pSubMenu; } @@ -483,17 +482,14 @@ void SAL_CALL NewMenuController::activate( const css::awt::MenuEvent& ) throw (R { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); sal_Bool bShowImages( rSettings.GetUseImagesInMenus() ); - sal_Bool bHiContrast( rSettings.GetHighContrastMode() ); PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); - if (( m_bShowImages != bShowImages ) || - ( m_bHiContrast != bHiContrast )) + if ( m_bShowImages != bShowImages ) { m_bShowImages = bShowImages; - m_bHiContrast = bHiContrast; - setMenuImages( pVCLPopupMenu, m_bShowImages, m_bHiContrast ); + setMenuImages( pVCLPopupMenu, m_bShowImages ); } setAccelerators( pVCLPopupMenu ); @@ -560,7 +556,6 @@ void SAL_CALL NewMenuController::initialize( const Sequence< Any >& aArguments ) const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); m_bShowImages = rSettings.GetUseImagesInMenus(); - m_bHiContrast = rSettings.GetHighContrastMode(); m_bNewMenu = m_aCommandURL.equalsAscii( ".uno:AddDirect" ); } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 0821a55c75eb..91e010baca0a 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -176,13 +176,11 @@ throw ( RuntimeException ) //***************************************************************************************************************** -static sal_Int16 getImageTypeFromBools( sal_Bool bBig, sal_Bool bHighContrast ) +static sal_Int16 getImageTypeFromBools( sal_Bool bBig ) { sal_Int16 n( 0 ); if ( bBig ) n |= ::com::sun::star::ui::ImageType::SIZE_LARGE; - if ( bHighContrast ) - n |= ::com::sun::star::ui::ImageType::COLOR_HIGHCONTRAST; return n; } @@ -239,7 +237,6 @@ ToolBarManager::ToolBarManager( const Reference< XMultiServiceFactory >& rServic ThreadHelpBase( &Application::GetSolarMutex() ), OWeakObject(), m_bDisposed( sal_False ), - m_bIsHiContrast( pToolBar->GetSettings().GetStyleSettings().GetHighContrastMode() ), m_bSmallSymbols( !SvtMiscOptions().AreCurrentSymbolsLarge() ), m_bModuleIdentified( sal_False ), m_bAddedToTaskPaneList( sal_True ), @@ -369,21 +366,6 @@ void ToolBarManager::CheckAndUpdateImages() ResetableGuard aGuard( m_aLock ); sal_Bool bRefreshImages = sal_False; - // Check if high contrast/normal mode have changed - if ( m_pToolBar->GetSettings().GetStyleSettings().GetHighContrastMode() ) - { - if ( !m_bIsHiContrast ) - { - bRefreshImages = TRUE; - m_bIsHiContrast = sal_True; - } - } - else if ( m_bIsHiContrast ) - { - bRefreshImages = sal_True; - m_bIsHiContrast = sal_False; - } - SvtMiscOptions aMiscOptions; bool bCurrentSymbolsSmall = !aMiscOptions.AreCurrentSymbolsLarge(); if ( m_bSmallSymbols != bCurrentSymbolsSmall ) @@ -416,11 +398,11 @@ void ToolBarManager::RefreshImages() if ( nId > 0 ) { ::rtl::OUString aCommandURL = m_pToolBar->GetItemCommand( nId ); - Image aImage = GetImageFromURL( m_xFrame, aCommandURL, bBigImages, m_bIsHiContrast ); + Image aImage = GetImageFromURL( m_xFrame, aCommandURL, bBigImages ); // Try also to query for add-on images before giving up and use an // empty image. if ( !aImage ) - aImage = QueryAddonsImage( aCommandURL, bBigImages, m_bIsHiContrast ); + aImage = QueryAddonsImage( aCommandURL, bBigImages ); m_pToolBar->SetItemImage( nId, aImage ); } } @@ -764,8 +746,7 @@ void ToolBarManager::impl_elementChanged(bool _bRemove,const ::com::sun::star::u Reference< XNameAccess > xNameAccess; sal_Int16 nImageType = sal_Int16(); sal_Int16 nCurrentImageType = getImageTypeFromBools( - SvtMiscOptions().AreCurrentSymbolsLarge(), - m_bIsHiContrast ); + SvtMiscOptions().AreCurrentSymbolsLarge()); if (( Event.aInfo >>= nImageType ) && ( nImageType == nCurrentImageType ) && @@ -1559,8 +1540,7 @@ void ToolBarManager::RequestImages() } sal_Bool bBigImages( SvtMiscOptions().AreCurrentSymbolsLarge() ); - m_bIsHiContrast = m_pToolBar->GetSettings().GetStyleSettings().GetHighContrastMode(); - sal_Int16 p = getImageTypeFromBools( SvtMiscOptions().AreCurrentSymbolsLarge(), m_bIsHiContrast ); + sal_Int16 p = getImageTypeFromBools( SvtMiscOptions().AreCurrentSymbolsLarge() ); if ( m_xDocImageManager.is() ) aDocGraphicSeq = m_xDocImageManager->getImages( p, aCmdURLSeq ); @@ -1581,7 +1561,7 @@ void ToolBarManager::RequestImages() // Try also to query for add-on images before giving up and use an // empty image. if ( !aImage ) - aImage = QueryAddonsImage( aCmdURLSeq[i], bBigImages, m_bIsHiContrast ); + aImage = QueryAddonsImage( aCmdURLSeq[i], bBigImages ); pIter->second.nImageInfo = 1; // mark image as module based } @@ -1838,8 +1818,7 @@ PopupMenu * ToolBarManager::GetToolBarCustomMeun(ToolBox* pToolBar) pItemMenu->SetItemImage( STARTID_CUSTOMIZE_POPUPMENU+nPos, GetImageFromURL( m_xFrame, aCommandURL, - sal_False, - m_bIsHiContrast )); + sal_False )); } else { @@ -2241,9 +2220,9 @@ IMPL_STATIC_LINK_NOINSTANCE( ToolBarManager, ExecuteHdl_Impl, ExecuteInfo*, pExe return 0; } -Image ToolBarManager::QueryAddonsImage( const ::rtl::OUString& aCommandURL, bool bBigImages, bool bHiContrast ) +Image ToolBarManager::QueryAddonsImage( const ::rtl::OUString& aCommandURL, bool bBigImages ) { - Image aImage = framework::AddonsOptions().GetImageFromURL( aCommandURL, bBigImages, bHiContrast ); + Image aImage = framework::AddonsOptions().GetImageFromURL( aCommandURL, bBigImages ); return aImage; } diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 52deaff461e8..8853d58b6949 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -203,7 +203,7 @@ void ToolbarsMenuController::addCommand( const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); if ( rSettings.GetUseImagesInMenus() ) - aImage = GetImageFromURL( m_xFrame, rCommandURL, FALSE, rSettings.GetHighContrastMode() ); + aImage = GetImageFromURL( m_xFrame, rCommandURL, FALSE ); VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( rPopupMenu ); if ( pPopupMenu ) |