diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-10-03 15:38:54 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-10-03 15:43:45 +0200 |
commit | 02394b10d348aeabcbaceaa7659794a6b74a3768 (patch) | |
tree | 23b791aa8af85b94abede2581e68aec30da5646b /sfx2/source | |
parent | 325309a7774e10fea79d92f424ae398ea242d142 (diff) |
n#782597: Allow adding external templates
Change-Id: I56d5a716795b7303a77194964a612c550f25eeec
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/docvor.cxx | 16 |
2 files changed, 8 insertions, 12 deletions
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 25ed45909bcc..281e1c762e14 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -678,8 +678,6 @@ sal_Bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString& } catch ( Exception& ) { - // the document is not a StarOffice document - return sal_False; } try @@ -2014,7 +2012,6 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, // Get the content type OUString aTitle, aType, aTargetURL2, aFullName; - // only StarOffice documents are acceptable sal_Bool bDocHasTitle = sal_False; if( !getTitleFromURL( rSourceURL, aTitle, aType, bDocHasTitle ) ) return sal_False; @@ -2573,7 +2570,6 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList, if ( aChildTitle.compareToAscii( "sfx.tlx" ) == 0 || aChildTitle == "groupuinames.xml" ) continue; - // only StarOffice templates are accepted sal_Bool bDocHasTitle = sal_False; if( !getTitleFromURL( aTargetURL, aChildTitle, aType, bDocHasTitle ) ) continue; diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index cf016f3c5a85..2c28cd354b81 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -1548,7 +1548,7 @@ String SfxOrganizeDlg_Impl::GetPath_Impl( sal_Bool bOpen, const String& rFileNam pFileDlg->SetDisplayDirectory( aObj.GetMainURL( INetURLObject::NO_DECODE ) ); } - pFileDlg->StartExecuteModal( LINK( this, SfxOrganizeDlg_Impl, ImportHdl ) ); + pFileDlg->StartExecuteModal( LINK( this, SfxOrganizeDlg_Impl, ExportHdl ) ); return aPath; } @@ -1592,18 +1592,18 @@ String SfxOrganizeDlg_Impl::GetPath_Impl( sal_Bool bOpen, const String& rFileNam // add filters of modules which are installed SvtModuleOptions aModuleOpt; if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) ) - sFilterExt += DEFINE_CONST_UNICODE( "*.ott;*.stw;*.oth" ); + sFilterExt += DEFINE_CONST_UNICODE( "*.ott;*.stw;*.oth;*.dot;*.dotm;*.dotx" ); if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) ) { if ( sFilterExt.Len() > 0 ) sFilterExt += ';'; - sFilterExt += DEFINE_CONST_UNICODE( "*.ots;*.stc" ); + sFilterExt += DEFINE_CONST_UNICODE( "*.ots;*.stci;*.xlt;*.xltm;*.xltm" ); } if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) ) { if ( sFilterExt.Len() > 0 ) sFilterExt += ';'; - sFilterExt += DEFINE_CONST_UNICODE( "*.otp;*.sti" ); + sFilterExt += DEFINE_CONST_UNICODE( "*.otp;*.sti;*.pot;*.potm;*.potx" ); } if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) ) { @@ -1644,7 +1644,7 @@ String SfxOrganizeDlg_Impl::GetPath_Impl( sal_Bool bOpen, const String& rFileNam pFileDlg->SetDisplayDirectory( aObj.GetMainURL( INetURLObject::NO_DECODE ) ); } - pFileDlg->StartExecuteModal( LINK( this, SfxOrganizeDlg_Impl, ExportHdl ) ); + pFileDlg->StartExecuteModal( LINK( this, SfxOrganizeDlg_Impl, ImportHdl ) ); return aPaths; } @@ -2225,9 +2225,9 @@ IMPL_LINK( SfxOrganizeDlg_Impl, AddFiles_Impl, Button *, pButton ) //------------------------------------------------------------------------- -IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ImportHdl) +IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ExportHdl) { - DBG_ASSERT( pFileDlg, "SfxOrganizeDlg_Impl::ImportHdl(): no file dialog" ); + DBG_ASSERT( pFileDlg, "SfxOrganizeDlg_Impl::ExportHdl(): no file dialog" ); if ( ERRCODE_NONE == pFileDlg->GetError() ) { @@ -2262,7 +2262,7 @@ IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ImportHdl) //------------------------------------------------------------------------- -IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ExportHdl) +IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ImportHdl) { DBG_ASSERT( pFileDlg, "SfxOrganizeDlg_Impl::ImportHdl(): no file dialog" ); ::com::sun::star::uno::Sequence< ::rtl::OUString > aPaths; |