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 /cui | |
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 'cui')
-rw-r--r-- | cui/source/dialogs/pastedlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/optgdlg.cxx | 6 | ||||
-rw-r--r-- | cui/source/options/optopencl.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/optsave.cxx | 6 | ||||
-rw-r--r-- | cui/source/tabpages/backgrnd.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/numpages.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/swpossizetabpage.cxx | 4 |
7 files changed, 11 insertions, 13 deletions
diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx index 85e49f637b09..0ce111ffdce0 100644 --- a/cui/source/dialogs/pastedlg.cxx +++ b/cui/source/dialogs/pastedlg.cxx @@ -201,7 +201,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper, if( Dialog::Execute() == RET_OK ) { - nSelFormat = reinterpret_cast<sal_uLong>(ObjectLB().GetEntryData( ObjectLB().GetSelectEntryPos() )); + nSelFormat = reinterpret_cast<sal_uLong>(ObjectLB().GetSelectEntryData()); } return nSelFormat; diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 512e8ad2c024..207addc847b7 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1254,7 +1254,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) // handle settings for UI Language // a change of setting needs to bring up a warning message OUString aLangString; - sal_Int32 d = (sal_Int32)reinterpret_cast<sal_IntPtr>(m_pUserInterfaceLB->GetEntryData(m_pUserInterfaceLB->GetSelectEntryPos())); + sal_Int32 d = (sal_Int32)reinterpret_cast<sal_IntPtr>(m_pUserInterfaceLB->GetSelectEntryData()); if( d > 0 && seqInstalledLanguages.getLength() > d-1) aLangString = seqInstalledLanguages[d-1]; @@ -1331,9 +1331,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) // Configured currency, for example, USD-en-US or EUR-de-DE, or empty for locale default. OUString sOldCurr = pLangConfig->aSysLocaleOptions.GetCurrencyConfigString(); - sal_Int32 nCurrPos = m_pCurrencyLB->GetSelectEntryPos(); - const NfCurrencyEntry* pCurr = (const NfCurrencyEntry*) - m_pCurrencyLB->GetEntryData( nCurrPos ); + const NfCurrencyEntry* pCurr = (const NfCurrencyEntry*) m_pCurrencyLB->GetSelectEntryData(); OUString sNewCurr; if ( pCurr ) sNewCurr = SvtSysLocaleOptions::CreateCurrencyConfigString( diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx index cbc8a38cf2ab..9910d962566b 100644 --- a/cui/source/options/optopencl.cxx +++ b/cui/source/options/optopencl.cxx @@ -247,7 +247,7 @@ IMPL_LINK(ListEntryDialog, OSSelectHdl, ListBox*, pListBox) if (mpOS->GetSelectEntryPos() == 0) maEntry.maOS.clear(); else - maEntry.maOS = mpOS->GetEntry(mpOS->GetSelectEntryPos()); + maEntry.maOS = mpOS->GetSelectEntry(); } return 0; diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 465be9c6f59c..bbecdaab6ef9 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -251,7 +251,7 @@ bool SfxSaveTabPage::FillItemSet( SfxItemSet* rSet ) if ( aODFVersionLB->IsValueChangedFromSaved() ) { - sal_IntPtr nVersion = sal_IntPtr( aODFVersionLB->GetEntryData( aODFVersionLB->GetSelectEntryPos() ) ); + sal_IntPtr nVersion = sal_IntPtr( aODFVersionLB->GetSelectEntryData() ); aSaveOpt.SetODFDefaultVersion( SvtSaveOptions::ODFDefaultVersion( nVersion ) ); } @@ -607,7 +607,7 @@ IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) IMPL_LINK_NOARG(SfxSaveTabPage, ODFVersionHdl_Impl) { - sal_IntPtr nVersion = sal_IntPtr( aODFVersionLB->GetEntryData( aODFVersionLB->GetSelectEntryPos() ) ); + sal_IntPtr nVersion = sal_IntPtr( aODFVersionLB->GetSelectEntryData() ); bool bShown = SvtSaveOptions::ODFDefaultVersion( nVersion ) != SvtSaveOptions::ODFVER_LATEST; if ( bShown ) { @@ -623,7 +623,7 @@ IMPL_LINK_NOARG(SfxSaveTabPage, ODFVersionHdl_Impl) } bShown = !bHasODFFormat - || ( aSaveAsLB->GetEntryData( aSaveAsLB->GetSelectEntryPos() ) != NULL ); + || ( aSaveAsLB->GetSelectEntryData() != NULL ); } aODFWarningFI->Show( bShown ); diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index a764095e5a13..a04040670717 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -134,7 +134,7 @@ static void lcl_SetTransparency(SvxBrushItem& rBrush, long nTransparency) /// Returns the fill style of the currently selected entry. static drawing::FillStyle lcl_getFillStyle(ListBox* pLbSelect) { - return (drawing::FillStyle)reinterpret_cast<sal_uLong>(pLbSelect->GetEntryData(pLbSelect->GetSelectEntryPos())); + return (drawing::FillStyle)reinterpret_cast<sal_uLong>(pLbSelect->GetSelectEntryData()); } // Selects the entry matching the specified fill style. diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 71f90f564e1f..d472852270cb 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -1713,7 +1713,7 @@ IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox *, pBox ) { SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); // PAGEDESC does not exist - sal_uInt16 nNumType = (sal_uInt16)reinterpret_cast<sal_uLong>(pBox->GetEntryData(pBox->GetSelectEntryPos())); + sal_uInt16 nNumType = (sal_uInt16)reinterpret_cast<sal_uLong>(pBox->GetSelectEntryData()); aNumFmt.SetNumberingType((sal_Int16)nNumType); sal_uInt16 nNumberingType = aNumFmt.GetNumberingType(); if(SVX_NUM_BITMAP == (nNumberingType&(~LINK_TOKEN))) diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index e9a451625c8f..bb26490ee9fb 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -1281,7 +1281,7 @@ IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB ) { if (pRelLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) - nRel = ((RelationMap *)pRelLB->GetEntryData(pRelLB->GetSelectEntryPos()))->nRelation; + nRel = ((RelationMap *)pRelLB->GetSelectEntryData())->nRelation; FillRelLB(pMap, nMapPos, nAlign, nRel, *pRelLB, *pRelFT); } @@ -1406,7 +1406,7 @@ short SvxSwPosSizeTabPage::GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, ListBo { if (rRelationLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) { - sal_uLong nRel = ((RelationMap *)rRelationLB.GetEntryData(rRelationLB.GetSelectEntryPos()))->nLBRelation; + sal_uLong nRel = ((RelationMap *)rRelationLB.GetSelectEntryData())->nLBRelation; std::size_t nMapCount = ::lcl_GetFrmMapCount(pMap); SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId; |