summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorC├ędric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-10-03 15:38:54 +0200
committerPetr Mladek <pmladek@suse.cz>2012-11-05 16:56:10 +0100
commitdd22f7147e0929ae52043a0354306a8ee6710927 (patch)
treedb92bebf8be51b82e31c2f7fef020aa47c299106
parentef15a5a4acd3174752484c6aeb570d4d6444b645 (diff)
n#782597: Allow adding external templates
Change-Id: I56d5a716795b7303a77194964a612c550f25eeec
-rw-r--r--sfx2/source/doc/doctemplates.cxx4
-rw-r--r--sfx2/source/doc/docvor.cxx16
2 files changed, 8 insertions, 12 deletions
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index ecceed91d4c6..b96a3c7c7781 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -697,8 +697,6 @@ sal_Bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString&
}
catch ( Exception& )
{
- // the document is not a StarOffice document
- return sal_False;
}
try
@@ -2035,7 +2033,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;
@@ -2594,7 +2591,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 a1eded4f2b52..67f9a946357b 100644
--- a/sfx2/source/doc/docvor.cxx
+++ b/sfx2/source/doc/docvor.cxx
@@ -1559,7 +1559,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;
}
@@ -1603,18 +1603,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 ) )
{
@@ -1655,7 +1655,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;
}
@@ -2236,9 +2236,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() )
{
@@ -2273,7 +2273,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;