summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-21 13:01:50 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-12-07 10:32:29 +0100
commit1f1aebabaa97951aae38de51e8abf5f6aab9c944 (patch)
treef845b2d17eee368fd7e1e528eb0167e61bf65ad0
parent570037ddd5f46b0ef6cc8b100dda0aefbb50fbb6 (diff)
sw_redlinehide_4a: convert SwTextNode::GetMinMaxSize()
Change-Id: I1ac09d3dfd95f2a98142c4bfe51aad04926e2d38 (cherry picked from commit 6b54554d93bb0683ae63836a85975f0b17bd1324)
-rw-r--r--sw/source/core/text/itratr.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 4879f4c2cecb..458212f8fd17 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -835,7 +835,7 @@ bool SwTextNode::IsSymbolAt(const sal_Int32 nBegin) const
{
SwScriptInfo aScriptInfo;
SwAttrIter aIter( *const_cast<SwTextNode*>(this), aScriptInfo );
- aIter.Seek( nBegin );
+ aIter.Seek( TextFrameIndex(nBegin) );
return aIter.GetFnt()->IsSymbol( getIDocumentLayoutAccess().GetCurrentViewShell() );
}
@@ -976,6 +976,7 @@ static void lcl_MinMaxNode( SwFrameFormat* pNd, SwMinMaxNodeArgs* pIn )
/**
* Changing this method very likely requires changing of GetScalingOfSelectedText
+ * This one is called exclusively from import filters, so there is no layout.
*/
void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMax,
sal_uLong& rAbsMin ) const
@@ -1032,23 +1033,23 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
SwScriptInfo aScriptInfo;
SwAttrIter aIter( *const_cast<SwTextNode*>(this), aScriptInfo );
- sal_Int32 nIdx = 0;
+ TextFrameIndex nIdx(0);
aIter.SeekAndChgAttrIter( nIdx, pOut );
- sal_Int32 nLen = m_Text.getLength();
+ TextFrameIndex nLen(m_Text.getLength());
long nCurrentWidth = 0;
long nAdd = 0;
SwMinMaxArgs aArg( pOut, pSh, rMin, rAbsMin );
while( nIdx < nLen )
{
- sal_Int32 nNextChg = aIter.GetNextAttr();
- sal_Int32 nStop = aScriptInfo.NextScriptChg( nIdx );
+ TextFrameIndex nNextChg = aIter.GetNextAttr();
+ TextFrameIndex nStop = aScriptInfo.NextScriptChg( nIdx );
if( nNextChg > nStop )
nNextChg = nStop;
SwTextAttr *pHint = nullptr;
sal_Unicode cChar = CH_BLANK;
nStop = nIdx;
while( nStop < nLen && nStop < nNextChg &&
- CH_TAB != ( cChar = m_Text[nStop] ) &&
+ CH_TAB != (cChar = m_Text[sal_Int32(nStop)]) &&
CH_BREAK != cChar && CHAR_HARDBLANK != cChar &&
CHAR_HARDHYPHEN != cChar && CHAR_SOFTHYPHEN != cChar &&
!pHint )
@@ -1057,7 +1058,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
|| ( nullptr == ( pHint = aIter.GetAttr( nStop ) ) ) )
++nStop;
}
- if ( lcl_MinMaxString( aArg, aIter.GetFnt(), m_Text, nIdx, nStop ) )
+ if (lcl_MinMaxString(aArg, aIter.GetFnt(), m_Text, sal_Int32(nIdx), sal_Int32(nStop)))
{
nAdd = 20;
}
@@ -1087,7 +1088,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
case CHAR_HARDHYPHEN:
{
OUString sTmp( cChar );
- SwDrawTextInfo aDrawInf( getIDocumentLayoutAccess().GetCurrentViewShell(),
+ SwDrawTextInfo aDrawInf( pSh,
*pOut, sTmp, 0, 1, 0, false );
nCurrentWidth = aIter.GetFnt()->GetTextSize_( aDrawInf ).Width();
aArg.nWordWidth += nCurrentWidth;
@@ -1095,7 +1096,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
if( static_cast<long>(rAbsMin) < aArg.nWordWidth )
rAbsMin = aArg.nWordWidth;
aArg.Minimum( aArg.nWordWidth + aArg.nWordAdd );
- aArg.nNoLineBreak = nIdx++;
+ aArg.nNoLineBreak = sal_Int32(nIdx++);
}
break;
case CH_TXTATR_BREAKWORD:
@@ -1161,8 +1162,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
case RES_TXTATR_ANNOTATION :
{
SwField *pField = const_cast<SwField*>(pHint->GetFormatField().GetField());
- const OUString aText = pField->ExpandField(true,
- pSh ? pSh->GetLayout() : nullptr);
+ const OUString aText = pField->ExpandField(true, nullptr);
if( lcl_MinMaxString( aArg, aIter.GetFnt(), aText, 0,
aText.getLength() ) )
nAdd = 20;