diff options
author | Jan Holesovsky <kendy@collabora.com> | 2020-05-07 15:47:49 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2020-05-28 09:19:40 +0100 |
commit | 2e063333696e45fd246f57df5bf0a9c813810aad (patch) | |
tree | d6c1da30242111172b050f89f6cb549fafcc4934 /desktop | |
parent | 7da01b39dc0a27400e098a84f6babcc753039790 (diff) |
formula bar: Change completeFunction() to accept string instead of index.
The 'index' is unsafe, because the set it tries to index can change in
the meantime. Instead, use the function name and search for it in the
set, to get the recent index.
Change-Id: Id2a021c32f421057c87b6f7f4fffcc1c98009acb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93666
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93910
Tested-by: Jenkins
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 648e7421c54f..060a36581223 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1143,7 +1143,7 @@ static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOu static void doc_resizeWindow(LibreOfficeKitDocument* pThis, unsigned nLOKWindowId, const int nWidth, const int nHeight); -static void doc_completeFunction(LibreOfficeKitDocument* pThis, int nIndex); +static void doc_completeFunction(LibreOfficeKitDocument* pThis, const char*); static void doc_sendFormFieldEvent(LibreOfficeKitDocument* pThis, @@ -5529,7 +5529,7 @@ static void doc_resizeWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWin pWindow->SetSizePixel(Size(nWidth, nHeight)); } -static void doc_completeFunction(LibreOfficeKitDocument* pThis, int nIndex) +static void doc_completeFunction(LibreOfficeKitDocument* pThis, const char* pFunctionName) { SolarMutexGuard aGuard; SetLastExceptionMsg(); @@ -5541,7 +5541,7 @@ static void doc_completeFunction(LibreOfficeKitDocument* pThis, int nIndex) return; } - pDoc->completeFunction(nIndex); + pDoc->completeFunction(OUString::fromUtf8(pFunctionName)); } |