summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-02-13 13:31:57 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-02-16 06:38:42 +0000
commit9f8ffc8dfed61eb8460d92ce85b20effe5114f87 (patch)
tree22345276a060d99201fa271486b785a5b56dc87b /include
parent031166e43ff2e476df5158ff3e6e631b0c346441 (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 'include')
-rw-r--r--include/svx/checklbx.hxx1
-rw-r--r--include/vcl/combobox.hxx1
-rw-r--r--include/vcl/lstbox.hxx1
3 files changed, 3 insertions, 0 deletions
diff --git a/include/svx/checklbx.hxx b/include/svx/checklbx.hxx
index a709487f1a56..eb587db0924f 100644
--- a/include/svx/checklbx.hxx
+++ b/include/svx/checklbx.hxx
@@ -56,6 +56,7 @@ public:
void SelectEntryPos ( sal_uLong nPos, bool bSelect = true );
sal_uLong GetSelectEntryPos () const;
+ void* GetSelectEntryData () const { return GetEntryData(GetSelectEntryPos()); }
OUString GetText ( sal_uLong nPos ) const;
sal_uLong GetCheckedEntryCount() const;
diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 2da1f1b1e2c8..c7a8cef99851 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -193,6 +193,7 @@ public:
sal_Int32 GetSelectEntryCount() const;
sal_Int32 GetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const;
+ OUString GetSelectEntry() const { return GetEntry( GetSelectEntryPos() ); }
bool IsEntryPosSelected( sal_Int32 nPos ) const;
void SelectEntryPos( sal_Int32 nPos, bool bSelect = true );
void SetNoSelection();
diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx
index 621b571c224a..29d219920844 100644
--- a/include/vcl/lstbox.hxx
+++ b/include/vcl/lstbox.hxx
@@ -143,6 +143,7 @@ public:
void SetEntryData( sal_Int32 nPos, void* pNewData );
void* GetEntryData( sal_Int32 nPos ) const;
+ void* GetSelectEntryData() const { return GetEntryData(GetSelectEntryPos()); }
/** this methods stores a combination of flags from the
LISTBOX_ENTRY_FLAG_* defines at the given entry.