summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-11-19 23:47:35 +0100
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2014-11-20 18:19:50 +0000
commit99099bb59a19a8367cb9c7c68470a31b09089144 (patch)
tree3941645af585f7ab859230686aeb99fb7fdfe9c4 /sw
parent833936eb526fed3de821247e42198e068c962607 (diff)
expand complex cascading conditional operator
Change-Id: I290797eba555617e39ced5ba8e6c209fd6d0780f Reviewed-on: https://gerrit.libreoffice.org/12996 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/flycnt.cxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 4aae102067b4..f09b010e47be 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -1202,16 +1202,19 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
if ( pCnt->Frm().IsInside( aNew ) )
{
// #i70582#
- 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( bVert )
{
if ( bVertL2R )