From b72f59d414a398e3c64f1723f76e7dbaa5d73792 Mon Sep 17 00:00:00 2001 From: Philipp Lohmann Date: Wed, 28 Oct 2009 13:31:14 +0100 Subject: #i106374# clean up dead code (thanks cmc) --- shell/inc/internal/xml_parser.hxx | 7 ------- shell/source/all/xml_parser.cxx | 14 -------------- shell/source/backends/gconfbe/gconfbackend.cxx | 3 +-- shell/source/backends/gconfbe/gconfbackend.hxx | 5 +++-- shell/source/unix/sysshell/recently_used_file.cxx | 6 ------ shell/source/unix/sysshell/recently_used_file.hxx | 3 --- .../unix/sysshell/recently_used_file_handler.cxx | 20 -------------------- 7 files changed, 4 insertions(+), 54 deletions(-) diff --git a/shell/inc/internal/xml_parser.hxx b/shell/inc/internal/xml_parser.hxx index 5c52fcb7cd13..e27fbdccd01d 100644 --- a/shell/inc/internal/xml_parser.hxx +++ b/shell/inc/internal/xml_parser.hxx @@ -75,9 +75,6 @@ public: //######################################################## xml_parser(const XML_Char* EncodingName = 0); - //######################################################## - xml_parser(const XML_Char* EncodingName, XML_Char NamespaceSeparator); - //######################################################## ~xml_parser(); @@ -126,10 +123,6 @@ public: /** Returns the currently used document handler or null if no document handler was set before. */ i_xml_parser_event_handler* get_document_handler() const; - - //############################################ - void set_encoding(const XML_Char* Encoding); - private: void init(); diff --git a/shell/source/all/xml_parser.cxx b/shell/source/all/xml_parser.cxx index 1c898afde0a2..046397f64b8b 100644 --- a/shell/source/all/xml_parser.cxx +++ b/shell/source/all/xml_parser.cxx @@ -89,14 +89,6 @@ xml_parser::xml_parser(const XML_Char* EncodingName) : init(); } -//################################################### -xml_parser::xml_parser(const XML_Char* EncodingName, XML_Char /*NamespaceSeparator*/) : - document_handler_(0), - xml_parser_(XML_ParserCreate(EncodingName)) -{ - init(); -} - //################################################### xml_parser::~xml_parser() { @@ -224,9 +216,3 @@ i_xml_parser_event_handler* xml_parser::get_document_handler() const { return document_handler_; } - -//################################################### -void xml_parser::set_encoding(const XML_Char* Encoding) -{ - XML_SetEncoding(xml_parser_, Encoding); -} diff --git a/shell/source/backends/gconfbe/gconfbackend.cxx b/shell/source/backends/gconfbe/gconfbackend.cxx index 504c3bba9232..3c5b5eb86ad6 100644 --- a/shell/source/backends/gconfbe/gconfbackend.cxx +++ b/shell/source/backends/gconfbe/gconfbackend.cxx @@ -763,7 +763,6 @@ keyChangedCallback(GConfClient* aClient, aGconfBe->notifyListeners(aGconfKey); } -#endif //------------------------------------------------------------------------------ @@ -827,7 +826,7 @@ void GconfBackend::notifyListeners(const rtl::OUString& /*aGconfKey*/) } */ } - +#endif //------------------------------------------------------------------------------ void SAL_CALL GconfBackend::addChangesListener( diff --git a/shell/source/backends/gconfbe/gconfbackend.hxx b/shell/source/backends/gconfbe/gconfbackend.hxx index 721586a80186..185577ec0265 100644 --- a/shell/source/backends/gconfbe/gconfbackend.hxx +++ b/shell/source/backends/gconfbe/gconfbackend.hxx @@ -174,10 +174,11 @@ class GconfBackend : public BackendBase { const uno::Reference& xListener, const rtl::OUString& aComponent) throw (::com::sun::star::uno::RuntimeException); - +// currently not used +#if 0 //Notify all listener of component change void notifyListeners(const rtl::OUString& aGconfKey); - +#endif protected: /** Service constructor from a service factory. diff --git a/shell/source/unix/sysshell/recently_used_file.cxx b/shell/source/unix/sysshell/recently_used_file.cxx index 9126f1829ed7..6de067a62936 100644 --- a/shell/source/unix/sysshell/recently_used_file.cxx +++ b/shell/source/unix/sysshell/recently_used_file.cxx @@ -114,12 +114,6 @@ void recently_used_file::reset() const rewind(file_); } -//------------------------------------------------ -void recently_used_file::flush() -{ - fflush(file_); -} - //------------------------------------------------ void recently_used_file::truncate(off_t length) { diff --git a/shell/source/unix/sysshell/recently_used_file.hxx b/shell/source/unix/sysshell/recently_used_file.hxx index 93d0027a0d3e..ec27e5458cf0 100644 --- a/shell/source/unix/sysshell/recently_used_file.hxx +++ b/shell/source/unix/sysshell/recently_used_file.hxx @@ -53,9 +53,6 @@ public: //---------------------------- void truncate(off_t length = 0); - //---------------------------- - void flush(); - //---------------------------- size_t read( char* buffer, diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx b/shell/source/unix/sysshell/recently_used_file_handler.cxx index faf8118d7f8d..80d22501ed46 100644 --- a/shell/source/unix/sysshell/recently_used_file_handler.cxx +++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx @@ -49,18 +49,6 @@ #include namespace /* private */ { - - const rtl::OUString ENVV_UPDATE_RECENTLY_USED = - rtl::OUString::createFromAscii("ENABLE_UPDATE_RECENTLY_USED"); - - //######################################## - inline rtl::OString get_file_extension(const rtl::OString& file_url) - { - sal_Int32 index = file_url.lastIndexOf('.'); - OSL_ENSURE((index != -1) && ((index + 1) < file_url.getLength()), "Invalid file url"); - return file_url.copy(index + 1); - } - //######################################## typedef std::vector string_container_t; @@ -475,14 +463,6 @@ namespace /* private */ { greater_recently_used_item()); } - //############################## - bool update_recently_used_enabled() - { - rtl::OUString tmp; - osl_getEnvironment(ENVV_UPDATE_RECENTLY_USED.pData, &tmp.pData); - return (tmp.getLength() > 0); - } - //------------------------------------------------ struct cleanup_guard { -- cgit From 1e5a2483572d7185407352ffce2493e41f205532 Mon Sep 17 00:00:00 2001 From: Philipp Lohmann Date: Wed, 28 Oct 2009 14:32:30 +0100 Subject: #i105062# improve icon theme fallback (thanks pmladek) --- svx/source/cui/optgdlg.cxx | 72 ++++++++++++++++++++++++---------------------- svx/source/cui/optgdlg.hxx | 3 ++ 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/svx/source/cui/optgdlg.cxx b/svx/source/cui/optgdlg.cxx index 9a53de6bea72..586bc9d737c0 100644 --- a/svx/source/cui/optgdlg.cxx +++ b/svx/source/cui/optgdlg.cxx @@ -781,6 +781,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 ) { @@ -788,19 +812,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 ); } } @@ -879,20 +898,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; @@ -1064,18 +1079,7 @@ void OfaViewTabPage::Reset( const SfxItemSet& ) 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; - } - } + nStyleLB_InitialSelection = aIconStyleItemId[aMiscOptions.GetCurrentSymbolsStyle()]; aIconStyleLB.SelectEntryPos( nStyleLB_InitialSelection ); aIconStyleLB.SaveValue(); diff --git a/svx/source/cui/optgdlg.hxx b/svx/source/cui/optgdlg.hxx index 4b86896fa58f..4813e23c4305 100644 --- a/svx/source/cui/optgdlg.hxx +++ b/svx/source/cui/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; -- cgit From 823828faa089adcc4f1a02738d472c88f0d09613 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 9 Nov 2009 14:20:19 +0100 Subject: #i103482# add oxygen icon theme --- svx/source/cui/optgdlg.src | 1 + 1 file changed, 1 insertion(+) diff --git a/svx/source/cui/optgdlg.src b/svx/source/cui/optgdlg.src index f663a7ed44ef..79de8e17b96d 100644 --- a/svx/source/cui/optgdlg.src +++ b/svx/source/cui/optgdlg.src @@ -250,6 +250,7 @@ TabPage OFA_TP_VIEW < "Industrial" ; > ; < "Crystal" ; > ; < "Tango" ; > ; + < "Oxygen" ; > ; < "Classic" ; > ; }; }; -- cgit From 820bd98dc89219439df5bb460e5bcbbfe71d1845 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 9 Nov 2009 18:22:51 +0100 Subject: vcl107: #i91205# add document path menu on Mac --- framework/source/helper/titlebarupdate.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx index c57840b4d442..feec90e5a167 100644 --- a/framework/source/helper/titlebarupdate.cxx +++ b/framework/source/helper/titlebarupdate.cxx @@ -371,6 +371,12 @@ void TitleBarUpdate::impl_updateIcon(const css::uno::Reference< css::frame::XFra { WorkWindow* pWorkWindow = (WorkWindow*)pWindow; pWorkWindow->SetIcon( (sal_uInt16)nIcon ); + + css::uno::Reference< css::frame::XModel > xModel = xController->getModel(); + rtl::OUString aURL; + if( xModel.is() ) + aURL = xModel->getURL(); + pWorkWindow->SetRepresentedURL( aURL ); } aSolarLock.clear(); -- cgit From e703b510971dfcab5ece9d3f09243231c0b9594a Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 13 Nov 2009 11:06:32 +0100 Subject: vcl107: #i103482# get rid of SFX_SYMBOLS_STYLE --- svx/source/cui/optgdlg.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/cui/optgdlg.cxx b/svx/source/cui/optgdlg.cxx index 586bc9d737c0..27fd25ac4be9 100644 --- a/svx/source/cui/optgdlg.cxx +++ b/svx/source/cui/optgdlg.cxx @@ -1078,7 +1078,7 @@ void OfaViewTabPage::Reset( const SfxItemSet& ) aIconSizeLB.SelectEntryPos( nSizeLB_InitialSelection ); aIconSizeLB.SaveValue(); - if( aMiscOptions.GetSymbolsStyle() != SFX_SYMBOLS_STYLE_AUTO ) + if( aMiscOptions.GetSymbolsStyle() != STYLE_SYMBOLS_AUTO ) nStyleLB_InitialSelection = aIconStyleItemId[aMiscOptions.GetCurrentSymbolsStyle()]; aIconStyleLB.SelectEntryPos( nStyleLB_InitialSelection ); -- cgit