summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-02-12 13:47:42 +0100
committerMichael Stahl <mstahl@redhat.com>2016-02-12 18:54:32 +0100
commit2edfb8d9b4da733a2d825cd5fc791fea5352dffe (patch)
tree88eea2d2192c74a5126d7c470a7895baf0321ce6
parent60d4dd0a6c44b45ed424ca6a0ddcf857ec089b24 (diff)
sw: unindent SwOLELRUCache::Load()
Change-Id: If1a83fd4716b7a8ebfb09a7118e760fcca3a61b4
-rw-r--r--sw/source/core/ole/ndole.cxx42
1 files 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<SwOLELRUCache> 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<SwOLELRUCache> 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 )