[Libreoffice-commits] .: sfx2/source ucb/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Nov 5 01:49:22 PST 2012
sfx2/source/appl/app.hrc | 1
sfx2/source/appl/app.src | 7 +++++
sfx2/source/doc/objserv.cxx | 5 +++-
ucb/source/ucp/cmis/cmis_content.cxx | 41 +++++++++++++++++------------------
4 files changed, 33 insertions(+), 21 deletions(-)
New commits:
commit bce042ca83c7cb5cc3e3bdc07c50b60e6a1ed659
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Sat Nov 3 14:55:19 2012 +0100
CMIS: added confirmation dialog for cancel checkout
Change-Id: I12317bd8c91756c7960f04d2fad38dd509840932
diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc
index 5cbfd7f..fb322cb 100644
--- a/sfx2/source/appl/app.hrc
+++ b/sfx2/source/appl/app.hrc
@@ -112,6 +112,7 @@
#define RID_XMLSEC_QUERY_LOSINGSIGNATURE (RID_SFX_APP_START + 186)
#define RID_XMLSEC_QUERY_SAVEBEFORESIGN (RID_SFX_APP_START + 187)
+#define RID_QUERY_CANCELCHECKOUT (RID_SFX_APP_START + 188)
#define RID_XMLSEC_INFO_WRONGDOCFORMAT (RID_SFX_APP_START + 190)
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index 6eae48d..d1dcccd 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -432,6 +432,13 @@ QueryBox RID_XMLSEC_QUERY_SAVEBEFORESIGN
Message [ en-US ] = "The document has to be saved before it can be signed.\nDo you want to save the document?" ;
};
+QueryBox RID_QUERY_CANCELCHECKOUT
+{
+ Buttons = WB_YES_NO ;
+ DefButton = WB_DEF_YES ;
+ Message [ en-US ] = "This will discard all changes on the server since check-out.\nDo you want to proceed?" ;
+};
+
InfoBox RID_XMLSEC_INFO_WRONGDOCFORMAT
{
Message [ en-US ] = "This document must be saved in OpenDocument file format before it can be digitally signed." ;
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 116f976..490a72b 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -951,7 +951,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
}
case SID_CANCELCHECKOUT:
{
- CancelCheckOut( );
+ if ( QueryBox( NULL, SfxResId( RID_QUERY_CANCELCHECKOUT ) ).Execute( ) == RET_YES )
+ {
+ CancelCheckOut( );
+ }
break;
}
case SID_CHECKIN:
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 0c6ba36..83551b2 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -837,9 +837,9 @@ namespace cmis
// Get the Original document (latest version)
vector< libcmis::DocumentPtr > aVersions = pPwc->getAllVersions( );
- libcmis::DocumentPtr pDoc;
+ bool bFound = false;
for ( vector< libcmis::DocumentPtr >::iterator it = aVersions.begin();
- it != aVersions.end( ) && pDoc != NULL; ++it )
+ it != aVersions.end( ) && !bFound; ++it )
{
libcmis::DocumentPtr pVersion = *it;
map< string, libcmis::PropertyPtr > aProps = pVersion->getProperties( );
@@ -851,25 +851,26 @@ namespace cmis
}
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 ) );
+ {
+ bFound = true;
+ // Compute the URL of the Document
+ URL aCmisUrl( m_sURL );
+ vector< string > aPaths = pVersion->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 = pVersion->getId( );
+ aCmisUrl.setObjectId( STD_TO_OUSTR( sId ) );
+ }
+ aRet = aCmisUrl.asString( );
+ }
}
- aRet = aCmisUrl.asString( );
}
catch ( const libcmis::Exception& e )
{
More information about the Libreoffice-commits
mailing list