diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-10-31 11:21:50 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-10-31 12:03:31 +0100 |
commit | 99f376d2d143fa169fbf6e2527a897277d586524 (patch) | |
tree | d9cf6cad78aeec3720b7d84e2744b29b3ddd4f9c /sfx2/source/view | |
parent | 103d75da5f47a2f19e2242ca377fd8ec67548126 (diff) |
Fix broken sw unit introduced by commit a522818
Change-Id: I78a191e39dee00d31ddd773e7b49af73be3136cc
Diffstat (limited to 'sfx2/source/view')
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 81638ff2076b..dee5ea764914 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -1440,31 +1440,34 @@ void SfxBaseController::ShowInfoBars( ) { // CMIS verifications REFERENCE< document::XCmisDocument > xCmisDoc( m_pData->m_pViewShell->GetObjectShell()->GetModel(), uno::UNO_QUERY ); - beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues( ); - - if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) ) + if ( xCmisDoc.is( ) ) { - // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut - bool bFoundCheckedout = false; - sal_Bool bCheckedOut = sal_False; - for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i ) + beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues( ); + + if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) ) { - if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" ) + // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut + bool bFoundCheckedout = false; + sal_Bool bCheckedOut = sal_False; + for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i ) { - bFoundCheckedout = true; - aCmisProperties[i].Value >>= bCheckedOut; + if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" ) + { + bFoundCheckedout = true; + aCmisProperties[i].Value >>= bCheckedOut; + } } - } - if ( !bCheckedOut ) - { - // Get the Frame and show the InfoBar if not checked out - SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame(); - std::vector< PushButton* > aButtons; - PushButton* pBtn = new PushButton( &pViewFrame->GetWindow(), SfxResId( BT_CHECKOUT ) ); - pBtn->SetClickHdl( LINK( this, SfxBaseController, CheckOutHandler ) ); - aButtons.push_back( pBtn ); - pViewFrame->AppendInfoBar( "checkout", SfxResId( STR_NONCHECKEDOUT_DOCUMENT ), aButtons ); + if ( !bCheckedOut ) + { + // Get the Frame and show the InfoBar if not checked out + SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame(); + std::vector< PushButton* > aButtons; + PushButton* pBtn = new PushButton( &pViewFrame->GetWindow(), SfxResId( BT_CHECKOUT ) ); + pBtn->SetClickHdl( LINK( this, SfxBaseController, CheckOutHandler ) ); + aButtons.push_back( pBtn ); + pViewFrame->AppendInfoBar( "checkout", SfxResId( STR_NONCHECKEDOUT_DOCUMENT ), aButtons ); + } } } } |