diff options
-rw-r--r-- | offapi/UnoApi_offapi.mk | 3 | ||||
-rw-r--r-- | offapi/com/sun/star/ucb/GlobalTransferCommandArgument2.idl | 32 | ||||
-rw-r--r-- | offapi/com/sun/star/ucb/InsertCommandArgument2.idl | 31 | ||||
-rw-r--r-- | offapi/com/sun/star/ucb/TransferInfo2.idl | 31 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 6 | ||||
-rw-r--r-- | ucb/source/core/ucb.cxx | 29 | ||||
-rw-r--r-- | ucb/source/core/ucb.hxx | 4 | ||||
-rw-r--r-- | ucb/source/core/ucbcmds.cxx | 38 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 22 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.hxx | 3 | ||||
-rw-r--r-- | ucbhelper/inc/ucbhelper/content.hxx | 3 | ||||
-rw-r--r-- | ucbhelper/source/client/content.cxx | 10 |
13 files changed, 180 insertions, 48 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index f573d5ba2966..d5a65a3c9184 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -3801,10 +3801,12 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/ucb,\ FolderListCommand \ FolderListEntry \ GlobalTransferCommandArgument \ + GlobalTransferCommandArgument2 \ HandleCookiesRequest \ IOErrorCode \ IllegalIdentifierException \ InsertCommandArgument \ + InsertCommandArgument2 \ InteractiveAppException \ InteractiveAugmentedIOException \ InteractiveBadTransferURLException \ @@ -3870,6 +3872,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/ucb,\ SynchronizePolicy \ TransferCommandOperation \ TransferInfo \ + TransferInfo2 \ TransferResult \ URLAuthenticationRequest \ UnsupportedCommandException \ diff --git a/offapi/com/sun/star/ucb/GlobalTransferCommandArgument2.idl b/offapi/com/sun/star/ucb/GlobalTransferCommandArgument2.idl new file mode 100644 index 000000000000..7169ba9afbf2 --- /dev/null +++ b/offapi/com/sun/star/ucb/GlobalTransferCommandArgument2.idl @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef __com_sun_star_ucb_GlobalTransferCommandArgument2_idl__ +#define __com_sun_star_ucb_GlobalTransferCommandArgument2_idl__ + +#include <com/sun/star/ucb/GlobalTransferCommandArgument.idl> + + +module com { module sun { module star { module ucb { + +/** This struct extends the one for transfers arguments by adding a Mime + type property to it. + */ +struct GlobalTransferCommandArgument2 : GlobalTransferCommandArgument +{ + /** contains the MIME type of the source object. + */ + string MimeType; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/ucb/InsertCommandArgument2.idl b/offapi/com/sun/star/ucb/InsertCommandArgument2.idl new file mode 100644 index 000000000000..510554327a78 --- /dev/null +++ b/offapi/com/sun/star/ucb/InsertCommandArgument2.idl @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef __com_sun_star_ucb_InsertCommandArgument2_idl__ +#define __com_sun_star_ucb_InsertCommandArgument2_idl__ + +#include <com/sun/star/ucb/InsertCommandArgument.idl> + + +module com { module sun { module star { module ucb { + +/** The argument for the command "insert" augmented with some properties +*/ +struct InsertCommandArgument2 : InsertCommandArgument +{ + /** contains the MIME type of the document to insert + */ + string MimeType; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/ucb/TransferInfo2.idl b/offapi/com/sun/star/ucb/TransferInfo2.idl new file mode 100644 index 000000000000..c7bcef22daca --- /dev/null +++ b/offapi/com/sun/star/ucb/TransferInfo2.idl @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef __com_sun_star_ucb_TransferInfo2_idl__ +#define __com_sun_star_ucb_TransferInfo2_idl__ + +#include <com/sun/star/ucb/TransferInfo.idl> + +module com { module sun { module star { module ucb { + +/** extends TransferInfo structure to give some additional parameters + for transfers. + */ +struct TransferInfo2 : TransferInfo +{ + /** contains the MIME type of the source of the action + */ + string MimeType; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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 diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index e844b87fdc08..568f530cb2d3 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -26,7 +26,7 @@ #include <osl/diagnose.h> #include <cppuhelper/interfacecontainer.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> -#include <com/sun/star/ucb/GlobalTransferCommandArgument.hpp> +#include <com/sun/star/ucb/GlobalTransferCommandArgument2.hpp> #include <com/sun/star/ucb/XCommandInfo.hpp> #include <com/sun/star/ucb/XContentProvider.hpp> #include <com/sun/star/ucb/XContentProviderSupplier.hpp> @@ -654,16 +654,27 @@ Any SAL_CALL UniversalContentBroker::execute( // globalTransfer ////////////////////////////////////////////////////////////////// - GlobalTransferCommandArgument aTransferArg; + GlobalTransferCommandArgument2 aTransferArg; if ( !( aCommand.Argument >>= aTransferArg ) ) { - ucbhelper::cancelCommandExecution( - makeAny( IllegalArgumentException( - OUString( "Wrong argument type!" ), - static_cast< cppu::OWeakObject * >( this ), - -1 ) ), - Environment ); - // Unreachable + GlobalTransferCommandArgument aArg; + if ( !( aCommand.Argument >>= aArg ) ) + { + ucbhelper::cancelCommandExecution( + makeAny( IllegalArgumentException( + OUString( "Wrong argument type!" ), + static_cast< cppu::OWeakObject * >( this ), + -1 ) ), + Environment ); + // Unreachable + } + + // Copy infos into the new stucture + aTransferArg.Operation = aArg.Operation; + aTransferArg.SourceURL = aArg.SourceURL; + aTransferArg.TargetURL = aArg.TargetURL; + aTransferArg.NewTitle = aArg.NewTitle; + aTransferArg.NameClash = aArg.NameClash; } globalTransfer( aTransferArg, Environment ); diff --git a/ucb/source/core/ucb.hxx b/ucb/source/core/ucb.hxx index 8cd61e413f0a..9de5839aa08e 100644 --- a/ucb/source/core/ucb.hxx +++ b/ucb/source/core/ucb.hxx @@ -49,7 +49,7 @@ namespace cppu { class OInterfaceContainerHelper; } namespace com { namespace sun { namespace star { namespace ucb { class XCommandInfo; - struct GlobalTransferCommandArgument; + struct GlobalTransferCommandArgument2; } } } } class UniversalContentBroker : @@ -176,7 +176,7 @@ private: void globalTransfer( - const com::sun::star::ucb::GlobalTransferCommandArgument & rArg, + const com::sun::star::ucb::GlobalTransferCommandArgument2 & rArg, const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw( com::sun::star::uno::Exception ); diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index 62635e4f3a86..975b53fc8bd0 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -43,14 +43,14 @@ #include <com/sun/star/ucb/CommandEnvironment.hpp> #include <com/sun/star/ucb/CommandFailedException.hpp> #include <com/sun/star/ucb/ContentInfoAttribute.hpp> -#include <com/sun/star/ucb/GlobalTransferCommandArgument.hpp> -#include <com/sun/star/ucb/InsertCommandArgument.hpp> +#include <com/sun/star/ucb/GlobalTransferCommandArgument2.hpp> +#include <com/sun/star/ucb/InsertCommandArgument2.hpp> #include <com/sun/star/ucb/InteractiveBadTransferURLException.hpp> #include <com/sun/star/ucb/NameClash.hpp> #include <com/sun/star/ucb/NameClashException.hpp> #include <com/sun/star/ucb/OpenCommandArgument2.hpp> #include <com/sun/star/ucb/OpenMode.hpp> -#include <com/sun/star/ucb/TransferInfo.hpp> +#include <com/sun/star/ucb/TransferInfo2.hpp> #include <com/sun/star/ucb/UnsupportedNameClashException.hpp> #include <com/sun/star/ucb/XCommandInfo.hpp> #include <com/sun/star/ucb/XContentAccess.hpp> @@ -80,14 +80,14 @@ struct TransferCommandContext uno::Reference< ucb::XCommandProcessor > xProcessor; uno::Reference< ucb::XCommandEnvironment > xEnv; uno::Reference< ucb::XCommandEnvironment > xOrigEnv; - ucb::GlobalTransferCommandArgument aArg; + ucb::GlobalTransferCommandArgument2 aArg; TransferCommandContext( const uno::Reference< lang::XMultiServiceFactory > & rxSMgr, const uno::Reference< ucb::XCommandProcessor > & rxProcessor, const uno::Reference< ucb::XCommandEnvironment > & rxEnv, const uno::Reference< ucb::XCommandEnvironment > & rxOrigEnv, - const ucb::GlobalTransferCommandArgument & rArg ) + const ucb::GlobalTransferCommandArgument2 & rArg ) : xSMgr( rxSMgr ), xProcessor( rxProcessor ), xEnv( rxEnv ), xOrigEnv( rxOrigEnv ), aArg( rArg ) {} }; @@ -1171,7 +1171,7 @@ void handleNameClashRename( } } - ucb::InsertCommandArgument aArg; + ucb::InsertCommandArgument2 aArg; aArg.Data = xInputStream; aArg.ReplaceExisting = sal_False; @@ -1354,8 +1354,9 @@ void globalTransfer_( // ////////////////////////////////////////////////////////////////////// - ucb::InsertCommandArgument aArg; + ucb::InsertCommandArgument2 aArg; aArg.Data = xInputStream; + aArg.MimeType = rContext.aArg.MimeType; switch ( rContext.aArg.NameClash ) { @@ -1599,13 +1600,14 @@ void globalTransfer_( if ( xResultSet->first() ) { - ucb::GlobalTransferCommandArgument aTransArg( - rContext.aArg.Operation, // Operation + ucb::GlobalTransferCommandArgument2 aTransArg( + rContext.aArg.Operation, rtl::OUString(), // SourceURL; filled later xNew->getIdentifier() ->getContentIdentifier(), // TargetURL rtl::OUString(), // NewTitle; - rContext.aArg.NameClash ); // NameClash + rContext.aArg.NameClash, + rContext.aArg.MimeType ); TransferCommandContext aSubCtx( rContext.xSMgr, @@ -1685,7 +1687,7 @@ UniversalContentBroker::getCommandInfo() //========================================================================= void UniversalContentBroker::globalTransfer( - const ucb::GlobalTransferCommandArgument & rArg, + const ucb::GlobalTransferCommandArgument2 & rArg, const uno::Reference< ucb::XCommandEnvironment > & xEnv ) throw( uno::Exception ) { @@ -1764,12 +1766,13 @@ void UniversalContentBroker::globalTransfer( // Unreachable } - ucb::TransferInfo aTransferArg( + ucb::TransferInfo2 aTransferArg( ( rArg.Operation == ucb::TransferCommandOperation_MOVE ), // MoveData - rArg.SourceURL, // SourceURL - rArg.NewTitle, // NewTitle - rArg.NameClash ); // NameClash + rArg.SourceURL, + rArg.NewTitle, + rArg.NameClash, + rArg.MimeType ); bool bRetry; do @@ -1808,11 +1811,12 @@ void UniversalContentBroker::globalTransfer( // NameClash::ERROR. try { - ucb::TransferInfo aTransferArg1( + ucb::TransferInfo2 aTransferArg1( aTransferArg.MoveData, aTransferArg.SourceURL, aTransferArg.NewTitle, - ucb::NameClash::ERROR ); + ucb::NameClash::ERROR, + aTransferArg.MimeType ); ucb::Command aCommand1( rtl::OUString("transfer"), diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index adf9eecd83d5..a2d8f4a2eb41 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -38,7 +38,7 @@ #include <com/sun/star/task/InteractionClassification.hpp> #include <com/sun/star/ucb/ContentInfo.hpp> #include <com/sun/star/ucb/ContentInfoAttribute.hpp> -#include <com/sun/star/ucb/InsertCommandArgument.hpp> +#include <com/sun/star/ucb/InsertCommandArgument2.hpp> #include <com/sun/star/ucb/InteractiveBadTransferURLException.hpp> #include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp> #include <com/sun/star/ucb/MissingInputStreamException.hpp> @@ -668,7 +668,8 @@ namespace cmis } void Content::insert( const uno::Reference< io::XInputStream > & xInputStream, - sal_Bool bReplaceExisting, const uno::Reference< ucb::XCommandEnvironment >& xEnv ) + sal_Bool bReplaceExisting, const rtl::OUString& rMimeType, + const uno::Reference< ucb::XCommandEnvironment >& xEnv ) throw( uno::Exception ) { if ( !xInputStream.is() ) @@ -740,7 +741,7 @@ namespace cmis boost::shared_ptr< ostream > pOut( new ostringstream ( ios_base::binary | ios_base::in | ios_base::out ) ); uno::Reference < io::XOutputStream > xOutput = new ucbhelper::StdOutputStream( pOut ); copyData( xInputStream, xOutput ); - document->setContentStream( pOut, sMime, string( ), bReplaceExisting ); + document->setContentStream( pOut, sMime, OUSTR_TO_STDSTR( rMimeType ), bReplaceExisting ); } } else @@ -759,7 +760,7 @@ namespace cmis boost::shared_ptr< ostream > pOut( new ostringstream ( ios_base::binary | ios_base::in | ios_base::out ) ); uno::Reference < io::XOutputStream > xOutput = new ucbhelper::StdOutputStream( pOut ); copyData( xInputStream, xOutput ); - pFolder->createDocument( m_pObjectProps, pOut, string(), string() ); + pFolder->createDocument( m_pObjectProps, pOut, OUSTR_TO_STDSTR( rMimeType ), string() ); sNewPath = STD_TO_OUSTR( newPath ); } } @@ -1005,7 +1006,7 @@ namespace cmis -1, getCppuBooleanType() ), ucb::CommandInfo ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ), - -1, getCppuType( static_cast<ucb::InsertCommandArgument * >( 0 ) ) ), + -1, getCppuType( static_cast<ucb::InsertCommandArgument2 * >( 0 ) ) ), ucb::CommandInfo ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ), -1, getCppuType( static_cast<ucb::OpenCommandArgument2 * >( 0 ) ) ), @@ -1166,10 +1167,17 @@ namespace cmis } else if ( aCommand.Name == "insert" ) { - ucb::InsertCommandArgument arg; + ucb::InsertCommandArgument2 arg; if ( !( aCommand.Argument >>= arg ) ) + { + ucb::InsertCommandArgument insertArg; + if ( !( aCommand.Argument >>= insertArg ) ) ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); - insert( arg.Data, arg.ReplaceExisting, xEnv ); + + arg.Data = insertArg.Data; + arg.ReplaceExisting = insertArg.ReplaceExisting; + } + insert( arg.Data, arg.ReplaceExisting, arg.MimeType, xEnv ); } else if ( aCommand.Name == "delete" ) { diff --git a/ucb/source/ucp/cmis/cmis_content.hxx b/ucb/source/ucp/cmis/cmis_content.hxx index db98e3ee577a..8790834ed0cd 100644 --- a/ucb/source/ucp/cmis/cmis_content.hxx +++ b/ucb/source/ucp/cmis/cmis_content.hxx @@ -113,7 +113,8 @@ private: throw( com::sun::star::uno::Exception ); void insert( const com::sun::star::uno::Reference< com::sun::star::io::XInputStream > & xInputStream, - sal_Bool bReplaceExisting, const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv ) + sal_Bool bReplaceExisting, const ::rtl::OUString & rMimeType, + const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw( com::sun::star::uno::Exception ); void destroy( ) throw( com::sun::star::uno::Exception ); diff --git a/ucbhelper/inc/ucbhelper/content.hxx b/ucbhelper/inc/ucbhelper/content.hxx index 9c06bf5366e7..259c77292492 100644 --- a/ucbhelper/inc/ucbhelper/content.hxx +++ b/ucbhelper/inc/ucbhelper/content.hxx @@ -669,7 +669,8 @@ public: transferContent( const Content& rSourceContent, InsertOperation eOperation, const ::rtl::OUString & rTitle, - const sal_Int32 nNameClashAction ) + const sal_Int32 nNameClashAction, + const ::rtl::OUString & rMimeType = ::rtl::OUString( ) ) throw( ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception ); diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx index ec3b4544d62c..22c9b31269f1 100644 --- a/ucbhelper/source/client/content.cxx +++ b/ucbhelper/source/client/content.cxx @@ -36,7 +36,7 @@ #include <com/sun/star/ucb/ContentAction.hpp> #include <com/sun/star/ucb/OpenCommandArgument2.hpp> #include <com/sun/star/ucb/InsertCommandArgument.hpp> -#include <com/sun/star/ucb/GlobalTransferCommandArgument.hpp> +#include <com/sun/star/ucb/GlobalTransferCommandArgument2.hpp> #include <com/sun/star/ucb/NameClash.hpp> #include <com/sun/star/ucb/OpenMode.hpp> #include <com/sun/star/ucb/XContentCreator.hpp> @@ -961,7 +961,8 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, sal_Bool Content::transferContent( const Content& rSourceContent, InsertOperation eOperation, const rtl::OUString & rTitle, - const sal_Int32 nNameClashAction ) + const sal_Int32 nNameClashAction, + const rtl::OUString & rMimeType ) throw( CommandAbortedException, RuntimeException, Exception ) { Reference< XUniversalContentBroker > pBroker( @@ -995,12 +996,13 @@ sal_Bool Content::transferContent( const Content& rSourceContent, // Unreachable } - GlobalTransferCommandArgument aTransferArg( + GlobalTransferCommandArgument2 aTransferArg( eTransOp, rSourceContent.getURL(), // SourceURL getURL(), // TargetFolderURL, rTitle, - nNameClashAction ); + nNameClashAction, + rMimeType ); Command aCommand; aCommand.Name = rtl::OUString("globalTransfer"); aCommand.Handle = -1; // n/a |