From 4632719f9e895b513418d2560637cea78d406ebf Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 18 Mar 2011 19:56:21 +0000 Subject: WaE: fix dubious undefined behaviour --- framework/source/layoutmanager/layoutmanager.cxx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'framework') diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index c5c876da5f1c..da7c776132b5 100755 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -258,7 +258,7 @@ void LayoutManager::implts_lock() sal_Bool LayoutManager::implts_unlock() { WriteGuard aWriteLock( m_aLock ); - m_nLockCount = std::max( --m_nLockCount, static_cast(0) ); + m_nLockCount = std::max( m_nLockCount-1, static_cast(0) ); return ( m_nLockCount == 0 ); } @@ -1659,7 +1659,6 @@ throw (uno::RuntimeException) { bool bResult( false ); bool bNotify( false ); - bool bDoLayout( false ); ::rtl::OUString aElementType; ::rtl::OUString aElementName; @@ -1693,7 +1692,6 @@ throw (uno::RuntimeException) pWindow->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); bResult = true; bNotify = true; - bDoLayout = true; } } } @@ -1704,7 +1702,6 @@ throw (uno::RuntimeException) implts_showProgressBar(); bResult = true; bNotify = true; - bDoLayout = true; } else if ( aElementType.equalsIgnoreAsciiCaseAscii( UIRESOURCETYPE_TOOLBAR ) && m_bVisible ) { @@ -1716,7 +1713,6 @@ throw (uno::RuntimeException) if ( pToolbarManager && bComponentAttached ) { bNotify = pToolbarManager->requestToolbar( rResourceURL ); - bDoLayout = true; } } else if ( aElementType.equalsIgnoreAsciiCaseAscii( "dockingwindow" )) @@ -1875,7 +1871,6 @@ throw (RuntimeException) { RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::LayoutManager::hideElement" ); - bool bResult( false ); bool bNotify( false ); bool bMustLayout( false ); ::rtl::OUString aElementType; @@ -1901,7 +1896,6 @@ throw (RuntimeException) if ( pMenuBar ) { pMenuBar->SetDisplayable( sal_False ); - bResult = true; bNotify = true; } } @@ -1916,12 +1910,11 @@ throw (RuntimeException) implts_writeWindowStateData( m_aStatusBarAlias, m_aStatusBarElement ); bMustLayout = sal_True; bNotify = sal_True; - bResult = sal_True; } } else if ( aElementType.equalsIgnoreAsciiCaseAscii( "progressbar" ) && aElementName.equalsIgnoreAsciiCaseAscii( "progressbar" )) { - bResult = bNotify = implts_hideProgressBar(); + bNotify = implts_hideProgressBar(); } else if ( aElementType.equalsIgnoreAsciiCaseAscii( UIRESOURCETYPE_TOOLBAR )) { -- cgit