summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-11-03 14:55:19 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-11-05 10:46:31 +0100
commitbce042ca83c7cb5cc3e3bdc07c50b60e6a1ed659 (patch)
tree3a3446c04e2f743401f8019b326c921a4f093b0f /ucb
parent9c248f9265747351f32bf52d608a91393bfdf1e2 (diff)
CMIS: added confirmation dialog for cancel checkout
Change-Id: I12317bd8c91756c7960f04d2fad38dd509840932
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx41
1 files changed, 21 insertions, 20 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 0c6ba3625bc5..83551b21d799 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 )
{