summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-01-05 14:46:45 +0100
committerMathias Bauer <mba@openoffice.org>2010-01-05 14:46:45 +0100
commit8478b0c12b1e51be005551a5e00b7b577b8a3d60 (patch)
tree4da94a2821c5173d55a527c43b93be74e9f33d4e /cui/source
parent06c61003faf8a61f38f7985b58d27e4fb38ef0c6 (diff)
parentb87a09786de6f985602ef29f275f44a9944992ce (diff)
merge commit for m68
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/dialogs/linkdlg.cxx12
-rw-r--r--cui/source/options/optgdlg.cxx74
-rw-r--r--cui/source/options/optgdlg.hxx3
-rw-r--r--cui/source/options/optgdlg.src1
-rw-r--r--cui/source/tabpages/numpages.cxx8
-rw-r--r--cui/source/tabpages/paragrph.cxx2
6 files changed, 53 insertions, 47 deletions
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 2337aeb3046e..106e3b898243 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -221,7 +221,7 @@ IMPL_LINK( SvBaseLinksDlg, LinksSelectHdl, SvTabListBox *, pSvTabListBox )
String aFileName;
pLinkMgr->GetDisplayNames( pLink, &sType, &aFileName, pLinkNm, pFilter );
-
+ aFileName = INetURLObject::decode(aFileName, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS);
FileName().SetText( aFileName );
SourceName().SetText( sLink );
TypeName().SetText( sType );
@@ -525,9 +525,9 @@ IMPL_LINK( SvBaseLinksDlg, UpdateWaitingHdl, Timer*, pTimer )
IMPL_LINK( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink*, _pLink )
{
USHORT nPos;
- SvBaseLink* pLink = GetSelEntry( &nPos );
+ GetSelEntry( &nPos );
- if ( pLink != _pLink && _pLink && _pLink->WasLastEditOK() )
+ if( _pLink && _pLink->WasLastEditOK() )
{
// JP 09.01.98:
// StarImpress/Draw tauschen die LinkObjecte selbst aus!
@@ -561,10 +561,6 @@ IMPL_LINK( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink*, _pLink )
if( pLinkMgr->GetPersist() )
pLinkMgr->GetPersist()->SetModified();
}
- else if ( pLink == _pLink )
- {
- DBG_ERRORFILE( "SvBaseLinksDlg::EndEditHdl(): wrong link" );
- }
return 0;
}
@@ -640,6 +636,8 @@ void SvBaseLinksDlg::InsertEntry( const SvBaseLink& rLink, USHORT nPos, sal_Bool
XubString aTxt = Links().GetEllipsisString( sFileNm, nWidthPixel, TEXT_DRAW_PATHELLIPSIS );
INetURLObject aPath( sFileNm, INET_PROT_FILE );
String aFileName = aPath.getName();
+ aFileName = INetURLObject::decode(aFileName, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS);
+
if( aFileName.Len() > aTxt.Len() )
aTxt = aFileName;
else if( aTxt.Search( aFileName, aTxt.Len() - aFileName.Len() ) == STRING_NOTFOUND )
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 7e389c4b3d15..cb9da902c050 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" ; > ;
};
};
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index bb5dcbd4f5a4..22c13efa37ab 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -305,7 +305,7 @@ SfxTabPage* SvxSingleNumPickTabPage::Create( Window* pParent,
BOOL SvxSingleNumPickTabPage::FillItemSet( SfxItemSet& rSet )
{
- if(bPreset || bModified && pSaveNum)
+ if( (bPreset || bModified) && pSaveNum)
{
*pSaveNum = *pActNum;
rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
@@ -507,7 +507,7 @@ SfxTabPage* SvxBulletPickTabPage::Create( Window* pParent,
BOOL SvxBulletPickTabPage::FillItemSet( SfxItemSet& rSet )
{
- if(bPreset || bModified && pActNum)
+ if( (bPreset || bModified) && pActNum)
{
*pSaveNum = *pActNum;
rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
@@ -744,7 +744,7 @@ SfxTabPage* SvxNumPickTabPage::Create( Window* pParent,
BOOL SvxNumPickTabPage::FillItemSet( SfxItemSet& rSet )
{
- if(bPreset || bModified && pActNum)
+ if( (bPreset || bModified) && pActNum)
{
*pSaveNum = *pActNum;
rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
@@ -1104,7 +1104,7 @@ BOOL SvxBitmapPickTabPage::FillItemSet( SfxItemSet& rSet )
// rSet.DisableItem(SID_ATTR_NUMBERING_RULE);
return FALSE;
}
- if(bPreset || bModified && pActNum)
+ if( (bPreset || bModified) && pActNum)
{
*pSaveNum = *pActNum;
rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 3f3021162db9..5722f2e9d279 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1288,7 +1288,7 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet& rSet )
aLastLineLB.Hide();
aLastLineFT.Hide();
aExpandCB.Hide();
- if(!(nHtmlMode & HTMLMODE_FULL_STYLES|HTMLMODE_FIRSTLINE) )
+ if(!(nHtmlMode & (HTMLMODE_FULL_STYLES|HTMLMODE_FIRSTLINE)) )
aJustify.Disable();
aSnapToGridCB.Show(FALSE);
}