From 2edfb8d9b4da733a2d825cd5fc791fea5352dffe Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 12 Feb 2016 13:47:42 +0100 Subject: sw: unindent SwOLELRUCache::Load() Change-Id: If1a83fd4716b7a8ebfb09a7118e760fcca3a61b4 --- sw/source/core/ole/ndole.cxx | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index 5573942ef789..f3f53c1a4f49 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -932,33 +932,31 @@ void SwOLELRUCache::Load() Sequence< Any > aValues = GetProperties( aNames ); const Any* pValues = aValues.getConstArray(); OSL_ENSURE( aValues.getLength() == aNames.getLength(), "GetProperties failed" ); - if( aValues.getLength() == aNames.getLength() && pValues->hasValue() ) + if (aValues.getLength() != aNames.getLength() || !pValues->hasValue()) + return; + + sal_Int32 nVal = 0; + *pValues >>= nVal; + + if (nVal < m_nLRU_InitSize) { - sal_Int32 nVal = 0; - *pValues >>= nVal; + std::shared_ptr tmp(g_pOLELRU_Cache); // prevent delete this + // size of cache has been changed + sal_Int32 nCount = m_OleObjects.size(); + sal_Int32 nPos = nCount; + // try to remove the last entries until new maximum size is reached + while( nCount > nVal ) { - if (nVal < m_nLRU_InitSize) - { - std::shared_ptr tmp(g_pOLELRU_Cache); // prevent delete this - // size of cache has been changed - sal_Int32 nCount = m_OleObjects.size(); - sal_Int32 nPos = nCount; - - // try to remove the last entries until new maximum size is reached - while( nCount > nVal ) - { - SwOLEObj *const pObj = m_OleObjects[ --nPos ]; - if ( pObj->UnloadObject() ) - nCount--; - if ( !nPos ) - break; - } - } + SwOLEObj *const pObj = m_OleObjects[ --nPos ]; + if ( pObj->UnloadObject() ) + nCount--; + if ( !nPos ) + break; } - - m_nLRU_InitSize = nVal; } + + m_nLRU_InitSize = nVal; } void SwOLELRUCache::InsertObj( SwOLEObj& rObj ) -- cgit v1.2.3