summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-02-04 14:10:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-02-04 16:43:44 +0100
commitd5a43d2c0ce695a87b3ccd322c11b1d28400f2da (patch)
tree5ce8f007c52f55be1b25ffb64c476bb38fbc3854
parent50682cea4196819980c8e2d4018f80384097ce6f (diff)
use some more add toId/fromId
Change-Id: I3a21e2aa5a2c482c0bac1d4c9bf84f8b56261408 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129492 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--basctl/source/basicide/bastype3.cxx6
-rw-r--r--basctl/source/basicide/moduldlg.cxx2
-rw-r--r--cui/source/inc/cfg.hxx2
-rw-r--r--dbaccess/source/ui/browser/dsEntriesNoExp.cxx2
-rw-r--r--dbaccess/source/ui/browser/dsbrowserDnD.cxx2
-rw-r--r--dbaccess/source/ui/control/dbtreelistbox.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/QTableWindow.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx2
-rw-r--r--extensions/source/propctrlr/selectlabeldialog.cxx2
-rw-r--r--fpicker/source/office/iodlgimp.hxx2
-rw-r--r--sc/source/core/tool/orcusxml.cxx2
-rw-r--r--svx/source/dialog/ctredlin.cxx8
-rw-r--r--svx/source/dialog/docrecovery.cxx8
-rw-r--r--svx/source/form/filtnav.cxx26
-rw-r--r--sw/source/ui/misc/glossary.cxx8
15 files changed, 40 insertions, 40 deletions
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
index edf4c5bae04a..43f1b970209e 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -156,7 +156,7 @@ SbxVariable* SbTreeListBox::FindVariable(const weld::TreeIter* pEntry)
do
{
sal_uInt16 nDepth = m_xControl->get_iter_depth(*xIter);
- Entry* pBE = reinterpret_cast<Entry*>(m_xControl->get_id(*xIter).toInt64());
+ Entry* pBE = weld::fromId<Entry*>(m_xControl->get_id(*xIter));
switch (nDepth)
{
case 4:
@@ -257,7 +257,7 @@ EntryDescriptor SbTreeListBox::GetEntryDescriptor(const weld::TreeIter* pEntry)
do
{
sal_uInt16 nDepth = m_xControl->get_iter_depth(*xIter);
- Entry* pBE = reinterpret_cast<Entry*>(m_xControl->get_id(*xIter).toInt64());
+ Entry* pBE = weld::fromId<Entry*>(m_xControl->get_id(*xIter));
switch (nDepth)
{
case 4:
@@ -421,7 +421,7 @@ bool SbTreeListBox::FindRootEntry( const ScriptDocument& rDocument, LibraryLocat
bool bValidIter = m_xControl->get_iter_first(rIter);
while (bValidIter)
{
- DocumentEntry* pBDEntry = reinterpret_cast<DocumentEntry*>(m_xControl->get_id(rIter).toInt64());
+ DocumentEntry* pBDEntry = weld::fromId<DocumentEntry*>(m_xControl->get_id(rIter));
if (pBDEntry && pBDEntry->GetDocument() == rDocument && pBDEntry->GetLocation() == eLocation)
return true;
bValidIter = m_xControl->iter_next_sibling(rIter);
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 2e3c8c2530d1..baa9faae255a 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -685,7 +685,7 @@ IMPL_LINK(ObjectPage, ButtonHdl, weld::Button&, rButton, void)
std::unique_ptr<weld::TreeIter> xParentEntry(m_xBasicBox->make_iterator(xCurEntry.get()));
if (m_xBasicBox->iter_parent(*xParentEntry))
{
- DocumentEntry* pDocumentEntry = reinterpret_cast<DocumentEntry*>(m_xBasicBox->get_id(*xParentEntry).toInt64());
+ DocumentEntry* pDocumentEntry = weld::fromId<DocumentEntry*>(m_xBasicBox->get_id(*xParentEntry));
if (pDocumentEntry)
aDocument = pDocumentEntry->GetDocument();
}
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index 361e801d723c..7adc9c026185 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -496,7 +496,7 @@ public:
SvxConfigEntry* GetTopLevelSelection()
{
- return reinterpret_cast<SvxConfigEntry*>(m_xTopLevelListBox->get_active_id().toInt64());
+ return weld::fromId<SvxConfigEntry*>(m_xTopLevelListBox->get_active_id());
}
/** identifies the module in the given frame. If the frame is <NULL/>, a default
diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
index debc3fa51a67..b31261df1b4e 100644
--- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
+++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
@@ -56,7 +56,7 @@ OUString SbaTableQueryBrowser::GetEntryText(const weld::TreeIter& rEntry) const
SbaTableQueryBrowser::EntryType SbaTableQueryBrowser::getEntryType(const weld::TreeIter& rEntry) const
{
const weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- DBTreeListUserData* pEntryData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(rEntry).toUInt64());
+ DBTreeListUserData* pEntryData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(rEntry));
return pEntryData ? pEntryData->eType : etUnknown;
}
diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
index 7d51a5abf8fb..961fd731af5f 100644
--- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx
+++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
@@ -232,7 +232,7 @@ namespace dbaui
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
rTreeView.all_foreach([this, &rTreeView](weld::TreeIter& rEntryLoop){
// clear the user data of the tree model
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(rEntryLoop).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(rEntryLoop));
if (pData)
{
rTreeView.set_id(rEntryLoop, OUString());
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index 55db602c5ea9..472171142368 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -193,7 +193,7 @@ std::unique_ptr<weld::TreeIter> TreeListBox::GetEntryPosByName(std::u16string_vi
{
if (m_xTreeView->get_text(*xEntry) == aName)
{
- if (!_pFilter || _pFilter->includeEntry(reinterpret_cast<void*>(m_xTreeView->get_id(*xEntry).toUInt64())))
+ if (!_pFilter || _pFilter->includeEntry(weld::fromId<void*>(m_xTreeView->get_id(*xEntry))))
{
// found
return xEntry;
@@ -285,7 +285,7 @@ IMPL_LINK(TreeListBox, QueryTooltipHdl, const weld::TreeIter&, rIter, OUString)
{
OUString sQuickHelpText;
if (m_pActionListener &&
- m_pActionListener->requestQuickHelp(reinterpret_cast<void*>(m_xTreeView->get_id(rIter).toUInt64()), sQuickHelpText))
+ m_pActionListener->requestQuickHelp(weld::fromId<void*>(m_xTreeView->get_id(rIter)), sQuickHelpText))
{
return sQuickHelpText;
}
diff --git a/dbaccess/source/ui/querydesign/QTableWindow.cxx b/dbaccess/source/ui/querydesign/QTableWindow.cxx
index cc70e1276a19..6b129c32d5fd 100644
--- a/dbaccess/source/ui/querydesign/QTableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx
@@ -110,7 +110,7 @@ void OQueryTableWindow::OnEntryDoubleClicked(weld::TreeIter& rEntry)
return;
weld::TreeView& rTreeView = m_xListBox->get_widget();
- OTableFieldInfo* pInf = reinterpret_cast<OTableFieldInfo*>(rTreeView.get_id(rEntry).toUInt64());
+ OTableFieldInfo* pInf = weld::fromId<OTableFieldInfo*>(rTreeView.get_id(rEntry));
OSL_ENSURE(pInf != nullptr, "OQueryTableWindow::OnEntryDoubleClicked : field doesn't have FieldInfo !");
// build up DragInfo
@@ -144,7 +144,7 @@ bool OQueryTableWindow::ExistsField(const OUString& strFieldName, OTableFieldDes
{
if (bCase(strFieldName, rTreeView.get_text(*xEntry)))
{
- OTableFieldInfo* pInf = reinterpret_cast<OTableFieldInfo*>(rTreeView.get_id(*xEntry).toUInt64());
+ OTableFieldInfo* pInf = weld::fromId<OTableFieldInfo*>(rTreeView.get_id(*xEntry));
assert(pInf && "OQueryTableWindow::ExistsField : field doesn't have FieldInfo !");
rInfo->SetTabWindow(this);
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 235ed9bd1c41..ac183e9d09e9 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -1556,7 +1556,7 @@ OTableFieldDescRef OSelectionBrowseBox::InsertField(const OJoinExchangeData& jxd
weld::TreeView& rTreeView = jxdSource.pListBox->get_widget();
OUString aFieldName = rTreeView.get_text(jxdSource.nEntry);
sal_uInt32 nFieldIndex = jxdSource.nEntry;
- OTableFieldInfo* pInf = reinterpret_cast<OTableFieldInfo*>(rTreeView.get_id(jxdSource.nEntry).toUInt64());
+ OTableFieldInfo* pInf = weld::fromId<OTableFieldInfo*>(rTreeView.get_id(jxdSource.nEntry));
// construct DragInfo, such that I use the other InsertField
OTableFieldDescRef aInfo = new OTableFieldDesc(pSourceWin->GetTableName(),aFieldName);
diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx
index 41749f9b4e5c..f5f00f663790 100644
--- a/extensions/source/propctrlr/selectlabeldialog.cxx
+++ b/extensions/source/propctrlr/selectlabeldialog.cxx
@@ -232,7 +232,7 @@ namespace pcr
bool bSelected = m_xControlTree->get_selected(xIter.get());
OUString sData = bSelected ? m_xControlTree->get_id(*xIter) : OUString();
if (!sData.isEmpty())
- m_xSelectedControl.set(*reinterpret_cast<Reference<XPropertySet>*>(sData.toInt64()));
+ m_xSelectedControl.set(*weld::fromId<Reference<XPropertySet>*>(sData));
m_xNoAssignment->set_active(sData.isEmpty());
}
diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx
index 7300ab16e5e3..1ae0dc652547 100644
--- a/fpicker/source/office/iodlgimp.hxx
+++ b/fpicker/source/office/iodlgimp.hxx
@@ -185,7 +185,7 @@ public:
SvtFileDialogFilter_Impl* GetSelectedFilterEntry( OUString& rDisplayName ) const
{
rDisplayName = m_xLbFilter->get_active_text();
- return reinterpret_cast<SvtFileDialogFilter_Impl*>(m_xLbFilter->get_active_id().toInt64());
+ return weld::fromId<SvtFileDialogFilter_Impl*>(m_xLbFilter->get_active_id());
}
// access to the current filter via methods only - need to care for consistency between m_pCurFilter and m_sCurrentFilterDisplayName
diff --git a/sc/source/core/tool/orcusxml.cxx b/sc/source/core/tool/orcusxml.cxx
index 1323362b4124..26fc0e27fbdb 100644
--- a/sc/source/core/tool/orcusxml.cxx
+++ b/sc/source/core/tool/orcusxml.cxx
@@ -21,7 +21,7 @@ ScOrcusXMLTreeParam::EntryData::EntryData(EntryType eType)
ScOrcusXMLTreeParam::EntryData* ScOrcusXMLTreeParam::getUserData(const weld::TreeView& rControl, const weld::TreeIter& rEntry)
{
- return reinterpret_cast<ScOrcusXMLTreeParam::EntryData*>(rControl.get_id(rEntry).toInt64());
+ return weld::fromId<ScOrcusXMLTreeParam::EntryData*>(rControl.get_id(rEntry));
}
ScOrcusImportXMLParam::CellLink::CellLink(const ScAddress& rPos, const OString& rPath) :
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 3ce4e81bb8e7..dc9d84801c2b 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -135,8 +135,8 @@ int SvxRedlinTable::ColCompare(const weld::TreeIter& rLeft, const weld::TreeIter
if (pTreeView == xWriterTreeView.get() && nSortCol == 0)
{
- RedlinData *pLeftData = reinterpret_cast<RedlinData*>(pTreeView->get_id(rLeft).toInt64());
- RedlinData *pRightData = reinterpret_cast<RedlinData*>(pTreeView->get_id(rRight).toInt64());
+ RedlinData *pLeftData = weld::fromId<RedlinData*>(pTreeView->get_id(rLeft));
+ RedlinData *pRightData = weld::fromId<RedlinData*>(pTreeView->get_id(rRight));
if (pLeftData && pRightData)
{
@@ -150,8 +150,8 @@ int SvxRedlinTable::ColCompare(const weld::TreeIter& rLeft, const weld::TreeIter
if (nSortCol == nDatePos)
{
- RedlinData *pLeftData = reinterpret_cast<RedlinData*>(pTreeView->get_id(rLeft).toInt64());
- RedlinData *pRightData = reinterpret_cast<RedlinData*>(pTreeView->get_id(rRight).toInt64());
+ RedlinData *pLeftData = weld::fromId<RedlinData*>(pTreeView->get_id(rLeft));
+ RedlinData *pRightData = weld::fromId<RedlinData*>(pTreeView->get_id(rRight));
if (pLeftData && pRightData)
{
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index fa4449c46b95..e950a060bd61 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -679,7 +679,7 @@ RecoveryDialog::RecoveryDialog(weld::Window* pParent, RecoveryCore* pCore)
{
const TURLInfo& rInfo = rURLList[i];
m_xFileListLB->append();
- m_xFileListLB->set_id(i, OUString::number(reinterpret_cast<sal_IntPtr>(&rInfo)));
+ m_xFileListLB->set_id(i, weld::toId(&rInfo));
m_xFileListLB->set_image(i, rInfo.StandardImageId, 0);
m_xFileListLB->set_text(i, rInfo.DisplayName, 1);
m_xFileListLB->set_image(i, impl_getStatusImage(rInfo), 2);
@@ -871,7 +871,7 @@ void RecoveryDialog::updateItems()
int c = m_xFileListLB->n_children();
for (int i = 0; i < c; ++i)
{
- TURLInfo* pInfo = reinterpret_cast<TURLInfo*>(m_xFileListLB->get_id(i).toInt64());
+ TURLInfo* pInfo = weld::fromId<TURLInfo*>(m_xFileListLB->get_id(i));
if ( !pInfo )
continue;
@@ -887,7 +887,7 @@ void RecoveryDialog::stepNext(TURLInfo* pItem)
int c = m_xFileListLB->n_children();
for (int i=0; i < c; ++i)
{
- TURLInfo* pInfo = reinterpret_cast<TURLInfo*>(m_xFileListLB->get_id(i).toInt64());
+ TURLInfo* pInfo = weld::fromId<TURLInfo*>(m_xFileListLB->get_id(i));
if (pInfo->ID != pItem->ID)
continue;
@@ -1044,7 +1044,7 @@ void BrokenRecoveryDialog::impl_refresh()
m_bExecutionNeeded = true;
- m_xFileListLB->append(OUString::number(reinterpret_cast<sal_IntPtr>(&rInfo)), rInfo.DisplayName, rInfo.StandardImageId);
+ m_xFileListLB->append(weld::toId(&rInfo), rInfo.DisplayName, rInfo.StandardImageId);
}
m_sSavePath.clear();
m_xOkBtn->grab_focus();
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 22426ad7dbeb..66c70522cf16 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -925,7 +925,7 @@ IMPL_STATIC_LINK(FmFilterNavigator, CustomGetSizeHdl, weld::TreeView::get_size_a
Size aSize;
- FmFilterData* pData = reinterpret_cast<FmFilterData*>(rId.toUInt64());
+ FmFilterData* pData = weld::fromId<FmFilterData*>(rId);
OUString sText = pData->GetText();
if (FmFilterItem* pItem = dynamic_cast<FmFilterItem*>(pData))
@@ -967,7 +967,7 @@ IMPL_STATIC_LINK(FmFilterNavigator, CustomRenderHdl, weld::TreeView::render_args
else
rRenderContext.SetTextColor(rStyleSettings.GetDialogTextColor());
- FmFilterData* pData = reinterpret_cast<FmFilterData*>(rId.toUInt64());
+ FmFilterData* pData = weld::fromId<FmFilterData*>(rId);
OUString sText = pData->GetText();
Point aPos(aRect.TopLeft());
@@ -1108,7 +1108,7 @@ void FmFilterNavigator::UpdateContent(const Reference< XIndexAccess > & xControl
IMPL_LINK(FmFilterNavigator, EditingEntryHdl, const weld::TreeIter&, rIter, bool)
{
// returns true to allow editing
- if (dynamic_cast<const FmFilterItem*>(reinterpret_cast<FmFilterData*>(m_xTreeView->get_id(rIter).toUInt64())))
+ if (dynamic_cast<const FmFilterItem*>(weld::fromId<FmFilterData*>(m_xTreeView->get_id(rIter))))
{
m_xEditingCurrently = m_xTreeView->make_iterator(&rIter);
return true;
@@ -1126,7 +1126,7 @@ IMPL_LINK(FmFilterNavigator, EditedEntryHdl, const IterString&, rIterString, boo
"FmFilterNavigator::EditedEntry: suspicious entry!");
m_xEditingCurrently.reset();
- FmFilterData* pData = reinterpret_cast<FmFilterData*>(m_xTreeView->get_id(rIter).toUInt64());
+ FmFilterData* pData = weld::fromId<FmFilterData*>(m_xTreeView->get_id(rIter));
DBG_ASSERT(dynamic_cast<const FmFilterItem*>(pData) != nullptr,
"FmFilterNavigator::EditedEntry() wrong entry");
@@ -1190,7 +1190,7 @@ sal_Int8 FmFilterNavigator::AcceptDrop( const AcceptDropEvent& rEvt )
if (!xDropTarget)
return DND_ACTION_NONE;
- FmFilterData* pData = reinterpret_cast<FmFilterData*>(m_xTreeView->get_id(*xDropTarget).toUInt64());
+ FmFilterData* pData = weld::fromId<FmFilterData*>(m_xTreeView->get_id(*xDropTarget));
FmFormItem* pForm = nullptr;
if (dynamic_cast<const FmFilterItem*>(pData) != nullptr)
{
@@ -1214,7 +1214,7 @@ namespace
{
FmFilterItems* getTargetItems(const weld::TreeView& rTreeView, const weld::TreeIter& rTarget)
{
- FmFilterData* pData = reinterpret_cast<FmFilterData*>(rTreeView.get_id(rTarget).toUInt64());
+ FmFilterData* pData = weld::fromId<FmFilterData*>(rTreeView.get_id(rTarget));
FmFilterItems* pTargetItems = dynamic_cast<FmFilterItems*>(pData);
if (!pTargetItems)
pTargetItems = dynamic_cast<FmFilterItems*>(pData->GetParent());
@@ -1253,7 +1253,7 @@ IMPL_LINK_NOARG(FmFilterNavigator, SelectHdl, weld::TreeView&, void)
if (!m_xTreeView->get_selected(xIter.get()))
return;
- FmFilterData* pData = reinterpret_cast<FmFilterData*>(m_xTreeView->get_id(*xIter).toUInt64());
+ FmFilterData* pData = weld::fromId<FmFilterData*>(m_xTreeView->get_id(*xIter));
FmFormItem* pFormItem = nullptr;
if (FmFilterItem* pItem = dynamic_cast<FmFilterItem*>(pData))
@@ -1310,7 +1310,7 @@ std::unique_ptr<weld::TreeIter> FmFilterNavigator::FindEntry(const FmFilterData*
return nullptr;
do
{
- FmFilterData* pEntryItem = reinterpret_cast<FmFilterData*>(m_xTreeView->get_id(*xEntry).toUInt64());
+ FmFilterData* pEntryItem = weld::fromId<FmFilterData*>(m_xTreeView->get_id(*xEntry));
if (pEntryItem == pItem)
return xEntry;
}
@@ -1326,7 +1326,7 @@ void FmFilterNavigator::Insert(FmFilterData* pItem, int nPos)
// insert the item
std::unique_ptr<weld::TreeIter> xParentEntry = FindEntry(pParent);
- OUString sId(OUString::number(reinterpret_cast<sal_uIntPtr>(pItem)));
+ OUString sId(weld::toId(pItem));
std::unique_ptr<weld::TreeIter> xRet(m_xTreeView->make_iterator());
m_xTreeView->insert(xParentEntry.get(), nPos, &pItem->GetText(), &sId,
nullptr, nullptr, false, xRet.get());
@@ -1369,7 +1369,7 @@ FmFormItem* FmFilterNavigator::getSelectedFilterItems(::std::vector<FmFilterItem
bool bFoundSomething = false;
m_xTreeView->selected_foreach([this, &bHandled, &bFoundSomething, &pFirstItem, &_rItemList](weld::TreeIter& rEntry) {
- FmFilterData* pFilterEntry = reinterpret_cast<FmFilterData*>(m_xTreeView->get_id(rEntry).toInt64());
+ FmFilterData* pFilterEntry = weld::fromId<FmFilterData*>(m_xTreeView->get_id(rEntry));
FmFilterItem* pFilter = dynamic_cast<FmFilterItem*>(pFilterEntry);
if (pFilter)
{
@@ -1475,7 +1475,7 @@ IMPL_LINK(FmFilterNavigator, PopupMenuHdl, const CommandEvent&, rEvt, bool)
::std::vector<FmFilterData*> aSelectList;
m_xTreeView->selected_foreach([this, &aSelectList](weld::TreeIter& rEntry) {
- FmFilterData* pFilterEntry = reinterpret_cast<FmFilterData*>(m_xTreeView->get_id(rEntry).toInt64());
+ FmFilterData* pFilterEntry = weld::fromId<FmFilterData*>(m_xTreeView->get_id(rEntry));
// don't delete forms
FmFormItem* pForm = dynamic_cast<FmFormItem*>(pFilterEntry);
@@ -1505,7 +1505,7 @@ IMPL_LINK(FmFilterNavigator, PopupMenuHdl, const CommandEvent&, rEvt, bool)
xContextMenu->remove("delete");
}
- FmFilterData* pFilterEntry = reinterpret_cast<FmFilterData*>(m_xTreeView->get_id(*xClicked).toInt64());
+ FmFilterData* pFilterEntry = weld::fromId<FmFilterData*>(m_xTreeView->get_id(*xClicked));
auto pFilterItem = dynamic_cast<FmFilterItem*>(pFilterEntry);
bool bEdit = pFilterItem &&
m_xTreeView->is_selected(*xClicked) && m_xTreeView->count_selected_rows() == 1;
@@ -1697,7 +1697,7 @@ void FmFilterNavigator::DeleteSelection()
std::vector<FmFilterData*> aEntryList;
m_xTreeView->selected_foreach([this, &aEntryList](weld::TreeIter& rEntry) {
- FmFilterData* pFilterEntry = reinterpret_cast<FmFilterData*>(m_xTreeView->get_id(rEntry).toInt64());
+ FmFilterData* pFilterEntry = weld::fromId<FmFilterData*>(m_xTreeView->get_id(rEntry));
if (dynamic_cast<FmFilterItem*>(pFilterEntry))
{
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 842fc3f621e4..5a798c9958d5 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -274,7 +274,7 @@ IMPL_LINK(SwGlossaryDlg, GrpSelect, weld::TreeView&, rBox, void)
}
else
pParent = xEntry.get();
- GroupUserData* pGroupData = reinterpret_cast<GroupUserData*>(rBox.get_id(*pParent).toInt64());
+ GroupUserData* pGroupData = weld::fromId<GroupUserData*>(rBox.get_id(*pParent));
::SetCurrGlosGroup(pGroupData->sGroupName
+ OUStringChar(GLOS_DELIM)
+ OUString::number(pGroupData->nPathIdx));
@@ -654,7 +654,7 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl, weld::Button&, void)
{
if (!m_xCategoryBox->get_iter_depth(*xEntry))
{
- GroupUserData* pGroupData = reinterpret_cast<GroupUserData*>(m_xCategoryBox->get_id(*xEntry).toInt64());
+ GroupUserData* pGroupData = weld::fromId<GroupUserData*>(m_xCategoryBox->get_id(*xEntry));
const OUString sGroup = pGroupData->sGroupName
+ OUStringChar(GLOS_DELIM)
+ OUString::number(pGroupData->nPathIdx);
@@ -750,7 +750,7 @@ void SwGlossaryDlg::Init()
{
if (!m_xCategoryBox->get_iter_depth(*xSearch))
{
- GroupUserData* pData = reinterpret_cast<GroupUserData*>(m_xCategoryBox->get_id(*xSearch).toInt64());
+ GroupUserData* pData = weld::fromId<GroupUserData*>(m_xCategoryBox->get_id(*xSearch));
if (!pData->bReadonly)
{
xSelEntry = std::move(xSearch);
@@ -850,7 +850,7 @@ OUString SwGlossaryDlg::GetCurrGrpName() const
{
if (m_xCategoryBox->get_iter_depth(*xEntry))
m_xCategoryBox->iter_parent(*xEntry);
- GroupUserData* pGroupData = reinterpret_cast<GroupUserData*>(m_xCategoryBox->get_id(*xEntry).toInt64());
+ GroupUserData* pGroupData = weld::fromId<GroupUserData*>(m_xCategoryBox->get_id(*xEntry));
return pGroupData->sGroupName + OUStringChar(GLOS_DELIM) + OUString::number(pGroupData->nPathIdx);
}
return OUString();