diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-11-09 17:33:22 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-11-09 20:42:28 +0100 |
commit | ea3fc61f29f6d53c4c65cf6026267f7a37ef1a87 (patch) | |
tree | cdb4cc096fa4c5c429268ac848d23b3b2a6910b9 /embeddedobj | |
parent | a32dea330e5767a68754b19f6005a78618765c1a (diff) |
Fix sd toolbar manager lock underflows
Regressions from commit 45519023aa44 ("Resolves: tdf#119997
toolbar layout unlock doesn't refresh ui"), commit c5977a89c28b
("Resolves: tdf#96451 do magic to enable embedded chart sidebar
only for chart") and commit faed29cac93f ("for now show chart
sidebar").
It also adds an assert for the underflow, as nobody cared for
the underflow warnings since some years.
Change-Id: I86bb093987f084c85a7b640a846dfe0aefea9e48
Reviewed-on: https://gerrit.libreoffice.org/63204
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/general/docholder.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index 6afbba4aa50c..75f61282fcc2 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -691,8 +691,8 @@ bool DocumentHolder::ShowUI( const uno::Reference< css::frame::XLayoutManager >& if ( xOwnLM.is() && xDocAreaAcc.is() ) { // make sure that lock state of LM is correct even if an exception is thrown in between - bool bUnlock = false; - bool bLock = false; + bool bUnlockContainerLM = false; + bool bLockOwnLM = false; try { // take over the control over the containers window @@ -706,18 +706,14 @@ bool DocumentHolder::ShowUI( const uno::Reference< css::frame::XLayoutManager >& // this must be done after merging menus as we won't get the container menu otherwise xContainerLM->setDockingAreaAcceptor( uno::Reference < ui::XDockingAreaAcceptor >() ); - bool bIsChart = false; uno::Reference< lang::XServiceInfo> xServiceInfo(m_xComponent, uno::UNO_QUERY); - if (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.chart2.ChartDocument")) - bIsChart = true; - // prevent further changes at this LM - // TODO: moggi: why is this necessary? - if (!bIsChart) + if (!xServiceInfo.is() || !xServiceInfo->supportsService("com.sun.star.chart2.ChartDocument")) { - xContainerLM->setVisible( false ); + // prevent further changes at this LM + xContainerLM->setVisible(false); xContainerLM->lock(); + bUnlockContainerLM = true; } - bUnlock = true; // by unlocking the LM each layout change will now resize the containers window; pending layouts will be processed now xOwnLM->setVisible( true ); @@ -727,7 +723,7 @@ bool DocumentHolder::ShowUI( const uno::Reference< css::frame::XLayoutManager >& xSupp->setActiveFrame( m_xFrame ); xOwnLM->unlock(); - bLock = true; + bLockOwnLM = true; bResult = true; // TODO/LATER: The following action should be done only if the window is not hidden @@ -746,7 +742,7 @@ bool DocumentHolder::ShowUI( const uno::Reference< css::frame::XLayoutManager >& xSupp->setActiveFrame( nullptr ); // remove control about containers window from own LM - if ( bLock ) + if (bLockOwnLM) xOwnLM->lock(); xOwnLM->setVisible( false ); xOwnLM->setDockingAreaAcceptor( uno::Reference< css::ui::XDockingAreaAcceptor >() ); @@ -762,7 +758,7 @@ bool DocumentHolder::ShowUI( const uno::Reference< css::frame::XLayoutManager >& // reestablish control of containers window xContainerLM->setDockingAreaAcceptor( xDocAreaAcc ); xContainerLM->setVisible( true ); - if ( bUnlock ) + if (bUnlockContainerLM) xContainerLM->unlock(); } catch( const uno::Exception& ) {} @@ -805,8 +801,12 @@ bool DocumentHolder::HideUI( const uno::Reference< css::frame::XLayoutManager >& xMerge->removeMergedMenuBar(); xContainerLM->setDockingAreaAcceptor( xDocAreaAcc ); - xContainerLM->setVisible( true ); - xContainerLM->unlock(); + uno::Reference< lang::XServiceInfo> xServiceInfo(m_xComponent, uno::UNO_QUERY); + if (!xServiceInfo.is() || !xServiceInfo->supportsService("com.sun.star.chart2.ChartDocument")) + { + xContainerLM->setVisible(true); + xContainerLM->unlock(); + } xContainerLM->doLayout(); bResult = true; |