diff options
author | Noel Grandin <noel@peralex.com> | 2015-02-13 13:31:57 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-02-16 06:38:42 +0000 |
commit | 9f8ffc8dfed61eb8460d92ce85b20effe5114f87 (patch) | |
tree | 22345276a060d99201fa271486b785a5b56dc87b /vcl/generic | |
parent | 031166e43ff2e476df5158ff3e6e631b0c346441 (diff) |
add GetSelectEntryData to ListBox and ComboBox
to reduce code clutter like
pLbSelect->GetEntryData(pLbSelect->GetSelectEntryPos())
since this is a fairly frequent operation.
Change-Id: I41daf30fdeda2442ad1ac829e12f553233bae184
Reviewed-on: https://gerrit.libreoffice.org/14472
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/generic')
-rw-r--r-- | vcl/generic/print/prtsetup.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx index 7118850236b1..a2e5255a64fe 100644 --- a/vcl/generic/print/prtsetup.cxx +++ b/vcl/generic/print/prtsetup.cxx @@ -260,8 +260,7 @@ IMPL_LINK( RTSPaperPage, SelectHdl, ListBox*, pBox ) } if( pKey ) { - PPDValue* pValue = - (PPDValue*)pBox->GetEntryData( pBox->GetSelectEntryPos() ); + PPDValue* pValue = (PPDValue*)pBox->GetSelectEntryData(); m_pParent->m_aJobData.m_aContext.setValue( pKey, pValue ); update(); } @@ -390,7 +389,7 @@ sal_uLong RTSDevicePage::getColorDevice() sal_uLong RTSDevicePage::getLevel() { - sal_uLong nLevel = reinterpret_cast<sal_uLong>(m_pLevelBox->GetEntryData( m_pLevelBox->GetSelectEntryPos() )); + sal_uLong nLevel = reinterpret_cast<sal_uLong>(m_pLevelBox->GetSelectEntryData()); if (nLevel == 0) return 0; //automatic return nLevel < 10 ? nLevel-1 : 0; @@ -398,7 +397,7 @@ sal_uLong RTSDevicePage::getLevel() sal_uLong RTSDevicePage::getPDFDevice() { - sal_uLong nLevel = reinterpret_cast<sal_uLong>(m_pLevelBox->GetEntryData( m_pLevelBox->GetSelectEntryPos() )); + sal_uLong nLevel = reinterpret_cast<sal_uLong>(m_pLevelBox->GetSelectEntryData()); if (nLevel > 9) return 2; //explicitly PDF else if (nLevel == 0) @@ -419,13 +418,13 @@ IMPL_LINK( RTSDevicePage, SelectHdl, ListBox*, pBox ) { if( pBox == m_pPPDKeyBox ) { - const PPDKey* pKey = (PPDKey*)m_pPPDKeyBox->GetEntryData( m_pPPDKeyBox->GetSelectEntryPos() ); + const PPDKey* pKey = (PPDKey*)m_pPPDKeyBox->GetSelectEntryData(); FillValueBox( pKey ); } else if( pBox == m_pPPDValueBox ) { - const PPDKey* pKey = (PPDKey*)m_pPPDKeyBox->GetEntryData( m_pPPDKeyBox->GetSelectEntryPos() ); - const PPDValue* pValue = (PPDValue*)m_pPPDValueBox->GetEntryData( m_pPPDValueBox->GetSelectEntryPos() ); + const PPDKey* pKey = (PPDKey*)m_pPPDKeyBox->GetSelectEntryData(); + const PPDValue* pValue = (PPDValue*)m_pPPDValueBox->GetSelectEntryData(); if (pKey && pValue) { m_pParent->m_aJobData.m_aContext.setValue( pKey, pValue ); |