summaryrefslogtreecommitdiff
path: root/ucbhelper/source
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-10-30 11:06:18 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-10-31 12:03:30 +0100
commit1a9261124eed5baa04b069a1cb1b51f24423ec9b (patch)
tree1cb64575ef26bb2790e73b51371eff869f44cc13 /ucbhelper/source
parent1eb7a921641107cdd802e8bbc6117d6f303f73f5 (diff)
CMIS: added cancelCheckOut and checkIn implementations and menu items
Although the implementation is here, the dialogs to show when clicking on the menu items aren't there yet. Change-Id: I14886ec8ea8b97a35ca6c8474bc33e30da1a86d3
Diffstat (limited to 'ucbhelper/source')
-rw-r--r--ucbhelper/source/client/content.cxx47
1 files changed, 35 insertions, 12 deletions
diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx
index 22c9b31269f1..95e589ff8d96 100644
--- a/ucbhelper/source/client/content.cxx
+++ b/ucbhelper/source/client/content.cxx
@@ -27,6 +27,7 @@
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/ucb/CheckinArgument.hpp>
#include <com/sun/star/ucb/ContentCreationError.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/ucb/XCommandInfo.hpp>
@@ -962,7 +963,10 @@ sal_Bool Content::transferContent( const Content& rSourceContent,
InsertOperation eOperation,
const rtl::OUString & rTitle,
const sal_Int32 nNameClashAction,
- const rtl::OUString & rMimeType )
+ const rtl::OUString & rMimeType,
+ bool bMajorVersion,
+ const rtl::OUString & rVersionComment,
+ rtl::OUString* pResultURL )
throw( CommandAbortedException, RuntimeException, Exception )
{
Reference< XUniversalContentBroker > pBroker(
@@ -971,6 +975,8 @@ sal_Bool Content::transferContent( const Content& rSourceContent,
// Execute command "globalTransfer" at UCB.
TransferCommandOperation eTransOp = TransferCommandOperation();
+ rtl::OUString sCommand( "globalTransfer" );
+ bool bCheckIn = false;
switch ( eOperation )
{
case InsertOperation_COPY:
@@ -985,6 +991,12 @@ sal_Bool Content::transferContent( const Content& rSourceContent,
eTransOp = TransferCommandOperation_LINK;
break;
+ case InsertOperation_CHECKIN:
+ eTransOp = TransferCommandOperation_COPY;
+ sCommand = rtl::OUString( "checkin" );
+ bCheckIn = true;
+ break;
+
default:
ucbhelper::cancelCommandExecution(
makeAny( IllegalArgumentException(
@@ -995,20 +1007,31 @@ sal_Bool Content::transferContent( const Content& rSourceContent,
m_xImpl->getEnvironment() );
// Unreachable
}
-
- GlobalTransferCommandArgument2 aTransferArg(
- eTransOp,
- rSourceContent.getURL(), // SourceURL
- getURL(), // TargetFolderURL,
- rTitle,
- nNameClashAction,
- rMimeType );
Command aCommand;
- aCommand.Name = rtl::OUString("globalTransfer");
+ aCommand.Name = sCommand;
aCommand.Handle = -1; // n/a
- aCommand.Argument <<= aTransferArg;
- pBroker->execute( aCommand, 0, m_xImpl->getEnvironment() );
+ if ( !bCheckIn )
+ {
+ GlobalTransferCommandArgument2 aTransferArg(
+ eTransOp,
+ rSourceContent.getURL(), // SourceURL
+ getURL(), // TargetFolderURL,
+ rTitle,
+ nNameClashAction,
+ rMimeType );
+ aCommand.Argument <<= aTransferArg;
+ }
+ else
+ {
+ CheckinArgument aCheckinArg( bMajorVersion, rVersionComment,
+ rSourceContent.getURL(), getURL(), rTitle, rMimeType );
+ aCommand.Argument <<= aCheckinArg;
+ }
+
+ Any aRet = pBroker->execute( aCommand, 0, m_xImpl->getEnvironment() );
+ if ( pResultURL != NULL )
+ aRet >>= *pResultURL;
return sal_True;
}