summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/app/AppDetailView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/app/AppDetailView.cxx')
-rw-r--r--dbaccess/source/ui/app/AppDetailView.cxx30
1 files changed, 11 insertions, 19 deletions
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx
index 6e995354e4f6..9b445d382dea 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -40,8 +40,6 @@
using namespace ::dbaui;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::graphic;
using namespace ::com::sun::star::ui;
@@ -63,7 +61,7 @@ void OTasksWindow::updateHelpText()
TranslateId pHelpTextId;
int nCurEntry = m_xTreeView->get_selected_index();
if (nCurEntry != -1)
- pHelpTextId = reinterpret_cast<TaskEntry*>(m_xTreeView->get_id(nCurEntry).toUInt64())->pHelpID;
+ pHelpTextId = weld::fromId<TaskEntry*>(m_xTreeView->get_id(nCurEntry))->pHelpID;
setHelpText(pHelpTextId);
}
@@ -73,7 +71,7 @@ IMPL_LINK(OTasksWindow, onSelected, weld::TreeView&, rTreeView, bool)
if (m_nCursorIndex != -1)
{
URL aCommand;
- aCommand.Complete = reinterpret_cast<TaskEntry*>(rTreeView.get_id(m_nCursorIndex).toUInt64())->sUNOCommand;
+ aCommand.Complete = weld::fromId<TaskEntry*>(rTreeView.get_id(m_nCursorIndex))->sUNOCommand;
getDetailView()->getBorderWin().getView()->getAppController().executeChecked( aCommand, Sequence< PropertyValue >() );
}
return true;
@@ -158,26 +156,20 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList )
// copy the commands so we can use them with the config managers
Sequence< OUString > aCommands( _rList.size() );
- OUString* pCommands = aCommands.getArray();
- for (auto const& copyTask : _rList)
- {
- *pCommands = copyTask.sUNOCommand;
- ++pCommands;
- }
+ std::transform(_rList.begin(), _rList.end(), aCommands.getArray(),
+ [](auto& copyTask) { return copyTask.sUNOCommand; });
Sequence< Reference< XGraphic> > aImages = xImageMgr->getImages(
ImageType::SIZE_DEFAULT | ImageType::COLOR_NORMAL ,
aCommands
);
+ assert(aImages.size() == _rList.size());
- const Reference< XGraphic >* pImages( aImages.getConstArray() );
-
- size_t nIndex = 0;
- for (auto const& task : _rList)
+ for (size_t nIndex = 0; nIndex < _rList.size(); ++nIndex)
{
- OUString sId = OUString::number(reinterpret_cast<sal_uInt64>(new TaskEntry(task)));
- m_xTreeView->append(sId, task.sTitle);
- m_xTreeView->set_image(nIndex++, *pImages++);
+ OUString sId = weld::toId(new TaskEntry(_rList[nIndex]));
+ m_xTreeView->append(sId, _rList[nIndex].sTitle);
+ m_xTreeView->set_image(nIndex, aImages[nIndex]);
}
}
catch(Exception&)
@@ -192,7 +184,7 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList )
void OTasksWindow::Clear()
{
m_xTreeView->all_foreach([this](weld::TreeIter& rEntry){
- TaskEntry* pUserData = reinterpret_cast<TaskEntry*>(m_xTreeView->get_id(rEntry).toUInt64());
+ TaskEntry* pUserData = weld::fromId<TaskEntry*>(m_xTreeView->get_id(rEntry));
delete pUserData;
return false;
});
@@ -313,7 +305,7 @@ void OApplicationDetailView::impl_fillTaskPaneData(ElementType _eType, TaskPaneD
const TaskPaneData& OApplicationDetailView::impl_getTaskPaneData( ElementType _eType )
{
if ( m_aTaskPaneData.empty() )
- m_aTaskPaneData.resize( ELEMENT_COUNT );
+ m_aTaskPaneData.resize( size_t(E_ELEMENT_TYPE_COUNT) );
OSL_ENSURE( ( _eType >= 0 ) && ( _eType < E_ELEMENT_TYPE_COUNT ), "OApplicationDetailView::impl_getTaskPaneData: illegal element type!" );
TaskPaneData& rData = m_aTaskPaneData[ _eType ];