summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-03-12 16:30:48 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-03-13 12:25:27 +0000
commit867f1e5404536fd2f2ffd57fb4510f1eb7ed4561 (patch)
treef39ebf7ffa9047a150610130b5c2a9893b2789c9 /svx
parent4605bd46984125a99b0e993b71efa6edb411699f (diff)
ToolBox::GetItemCommand/GetItemWindow take IDs
...not positions in the [0..GetItemCount()) range, so what's probably missing here is to map from positions to IDs. Code was introduced with f25cdaa78d5e7d200fbaf31cce9895bab7c5ee63 "fdo#74132: Do not interrupt search in Writer." Change-Id: I0049b76c91c8ed5a9f4051f170454fb3d49c46f9 Reviewed-on: https://gerrit.libreoffice.org/35101 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/srchdlg.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index c5a16a3ac170..c990206fb404 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -2396,8 +2396,11 @@ static vcl::Window* lcl_GetSearchLabelWindow()
xUIElement->getRealInterface(), css::uno::UNO_QUERY_THROW);
VclPtr< ToolBox > pToolBox = static_cast<ToolBox*>( VCLUnoHelper::GetWindow(xWindow).get() );
for (size_t i = 0; pToolBox && i < pToolBox->GetItemCount(); ++i)
- if (pToolBox->GetItemCommand(i) == ".uno:SearchLabel")
- return pToolBox->GetItemWindow(i);
+ {
+ sal_uInt16 id = pToolBox->GetItemId(i);
+ if (pToolBox->GetItemCommand(id) == ".uno:SearchLabel")
+ return pToolBox->GetItemWindow(id);
+ }
return nullptr;
}