diff options
author | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-07 09:15:49 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-07 09:15:49 +0100 |
commit | f1b864563766e1ab78c1242711b0e8906bcaa345 (patch) | |
tree | 7fbeab87c311be1f212a5984290ce9a1b189397e /extensions | |
parent | 738f9f2e8577984fa90f1376078e18c1f57bf64b (diff) |
enable hierachical queries
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 30 | ||||
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.hxx | 9 |
2 files changed, 35 insertions, 4 deletions
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 6f580ec2422e..78fa5db34561 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -33,6 +33,7 @@ #include "controltype.hxx" #include "propctrlr.hrc" +#include "extensio.hrc" #include "fontdialog.hxx" #include "formcomponenthandler.hxx" #include "formlinkdialog.hxx" @@ -2538,17 +2539,38 @@ namespace pcr Reference< XQueriesSupplier > xSupplyQueries( m_xRowSetConnection, UNO_QUERY ); Reference< XNameAccess > xQueryNames; if ( xSupplyQueries.is() ) + { xQueryNames = xSupplyQueries->getQueries(); - DBG_ASSERT( xQueryNames.is(), "FormComponentPropertyHandler::impl_fillQueryNames_throw: no way to obtain the queries of the connection!" ); - if ( !xQueryNames.is() ) + impl_fillQueryNames_throw(xQueryNames,_out_rNames); + } + } + //------------------------------------------------------------------------ + void FormComponentPropertyHandler::impl_fillQueryNames_throw( const Reference< XNameAccess >& _xQueryNames,::std::vector< ::rtl::OUString >& _out_rNames,const ::rtl::OUString& _sName ) const + { + DBG_ASSERT( _xQueryNames.is(), "FormComponentPropertyHandler::impl_fillQueryNames_throw: no way to obtain the queries of the connection!" ); + if ( !_xQueryNames.is() ) return; - Sequence< ::rtl::OUString> aQueryNames = xQueryNames->getElementNames(); + Sequence< ::rtl::OUString> aQueryNames = _xQueryNames->getElementNames(); sal_uInt32 nCount = aQueryNames.getLength(); const ::rtl::OUString* pQueryNames = aQueryNames.getConstArray(); + sal_Bool bAdd = _sName.getLength(); for ( sal_uInt32 i=0; i<nCount; i++, ++pQueryNames ) - _out_rNames.push_back( *pQueryNames ); + { + ::rtl::OUStringBuffer sTemp; + if ( bAdd ) + { + sTemp.append(_sName); + sTemp.appendAscii("/"); + } + sTemp.append(*pQueryNames); + Reference< XNameAccess > xSubQueries(_xQueryNames->getByName(*pQueryNames),UNO_QUERY); + if ( xSubQueries.is() ) + impl_fillQueryNames_throw(xSubQueries,_out_rNames,sTemp.makeStringAndClear()); + else + _out_rNames.push_back( sTemp.makeStringAndClear() ); + } } //------------------------------------------------------------------------ diff --git a/extensions/source/propctrlr/formcomponenthandler.hxx b/extensions/source/propctrlr/formcomponenthandler.hxx index 9b972896e856..d02a05c8e650 100644 --- a/extensions/source/propctrlr/formcomponenthandler.hxx +++ b/extensions/source/propctrlr/formcomponenthandler.hxx @@ -238,6 +238,15 @@ namespace pcr */ void impl_fillQueryNames_throw( ::std::vector< ::rtl::OUString >& _out_rNames ) const; + /** describes the UI for selecting a query name + + @precond + m_xRowSetConnection is not <NULL/> + */ + void impl_fillQueryNames_throw( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xQueryNames + ,::std::vector< ::rtl::OUString >& _out_rNames + ,const ::rtl::OUString& _sName = ::rtl::OUString() ) const; + /** describes the UI for selecting a ListSource (for list-like form controls) @precond ->m_xRowSetConnection is not <NULL/> |