diff options
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/abpilot/datasourcehandling.cxx | 86 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.cxx | 39 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.hxx | 6 | ||||
-rw-r--r-- | extensions/source/bibliography/framectr.cxx | 6 | ||||
-rw-r--r-- | extensions/source/bibliography/framectr.hxx | 6 | ||||
-rw-r--r-- | extensions/source/bibliography/general.cxx | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/editpropertyhandler.cxx | 1 | ||||
-rw-r--r-- | extensions/source/propctrlr/eventhandler.cxx | 6 |
8 files changed, 64 insertions, 90 deletions
diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index 14ad3543ac51..269c84adf163 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -30,30 +30,34 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" + +#include "abpresid.hrc" +#include "abptypes.hxx" +#include "componentmodule.hxx" #include "datasourcehandling.hxx" + #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/sdb/SQLContext.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> -#include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/frame/XStorable.hpp> -#include <com/sun/star/uno/XNamingService.hpp> #include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/sdbc/XConnection.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> +#include <com/sun/star/sdb/XDatabaseRegistrations.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> -#include <tools/debug.hxx> +#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/uno/XNamingService.hpp> + #include <comphelper/interaction.hxx> -#include <vcl/stdtext.hxx> -#ifndef EXTENSIONS_ABPRESID_HRC -#include "abpresid.hrc" -#endif -#include "componentmodule.hxx" -#include "abptypes.hxx" +#include <comphelper/componentcontext.hxx> +#include <tools/debug.hxx> +#include <tools/diagnose_ex.h> #include <unotools/confignode.hxx> #include <unotools/sharedunocomponent.hxx> +#include <vcl/stdtext.hxx> //......................................................................... namespace abp @@ -76,26 +80,6 @@ namespace abp struct PackageAccessControl { }; //===================================================================== - //-------------------------------------------------------------------- - static const ::rtl::OUString& getDbRegisteredNamesNodeName() - { - static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("org.openoffice.Office.DataAccess/RegisteredNames"); - return s_sNodeName; - } - - //-------------------------------------------------------------------- - static const ::rtl::OUString& getDbNameNodeName() - { - static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("Name"); - return s_sNodeName; - } - - //-------------------------------------------------------------------- - static const ::rtl::OUString& getDbLocationNodeName() - { - static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("Location"); - return s_sNodeName; - } //--------------------------------------------------------------------- static Reference< XNameAccess > lcl_getDataSourceContext( const Reference< XMultiServiceFactory >& _rxORB ) SAL_THROW (( Exception )) { @@ -173,28 +157,24 @@ namespace abp const Reference< XMultiServiceFactory >& _rxORB, const ::rtl::OUString& _sName, const ::rtl::OUString& _sURL ) SAL_THROW (( ::com::sun::star::uno::Exception )) { - // the config node where all pooling relevant info are stored under - OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory( - _rxORB, getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_UPDATABLE); - - if (!aDbRegisteredNamesRoot.isValid()) - // already asserted by the OConfigurationTreeRoot - return; - - OSL_ENSURE(_sName.getLength(),"No Name given!"); - OSL_ENSURE(_sURL.getLength(),"No URL given!"); - - OConfigurationNode aThisDriverSettings; - if ( aDbRegisteredNamesRoot.hasByName(_sName) ) - aThisDriverSettings = aDbRegisteredNamesRoot.openNode(_sName); - else - aThisDriverSettings = aDbRegisteredNamesRoot.createNode(_sName); + OSL_ENSURE( _sName.getLength(), "lcl_registerDataSource: invalid name!" ); + OSL_ENSURE( _sURL.getLength(), "lcl_registerDataSource: invalid URL!" ); + try + { - // set the values - aThisDriverSettings.setNodeValue(getDbNameNodeName(), makeAny(_sName)); - aThisDriverSettings.setNodeValue(getDbLocationNodeName(), makeAny(_sURL)); + ::comphelper::ComponentContext aContext( _rxORB ); + Reference< XDatabaseRegistrations > xRegistrations( + aContext.createComponent( "com.sun.star.sdb.DatabaseContext" ), UNO_QUERY_THROW ); - aDbRegisteredNamesRoot.commit(); + if ( xRegistrations->hasRegisteredDatabase( _sName ) ) + xRegistrations->changeDatabaseLocation( _sName, _sURL ); + else + xRegistrations->registerDatabaseLocation( _sName, _sURL ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } } //===================================================================== diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 5a95f61f50c1..6f8395eae027 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" #include <osl/mutex.hxx> +#include <tools/diagnose_ex.h> #include <tools/urlobj.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/io/XPersistObject.hpp> @@ -887,12 +888,14 @@ void BibDataManager::InsertFields(const Reference< XFormComponent > & _rxGrid) case DataType::BINARY: case DataType::VARBINARY: case DataType::LONGVARBINARY: + case DataType::BLOB: sCurrentModelType = C2U("TextField"); break; case DataType::VARCHAR: case DataType::LONGVARCHAR: case DataType::CHAR: + case DataType::CLOB: bFormattedIsNumeric = sal_False; // _NO_ break ! default: @@ -1085,20 +1088,16 @@ void BibDataManager::setFilter(const ::rtl::OUString& rQuery) return; try { - m_xParser->setFilter(rQuery); - ::rtl::OUString aQuery=m_xParser->getFilter(); - Reference< XPropertySet > aPropertySet( m_xForm, UNO_QUERY ); - Any aVal; aVal <<= aQuery; - aPropertySet->setPropertyValue(C2U("Filter"), aVal); - BOOL bVal = sal_True; - aVal.setValue(&bVal, ::getBooleanCppuType()); - aPropertySet->setPropertyValue(C2U("ApplyFilter"), aVal); + m_xParser->setFilter( rQuery ); + ::rtl::OUString aQuery = m_xParser->getFilter(); + Reference< XPropertySet > xFormProps( m_xForm, UNO_QUERY_THROW ); + xFormProps->setPropertyValue( C2U( "Filter" ), makeAny( aQuery ) ); + xFormProps->setPropertyValue( C2U( "ApplyFilter" ), makeAny( sal_True ) ); reload(); } catch(Exception& e ) { - (void) e; // make compiler happy - DBG_ERROR("::setFilterOnActiveDataSource: something went wrong !"); + DBG_UNHANDLED_EXCEPTION(); } @@ -1110,18 +1109,12 @@ void BibDataManager::setFilter(const ::rtl::OUString& rQuery) ::rtl::OUString aQueryString; try { - Reference< XPropertySet > aPropertySet( m_xForm, UNO_QUERY ); - Any aQuery=aPropertySet->getPropertyValue(C2U("Filter")); - - if(aQuery.getValueType() == ::getCppuType((::rtl::OUString*)0)) - { - aQueryString=*(::rtl::OUString*)aQuery.getValue(); - } + Reference< XPropertySet > xFormProps( m_xForm, UNO_QUERY_THROW ); + OSL_VERIFY( xFormProps->getPropertyValue( C2U( "Filter" ) ) >>= aQueryString ); } - catch(Exception& e ) + catch( const Exception& ) { - (void) e; // make compiler happy - DBG_ERROR("::getFilterOnActiveDataSource: something went wrong !"); + DBG_UNHANDLED_EXCEPTION(); } @@ -1795,13 +1788,13 @@ void BibDataManager::SetToolbar(BibToolBar* pSet) /* -----------------------------08.05.2002 09:26------------------------------ ---------------------------------------------------------------------------*/ -uno::Reference< form::XFormController > BibDataManager::GetFormController() +uno::Reference< form::runtime::XFormController > BibDataManager::GetFormController() { if(!m_xFormCtrl.is()) { Reference< lang::XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); - m_xFormCtrl = uno::Reference< form::XFormController > ( - xMgr->createInstance(C2U("com.sun.star.form.FormController")), UNO_QUERY); + m_xFormCtrl = uno::Reference< form::runtime::XFormController > ( + xMgr->createInstance(C2U("com.sun.star.form.runtime.FormController")), UNO_QUERY); m_xFormCtrl->setModel(uno::Reference< awt::XTabControllerModel > (getForm(), UNO_QUERY)); // #100312# ------------- m_xFormDispatch = uno::Reference< frame::XDispatch > ( m_xFormCtrl, UNO_QUERY); diff --git a/extensions/source/bibliography/datman.hxx b/extensions/source/bibliography/datman.hxx index 6f5bb6834e5c..17608142b6ab 100644 --- a/extensions/source/bibliography/datman.hxx +++ b/extensions/source/bibliography/datman.hxx @@ -35,7 +35,7 @@ #include <com/sun/star/form/XForm.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> -#include <com/sun/star/form/XFormController.hpp> +#include <com/sun/star/form/runtime/XFormController.hpp> #include <cppuhelper/compbase2.hxx> #include <cppuhelper/interfacecontainer.h> #include <com/sun/star/form/XLoadable.hpp> @@ -98,7 +98,7 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > m_xGridModel; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xSourceProps; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer > m_xParser; - ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController > m_xFormCtrl; + ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > m_xFormCtrl; // #100312# ------------------- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xFormDispatch; BibInterceptorHelper* m_pInterceptorHelper; @@ -191,7 +191,7 @@ public: const rtl::OUString& GetIdentifierMapping(); void ResetIdentifierMapping() {sIdentifierMapping = rtl::OUString();} - ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController > GetFormController(); + ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > GetFormController(); // #100312# ---------- void RegisterInterceptor( ::bib::BibBeamer* pBibBeamer); diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index 5dc410db4c59..50bc4821f0ac 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -50,7 +50,7 @@ #include "bibliography.hrc" #include <comphelper/processfactory.hxx> #include <com/sun/star/form/XConfirmDeleteListener.hpp> -#include <com/sun/star/form/XFormController.hpp> +#include <com/sun/star/form/runtime/XFormController.hpp> #include <com/sun/star/beans/PropertyState.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> @@ -384,7 +384,7 @@ sal_Bool canInsertRecords(const Reference< beans::XPropertySet>& _rxCursorSet) /* -----------------------------08.05.2002 08:58------------------------------ ---------------------------------------------------------------------------*/ -sal_Bool BibFrameController_Impl::SaveModified(const Reference< form::XFormController>& xController) +sal_Bool BibFrameController_Impl::SaveModified(const Reference< form::runtime::XFormController>& xController) { if (!xController.is()) return sal_False; @@ -592,7 +592,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen } else if(aCommand.EqualsAscii("Bib/InsertRecord")) { - Reference<form::XFormController > xFormCtrl = pDatMan->GetFormController(); + Reference<form::runtime::XFormController > xFormCtrl = pDatMan->GetFormController(); if(SaveModified(xFormCtrl)) { try diff --git a/extensions/source/bibliography/framectr.hxx b/extensions/source/bibliography/framectr.hxx index 99304c394021..b3a7469b8dae 100644 --- a/extensions/source/bibliography/framectr.hxx +++ b/extensions/source/bibliography/framectr.hxx @@ -44,9 +44,9 @@ class BibDataManager; class BibFrameCtrl_Impl; namespace com{namespace sun{namespace star{ - namespace form{ + namespace form { namespace runtime { class XFormController; - } + } } }}} class BibStatusDispatch { @@ -83,7 +83,7 @@ friend class BibFrameCtrl_Impl; DECL_STATIC_LINK( BibFrameController_Impl, DisposeHdl, void* ); - sal_Bool SaveModified(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController>& xController); + sal_Bool SaveModified(const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController>& xController); public: BibFrameController_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > & xComponent, BibDataManager* pDatMan); diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index 62efe9127641..eb6e941c313b 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -417,7 +417,7 @@ BibGeneralPage::BibGeneralPage(Window* pParent, BibDataManager* pMan): uno::Reference< sdbc::XRowSet > xRowSet(pDatMan->getForm(), UNO_QUERY); if(xRowSet.is()) xRowSet->addRowSetListener(xPosListener); - uno::Reference< form::XFormController > xFormCtrl = pDatMan->GetFormController(); + uno::Reference< form::runtime::XFormController > xFormCtrl = pDatMan->GetFormController(); xFormCtrl->setContainer(xCtrlContnr); xFormCtrl->activateTabOrder(); @@ -454,7 +454,7 @@ BibGeneralPage::~BibGeneralPage() ---------------------------------------------------------------------------*/ void BibGeneralPage::CommitActiveControl() { - uno::Reference< form::XFormController > xFormCtrl = pDatMan->GetFormController(); + uno::Reference< form::runtime::XFormController > xFormCtrl = pDatMan->GetFormController(); uno::Reference< awt::XControl > xCurr = xFormCtrl->getCurrentControl(); if(xCurr.is()) { diff --git a/extensions/source/propctrlr/editpropertyhandler.cxx b/extensions/source/propctrlr/editpropertyhandler.cxx index cd9d197e3fb5..bdefa5cff692 100644 --- a/extensions/source/propctrlr/editpropertyhandler.cxx +++ b/extensions/source/propctrlr/editpropertyhandler.cxx @@ -298,6 +298,7 @@ namespace pcr _rxInspectorUI->enablePropertyUI( PROPERTY_DEFAULT_TEXT, nTextType != TEXTTYPE_RICHTEXT ); _rxInspectorUI->enablePropertyUI( PROPERTY_SHOW_SCROLLBARS, nTextType != TEXTTYPE_SINGLELINE ); _rxInspectorUI->enablePropertyUI( PROPERTY_LINEEND_FORMAT, nTextType != TEXTTYPE_SINGLELINE ); + _rxInspectorUI->enablePropertyUI( PROPERTY_VERTICAL_ALIGN, nTextType == TEXTTYPE_SINGLELINE ); _rxInspectorUI->showCategory( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Data" ) ), nTextType != TEXTTYPE_RICHTEXT ); } diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index e6ef80f5ba6b..1f3c17377687 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -55,7 +55,7 @@ #include <com/sun/star/container/XNameReplace.hpp> #include <com/sun/star/form/FormComponentType.hpp> #include <com/sun/star/form/XForm.hpp> -#include <com/sun/star/form/XFormController.hpp> +#include <com/sun/star/form/runtime/XFormController.hpp> #include <com/sun/star/inspection/PropertyControlType.hpp> #include <com/sun/star/lang/NullPointerException.hpp> #include <com/sun/star/script/XEventAttacherManager.hpp> @@ -118,7 +118,7 @@ namespace pcr using ::com::sun::star::container::XNameContainer; using ::com::sun::star::awt::XTabControllerModel; using ::com::sun::star::form::XForm; - using ::com::sun::star::form::XFormController; + using ::com::sun::star::form::runtime::XFormController; using ::com::sun::star::beans::UnknownPropertyException; using ::com::sun::star::uno::makeAny; using ::com::sun::star::container::NoSuchElementException; @@ -1155,7 +1155,7 @@ namespace pcr m_aContext.createComponent( (const rtl::OUString&)SERVICE_FORMCONTROLLER ), UNO_QUERY_THROW ); xController->setModel( xComponentAsTCModel ); - xReturn = xController.get(); + xReturn = xController; } else { |