summaryrefslogtreecommitdiff
path: root/cui/source/options
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2009-12-10 18:31:30 +0100
committerVladimir Glazunov <vg@openoffice.org>2009-12-10 18:31:30 +0100
commit2ee1464936d571b6796dcd3336135a8283d56269 (patch)
tree77798f7572efd624c467693861039957ad004945 /cui/source/options
parent6faf78102859e7ddc05c762e1aebc47c784e2aa5 (diff)
parent2a00316c1cfb9fee87ed6b49b9e4565642f4be2b (diff)
CWS-TOOLING: integrate CWS vcl107
Diffstat (limited to 'cui/source/options')
-rw-r--r--cui/source/options/optgdlg.cxx74
-rw-r--r--cui/source/options/optgdlg.hxx3
-rw-r--r--cui/source/options/optgdlg.src1
3 files changed, 43 insertions, 35 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 2c069130c40d..656eca17fd22 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -769,6 +769,30 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) :
m_aSystemFont.Enable( FALSE );
}
+ const StyleSettings& aStyleSettings = Application::GetSettings().GetStyleSettings();
+
+ // remove non-installed icon themes
+ if( aIconStyleLB.GetEntryCount() == STYLE_SYMBOLS_THEMES_MAX )
+ {
+ // do not check 0th item == auto; it is not a real theme
+ aIconStyleItemId[0] = 0;
+ ULONG nItem = 1;
+ for ( ULONG n=0; ++n < STYLE_SYMBOLS_THEMES_MAX; )
+ {
+ if ( aStyleSettings.CheckSymbolStyle( n ) )
+ {
+ // existing style => save the item id
+ aIconStyleItemId[n] = nItem++;
+ }
+ else
+ {
+ // non-existing style => remove item;
+ aIconStyleLB.RemoveEntry( nItem );
+ aIconStyleItemId[n] = 0;
+ }
+ }
+ }
+
// add real theme name to 'auto' theme, e.g. 'auto' => 'auto (classic)'
if( aIconStyleLB.GetEntryCount() > 1 )
{
@@ -776,19 +800,14 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) :
aAutoStr += ::rtl::OUString::createFromAscii( " (" );
- switch( Application::GetSettings().GetStyleSettings().GetAutoSymbolsStyle() )
- {
- case STYLE_SYMBOLS_DEFAULT: aAutoStr += aIconStyleLB.GetEntry( 1 ); break;
- case STYLE_SYMBOLS_INDUSTRIAL: aAutoStr += aIconStyleLB.GetEntry( 2 ); break;
- case STYLE_SYMBOLS_CRYSTAL: aAutoStr += aIconStyleLB.GetEntry( 3 ); break;
- case STYLE_SYMBOLS_TANGO: aAutoStr += aIconStyleLB.GetEntry( 4 ); break;
- case STYLE_SYMBOLS_CLASSIC: aAutoStr += aIconStyleLB.GetEntry( 5 ); break;
- case STYLE_SYMBOLS_HICONTRAST: aAutoStr += aIconStyleLB.GetEntry( 6 ); break;
- }
+ ULONG nAutoStyle = aStyleSettings.GetAutoSymbolsStyle();
+ if ( aIconStyleItemId[nAutoStyle] )
+ aAutoStr += aIconStyleLB.GetEntry( aIconStyleItemId[nAutoStyle] );
aIconStyleLB.RemoveEntry( 0 );
aIconStyleLB.InsertEntry( aAutoStr += ::rtl::OUString::createFromAscii( ")" ), 0 );
- aIconStyleLB.SetSeparatorPos( aIconStyleLB.GetEntryCount() - 2 );
+ // separate auto and other icon themes
+ aIconStyleLB.SetSeparatorPos( 0 );
}
}
@@ -867,20 +886,16 @@ BOOL OfaViewTabPage::FillItemSet( SfxItemSet& )
UINT16 nStyleLB_NewSelection = aIconStyleLB.GetSelectEntryPos();
if( nStyleLB_InitialSelection != nStyleLB_NewSelection )
{
- sal_Int16 eSet = SFX_SYMBOLS_STYLE_AUTO;
- switch( nStyleLB_NewSelection )
+ // find the style name in the aIconStyleItemId table
+ // items from the non-installed icon themes were removed
+ for ( ULONG n=0; n < STYLE_SYMBOLS_THEMES_MAX; n++ )
{
- case 0: eSet = SFX_SYMBOLS_STYLE_AUTO; break;
- case 1: eSet = SFX_SYMBOLS_STYLE_DEFAULT; break;
- case 2: eSet = SFX_SYMBOLS_STYLE_HICONTRAST; break;
- case 3: eSet = SFX_SYMBOLS_STYLE_INDUSTRIAL; break;
- case 4: eSet = SFX_SYMBOLS_STYLE_CRYSTAL; break;
- case 5: eSet = SFX_SYMBOLS_STYLE_TANGO; break;
- case 6: eSet = SFX_SYMBOLS_STYLE_CLASSIC; break;
- default:
- DBG_ERROR( "OfaViewTabPage::FillItemSet(): This state of aIconStyleLB should not be possible!" );
+ if ( aIconStyleItemId[n] == nStyleLB_NewSelection )
+ {
+ aMiscOptions.SetSymbolsStyle( n );
+ n = STYLE_SYMBOLS_THEMES_MAX;
+ }
}
- aMiscOptions.SetSymbolsStyle( eSet );
}
BOOL bAppearanceChanged = FALSE;
@@ -1051,19 +1066,8 @@ void OfaViewTabPage::Reset( const SfxItemSet& )
aIconSizeLB.SelectEntryPos( nSizeLB_InitialSelection );
aIconSizeLB.SaveValue();
- if( aMiscOptions.GetSymbolsStyle() != SFX_SYMBOLS_STYLE_AUTO )
- {
- switch ( aMiscOptions.GetCurrentSymbolsStyle() )
- {
- case SFX_SYMBOLS_STYLE_DEFAULT: nStyleLB_InitialSelection = 1; break;
- case SFX_SYMBOLS_STYLE_HICONTRAST: nStyleLB_InitialSelection = 2; break;
- case SFX_SYMBOLS_STYLE_INDUSTRIAL: nStyleLB_InitialSelection = 3; break;
- case SFX_SYMBOLS_STYLE_CRYSTAL: nStyleLB_InitialSelection = 4; break;
- case SFX_SYMBOLS_STYLE_TANGO: nStyleLB_InitialSelection = 5; break;
- case SFX_SYMBOLS_STYLE_CLASSIC: nStyleLB_InitialSelection = 6; break;
- default: nStyleLB_InitialSelection = 0; break;
- }
- }
+ if( aMiscOptions.GetSymbolsStyle() != STYLE_SYMBOLS_AUTO )
+ nStyleLB_InitialSelection = aIconStyleItemId[aMiscOptions.GetCurrentSymbolsStyle()];
aIconStyleLB.SelectEntryPos( nStyleLB_InitialSelection );
aIconStyleLB.SaveValue();
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 4b86896fa58f..4813e23c4305 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -138,6 +138,9 @@ private:
UINT16 nStyleLB_InitialSelection;
BOOL bSfxSymbolsAuto;
+ // item ID for the given icon theme
+ // might be zero when the theme is not installed and the item is removed
+ ULONG aIconStyleItemId[STYLE_SYMBOLS_THEMES_MAX];
SvtTabAppearanceCfg* pAppearanceCfg;
CanvasSettings* pCanvasSettings;
SvtOptionsDrawinglayer* mpDrawinglayerOpt;
diff --git a/cui/source/options/optgdlg.src b/cui/source/options/optgdlg.src
index e8c8b9edf9a5..8318d4eccd10 100644
--- a/cui/source/options/optgdlg.src
+++ b/cui/source/options/optgdlg.src
@@ -250,6 +250,7 @@ TabPage OFA_TP_VIEW
< "Industrial" ; > ;
< "Crystal" ; > ;
< "Tango" ; > ;
+ < "Oxygen" ; > ;
< "Classic" ; > ;
};
};