diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-18 14:08:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-19 11:01:18 +0200 |
commit | 9df2821e61979dab32390d5c64dd49bee868adbb (patch) | |
tree | 5b827e29e73ac2300c164b0a389a784a358956e6 /chart2/source/controller/accessibility/AccessibleChartView.cxx | |
parent | 8b0a69498b025e13d9772689e9e4fa3d6b05e609 (diff) |
loplugin:flatten in chart2
Change-Id: Iadc4da6515a7d82e7a92b33d74d589b61fa2c64f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92480
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/controller/accessibility/AccessibleChartView.cxx')
-rw-r--r-- | chart2/source/controller/accessibility/AccessibleChartView.cxx | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/chart2/source/controller/accessibility/AccessibleChartView.cxx b/chart2/source/controller/accessibility/AccessibleChartView.cxx index 9ce465b70613..0738f52abc36 100644 --- a/chart2/source/controller/accessibility/AccessibleChartView.cxx +++ b/chart2/source/controller/accessibility/AccessibleChartView.cxx @@ -289,37 +289,37 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments if( bOldInvalid && bNewInvalid ) bChanged = false; - if( bChanged ) + if( !bChanged ) + return; + { - { - //before notification we prepare for creation of new context - //the old context will be deleted after notification than - MutexGuard aGuard( m_aMutex); - Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY ); - if( xChartDoc.is()) - m_spObjectHierarchy = - std::make_shared<ObjectHierarchy>( xChartDoc, comphelper::getUnoTunnelImplementation<ExplicitValueProvider>(m_xChartView) ); - else - m_spObjectHierarchy.reset(); - } + //before notification we prepare for creation of new context + //the old context will be deleted after notification than + MutexGuard aGuard( m_aMutex); + Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY ); + if( xChartDoc.is()) + m_spObjectHierarchy = + std::make_shared<ObjectHierarchy>( xChartDoc, comphelper::getUnoTunnelImplementation<ExplicitValueProvider>(m_xChartView) ); + else + m_spObjectHierarchy.reset(); + } - { - AccessibleElementInfo aAccInfo; - aAccInfo.m_aOID = ObjectIdentifier("ROOT"); - aAccInfo.m_xChartDocument = uno::WeakReference< chart2::XChartDocument >( - uno::Reference< chart2::XChartDocument >( m_xChartModel.get(), uno::UNO_QUERY )); - aAccInfo.m_xSelectionSupplier = m_xSelectionSupplier; - aAccInfo.m_xView = m_xChartView; - aAccInfo.m_xWindow = m_xWindow; - aAccInfo.m_pParent = nullptr; - aAccInfo.m_spObjectHierarchy = m_spObjectHierarchy; - aAccInfo.m_pSdrView = m_pSdrView; - VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( m_xWindow ); - m_pViewForwarder.reset( new AccessibleViewForwarder( this, pWindow ) ); - aAccInfo.m_pViewForwarder = m_pViewForwarder.get(); - // broadcasts an INVALIDATE_ALL_CHILDREN event globally - SetInfo( aAccInfo ); - } + { + AccessibleElementInfo aAccInfo; + aAccInfo.m_aOID = ObjectIdentifier("ROOT"); + aAccInfo.m_xChartDocument = uno::WeakReference< chart2::XChartDocument >( + uno::Reference< chart2::XChartDocument >( m_xChartModel.get(), uno::UNO_QUERY )); + aAccInfo.m_xSelectionSupplier = m_xSelectionSupplier; + aAccInfo.m_xView = m_xChartView; + aAccInfo.m_xWindow = m_xWindow; + aAccInfo.m_pParent = nullptr; + aAccInfo.m_spObjectHierarchy = m_spObjectHierarchy; + aAccInfo.m_pSdrView = m_pSdrView; + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( m_xWindow ); + m_pViewForwarder.reset( new AccessibleViewForwarder( this, pWindow ) ); + aAccInfo.m_pViewForwarder = m_pViewForwarder.get(); + // broadcasts an INVALIDATE_ALL_CHILDREN event globally + SetInfo( aAccInfo ); } } @@ -333,19 +333,19 @@ void SAL_CALL AccessibleChartView::selectionChanged( const lang::EventObject& /* xSelectionSupplier.set(m_xSelectionSupplier); } - if( xSelectionSupplier.is() ) + if( !xSelectionSupplier.is() ) + return; + + ObjectIdentifier aSelectedOID( xSelectionSupplier->getSelection() ); + if ( m_aCurrentSelectionOID.isValid() ) { - ObjectIdentifier aSelectedOID( xSelectionSupplier->getSelection() ); - if ( m_aCurrentSelectionOID.isValid() ) - { - NotifyEvent( EventType::LOST_SELECTION, m_aCurrentSelectionOID ); - } - if( aSelectedOID.isValid() ) - { - NotifyEvent( EventType::GOT_SELECTION, aSelectedOID ); - } - m_aCurrentSelectionOID = aSelectedOID; + NotifyEvent( EventType::LOST_SELECTION, m_aCurrentSelectionOID ); + } + if( aSelectedOID.isValid() ) + { + NotifyEvent( EventType::GOT_SELECTION, aSelectedOID ); } + m_aCurrentSelectionOID = aSelectedOID; } // XEventListener |