summaryrefslogtreecommitdiff
path: root/vcl/source/control/combobox.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-21 15:54:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-05-22 13:17:30 +0200
commitc200aa27ee4a0f5a89af6e970c2c22580029eded (patch)
tree3988c0c756df2d1eb182c50ad1dc0e226d2ecf14 /vcl/source/control/combobox.cxx
parentaf6561532832615f39b5ea82aa5d9b3e240784e8 (diff)
remove Size arg from Window::Draw and depend on GetSizePixel
90% of cases pass GetSizePixel as the Size arg already and this aligns Window::Draw with how Window::PaintToDevice works Change-Id: If5b024179a4b7a3b099177c2f6d4b1fb006b95ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94644 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/control/combobox.cxx')
-rw-r--r--vcl/source/control/combobox.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 1ca1d398a676..18913f77eafd 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -1145,12 +1145,12 @@ void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines
}
}
-void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags )
+void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags )
{
m_pImpl->m_pImplLB->GetMainWindow()->ApplySettings(*pDev);
Point aPos = pDev->LogicToPixel( rPos );
- Size aSize = pDev->LogicToPixel( rSize );
+ Size aSize = GetSizePixel();
vcl::Font aFont = m_pImpl->m_pImplLB->GetMainWindow()->GetDrawPixelFont( pDev );
pDev->Push();
@@ -1187,7 +1187,10 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, D
DrawTextFlags nTextStyle = DrawTextFlags::VCenter;
// First, draw the edit part
- m_pImpl->m_pSubEdit->Draw( pDev, aPos, Size( aSize.Width(), nEditHeight ), nFlags );
+ Size aOrigSize(m_pImpl->m_pSubEdit->GetSizePixel());
+ m_pImpl->m_pSubEdit->SetSizePixel(Size(aSize.Width(), nEditHeight));
+ m_pImpl->m_pSubEdit->Draw( pDev, aPos, nFlags );
+ m_pImpl->m_pSubEdit->SetSizePixel(aOrigSize);
// Second, draw the listbox
if ( GetStyle() & WB_CENTER )
@@ -1242,10 +1245,12 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, D
// Call Edit::Draw after restoring the MapMode...
if ( IsDropDownBox() )
{
- m_pImpl->m_pSubEdit->Draw( pDev, rPos, rSize, nFlags );
+ Size aOrigSize(m_pImpl->m_pSubEdit->GetSizePixel());
+ m_pImpl->m_pSubEdit->SetSizePixel(GetSizePixel());
+ m_pImpl->m_pSubEdit->Draw( pDev, rPos, nFlags );
+ m_pImpl->m_pSubEdit->SetSizePixel(aOrigSize);
// DD-Button ?
}
-
}
void ComboBox::SetUserDrawHdl(const Link<UserDrawEvent*, void>& rLink)