Kaydet (Commit) d10f615c authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide: SwDrawTextInfo conversion in itratr.cxx

Change-Id: Ibce3ce21e3ddeb762d082b641a4f5d49099b1a6d
üst 416b5ba0
...@@ -771,7 +771,7 @@ static bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const OUString & ...@@ -771,7 +771,7 @@ static bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const OUString &
if( nStop > nEnd ) if( nStop > nEnd )
nStop = nEnd; nStop = nEnd;
SwDrawTextInfo aDrawInf( rArg.pSh, *rArg.pOut, nullptr, rText, nIdx, nStop - nIdx ); SwDrawTextInfo aDrawInf(rArg.pSh, *rArg.pOut, rText, nIdx, nStop - nIdx);
long nCurrentWidth = pFnt->GetTextSize_( aDrawInf ).Width(); long nCurrentWidth = pFnt->GetTextSize_( aDrawInf ).Width();
rArg.nRowWidth += nCurrentWidth; rArg.nRowWidth += nCurrentWidth;
if( bClear ) if( bClear )
...@@ -1046,7 +1046,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM ...@@ -1046,7 +1046,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
{ {
OUString sTmp( cChar ); OUString sTmp( cChar );
SwDrawTextInfo aDrawInf( getIDocumentLayoutAccess().GetCurrentViewShell(), SwDrawTextInfo aDrawInf( getIDocumentLayoutAccess().GetCurrentViewShell(),
*pOut, nullptr, sTmp, 0, 1, 0, false ); *pOut, sTmp, 0, 1, 0, false );
nCurrentWidth = aIter.GetFnt()->GetTextSize_( aDrawInf ).Width(); nCurrentWidth = aIter.GetFnt()->GetTextSize_( aDrawInf ).Width();
aArg.nWordWidth += nCurrentWidth; aArg.nWordWidth += nCurrentWidth;
aArg.nRowWidth += nCurrentWidth; aArg.nRowWidth += nCurrentWidth;
...@@ -1269,7 +1269,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd ...@@ -1269,7 +1269,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd
// calculate text widths up to cChar // calculate text widths up to cChar
if ( nStop > nIdx ) if ( nStop > nIdx )
{ {
SwDrawTextInfo aDrawInf( pSh, *pOut, nullptr, GetText(), nIdx, nStop - nIdx ); SwDrawTextInfo aDrawInf(pSh, *pOut, GetText(), nIdx, nStop - nIdx);
nProWidth += aIter.GetFnt()->GetTextSize_( aDrawInf ).Width(); nProWidth += aIter.GetFnt()->GetTextSize_( aDrawInf ).Width();
} }
...@@ -1286,7 +1286,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd ...@@ -1286,7 +1286,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd
{ {
// tab receives width of one space // tab receives width of one space
OUString sTmp( CH_BLANK ); OUString sTmp( CH_BLANK );
SwDrawTextInfo aDrawInf( pSh, *pOut, nullptr, sTmp, 0, 1 ); SwDrawTextInfo aDrawInf( pSh, *pOut, sTmp, 0, 1 );
nProWidth += aIter.GetFnt()->GetTextSize_( aDrawInf ).Width(); nProWidth += aIter.GetFnt()->GetTextSize_( aDrawInf ).Width();
nIdx++; nIdx++;
} }
...@@ -1295,7 +1295,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd ...@@ -1295,7 +1295,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd
else if ( cChar == CHAR_HARDBLANK || cChar == CHAR_HARDHYPHEN ) else if ( cChar == CHAR_HARDBLANK || cChar == CHAR_HARDHYPHEN )
{ {
OUString sTmp( cChar ); OUString sTmp( cChar );
SwDrawTextInfo aDrawInf( pSh, *pOut, nullptr, sTmp, 0, 1 ); SwDrawTextInfo aDrawInf( pSh, *pOut, sTmp, 0, 1 );
nProWidth += aIter.GetFnt()->GetTextSize_( aDrawInf ).Width(); nProWidth += aIter.GetFnt()->GetTextSize_( aDrawInf ).Width();
nIdx++; nIdx++;
} }
...@@ -1306,7 +1306,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd ...@@ -1306,7 +1306,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd
case RES_TXTATR_FTN : case RES_TXTATR_FTN :
{ {
const OUString aText = pHint->GetFootnote().GetNumStr(); const OUString aText = pHint->GetFootnote().GetNumStr();
SwDrawTextInfo aDrawInf( pSh, *pOut, nullptr, aText, 0, aText.getLength() ); SwDrawTextInfo aDrawInf(pSh, *pOut, aText, 0, aText.getLength());
nProWidth += aIter.GetFnt()->GetTextSize_( aDrawInf ).Width(); nProWidth += aIter.GetFnt()->GetTextSize_( aDrawInf ).Width();
break; break;
...@@ -1317,7 +1317,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd ...@@ -1317,7 +1317,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd
{ {
SwField *pField = const_cast<SwField*>(pHint->GetFormatField().GetField()); SwField *pField = const_cast<SwField*>(pHint->GetFormatField().GetField());
OUString const aText = pField->ExpandField(true); OUString const aText = pField->ExpandField(true);
SwDrawTextInfo aDrawInf( pSh, *pOut, nullptr, aText, 0, aText.getLength() ); SwDrawTextInfo aDrawInf(pSh, *pOut, aText, 0, aText.getLength());
nProWidth += aIter.GetFnt()->GetTextSize_( aDrawInf ).Width(); nProWidth += aIter.GetFnt()->GetTextSize_( aDrawInf ).Width();
break; break;
...@@ -1364,7 +1364,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd ...@@ -1364,7 +1364,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd
aIter.SeekAndChgAttrIter( nStt, pOut ); aIter.SeekAndChgAttrIter( nStt, pOut );
pOut->SetMapMode( aOldMap ); pOut->SetMapMode( aOldMap );
SwDrawTextInfo aDrawInf( pSh, *pOut, nullptr, GetText(), nStt, 1 ); SwDrawTextInfo aDrawInf( pSh, *pOut, GetText(), nStt, 1 );
return static_cast<sal_uInt16>( nWidth ? ((100 * aIter.GetFnt()->GetTextSize_( aDrawInf ).Height()) / nWidth ) : 0 ); return static_cast<sal_uInt16>( nWidth ? ((100 * aIter.GetFnt()->GetTextSize_( aDrawInf ).Height()) / nWidth ) : 0 );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment