From a381e73c6f0693d2de99a4963343806361a62748 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 4 Jun 2010 13:46:22 +0200 Subject: changehid: #i111874# remove SmartId, make HID of type rtl::OString, fill in dummies for all explicit help ids --- dbaccess/source/ui/browser/dbtreeview.cxx | 3 ++- dbaccess/source/ui/browser/unodatbr.cxx | 15 ++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'dbaccess/source/ui/browser') diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx index 65185f9f3e73..8129c67afd0f 100644 --- a/dbaccess/source/ui/browser/dbtreeview.cxx +++ b/dbaccess/source/ui/browser/dbtreeview.cxx @@ -64,7 +64,8 @@ DBTreeView::DBTreeView( Window* pParent, const Reference< XMultiServiceFactory > m_pTreeListBox->EnableCheckButton(NULL); m_pTreeListBox->SetDragDropMode( 0 ); m_pTreeListBox->EnableInplaceEditing( sal_True ); - m_pTreeListBox->SetHelpId(HID_TLB_TREELISTBOX); + // FIXME: HELPID + m_pTreeListBox->SetHelpId(""/*HID_TLB_TREELISTBOX*/); m_pTreeListBox->Show(); } diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index f5880cf804de..3b111cbb869d 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -393,7 +393,8 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) m_pTreeView->getListBox().setContextMenuProvider( this ); m_pTreeView->getListBox().setControlActionListener( this ); - m_pTreeView->SetHelpId(HID_CTL_TREEVIEW); + // FIXME: HELPID + m_pTreeView->SetHelpId(""/*HID_CTL_TREEVIEW*/); // a default pos for the splitter, so that the listbox is about 80 (logical) pixels wide m_pSplitter->SetSplitPosPixel( getBrowserView()->LogicToPixel( ::Size( 80, 0 ), MAP_APPFONT ).Width() ); @@ -409,11 +410,15 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) m_pTreeView->setSelChangeHdl( LINK( this, SbaTableQueryBrowser, OnSelectionChange ) ); // TODO - getBrowserView()->getVclControl()->GetDataWindow().SetUniqueId(UID_DATABROWSE_DATAWINDOW); - getBrowserView()->getVclControl()->SetHelpId(HID_CTL_TABBROWSER); - getBrowserView()->SetUniqueId(UID_CTL_CONTENT); + // FIXME: HELPID + getBrowserView()->getVclControl()->GetDataWindow().SetUniqueId(""/*UID_DATABROWSE_DATAWINDOW*/); + // FIXME: HELPID + getBrowserView()->getVclControl()->SetHelpId(""/*HID_CTL_TABBROWSER*/); + // FIXME: HELPID + getBrowserView()->SetUniqueId(""/*UID_CTL_CONTENT*/); if (getBrowserView()->getVclControl()->GetHeaderBar()) - getBrowserView()->getVclControl()->GetHeaderBar()->SetHelpId(HID_DATABROWSE_HEADER); + // FIXME: HELPID + getBrowserView()->getVclControl()->GetHeaderBar()->SetHelpId(""/*HID_DATABROWSE_HEADER*/); InvalidateFeature(ID_BROWSER_EXPLORER); } -- cgit From d1f6ae4254c5f3b6047551d95fe341ac8d6dd56b Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sat, 10 Jul 2010 18:21:24 +0200 Subject: CWS changehid: #i111874#: change code to support HelpIds as byte strings --- dbaccess/source/ui/browser/dbtreeview.cxx | 3 +-- dbaccess/source/ui/browser/genericcontroller.cxx | 4 ++-- dbaccess/source/ui/browser/sbabrw.src | 2 -- dbaccess/source/ui/browser/unodatbr.cxx | 15 +++++---------- 4 files changed, 8 insertions(+), 16 deletions(-) (limited to 'dbaccess/source/ui/browser') diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx index 8129c67afd0f..65185f9f3e73 100644 --- a/dbaccess/source/ui/browser/dbtreeview.cxx +++ b/dbaccess/source/ui/browser/dbtreeview.cxx @@ -64,8 +64,7 @@ DBTreeView::DBTreeView( Window* pParent, const Reference< XMultiServiceFactory > m_pTreeListBox->EnableCheckButton(NULL); m_pTreeListBox->SetDragDropMode( 0 ); m_pTreeListBox->EnableInplaceEditing( sal_True ); - // FIXME: HELPID - m_pTreeListBox->SetHelpId(""/*HID_TLB_TREELISTBOX*/); + m_pTreeListBox->SetHelpId(HID_TLB_TREELISTBOX); m_pTreeListBox->Show(); } diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 5935baafa2c0..b81b073a56bf 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -1387,9 +1387,9 @@ void OGenericUnoController::openHelpAgent(rtl::OUString const& _suHelpStringURL openHelpAgent( aURL ); } -void OGenericUnoController::openHelpAgent(sal_Int32 _nHelpId) +void OGenericUnoController::openHelpAgent(const rtl::OString& _sHelpId) { - openHelpAgent( createHelpAgentURL( lcl_getModuleHelpModuleName( getFrame() ), _nHelpId ) ); + openHelpAgent( createHelpAgentURL( lcl_getModuleHelpModuleName( getFrame() ), _sHelpId ) ); } void OGenericUnoController::openHelpAgent( const URL& _rURL ) diff --git a/dbaccess/source/ui/browser/sbabrw.src b/dbaccess/source/ui/browser/sbabrw.src index 747a2d7ac8cf..476fcf683b3f 100644 --- a/dbaccess/source/ui/browser/sbabrw.src +++ b/dbaccess/source/ui/browser/sbabrw.src @@ -190,14 +190,12 @@ Menu RID_MENU_REFRESH_DATA MenuItem { MID_SBA_QRY_REFRESH - HelpId = SID_FM_REFRESH ; Command = ".uno:Refresh"; }; MenuItem { Identifier = ID_BROWSER_REFRESH_REBUILD; Command = ".uno:DBRebuildData"; - HelpId = HID_BROWSER_REFRESH_REBUILDVIEW; Text [ en-US ] = "Rebuild"; }; }; diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 3b111cbb869d..f5880cf804de 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -393,8 +393,7 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) m_pTreeView->getListBox().setContextMenuProvider( this ); m_pTreeView->getListBox().setControlActionListener( this ); - // FIXME: HELPID - m_pTreeView->SetHelpId(""/*HID_CTL_TREEVIEW*/); + m_pTreeView->SetHelpId(HID_CTL_TREEVIEW); // a default pos for the splitter, so that the listbox is about 80 (logical) pixels wide m_pSplitter->SetSplitPosPixel( getBrowserView()->LogicToPixel( ::Size( 80, 0 ), MAP_APPFONT ).Width() ); @@ -410,15 +409,11 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) m_pTreeView->setSelChangeHdl( LINK( this, SbaTableQueryBrowser, OnSelectionChange ) ); // TODO - // FIXME: HELPID - getBrowserView()->getVclControl()->GetDataWindow().SetUniqueId(""/*UID_DATABROWSE_DATAWINDOW*/); - // FIXME: HELPID - getBrowserView()->getVclControl()->SetHelpId(""/*HID_CTL_TABBROWSER*/); - // FIXME: HELPID - getBrowserView()->SetUniqueId(""/*UID_CTL_CONTENT*/); + getBrowserView()->getVclControl()->GetDataWindow().SetUniqueId(UID_DATABROWSE_DATAWINDOW); + getBrowserView()->getVclControl()->SetHelpId(HID_CTL_TABBROWSER); + getBrowserView()->SetUniqueId(UID_CTL_CONTENT); if (getBrowserView()->getVclControl()->GetHeaderBar()) - // FIXME: HELPID - getBrowserView()->getVclControl()->GetHeaderBar()->SetHelpId(""/*HID_DATABROWSE_HEADER*/); + getBrowserView()->getVclControl()->GetHeaderBar()->SetHelpId(HID_DATABROWSE_HEADER); InvalidateFeature(ID_BROWSER_EXPLORER); } -- cgit From bc3f6b2c1cbe3972642b54d7b20022ebfeb47bae Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 29 Sep 2010 12:51:19 +0200 Subject: dba34b: #i109580# (preparations) --- dbaccess/source/ui/browser/brwctrlr.cxx | 54 ++---------------------- dbaccess/source/ui/browser/unodatbr.cxx | 75 +++++++++++++++++++-------------- 2 files changed, 47 insertions(+), 82 deletions(-) (limited to 'dbaccess/source/ui/browser') diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 6a2161b1c291..db4a6bff8f96 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1205,34 +1205,16 @@ void SbaXDataBrowserController::propertyChange(const PropertyChangeEvent& evt) t } - // the filter or the sort criterias have changed ? -> update our parser - if (evt.PropertyName.equals(PROPERTY_ACTIVECOMMAND)) + if (evt.PropertyName.equals(PROPERTY_FILTER)) { - // if (m_xParser.is()) - //DO_SAFE( m_xParser->setElementaryQuery(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new query to my parser !" ); - } - else if (evt.PropertyName.equals(PROPERTY_FILTER)) - { - // if ( m_xParser.is() && m_xParser->getFilter() != ::comphelper::getString(evt.NewValue)) - //{ - // DO_SAFE( m_xParser->setFilter(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new filter to my parser !" ); - //} InvalidateFeature(ID_BROWSER_REMOVEFILTER); } else if (evt.PropertyName.equals(PROPERTY_HAVING_CLAUSE)) { - //if ( m_xParser.is() && m_xParser->getHavingClause() != ::comphelper::getString(evt.NewValue)) - //{ - // DO_SAFE( m_xParser->setHavingClause(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new filter to my parser !" ); - //} InvalidateFeature(ID_BROWSER_REMOVEFILTER); } else if (evt.PropertyName.equals(PROPERTY_ORDER)) { - //if ( m_xParser.is() && m_xParser->getOrder() != ::comphelper::getString(evt.NewValue)) - //{ - // DO_SAFE( m_xParser->setOrder(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new order to my parser !" ); - //} InvalidateFeature(ID_BROWSER_REMOVEFILTER); } @@ -1911,12 +1893,8 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter) { DlgFilterCrit aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() ); String aFilter; - if(!aDlg.Execute()) - { - //m_xParser->setFilter(sOldVal); - //m_xParser->setHavingClause(sOldHaving); - return; // if so we don't need to actualize the grid - } + if ( !aDlg.Execute() ) + return; // if so we don't need to update the grid aDlg.BuildWherePart(); } else @@ -1925,7 +1903,6 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter) String aOrder; if(!aDlg.Execute()) { - //m_xParser->setOrder(sOldVal); return; // if so we don't need to actualize the grid } aDlg.BuildOrderPart(); @@ -2707,22 +2684,7 @@ void SbaXDataBrowserController::initializeParser() const { // (only if the statement isn't native) // (it is allowed to use the PROPERTY_ISPASSTHROUGH : _after_ loading a form it is valid) xFormSet->getPropertyValue(PROPERTY_SINGLESELECTQUERYCOMPOSER) >>= m_xParser; -/* - const Reference xFactory(::dbtools::getConnection(getRowSet()),UNO_QUERY); - if ( xFactory.is() ) - m_xParser.set(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY); -*/ - } -/* - // initialize the parser with the current sql-statement of the form - if ( m_xParser.is() ) - { - m_xParser->setElementaryQuery(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ACTIVECOMMAND))); - m_xParser->setFilter(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_FILTER))); - m_xParser->setHavingClause(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_HAVING_CLAUSE))); - m_xParser->setOrder(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ORDER))); } -*/ } catch(Exception&) { @@ -2758,16 +2720,6 @@ void SbaXDataBrowserController::unloaded(const EventObject& /*aEvent*/) throw( R // change as a reaction on that event. as we have no chance to be notified of this change (which is // the one we're interested in) we give them time to do what they want to before invalidating our // bound-field-dependent slots .... - /* - try - { - ::comphelper::disposeComponent(m_xParser); - } - catch(Exception&) - { - OSL_ENSURE(0,"Exception thrown by dispose"); - } - */ } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index c65055c582fc..2c1c1f47d6de 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -420,6 +420,24 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) return sal_True; } // ------------------------------------------------------------------------- +namespace +{ + struct SelectValueByName : public ::std::unary_function< ::rtl::OUString, Any > + { + const Any& operator()( ::rtl::OUString const& i_name ) const + { + return m_rCollection.get( i_name ); + } + + SelectValueByName( ::comphelper::NamedValueCollection const& i_collection ) + :m_rCollection( i_collection ) + { + } + + ::comphelper::NamedValueCollection const& m_rCollection; + }; +} + sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star::sdbc::XRowSet > & _rxForm) { if(!m_pCurrentlyDisplayed) @@ -428,46 +446,41 @@ sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star: // this method set all format settings from the orignal table or query try { - // we send all properties at once, maybe the implementation is clever enough to handle one big PropertiesChanged - // more effective than many small PropertyChanged ;) - Sequence< ::rtl::OUString> aProperties(3); - Sequence< Any> aValues(3); - DBTreeListUserData* pData = static_cast(m_pCurrentlyDisplayed->GetUserData()); - OSL_ENSURE( pData, "SbaTableQueryBrowser::InitializeForm: No user data set at the currently displayed entry!" ); - OSL_ENSURE( pData->xObjectProperties.is(), "SbaTableQueryBrowser::InitializeForm: No table available!" ); + ENSURE_OR_RETURN_FALSE( pData, "SbaTableQueryBrowser::InitializeForm: No user data set at the currently displayed entry!" ); + ENSURE_OR_RETURN_FALSE( pData->xObjectProperties.is(), "SbaTableQueryBrowser::InitializeForm: No table available!" ); - if ( pData->xObjectProperties.is() ) - { - sal_Int32 nPos = 0; - // is the filter intially applied ? - aProperties.getArray()[nPos] = PROPERTY_APPLYFILTER; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_APPLYFILTER); + Reference< XPropertySetInfo > xPSI( pData->xObjectProperties->getPropertySetInfo(), UNO_SET_THROW ); - // the initial filter - aProperties.getArray()[nPos] = PROPERTY_FILTER; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_FILTER); + ::comphelper::NamedValueCollection aPropertyValues; - if ( pData->xObjectProperties->getPropertySetInfo()->hasPropertyByName(PROPERTY_HAVING_CLAUSE) ) - { - aProperties.realloc(aProperties.getLength()+1); - aValues.realloc(aValues.getLength()+1); - // the initial having clause - aProperties.getArray()[nPos] = PROPERTY_HAVING_CLAUSE; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_HAVING_CLAUSE); - } + const ::rtl::OUString aTransferProperties[] = + { + PROPERTY_APPLYFILTER, + PROPERTY_FILTER, + PROPERTY_HAVING_CLAUSE, + PROPERTY_ORDER + }; + for ( size_t i=0; i < sizeof( aTransferProperties ) / sizeof( aTransferProperties[0] ); ++i ) + { + if ( !xPSI->hasPropertyByName( aTransferProperties[i] ) ) + continue; + aPropertyValues.put( aTransferProperties[i], pData->xObjectProperties->getPropertyValue( aTransferProperties[i] ) ); + } - // the initial ordering - aProperties.getArray()[nPos] = PROPERTY_ORDER; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_ORDER); + const ::std::vector< ::rtl::OUString > aNames( aPropertyValues.getNames() ); + Sequence< ::rtl::OUString > aPropNames( aNames.size() ); + ::std::copy( aNames.begin(), aNames.end(), aPropNames.getArray() ); - Reference< XMultiPropertySet > xFormMultiSet(_rxForm, UNO_QUERY); - xFormMultiSet->setPropertyValues(aProperties, aValues); - } + Sequence< Any > aPropValues( aNames.size() ); + ::std::transform( aNames.begin(), aNames.end(), aPropValues.getArray(), SelectValueByName( aPropertyValues ) ); + + Reference< XMultiPropertySet > xFormMultiSet( _rxForm, UNO_QUERY ); + xFormMultiSet->setPropertyValues( aPropNames, aPropValues ); } catch(Exception&) { - DBG_ERROR("SbaTableQueryBrowser::InitializeForm : something went wrong !"); + DBG_UNHANDLED_EXCEPTION(); return sal_False; } -- cgit From 3f80aa43531aecebaea860c7efbb4c95d9f4b6d0 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 30 Sep 2010 09:27:40 +0200 Subject: dba34b: #i109580# don't attempt to apply Order clauses which refer to nonexistent tables --- dbaccess/source/ui/browser/brwctrlr.cxx | 68 ++++++++-- dbaccess/source/ui/browser/exsrcbrw.cxx | 2 +- dbaccess/source/ui/browser/unodatbr.cxx | 212 +++++++++++++++++++++++--------- 3 files changed, 209 insertions(+), 73 deletions(-) (limited to 'dbaccess/source/ui/browser') diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index db4a6bff8f96..103267154da0 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -737,6 +737,26 @@ sal_Bool SbaXDataBrowserController::reloadForm( const Reference< XLoadable >& _r if (::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ESCAPE_PROCESSING))) xFormSet->getPropertyValue(PROPERTY_SINGLESELECTQUERYCOMPOSER) >>= m_xParser; + { + const Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY ); + const Reference< XSingleSelectQueryAnalyzer > xAnalyzer( xRowSetProps->getPropertyValue( PROPERTY_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY ); + if ( xAnalyzer.is() ) + { + const Reference< XIndexAccess > xOrderColumns( xAnalyzer->getOrderColumns(), UNO_SET_THROW ); + const sal_Int32 nOrderColumns( xOrderColumns->getCount() ); + for ( sal_Int32 c=0; c xOrderColumn( xOrderColumns->getByIndex(c), UNO_QUERY_THROW ); + ::rtl::OUString sColumnName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_NAME ) >>= sColumnName); + ::rtl::OUString sTableName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName); + (void)sColumnName; + (void)sTableName; + } + } + } + Reference< XWarningsSupplier > xWarnings( _rxLoadable, UNO_QUERY ); if ( xWarnings.is() ) { @@ -807,7 +827,8 @@ sal_Bool SbaXDataBrowserController::Construct(Window* pParent) m_xColumnsSupplier.set(m_xRowSet,UNO_QUERY); m_xLoadable.set(m_xRowSet,UNO_QUERY); - if (!InitializeForm(m_xRowSet)) + Reference< XPropertySet > xFormProperties( m_xRowSet, UNO_QUERY ); + if ( !InitializeForm( xFormProperties ) ) return sal_False; m_xGridModel = CreateGridModel(); @@ -1853,25 +1874,50 @@ void SbaXDataBrowserController::applyParserFilter(const ::rtl::OUString& _rOldFi setCurrentColumnPosition(nPos); } + //------------------------------------------------------------------------------ Reference< XSingleSelectQueryComposer > SbaXDataBrowserController::createParser_nothrow() { - Reference< XSingleSelectQueryComposer > xRet; + Reference< XSingleSelectQueryComposer > xComposer; try { - Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY_THROW); - const Reference xFactory(::dbtools::getConnection(getRowSet()),UNO_QUERY_THROW); - xRet.set(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY_THROW); - xRet->setElementaryQuery(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ACTIVECOMMAND))); - xRet->setFilter(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_FILTER))); - xRet->setHavingClause(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_HAVING_CLAUSE))); - xRet->setOrder(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ORDER))); + const Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW ); + const Reference< XMultiServiceFactory > xFactory( + xRowSetProps->getPropertyValue( PROPERTY_ACTIVE_CONNECTION ), UNO_QUERY_THROW ); + xComposer.set( xFactory->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW ); + + ::rtl::OUString sActiveCommand; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ACTIVECOMMAND ) >>= sActiveCommand ); + if ( sActiveCommand.getLength() > 0 ) + { + xComposer->setElementaryQuery( sActiveCommand ); + } + else + { + ::rtl::OUString sCommand; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND ) >>= sCommand ); + sal_Int32 nCommandType = CommandType::COMMAND; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND_TYPE ) >>= nCommandType ); + xComposer->setCommand( sCommand, nCommandType ); + } + + ::rtl::OUString sFilter; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_FILTER ) >>= sFilter ); + xComposer->setFilter( sFilter ); + + ::rtl::OUString sHavingClause; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_HAVING_CLAUSE ) >>= sHavingClause ); + xComposer->setHavingClause( sHavingClause ); + + ::rtl::OUString sOrder; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ORDER ) >>= sOrder ); + xComposer->setOrder( sOrder ); } - catch(Exception&) + catch ( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } - return xRet; + return xComposer; } //------------------------------------------------------------------------------ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter) diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index 41200c7625ec..ba40583141ab 100644 --- a/dbaccess/source/ui/browser/exsrcbrw.cxx +++ b/dbaccess/source/ui/browser/exsrcbrw.cxx @@ -145,7 +145,7 @@ Reference< XRowSet > SbaExternalSourceBrowser::CreateForm() } //------------------------------------------------------------------------------ -sal_Bool SbaExternalSourceBrowser::InitializeForm(const Reference< XRowSet > & /*xForm*/) +sal_Bool SbaExternalSourceBrowser::InitializeForm(const Reference< XPropertySet > & /*i_formProperties*/) { return sal_True; } diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 2c1c1f47d6de..9e4427a78081 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -419,9 +419,10 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) return sal_True; } -// ------------------------------------------------------------------------- +// --------------------------------------------------------------------------------------------------------------------- namespace { + // ----------------------------------------------------------------------------------------------------------------- struct SelectValueByName : public ::std::unary_function< ::rtl::OUString, Any > { const Any& operator()( ::rtl::OUString const& i_name ) const @@ -438,7 +439,98 @@ namespace }; } -sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star::sdbc::XRowSet > & _rxForm) +// --------------------------------------------------------------------------------------------------------------------- +void SbaTableQueryBrowser::impl_sanitizeRowSetClauses_nothrow() +{ + try + { + Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW ); + sal_Bool bEscapeProcessing = sal_False; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ESCAPE_PROCESSING ) >>= bEscapeProcessing ); + if ( !bEscapeProcessing ) + // don't touch or interpret anything if escape processing is disabled + return; + + Reference< XSingleSelectQueryComposer > xComposer( createParser_nothrow() ); + if ( !xComposer.is() ) + // can't do anything. Already reported via assertion in createParser_nothrow. + return; + + // the tables participating in the statement + Reference< XTablesSupplier > xSuppTables( xComposer, UNO_QUERY_THROW ); + Reference< XNameAccess > xTableNames( xSuppTables->getTables(), UNO_QUERY_THROW ); + + // ............................................................................................................. + // check if the order columns apply to tables which really exist in the statement + const Reference< XIndexAccess > xOrderColumns( xComposer->getOrderColumns(), UNO_SET_THROW ); + const sal_Int32 nOrderColumns( xOrderColumns->getCount() ); + bool invalidColumn = false; + for ( sal_Int32 c=0; ( c < nOrderColumns ) && !invalidColumn; ++c ) + { + const Reference< XPropertySet > xOrderColumn( xOrderColumns->getByIndex(c), UNO_QUERY_THROW ); + ::rtl::OUString sTableName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName); + + if ( !xTableNames->hasByName( sTableName ) ) + invalidColumn = true; + } + + if ( invalidColumn ) + { + // reset the complete order statement at both the row set and the parser + const ::rtl::OUString sEmptyOrder; + xRowSetProps->setPropertyValue( PROPERTY_ORDER, makeAny( sEmptyOrder ) ); + xComposer->setOrder( sEmptyOrder ); + } + + // ............................................................................................................. + // check if the columns participating in the filter refer to existing tables + // TODO: there's no API at all for this. The method which comes nearest to what we need is + // "getStructuredFilter", but it returns pure column names only. That is, for a statement like + // "SELECT * FROM WHERE . = ", it will return "". But + // there's no API at all to retrieve the information about "" - which is what would + // be needed here. + // That'd be a chance to replace getStructuredFilter with something more reasonable. This method + // has at least one other problem: For a clause like " != ", it will return "" + // as column name, "NOT_EQUAL" as operator, and "!= " as value, effectively duplicating the + // information about the operator, and beding all clients to manually remove the "!=" from the value + // string. + // So, what really would be handy, is some + // XNormalizedFilter getNormalizedFilter(); + // with + // interface XDisjunctiveFilterExpression + // { + // XConjunctiveFilterTerm getTerm( int index ); + // } + // interface XConjunctiveFilterTerm + // { + // ComparisonPredicate getPredicate( int index ); + // } + // struct ComparisonPredicate + // { + // XComparisonOperand Lhs; + // SQLFilterOperator Operator; + // XComparisonOperand Rhs; + // } + // interface XComparisonOperand + // { + // SQLFilterOperand Type; + // XPropertySet getColumn(); + // string getLiteral(); + // ... + // } + // enum SQLFilterOperand { Column, Literal, ... } + // + // ... or something like this .... + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +// --------------------------------------------------------------------------------------------------------------------- +sal_Bool SbaTableQueryBrowser::InitializeForm( const Reference< XPropertySet > & i_formProperties ) { if(!m_pCurrentlyDisplayed) return sal_True; @@ -475,16 +567,17 @@ sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star: Sequence< Any > aPropValues( aNames.size() ); ::std::transform( aNames.begin(), aNames.end(), aPropValues.getArray(), SelectValueByName( aPropertyValues ) ); - Reference< XMultiPropertySet > xFormMultiSet( _rxForm, UNO_QUERY ); + Reference< XMultiPropertySet > xFormMultiSet( i_formProperties, UNO_QUERY_THROW ); xFormMultiSet->setPropertyValues( aPropNames, aPropValues ); + + impl_sanitizeRowSetClauses_nothrow(); } - catch(Exception&) + catch ( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); return sal_False; } - return sal_True; } @@ -2306,77 +2399,74 @@ sal_Bool SbaTableQueryBrowser::implSelect(const ::svx::ODataAccessDescriptor& _r sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSourceName, const ::rtl::OUString& _rCommand, const sal_Int32 _nCommandType, const sal_Bool _bEscapeProcessing, const SharedConnection& _rxConnection) { - Reference xProp(getRowSet(),UNO_QUERY); - if(xProp.is()) + try { - Reference< ::com::sun::star::form::XLoadable > xLoadable(xProp,UNO_QUERY); - try - { - // the values allowing the RowSet to re-execute - xProp->setPropertyValue(PROPERTY_DATASOURCENAME, makeAny(_rDataSourceName)); - if(_rxConnection.is()) - xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( _rxConnection.getTyped() ) ); + Reference xProp( getRowSet(), UNO_QUERY_THROW ); + Reference< XLoadable > xLoadable( xProp, UNO_QUERY_THROW ); + // the values allowing the RowSet to re-execute + xProp->setPropertyValue(PROPERTY_DATASOURCENAME, makeAny(_rDataSourceName)); + if(_rxConnection.is()) + xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( _rxConnection.getTyped() ) ); - // set this _before_ setting the connection, else the rowset would rebuild it ... - xProp->setPropertyValue(PROPERTY_COMMAND_TYPE, makeAny(_nCommandType)); - xProp->setPropertyValue(PROPERTY_COMMAND, makeAny(_rCommand)); - xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, ::cppu::bool2any(_bEscapeProcessing)); - if ( m_bPreview ) - { - xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, makeAny(FetchDirection::FORWARD)); - } + // set this _before_ setting the connection, else the rowset would rebuild it ... + xProp->setPropertyValue(PROPERTY_COMMAND_TYPE, makeAny(_nCommandType)); + xProp->setPropertyValue(PROPERTY_COMMAND, makeAny(_rCommand)); + xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, ::cppu::bool2any(_bEscapeProcessing)); + if ( m_bPreview ) + { + xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, makeAny(FetchDirection::FORWARD)); + } - // the formatter depends on the data source we're working on, so rebuild it here ... - initFormatter(); + // the formatter depends on the data source we're working on, so rebuild it here ... + initFormatter(); - // switch the grid to design mode while loading - getBrowserView()->getGridControl()->setDesignMode(sal_True); - InitializeForm(getRowSet()); + // switch the grid to design mode while loading + getBrowserView()->getGridControl()->setDesignMode(sal_True); + InitializeForm( xProp ); - sal_Bool bSuccess = sal_True; + sal_Bool bSuccess = sal_True; + { { - { - Reference< XNameContainer > xColContainer(getFormComponent(), UNO_QUERY); - // first we have to clear the grid - clearGridColumns(xColContainer); - } - FormErrorHelper aHelper(this); - // load the form - bSuccess = reloadForm(xLoadable); + Reference< XNameContainer > xColContainer(getFormComponent(), UNO_QUERY); + // first we have to clear the grid + clearGridColumns(xColContainer); + } + FormErrorHelper aHelper(this); + // load the form + bSuccess = reloadForm(xLoadable); - // initialize the model - InitializeGridModel(getFormComponent()); + // initialize the model + InitializeGridModel(getFormComponent()); - if ( m_bPreview ) - initializePreviewMode(); - - LoadFinished(sal_True); - } + if ( m_bPreview ) + initializePreviewMode(); - InvalidateAll(); - return bSuccess; - } - catch( const SQLException& e ) - { - Any aException( ::cppu::getCaughtException() ); - showError( SQLExceptionInfo( aException ) ); - } - catch( const WrappedTargetException& e ) - { - SQLException aSql; - if ( e.TargetException.isExtractableTo( ::cppu::UnoType< SQLException >::get() ) ) - showError( SQLExceptionInfo( e.TargetException ) ); - else - { - DBG_UNHANDLED_EXCEPTION(); - } + LoadFinished(sal_True); } - catch(Exception&) + + InvalidateAll(); + return bSuccess; + } + catch( const SQLException& e ) + { + Any aException( ::cppu::getCaughtException() ); + showError( SQLExceptionInfo( aException ) ); + } + catch( const WrappedTargetException& e ) + { + SQLException aSql; + if ( e.TargetException.isExtractableTo( ::cppu::UnoType< SQLException >::get() ) ) + showError( SQLExceptionInfo( e.TargetException ) ); + else { DBG_UNHANDLED_EXCEPTION(); } } + catch(Exception&) + { + DBG_UNHANDLED_EXCEPTION(); + } InvalidateAll(); return sal_False; -- cgit From 13b5be5ec753e5d08ae10b78114147d94a21c152 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 30 Sep 2010 09:49:33 +0200 Subject: dba34b: #ii109580# impl_sanitizeRowSetClauses_nothrow: completed the check for order column validity --- dbaccess/source/ui/browser/unodatbr.cxx | 38 ++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'dbaccess/source/ui/browser') diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 9e4427a78081..d34ec0c4e11a 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -457,8 +457,12 @@ void SbaTableQueryBrowser::impl_sanitizeRowSetClauses_nothrow() return; // the tables participating in the statement - Reference< XTablesSupplier > xSuppTables( xComposer, UNO_QUERY_THROW ); - Reference< XNameAccess > xTableNames( xSuppTables->getTables(), UNO_QUERY_THROW ); + const Reference< XTablesSupplier > xSuppTables( xComposer, UNO_QUERY_THROW ); + const Reference< XNameAccess > xTableNames( xSuppTables->getTables(), UNO_QUERY_THROW ); + + // the columns participating in the statement + const Reference< XColumnsSupplier > xSuppColumns( xComposer, UNO_QUERY_THROW ); + const Reference< XNameAccess > xColumnNames( xSuppColumns->getColumns(), UNO_QUERY_THROW ); // ............................................................................................................. // check if the order columns apply to tables which really exist in the statement @@ -469,10 +473,34 @@ void SbaTableQueryBrowser::impl_sanitizeRowSetClauses_nothrow() { const Reference< XPropertySet > xOrderColumn( xOrderColumns->getByIndex(c), UNO_QUERY_THROW ); ::rtl::OUString sTableName; - OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName); + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName ); + ::rtl::OUString sColumnName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_NAME ) >>= sColumnName ); + + if ( sTableName.getLength() == 0 ) + { + if ( !xColumnNames->hasByName( sColumnName ) ) + { + invalidColumn = true; + break; + } + } + else + { + if ( !xTableNames->hasByName( sTableName ) ) + { + invalidColumn = true; + break; + } - if ( !xTableNames->hasByName( sTableName ) ) - invalidColumn = true; + const Reference< XColumnsSupplier > xSuppTableColumns( xTableNames->getByName( sTableName ), UNO_QUERY_THROW ); + const Reference< XNameAccess > xTableColumnNames( xSuppTableColumns->getColumns(), UNO_QUERY_THROW ); + if ( !xTableColumnNames->hasByName( sColumnName ) ) + { + invalidColumn = true; + break; + } + } } if ( invalidColumn ) -- cgit From 5cf47c0008eb4126cfc41c59fbeeb4d73c8e22b1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 25 Nov 2010 14:28:03 +0100 Subject: undoapi: split OSingleDocumentController into DBSubComponentController (which the report design's controller will be derived from) and the still-so-named OSingleDocumentController. Module reportdesign does not compile with this change, this is yet to come. --- dbaccess/source/ui/browser/dataview.cxx | 39 +++++---------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) (limited to 'dbaccess/source/ui/browser') diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx index 382aac477727..8112250ad23e 100644 --- a/dbaccess/source/ui/browser/dataview.cxx +++ b/dbaccess/source/ui/browser/dataview.cxx @@ -44,9 +44,6 @@ #ifndef _SFXIMGMGR_HXX #include #endif -#ifndef _SV_FIXED_HXX -#include -#endif #ifndef DBAUI_ICONTROLLER_HXX #include "IController.hxx" #endif @@ -103,11 +100,12 @@ namespace dbaui :Window(pParent,nStyle) ,m_xServiceFactory(_rFactory) ,m_rController( _rController ) - ,m_pSeparator( NULL ) + ,m_aSeparator( this ) { DBG_CTOR(ODataView,NULL); m_rController.acquire(); m_pAccel.reset(::svt::AcceleratorExecute::createAcceleratorHelper()); + m_aSeparator.Show(); } // ------------------------------------------------------------------------- @@ -120,29 +118,9 @@ namespace dbaui { DBG_DTOR(ODataView,NULL); - enableSeparator( sal_False ); m_rController.release(); } - // ------------------------------------------------------------------------- - void ODataView::enableSeparator( const sal_Bool _bEnable ) - { - if ( _bEnable == isSeparatorEnabled() ) - // nothing to do - return; - - if ( _bEnable ) - { - m_pSeparator = new FixedLine( this ); - m_pSeparator->Show( ); - } - else - { - ::std::auto_ptr aTemp(m_pSeparator); - m_pSeparator = NULL; - } - Resize(); - } // ------------------------------------------------------------------------- void ODataView::resizeDocumentView( Rectangle& /*_rPlayground*/ ) { @@ -167,15 +145,10 @@ namespace dbaui { Rectangle aPlayground( _rPlayground ); - // position thew separator - if ( m_pSeparator ) - { - Size aSeparatorSize = Size( aPlayground.GetWidth(), 2 ); - - m_pSeparator->SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize ); - - aPlayground.Top() += aSeparatorSize.Height() + 1; - } + // position the separator + const Size aSeparatorSize = Size( aPlayground.GetWidth(), 2 ); + m_aSeparator.SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize ); + aPlayground.Top() += aSeparatorSize.Height() + 1; // position the controls of the document's view resizeDocumentView( aPlayground ); -- cgit From f2478305d255a1ea18191413406c4edf21f704c9 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 26 Nov 2010 09:46:54 +0100 Subject: undoapi: assert unknown slots in ImplInvalidateFeature --- dbaccess/source/ui/browser/genericcontroller.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'dbaccess/source/ui/browser') diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index b81b073a56bf..0c0190318c72 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -704,6 +704,18 @@ void OGenericUnoController::InvalidateFeature_Impl() // ----------------------------------------------------------------------- void OGenericUnoController::ImplInvalidateFeature( sal_Int32 _nId, const Reference< XStatusListener >& _xListener, sal_Bool _bForceBroadcast ) { +#if OSL_DEBUG_LEVEL > 0 + if ( _nId != -1 ) + { + SupportedFeatures::iterator aFeaturePos = ::std::find_if( + m_aSupportedFeatures.begin(), + m_aSupportedFeatures.end(), + ::std::bind2nd( CompareFeatureById(), _nId ) + ); + OSL_ENSURE( aFeaturePos != m_aSupportedFeatures.end(), "OGenericUnoController::ImplInvalidateFeature: invalidating an unsupported feature is suspicious, at least!" ); + } +#endif + FeatureListener aListener; aListener.nId = _nId; aListener.xListener = _xListener; -- cgit From 5c5ac6f63c3c4cb8fd02d8749656d804f0db1046 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Fri, 26 Nov 2010 11:14:33 +0100 Subject: dba34b: #i114309# set default values for bit boolean and reset when we are on the insertrow --- dbaccess/source/ui/browser/unodatbr.cxx | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'dbaccess/source/ui/browser') diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index d34ec0c4e11a..d15fb125f234 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -735,6 +736,7 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: ::std::vector< NamedValue > aInitialValues; ::std::vector< ::rtl::OUString > aCopyProperties; + Any aDefault; switch(nType) { @@ -751,6 +753,8 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TriState" ) ), makeAny( sal_Bool( ColumnValue::NO_NULLS != nNullable ) ) ) ); + if ( ColumnValue::NO_NULLS == nNullable ) + aDefault <<= (sal_Int16)STATE_NOCHECK; } break; @@ -792,18 +796,17 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: Reference< XPropertySetInfo > xGridColPSI( xGridCol->getPropertySetInfo(), UNO_SET_THROW ); // calculate the default - Any aDefault; if ( xGridColPSI->hasPropertyByName( PROPERTY_CONTROLDEFAULT ) ) - aDefault = xColumn->getPropertyValue( PROPERTY_CONTROLDEFAULT ); - - // default value - if ( nType == DataType::BIT || nType == DataType::BOOLEAN ) { - if ( aDefault.hasValue() ) - aDefault <<= (comphelper::getString(aDefault).toInt32() == 0) ? (sal_Int16)STATE_NOCHECK : (sal_Int16)STATE_CHECK; - else - aDefault <<= ((sal_Int16)STATE_DONTKNOW); - + aDefault = xColumn->getPropertyValue( PROPERTY_CONTROLDEFAULT ); + // default value + if ( nType == DataType::BIT || nType == DataType::BOOLEAN ) + { + if ( aDefault.hasValue() ) + aDefault <<= (comphelper::getString(aDefault).toInt32() == 0) ? (sal_Int16)STATE_NOCHECK : (sal_Int16)STATE_CHECK; + else + aDefault <<= ((sal_Int16)STATE_DONTKNOW); + } } if ( aDefault.hasValue() ) @@ -2467,6 +2470,14 @@ sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSou // initialize the model InitializeGridModel(getFormComponent()); + Any aVal = xProp->getPropertyValue(PROPERTY_ISNEW); + if (aVal.hasValue() && ::comphelper::getBOOL(aVal)) + { + // then set the default values and the parameters given from the parent + Reference< XReset> xReset(xProp, UNO_QUERY); + xReset->reset(); + } + if ( m_bPreview ) initializePreviewMode(); -- cgit From 409873c1c1267b71eb53e4d5536fc240510438d9 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Fri, 14 Jan 2011 15:00:11 +0100 Subject: removetooltypes01: #i112600# remove tooltypes from dbaccess --- dbaccess/source/ui/browser/brwview.cxx | 4 ++-- dbaccess/source/ui/browser/dbexchange.cxx | 2 +- dbaccess/source/ui/browser/dbtreemodel.hxx | 4 ++-- dbaccess/source/ui/browser/dsEntriesNoExp.cxx | 4 ++-- dbaccess/source/ui/browser/genericcontroller.cxx | 2 +- dbaccess/source/ui/browser/sbagrid.cxx | 2 +- dbaccess/source/ui/browser/unodatbr.cxx | 8 ++++---- 7 files changed, 13 insertions(+), 13 deletions(-) (limited to 'dbaccess/source/ui/browser') diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index 44a6b40e1f2f..358e5b99e9be 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -357,8 +357,8 @@ long UnoDataBrowserView::PreNotify( NotifyEvent& rNEvt ) { const KeyEvent* pKeyEvt = rNEvt.GetKeyEvent(); const KeyCode& rKeyCode = pKeyEvt->GetKeyCode(); - if ( ( rKeyCode == KeyCode( KEY_E, TRUE, TRUE, FALSE, FALSE ) ) - || ( rKeyCode == KeyCode( KEY_TAB, TRUE, FALSE, FALSE, FALSE ) ) + if ( ( rKeyCode == KeyCode( KEY_E, sal_True, sal_True, sal_False, sal_False ) ) + || ( rKeyCode == KeyCode( KEY_TAB, sal_True, sal_False, sal_False, sal_False ) ) ) { if ( m_pTreeView && m_pVclControl && m_pTreeView->HasChildPathFocus() ) diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx index 972f9be83934..8e7131d129b4 100644 --- a/dbaccess/source/ui/browser/dbexchange.cxx +++ b/dbaccess/source/ui/browser/dbexchange.cxx @@ -179,7 +179,7 @@ namespace dbaui // ----------------------------------------------------------------------------- sal_Bool ODataClipboard::GetData( const DataFlavor& rFlavor ) { - const ULONG nFormat = SotExchange::GetFormat(rFlavor); + const sal_uLong nFormat = SotExchange::GetFormat(rFlavor); switch (nFormat) { case SOT_FORMAT_RTF: diff --git a/dbaccess/source/ui/browser/dbtreemodel.hxx b/dbaccess/source/ui/browser/dbtreemodel.hxx index 8894f85ce430..33186543afab 100644 --- a/dbaccess/source/ui/browser/dbtreemodel.hxx +++ b/dbaccess/source/ui/browser/dbtreemodel.hxx @@ -51,8 +51,8 @@ // tables holds the nameaccess for the tables // table holds the table -#define CONTAINER_QUERIES ULONG( 0 ) -#define CONTAINER_TABLES ULONG( 1 ) +#define CONTAINER_QUERIES sal_uLong( 0 ) +#define CONTAINER_TABLES sal_uLong( 1 ) namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } } } } diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx index 5fb5b0f985c6..af9d43d226ef 100644 --- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx +++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx @@ -264,8 +264,8 @@ void SbaTableQueryBrowser::notifyHiContrastChanged() } // find the proper item, and set its icons - USHORT nCount = pEntryLoop->ItemCount(); - for (USHORT i=0;iItemCount(); + for (sal_uInt16 i=0;iGetItem(i); if ( !pItem || ( pItem->IsA() != SV_ITEM_ID_LBOXCONTEXTBMP ) ) diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index b81b073a56bf..7115ffa5636c 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -403,7 +403,7 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen throw RuntimeException( ::rtl::OUString::createFromAscii( "unable to create a view" ), *this ); if ( m_bReadOnly || m_bPreview ) - pView->EnableInput( FALSE ); + pView->EnableInput( sal_False ); impl_initialize(); } diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index bb0784c0ce53..be86427f2802 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -936,7 +936,7 @@ SbaGridControl::SbaGridControl(Reference< XMultiServiceFactory > _rM, :FmGridControl(_rM,pParent, _pPeer, nBits) ,m_pMasterListener(NULL) ,m_nAsyncDropEvent(0) - ,m_nCurrentActionColId((USHORT)-1) + ,m_nCurrentActionColId((sal_uInt16)-1) ,m_bActivatingForDrop(sal_False) { DBG_CTOR(SbaGridControl ,NULL); diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index c65055c582fc..b8837aac6c25 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -480,8 +480,8 @@ void SbaTableQueryBrowser::initializePreviewMode() { if ( getBrowserView() && getBrowserView()->getVclControl() ) { - getBrowserView()->getVclControl()->AlwaysEnableInput( FALSE ); - getBrowserView()->getVclControl()->EnableInput( FALSE ); + getBrowserView()->getVclControl()->AlwaysEnableInput( sal_False ); + getBrowserView()->getVclControl()->EnableInput( sal_False ); getBrowserView()->getVclControl()->ForceHideScrollbars( sal_True ); } Reference< XPropertySet > xDataSourceSet(getRowSet(), UNO_QUERY); @@ -2006,7 +2006,7 @@ void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDb m_pTreeView->getListBox().InsertEntry( _rQueryName, _rQueryImage, _rQueryImage, pDatasourceEntry, - TRUE /*ChildsOnDemand*/, LIST_APPEND, pQueriesData ); + sal_True /*ChildsOnDemand*/, LIST_APPEND, pQueriesData ); } // the child for the tables container @@ -2016,7 +2016,7 @@ void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDb m_pTreeView->getListBox().InsertEntry( _rTableName, _rTableImage, _rTableImage, pDatasourceEntry, - TRUE /*ChildsOnDemand*/, LIST_APPEND, pTablesData ); + sal_True /*ChildsOnDemand*/, LIST_APPEND, pTablesData ); } } -- cgit From 1f9060d1e01be5f4f830ee772950d0a98b362064 Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Sat, 12 Mar 2011 19:20:31 -0600 Subject: fix mis-merge --- dbaccess/source/ui/browser/brwctrlr.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'dbaccess/source/ui/browser') diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 29e243823b67..6e07b440565e 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -2723,6 +2723,7 @@ void SbaXDataBrowserController::initializeParser() const { // (only if the statement isn't native) // (it is allowed to use the PROPERTY_ISPASSTHROUGH : _after_ loading a form it is valid) xFormSet->getPropertyValue(PROPERTY_SINGLESELECTQUERYCOMPOSER) >>= m_xParser; + } } catch(Exception&) { -- cgit