summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfx2/source/doc/objserv.cxx24
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx19
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();