diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-02-22 22:12:53 +0600 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-02-23 01:35:14 +0100 |
commit | d37df8fd1a681db758de6f4acfe6479e8e78b2dd (patch) | |
tree | 3427c325ea6de49f7bbdc5e05927ce2ee13b4f56 /vcl/source/control | |
parent | d7831d30e46a46e253cd6e855dd87eee3cb004a4 (diff) |
Fix warning C4312 when building with MSVC without -Wv:18
Discovered by https://gerrit.libreoffice.org/c/core/+/163717
Like these:
C:/lo/core/sw/source/ui/dbui/addresslistdialog.cxx(426): warning C4312: 'reinterpret_cast': conversion from 'int' to 'void *' of greater size
Change-Id: Idbfbe8add89c8e219bdabcf28b741e2e31a5e345
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163781
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/combobox.cxx | 8 | ||||
-rw-r--r-- | vcl/source/control/imp_listbox.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/listbox.cxx | 12 |
3 files changed, 11 insertions, 11 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 2a979b70b0a3..db66391d2cc4 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -895,7 +895,7 @@ sal_Int32 ComboBox::InsertEntry(const OUString& rStr, sal_Int32 const nPos) nRealPos = m_pImpl->m_pImplLB->InsertEntry( nRealPos, rStr ); nRealPos -= m_pImpl->m_pImplLB->GetEntryList().GetMRUCount(); - CallEventListeners( VclEventId::ComboboxItemAdded, reinterpret_cast<void*>(nRealPos) ); + CallEventListeners( VclEventId::ComboboxItemAdded, reinterpret_cast<void*>(static_cast<sal_IntPtr>(nRealPos)) ); return nRealPos; } @@ -916,7 +916,7 @@ sal_Int32 ComboBox::InsertEntryWithImage( nRealPos = m_pImpl->m_pImplLB->InsertEntry( nRealPos, rStr, rImage ); nRealPos -= m_pImpl->m_pImplLB->GetEntryList().GetMRUCount(); - CallEventListeners( VclEventId::ComboboxItemAdded, reinterpret_cast<void*>(nRealPos) ); + CallEventListeners( VclEventId::ComboboxItemAdded, reinterpret_cast<void*>(static_cast<sal_IntPtr>(nRealPos)) ); return nRealPos; } @@ -925,7 +925,7 @@ void ComboBox::RemoveEntryAt(sal_Int32 const nPos) const sal_Int32 nMRUCount = m_pImpl->m_pImplLB->GetEntryList().GetMRUCount(); assert(nPos >= 0 && nPos <= COMBOBOX_MAX_ENTRIES - nMRUCount); m_pImpl->m_pImplLB->RemoveEntry( nPos + nMRUCount ); - CallEventListeners( VclEventId::ComboboxItemRemoved, reinterpret_cast<void*>(nPos) ); + CallEventListeners( VclEventId::ComboboxItemRemoved, reinterpret_cast<void*>(static_cast<sal_IntPtr>(nPos)) ); } void ComboBox::Clear() @@ -933,7 +933,7 @@ void ComboBox::Clear() if (!m_pImpl->m_pImplLB) return; m_pImpl->m_pImplLB->Clear(); - CallEventListeners( VclEventId::ComboboxItemRemoved, reinterpret_cast<void*>(-1) ); + CallEventListeners( VclEventId::ComboboxItemRemoved, reinterpret_cast<void*>(sal_IntPtr(-1)) ); } Image ComboBox::GetEntryImage( sal_Int32 nPos ) const diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index bb4da51859b0..488c032a89f6 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -1552,7 +1552,7 @@ namespace // vcl::StringEntryIdentifier does not allow for 0 values, but our position is 0-based // => normalize - return reinterpret_cast< vcl::StringEntryIdentifier >( _nPos + 1 ); + return reinterpret_cast< vcl::StringEntryIdentifier >( _nPos + sal_IntPtr(1) ); } sal_Int32 lcl_getEntryPos( vcl::StringEntryIdentifier _entry ) diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index e189c8480f05..81e9eafdc33e 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -191,7 +191,7 @@ IMPL_LINK_NOARG(ListBox, ImplSelectHdl, LinkParamNone*, void) IMPL_LINK( ListBox, ImplFocusHdl, sal_Int32, nPos, void ) { - CallEventListeners( VclEventId::ListboxFocus, reinterpret_cast<void*>(nPos) ); + CallEventListeners( VclEventId::ListboxFocus, reinterpret_cast<void*>(static_cast<sal_IntPtr>(nPos)) ); } IMPL_LINK_NOARG( ListBox, ImplListItemSelectHdl, LinkParamNone*, void ) @@ -945,7 +945,7 @@ sal_Int32 ListBox::InsertEntry( const OUString& rStr, sal_Int32 nPos ) { sal_Int32 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList().GetMRUCount(), rStr ); nRealPos = sal::static_int_cast<sal_Int32>(nRealPos - mpImplLB->GetEntryList().GetMRUCount()); - CallEventListeners( VclEventId::ListboxItemAdded, reinterpret_cast<void*>(nRealPos) ); + CallEventListeners( VclEventId::ListboxItemAdded, reinterpret_cast<void*>(static_cast<sal_IntPtr>(nRealPos)) ); return nRealPos; } @@ -953,14 +953,14 @@ sal_Int32 ListBox::InsertEntry( const OUString& rStr, const Image& rImage, sal_I { sal_Int32 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList().GetMRUCount(), rStr, rImage ); nRealPos = sal::static_int_cast<sal_Int32>(nRealPos - mpImplLB->GetEntryList().GetMRUCount()); - CallEventListeners( VclEventId::ListboxItemAdded, reinterpret_cast<void*>(nRealPos) ); + CallEventListeners( VclEventId::ListboxItemAdded, reinterpret_cast<void*>(static_cast<sal_IntPtr>(nRealPos)) ); return nRealPos; } void ListBox::RemoveEntry( sal_Int32 nPos ) { mpImplLB->RemoveEntry( nPos + mpImplLB->GetEntryList().GetMRUCount() ); - CallEventListeners( VclEventId::ListboxItemRemoved, reinterpret_cast<void*>(nPos) ); + CallEventListeners( VclEventId::ListboxItemRemoved, reinterpret_cast<void*>(static_cast<sal_IntPtr>(nPos)) ); } Image ListBox::GetEntryImage( sal_Int32 nPos ) const @@ -1043,9 +1043,9 @@ void ListBox::SelectEntryPos( sal_Int32 nPos, bool bSelect ) //Only when bSelect == true, send both Selection & Focus events if (nCurrentPos != nPos && bSelect) { - CallEventListeners( VclEventId::ListboxSelect, reinterpret_cast<void*>(nPos)); + CallEventListeners( VclEventId::ListboxSelect, reinterpret_cast<void*>(static_cast<sal_IntPtr>(nPos))); if (HasFocus()) - CallEventListeners( VclEventId::ListboxFocus, reinterpret_cast<void*>(nPos)); + CallEventListeners( VclEventId::ListboxFocus, reinterpret_cast<void*>(static_cast<sal_IntPtr>(nPos))); } } } |