summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-11 15:43:08 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-23 10:26:40 +0200
commitc988da288ec473a28f61ebb53aa3ff82bab11ef4 (patch)
tree284f184384dba369c40e0caff533a2d683e9d478 /basctl
parenteb016138e817d686795e1902a7a295d93639da27 (diff)
fdo#46808, Adapt ui::dialogs::FolderPicker UNO service to new style
Create a merged XFolderPicker2 interface for this service to implement. Which is backwards-compatible, but does not require creating a new service. Change-Id: I4a2c2a8d491a8d5633c19ddcea547f0efe75b91d
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/moduldl2.cxx38
1 files changed, 17 insertions, 21 deletions
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index a972bf5c5fa2..baef4799806a 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -45,7 +45,7 @@
#include <sot/storage.hxx>
#include <com/sun/star/io/Pipe.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
+#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/script/XLibraryContainer2.hpp>
@@ -1386,30 +1386,26 @@ void LibPage::ExportAsBasic( const String& aLibName )
// Folder picker
Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
- Reference< XFolderPicker > xFolderPicker( xMSF->createInstance(
- "com.sun.star.ui.dialogs.FolderPicker" ), UNO_QUERY );
+ Reference< XFolderPicker2 > xFolderPicker = FolderPicker::create(xContext);
Reference< task::XInteractionHandler2 > xHandler( task::InteractionHandler::createWithParent(xContext, 0) );
- if( xFolderPicker.is() )
- {
- xFolderPicker->setTitle( String( IDEResId( RID_STR_EXPORTBASIC ) ) );
-
- // set display directory and filter
- String aPath =GetExtraData()->GetAddLibPath();
- if( !aPath.Len() )
- aPath = SvtPathOptions().GetWorkPath();
+ xFolderPicker->setTitle( String( IDEResId( RID_STR_EXPORTBASIC ) ) );
- // INetURLObject aURL(m_sSavePath, INET_PROT_FILE);
- xFolderPicker->setDisplayDirectory( aPath );
- short nRet = xFolderPicker->execute();
- if( nRet == RET_OK )
- {
- String aTargetURL = xFolderPicker->getDirectory();
- GetExtraData()->SetAddLibPath(aTargetURL);
+ // set display directory and filter
+ String aPath =GetExtraData()->GetAddLibPath();
+ if( !aPath.Len() )
+ aPath = SvtPathOptions().GetWorkPath();
+
+ // INetURLObject aURL(m_sSavePath, INET_PROT_FILE);
+ xFolderPicker->setDisplayDirectory( aPath );
+ short nRet = xFolderPicker->execute();
+ if( nRet == RET_OK )
+ {
+ String aTargetURL = xFolderPicker->getDirectory();
+ GetExtraData()->SetAddLibPath(aTargetURL);
- Reference< task::XInteractionHandler > xDummyHandler( new DummyInteractionHandler( xHandler ) );
- implExportLib( aLibName, aTargetURL, xDummyHandler );
- }
+ Reference< task::XInteractionHandler > xDummyHandler( new DummyInteractionHandler( xHandler ) );
+ implExportLib( aLibName, aTargetURL, xDummyHandler );
}
}