diff options
author | Tor Lillqvist <tml@collabora.com> | 2014-04-22 13:03:06 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-04-22 13:04:19 +0300 |
commit | f12237c4c6239428b00dd4885a25bbc3b4f14368 (patch) | |
tree | c63ec38956f8abc92dc288739943a0cc083a879b /forms/source | |
parent | convert field assign address book page to .ui (diff) | |
download | core-f12237c4c6239428b00dd4885a25bbc3b4f14368.tar.gz core-f12237c4c6239428b00dd4885a25bbc3b4f14368.zip |
More hacking on --disable-database-connectivity
Change-Id: Iefa6b104c60464e5a0d793bd676d8ea7ff2727c1
Diffstat (limited to 'forms/source')
-rw-r--r-- | forms/source/component/Filter.cxx | 17 | ||||
-rw-r--r-- | forms/source/component/Filter.hxx | 4 | ||||
-rw-r--r-- | forms/source/component/Grid.cxx | 6 | ||||
-rw-r--r-- | forms/source/component/ListBox.cxx | 16 | ||||
-rw-r--r-- | forms/source/misc/services.cxx | 6 | ||||
-rw-r--r-- | forms/source/runtime/formoperations.cxx | 3 |
6 files changed, 49 insertions, 3 deletions
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index 976c82ff22ea..603178f8bd53 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -98,7 +98,9 @@ namespace frm :UnoControl() ,m_aTextListeners( *this ) ,m_xContext( _rxORB ) +#if HAVE_FEATURE_DBCONNECTIVITY ,m_aParser( _rxORB ) +#endif ,m_nControlClass( FormComponentType::TEXTFIELD ) ,m_bFilterList( sal_False ) ,m_bMultiLine( sal_False ) @@ -109,6 +111,7 @@ namespace frm sal_Bool OFilterControl::ensureInitialized( ) { +#if HAVE_FEATURE_DBCONNECTIVITY if ( !m_xField.is() ) { OSL_FAIL( "OFilterControl::ensureInitialized: improperly initialized: no field!" ); @@ -139,7 +142,7 @@ namespace frm // no fallback anymore return sal_False; } - +#endif return sal_True; } @@ -291,6 +294,9 @@ namespace frm void SAL_CALL OFilterControl::itemStateChanged( const ItemEvent& rEvent ) throw(RuntimeException, std::exception) { +#if !HAVE_FEATURE_DBCONNECTIVITY + (void) rEvent; +#else OUStringBuffer aText; switch (m_nControlClass) { @@ -377,11 +383,13 @@ namespace frm while( aIt.hasMoreElements() ) ((XTextListener *)aIt.next())->textChanged( aEvt ); } +#endif } void OFilterControl::implInitFilterList() { +#if HAVE_FEATURE_DBCONNECTIVITY if ( !ensureInitialized( ) ) // already asserted in ensureInitialized return; @@ -487,6 +495,7 @@ namespace frm { DBG_UNHANDLED_EXCEPTION(); } +#endif } // XFocusListener @@ -506,6 +515,7 @@ namespace frm sal_Bool SAL_CALL OFilterControl::commit() throw(RuntimeException, std::exception) { +#if HAVE_FEATURE_DBCONNECTIVITY if ( !ensureInitialized( ) ) // already asserted in ensureInitialized return sal_True; @@ -550,6 +560,7 @@ namespace frm while( aIt.hasMoreElements() ) static_cast< XTextListener* >( aIt.next() )->textChanged( aEvt ); } +#endif return sal_True; } @@ -820,6 +831,9 @@ namespace frm void OFilterControl::initControlModel(Reference< XPropertySet >& xControlModel) { +#if !HAVE_FEATURE_DBCONNECTIVITY + (void) xControlModel; +#else if ( !xControlModel.is() ) { OSL_FAIL( "OFilterControl::initialize: invalid control model argument!" ); @@ -873,6 +887,7 @@ namespace frm xForm = xForm.query( xModel->getParent() ); m_xConnection = ::dbtools::getConnection( xForm ); OSL_ENSURE( m_xConnection.is(), "OFilterControl::initialize: unable to determine the form's connection!" ); +#endif } OUString SAL_CALL OFilterControl::getImplementationName( ) throw (RuntimeException, std::exception) diff --git a/forms/source/component/Filter.hxx b/forms/source/component/Filter.hxx index f61b7ab40820..51cfd651b470 100644 --- a/forms/source/component/Filter.hxx +++ b/forms/source/component/Filter.hxx @@ -20,6 +20,8 @@ #ifndef INCLUDED_FORMS_SOURCE_COMPONENT_FILTER_HXX #define INCLUDED_FORMS_SOURCE_COMPONENT_FILTER_HXX +#include <config_features.h> + #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XInitialization.hpp> @@ -70,7 +72,9 @@ namespace frm MapString2String m_aDisplayItemToValueItem; OUString m_aText; +#if HAVE_FEATURE_DBCONNECTIVITY ::connectivity::OSQLParser m_aParser; +#endif sal_Int16 m_nControlClass; // which kind of control do we use? sal_Bool m_bFilterList : 1; sal_Bool m_bMultiLine : 1; diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index 7d4abec36133..f6a17b10497e 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -16,6 +16,9 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + +#include <config_features.h> + #include "Columns.hxx" #include "findpos.hxx" #include "Grid.hxx" @@ -188,12 +191,15 @@ Any SAL_CALL OGridControlModel::queryAggregation( const Type& _rType ) throw (Ru return aReturn; } +#if HAVE_FEATURE_DBCONNECTIVITY + // XSQLErrorListener void SAL_CALL OGridControlModel::errorOccured( const SQLErrorEvent& _rEvent ) throw (RuntimeException, std::exception) { // forward the errors which happened to my columns to my own listeners onError( _rEvent ); } +#endif // XRowSetSupplier Reference< XRowSet > SAL_CALL OGridControlModel::getRowSet( ) throw (RuntimeException, std::exception) diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index f812dc987c59..ea2d688603b6 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> #include "ListBox.hxx" #include "property.hxx" @@ -352,6 +353,7 @@ namespace frm } break; +#if HAVE_FEATURE_DBCONNECTIVITY case PROPERTY_ID_SELECT_VALUE : { ORowSetValue v; @@ -360,7 +362,7 @@ namespace frm setControlValue( newSelectSeq, eOther ); } break; - +#endif case PROPERTY_ID_DEFAULT_SELECT_SEQ : DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(static_cast< Sequence<sal_Int16>*>(0))), "OListBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); @@ -859,6 +861,7 @@ namespace frm switch (m_eListSourceType) { +#if HAVE_FEATURE_DBCONNECTIVITY case ListSourceType_SQL: case ListSourceType_SQLPASSTHROUGH: case ListSourceType_TABLE: @@ -928,7 +931,7 @@ namespace frm } } break; - +#endif case ListSourceType_TABLEFIELDS: { Reference<XNameAccess> xFieldNames = getTableFields(xConnection, sListSource); @@ -1173,8 +1176,10 @@ namespace frm const ValueList aValues( impl_getValues() ); assert( m_nConvertedBoundValuesType == getValueType()); Sequence< sal_Int16 > aSelectionIndicies(i_aValues.getLength()); + sal_Int32 nCount(0); +#if HAVE_FEATURE_DBCONNECTIVITY sal_Int16 *pIndex = aSelectionIndicies.getArray(); const Any *pValue = i_aValues.getConstArray(); const Any * const pValueEnd = i_aValues.getConstArray() + i_aValues.getLength(); @@ -1204,12 +1209,14 @@ namespace frm } } assert(aSelectionIndicies.getArray() + nCount == pIndex); +#endif aSelectionIndicies.realloc(nCount); return aSelectionIndicies; } Any OListBoxModel::translateDbColumnToControlValue() { +#if HAVE_FEATURE_DBCONNECTIVITY Reference< XPropertySet > xBoundField( getField() ); if ( !xBoundField.is() ) { @@ -1223,6 +1230,9 @@ namespace frm m_aSaveValue = aCurrentValue; return makeAny( translateDbValueToControlValue(aCurrentValue) ); +#else + return Any(); +#endif } // XReset @@ -1325,11 +1335,13 @@ namespace frm break; case eValue: +#if HAVE_FEATURE_DBCONNECTIVITY { ORowSetValue v; v.fill(_rExternalValue); aSelectIndexes = translateDbValueToControlValue(v); } +#endif break; case eIndexList: diff --git a/forms/source/misc/services.cxx b/forms/source/misc/services.cxx index 02e0548d1d0b..c520e3c93572 100644 --- a/forms/source/misc/services.cxx +++ b/forms/source/misc/services.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include "services.hxx" #include "frm_module.hxx" #include <cppuhelper/factory.hxx> @@ -220,7 +222,9 @@ void SAL_CALL createRegistryInfo_FORMS() static sal_Bool bInit = sal_False; if (!bInit) { +#if HAVE_FEATURE_DBCONNECTIVITY createRegistryInfo_ODatabaseForm(); +#endif createRegistryInfo_OFilterControl(); createRegistryInfo_OScrollBarModel(); createRegistryInfo_OSpinButtonModel(); @@ -229,7 +233,9 @@ void SAL_CALL createRegistryInfo_FORMS() createRegistryInfo_ORichTextModel(); createRegistryInfo_ORichTextControl(); createRegistryInfo_CLibxml2XFormsExtension(); +#if HAVE_FEATURE_DBCONNECTIVITY createRegistryInfo_FormOperations(); +#endif bInit = sal_True; } } diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index 0ca37a5ff244..2e06b5280853 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> #include "formoperations.hxx" #include "frm_strings.hxx" @@ -1741,6 +1742,7 @@ namespace frm { f(); } +#if HAVE_FEATURE_DBCONNECTIVITY catch( const SQLException& e ) { (void)e; @@ -1753,6 +1755,7 @@ namespace frm aInfo.prepend( sAdditionalError ); aInfo.doThrow(); } +#endif catch( const RuntimeException& ) { throw; } catch( const Exception& ) { |