diff options
-rw-r--r-- | editeng/source/accessibility/AccessibleStringWrap.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 40 | ||||
-rw-r--r-- | editeng/source/items/svxfont.cxx | 46 | ||||
-rw-r--r-- | include/editeng/svxfont.hxx | 8 | ||||
-rw-r--r-- | svx/source/dialog/fntctrl.cxx | 6 | ||||
-rw-r--r-- | svx/source/styles/CommonStylePreviewRenderer.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/chrdlg/drpcps.cxx | 2 |
8 files changed, 52 insertions, 56 deletions
diff --git a/editeng/source/accessibility/AccessibleStringWrap.cxx b/editeng/source/accessibility/AccessibleStringWrap.cxx index de11c4a0732c..77149d1df70d 100644 --- a/editeng/source/accessibility/AccessibleStringWrap.cxx +++ b/editeng/source/accessibility/AccessibleStringWrap.cxx @@ -43,7 +43,7 @@ void AccessibleStringWrap::GetCharacterBounds( sal_Int32 nIndex, tools::Rectangl DBG_ASSERT(nIndex >= 0, "SvxAccessibleStringWrap::GetCharacterBounds: index value overflow"); - mrFont.SetPhysFont( &mrDev ); + mrFont.SetPhysFont(mrDev); // #108900# Handle virtual position one-past-the end of the string if( nIndex >= maText.getLength() ) diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index dbf4017542cb..76285d237fd8 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -3186,7 +3186,7 @@ sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, { SvxFont aTmpFont( pPortion->GetNode()->GetCharAttribs().GetDefFont() ); SeekCursor( pPortion->GetNode(), nPos+1, aTmpFont ); - aTmpFont.SetPhysFont( GetRefDevice() ); + aTmpFont.SetPhysFont(*GetRefDevice()); ImplInitDigitMode(*GetRefDevice(), aTmpFont.GetLanguage()); nWidth += aTmpFont.QuickGetTextSize( GetRefDevice(), pPortion->GetNode()->GetString(), nPos, rTextPortion.GetLen() ).Width(); } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 907b7493d403..454f65286416 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -829,7 +829,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) if ( !bSameLineAgain ) { SeekCursor( pNode, nTmpPos+1, aTmpFont ); - aTmpFont.SetPhysFont( GetRefDevice() ); + aTmpFont.SetPhysFont(*GetRefDevice()); ImplInitDigitMode(*GetRefDevice(), aTmpFont.GetLanguage()); if ( IsFixedCellHeight() ) @@ -1042,7 +1042,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) case EE_FEATURE_FIELD: { SeekCursor( pNode, nTmpPos+1, aTmpFont ); - aTmpFont.SetPhysFont( GetRefDevice() ); + aTmpFont.SetPhysFont(*GetRefDevice()); ImplInitDigitMode(*GetRefDevice(), aTmpFont.GetLanguage()); OUString aFieldValue = static_cast<const EditCharAttribField*>(pNextFeature)->GetFieldValue(); @@ -1145,7 +1145,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) { DBG_ASSERT( nPortionLen || bProcessingEmptyLine, "Empty Portion - Extra Space?!" ); SeekCursor( pNode, nTmpPos+1, aTmpFont ); - aTmpFont.SetPhysFont( GetRefDevice() ); + aTmpFont.SetPhysFont(*GetRefDevice()); ImplInitDigitMode(*GetRefDevice(), aTmpFont.GetLanguage()); if (!bContinueLastPortion) @@ -1371,7 +1371,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) if ( aTextSize.Height() == 0 ) { SeekCursor( pNode, pLine->GetStart()+1, aTmpFont ); - aTmpFont.SetPhysFont( pRefDev ); + aTmpFont.SetPhysFont(*pRefDev); ImplInitDigitMode(*pRefDev, aTmpFont.GetLanguage()); if ( IsFixedCellHeight() ) @@ -1393,7 +1393,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) if ( rTP.GetKind() != PortionKind::LINEBREAK ) { SeekCursor( pNode, nTPos+1, aTmpFont ); - aTmpFont.SetPhysFont( GetRefDevice() ); + aTmpFont.SetPhysFont(*GetRefDevice()); ImplInitDigitMode(*GetRefDevice(), aTmpFont.GetLanguage()); RecalcFormatterFontMetrics( aFormatterMetrics, aTmpFont ); } @@ -1707,7 +1707,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion ) SvxFont aTmpFont; SeekCursor( pParaPortion->GetNode(), bLineBreak ? pParaPortion->GetNode()->Len() : 0, aTmpFont ); - aTmpFont.SetPhysFont( pRefDev ); + aTmpFont.SetPhysFont(*pRefDev); TextPortion* pDummyPortion = new TextPortion( 0 ); pDummyPortion->GetSize() = aTmpFont.GetPhysTxtSize( pRefDev ); @@ -2070,7 +2070,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te // Determine the width of the Hyph-Portion: SvxFont aFont; SeekCursor( pParaPortion->GetNode(), nBreakPos, aFont ); - aFont.SetPhysFont( GetRefDevice() ); + aFont.SetPhysFont(*GetRefDevice()); pHyphPortion->GetSize().setHeight( GetRefDevice()->GetTextHeight() ); pHyphPortion->GetSize().setWidth( GetRefDevice()->GetTextWidth( CH_HYPH ) ); @@ -2368,7 +2368,7 @@ sal_Int32 ImpEditEngine::SplitTextPortion( ParaPortion* pPortion, sal_Int32 nPos sal_Int32 nTxtPortionStart = pPortion->GetTextPortions().GetStartPos( nSplitPortion ); SvxFont aTmpFont( pPortion->GetNode()->GetCharAttribs().GetDefFont() ); SeekCursor( pPortion->GetNode(), nTxtPortionStart+1, aTmpFont ); - aTmpFont.SetPhysFont( GetRefDevice() ); + aTmpFont.SetPhysFont(*GetRefDevice()); GetRefDevice()->Push( PushFlags::TEXTLANGUAGE ); ImplInitDigitMode(*GetRefDevice(), aTmpFont.GetLanguage()); Size aSz = aTmpFont.QuickGetTextSize( GetRefDevice(), pPortion->GetNode()->GetString(), nTxtPortionStart, pTextPortion->GetLen() ); @@ -2760,7 +2760,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo // For the current Output device, because otherwise if RefDev=Printer its looks // ugly on the screen! OutputDevice* pDev = pOut ? pOut : GetRefDevice(); - rFont.SetPhysFont( pDev ); + rFont.SetPhysFont(*pDev); FontMetric aMetric( pDev->GetFontMetric() ); // before forcing nPropr to 100%, calculate a new escapement relative to this fake size. @@ -2891,7 +2891,7 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics if ( nPropr != 100 ) { rFont.SetPropr( 100 ); - rFont.SetPhysFont( pRefDev ); + rFont.SetPhysFont(*pRefDev); } sal_uInt16 nAscent, nDescent; @@ -2915,7 +2915,7 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics { // Lets see what Leading one gets on the screen VclPtr<VirtualDevice> pVDev = GetVirtualDevice( pRefDev->GetMapMode(), pRefDev->GetDrawMode() ); - rFont.SetPhysFont( pVDev ); + rFont.SetPhysFont(*pVDev); aMetric = pVDev->GetFontMetric(); // This is so that the Leading does not count itself out again, @@ -3189,7 +3189,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po aTmpFont.SetTransparent( sal_False ); } #endif - aTmpFont.SetPhysFont( &rOutDev ); + aTmpFont.SetPhysFont(rOutDev); // #114278# Saving both layout mode and language (since I'm // potentially changing both) @@ -3263,7 +3263,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po aTmpFont.SetEscapement( -20 ); aTmpFont.SetPropr( 25 ); - aTmpFont.SetPhysFont( &rOutDev ); + aTmpFont.SetPhysFont(rOutDev); const Size aSlashSize = aTmpFont.QuickGetTextSize( &rOutDev, aSlash, 0, 1 ); Point aSlashPos( aTmpPos ); @@ -3275,7 +3275,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po aTmpFont.SetEscapement( nOldEscapement ); aTmpFont.SetPropr( nOldPropr ); - aTmpFont.SetPhysFont( &rOutDev ); + aTmpFont.SetPhysFont(rOutDev); } } } @@ -3333,7 +3333,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po pTmpDXArray.reset(new tools::Long[ aText.getLength() ]); pDXArray = pTmpDXArray.get(); - aTmpFont.SetPhysFont( GetRefDevice() ); + aTmpFont.SetPhysFont(*GetRefDevice()); aTmpFont.QuickGetTextSize( GetRefDevice(), aText, nTextStart, nTextLen, pTmpDXArray.get() ); // add a meta file comment if we record to a metafile @@ -3360,7 +3360,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po // crash when accessing 0 pointer in pDXArray pTmpDXArray.reset(new tools::Long[ aText.getLength() ]); pDXArray = pTmpDXArray.get(); - aTmpFont.SetPhysFont( GetRefDevice() ); + aTmpFont.SetPhysFont(*GetRefDevice()); aTmpFont.QuickGetTextSize( GetRefDevice(), aText, 0, aText.getLength(), pTmpDXArray.get() ); } @@ -3488,7 +3488,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po aOutPos = lcl_ImplCalcRotatedPos( aOutPos, aOrigin, nSin, nCos ); aTmpFont.SetOrientation( aTmpFont.GetOrientation()+nOrientation ); - aTmpFont.SetPhysFont( &rOutDev ); + aTmpFont.SetPhysFont(rOutDev); } @@ -3529,7 +3529,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po sal_uInt8 nProp = aTmpFont.GetPropr(); aTmpFont.SetEscapement( 0 ); aTmpFont.SetPropr( 100 ); - aTmpFont.SetPhysFont( &rOutDev ); + aTmpFont.SetPhysFont(rOutDev); OUStringBuffer aBlanks; comphelper::string::padToLength( aBlanks, nTextLen, ' ' ); Point aUnderlinePos( aOutPos ); @@ -3541,7 +3541,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po if ( !nOrientation ) aTmpFont.SetEscapement( nEsc ); aTmpFont.SetPropr( nProp ); - aTmpFont.SetPhysFont( &rOutDev ); + aTmpFont.SetPhysFont(rOutDev); } } Point aRealOutPos( aOutPos ); @@ -3652,7 +3652,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po SeekCursor( rPortion.GetNode(), nIndex+1, aTmpFont, &rOutDev ); aTmpFont.SetTransparent( false ); aTmpFont.SetEscapement( 0 ); - aTmpFont.SetPhysFont( &rOutDev ); + aTmpFont.SetPhysFont(rOutDev); tools::Long nCharWidth = aTmpFont.QuickGetTextSize( &rOutDev, OUString(rTextPortion.GetExtraValue()), 0, 1 ).Width(); sal_Int32 nChars = 2; diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx index 61039b316ac6..f92c6851a8f3 100644 --- a/editeng/source/items/svxfont.cxx +++ b/editeng/source/items/svxfont.cxx @@ -371,13 +371,13 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo) const } -void SvxFont::SetPhysFont( OutputDevice *pOut ) const +void SvxFont::SetPhysFont(OutputDevice& rOut) const { - const vcl::Font& rCurrentFont = pOut->GetFont(); + const vcl::Font& rCurrentFont = rOut.GetFont(); if ( nPropr == 100 ) { if ( !rCurrentFont.IsSameInstance( *this ) ) - pOut->SetFont( *this ); + rOut.SetFont( *this ); } else { @@ -386,19 +386,17 @@ void SvxFont::SetPhysFont( OutputDevice *pOut ) const aNewFont.SetFontSize( Size( aSize.Width() * nPropr / 100, aSize.Height() * nPropr / 100 ) ); if ( !rCurrentFont.IsSameInstance( aNewFont ) ) - pOut->SetFont( aNewFont ); + rOut.SetFont( aNewFont ); } } - -vcl::Font SvxFont::ChgPhysFont( OutputDevice *pOut ) const +vcl::Font SvxFont::ChgPhysFont(OutputDevice& rOut) const { - vcl::Font aOldFont( pOut->GetFont() ); - SetPhysFont( pOut ); + vcl::Font aOldFont(rOut.GetFont()); + SetPhysFont(rOut); return aOldFont; } - Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt, const sal_Int32 nIdx, const sal_Int32 nLen ) const { @@ -483,25 +481,23 @@ Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const OUString &rTxt, return aTxtSize; } - -Size SvxFont::GetTextSize( const OutputDevice *pOut, const OUString &rTxt, - const sal_Int32 nIdx, const sal_Int32 nLen ) const +Size SvxFont::GetTextSize(const OutputDevice& rOut, const OUString &rTxt, + const sal_Int32 nIdx, const sal_Int32 nLen) const { sal_Int32 nTmp = nLen; if ( nTmp == SAL_MAX_INT32 ) // already initialized? nTmp = rTxt.getLength(); - Font aOldFont( ChgPhysFont(const_cast<OutputDevice *>(pOut)) ); + Font aOldFont( ChgPhysFont(const_cast<OutputDevice&>(rOut))); Size aTxtSize; if( IsCapital() && !rTxt.isEmpty() ) { - aTxtSize = GetCapitalSize( pOut, rTxt, nIdx, nTmp ); + aTxtSize = GetCapitalSize(&rOut, rTxt, nIdx, nTmp); } - else aTxtSize = GetPhysTxtSize(pOut,rTxt,nIdx,nTmp); - const_cast<OutputDevice *>(pOut)->SetFont( aOldFont ); + else aTxtSize = GetPhysTxtSize(&rOut,rTxt,nIdx,nTmp); + const_cast<OutputDevice&>(rOut).SetFont(aOldFont); return aTxtSize; } - void SvxFont::QuickDrawText( OutputDevice *pOut, const Point &rPos, const OUString &rTxt, const sal_Int32 nIdx, const sal_Int32 nLen, const tools::Long* pDXArray ) const @@ -587,8 +583,8 @@ void SvxFont::DrawPrev( OutputDevice *pOut, Printer* pPrinter, Size aSize = GetFontSize(); aPos.AdjustY( -(( nTmpEsc * aSize.Height() ) / 100) ); } - Font aOldFont( ChgPhysFont( pOut ) ); - Font aOldPrnFont( ChgPhysFont( pPrinter ) ); + Font aOldFont( ChgPhysFont(*pOut) ); + Font aOldPrnFont( ChgPhysFont(*pPrinter) ); if ( IsCapital() ) DrawCapital( pOut, aPos, rTxt, nIdx, nTmp ); @@ -672,12 +668,12 @@ void SvxDoGetCapitalSize::Do( const OUString &_rTxt, const sal_Int32 _nIdx, { sal_uInt8 nProp = pFont->GetPropr(); pFont->SetProprRel( SMALL_CAPS_PERCENTAGE ); - pFont->SetPhysFont( pOut ); + pFont->SetPhysFont( *pOut ); aPartSize.setWidth( pOut->GetTextWidth( _rTxt, _nIdx, _nLen ) ); aPartSize.setHeight( pOut->GetTextHeight() ); aTxtSize.setHeight( aPartSize.Height() ); pFont->SetPropr( nProp ); - pFont->SetPhysFont( pOut ); + pFont->SetPhysFont( *pOut ); } else { @@ -744,11 +740,11 @@ void SvxDoDrawCapital::DoSpace( const bool bDraw ) bool bTrans = pFont->IsTransparent(); pFont->SetWordLineMode( false ); pFont->SetTransparent( true ); - pFont->SetPhysFont( pOut ); + pFont->SetPhysFont(*pOut); pOut->DrawStretchText( aSpacePos, nDiff, " ", 0, 2 ); pFont->SetWordLineMode( bWordWise ); pFont->SetTransparent( bTrans ); - pFont->SetPhysFont( pOut ); + pFont->SetPhysFont(*pOut); } } @@ -774,7 +770,7 @@ void SvxDoDrawCapital::Do( const OUString &_rTxt, const sal_Int32 _nIdx, nProp = pFont->GetPropr(); pFont->SetProprRel( SMALL_CAPS_PERCENTAGE ); } - pFont->SetPhysFont( pOut ); + pFont->SetPhysFont(*pOut); aPartSize.setWidth( pOut->GetTextWidth( _rTxt, _nIdx, _nLen ) ); aPartSize.setHeight( pOut->GetTextHeight() ); @@ -791,7 +787,7 @@ void SvxDoDrawCapital::Do( const OUString &_rTxt, const sal_Int32 _nIdx, pFont->SetStrikeout( eStrike ); if ( !bUpper ) pFont->SetPropr( nProp ); - pFont->SetPhysFont( pOut ); + pFont->SetPhysFont(*pOut); aPos.AdjustX(nWidth-(nKern/2) ); } diff --git a/include/editeng/svxfont.hxx b/include/editeng/svxfont.hxx index b385ada1592d..5174e482bf1a 100644 --- a/include/editeng/svxfont.hxx +++ b/include/editeng/svxfont.hxx @@ -78,8 +78,8 @@ public: // Handle upper case letters void DoOnCapitals(SvxDoCapitals &rDo) const; - void SetPhysFont( OutputDevice *pOut ) const; - vcl::Font ChgPhysFont( OutputDevice *pOut ) const; + void SetPhysFont(OutputDevice& rOut) const; + vcl::Font ChgPhysFont(OutputDevice& rOut) const; Size GetCapitalSize( const OutputDevice *pOut, const OUString &rTxt, const sal_Int32 nIdx, const sal_Int32 nLen) const; @@ -91,8 +91,8 @@ public: Size GetPhysTxtSize( const OutputDevice *pOut ); - Size GetTextSize( const OutputDevice *pOut, const OUString &rTxt, - const sal_Int32 nIdx = 0, const sal_Int32 nLen = SAL_MAX_INT32 ) const; + Size GetTextSize(const OutputDevice& rOut, const OUString &rTxt, + const sal_Int32 nIdx = 0, const sal_Int32 nLen = SAL_MAX_INT32) const; void QuickDrawText( OutputDevice *pOut, const Point &rPos, const OUString &rTxt, const sal_Int32 nIdx = 0, const sal_Int32 nLen = SAL_MAX_INT32, const tools::Long* pDXArray = nullptr ) const; diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index d2a99a367131..8dcbcebcd446 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -328,7 +328,7 @@ Size FontPrevWin_Impl::CalcTextSize(vcl::RenderContext& rRenderContext, OutputDe ((nScript == css::i18n::ScriptType::COMPLEX) ? maCTLFont : rInFont); - tools::Long nWidth = rFont.GetTextSize(_pPrinter, maText, nStart, nEnd - nStart).Width(); + tools::Long nWidth = rFont.GetTextSize(*_pPrinter, maText, nStart, nEnd - nStart).Width(); if (nIdx >= maTextWidth.size()) break; @@ -747,12 +747,12 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const tools::R if (pImpl->mcStartBracket) { OUString sBracket(pImpl->mcStartBracket); - nStartBracketWidth = rFont.GetTextSize(pPrinter, sBracket).Width(); + nStartBracketWidth = rFont.GetTextSize(*pPrinter, sBracket).Width(); } if (pImpl->mcEndBracket) { OUString sBracket(pImpl->mcEndBracket); - nEndBracketWidth = rFont.GetTextSize(pPrinter, sBracket).Width(); + nEndBracketWidth = rFont.GetTextSize(*pPrinter, sBracket).Width(); } nTextWidth = pImpl->CalcTextSize(rRenderContext, pPrinter, aSmallFont).Width(); tools::Long nResultWidth = nStartBracketWidth; diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx index 5ad1b8769ec7..65690bed792b 100644 --- a/svx/source/styles/CommonStylePreviewRenderer.cxx +++ b/svx/source/styles/CommonStylePreviewRenderer.cxx @@ -181,7 +181,7 @@ bool CommonStylePreviewRenderer::recalculate() Size CommonStylePreviewRenderer::getRenderSize() const { assert(m_pFont); - Size aPixelSize = m_pFont->GetTextSize(&mrOutputDev, maStyleName); + Size aPixelSize = m_pFont->GetTextSize(mrOutputDev, maStyleName); if (aPixelSize.Height() > mnMaxHeight) aPixelSize.setHeight( mnMaxHeight ); diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index ed9f3f6a75ac..9c42b44228e4 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -400,7 +400,7 @@ Size SwDropCapsPict::CalcTextSize() ? maCTLFont : maFont); - sal_uLong nWidth = rFnt.GetTextSize(mpPrinter, maText, nStart, nEnd-nStart ).Width(); + sal_uLong nWidth = rFnt.GetTextSize(*mpPrinter, maText, nStart, nEnd-nStart ).Width(); if (nIdx < maScriptChanges.size()) maScriptChanges[nIdx].textWidth = nWidth; |