summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-17 13:34:39 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-17 14:53:25 +0000
commit6ca5cc5b1aea3c7dc9f8c5f96eb9b9237430278f (patch)
treecd8fba86f2a85c4f1fb3c5d94ca1dad8ba2713c4 /sw
parenta7d26c9f252f35eb18d8ab2900e4a6f67ca2e875 (diff)
help coverity out with empty()
Change-Id: Icc28a0f0f4afcbda9e595fa753494a8161f82d4c
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index c5e18c9b9565..a2221feb49fa 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -988,14 +988,15 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
long lTopBorder = rBorder.Top() + 5;
long lBottomBorder = rBorder.Bottom() - 5;
const long lVisibleHeight = lBottomBorder - lTopBorder; //rBorder.GetHeight() ;
+ const size_t nPostItListSize = aVisiblePostItList.size();
long lTranslatePos = 0;
bool bScrollbars = false;
// do all necessary resizings
- if (!aVisiblePostItList.empty() && lVisibleHeight < lNeededHeight)
+ if (nPostItListSize > 0 && lVisibleHeight < lNeededHeight)
{
// ok, now we have to really resize and adding scrollbars
- const long lAverageHeight = (lVisibleHeight - aVisiblePostItList.size()*GetSpaceBetween()) / aVisiblePostItList.size();
+ const long lAverageHeight = (lVisibleHeight - nPostItListSize*GetSpaceBetween()) / nPostItListSize;
if (lAverageHeight<GetMinimumSizeWithMeta())
{
bScrollbars = true;