[Libreoffice-commits] .: 15 commits - basctl/uiconfig chart2/uiconfig cui/source curl/ExternalProject_curl.mk dbaccess/uiconfig extensions/source offapi/com offapi/UnoApi_offapi.mk officecfg/registry sc/uiconfig sd/uiconfig sfx2/inc sfx2/sdi sfx2/source starmath/uiconfig svtools/source sw/CppunitTest_sw_filters_test.mk sw/CppunitTest_sw_subsequent_odfexport.mk sw/CppunitTest_sw_subsequent_odfimport.mk sw/CppunitTest_sw_subsequent_ooxmlexport.mk sw/CppunitTest_sw_subsequent_ooxmlimport.mk sw/CppunitTest_sw_subsequent_rtfexport.mk sw/CppunitTest_sw_subsequent_rtfimport.mk sw/CppunitTest_sw_subsequent_ww8import.mk sw/uiconfig tools/inc tools/qa tools/source ucbhelper/inc ucbhelper/source ucb/source unotest/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Oct 31 04:06:46 PDT 2012
basctl/uiconfig/basicide/menubar/menubar.xml | 3
chart2/uiconfig/menubar/menubar.xml | 3
cui/source/options/optcolor.cxx | 4
curl/ExternalProject_curl.mk | 5
dbaccess/uiconfig/dbapp/menubar/menubar.xml | 3
dbaccess/uiconfig/dbquery/menubar/menubar.xml | 3
dbaccess/uiconfig/dbrelation/menubar/menubar.xml | 3
dbaccess/uiconfig/dbtable/menubar/menubar.xml | 3
dbaccess/uiconfig/dbtdata/menubar/menubar.xml | 3
extensions/source/bibliography/uiconfig/sbibliography/menubar/menubar.xml | 3
offapi/UnoApi_offapi.mk | 4
offapi/com/sun/star/document/XCmisDocument.idl | 20
offapi/com/sun/star/ucb/CheckinArgument.idl | 60 +
offapi/com/sun/star/ucb/GlobalTransferCommandArgument2.idl | 32
offapi/com/sun/star/ucb/InsertCommandArgument2.idl | 31
offapi/com/sun/star/ucb/TransferInfo2.idl | 31
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 15
officecfg/registry/data/org/openoffice/ucb/Configuration.xcu | 2
sc/uiconfig/scalc/menubar/menubar.xml | 3
sd/uiconfig/sdraw/menubar/menubar.xml | 3
sd/uiconfig/simpress/menubar/menubar.xml | 3
sfx2/inc/sfx2/docfile.hxx | 2
sfx2/inc/sfx2/infobar.hxx | 10
sfx2/inc/sfx2/objsh.hxx | 4
sfx2/inc/sfx2/sfxbasecontroller.hxx | 2
sfx2/inc/sfx2/sfxbasemodel.hxx | 10
sfx2/inc/sfx2/sfxcommands.h | 3
sfx2/inc/sfx2/sfxsids.hrc | 4
sfx2/inc/sfx2/viewfrm.hxx | 5
sfx2/sdi/docslots.sdi | 15
sfx2/sdi/sfx.sdi | 72 ++
sfx2/source/appl/appuno.cxx | 3
sfx2/source/dialog/infobar.cxx | 77 ++
sfx2/source/doc/docfile.cxx | 72 +-
sfx2/source/doc/doctemplates.cxx | 6
sfx2/source/doc/objserv.cxx | 136 ++++
sfx2/source/doc/objstor.cxx | 22
sfx2/source/doc/sfxbasemodel.cxx | 160 ++++
sfx2/source/view/sfxbasecontroller.cxx | 63 -
sfx2/source/view/viewfrm.cxx | 7
starmath/uiconfig/smath/menubar/menubar.xml | 5
svtools/source/dialogs/ServerDetailsControls.cxx | 6
sw/CppunitTest_sw_filters_test.mk | 1
sw/CppunitTest_sw_subsequent_odfexport.mk | 1
sw/CppunitTest_sw_subsequent_odfimport.mk | 1
sw/CppunitTest_sw_subsequent_ooxmlexport.mk | 1
sw/CppunitTest_sw_subsequent_ooxmlimport.mk | 1
sw/CppunitTest_sw_subsequent_rtfexport.mk | 1
sw/CppunitTest_sw_subsequent_rtfimport.mk | 1
sw/CppunitTest_sw_subsequent_ww8import.mk | 1
sw/uiconfig/sglobal/menubar/menubar.xml | 3
sw/uiconfig/sweb/menubar/menubar.xml | 3
sw/uiconfig/swform/menubar/menubar.xml | 3
sw/uiconfig/swreport/menubar/menubar.xml | 3
sw/uiconfig/swriter/menubar/menubar.xml | 3
sw/uiconfig/swxform/menubar/menubar.xml | 3
tools/inc/tools/urlobj.hxx | 2
tools/qa/cppunit/test_urlobj.cxx | 8
tools/source/fsys/urlobj.cxx | 8
ucb/source/core/ucb.cxx | 34 -
ucb/source/core/ucb.hxx | 9
ucb/source/core/ucbcmds.cxx | 131 +++
ucb/source/core/ucbcmds.hxx | 3
ucb/source/ucp/cmis/cmis_content.cxx | 332 ++++++++--
ucb/source/ucp/cmis/cmis_content.hxx | 18
ucb/source/ucp/cmis/cmis_repo_content.cxx | 2
ucb/source/ucp/cmis/cmis_repo_content.hxx | 2
ucb/source/ucp/cmis/cmis_url.cxx | 2
ucbhelper/inc/ucbhelper/content.hxx | 14
ucbhelper/source/client/content.cxx | 49 +
unotest/source/cpp/macros_test.cxx | 3
71 files changed, 1379 insertions(+), 185 deletions(-)
New commits:
commit 99f376d2d143fa169fbf6e2527a897277d586524
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Wed Oct 31 11:21:50 2012 +0100
Fix broken sw unit introduced by commit a522818
Change-Id: I78a191e39dee00d31ddd773e7b49af73be3136cc
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 46f0bee..163929e 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2683,23 +2683,27 @@ void SAL_CALL SfxBaseModel::checkIn( sal_Bool bIsMajor, const rtl::OUString& rMe
sal_Bool SfxBaseModel::getBoolPropertyValue( const rtl::OUString& rName ) throw ( uno::RuntimeException )
{
sal_Bool bValue = sal_False;
- SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
- if ( pMedium )
+ if ( m_pData->m_pObjectShell )
{
- try
+ SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
+ if ( pMedium )
{
- ::ucbhelper::Content aContent( pMedium->GetName( ),
- uno::Reference<ucb::XCommandEnvironment>(),
- comphelper::getProcessComponentContext() );
- com::sun::star::uno::Reference < beans::XPropertySetInfo > xProps = aContent.getProperties();
- if ( xProps->hasPropertyByName( rName ) )
+ try
{
- aContent.getPropertyValue( rName ) >>= bValue;
+ ::ucbhelper::Content aContent( pMedium->GetName( ),
+ uno::Reference<ucb::XCommandEnvironment>(),
+ comphelper::getProcessComponentContext() );
+ com::sun::star::uno::Reference < beans::XPropertySetInfo > xProps = aContent.getProperties();
+ if ( xProps->hasPropertyByName( rName ) )
+ {
+ aContent.getPropertyValue( rName ) >>= bValue;
+ }
+ }
+ catch ( const uno::Exception & )
+ {
+ // Simply ignore it: it's likely the document isn't versionable in that case
+ bValue = sal_False;
}
- }
- catch ( const uno::Exception & e )
- {
- throw uno::RuntimeException( e.Message, e.Context );
}
}
return bValue;
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 81638ff..dee5ea7 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1440,31 +1440,34 @@ void SfxBaseController::ShowInfoBars( )
{
// CMIS verifications
REFERENCE< document::XCmisDocument > xCmisDoc( m_pData->m_pViewShell->GetObjectShell()->GetModel(), uno::UNO_QUERY );
- beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues( );
-
- if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) )
+ if ( xCmisDoc.is( ) )
{
- // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut
- bool bFoundCheckedout = false;
- sal_Bool bCheckedOut = sal_False;
- for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i )
+ beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues( );
+
+ if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) )
{
- if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" )
+ // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut
+ bool bFoundCheckedout = false;
+ sal_Bool bCheckedOut = sal_False;
+ for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i )
{
- bFoundCheckedout = true;
- aCmisProperties[i].Value >>= bCheckedOut;
+ if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" )
+ {
+ bFoundCheckedout = true;
+ aCmisProperties[i].Value >>= bCheckedOut;
+ }
}
- }
- if ( !bCheckedOut )
- {
- // Get the Frame and show the InfoBar if not checked out
- SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
- std::vector< PushButton* > aButtons;
- PushButton* pBtn = new PushButton( &pViewFrame->GetWindow(), SfxResId( BT_CHECKOUT ) );
- pBtn->SetClickHdl( LINK( this, SfxBaseController, CheckOutHandler ) );
- aButtons.push_back( pBtn );
- pViewFrame->AppendInfoBar( "checkout", SfxResId( STR_NONCHECKEDOUT_DOCUMENT ), aButtons );
+ if ( !bCheckedOut )
+ {
+ // Get the Frame and show the InfoBar if not checked out
+ SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
+ std::vector< PushButton* > aButtons;
+ PushButton* pBtn = new PushButton( &pViewFrame->GetWindow(), SfxResId( BT_CHECKOUT ) );
+ pBtn->SetClickHdl( LINK( this, SfxBaseController, CheckOutHandler ) );
+ aButtons.push_back( pBtn );
+ pViewFrame->AppendInfoBar( "checkout", SfxResId( STR_NONCHECKEDOUT_DOCUMENT ), aButtons );
+ }
}
}
}
commit 103d75da5f47a2f19e2242ca377fd8ec67548126
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Tue Oct 30 17:05:56 2012 +0100
sw unis tests: added basic/util/sb where needed
Change-Id: I3a16f891b099f80bc3a606ed821d7301fc446653
diff --git a/sw/CppunitTest_sw_filters_test.mk b/sw/CppunitTest_sw_filters_test.mk
index e49b467..a97329e 100644
--- a/sw/CppunitTest_sw_filters_test.mk
+++ b/sw/CppunitTest_sw_filters_test.mk
@@ -72,6 +72,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_filters_test,\
$(eval $(call gb_CppunitTest_use_ure,sw_filters_test))
$(eval $(call gb_CppunitTest_use_components,sw_filters_test,\
+ basic/util/sb \
comphelper/util/comphelp \
configmgr/source/configmgr \
dbaccess/util/dba \
diff --git a/sw/CppunitTest_sw_subsequent_odfexport.mk b/sw/CppunitTest_sw_subsequent_odfexport.mk
index 34e5674..5149659 100644
--- a/sw/CppunitTest_sw_subsequent_odfexport.mk
+++ b/sw/CppunitTest_sw_subsequent_odfexport.mk
@@ -65,6 +65,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_odfexport,\
$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_odfexport))
$(eval $(call gb_CppunitTest_use_components,sw_subsequent_odfexport,\
+ basic/util/sb \
comphelper/util/comphelp \
configmgr/source/configmgr \
fileaccess/source/fileacc \
diff --git a/sw/CppunitTest_sw_subsequent_odfimport.mk b/sw/CppunitTest_sw_subsequent_odfimport.mk
index bb438b9..189817e 100644
--- a/sw/CppunitTest_sw_subsequent_odfimport.mk
+++ b/sw/CppunitTest_sw_subsequent_odfimport.mk
@@ -64,6 +64,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_odfimport,\
$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_odfimport))
$(eval $(call gb_CppunitTest_use_components,sw_subsequent_odfimport,\
+ basic/util/sb \
comphelper/util/comphelp \
configmgr/source/configmgr \
fileaccess/source/fileacc \
diff --git a/sw/CppunitTest_sw_subsequent_ooxmlexport.mk b/sw/CppunitTest_sw_subsequent_ooxmlexport.mk
index a6d6c80..288795e 100644
--- a/sw/CppunitTest_sw_subsequent_ooxmlexport.mk
+++ b/sw/CppunitTest_sw_subsequent_ooxmlexport.mk
@@ -65,6 +65,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_ooxmlexport,\
$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_ooxmlexport))
$(eval $(call gb_CppunitTest_use_components,sw_subsequent_ooxmlexport,\
+ basic/util/sb \
comphelper/util/comphelp \
configmgr/source/configmgr \
embeddedobj/util/embobj \
diff --git a/sw/CppunitTest_sw_subsequent_ooxmlimport.mk b/sw/CppunitTest_sw_subsequent_ooxmlimport.mk
index 66a977a..48e08c5 100644
--- a/sw/CppunitTest_sw_subsequent_ooxmlimport.mk
+++ b/sw/CppunitTest_sw_subsequent_ooxmlimport.mk
@@ -64,6 +64,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_ooxmlimport,\
$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_ooxmlimport))
$(eval $(call gb_CppunitTest_use_components,sw_subsequent_ooxmlimport,\
+ basic/util/sb \
comphelper/util/comphelp \
configmgr/source/configmgr \
embeddedobj/util/embobj \
diff --git a/sw/CppunitTest_sw_subsequent_rtfexport.mk b/sw/CppunitTest_sw_subsequent_rtfexport.mk
index 270139a..f5ac911 100644
--- a/sw/CppunitTest_sw_subsequent_rtfexport.mk
+++ b/sw/CppunitTest_sw_subsequent_rtfexport.mk
@@ -64,6 +64,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_rtfexport,\
$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_rtfexport))
$(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtfexport,\
+ basic/util/sb \
comphelper/util/comphelp \
configmgr/source/configmgr \
embeddedobj/util/embobj \
diff --git a/sw/CppunitTest_sw_subsequent_rtfimport.mk b/sw/CppunitTest_sw_subsequent_rtfimport.mk
index 2c01fb8..599c961 100644
--- a/sw/CppunitTest_sw_subsequent_rtfimport.mk
+++ b/sw/CppunitTest_sw_subsequent_rtfimport.mk
@@ -66,6 +66,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_rtfimport,\
$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_rtfimport))
$(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtfimport,\
+ basic/util/sb \
comphelper/util/comphelp \
configmgr/source/configmgr \
fileaccess/source/fileacc \
diff --git a/sw/CppunitTest_sw_subsequent_ww8import.mk b/sw/CppunitTest_sw_subsequent_ww8import.mk
index e5a3dd0..b59f32b 100644
--- a/sw/CppunitTest_sw_subsequent_ww8import.mk
+++ b/sw/CppunitTest_sw_subsequent_ww8import.mk
@@ -63,6 +63,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_ww8import,\
$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_ww8import))
$(eval $(call gb_CppunitTest_use_components,sw_subsequent_ww8import,\
+ basic/util/sb \
comphelper/util/comphelp \
configmgr/source/configmgr \
dbaccess/util/dba \
commit 6ffa5b9f5353d1faffc25dee7afa95306fb9a0ea
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Tue Oct 30 15:15:40 2012 +0100
Show URL of failing document in unit tests
Change-Id: I5434b6615338dfc6780c6ff877c6eebfd20b763b
diff --git a/unotest/source/cpp/macros_test.cxx b/unotest/source/cpp/macros_test.cxx
index 5b026f9..4d08d04 100644
--- a/unotest/source/cpp/macros_test.cxx
+++ b/unotest/source/cpp/macros_test.cxx
@@ -49,7 +49,8 @@ uno::Reference< com::sun::star::lang::XComponent > MacrosTest::loadFromDesktop(c
com::sun::star::document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN;
args[0].State = com::sun::star::beans::PropertyState_DIRECT_VALUE;
uno::Reference< com::sun::star::lang::XComponent> xComponent= xLoader->loadComponentFromURL(rURL, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_default")), 0, args);
- CPPUNIT_ASSERT_MESSAGE("loading failed", xComponent.is());
+ rtl::OUString sMessage = rtl::OUString( "loading failed: " ) + rURL;
+ CPPUNIT_ASSERT_MESSAGE(rtl::OUStringToOString( sMessage, RTL_TEXTENCODING_UTF8 ).getStr( ), xComponent.is());
return xComponent;
}
commit 3a6233a0406acda6b9b9611cc0cd5c4e73e3f9c3
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Tue Oct 30 13:38:51 2012 +0100
Add PATH to have curl configure find ns{s,pr}-config in solver
Change-Id: I15dc96c13189d0dc76c616f3ab49d2ea099bc884
diff --git a/curl/ExternalProject_curl.mk b/curl/ExternalProject_curl.mk
index 7baca05..e1388cd 100644
--- a/curl/ExternalProject_curl.mk
+++ b/curl/ExternalProject_curl.mk
@@ -19,7 +19,8 @@ ifeq ($(GUI),UNX)
$(call gb_ExternalProject_get_state_target,curl,build):
cd $(EXTERNAL_WORKDIR) \
- && ./configure --with-nss --without-ssl --without-libidn --enable-ftp --enable-ipv6 --enable-http --disable-gopher \
+ && PATH=$(OUTDIR_FOR_BUILD)/bin:$$PATH ./configure --with-nss --without-ssl \
+ --without-libidn --enable-ftp --enable-ipv6 --enable-http --disable-gopher \
--disable-file --disable-ldap --disable-telnet --disable-dict --without-libssh2 \
$(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \
@@ -33,7 +34,7 @@ else ifeq ($(OS)$(COM),WNTGCC)
$(call gb_ExternalProject_get_state_target,curl,build):
cd $(EXTERNAL_WORKDIR) \
- && ./configure --with-nss --without-ssl --enable-ftp --enable-ipv6 --disable-http --disable-gopher \
+ && PATH=$(OUTDIR_FOR_BUILD)/bin:$$PATH ./configure --with-nss --without-ssl --enable-ftp --enable-ipv6 --disable-http --disable-gopher \
--disable-file --disable-ldap --disable-telnet --disable-dict --build=i586-pc-mingw32 --host=i586-pc-mingw32 \
$(if $(filter TRUE,$(ENABLE_DEBUG)),--enable-debug) \
CC="$(CC) -mthreads $(if $(filter YES,$(MINGW_SHARED_GCCLIB)),-shared-libgcc)" \
commit 1a9261124eed5baa04b069a1cb1b51f24423ec9b
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Tue Oct 30 11:06:18 2012 +0100
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
diff --git a/basctl/uiconfig/basicide/menubar/menubar.xml b/basctl/uiconfig/basicide/menubar/menubar.xml
index 58a453c..886909d 100644
--- a/basctl/uiconfig/basicide/menubar/menubar.xml
+++ b/basctl/uiconfig/basicide/menubar/menubar.xml
@@ -30,6 +30,8 @@
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menu menu:id=".uno:TemplateMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
diff --git a/chart2/uiconfig/menubar/menubar.xml b/chart2/uiconfig/menubar/menubar.xml
index 3d0e33b..311a60b 100644
--- a/chart2/uiconfig/menubar/menubar.xml
+++ b/chart2/uiconfig/menubar/menubar.xml
@@ -28,6 +28,8 @@
<menu:menuitem menu:id=".uno:SaveAs" menu:helpid="5502" menu:label="" />
<menu:menuitem menu:id=".uno:SaveAll" menu:helpid="5309" menu:label="" />
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuitem menu:id=".uno:Reload" menu:helpid="5508" menu:label="" />
<menu:menuitem menu:id=".uno:VersionDialog" menu:helpid="6583" menu:label="" />
<menu:menuitem menu:id=".uno:SendMail" menu:helpid="5331" menu:label="" />
diff --git a/dbaccess/uiconfig/dbapp/menubar/menubar.xml b/dbaccess/uiconfig/dbapp/menubar/menubar.xml
index 9c65ce8..1ddbe5a 100644
--- a/dbaccess/uiconfig/dbapp/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbapp/menubar/menubar.xml
@@ -30,6 +30,8 @@
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ExportTo"/>
<menu:menu menu:id=".uno:SendToMenu">
diff --git a/dbaccess/uiconfig/dbquery/menubar/menubar.xml b/dbaccess/uiconfig/dbquery/menubar/menubar.xml
index 4b605ea..dd84ef3 100644
--- a/dbaccess/uiconfig/dbquery/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbquery/menubar/menubar.xml
@@ -28,6 +28,8 @@
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Quit"/>
</menu:menupopup>
diff --git a/dbaccess/uiconfig/dbrelation/menubar/menubar.xml b/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
index 1d5e0a3..f4a9ffc 100644
--- a/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
@@ -27,6 +27,8 @@
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Quit"/>
</menu:menupopup>
diff --git a/dbaccess/uiconfig/dbtable/menubar/menubar.xml b/dbaccess/uiconfig/dbtable/menubar/menubar.xml
index 496664d..63982ad 100644
--- a/dbaccess/uiconfig/dbtable/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbtable/menubar/menubar.xml
@@ -28,6 +28,8 @@
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Quit"/>
</menu:menupopup>
diff --git a/dbaccess/uiconfig/dbtdata/menubar/menubar.xml b/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
index e22b66a..95c327e 100644
--- a/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
@@ -28,6 +28,8 @@
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Quit"/>
</menu:menupopup>
diff --git a/extensions/source/bibliography/uiconfig/sbibliography/menubar/menubar.xml b/extensions/source/bibliography/uiconfig/sbibliography/menubar/menubar.xml
index 05416af..32419a7 100644
--- a/extensions/source/bibliography/uiconfig/sbibliography/menubar/menubar.xml
+++ b/extensions/source/bibliography/uiconfig/sbibliography/menubar/menubar.xml
@@ -11,6 +11,8 @@
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
<menu:menuseparator/>
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index d5a65a3..7e1bc58 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -3768,6 +3768,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/ucb,\
AlreadyInitializedException \
AuthenticationRequest \
CHAOSProgressStart \
+ CheckinArgument \
CertificateValidationRequest \
Command \
CommandAbortedException \
diff --git a/offapi/com/sun/star/document/XCmisDocument.idl b/offapi/com/sun/star/document/XCmisDocument.idl
index c456808..fabd69f 100644
--- a/offapi/com/sun/star/document/XCmisDocument.idl
+++ b/offapi/com/sun/star/document/XCmisDocument.idl
@@ -24,10 +24,26 @@ interface XCmisDocument : com::sun::star::uno::XInterface
*/
void checkOut( );
+ /** Cancel checked out document, this will discard all changes since
+ check-out.
+ */
+ void cancelCheckOut( );
+
+ /** Creates a new version of the document from the private working
+ copy.
+ */
+ void checkIn( [in] boolean isMajor, [in] string comment );
+
/** Tells whether a document can support versioning or not.
*/
boolean isVersionable( );
+ boolean canCheckOut( );
+
+ boolean canCancelCheckOut( );
+
+ boolean canCheckIn( );
+
/** Contains the properties values named after their CMIS ID.
*/
[attribute] com::sun::star::beans::PropertyValues CmisPropertiesValues;
diff --git a/offapi/com/sun/star/ucb/CheckinArgument.idl b/offapi/com/sun/star/ucb/CheckinArgument.idl
new file mode 100644
index 0000000..08f6822
--- /dev/null
+++ b/offapi/com/sun/star/ucb/CheckinArgument.idl
@@ -0,0 +1,60 @@
+/* -*- 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_CheckinArgument_idl__
+#define __com_sun_star_ucb_CheckinArgument_idl__
+
+
+
+module com { module sun { module star { module ucb {
+
+/** contains information needed to checkin a document.
+
+ <p>The checkin command is always called on the target private
+ working copy document.</p>
+*/
+struct CheckinArgument
+{
+ /** Tells whether to create a new major or minor version during the
+ checkin.
+ */
+ boolean MajorVersion;
+
+ /** Contains the version comment to set during the checkin.
+ */
+ string VersionComment;
+
+ /** contains the URL of the source of the action (e.g. the URL of
+ the temporary file to checkin).
+ */
+ string SourceURL;
+
+ /** contains the URL of the private working copy to checkin.
+ */
+ string TargetURL;
+
+ /** contains the title of the transferred object, if it is different
+ from the original one.
+
+ <p>If this field is filled, for example, a file will be renamed
+ while it is being checked in.</p>
+ */
+ string NewTitle;
+
+ /** contains the Mime-Type of the content to check-in as it may be
+ different from the original one.
+ */
+ string MimeType;
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 4011c05..e80fb4d 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -1901,6 +1901,16 @@
<value xml:lang="en-US">Check-Out</value>
</prop>
</node>
+ <node oor:name=".uno:CancelCheckOut" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Cancel Check-Out...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CheckIn" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Check-In...</value>
+ </prop>
+ </node>
<node oor:name=".uno:CloseDoc" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Close</value>
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index 490266c..901deda 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -14,6 +14,8 @@
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index 0dbc2f6..e23ff0c 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -13,7 +13,9 @@
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
- <menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index 629a705..de67010 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -14,6 +14,8 @@
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index 9a134b6..5ba00f6 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -194,6 +194,8 @@ public:
sal_Bool SwitchDocumentToFile( const rtl::OUString& aURL );
::rtl::OUString GetBaseURL( bool bForSaving=false );
+ void SetInCheckIn( bool bInCheckIn );
+ bool IsInCheckIn( );
#if _SOLAR__PRIVATE
SAL_DLLPRIVATE sal_Bool HasStorage_Impl() const;
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 88a2abe..d2a3b3d 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -734,6 +734,8 @@ public:
SAL_DLLPRIVATE sal_Bool QuerySaveSizeExceededModules_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
SAL_DLLPRIVATE void CheckOut( );
+ SAL_DLLPRIVATE void CancelCheckOut( );
+ SAL_DLLPRIVATE void CheckIn( );
};
#define SFX_GLOBAL_CLASSID \
diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx
index b8daf8b..4db98d5 100644
--- a/sfx2/inc/sfx2/sfxbasecontroller.hxx
+++ b/sfx2/inc/sfx2/sfxbasecontroller.hxx
@@ -387,7 +387,7 @@ private:
SAL_DLLPRIVATE SfxViewFrame& GetViewFrame_Impl() const;
SAL_DLLPRIVATE void ShowInfoBars( );
- DECL_LINK( CheckOutHandler, PushButton * );
+ DECL_LINK( CheckOutHandler, void * );
//________________________________________________________________________________________________________
// private variables
diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx
index 3cabf59..49e4dca 100644
--- a/sfx2/inc/sfx2/sfxbasemodel.hxx
+++ b/sfx2/inc/sfx2/sfxbasemodel.hxx
@@ -1422,8 +1422,16 @@ public:
throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL checkOut( ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL cancelCheckOut( ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL checkIn( sal_Bool bIsMajor, const rtl::OUString & rMessage )
+ throw ( ::com::sun::star::uno::RuntimeException );
virtual sal_Bool SAL_CALL isVersionable( ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL canCheckOut( ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL canCancelCheckOut( ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL canCheckIn( ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ sal_Bool getBoolPropertyValue( const rtl::OUString& rName ) throw ( ::com::sun::star::uno::RuntimeException );
//____________________________________________________________________________________________________
// SfxListener
diff --git a/sfx2/inc/sfx2/sfxcommands.h b/sfx2/inc/sfx2/sfxcommands.h
index 46c7ebc..f054ca9 100644
--- a/sfx2/inc/sfx2/sfxcommands.h
+++ b/sfx2/inc/sfx2/sfxcommands.h
@@ -45,6 +45,8 @@
#define CMD_SID_DOCINFO_TITLE ".uno:DocInfoTitle"
#define CMD_SID_OPENTEMPLATE ".uno:OpenTemplate"
#define CMD_SID_CHECKOUT ".uno:CheckOut"
+#define CMD_SID_CANCELCHECKOUT ".uno:CancelCheckOut"
+#define CMD_SID_CHECKIN ".uno:CheckIn"
#define CMD_SID_OPENURL ".uno:OpenUrl"
#define CMD_SID_OPTIONS ".uno:Options"
#define CMD_SID_ORGANIZER ".uno:Organizer"
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 9586dde..0998c65 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -144,6 +144,8 @@
#define SID_DIRECTEXPORTDOCASPDF (SID_SFX_START + 1674)
#define SID_UPDATEDOCMODE (SID_SFX_START + 1668)
#define SID_CHECKOUT (SID_SFX_START + 512)
+#define SID_CANCELCHECKOUT (SID_SFX_START + 513)
+#define SID_CHECKIN (SID_SFX_START + 514)
#define SID_FORCERELOAD (SID_SFX_START + 1502)
#define SID_FILE_DIALOG (SID_SFX_START + 304)
@@ -310,6 +312,7 @@
#define SID_DOCINFO_KEYWORDS (SID_SFX_START + 591)
#define SID_DOCINFO_COMMENTS (SID_SFX_START + 592)
#define SID_DOCINFO_AUTHOR (SID_SFX_START + 593)
+#define SID_DOCINFO_MAJOR (SID_SFX_START + 594)
#define SID_NEWDOCDIRECT (SID_SFX_START + 537)
#define SID_DOCFRAME (SID_SFX_START + 598)
#define SID_TARGETNAME (SID_SFX_START + 560)
diff --git a/sfx2/sdi/docslots.sdi b/sfx2/sdi/docslots.sdi
index 6ba11a8..111ba6d 100644
--- a/sfx2/sdi/docslots.sdi
+++ b/sfx2/sdi/docslots.sdi
@@ -182,6 +182,16 @@ interface OfficeDocument : Document
ExecMethod = ExecFile_Impl;
StateMethod = GetState_Impl;
]
+ SID_CANCELCHECKOUT
+ [
+ ExecMethod = ExecFile_Impl;
+ StateMethod = GetState_Impl;
+ ]
+ SID_CHECKIN
+ [
+ ExecMethod = ExecFile_Impl;
+ StateMethod = GetState_Impl;
+ ]
}
//=========================================================================
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 635342a..a7468ce 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -4468,6 +4468,54 @@ SfxVoidItem CheckOut SID_CHECKOUT
GroupId = GID_DOCUMENT;
]
+SfxVoidItem CancelCheckOut SID_CANCELCHECKOUT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+SfxVoidItem CheckIn SID_CHECKIN
+(SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxBoolItem VersionMajor SID_DOCINFO_MAJOR)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
//--------------------------------------------------------------------------
SfxStringItem OpenUrl SID_OPENURL
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 36be7f9..fa30856 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -131,7 +131,8 @@ SfxFormalArgument aFormalArgs[] = {
SFX_ARGUMENT(SID_DEFAULTFILENAME,"SuggestedSaveAsName",SfxStringItem),
SFX_ARGUMENT(SID_DEFAULTFILEPATH,"SuggestedSaveAsDir",SfxStringItem),
SFX_ARGUMENT(SID_DOCINFO_AUTHOR,"VersionAuthor",SfxStringItem),
- SFX_ARGUMENT(SID_DOCINFO_COMMENTS,"VersionComment",SfxStringItem),
+ SFX_ARGUMENT(SID_DOCINFO_COMMENTS,"VersionComment",SfxBoolItem),
+ SFX_ARGUMENT(SID_DOCINFO_MAJOR,"VersionMajor",SfxStringItem),
SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,"FilterOptions",SfxStringItem),
SFX_ARGUMENT(SID_FILTER_NAME,"FilterName",SfxStringItem),
// SFX_ARGUMENT(SID_FILE_NAME,"FileName",SfxStringItem),
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index e5380e7..b36a441 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -262,6 +262,7 @@ public:
bool m_bTriedStorage:1;
bool m_bRemote:1;
bool m_bInputStreamIsReadOnly:1;
+ bool m_bInCheckIn:1;
OUString m_aName;
OUString m_aLogicName;
@@ -336,6 +337,7 @@ SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP ) :
m_bTriedStorage(false),
m_bRemote(false),
m_bInputStreamIsReadOnly(false),
+ m_bInCheckIn(false),
m_pSet(NULL),
m_pURLObj(NULL),
m_pFilter(NULL),
@@ -1924,23 +1926,31 @@ void SfxMedium::Transfer_Impl()
::ucbhelper::Content aSourceContent;
::ucbhelper::Content aTransferContent;
- // Get the parent URL from the XChild if possible: why would the URL necessarily have
- // 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 );
- rtl::OUString sParentUrl;
- if ( xChild.is( ) )
+ if ( !IsInCheckIn( ) )
{
- Reference< ::com::sun::star::ucb::XContent > xParent( xChild->getParent( ), uno::UNO_QUERY );
- if ( xParent.is( ) )
+ // Get the parent URL from the XChild if possible: why would the URL necessarily have
+ // a hierarchical path? It's not always the case for CMIS.
+ Reference< ::com::sun::star::container::XChild> xChild( aDestContent.get(), uno::UNO_QUERY );
+ rtl::OUString sParentUrl;
+ if ( xChild.is( ) )
{
- sParentUrl = xParent->getIdentifier( )->getContentIdentifier();
+ Reference< ::com::sun::star::ucb::XContent > xParent( xChild->getParent( ), uno::UNO_QUERY );
+ if ( xParent.is( ) )
+ {
+ sParentUrl = xParent->getIdentifier( )->getContentIdentifier();
+ }
}
- }
- if ( !sParentUrl.isEmpty() )
- aDest = INetURLObject( sParentUrl );
+ if ( !sParentUrl.isEmpty() )
+ aDest = INetURLObject( sParentUrl );
+ }
+ else
+ {
+ // For checkin, we need the object URL, not the parent folder
+ aDest = INetURLObject( aDestURL );
+ }
// LongName wasn't defined anywhere, only used here... get the Title instead
// as it's less probably empty
@@ -1997,8 +2007,24 @@ void SfxMedium::Transfer_Impl()
try
{
rtl::OUString aMimeType = GetFilter()->GetMimeType( );
- if (!aTransferContent.transferContent( aSourceContent, ::ucbhelper::InsertOperation_COPY, aFileName, nNameClash, aMimeType ))
+ ::ucbhelper::InsertOperation eOperation = ::ucbhelper::InsertOperation_COPY;
+ bool bMajor = false;
+ rtl::OUString sComment;
+ if ( IsInCheckIn( ) )
+ {
+ eOperation = ::ucbhelper::InsertOperation_CHECKIN;
+ SFX_ITEMSET_ARG( GetItemSet(), pMajor, SfxBoolItem, SID_DOCINFO_MAJOR, false );
+ bMajor = pMajor && pMajor->GetValue( );
+ SFX_ITEMSET_ARG( GetItemSet(), pComments, SfxStringItem, SID_DOCINFO_COMMENTS, false );
+ if ( pComments )
+ sComment = pComments->GetValue( );
+ }
+ rtl::OUString sResultURL;
+ if (!aTransferContent.transferContent( aSourceContent, eOperation,
+ aFileName, nNameClash, aMimeType, bMajor, sComment, &sResultURL ))
pImp->m_eError = ERRCODE_IO_GENERAL;
+ else if ( !sResultURL.isEmpty( ) ) // Likely to happen only for checkin
+ SwitchDocumentToFile( sResultURL );
}
catch ( const ::com::sun::star::ucb::CommandAbortedException& )
{
@@ -3694,4 +3720,14 @@ sal_Bool SfxMedium::SwitchDocumentToFile( const rtl::OUString& aURL )
return bResult;
}
+void SfxMedium::SetInCheckIn( bool bInCheckIn )
+{
+ pImp->m_bInCheckIn = bInCheckIn;
+}
+
+bool SfxMedium::IsInCheckIn( )
+{
+ return pImp->m_bInCheckIn;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 1357188..116f976 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -361,6 +361,43 @@ void SfxObjectShell::CheckOut( )
}
}
+void SfxObjectShell::CancelCheckOut( )
+{
+ try
+ {
+ uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW );
+ // TODO Pop up dialog to ask whether to loose data or not
+ xCmisDoc->cancelCheckOut( );
+ }
+ catch ( const uno::RuntimeException& e )
+ {
+ ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message );
+ pErrorBox->Execute( );
+ delete pErrorBox;
+ }
+}
+
+void SfxObjectShell::CheckIn( )
+{
+ try
+ {
+ uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW );
+ sal_Bool bIsMajor = sal_False;
+ rtl::OUString sComment( "Some sample comment" );
+ // TODO Pop up dialog to ask for comment and major
+ xCmisDoc->checkIn( bIsMajor, sComment );
+ uno::Reference< util::XModifiable > xModifiable( GetModel( ), uno::UNO_QUERY );
+ if ( xModifiable.is( ) )
+ xModifiable->setModified( sal_False );
+ }
+ catch ( const uno::RuntimeException& e )
+ {
+ ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message );
+ pErrorBox->Execute( );
+ delete pErrorBox;
+ }
+}
+
//--------------------------------------------------------------------
void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
@@ -912,6 +949,16 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
CheckOut( );
break;
}
+ case SID_CANCELCHECKOUT:
+ {
+ CancelCheckOut( );
+ break;
+ }
+ case SID_CHECKIN:
+ {
+ CheckIn( );
+ break;
+ }
}
// Prevent entry in the Pick-lists
@@ -976,6 +1023,37 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
}
break;
+ case SID_CANCELCHECKOUT:
+ case SID_CHECKIN:
+ {
+ bool bShow = false;
+ Reference< XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY );
+ beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues( );
+
+ if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) )
+ {
+ // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut
+ bool bFoundCheckedout = false;
+ sal_Bool bCheckedOut = sal_False;
+ for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i )
+ {
+ if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" )
+ {
+ bFoundCheckedout = true;
+ aCmisProperties[i].Value >>= bCheckedOut;
+ }
+ }
+ bShow = bCheckedOut;
+ }
+
+ if ( !bShow )
+ {
+ rSet.DisableItem( nWhich );
+ rSet.Put( SfxVisibilityItem( nWhich, sal_False ) );
+ }
+ }
+ break;
+
case SID_VERSION:
{
SfxObjectShell *pDoc = this;
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 45b1cb2..9fe5394 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1374,7 +1374,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
pFilter = rMedium.GetFilter();
- const SfxStringItem *pVersionItem = pSet ? (const SfxStringItem*)
+ const SfxStringItem *pVersionItem = ( !rMedium.IsInCheckIn( ) && pSet ) ? (const SfxStringItem*)
SfxRequest::GetItem( pSet, SID_DOCINFO_COMMENTS, sal_False, TYPE(SfxStringItem) ) : NULL;
::rtl::OUString aTmpVersionURL;
@@ -1460,7 +1460,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
}
}
- if ( bOk && pVersionItem )
+ if ( bOk && pVersionItem && !rMedium.IsInCheckIn() )
{
// store a version also
const SfxStringItem *pAuthorItem = pSet ? (const SfxStringItem*)
@@ -1624,7 +1624,12 @@ sal_Bool SfxObjectShell::SaveTo_Impl
AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Medium commit." ) );
+ rtl::OUString sName( rMedium.GetName( ) );
bOk = rMedium.Commit();
+ rtl::OUString sNewName( rMedium.GetName( ) );
+
+ if ( sName != sNewName )
+ GetMedium( )->SwitchDocumentToFile( sNewName );
if ( bOk )
{
@@ -2414,10 +2419,23 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
pSet->ClearItem( SID_VERSION );
pSet->ClearItem( SID_DOC_BASEURL );
+ // copy the version comment and major items for the checkin only
+ if ( pRetrMedium->IsInCheckIn( ) )
+ {
+ const SfxPoolItem* pMajor = pArgs->GetItem( SID_DOCINFO_MAJOR );
+ if ( pMajor )
+ pSet->Put( *pMajor );
+
+ const SfxPoolItem* pComments = pArgs->GetItem( SID_DOCINFO_COMMENTS );
+ if ( pComments )
+ pSet->Put( *pComments );
+ }
+
// create a medium as a copy; this medium is only for writingm, because it
// uses the same name as the original one writing is done through a copy,
// that will be transferred to the target (of course after calling HandsOff)
SfxMedium* pMediumTmp = new SfxMedium( pRetrMedium->GetName(), pRetrMedium->GetOpenMode(), pFilter, pSet );
+ pMediumTmp->SetInCheckIn( pRetrMedium->IsInCheckIn( ) );
pMediumTmp->SetLongName( pRetrMedium->GetLongName() );
if ( pMediumTmp->GetErrorCode() != ERRCODE_NONE )
{
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index cc2abe9..46f0bee 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1621,11 +1621,13 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "storeSelf" ) );
SfxSaveGuard aSaveGuard(this, m_pData, sal_False);
+ sal_Bool bCheckIn = sal_False;
for ( sal_Int32 nInd = 0; nInd < aSeqArgs.getLength(); nInd++ )
{
// check that only acceptable parameters are provided here
if ( aSeqArgs[nInd].Name != "VersionComment" && aSeqArgs[nInd].Name != "Author"
- && aSeqArgs[nInd].Name != "InteractionHandler" && aSeqArgs[nInd].Name != "StatusIndicator" )
+ && aSeqArgs[nInd].Name != "InteractionHandler" && aSeqArgs[nInd].Name != "StatusIndicator"
+ && aSeqArgs[nInd].Name != "VersionMajor" && aSeqArgs[nInd].Name != "CheckIn" )
{
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "unexpected parameter for storeSelf, might be no problem if SaveAs is executed." ) );
m_pData->m_pObjectShell->StoreLog();
@@ -1634,10 +1636,34 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
aMessage += aSeqArgs[nInd].Name;
throw lang::IllegalArgumentException( aMessage, uno::Reference< uno::XInterface >(), 1 );
}
+ else if ( aSeqArgs[nInd].Name == "CheckIn" )
+ {
+ aSeqArgs[nInd].Value >>= bCheckIn;
+ }
+ }
+
+ // Remove CheckIn property if needed
+ sal_uInt16 nSlotId = SID_SAVEDOC;
+ uno::Sequence< beans::PropertyValue > aArgs = aSeqArgs;
+ if ( bCheckIn )
+ {
+ nSlotId = SID_CHECKIN;
+ sal_Int32 nLength = aSeqArgs.getLength( );
+ aArgs = uno::Sequence< beans::PropertyValue >( nLength - 1 );
+ sal_Int32 nNewI = 0;
+ for ( sal_Int32 i = 0; i < nLength; ++i )
+ {
+ beans::PropertyValue aProp = aSeqArgs[i];
+ if ( aProp.Name != "CheckIn" )
+ {
+ aArgs[nNewI] = aProp;
+ ++nNewI;
+ }
+ }
}
SfxAllItemSet *pParams = new SfxAllItemSet( SFX_APP()->GetPool() );
- TransformParameters( SID_SAVEDOC, aSeqArgs, *pParams );
+ TransformParameters( nSlotId, aArgs, *pParams );
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOC, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOC), m_pData->m_pObjectShell ) );
@@ -1662,7 +1688,12 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
}
}
else
+ {
+ // Tell the SfxMedium if we are in checkin instead of normal save
+ m_pData->m_pObjectShell->GetMedium( )->SetInCheckIn( nSlotId == SID_CHECKIN );
bRet = m_pData->m_pObjectShell->Save_Impl( pParams );
+ m_pData->m_pObjectShell->GetMedium( )->SetInCheckIn( nSlotId != SID_CHECKIN );
+ }
DELETEZ( pParams );
@@ -2577,9 +2608,81 @@ void SAL_CALL SfxBaseModel::checkOut( ) throw ( uno::RuntimeException )
}
}
-sal_Bool SAL_CALL SfxBaseModel::isVersionable( ) throw ( uno::RuntimeException )
+void SAL_CALL SfxBaseModel::cancelCheckOut( ) throw ( uno::RuntimeException )
{
- sal_Bool bVersionable = sal_False;
+ SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
+ if ( pMedium )
+ {
+ try
+ {
+ ::ucbhelper::Content aContent( pMedium->GetName(),
+ uno::Reference<ucb::XCommandEnvironment>(),
+ comphelper::getProcessComponentContext() );
+
+ uno::Any aResult = aContent.executeCommand( "cancelCheckout", uno::Any( ) );
+ rtl::OUString sURL;
+ aResult >>= sURL;
+
+ m_pData->m_pObjectShell->GetMedium( )->SwitchDocumentToFile( sURL );
+ m_pData->m_xDocumentProperties->setTitle( getTitle( ) );
+ uno::Sequence< beans::PropertyValue > aSequence ;
+ TransformItems( SID_OPENDOC, *pMedium->GetItemSet(), aSequence );
+ attachResource( sURL, aSequence );
+
+ // Reload the CMIS properties
+ loadCmisProperties( );
+ }
+ catch ( const uno::Exception & e )
+ {
+ throw uno::RuntimeException( e.Message, e.Context );
+ }
+ }
+}
+
+void SAL_CALL SfxBaseModel::checkIn( sal_Bool bIsMajor, const rtl::OUString& rMessage ) throw ( uno::RuntimeException )
+{
+ SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
+ if ( pMedium )
+ {
+ try
+ {
+ uno::Sequence< beans::PropertyValue > aProps( 3 );
+ aProps[0].Name = "VersionMajor";
+ aProps[0].Value = uno::makeAny( bIsMajor );
+ aProps[1].Name = "VersionComment";
+ aProps[1].Value = uno::makeAny( rMessage );
+ aProps[2].Name = "CheckIn";
+ aProps[2].Value = uno::makeAny( sal_True );
+
+ rtl::OUString sName( pMedium->GetName( ) );
+ storeSelf( aProps );
+
+ // Refresh pMedium as it has probably changed during the storeSelf call
+ pMedium = m_pData->m_pObjectShell->GetMedium( );
+ rtl::OUString sNewName( pMedium->GetName( ) );
+
+ // URL has changed, update the document
+ if ( sName != sNewName )
+ {
+ m_pData->m_xDocumentProperties->setTitle( getTitle( ) );
+ uno::Sequence< beans::PropertyValue > aSequence ;
+ TransformItems( SID_OPENDOC, *pMedium->GetItemSet(), aSequence );
+ attachResource( sNewName, aSequence );
+
+ // Reload the CMIS properties
+ loadCmisProperties( );
+ }
+ }
+ catch ( const uno::Exception & e )
+ {
+ throw uno::RuntimeException( e.Message, e.Context );
+ }
+ }
+}
+
+sal_Bool SfxBaseModel::getBoolPropertyValue( const rtl::OUString& rName ) throw ( uno::RuntimeException )
+{
+ sal_Bool bValue = sal_False;
SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
if ( pMedium )
{
@@ -2589,10 +2692,9 @@ sal_Bool SAL_CALL SfxBaseModel::isVersionable( ) throw ( uno::RuntimeException )
uno::Reference<ucb::XCommandEnvironment>(),
comphelper::getProcessComponentContext() );
com::sun::star::uno::Reference < beans::XPropertySetInfo > xProps = aContent.getProperties();
- ::rtl::OUString aIsVersionableProp( "IsVersionable" );
- if ( xProps->hasPropertyByName( aIsVersionableProp ) )
+ if ( xProps->hasPropertyByName( rName ) )
{
- aContent.getPropertyValue( aIsVersionableProp ) >>= bVersionable;
+ aContent.getPropertyValue( rName ) >>= bValue;
}
}
catch ( const uno::Exception & e )
@@ -2600,7 +2702,27 @@ sal_Bool SAL_CALL SfxBaseModel::isVersionable( ) throw ( uno::RuntimeException )
throw uno::RuntimeException( e.Message, e.Context );
}
}
- return bVersionable;
+ return bValue;
+}
+
+sal_Bool SAL_CALL SfxBaseModel::isVersionable( ) throw ( uno::RuntimeException )
+{
+ return getBoolPropertyValue( "IsVersionable" );
+}
+
+sal_Bool SAL_CALL SfxBaseModel::canCheckOut( ) throw ( uno::RuntimeException )
+{
+ return getBoolPropertyValue( "CanCheckOut" );
+}
+
+sal_Bool SAL_CALL SfxBaseModel::canCancelCheckOut( ) throw ( uno::RuntimeException )
+{
+ return getBoolPropertyValue( "CanCancelCheckOut" );
+}
+
+sal_Bool SAL_CALL SfxBaseModel::canCheckIn( ) throw ( uno::RuntimeException )
+{
+ return getBoolPropertyValue( "CanCheckIn" );
}
void SfxBaseModel::loadCmisProperties( )
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 54827c5..81638ff 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1470,7 +1470,7 @@ void SfxBaseController::ShowInfoBars( )
}
}
-IMPL_LINK( SfxBaseController, CheckOutHandler, PushButton*, pBtn )
+IMPL_LINK_NOARG ( SfxBaseController, CheckOutHandler )
{
if ( m_pData->m_pViewShell )
m_pData->m_pViewShell->GetObjectShell()->CheckOut( );
diff --git a/starmath/uiconfig/smath/menubar/menubar.xml b/starmath/uiconfig/smath/menubar/menubar.xml
index 6339e00..8a4d7c9 100644
--- a/starmath/uiconfig/smath/menubar/menubar.xml
+++ b/starmath/uiconfig/smath/menubar/menubar.xml
@@ -30,6 +30,10 @@
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index 5adef7a..95806e8 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -14,6 +14,8 @@
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml
index 8ed158f..49d96f6 100644
--- a/sw/uiconfig/sweb/menubar/menubar.xml
+++ b/sw/uiconfig/sweb/menubar/menubar.xml
@@ -14,6 +14,8 @@
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ExportTo"/>
diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml
index 8286254..2fbd4c3 100644
--- a/sw/uiconfig/swform/menubar/menubar.xml
+++ b/sw/uiconfig/swform/menubar/menubar.xml
@@ -14,6 +14,8 @@
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml
index 3a64344..a1de857 100644
--- a/sw/uiconfig/swreport/menubar/menubar.xml
+++ b/sw/uiconfig/swreport/menubar/menubar.xml
@@ -14,6 +14,8 @@
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index 35b474d..3e7a0f0 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -14,6 +14,8 @@
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index 0643aa3..7bf5e6b 100644
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -14,6 +14,8 @@
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
+ <menu:menuitem menu:id=".uno:CancelCheckOut"/>
+ <menu:menuitem menu:id=".uno:CheckIn"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index 568f530..ee3926c 100644
--- a/ucb/source/core/ucb.cxx
+++ b/ucb/source/core/ucb.cxx
@@ -679,6 +679,21 @@ Any SAL_CALL UniversalContentBroker::execute(
globalTransfer( aTransferArg, Environment );
}
+ else if ( ( aCommand.Handle == CHECKIN_HANDLE ) || aCommand.Name == CHECKIN_NAME )
+ {
+ ucb::CheckinArgument aCheckinArg;
+ if ( !( aCommand.Argument >>= aCheckinArg ) )
+ {
+ ucbhelper::cancelCommandExecution(
+ makeAny( IllegalArgumentException(
+ OUString( "Wrong argument type!" ),
+ static_cast< cppu::OWeakObject * >( this ),
+ -1 ) ),
+ Environment );
+ // Unreachable
+ }
+ aRet <<= checkIn( aCheckinArg, Environment );
+ }
else
{
//////////////////////////////////////////////////////////////////
diff --git a/ucb/source/core/ucb.hxx b/ucb/source/core/ucb.hxx
index 9de5839..1f11b33 100644
--- a/ucb/source/core/ucb.hxx
+++ b/ucb/source/core/ucb.hxx
@@ -21,6 +21,7 @@
#define _UCB_HXX
+#include <com/sun/star/ucb/CheckinArgument.hpp>
#include <com/sun/star/ucb/XUniversalContentBroker.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -181,6 +182,10 @@ private:
com::sun::star::ucb::XCommandEnvironment >& xEnv )
throw( com::sun::star::uno::Exception );
+ com::sun::star::uno::Any checkIn( const com::sun::star::ucb::CheckinArgument& rArg,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw( com::sun::star::uno::Exception );
+
bool configureUcb()
throw ( com::sun::star::uno::RuntimeException);
diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx
index 975b53f..043ceef 100644
--- a/ucb/source/core/ucbcmds.cxx
+++ b/ucb/source/core/ucbcmds.cxx
@@ -249,6 +249,13 @@ CommandProcessorInfo::CommandProcessorInfo()
getCppuType(
static_cast<
ucb::GlobalTransferCommandArgument * >( 0 ) ) ); // ArgType
+ (*m_pInfo)[ 2 ]
+ = ucb::CommandInfo(
+ rtl::OUString( CHECKIN_NAME ), // Name
+ CHECKIN_HANDLE, // Handle
+ getCppuType(
+ static_cast<
+ ucb::GlobalTransferCommandArgument * >( 0 ) ) ); // ArgType
}
//=========================================================================
@@ -1782,7 +1789,7 @@ void UniversalContentBroker::globalTransfer(
try
{
ucb::Command aCommand(
- rtl::OUString("transfer"), // Name
+ rtl::OUString( "transfer" ), // Name
-1, // Handle
uno::makeAny( aTransferArg ) ); // Argument
@@ -2028,4 +2035,88 @@ void UniversalContentBroker::globalTransfer(
}
}
+uno::Any UniversalContentBroker::checkIn( const ucb::CheckinArgument& rArg,
+ const uno::Reference< ucb::XCommandEnvironment >& xEnv ) throw ( uno::Exception )
+{
+ uno::Any aRet;
+ // Use own command environment with own interaction handler intercepting
+ // some interaction requests that shall not be handled by the user-supplied
+ // interaction handler.
+ uno::Reference< ucb::XCommandEnvironment > xLocalEnv;
+ if (xEnv.is())
+ {
+ uno::Reference< uno::XComponentContext > xCtx(
+ comphelper::getComponentContext( m_xSMgr ) );
+
+ xLocalEnv.set( ucb::CommandEnvironment::create(
+ xCtx,
+ new InteractionHandlerProxy( xEnv->getInteractionHandler() ),
+ xEnv->getProgressHandler() ) );
+ }
+
+ uno::Reference< ucb::XContent > xTarget;
+ uno::Reference< ucb::XContentIdentifier > xId
+ = createContentIdentifier( rArg.TargetURL );
+ if ( xId.is() )
+ {
+ try
+ {
+ xTarget = queryContent( xId );
+ }
+ catch ( ucb::IllegalIdentifierException const & )
+ {
+ }
+ }
+
+ if ( !xTarget.is() )
+ {
+ uno::Any aProps
+ = uno::makeAny(beans::PropertyValue(
+ rtl::OUString( "Uri" ), -1,
+ uno::makeAny( rArg.TargetURL ),
+ beans::PropertyState_DIRECT_VALUE ) );
+ ucbhelper::cancelCommandExecution(
+ ucb::IOErrorCode_CANT_READ,
+ uno::Sequence< uno::Any >( &aProps, 1 ),
+ xEnv,
+ rtl::OUString( "Can't instanciate target object!" ),
+ this );
+ // Unreachable
+ }
+
+ uno::Reference< ucb::XCommandProcessor > xCommandProcessor(
+ xTarget, uno::UNO_QUERY );
+ if ( !xCommandProcessor.is() )
+ {
+ uno::Any aProps
+ = uno::makeAny(
+ beans::PropertyValue(
+ rtl::OUString( "Uri" ), -1,
+ uno::makeAny( rArg.TargetURL ),
+ beans::PropertyState_DIRECT_VALUE ) );
+ ucbhelper::cancelCommandExecution(
+ ucb::IOErrorCode_CANT_READ,
+ uno::Sequence< uno::Any >( &aProps, 1 ),
+ xEnv,
+ rtl::OUString( "Target content is not a XCommandProcessor!" ),
+ this );
+ // Unreachable
+ }
+
+ try
+ {
+ ucb::Command aCommand(
+ rtl::OUString( "checkin" ), -1,
+ uno::makeAny( rArg ) );
+
+ aRet = xCommandProcessor->execute( aCommand, 0, xLocalEnv );
+ }
+ catch ( ucb::UnsupportedCommandException const & )
+ {
+ // 'checkin' command is not supported by commandprocessor:
+ // ignore.
+ }
+ return aRet;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/core/ucbcmds.hxx b/ucb/source/core/ucbcmds.hxx
index 89b86f3..c0664f3 100644
--- a/ucb/source/core/ucbcmds.hxx
+++ b/ucb/source/core/ucbcmds.hxx
@@ -32,6 +32,9 @@
#define GLOBALTRANSFER_NAME "globalTransfer"
#define GLOBALTRANSFER_HANDLE 1025
+#define CHECKIN_NAME "checkin"
+#define CHECKIN_HANDLE 1026
+
#endif /* !_UCBCMDS_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 6ea78e0..0c6ba36 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -53,7 +53,9 @@
#include <libcmis/document.hxx>
+#include <comphelper/processfactory.hxx>
#include <ucbhelper/cancelcommandexecution.hxx>
+#include <ucbhelper/content.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include <ucbhelper/std_inputstream.hxx>
#include <ucbhelper/std_outputstream.hxx>
@@ -454,7 +456,8 @@ namespace cmis
{
boost::shared_ptr< libcmis::AllowableActions > allowableActions = getObject( xEnv )->getAllowableActions( );
sal_Bool bReadOnly = sal_False;
- if ( !allowableActions->isAllowed( libcmis::ObjectAction::SetContentStream ) )
+ if ( !allowableActions->isAllowed( libcmis::ObjectAction::SetContentStream ) &&
+ !allowableActions->isAllowed( libcmis::ObjectAction::CheckIn ) )
bReadOnly = sal_True;
xRow->appendBoolean( rProp, bReadOnly );
@@ -563,6 +566,60 @@ namespace cmis
xRow->appendVoid( rProp );
}
}
+ else if ( rProp.Name == "CanCheckOut" )
+ {
+ try
+ {
+ libcmis::ObjectPtr pObject = getObject( xEnv );
+ libcmis::AllowableActionsPtr aAllowables = pObject->getAllowableActions( );
+ bool bAllowed = false;
+ if ( aAllowables )
+ {
+ bAllowed = aAllowables->isAllowed( libcmis::ObjectAction::CheckOut );
+ }
+ xRow->appendBoolean( rProp, bAllowed );
+ }
+ catch ( const libcmis::Exception& )
+ {
+ xRow->appendVoid( rProp );
+ }
+ }
+ else if ( rProp.Name == "CanCancelCheckOut" )
+ {
+ try
+ {
+ libcmis::ObjectPtr pObject = getObject( xEnv );
+ libcmis::AllowableActionsPtr aAllowables = pObject->getAllowableActions( );
+ bool bAllowed = false;
+ if ( aAllowables )
+ {
+ bAllowed = aAllowables->isAllowed( libcmis::ObjectAction::CancelCheckOut );
+ }
+ xRow->appendBoolean( rProp, bAllowed );
+ }
+ catch ( const libcmis::Exception& )
+ {
+ xRow->appendVoid( rProp );
+ }
+ }
+ else if ( rProp.Name == "CanCheckIn" )
+ {
+ try
+ {
+ libcmis::ObjectPtr pObject = getObject( xEnv );
+ libcmis::AllowableActionsPtr aAllowables = pObject->getAllowableActions( );
+ bool bAllowed = false;
+ if ( aAllowables )
+ {
+ bAllowed = aAllowables->isAllowed( libcmis::ObjectAction::CheckIn );
+ }
+ xRow->appendBoolean( rProp, bAllowed );
+ }
+ catch ( const libcmis::Exception& )
+ {
+ xRow->appendVoid( rProp );
+ }
+ }
else
SAL_INFO( "cmisucp", "Looking for unsupported property " << rProp.Name );
}
@@ -662,6 +719,170 @@ namespace cmis
return aRet;
}
+ rtl::OUString Content::checkIn( const ucb::CheckinArgument& rArg,
+ const uno::Reference< ucb::XCommandEnvironment > & xEnv )
+ throw( uno::Exception )
+ {
+ ucbhelper::Content aSourceContent( rArg.SourceURL, xEnv, comphelper::getProcessComponentContext( ) );
+ uno::Reference< io::XInputStream > xIn = aSourceContent.openStream( );
+
+ libcmis::ObjectPtr object;
+ try
+ {
+ object = getObject( xEnv );
+ }
+ catch ( const libcmis::Exception& )
+ {
+ }
+
+ libcmis::Document* pPwc = dynamic_cast< libcmis::Document* >( object.get( ) );
+ if ( !pPwc )
+ {
+ ucbhelper::cancelCommandExecution(
+ ucb::IOErrorCode_GENERAL,
+ uno::Sequence< uno::Any >( 0 ),
+ xEnv,
+ "Checkin only supported by documents" );
+ }
+
+ 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( xIn, xOutput );
+
+ map< string, libcmis::PropertyPtr > newProperties;
+ libcmis::DocumentPtr pDoc = pPwc->checkIn( rArg.MajorVersion, OUSTR_TO_STDSTR( rArg.VersionComment ), newProperties,
+ pOut, OUSTR_TO_STDSTR( rArg.MimeType ), OUSTR_TO_STDSTR( rArg.NewTitle ) );
+
+ // Get the URL and send it back as a result
+ URL aCmisUrl( m_sURL );
+ vector< string > aPaths = pDoc->getPaths( );
+ if ( !aPaths.empty() )
+ {
+ string sPath = aPaths.front( );
+ aCmisUrl.setObjectPath( STD_TO_OUSTR( sPath ) );
+ }
+ else
+ {
+ // We may have unfiled document depending on the server, those
+ // won't have any path, use their ID instead
+ string sId = pDoc->getId( );
+ aCmisUrl.setObjectId( STD_TO_OUSTR( sId ) );
+ }
+ return aCmisUrl.asString( );
+ }
+
+ rtl::OUString Content::checkOut( const uno::Reference< ucb::XCommandEnvironment > & xEnv )
+ throw( uno::Exception )
+ {
+ rtl::OUString aRet;
+ try
+ {
+ // Checkout the document if possible
+ libcmis::DocumentPtr pDoc = boost::dynamic_pointer_cast< libcmis::Document >( getObject( xEnv ) );
+ if ( pDoc.get( ) == NULL )
+ {
+ ucbhelper::cancelCommandExecution(
+ ucb::IOErrorCode_GENERAL,
+ uno::Sequence< uno::Any >( 0 ),
+ xEnv,
+ "Checkout only supported by documents" );
+ }
+ libcmis::DocumentPtr pPwc = pDoc->checkOut( );
+
+ // Compute the URL of the Private Working Copy (PWC)
+ URL aCmisUrl( m_sURL );
+ vector< string > aPaths = pPwc->getPaths( );
+ if ( !aPaths.empty() )
+ {
+ string sPath = aPaths.front( );
+ aCmisUrl.setObjectPath( STD_TO_OUSTR( sPath ) );
+ }
+ else
+ {
+ // We may have unfiled PWC depending on the server, those
+ // won't have any path, use their ID instead
+ string sId = pPwc->getId( );
+ aCmisUrl.setObjectId( STD_TO_OUSTR( sId ) );
+ }
+ aRet = aCmisUrl.asString( );
+ }
+ catch ( const libcmis::Exception& e )
+ {
+ SAL_INFO( "cmisucp", "Unexpected libcmis exception: " << e.what( ) );
+ ucbhelper::cancelCommandExecution(
+ ucb::IOErrorCode_GENERAL,
+ uno::Sequence< uno::Any >( 0 ),
+ xEnv,
+ rtl::OUString::createFromAscii( e.what() ) );
+ }
+ return aRet;
+ }
+
+ rtl::OUString Content::cancelCheckOut( const uno::Reference< ucb::XCommandEnvironment > & xEnv )
+ throw( uno::Exception )
+ {
+ rtl::OUString aRet;
+ try
+ {
+ libcmis::DocumentPtr pPwc = boost::dynamic_pointer_cast< libcmis::Document >( getObject( xEnv ) );
+ if ( pPwc.get( ) == NULL )
+ {
+ ucbhelper::cancelCommandExecution(
+ ucb::IOErrorCode_GENERAL,
+ uno::Sequence< uno::Any >( 0 ),
+ xEnv,
+ "CancelCheckout only supported by documents" );
+ }
+ pPwc->cancelCheckout( );
+
+ // Get the Original document (latest version)
+ vector< libcmis::DocumentPtr > aVersions = pPwc->getAllVersions( );
+ libcmis::DocumentPtr pDoc;
+ for ( vector< libcmis::DocumentPtr >::iterator it = aVersions.begin();
+ it != aVersions.end( ) && pDoc != NULL; ++it )
+ {
+ libcmis::DocumentPtr pVersion = *it;
+ map< string, libcmis::PropertyPtr > aProps = pVersion->getProperties( );
+ bool bIsLatestVersion = false;
+ map< string, libcmis::PropertyPtr >::iterator propIt = aProps.find( string( "cmis:isLatestVersion" ) );
+ if ( propIt != aProps.end( ) && !propIt->second->getBools( ).empty( ) )
+ {
+ bIsLatestVersion = propIt->second->getBools( ).front( );
+ }
+
+ if ( bIsLatestVersion )
+ pDoc.reset( pVersion.get( ) );
+ }
+
+ // Compute the URL of the Document
+ URL aCmisUrl( m_sURL );
+ vector< string > aPaths = pDoc->getPaths( );
+ if ( !aPaths.empty() )
+ {
+ string sPath = aPaths.front( );
+ aCmisUrl.setObjectPath( STD_TO_OUSTR( sPath ) );
+ }
+ else
+ {
+ // We may have unfiled doc depending on the server, those
+ // won't have any path, use their ID instead
+ string sId = pDoc->getId( );
+ aCmisUrl.setObjectId( STD_TO_OUSTR( sId ) );
+ }
+ aRet = aCmisUrl.asString( );
+ }
+ catch ( const libcmis::Exception& e )
+ {
+ SAL_INFO( "cmisucp", "Unexpected libcmis exception: " << e.what( ) );
+ ucbhelper::cancelCommandExecution(
+ ucb::IOErrorCode_GENERAL,
+ uno::Sequence< uno::Any >( 0 ),
+ xEnv,
+ rtl::OUString::createFromAscii( e.what() ) );
+ }
+ return aRet;
+ }
+
void Content::transfer( const ucb::TransferInfo& rTransferInfo,
const uno::Reference< ucb::XCommandEnvironment > & xEnv )
throw( uno::Exception )
@@ -756,11 +977,10 @@ namespace cmis
libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get( ) );
if ( NULL != document )
{
- string sMime = document->getContentType( );
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, OUSTR_TO_STDSTR( rMimeType ), bReplaceExisting );
+ document->setContentStream( pOut, OUSTR_TO_STDSTR( rMimeType ), string( ), bReplaceExisting );
}
}
else
@@ -997,6 +1217,15 @@ namespace cmis
beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVersionable" ) ),
-1, getCppuBooleanType(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ),
+ beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CanCheckOut" ) ),
+ -1, getCppuBooleanType(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ),
+ beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CanCancelCheckOut" ) ),
+ -1, getCppuBooleanType(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ),
+ beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CanCheckIn" ) ),
+ -1, getCppuBooleanType(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ),
};
const int nProps = SAL_N_ELEMENTS(aGenericProperties);
@@ -1035,6 +1264,9 @@ namespace cmis
// Mandatory CMIS-only commands
ucb::CommandInfo ( rtl::OUString( "checkout" ), -1, getCppuVoidType() ),
+ ucb::CommandInfo ( rtl::OUString( "cancelCheckout" ), -1, getCppuVoidType() ),
+ ucb::CommandInfo ( rtl::OUString( "checkIn" ), -1,
+ getCppuType( static_cast<ucb::TransferInfo * >( 0 ) ) ),
// Folder Only, omitted if not a folder
ucb::CommandInfo
@@ -1227,46 +1459,20 @@ namespace cmis
}
else if ( aCommand.Name == "checkout" )
{
- try
- {
- // Checkout the document if possible
- libcmis::DocumentPtr pDoc = boost::dynamic_pointer_cast< libcmis::Document >( getObject( xEnv ) );
- if ( pDoc.get( ) == NULL )
- {
- ucbhelper::cancelCommandExecution(
- ucb::IOErrorCode_GENERAL,
- uno::Sequence< uno::Any >( 0 ),
- xEnv,
- "Checkout only supported by documents" );
- }
- libcmis::DocumentPtr pPwc = pDoc->checkOut( );
-
- // Compute the URL of the Private Working Copy (PWC)
- URL aCmisUrl( m_sURL );
- vector< string > aPaths = pPwc->getPaths( );
- if ( !aPaths.empty() )
- {
- string sPath = aPaths.front( );
- aCmisUrl.setObjectPath( STD_TO_OUSTR( sPath ) );
- }
- else
- {
- // We may have unfiled PWC depending on the server, those
- // won't have any path, use their ID instead
- string sId = pPwc->getId( );
- aCmisUrl.setObjectId( STD_TO_OUSTR( sId ) );
- }
- aRet <<= aCmisUrl.asString( );
- }
- catch ( const libcmis::Exception& e )
+ aRet <<= checkOut( xEnv );
+ }
+ else if ( aCommand.Name == "cancelCheckout" )
+ {
+ aRet <<= cancelCheckOut( xEnv );
+ }
+ else if ( aCommand.Name == "checkin" )
+ {
+ ucb::CheckinArgument aArg;
+ if ( !( aCommand.Argument >>= aArg ) )
{
- SAL_INFO( "cmisucp", "Unexpected libcmis exception: " << e.what( ) );
- ucbhelper::cancelCommandExecution(
- ucb::IOErrorCode_GENERAL,
- uno::Sequence< uno::Any >( 0 ),
- xEnv,
- rtl::OUString::createFromAscii( e.what() ) );
+ ucbhelper::cancelCommandExecution ( getBadArgExcept(), xEnv );
}
+ aRet <<= checkIn( aArg, xEnv );
}
else
{
diff --git a/ucb/source/ucp/cmis/cmis_content.hxx b/ucb/source/ucp/cmis/cmis_content.hxx
index 8790834..42c8482 100644
--- a/ucb/source/ucp/cmis/cmis_content.hxx
+++ b/ucb/source/ucp/cmis/cmis_content.hxx
@@ -34,6 +34,7 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/ucb/CheckinArgument.hpp>
#include <com/sun/star/ucb/ContentCreationException.hpp>
#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
#include <com/sun/star/ucb/TransferInfo.hpp>
@@ -117,6 +118,16 @@ private:
const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv )
throw( com::sun::star::uno::Exception );
+ rtl::OUString checkIn( const com::sun::star::ucb::CheckinArgument& rArg,
+ const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv )
+ throw( com::sun::star::uno::Exception );
+
+ rtl::OUString checkOut( const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv )
+ throw( com::sun::star::uno::Exception );
+
+ rtl::OUString cancelCheckOut( 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 );
void copyData( com::sun::star::uno::Reference< com::sun::star::io::XInputStream > xIn,
diff --git a/ucbhelper/inc/ucbhelper/content.hxx b/ucbhelper/inc/ucbhelper/content.hxx
index 259c772..16b186c 100644
--- a/ucbhelper/inc/ucbhelper/content.hxx
+++ b/ucbhelper/inc/ucbhelper/content.hxx
@@ -81,7 +81,8 @@ enum InsertOperation
{
InsertOperation_COPY, // copy source data
InsertOperation_MOVE, // move source data
- InsertOperation_LINK // create a link to source
+ InsertOperation_LINK, // create a link to source
+ InsertOperation_CHECKIN // check-in source data
};
//=========================================================================
@@ -664,13 +665,21 @@ public:
* will overwrite the clashing content and all its data,
* NameClash::RENAME will generate and supply a non-clashing title.
* @see com/sun/star/ucb/NameClash.idl
+ * @param rMimeType contains the MIME type of the document to write.
+ * @param bMajorVersion tells to create a new major version for checkin operations
+ * @param rCommentVersion contains the comment to use for checkin operations
+ * @param rResultURL is a hacky way to get the update URL after the operation in
+ * case there was a change (introduced for the checkin operation)
*/
sal_Bool
transferContent( const Content& rSourceContent,
InsertOperation eOperation,
const ::rtl::OUString & rTitle,
const sal_Int32 nNameClashAction,
- const ::rtl::OUString & rMimeType = ::rtl::OUString( ) )
+ const ::rtl::OUString & rMimeType = ::rtl::OUString( ),
+ bool bMajorVersion = false,
+ const ::rtl::OUString & rCommentVersion = ::rtl::OUString( ),
+ ::rtl::OUString* pResultURL = NULL )
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 22c9b31..95e589f 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;
}
commit 1eb7a921641107cdd802e8bbc6117d6f303f73f5
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Sat Oct 20 20:35:01 2012 -0700
CMIS UCP: fixed crash when URL to server is wrong, or server down
Change-Id: Ibe11358794a3ff714d2e1fafd900cc3262ca266d
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 966576b..6ea78e0 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -272,6 +272,12 @@ namespace cmis
m_pSession = libcmis::SessionFactory::createSession(
OUSTR_TO_STDSTR( m_aURL.getBindingUrl( ) ),
rUsername, rPassword, OUSTR_TO_STDSTR( m_aURL.getRepositoryId( ) ) );
+ if ( m_pSession == NULL )
+ ucbhelper::cancelCommandExecution(
+ ucb::IOErrorCode_INVALID_DEVICE,
+ uno::Sequence< uno::Any >( 0 ),
+ xEnv,
+ rtl::OUString( ) );
m_pProvider->registerSession( sSessionId, m_pSession );
}
else
commit 23722506efd84a9b7b447578de32c0eef9bf8b98
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Sat Oct 20 09:42:35 2012 -0700
CMIS: added CheckOut in the File menu
Change-Id: I5f003556065cff34cec38148bc3bb4da20692e54
diff --git a/basctl/uiconfig/basicide/menubar/menubar.xml b/basctl/uiconfig/basicide/menubar/menubar.xml
index aa5530f..58a453c 100644
--- a/basctl/uiconfig/basicide/menubar/menubar.xml
+++ b/basctl/uiconfig/basicide/menubar/menubar.xml
@@ -29,6 +29,7 @@
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
+ <menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menu menu:id=".uno:TemplateMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
diff --git a/chart2/uiconfig/menubar/menubar.xml b/chart2/uiconfig/menubar/menubar.xml
index d88e0e7..3d0e33b 100644
--- a/chart2/uiconfig/menubar/menubar.xml
+++ b/chart2/uiconfig/menubar/menubar.xml
@@ -27,6 +27,7 @@
<menu:menuitem menu:id=".uno:Save" menu:helpid="5505" menu:label="" />
<menu:menuitem menu:id=".uno:SaveAs" menu:helpid="5502" menu:label="" />
<menu:menuitem menu:id=".uno:SaveAll" menu:helpid="5309" menu:label="" />
+ <menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuitem menu:id=".uno:Reload" menu:helpid="5508" menu:label="" />
<menu:menuitem menu:id=".uno:VersionDialog" menu:helpid="6583" menu:label="" />
<menu:menuitem menu:id=".uno:SendMail" menu:helpid="5331" menu:label="" />
diff --git a/dbaccess/uiconfig/dbapp/menubar/menubar.xml b/dbaccess/uiconfig/dbapp/menubar/menubar.xml
index 84e999a..9c65ce8 100644
--- a/dbaccess/uiconfig/dbapp/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbapp/menubar/menubar.xml
@@ -29,6 +29,7 @@
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
+ <menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ExportTo"/>
<menu:menu menu:id=".uno:SendToMenu">
diff --git a/dbaccess/uiconfig/dbquery/menubar/menubar.xml b/dbaccess/uiconfig/dbquery/menubar/menubar.xml
index 4e98080..4b605ea 100644
--- a/dbaccess/uiconfig/dbquery/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbquery/menubar/menubar.xml
@@ -27,6 +27,7 @@
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Quit"/>
</menu:menupopup>
diff --git a/dbaccess/uiconfig/dbrelation/menubar/menubar.xml b/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
index 688ecf2..1d5e0a3 100644
--- a/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
@@ -26,6 +26,7 @@
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:Save"/>
+ <menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Quit"/>
</menu:menupopup>
diff --git a/dbaccess/uiconfig/dbtable/menubar/menubar.xml b/dbaccess/uiconfig/dbtable/menubar/menubar.xml
index 5fa1200..496664d 100644
--- a/dbaccess/uiconfig/dbtable/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbtable/menubar/menubar.xml
@@ -27,6 +27,7 @@
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Quit"/>
</menu:menupopup>
diff --git a/dbaccess/uiconfig/dbtdata/menubar/menubar.xml b/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
index 5f35b46..e22b66a 100644
--- a/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
@@ -27,6 +27,7 @@
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Quit"/>
</menu:menupopup>
diff --git a/extensions/source/bibliography/uiconfig/sbibliography/menubar/menubar.xml b/extensions/source/bibliography/uiconfig/sbibliography/menubar/menubar.xml
index f66c285..05416af 100644
--- a/extensions/source/bibliography/uiconfig/sbibliography/menubar/menubar.xml
+++ b/extensions/source/bibliography/uiconfig/sbibliography/menubar/menubar.xml
@@ -10,6 +10,7 @@
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
+ <menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
<menu:menuseparator/>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index f8a45f1..4011c05 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -1896,6 +1896,11 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:CheckOut" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Check-Out</value>
+ </prop>
+ </node>
<node oor:name=".uno:CloseDoc" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Close</value>
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index 621586e..490266c 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -13,6 +13,7 @@
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
+ <menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index 8dcff8f..0dbc2f6 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -13,6 +13,7 @@
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
+ <menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index 13c6939..629a705 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -13,6 +13,7 @@
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
+ <menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuitem menu:id=".uno:VersionDialog"/>
diff --git a/sfx2/inc/sfx2/infobar.hxx b/sfx2/inc/sfx2/infobar.hxx
index 876764a..b72dbbd 100644
--- a/sfx2/inc/sfx2/infobar.hxx
+++ b/sfx2/inc/sfx2/infobar.hxx
@@ -41,16 +41,18 @@ class SFX2_DLLPUBLIC SfxInfoBarContainerChild : public SfxChildWindow
class SfxInfoBarWindow : public Window
{
private:
+ rtl::OUString m_sId;
FixedText* m_pMessage;
Button* m_pCloseBtn;
std::vector< PushButton* > m_aActionBtns;
public:
- SfxInfoBarWindow( Window* parent,
+ SfxInfoBarWindow( Window* parent, const rtl::OUString& sId,
const rtl::OUString& sMessage,
std::vector< PushButton* > aButtons );
~SfxInfoBarWindow( );
+ virtual const rtl::OUString& getId() const { return m_sId; }
virtual void Paint( const Rectangle& );
virtual void Resize( );
@@ -68,7 +70,8 @@ class SfxInfoBarContainerWindow : public Window
SfxInfoBarContainerWindow( SfxInfoBarContainerChild* pChildWin );
~SfxInfoBarContainerWindow( );
- void appendInfoBar( const rtl::OUString& sMessage, std::vector< PushButton* > aButtons );
+ void appendInfoBar( const rtl::OUString& sId, const rtl::OUString& sMessage, std::vector< PushButton* > aButtons );
+ SfxInfoBarWindow* getInfoBar( const rtl::OUString& sId );
void removeInfoBar( SfxInfoBarWindow* pInfoBar );
virtual void Resize( );
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 331553d..88a2abe 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -732,6 +732,8 @@ public:
SAL_DLLPRIVATE void ImplSign( sal_Bool bScriptingContent = sal_False );
SAL_DLLPRIVATE sal_Bool QuerySaveSizeExceededModules_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
+
+ SAL_DLLPRIVATE void CheckOut( );
};
#define SFX_GLOBAL_CLASSID \
diff --git a/sfx2/inc/sfx2/sfxcommands.h b/sfx2/inc/sfx2/sfxcommands.h
index fc075b2..46c7ebc 100644
--- a/sfx2/inc/sfx2/sfxcommands.h
+++ b/sfx2/inc/sfx2/sfxcommands.h
@@ -44,6 +44,7 @@
#define CMD_SID_OPENHYPERLINK ".uno:OpenHyperlink"
#define CMD_SID_DOCINFO_TITLE ".uno:DocInfoTitle"
#define CMD_SID_OPENTEMPLATE ".uno:OpenTemplate"
+#define CMD_SID_CHECKOUT ".uno:CheckOut"
#define CMD_SID_OPENURL ".uno:OpenUrl"
#define CMD_SID_OPTIONS ".uno:Options"
#define CMD_SID_ORGANIZER ".uno:Organizer"
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 0d3522b..9586dde 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -143,6 +143,7 @@
#define SID_EXPORTDOCASPDF (SID_SFX_START + 1673)
#define SID_DIRECTEXPORTDOCASPDF (SID_SFX_START + 1674)
#define SID_UPDATEDOCMODE (SID_SFX_START + 1668)
+#define SID_CHECKOUT (SID_SFX_START + 512)
#define SID_FORCERELOAD (SID_SFX_START + 1502)
#define SID_FILE_DIALOG (SID_SFX_START + 304)
diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx
index c3d8893..4373a52 100644
--- a/sfx2/inc/sfx2/viewfrm.hxx
+++ b/sfx2/inc/sfx2/viewfrm.hxx
@@ -23,7 +23,6 @@
#include "sfx2/dllapi.h"
#include "sal/types.h"
#include <svl/lstner.hxx>
-#include <sfx2/infobar.hxx>
#include <sfx2/module.hxx>
#include <sfx2/frame.hxx>
#include <sfx2/shell.hxx>
@@ -191,8 +190,8 @@ public:
The buttons will be added from Right to Left at the right of the info bar. The parent, size
and position of each button will be changed: only the width will remain unchanged.
*/
- void AppendInfoBar( const rtl::OUString& sMessage, std::vector< PushButton* > aButtons );
- void RemoveInfoBar( SfxInfoBarWindow* pInfoBar );
+ void AppendInfoBar( const rtl::OUString& sId, const rtl::OUString& sMessage, std::vector< PushButton* > aButtons );
+ void RemoveInfoBar( const rtl::OUString& sId );
SAL_DLLPRIVATE void SetDowning_Impl();
SAL_DLLPRIVATE void GetDocNumber_Impl();
diff --git a/sfx2/sdi/docslots.sdi b/sfx2/sdi/docslots.sdi
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list