summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-11-20 01:01:44 +0100
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2014-11-20 18:21:39 +0000
commit2d78288637281f17862c3d155430629025c3afd5 (patch)
tree3b4271fd0a36866b05268e948bb7816701e8961c
parent907366ac2063e73aa6018a9e938dd079e858c648 (diff)
expand complex cascading conditional operator
Change-Id: Ide0224156e8246768c62d69f0cfa864068f0d1ed Reviewed-on: https://gerrit.libreoffice.org/13002 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
-rw-r--r--sw/source/core/txtnode/thints.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 5ec497a734d7..7cab8d826446 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -3405,15 +3405,20 @@ sal_uInt16 SwTxtNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen,
const sal_Int32 *pEndIdx = pHt->End();
// Ueberlappt das Attribut den Bereich?
- if (!pEndIdx)
+ if( !pEndIdx )
continue;
-
- if( nLen ? ( nAttrStart < nEnd && nBegin < *pEndIdx )
- : (( nAttrStart < nBegin &&
- ( pHt->DontExpand() ? nBegin < *pEndIdx
- : nBegin <= *pEndIdx )) ||
- ( nBegin == nAttrStart &&
- ( nAttrStart == *pEndIdx || !nBegin ))) )
+ if( nLen )
+ {
+ if( nAttrStart >= nEnd || nBegin >= *pEndIdx )
+ continue;
+ }
+ else if( nBegin != nAttrStart || ( nAttrStart != *pEndIdx && nBegin ))
+ {
+ if( nAttrStart >= nBegin )
+ continue;
+ if( pHt->DontExpand() ? nBegin >= *pEndIdx : nBegin > *pEndIdx)
+ continue;
+ }
{
const SfxPoolItem* pItem = CharFmt::GetItem( *pHt, nWhichId );
const sal_uInt16 nLng = ((SvxLanguageItem*)pItem)->GetLanguage();