summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-11-26 14:26:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-11-26 17:34:18 +0100
commit475d4b274b499c2f3c482449df046baa2a483b24 (patch)
tree9fe25b24d156ac7cbfd3cef70bb896f408f01a0b /dbaccess
parent5a448a920302c52b1366844efeab0f2e23bef95a (diff)
Use sal_IntPtr to transport HWND to IDataSourceLocator::put_hWnd
The HWND hWnd source is in OConnectionHelper::implInitControls (dbaccess/source/ui/dlg/ConnectionHelper.cxx) and the IDataSourceLocator::put_hWnd call sinks are in PromptNew and PromptEdit (dbaccess/source/ui/dlg/adodatalinks.cxx). The IDataSourceLocator source code has virtual HRESULT __stdcall put_hWnd( COMPATIBLE_LONG hwndParent) = 0; with typedef LONGLONG COMPATIBLE_LONG; (both C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\msdasc.h), so it looks like an integer type large enough to hold pointers is what is appropriate here. (Which matches the fact that HWND aka HANDLE aka PVOID is a pointer type.) Change-Id: I3a18e9a1d2f75a1feac716ef6e7bca78165ffe95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106695 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx2
-rw-r--r--dbaccess/source/ui/dlg/adodatalinks.cxx6
-rw-r--r--dbaccess/source/ui/dlg/adodatalinks.hxx3
3 files changed, 6 insertions, 5 deletions
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index 063c5320e566..5ab0d0b850e3 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -272,7 +272,7 @@ namespace dbaui
hWnd = reinterpret_cast<HWND>(tmp);
}
- sNewDataSource = getAdoDatalink(reinterpret_cast<LONG_PTR>(hWnd),sOldDataSource);
+ sNewDataSource = getAdoDatalink(reinterpret_cast<sal_IntPtr>(hWnd),sOldDataSource);
if ( !sNewDataSource.isEmpty() )
{
setURLNoPrefix(sNewDataSource);
diff --git a/dbaccess/source/ui/dlg/adodatalinks.cxx b/dbaccess/source/ui/dlg/adodatalinks.cxx
index c8bafabf1088..74703b010bcb 100644
--- a/dbaccess/source/ui/dlg/adodatalinks.cxx
+++ b/dbaccess/source/ui/dlg/adodatalinks.cxx
@@ -35,7 +35,7 @@
namespace {
-OUString PromptNew(long hWnd)
+OUString PromptNew(sal_IntPtr hWnd)
{
HRESULT hr;
IDataSourceLocator* dlPrompt = nullptr;
@@ -95,7 +95,7 @@ OUString PromptNew(long hWnd)
return OUString(o3tl::toU(_result));
}
-OUString PromptEdit(long hWnd, OUString const & connstr)
+OUString PromptEdit(sal_IntPtr hWnd, OUString const & connstr)
{
HRESULT hr;
IDataSourceLocator* dlPrompt = nullptr;
@@ -189,7 +189,7 @@ OUString PromptEdit(long hWnd, OUString const & connstr)
}
-OUString getAdoDatalink(long hWnd,OUString const & oldLink)
+OUString getAdoDatalink(sal_IntPtr hWnd,OUString const & oldLink)
{
OUString dataLink;
if (!oldLink.isEmpty())
diff --git a/dbaccess/source/ui/dlg/adodatalinks.hxx b/dbaccess/source/ui/dlg/adodatalinks.hxx
index 3cbbd18c3b6c..6b753f62e442 100644
--- a/dbaccess/source/ui/dlg/adodatalinks.hxx
+++ b/dbaccess/source/ui/dlg/adodatalinks.hxx
@@ -20,6 +20,7 @@
#pragma once
#include <rtl/ustring.hxx>
+#include <sal/types.h>
-OUString getAdoDatalink(long hWnd, OUString const& oldLink);
+OUString getAdoDatalink(sal_IntPtr hWnd, OUString const& oldLink);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */