diff options
Diffstat (limited to 'forms')
-rw-r--r-- | forms/prj/build.lst | 1 | ||||
-rw-r--r-- | forms/qa/unoapi/Test.java | 51 | ||||
-rw-r--r-- | forms/qa/unoapi/makefile.mk | 38 | ||||
-rw-r--r-- | forms/source/component/Columns.cxx | 20 | ||||
-rw-r--r-- | forms/source/component/ListBox.cxx | 22 | ||||
-rw-r--r-- | forms/source/component/ListBox.hxx | 5 | ||||
-rw-r--r-- | forms/source/inc/componenttools.hxx | 6 | ||||
-rw-r--r-- | forms/source/misc/componenttools.cxx | 12 | ||||
-rw-r--r-- | forms/util/frm.map | 8 | ||||
-rw-r--r-- | forms/util/makefile.mk | 2 |
10 files changed, 117 insertions, 48 deletions
diff --git a/forms/prj/build.lst b/forms/prj/build.lst index ec07ab8e243c..99f6b29d208b 100644 --- a/forms/prj/build.lst +++ b/forms/prj/build.lst @@ -15,3 +15,4 @@ fm forms\source\richtext nmake - all fm_richtext fm_inc N fm forms\source\runtime nmake - all frm_runtime NULL fm forms\util nmake - all fm_util fm_component fm_solar_component fm_solar_control fm_helper fm_misc fm_resource fm_richtext frm_runtime fm_xforms NULL fm forms\qa nmake - all fm_qa NULL +fm forms\qa\unoapi nmake - all fm_qa_unoapi NULL diff --git a/forms/qa/unoapi/Test.java b/forms/qa/unoapi/Test.java new file mode 100644 index 000000000000..52130214cc78 --- /dev/null +++ b/forms/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.forms.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "forms.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/forms/qa/unoapi/makefile.mk b/forms/qa/unoapi/makefile.mk index 9f033d058ce7..50c83e587db8 100644 --- a/forms/qa/unoapi/makefile.mk +++ b/forms/qa/unoapi/makefile.mk @@ -1,7 +1,6 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -22,27 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=forms -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = forms +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/forms/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST - -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce forms.sce -xcl knownissues.xcl -DOCPTH $(PWD)$/testdocuments -THRCNT 1 -tdoc $(PWD)$/testdocuments - @echo ======================================================================= - @echo Problems with controls might me focus problems during the run of XView - @echo these seems to appear by chance ... just re-run those testcases with - @echo $(SOLARENV)$/bin$/checkapi -o componentName -xcl knownissues.xcl -DOCPTH $(PWD)$/testdocuments -THRCNT 1 -tdoc $(PWD)$/testdocuments - @echo ======================================================================= +ALLTAR : javatest -run_%: - +$(SOLARENV)$/bin$/checkapi -o $(PRJNAME).$(@:s/run_//) -xcl knownissues.xcl -DOCPTH $(PWD)$/testdocuments -THRCNT 1 -tdoc $(PWD)$/testdocuments +.END diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx index ae1cbc2b7a5b..a93d121d4b99 100644 --- a/forms/source/component/Columns.cxx +++ b/forms/source/component/Columns.cxx @@ -32,6 +32,7 @@ #include "property.hrc" #endif #include "property.hxx" +#include "componenttools.hxx" #include "ids.hxx" #include "findpos.hxx" #include <com/sun/star/io/XPersistObject.hpp> @@ -169,11 +170,20 @@ Sequence<sal_Int8> SAL_CALL OGridColumn::getImplementationId() throw(RuntimeExce //------------------------------------------------------------------ Sequence<Type> SAL_CALL OGridColumn::getTypes() throw(RuntimeException) { - Reference<XTypeProvider> xProv; - - if (query_aggregation(m_xAggregate, xProv)) - return concatSequences(OGridColumn_BASE::getTypes(), xProv->getTypes()); - return OGridColumn_BASE::getTypes(); + TypeBag aTypes( OGridColumn_BASE::getTypes() ); + // erase the types which we do not support + aTypes.removeType( XFormComponent::static_type() ); + aTypes.removeType( XServiceInfo::static_type() ); + aTypes.removeType( XBindableValue::static_type() ); + aTypes.removeType( XPropertyContainer::static_type() ); + // but re-add their base class(es) + aTypes.addType( XChild::static_type() ); + + Reference< XTypeProvider > xProv; + if ( query_aggregation( m_xAggregate, xProv )) + aTypes.addTypes( xProv->getTypes() ); + + return aTypes.getTypes(); } //------------------------------------------------------------------ diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index 0aa90d9919cf..88135c040d71 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -41,7 +41,6 @@ /** === begin UNO includes === **/ #include <com/sun/star/util/XNumberFormatTypes.hpp> #include <com/sun/star/sdbc/XRowSet.hpp> -#include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp> #include <com/sun/star/sdb/XQueriesSupplier.hpp> @@ -167,7 +166,7 @@ namespace frm ,OErrorBroadcaster( OComponentHelper::rBHelper ) ,m_aListRowSet( getContext() ) ,m_nNULLPos(-1) - ,m_bBoundComponent(sal_False) + ,m_nBoundColumnType( DataType::SQLNULL ) { DBG_CTOR(OListBoxModel,NULL); @@ -189,7 +188,7 @@ namespace frm ,m_aBoundValues( _pOriginal->m_aBoundValues ) ,m_aDefaultSelectSeq( _pOriginal->m_aDefaultSelectSeq ) ,m_nNULLPos(-1) - ,m_bBoundComponent(sal_False) + ,m_nBoundColumnType( DataType::SQLNULL ) { DBG_CTOR(OListBoxModel,NULL); } @@ -629,7 +628,7 @@ namespace frm DBG_ASSERT( !hasExternalListSource(), "OListBoxModel::loadData: cannot load from DB when I have an external list source!" ); m_nNULLPos = -1; - m_bBoundComponent = sal_False; + m_nBoundColumnType = DataType::SQLNULL; // pre-requisites: // PRE1: connection @@ -832,20 +831,19 @@ namespace frm ::dbtools::FormattedColumnValue aValueFormatter( getContext(), m_xCursor, xDataField ); // Feld der BoundColumn des ResultSets holen - sal_Int32 nBoundColumnType = DataType::SQLNULL; + m_nBoundColumnType = DataType::SQLNULL; if ( ( nBoundColumn > 0 ) && m_xColumn.is() ) { // don't look for a bound column if we're not connected to a field try { Reference< XPropertySet > xBoundField( xColumns->getByIndex( nBoundColumn ), UNO_QUERY_THROW ); - OSL_VERIFY( xBoundField->getPropertyValue( ::rtl::OUString::createFromAscii( "Type" ) ) >>= nBoundColumnType ); + OSL_VERIFY( xBoundField->getPropertyValue( ::rtl::OUString::createFromAscii( "Type" ) ) >>= m_nBoundColumnType ); } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } } - m_bBoundComponent = ( nBoundColumnType != DataType::SQLNULL ); // Ist die LB an ein Feld gebunden und sind Leereintraege zulaessig // dann wird die Position fuer einen Leereintrag gemerkt @@ -860,9 +858,9 @@ namespace frm aStr = aValueFormatter.getFormattedValue(); aDisplayList.push_back( aStr ); - if ( m_bBoundComponent ) + if ( impl_hasBoundComponent() ) { - aBoundValue.fill( nBoundColumn + 1, nBoundColumnType, xCursorRow ); + aBoundValue.fill( nBoundColumn + 1, m_nBoundColumnType, xCursorRow ); aValueList.push_back( aBoundValue ); } @@ -907,7 +905,7 @@ namespace frm // NULL eintrag hinzufuegen if (bUseNULL && m_nNULLPos == -1) { - if ( m_bBoundComponent ) + if ( impl_hasBoundComponent() ) aValueList.insert( aValueList.begin(), ORowSetValue() ); aDisplayList.insert( aDisplayList.begin(), ORowSetValue( ::rtl::OUString() ) ); @@ -940,7 +938,7 @@ namespace frm { ValueList().swap(m_aBoundValues); m_nNULLPos = -1; - m_bBoundComponent = sal_False; + m_nBoundColumnType = DataType::SQLNULL; if ( !hasExternalListSource() ) setFastPropertyValue( PROPERTY_ID_STRINGITEMLIST, makeAny( StringSequence() ) ); @@ -1035,7 +1033,7 @@ namespace frm Sequence< sal_Int16 > aSelectionIndicies; ORowSetValue aCurrentValue; - aCurrentValue.fill( getFieldType(), m_xColumn ); + aCurrentValue.fill( impl_hasBoundComponent() ? m_nBoundColumnType : getFieldType(), m_xColumn ); // reset selection for NULL values if ( aCurrentValue.isNull() ) diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx index d2af81c1c52c..04db6069d89e 100644 --- a/forms/source/component/ListBox.hxx +++ b/forms/source/component/ListBox.hxx @@ -41,6 +41,7 @@ #include <com/sun/star/awt/XFocusListener.hpp> #include <com/sun/star/awt/XListBox.hpp> #include <com/sun/star/form/XChangeBroadcaster.hpp> +#include <com/sun/star/sdbc/DataType.hpp> /** === end UNO includes === **/ #include <comphelper/asyncnotification.hxx> @@ -82,7 +83,7 @@ class OListBoxModel :public OBoundControlModel // </properties> sal_Int16 m_nNULLPos; // position of the NULL value in our list - sal_Bool m_bBoundComponent : 1; + sal_Int32 m_nBoundColumnType; private: ::connectivity::ORowSetValue getFirstSelectedValue() const; @@ -177,6 +178,8 @@ private: void impl_refreshDbEntryList( bool _bForce ); ValueList impl_getValues() const; + + bool impl_hasBoundComponent() const { return m_nBoundColumnType != ::com::sun::star::sdbc::DataType::SQLNULL; } }; //================================================================== diff --git a/forms/source/inc/componenttools.hxx b/forms/source/inc/componenttools.hxx index 73771f19783a..e91573c43d2f 100644 --- a/forms/source/inc/componenttools.hxx +++ b/forms/source/inc/componenttools.hxx @@ -48,7 +48,7 @@ namespace frm typedef ::com::sun::star::uno::Type Type; public: - bool operator()( const Type& _rLHS, const Type& _rRHS ) + bool operator()( const Type& _rLHS, const Type& _rRHS ) const { return _rLHS.getTypeName() < _rRHS.getTypeName(); } @@ -85,7 +85,9 @@ namespace frm const TypeSequence& _rTypes3 ); - void addTypes( const TypeSequence& _rTypes ); + void addType( const Type& i_rType ); + void addTypes( const TypeSequence& _rTypes ); + void removeType( const Type& i_rType ); /** returns the types represented by this bag */ diff --git a/forms/source/misc/componenttools.cxx b/forms/source/misc/componenttools.cxx index 80e772dbd0da..bdba7456fa7f 100644 --- a/forms/source/misc/componenttools.cxx +++ b/forms/source/misc/componenttools.cxx @@ -84,6 +84,18 @@ namespace frm } //-------------------------------------------------------------------- + void TypeBag::addType( const Type& i_rType ) + { + m_aTypes.insert( i_rType ); + } + + //-------------------------------------------------------------------- + void TypeBag::removeType( const TypeBag::Type& i_rType ) + { + m_aTypes.erase( i_rType ); + } + + //-------------------------------------------------------------------- TypeBag::TypeSequence TypeBag::getTypes() const { TypeSequence aTypes( m_aTypes.size() ); diff --git a/forms/util/frm.map b/forms/util/frm.map deleted file mode 100644 index 7975644b139a..000000000000 --- a/forms/util/frm.map +++ /dev/null @@ -1,8 +0,0 @@ -FORMS_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/forms/util/makefile.mk b/forms/util/makefile.mk index 66de3cb83fb2..00d7a81d5a97 100644 --- a/forms/util/makefile.mk +++ b/forms/util/makefile.mk @@ -81,7 +81,7 @@ SHL1DEPN=$(LIB1TARGET) \ makefile.mk -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) |