diff options
author | Cao Cuong Ngo <cao.cuong.ngo@gmail.com> | 2013-09-27 21:42:14 +0200 |
---|---|---|
committer | Cao Cuong Ngo <cao.cuong.ngo@gmail.com> | 2013-09-27 23:04:46 +0200 |
commit | 4fd449b1ca4dce9f1425fc035291651bfc510a3e (patch) | |
tree | b03738d2e9788a15e52e69cf19b25b217841f3fc /sfx2 | |
parent | 1659af36ca5e6ecaeaa61fcdbd672e8a4b7ec083 (diff) |
Google Drive files don't need Checkout bar.
Plus, the Name property has been changed to Id,
that was the reason the Checkin bar disappeared.
Change-Id: I03f6ef4e1399c0f8b2a347ca8acd8a42daffa497
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 24 | ||||
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 19 |
2 files changed, 28 insertions, 15 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index fc4076961672..3a2ce2e7eb20 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -947,17 +947,22 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) ) { // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut - bool bFoundCheckedout = false; + bool bIsGoogleFile = false; sal_Bool bCheckedOut = sal_False; - for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i ) + for ( sal_Int32 i = 0; i < aCmisProperties.getLength(); ++i ) { - if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" ) + if ( aCmisProperties[i].Id == "cmis:isVersionSeriesCheckedOut" ) { - bFoundCheckedout = true; - aCmisProperties[i].Value >>= bCheckedOut; + uno::Sequence< sal_Bool > bTmp; + aCmisProperties[i].Value >>= bTmp; + bCheckedOut = bTmp[0]; } + // using title to know if it's a Google Drive file + // maybe there's a safer way. + if ( aCmisProperties[i].Name == "title" ) + bIsGoogleFile = true; } - bShow = !bCheckedOut; + bShow = !bCheckedOut && !bIsGoogleFile; } if ( !bShow ) @@ -982,10 +987,13 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) sal_Bool bCheckedOut = sal_False; for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i ) { - if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" ) + if ( aCmisProperties[i].Id == "cmis:isVersionSeriesCheckedOut" ) { bFoundCheckedout = true; - aCmisProperties[i].Value >>= bCheckedOut; + uno::Sequence< sal_Bool > bTmp; + aCmisProperties[i].Value >>= bTmp; + bCheckedOut = bTmp[0]; + } } bShow = bCheckedOut; diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 5ebbf71ac902..a119281a43af 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -1434,18 +1434,23 @@ void SfxBaseController::ShowInfoBars( ) if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) ) { // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut - bool bFoundCheckedout = false; + // and find if it is a Google Drive file. + bool bIsGoogleFile = false; sal_Bool bCheckedOut = sal_False; - for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i ) + for ( sal_Int32 i = 0; i < aCmisProperties.getLength(); ++i ) { - if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" ) - { - bFoundCheckedout = true; - aCmisProperties[i].Value >>= bCheckedOut; + if ( aCmisProperties[i].Id == "cmis:isVersionSeriesCheckedOut" ) { + uno::Sequence< sal_Bool > bTmp; + aCmisProperties[i].Value >>= bTmp; + bCheckedOut = bTmp[0]; } + // if it is a Google Drive file, we don't need the checkout bar, + // still need the checkout feature for the version dialog. + if ( aCmisProperties[i].Name == "title" ) + bIsGoogleFile = true; } - if ( !bCheckedOut ) + if ( !bCheckedOut && !bIsGoogleFile ) { // Get the Frame and show the InfoBar if not checked out SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame(); |