diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-02-04 09:13:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-02-04 15:02:03 +0100 |
commit | e00032ba6a2ddd4c08ae6f03b1982d3c099d288e (patch) | |
tree | 33f52e795971fd330922e21857b12c6097727ca8 /desktop/source/deployment | |
parent | 8d3f658aa58ddee8c7bc32ddea070c1bb3bf19b8 (diff) |
add toId/fromId to tidy up some ugly casting
Change-Id: I70f34ac5e9b5d2f2d6c0375e823908eaa2e540b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129487
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'desktop/source/deployment')
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_updatedialog.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 26820c5ea97f..e97075d0ea9a 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -489,7 +489,7 @@ short UpdateDialog::run() { IMPL_LINK(UpdateDialog, entryToggled, const weld::TreeView::iter_col&, rRowCol, void) { // error's can't be enabled - const UpdateDialog::Index* p = reinterpret_cast<UpdateDialog::Index const *>(m_xUpdates->get_id(rRowCol.first).toInt64()); + const UpdateDialog::Index* p = weld::fromId<UpdateDialog::Index const *>(m_xUpdates->get_id(rRowCol.first)); if (p->m_eKind == SPECIFIC_ERROR) m_xUpdates->set_toggle(rRowCol.first, TRISTATE_FALSE); @@ -502,7 +502,7 @@ void UpdateDialog::insertItem(UpdateDialog::Index *pEntry, bool bEnabledCheckBox m_xUpdates->append(); m_xUpdates->set_toggle(nEntry, bEnabledCheckBox ? TRISTATE_TRUE : TRISTATE_FALSE); m_xUpdates->set_text(nEntry, pEntry->m_aName, 0); - m_xUpdates->set_id(nEntry, OUString::number(reinterpret_cast<sal_Int64>(pEntry))); + m_xUpdates->set_id(nEntry, weld::toId(pEntry)); } void UpdateDialog::addAdditional(UpdateDialog::Index * index, bool bEnabledCheckBox) @@ -658,7 +658,7 @@ void UpdateDialog::notifyMenubar( bool bPrepareOnly, bool bRecheckOnly ) for (sal_uInt16 i = 0, nItemCount = m_xUpdates->n_children(); i < nItemCount; ++i) { - UpdateDialog::Index const * p = reinterpret_cast< UpdateDialog::Index const * >(m_xUpdates->get_id(i).toInt64()); + UpdateDialog::Index const * p = weld::fromId<UpdateDialog::Index const*>(m_xUpdates->get_id(i)); if ( p->m_eKind == ENABLED_UPDATE ) { @@ -829,7 +829,7 @@ IMPL_LINK_NOARG(UpdateDialog, selectionHandler, weld::TreeView&, void) const UpdateDialog::Index* p = nullptr; if (nSelectedPos != -1) - p = reinterpret_cast<UpdateDialog::Index const *>(m_xUpdates->get_id(nSelectedPos).toInt64()); + p = weld::fromId<UpdateDialog::Index const*>(m_xUpdates->get_id(nSelectedPos)); if (p != nullptr) { sal_uInt16 pos = p->m_nIndex; @@ -941,7 +941,7 @@ IMPL_LINK_NOARG(UpdateDialog, allHandler, weld::Toggleable&, void) for (sal_uInt16 i = m_xUpdates->n_children(); i != 0 ;) { i -= 1; - UpdateDialog::Index const * p = reinterpret_cast< UpdateDialog::Index const * >( m_xUpdates->get_id(i).toInt64() ); + UpdateDialog::Index const * p = weld::fromId<UpdateDialog::Index const*>(m_xUpdates->get_id(i)); if ( p->m_bIgnored || ( p->m_eKind != ENABLED_UPDATE ) ) { m_xUpdates->remove(i); @@ -976,8 +976,7 @@ IMPL_LINK_NOARG(UpdateDialog, okHandler, weld::Button&, void) for (sal_uInt16 i = 0, nCount = m_xUpdates->n_children(); i < nCount; ++i) { UpdateDialog::Index const * p = - reinterpret_cast< UpdateDialog::Index const * >( - m_xUpdates->get_id(i).toInt64()); + weld::fromId<UpdateDialog::Index const*>(m_xUpdates->get_id(i)); if (p->m_eKind == ENABLED_UPDATE && m_xUpdates->get_toggle(i) == TRISTATE_TRUE) { m_updateData.push_back( m_enabledUpdates[ p->m_nIndex ] ); } |