diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-11-20 00:09:40 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2014-11-20 18:20:38 +0000 |
commit | be049d3d2e84b99c7c62fd5931fa69b3827bb6d2 (patch) | |
tree | 536300d4d9441f7a82170a4ac4c12cd556ebe3e5 | |
parent | 0c5cbcd776f3f71226ea59d7d8e5d2c20f3c5c00 (diff) |
expand complex cascading conditional operator
Change-Id: I5702b1acd214d7ef862d72fa1a0a0dc8a09c351e
Reviewed-on: https://gerrit.libreoffice.org/12998
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
-rw-r--r-- | sw/source/core/layout/flycnt.cxx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index b23b6190e71c..68d3e5824d7c 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -562,16 +562,17 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet, //Follow the text flow. // #i70582# // --> OD 2009-03-05 - adopted for Support for Classical Mongolian Script - const SwTwips nTopForObjPos = - bVert - ? ( bVertL2R - ? ( pCnt->Frm().Left() + - pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) - : ( pCnt->Frm().Left() + - pCnt->Frm().Width() - - pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) ) - : ( pCnt->Frm().Top() + - pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ); + SwTwips nTopForObjPos; + if ( bVert ) + { + nTopForObjPos = pCnt->Frm().Left(); + if ( bVertL2R ) + nTopForObjPos += pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid(); + else + nTopForObjPos += pCnt->Frm().Width() - pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid(); + } + else + nTopForObjPos = pCnt->Frm().Top() + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid(); if ( pUp->Frm().IsInside( rPt ) ) { // <rPt> point is inside environment of given content frame |