Kaydet (Commit) 4fd449b1 authored tarafından Cao Cuong Ngo's avatar Cao Cuong Ngo

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
üst 1659af36
......@@ -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;
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment