diff options
Diffstat (limited to 'dbaccess/source/ui/app/AppDetailView.cxx')
-rw-r--r-- | dbaccess/source/ui/app/AppDetailView.cxx | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index 8570db552fe1..9ea7dcd4e6da 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; @@ -50,7 +48,7 @@ using namespace ::com::sun::star::beans; using ::com::sun::star::util::URL; using ::com::sun::star::sdb::application::NamedDatabaseObject; -TaskEntry::TaskEntry( const char* _pAsciiUNOCommand, const char* _pHelpID, const char* pTitleResourceID, bool _bHideWhenDisabled ) +TaskEntry::TaskEntry( const char* _pAsciiUNOCommand, TranslateId _pHelpID, TranslateId pTitleResourceID, bool _bHideWhenDisabled ) :sUNOCommand( OUString::createFromAscii( _pAsciiUNOCommand ) ) ,pHelpID( _pHelpID ) ,sTitle( DBA_RES(pTitleResourceID) ) @@ -60,21 +58,22 @@ TaskEntry::TaskEntry( const char* _pAsciiUNOCommand, const char* _pHelpID, const void OTasksWindow::updateHelpText() { - const char* pHelpTextId = nullptr; + 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); } IMPL_LINK(OTasksWindow, onSelected, weld::TreeView&, rTreeView, bool) { m_nCursorIndex = rTreeView.get_cursor_index(); - assert(m_nCursorIndex != -1 && "OTasksWindow::onSelected: invalid entry!"); - URL aCommand; - aCommand.Complete = reinterpret_cast<TaskEntry*>(rTreeView.get_id(m_nCursorIndex).toUInt64())->sUNOCommand; - getDetailView()->getBorderWin().getView()->getAppController().executeChecked( aCommand, Sequence< PropertyValue >() ); - + if (m_nCursorIndex != -1) + { + URL aCommand; + aCommand.Complete = weld::fromId<TaskEntry*>(rTreeView.get_id(m_nCursorIndex))->sUNOCommand; + getDetailView()->getBorderWin().getView()->getAppController().executeChecked( aCommand, Sequence< PropertyValue >() ); + } return true; } @@ -83,7 +82,6 @@ void OTasksWindow::GrabFocus() if (!m_xTreeView) return; m_xTreeView->grab_focus(); - FocusInHdl(*m_xTreeView); } bool OTasksWindow::HasChildPathFocus() const @@ -135,7 +133,7 @@ OTasksWindow::~OTasksWindow() Clear(); } -void OTasksWindow::setHelpText(const char* pId) +void OTasksWindow::setHelpText(TranslateId pId) { if (pId) m_xHelpText->set_text(DBA_RES(pId)); @@ -175,7 +173,7 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList ) size_t nIndex = 0; for (auto const& task : _rList) { - OUString sId = OUString::number(reinterpret_cast<sal_uInt64>(new TaskEntry(task))); + OUString sId = weld::toId(new TaskEntry(task)); m_xTreeView->append(sId, task.sTitle); m_xTreeView->set_image(nIndex++, *pImages++); } @@ -192,7 +190,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; }); @@ -208,7 +206,7 @@ OApplicationDetailView::OApplicationDetailView(weld::Container* pParent, OAppBor , m_xTasksParent(m_xBuilder->weld_container("tasks")) , m_xContainerParent(m_xBuilder->weld_container("container")) , m_xTasks(new dbaui::OTitleWindow(m_xTasksParent.get(), STR_TASKS)) - , m_xTitleContainer(new dbaui::OTitleWindow(m_xContainerParent.get(), nullptr)) + , m_xTitleContainer(new dbaui::OTitleWindow(m_xContainerParent.get(), TranslateId())) , m_rBorderWin(rBorder) { m_xControlHelper = std::make_shared<OAppDetailPageHelper>(m_xTitleContainer->getChildContainer(), m_rBorderWin, ePreviewMode); @@ -313,7 +311,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 ]; |