Use OutputDevice::ScopedPush in various

Change-Id: I1eb4340c603bae6a62fa676534ffb21fe2316649
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189806
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2025-08-17 09:44:41 +02:00
parent f70e18ab72
commit b68633e21c
13 changed files with 29 additions and 57 deletions
@@ -436,10 +436,9 @@ namespace frm
tools::Long nFontWidth = m_pEngine->GetStandardFont(0).GetFontSize().Width();
if ( !nFontWidth )
{
m_pViewport->GetOutDev()->Push( vcl::PushFlags::FONT );
auto popIt = m_pViewport->GetOutDev()->ScopedPush(vcl::PushFlags::FONT);
m_pViewport->SetFont( m_pEngine->GetStandardFont(0) );
nFontWidth = m_pViewport->GetTextWidth( u"x"_ustr );
m_pViewport->GetOutDev()->Pop();
}
// ... is the scroll size for the horizontal scrollbar
m_pHScroll->SetLineSize( 5 * nFontWidth );
@@ -551,7 +550,7 @@ namespace frm
{
// need to normalize the map mode of the device - every paint operation on any device needs
// to use the same map mode
_pDev->Push( vcl::PushFlags::MAPMODE | vcl::PushFlags::LINECOLOR | vcl::PushFlags::FILLCOLOR );
auto popIt = _pDev->ScopedPush(vcl::PushFlags::MAPMODE | vcl::PushFlags::LINECOLOR | vcl::PushFlags::FILLCOLOR);
// enforce our "normalize map mode" on the device
MapMode aRefMapMode( m_pEngine->GetRefDevice()->GetMapMode() );
@@ -602,8 +601,6 @@ namespace frm
// actually draw the content
m_pEngine->DrawText_ToRectangle(*_pDev, aPlayground, Point(), true);
_pDev->Pop();
}