diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-30 18:33:46 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-30 18:37:20 -0400 |
commit | c238c19d2fed00919e02c4bc268d99ceaa73aca1 (patch) | |
tree | 91851e45907b0d4661fdf7053ce77baf6f0c3f39 /framework | |
parent | e78b2fbc545c83b85b1a828bf65b455189c9dcb3 (diff) |
1) Don't pass filter name and 2) pass module name when opening file.
Passing the filter name bypasses the type detection, which is bad. Also,
the module name is needed in order for the type detection to intelligently
decide which app to open in case the file format type is generic, i.e.
.html, .xml, .txt etc.
Change-Id: If18f649b32e79fae58af088362b0b5f11adc8eb3
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/uielement/recentfilesmenucontroller.hxx | 1 | ||||
-rw-r--r-- | framework/source/uielement/recentfilesmenucontroller.cxx | 28 |
2 files changed, 7 insertions, 22 deletions
diff --git a/framework/inc/uielement/recentfilesmenucontroller.hxx b/framework/inc/uielement/recentfilesmenucontroller.hxx index 133a4eedb121..620820dbc34a 100644 --- a/framework/inc/uielement/recentfilesmenucontroller.hxx +++ b/framework/inc/uielement/recentfilesmenucontroller.hxx @@ -106,7 +106,6 @@ namespace framework struct RecentFile { rtl::OUString aURL; - rtl::OUString aFilter; rtl::OUString aTitle; rtl::OUString aPassword; }; diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 056d4e94adae..bbd00ab754af 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -148,8 +148,6 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_URL ) a >>= aRecentFile.aURL; - else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_FILTER ) - a >>= aRecentFile.aFilter; else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_TITLE ) a >>= aRecentFile.aTitle; else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_PASSWORD ) @@ -274,8 +272,6 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > void RecentFilesMenuController::executeEntry( sal_Int32 nIndex ) { - static int NUM_OF_PICKLIST_ARGS = 3; - Reference< css::awt::XPopupMenu > xPopupMenu; Reference< XDispatch > xDispatch; Reference< XDispatchProvider > xDispatchProvider; @@ -298,7 +294,8 @@ void RecentFilesMenuController::executeEntry( sal_Int32 nIndex ) aTargetURL.Complete = rRecentFile.aURL; m_xURLTransformer->parseStrict( aTargetURL ); - aArgsList.realloc( NUM_OF_PICKLIST_ARGS ); + sal_Int32 nSize = 2; + aArgsList.realloc(nSize); aArgsList[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" )); aArgsList[0].Value = makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER ))); @@ -306,25 +303,14 @@ void RecentFilesMenuController::executeEntry( sal_Int32 nIndex ) aArgsList[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AsTemplate" )); aArgsList[1].Value = makeAny( (sal_Bool) sal_False ); - ::rtl::OUString aFilter( rRecentFile.aFilter ); - sal_Int32 nPos = aFilter.indexOf( '|' ); - if ( nPos >= 0 ) + if (!m_aModuleName.isEmpty()) { - ::rtl::OUString aFilterOptions; - - if ( nPos < ( aFilter.getLength() - 1 ) ) - aFilterOptions = aFilter.copy( nPos+1 ); - - aArgsList[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterOptions" )); - aArgsList[2].Value <<= aFilterOptions; - - aFilter = aFilter.copy( 0, nPos-1 ); - aArgsList.realloc( ++NUM_OF_PICKLIST_ARGS ); + // Type detection needs to know which app we are opening it from. + aArgsList.realloc(++nSize); + aArgsList[nSize-1].Name = "DocumentService"; + aArgsList[nSize-1].Value <<= m_aModuleName; } - aArgsList[NUM_OF_PICKLIST_ARGS-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" )); - aArgsList[NUM_OF_PICKLIST_ARGS-1].Value <<= aFilter; - xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_default")), 0 ); } |