diff options
Diffstat (limited to 'dbaccess/source/ui/misc/WTypeSelect.cxx')
-rw-r--r-- | dbaccess/source/ui/misc/WTypeSelect.cxx | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 6f3fbd79d22c..f27dcc921168 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -19,7 +19,7 @@ #include <WTypeSelect.hxx> #include <bitmaps.hlst> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <osl/diagnose.h> #include <FieldDescriptions.hxx> #include <WCopyTable.hxx> @@ -33,7 +33,6 @@ using namespace ::dbaui; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::util; using namespace ::com::sun::star::sdbc; @@ -86,7 +85,7 @@ void OWizTypeSelectControl::CellModified(sal_Int32 nRow, sal_uInt16 nColId ) OFieldDescription* pCurFieldDescr = getCurrentFieldDescData(); const sal_Int32 nPos = pListBox->find_text(pCurFieldDescr->GetName()); - pCurFieldDescr = reinterpret_cast< OFieldDescription* >( pListBox->get_id(nPos).toInt64() ); + pCurFieldDescr = weld::fromId<OFieldDescription*>(pListBox->get_id(nPos)); OSL_ENSURE( pCurFieldDescr, "OWizTypeSelectControl::CellModified: Columnname/type not found in the listbox!" ); if ( !pCurFieldDescr ) return; @@ -153,7 +152,7 @@ void OWizTypeSelectControl::CellModified(sal_Int32 nRow, sal_uInt16 nColId ) pListBox->remove(nPos); pListBox->insert_text(nPos, pCurFieldDescr->GetName()); - pListBox->set_id(nPos, OUString::number(reinterpret_cast<sal_Int64>(pCurFieldDescr))); + pListBox->set_id(nPos, weld::toId(pCurFieldDescr)); pWiz->replaceColumn(nPos,pCurFieldDescr,sOldName); } @@ -205,7 +204,6 @@ OUString OWizTypeSelectControl::getAutoIncrementValue() const OWizTypeSelect::OWizTypeSelect(weld::Container* pPage, OCopyTableWizard* pWizard, SvStream* pStream) : OWizardPage(pPage, pWizard, "dbaccess/ui/typeselectpage.ui", "TypeSelect") , m_xColumnNames(new OWizTypeSelectList(m_xBuilder->weld_tree_view("columnnames"))) - , m_xColumns(m_xBuilder->weld_label("columns")) , m_xControlContainer(m_xBuilder->weld_container("control_container")) , m_xTypeControl(new OWizTypeSelectControl(m_xControlContainer.get(), this)) , m_xAutoType(m_xBuilder->weld_label("autotype")) @@ -248,7 +246,7 @@ OUString OWizTypeSelect::GetTitle() const IMPL_LINK_NOARG(OWizTypeSelect, ColumnSelectHdl, weld::TreeView&, void) { - OFieldDescription* pField = reinterpret_cast<OFieldDescription*>(m_xColumnNames->get_selected_id().toInt64()); + OFieldDescription* pField = weld::fromId<OFieldDescription*>(m_xColumnNames->get_selected_id()); if (pField) m_xTypeControl->DisplayData(pField); @@ -265,7 +263,7 @@ void OWizTypeSelect::Reset() const ODatabaseExport::TColumnVector& rDestColumns = m_pParent->getDestVector(); for (auto const& column : rDestColumns) { - OUString sId(OUString::number(reinterpret_cast<sal_Int64>(column->second))); + OUString sId(weld::toId(column->second)); m_xColumnNames->append(sId, column->first); if (column->second->IsPrimaryKey()) m_xColumnNames->set_image(nCount, BMP_PRIMARY_KEY); @@ -288,7 +286,7 @@ void OWizTypeSelect::Activate( ) bool OWizTypeSelect::LeavePage() { bool bDuplicateName = false; - OFieldDescription* pField = reinterpret_cast<OFieldDescription*>(m_xColumnNames->get_selected_id().toInt64()); + OFieldDescription* pField = weld::fromId<OFieldDescription*>(m_xColumnNames->get_selected_id()); if ( pField ) { m_xTypeControl->SaveData(pField); @@ -339,7 +337,7 @@ bool OWizTypeSelectList::IsPrimaryKeyAllowed() const for( sal_Int32 j = 0; m_bPKey && j < nCount; ++j ) { - OFieldDescription* pField = reinterpret_cast<OFieldDescription*>(m_xControl->get_id(aRows[j]).toInt64()); + OFieldDescription* pField = weld::fromId<OFieldDescription*>(m_xControl->get_id(aRows[j])); if(!pField || pField->getTypeInfo()->nSearchType == ColumnSearch::NONE) return false; } @@ -374,7 +372,7 @@ IMPL_LINK(OWizTypeSelectList, CommandHdl, const CommandEvent&, rCEvt, bool) bool bCheckOk = false; for(sal_Int32 j = 0 ; j < nCount ; ++j) { - OFieldDescription* pFieldDescr = reinterpret_cast<OFieldDescription*>(m_xControl->get_id(j).toInt64()); + OFieldDescription* pFieldDescr = weld::fromId<OFieldDescription*>(m_xControl->get_id(j)); // if at least one of the fields is selected but not in the primary key, // or is in the primary key but not selected, then don't check the // primary key checkbox. @@ -390,13 +388,13 @@ IMPL_LINK(OWizTypeSelectList, CommandHdl, const CommandEvent&, rCEvt, bool) if (bCheckOk) xContextMenu->set_active("primarykey", true); - OString sCommand(xContextMenu->popup_at_rect(m_xControl.get(), tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1)))); + OUString sCommand(xContextMenu->popup_at_rect(m_xControl.get(), tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1)))); if (sCommand != "primarykey") return true; for (sal_Int32 j = 0 ; j < nCount; ++j) { - OFieldDescription* pFieldDescr = reinterpret_cast<OFieldDescription*>(m_xControl->get_id(j).toInt64()); + OFieldDescription* pFieldDescr = weld::fromId<OFieldDescription*>(m_xControl->get_id(j)); if (pFieldDescr) { if(!bCheckOk && m_xControl->is_selected(j)) |