Kaydet (Commit) 6ca5cc5b authored tarafından Caolán McNamara's avatar Caolán McNamara

help coverity out with empty()

Change-Id: Icc28a0f0f4afcbda9e595fa753494a8161f82d4c
üst a7d26c9f
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment