diff options
author | Jan Holesovsky <kendy@collabora.com> | 2020-05-07 15:47:49 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-05-10 21:43:51 +0200 |
commit | c6a3f51a89449f61ad20a1787c0a3cb41fa91466 (patch) | |
tree | 8b2fb0f7c67a8c500d0a94ba74ea99e7740ff822 /desktop | |
parent | 4a1ceb06ca19a5c89895015e0fc73c8fa897294e (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 1a26cdd20b94..40e3d8b3b6a3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1136,7 +1136,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, @@ -5405,7 +5405,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(); @@ -5417,7 +5417,7 @@ static void doc_completeFunction(LibreOfficeKitDocument* pThis, int nIndex) return; } - pDoc->completeFunction(nIndex); + pDoc->completeFunction(OUString::fromUtf8(pFunctionName)); } |