sal_Bool arg of SetUseImagesInMenus was abused to squeeze '2' through it
which means that icons suddenly reappeared in the menus when the gtk
theme had disabled them
ref e8f8f24c84
Change-Id: Ia9aef5ca39bda2ddf6d7c4ebc2bddc01d470d09b
This commit is contained in:
@@ -752,7 +752,9 @@ sal_Bool OfaViewTabPage::FillItemSet( SfxItemSet& )
|
||||
|
||||
if(m_pMenuIconsLB->GetSelectEntryPos() != m_pMenuIconsLB->GetSavedValue())
|
||||
{
|
||||
aMenuOpt.SetMenuIconsState( m_pMenuIconsLB->GetSelectEntryPos() == 0 ? 2 : m_pMenuIconsLB->GetSelectEntryPos() - 1);
|
||||
aMenuOpt.SetMenuIconsState(m_pMenuIconsLB->GetSelectEntryPos() == 0 ?
|
||||
TRISTATE_INDET :
|
||||
static_cast<TriState>(m_pMenuIconsLB->GetSelectEntryPos() - 1));
|
||||
bModified = sal_True;
|
||||
bMenuOptModified = sal_True;
|
||||
bAppearanceChanged = sal_True;
|
||||
|
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <svtools/svtdllapi.h>
|
||||
#include <sal/types.h>
|
||||
#include <tools/gen.hxx>
|
||||
#include <osl/mutex.hxx>
|
||||
#include <unotools/options.hxx>
|
||||
|
||||
@@ -87,8 +88,8 @@ class SVT_DLLPUBLIC SAL_WARN_UNUSED SvtMenuOptions: public utl::detail::Options
|
||||
*//*-*****************************************************************************************************/
|
||||
|
||||
sal_Bool IsEntryHidingEnabled() const;
|
||||
sal_Int16 GetMenuIconsState() const;
|
||||
void SetMenuIconsState( sal_Int16 bState );
|
||||
TriState GetMenuIconsState() const;
|
||||
void SetMenuIconsState(TriState eState);
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -338,7 +338,7 @@ private:
|
||||
bool mbHighContrast;
|
||||
bool mbUseSystemUIFonts;
|
||||
sal_uInt16 mnAutoMnemonic;
|
||||
TriState mnUseImagesInMenus;
|
||||
TriState meUseImagesInMenus;
|
||||
bool mnUseFlatBorders;
|
||||
bool mbPreferredUseImagesInMenus;
|
||||
long mnMinThumbSize;
|
||||
@@ -648,18 +648,18 @@ public:
|
||||
{ CopyData(); mpData->mnUseFlatMenus = bUseFlatMenus; }
|
||||
bool GetUseFlatMenus() const
|
||||
{ return mpData->mnUseFlatMenus; }
|
||||
void SetUseImagesInMenus( bool bUseImagesInMenus )
|
||||
{ CopyData(); mpData->mnUseImagesInMenus = bUseImagesInMenus ? TRISTATE_TRUE : TRISTATE_FALSE; }
|
||||
void SetUseImagesInMenus( TriState eUseImagesInMenus )
|
||||
{ CopyData(); mpData->meUseImagesInMenus = eUseImagesInMenus; }
|
||||
bool GetUseImagesInMenus() const;
|
||||
void SetPreferredUseImagesInMenus( bool bPreferredUseImagesInMenus )
|
||||
void SetPreferredUseImagesInMenus( bool bPreferredUseImagesInMenus )
|
||||
{ CopyData(); mpData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus; }
|
||||
bool GetPreferredUseImagesInMenus() const
|
||||
bool GetPreferredUseImagesInMenus() const
|
||||
{ return mpData->mbPreferredUseImagesInMenus; }
|
||||
void SetSkipDisabledInMenus( bool bSkipDisabledInMenus )
|
||||
void SetSkipDisabledInMenus( bool bSkipDisabledInMenus )
|
||||
{ CopyData(); mpData->mbSkipDisabledInMenus = bSkipDisabledInMenus; }
|
||||
bool GetSkipDisabledInMenus() const
|
||||
{ return mpData->mbSkipDisabledInMenus; }
|
||||
void SetHideDisabledMenuItems( bool bHideDisabledMenuItems )
|
||||
void SetHideDisabledMenuItems( bool bHideDisabledMenuItems )
|
||||
{ CopyData(); mpData->mbHideDisabledMenuItems = bHideDisabledMenuItems; }
|
||||
bool GetHideDisabledMenuItems() const
|
||||
{ return mpData->mbHideDisabledMenuItems; }
|
||||
|
@@ -43,7 +43,7 @@ using namespace ::com::sun::star::uno ;
|
||||
#define ROOTNODE_MENU OUString("Office.Common/View/Menu" )
|
||||
#define DEFAULT_DONTHIDEDISABLEDENTRIES sal_False
|
||||
#define DEFAULT_FOLLOWMOUSE sal_True
|
||||
#define DEFAULT_MENUICONS 2
|
||||
#define DEFAULT_MENUICONS TRISTATE_INDET
|
||||
|
||||
#define PROPERTYNAME_DONTHIDEDISABLEDENTRIES OUString("DontHideDisabledEntry" )
|
||||
#define PROPERTYNAME_FOLLOWMOUSE OUString("FollowMouse" )
|
||||
@@ -73,7 +73,7 @@ class SvtMenuOptions_Impl : public ConfigItem
|
||||
::std::list<Link> aList;
|
||||
sal_Bool m_bDontHideDisabledEntries ; /// cache "DontHideDisabledEntries" of Menu section
|
||||
sal_Bool m_bFollowMouse ; /// cache "FollowMouse" of Menu section
|
||||
sal_Int16 m_nMenuIcons ; /// cache "MenuIcons" of Menu section
|
||||
TriState m_eMenuIcons ; /// cache "MenuIcons" of Menu section
|
||||
|
||||
|
||||
// public methods
|
||||
@@ -149,8 +149,8 @@ class SvtMenuOptions_Impl : public ConfigItem
|
||||
sal_Bool IsFollowMouseEnabled() const
|
||||
{ return m_bFollowMouse; }
|
||||
|
||||
sal_Int16 GetMenuIconsState() const
|
||||
{ return m_nMenuIcons; }
|
||||
TriState GetMenuIconsState() const
|
||||
{ return m_eMenuIcons; }
|
||||
|
||||
void SetEntryHidingState ( sal_Bool bState )
|
||||
{
|
||||
@@ -170,9 +170,9 @@ class SvtMenuOptions_Impl : public ConfigItem
|
||||
Commit();
|
||||
}
|
||||
|
||||
void SetMenuIconsState ( sal_Int16 nState )
|
||||
void SetMenuIconsState(TriState eState)
|
||||
{
|
||||
m_nMenuIcons = nState;
|
||||
m_eMenuIcons = eState;
|
||||
SetModified();
|
||||
for ( ::std::list<Link>::const_iterator iter = aList.begin(); iter != aList.end(); ++iter )
|
||||
iter->Call( this );
|
||||
@@ -210,7 +210,7 @@ SvtMenuOptions_Impl::SvtMenuOptions_Impl()
|
||||
// Init member then.
|
||||
, m_bDontHideDisabledEntries ( DEFAULT_DONTHIDEDISABLEDENTRIES )
|
||||
, m_bFollowMouse ( DEFAULT_FOLLOWMOUSE )
|
||||
, m_nMenuIcons ( DEFAULT_MENUICONS )
|
||||
, m_eMenuIcons ( DEFAULT_MENUICONS )
|
||||
{
|
||||
// Use our static list of configuration keys to get his values.
|
||||
Sequence< OUString > seqNames = impl_GetPropertyNames();
|
||||
@@ -223,12 +223,12 @@ SvtMenuOptions_Impl::SvtMenuOptions_Impl()
|
||||
|
||||
sal_Bool bMenuIcons = sal_True;
|
||||
sal_Bool bSystemMenuIcons = sal_True;
|
||||
if (m_nMenuIcons == 2)
|
||||
if (m_eMenuIcons == TRISTATE_INDET)
|
||||
bMenuIcons = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetPreferredUseImagesInMenus());
|
||||
else
|
||||
{
|
||||
bSystemMenuIcons = sal_False;
|
||||
bMenuIcons = m_nMenuIcons ? sal_True : sal_False;
|
||||
bMenuIcons = m_eMenuIcons ? sal_True : sal_False;
|
||||
}
|
||||
|
||||
// Copy values from list in right order to our internal member.
|
||||
@@ -269,7 +269,7 @@ SvtMenuOptions_Impl::SvtMenuOptions_Impl()
|
||||
}
|
||||
}
|
||||
|
||||
m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons;
|
||||
m_eMenuIcons = bSystemMenuIcons ? TRISTATE_INDET : static_cast<TriState>(bMenuIcons);
|
||||
|
||||
EnableNotification( seqNames );
|
||||
}
|
||||
@@ -301,12 +301,12 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
|
||||
bool bMenuSettingsChanged = false;
|
||||
sal_Bool bMenuIcons = sal_True;
|
||||
sal_Bool bSystemMenuIcons = sal_True;
|
||||
if (m_nMenuIcons == 2)
|
||||
if (m_eMenuIcons == TRISTATE_INDET)
|
||||
bMenuIcons = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus());
|
||||
else
|
||||
{
|
||||
bSystemMenuIcons = sal_False;
|
||||
bMenuIcons = m_nMenuIcons ? sal_True : sal_False;
|
||||
bMenuIcons = m_eMenuIcons ? sal_True : sal_False;
|
||||
}
|
||||
|
||||
// Step over list of property names and get right value from coreesponding value list to set it on internal members!
|
||||
@@ -340,7 +340,7 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
|
||||
}
|
||||
|
||||
if ( bMenuSettingsChanged )
|
||||
m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons;
|
||||
m_eMenuIcons = bSystemMenuIcons ? TRISTATE_INDET : static_cast<TriState>(bMenuIcons);
|
||||
|
||||
for ( ::std::list<Link>::const_iterator iter = aList.begin(); iter != aList.end(); ++iter )
|
||||
iter->Call( this );
|
||||
@@ -375,7 +375,7 @@ void SvtMenuOptions_Impl::Commit()
|
||||
}
|
||||
break;
|
||||
case PROPERTYHANDLE_SYSTEMICONSINMENUES : {
|
||||
sal_Bool bValue = (m_nMenuIcons == 2 ? sal_True : sal_False) ;
|
||||
sal_Bool bValue = (m_eMenuIcons == TRISTATE_INDET ? sal_True : sal_False) ;
|
||||
seqValues[nProperty] <<= bValue;
|
||||
}
|
||||
break;
|
||||
@@ -477,7 +477,7 @@ sal_Bool SvtMenuOptions::IsEntryHidingEnabled() const
|
||||
//*****************************************************************************************************************
|
||||
// public method
|
||||
//*****************************************************************************************************************
|
||||
sal_Int16 SvtMenuOptions::GetMenuIconsState() const
|
||||
TriState SvtMenuOptions::GetMenuIconsState() const
|
||||
{
|
||||
MutexGuard aGuard( GetOwnStaticMutex() );
|
||||
return m_pDataContainer->GetMenuIconsState();
|
||||
@@ -486,10 +486,10 @@ sal_Int16 SvtMenuOptions::GetMenuIconsState() const
|
||||
//*****************************************************************************************************************
|
||||
// public method
|
||||
//*****************************************************************************************************************
|
||||
void SvtMenuOptions::SetMenuIconsState( sal_Int16 bState )
|
||||
void SvtMenuOptions::SetMenuIconsState(TriState eState)
|
||||
{
|
||||
MutexGuard aGuard( GetOwnStaticMutex() );
|
||||
m_pDataContainer->SetMenuIconsState( bState );
|
||||
m_pDataContainer->SetMenuIconsState(eState);
|
||||
}
|
||||
|
||||
//*****************************************************************************************************************
|
||||
|
@@ -207,7 +207,7 @@ ImplStyleData::ImplStyleData() :
|
||||
mnOptions = 0;
|
||||
mnAutoMnemonic = 1;
|
||||
mnToolbarIconSize = STYLE_TOOLBAR_ICONSIZE_UNKNOWN;
|
||||
mnUseImagesInMenus = TRISTATE_INDET;
|
||||
meUseImagesInMenus = TRISTATE_INDET;
|
||||
mpFontOptions = NULL;
|
||||
mnEdgeBlending = 35;
|
||||
maEdgeBlendingTopLeftColor = RGB_COLORDATA(0xC0, 0xC0, 0xC0);
|
||||
@@ -323,7 +323,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
|
||||
mnUseFlatBorders = rData.mnUseFlatBorders;
|
||||
mnUseFlatMenus = rData.mnUseFlatMenus;
|
||||
mnAutoMnemonic = rData.mnAutoMnemonic;
|
||||
mnUseImagesInMenus = rData.mnUseImagesInMenus;
|
||||
meUseImagesInMenus = rData.meUseImagesInMenus;
|
||||
mbPreferredUseImagesInMenus = rData.mbPreferredUseImagesInMenus;
|
||||
mbSkipDisabledInMenus = rData.mbSkipDisabledInMenus;
|
||||
mbHideDisabledMenuItems = rData.mbHideDisabledMenuItems;
|
||||
@@ -519,7 +519,7 @@ void StyleSettings::SetCheckedColorSpecialCase( )
|
||||
bool StyleSettings::GetUseImagesInMenus() const
|
||||
{
|
||||
// icon mode selected in Tools -> Options... -> OpenOffice.org -> View
|
||||
switch (mpData->mnUseImagesInMenus) {
|
||||
switch (mpData->meUseImagesInMenus) {
|
||||
case TRISTATE_FALSE:
|
||||
return false;
|
||||
case TRISTATE_TRUE:
|
||||
@@ -774,7 +774,7 @@ bool StyleSettings::operator ==( const StyleSettings& rSet ) const
|
||||
(mpData->maPushButtonFont == rSet.mpData->maPushButtonFont) &&
|
||||
(mpData->maFieldFont == rSet.mpData->maFieldFont) &&
|
||||
(mpData->maIconFont == rSet.mpData->maIconFont) &&
|
||||
(mpData->mnUseImagesInMenus == rSet.mpData->mnUseImagesInMenus) &&
|
||||
(mpData->meUseImagesInMenus == rSet.mpData->meUseImagesInMenus) &&
|
||||
(mpData->mbPreferredUseImagesInMenus == rSet.mpData->mbPreferredUseImagesInMenus) &&
|
||||
(mpData->mbSkipDisabledInMenus == rSet.mpData->mbSkipDisabledInMenus) &&
|
||||
(mpData->mbHideDisabledMenuItems == rSet.mpData->mbHideDisabledMenuItems) &&
|
||||
|
Reference in New Issue
Block a user