[Libreoffice-commits] .: 2 commits - framework/inc framework/source svtools/inc svtools/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed May 30 16:17:35 PDT 2012
framework/inc/uielement/recentfilesmenucontroller.hxx | 1
framework/source/uielement/recentfilesmenucontroller.cxx | 28 +++------------
svtools/inc/svtools/popupmenucontrollerbase.hxx | 1
svtools/source/uno/popupmenucontrollerbase.cxx | 2 +
4 files changed, 10 insertions(+), 22 deletions(-)
New commits:
commit c238c19d2fed00919e02c4bc268d99ceaa73aca1
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 30 18:33:46 2012 -0400
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
diff --git a/framework/inc/uielement/recentfilesmenucontroller.hxx b/framework/inc/uielement/recentfilesmenucontroller.hxx
index 133a4ee..620820d 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 056d4e9..bbd00ab 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 );
}
commit e78b2fbc545c83b85b1a828bf65b455189c9dcb3
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 30 18:17:21 2012 -0400
Store the module name here. I need to use it in the recent files menu.
Change-Id: Ib074b6a4ac6c2fe89edf0a0e4b2faf2d8a8eae68
diff --git a/svtools/inc/svtools/popupmenucontrollerbase.hxx b/svtools/inc/svtools/popupmenucontrollerbase.hxx
index 5bd15cf..3252b3a 100644
--- a/svtools/inc/svtools/popupmenucontrollerbase.hxx
+++ b/svtools/inc/svtools/popupmenucontrollerbase.hxx
@@ -131,6 +131,7 @@ namespace svt
bool m_bInitialized;
rtl::OUString m_aCommandURL;
rtl::OUString m_aBaseURL;
+ rtl::OUString m_aModuleName;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xDispatch;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
diff --git a/svtools/source/uno/popupmenucontrollerbase.cxx b/svtools/source/uno/popupmenucontrollerbase.cxx
index 69e942e..cdc12be 100644
--- a/svtools/source/uno/popupmenucontrollerbase.cxx
+++ b/svtools/source/uno/popupmenucontrollerbase.cxx
@@ -373,6 +373,8 @@ void SAL_CALL PopupMenuControllerBase::initialize( const Sequence< Any >& aArgum
aPropValue.Value >>= xFrame;
else if ( aPropValue.Name == "CommandURL" )
aPropValue.Value >>= aCommandURL;
+ else if ( aPropValue.Name == "ModuleName" )
+ aPropValue.Value >>= m_aModuleName;
}
}
More information about the Libreoffice-commits
mailing list