[Libreoffice-commits] core.git: 2 commits - sw/source
Bjoern Michaelsen
bjoern.michaelsen at canonical.com
Thu Nov 20 10:21:58 PST 2014
sw/source/core/text/frmcrsr.cxx | 14 ++++++++++----
sw/source/core/txtnode/thints.cxx | 21 +++++++++++++--------
2 files changed, 23 insertions(+), 12 deletions(-)
New commits:
commit 2d78288637281f17862c3d155430629025c3afd5
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Thu Nov 20 01:01:44 2014 +0100
expand complex cascading conditional operator
Change-Id: Ide0224156e8246768c62d69f0cfa864068f0d1ed
Reviewed-on: https://gerrit.libreoffice.org/13002
Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 5ec497a..7cab8d8 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();
commit 907366ac2063e73aa6018a9e938dd079e858c648
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Thu Nov 20 00:36:01 2014 +0100
expand complex cascading conditional operator
Change-Id: Ia139d06e04e04871373b9413a4f6386e87738df5
Reviewed-on: https://gerrit.libreoffice.org/13001
Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index b18d2bf..445720f 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -368,10 +368,16 @@ bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
SwTwips nUpperMaxY = (pTmpFrm->*fnRect->fnGetPrtBottom)();
// nMaxY is in absolute value
- SwTwips nMaxY = bVert ?
- ( bVertL2R ? std::min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) : std::max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) ) :
- std::min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
-
+ SwTwips nMaxY;
+ if ( bVert )
+ {
+ if ( bVertL2R )
+ nMaxY = std::min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
+ else
+ nMaxY = std::max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
+ }
+ else
+ nMaxY = std::min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
if ( pFrm->IsEmpty() || ! (pFrm->Prt().*fnRect->fnGetHeight)() )
{
Point aPnt1 = pFrm->Frm().Pos() + pFrm->Prt().Pos();
More information about the Libreoffice-commits
mailing list