diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2016-11-10 02:10:00 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2016-11-11 11:13:27 +0200 |
commit | 2a778b4a4db25cc383e765be4c12b9e47b925d5b (patch) | |
tree | a16386f1e4cf2ff78e903eed834315e174c80f27 /framework | |
parent | ecdb04638c70f4063d146cf9df6d8adb5c91f78f (diff) |
RecentFile::aTitle is never read
Change-Id: Ic9f613f10914113af62fe6876e1a837a610a5782
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uielement/recentfilesmenucontroller.cxx | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index e49082166c52..da721d2bc618 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -93,16 +93,10 @@ public: private: virtual void impl_setPopupMenu() override; - struct RecentFile - { - OUString aURL; - OUString aTitle; - }; - void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu >& rPopupMenu ); void executeEntry( sal_Int32 nIndex ); - std::vector< RecentFile > m_aRecentFilesItems; + std::vector< OUString > m_aRecentFilesItems; bool m_bDisabled : 1; bool m_bShowToolbarEntries; }; @@ -152,19 +146,18 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > for ( int i = 0; i < nPickListMenuItems; i++ ) { Sequence< PropertyValue >& rPickListEntry = aHistoryList[i]; - RecentFile aRecentFile; + OUString aURL; for ( int j = 0; j < rPickListEntry.getLength(); j++ ) { - Any a = rPickListEntry[j].Value; - if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_URL ) - a >>= aRecentFile.aURL; - else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_TITLE ) - a >>= aRecentFile.aTitle; + { + rPickListEntry[j].Value >>= aURL; + break; + } } - m_aRecentFilesItems.push_back( aRecentFile ); + m_aRecentFilesItems.push_back( aURL ); } } @@ -195,7 +188,7 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > // Abbreviate URL OUString aMenuTitle; - INetURLObject aURL( m_aRecentFilesItems[i].aURL ); + INetURLObject aURL( m_aRecentFilesItems[i] ); OUString aTipHelpText( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) ); if ( aURL.GetProtocol() == INetProtocol::File ) @@ -257,8 +250,6 @@ void RecentFilesMenuController::executeEntry( sal_Int32 nIndex ) if (( nIndex >= 0 ) && ( nIndex < sal::static_int_cast<sal_Int32>( m_aRecentFilesItems.size() ))) { - const RecentFile& rRecentFile = m_aRecentFilesItems[ nIndex ]; - sal_Int32 nSize = 2; Sequence< PropertyValue > aArgsList(nSize); aArgsList[0].Name = "Referer"; @@ -276,7 +267,7 @@ void RecentFilesMenuController::executeEntry( sal_Int32 nIndex ) aArgsList[nSize-1].Value <<= m_aModuleName; } - dispatchCommand( rRecentFile.aURL, aArgsList, "_default" ); + dispatchCommand( m_aRecentFilesItems[ nIndex ], aArgsList, "_default" ); } } |