summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-11-20 21:20:15 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-11-21 15:45:02 +0100
commit4ea7a6f4f4a885dbf7c17e0738df45396da685bf (patch)
treede10905526558e51379a8603688dd74326c1aaea
parent0469d54c22d691a70eca407421306192a4ae0a12 (diff)
expand complex cascading conditional operator
Change-Id: I315f3a929a465c9fd0ec91999e947afcd08f1522
-rw-r--r--sw/source/ui/vba/vbatablehelper.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx
index 8dda034c0f7d..5c3906262189 100644
--- a/sw/source/ui/vba/vbatablehelper.cxx
+++ b/sw/source/ui/vba/vbatablehelper.cxx
@@ -208,10 +208,16 @@ sal_Int32 SwVbaTableHelper::GetColWidth( SwTabCols& rCols, sal_Int32 nNum ) thro
{
if(rCols.Count() == static_cast<size_t>(GetColCount( rCols )))
{
- nWidth = ((static_cast<size_t>(nNum) == rCols.Count()) ?
- rCols.GetRight() - rCols[nNum-1] :
- nNum == 0 ? rCols[nNum] - rCols.GetLeft() :
- rCols[nNum] - rCols[nNum-1]);
+ if(static_cast<size_t>(nNum) == rCols.Count())
+ nWidth = rCols.GetRight() - rCols[nNum-1];
+ else
+ {
+ nWidth = rCols[nNum];
+ if(nNum == 0)
+ nWidth -= rCols.GetLeft();
+ else
+ nWidth -= rCols[nNum-1];
+ }
}
else
{