// entries in the "type" ListBox #define DP_TYPELIST_TABLE 0 #define DP_TYPELIST_QUERY 1 #define DP_TYPELIST_SQLNAT 3
ScDataPilotDatabaseDlg::ScDataPilotDatabaseDlg(weld::Window* pParent)
: GenericDialogController(pParent, u"modules/scalc/ui/selectdatasource.ui"_ustr, u"SelectDataSourceDialog"_ustr)
, m_xLbDatabase(m_xBuilder->weld_combo_box(u"database"_ustr))
, m_xCbObject(m_xBuilder->weld_combo_box(u"datasource"_ustr))
, m_xLbType(m_xBuilder->weld_combo_box(u"type"_ustr))
{
weld::WaitObject aWait(pParent); // initializing the database service the first time takes a while
uno::Reference<container::XNameAccess> xItems; if ( nSelect == DP_TYPELIST_TABLE )
{ // get all tables
uno::Reference<sdbcx::XTablesSupplier> xTablesSupp( xConnection, uno::UNO_QUERY ); if ( !xTablesSupp.is() ) return;
xItems = xTablesSupp->getTables();
} else
{ // get all queries
uno::Reference<sdb::XQueriesSupplier> xQueriesSupp( xConnection, uno::UNO_QUERY ); if ( !xQueriesSupp.is() ) return;
xItems = xQueriesSupp->getQueries();
}
if ( !xItems.is() ) return;
// fill list const uno::Sequence<OUString> aNames = xItems->getElementNames(); for( const OUString& aName : aNames )
{
m_xCbObject->append_text(aName);
}
} catch(uno::Exception&)
{ // this may happen if an invalid database is selected -> no DBG_ERROR
TOOLS_WARN_EXCEPTION( "sc", "exception in database");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.