summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-10-17 09:41:52 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-10-31 12:03:29 +0100
commit75bc673b60d3eb40713868ce3d1b4f62dd6e1208 (patch)
treed377d1454c0dde448869a7c581c011862d3b555e /sfx2
parent4cc2571e49de162f52ac9ec171f98732bb256517 (diff)
Travelled MIME type through UCB for CMIS UCP to use it when creating documents
Change-Id: Id067932355607d3d60994862201b531f9844506d
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx16
-rw-r--r--sfx2/source/doc/doctemplates.cxx6
2 files changed, 15 insertions, 7 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 4d5227b73658..e5380e73e4dd 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1925,7 +1925,7 @@ void SfxMedium::Transfer_Impl()
::ucbhelper::Content aTransferContent;
// Get the parent URL from the XChild if possible: why would the URL necessarily have
- // a hierarchical path? It's not the case for CMIS.
+ // a hierarchical path? It's not always the case for CMIS.
::ucbhelper::Content aDestContent;
::ucbhelper::Content::create( aDestURL, xComEnv, comphelper::getProcessComponentContext(), aDestContent );
Reference< ::com::sun::star::container::XChild> xChild( aDestContent.get(), uno::UNO_QUERY );
@@ -1996,7 +1996,8 @@ void SfxMedium::Transfer_Impl()
try
{
- if (!aTransferContent.transferContent( aSourceContent, ::ucbhelper::InsertOperation_COPY, aFileName, nNameClash ))
+ rtl::OUString aMimeType = GetFilter()->GetMimeType( );
+ if (!aTransferContent.transferContent( aSourceContent, ::ucbhelper::InsertOperation_COPY, aFileName, nNameClash, aMimeType ))
pImp->m_eError = ERRCODE_IO_GENERAL;
}
catch ( const ::com::sun::star::ucb::CommandAbortedException& )
@@ -2060,10 +2061,12 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
{
try
{
+ rtl::OUString sMimeType = GetFilter()->GetMimeType( );
if( aBackupCont.transferContent( aOriginalContent,
::ucbhelper::InsertOperation_COPY,
aBackupName,
- NameClash::OVERWRITE ) )
+ NameClash::OVERWRITE,
+ sMimeType ) )
{
pImp->m_aBackupURL = aBackObj.GetMainURL( INetURLObject::NO_DECODE );
pImp->m_bRemoveBackup = true;
@@ -2146,10 +2149,12 @@ void SfxMedium::DoBackup_Impl()
try
{
// do the transfer ( copy source file to backup dir )
+ rtl::OUString sMimeType = GetFilter()->GetMimeType( );
bSuccess = aContent.transferContent( aSourceContent,
::ucbhelper::InsertOperation_COPY,
aFileName,
- NameClash::OVERWRITE );
+ NameClash::OVERWRITE,
+ sMimeType );
if( bSuccess )
{
pImp->m_aBackupURL = aDest.GetMainURL( INetURLObject::NO_DECODE );
@@ -3276,7 +3281,8 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace )
if ( !aFileName.isEmpty() && aTmpURLObj.removeSegment() )
{
::ucbhelper::Content aTargetContent( aTmpURLObj.GetMainURL( INetURLObject::NO_DECODE ), xComEnv, comphelper::getProcessComponentContext() );
- if ( aTargetContent.transferContent( pImp->aContent, ::ucbhelper::InsertOperation_COPY, aFileName, NameClash::OVERWRITE ) )
+ rtl::OUString sMimeType = GetFilter()->GetMimeType( );
+ if ( aTargetContent.transferContent( pImp->aContent, ::ucbhelper::InsertOperation_COPY, aFileName, NameClash::OVERWRITE, sMimeType ) )
{
SetWritableForUserOnly( aTmpURL );
bTransferSuccess = true;
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index f4dbb6cf6749..c7194de34247 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1418,7 +1418,8 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU
aTargetContent.transferContent( aSourceContent,
InsertOperation_COPY,
::rtl::OUString( "groupuinames.xml" ),
- ucb::NameClash::OVERWRITE );
+ ucb::NameClash::OVERWRITE,
+ ::rtl::OUString( "text/xml" ) );
bResult = sal_True;
}
catch ( uno::Exception& )
@@ -2062,7 +2063,8 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
if( ! aTargetGroup.transferContent( aSourceContent,
InsertOperation_COPY,
aNewTemplateTargetName,
- NameClash::OVERWRITE ) )
+ NameClash::OVERWRITE,
+ aType ) )
return sal_False;
// allow to edit the added template