diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-01-29 15:36:08 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-01-29 15:36:08 +0000 |
commit | 452b55d80ce6b5676c2fd230dcb55ec1e58787a2 (patch) | |
tree | 2dd5a76d82c3bf5a15285e1e3b47f335ca07ac7a /forms | |
parent | fb9f2b25462585f6c18087b681f0b5d029b01113 (diff) | |
parent | a79a4812e4cec0a2a0711279b20af5a0f6631838 (diff) |
ab71: merge with DEV300_m63
Diffstat (limited to 'forms')
-rw-r--r-- | forms/qa/integration/forms/FormLayer.java | 22 | ||||
-rw-r--r-- | forms/qa/integration/forms/FormPropertyBags.java | 2 | ||||
-rw-r--r-- | forms/qa/integration/forms/TestSkeleton.java | 50 | ||||
-rw-r--r-- | forms/qa/makefile.mk | 9 | ||||
-rw-r--r-- | forms/source/component/FormComponent.cxx | 13 | ||||
-rw-r--r-- | forms/source/xforms/model_ui.cxx | 11 | ||||
-rw-r--r-- | forms/source/xforms/xpathlib/xpathlib.cxx | 2 | ||||
-rw-r--r-- | forms/util/makefile.mk | 18 |
8 files changed, 66 insertions, 61 deletions
diff --git a/forms/qa/integration/forms/FormLayer.java b/forms/qa/integration/forms/FormLayer.java index d67e28bcf412..032ca5e7331a 100644 --- a/forms/qa/integration/forms/FormLayer.java +++ b/forms/qa/integration/forms/FormLayer.java @@ -310,7 +310,27 @@ public class FormLayer } /* ------------------------------------------------------------------ */ - /** retrieves a control model with a given access path + /** retrieves a control model with a given (integer) access path + */ + public XPropertySet getControlModel( int[] _accessPath ) throws com.sun.star.uno.Exception + { + XIndexAccess indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class, + m_document.getFormComponentTreeRoot() ); + XPropertySet controlModel = null; + int i=0; + while ( ( indexAcc != null ) && ( i < _accessPath.length ) ) + { + controlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, + indexAcc.getByIndex( _accessPath[i] ) ); + indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class, + controlModel ); + ++i; + } + return controlModel; + } + + /* ------------------------------------------------------------------ */ + /** retrieves a control model with a given (string) access path */ public XPropertySet getControlModel( String[] _accessPath ) throws com.sun.star.uno.Exception { diff --git a/forms/qa/integration/forms/FormPropertyBags.java b/forms/qa/integration/forms/FormPropertyBags.java index 92aa2b8b6236..4adb04796030 100644 --- a/forms/qa/integration/forms/FormPropertyBags.java +++ b/forms/qa/integration/forms/FormPropertyBags.java @@ -180,7 +180,7 @@ public class FormPropertyBags extends complexlib.ComplexTestCase implements XPro m_document = DocumentHelper.loadDocument( m_orb, documentURL ); m_formLayer = new FormLayer( m_document ); - XPropertySet textFieldModel = m_formLayer.getControlModel( new String[] { "Standard", "TextBox" } ); + XPropertySet textFieldModel = m_formLayer.getControlModel( new int[] { 0, 0 } ); // all persistent properties should have the expected values assure( "persistent properties did not survive reload (1)!", ((String)textFieldModel.getPropertyValue( "SomeBoundText" )).equals( "ChangedBoundText" ) ); diff --git a/forms/qa/integration/forms/TestSkeleton.java b/forms/qa/integration/forms/TestSkeleton.java index f16083664cbe..8f2765b3a6d5 100644 --- a/forms/qa/integration/forms/TestSkeleton.java +++ b/forms/qa/integration/forms/TestSkeleton.java @@ -6,9 +6,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: TestSkeleton.java,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -29,61 +26,50 @@ ************************************************************************/ package integration.forms; -import com.sun.star.uno.UnoRuntime; - -import com.sun.star.lang.XMultiServiceFactory; - -import com.sun.star.util.XCloseable; +import com.sun.star.uno.Exception; -import integration.forms.DocumentHelper; - -public class TestSkeleton extends complexlib.ComplexTestCase +public class TestSkeleton extends TestCase { - private DocumentHelper m_document; - private FormLayer m_formLayer; - private XMultiServiceFactory m_orb; - - /** Creates a new instance of ValueBinding */ + /** Creates a new instance of TestSkeleton */ public TestSkeleton() { + super( DocumentType.WRITER ); } /* ------------------------------------------------------------------ */ public String[] getTestMethodNames() { return new String[] { - "checkSomething" + "checkTestSkeleton" }; } /* ------------------------------------------------------------------ */ public String getTestObjectName() { - return "Form Control Spreadsheet Cell Binding Test"; + return "Test Skeleton"; + } + + /* ------------------------------------------------------------------ */ + public void checkTestSkeleton() throws com.sun.star.uno.Exception, java.lang.Exception + { } /* ------------------------------------------------------------------ */ - public void before() throws com.sun.star.uno.Exception, java.lang.Exception + public void before() throws Exception, java.lang.Exception { - m_orb = (XMultiServiceFactory)param.getMSF(); - m_document = DocumentHelper.blankTextDocument( m_orb ); - m_formLayer = new FormLayer( m_document ); + super.before(); } /* ------------------------------------------------------------------ */ - public void after() throws com.sun.star.uno.Exception, java.lang.Exception + public void after() throws Exception, java.lang.Exception { - // close our document - if ( m_document != null ) - { - XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class, - m_document.getDocument() ); - closeDoc.close( true ); - } + super.before(); } /* ------------------------------------------------------------------ */ - public void checkSomething() throws com.sun.star.uno.Exception, java.lang.Exception + protected void prepareDocument() throws com.sun.star.uno.Exception, java.lang.Exception { + super.prepareDocument(); } -} + } diff --git a/forms/qa/makefile.mk b/forms/qa/makefile.mk index 822f67e1bb46..b34529e2fbcf 100644 --- a/forms/qa/makefile.mk +++ b/forms/qa/makefile.mk @@ -73,15 +73,18 @@ ALL: ALLDEP .INCLUDE : target.mk +test: + echo $(SOLARBINDIR) + .IF "$(BUILD_QADEVOOO)" == "YES" show_targets: - +@java $(RUNNER_CLASSPATH) complexlib.ShowTargets $(foreach,i,$(JAVAFILES) $(i:s/.\$///:s/.java//)) + +@$(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) complexlib.ShowTargets $(foreach,i,$(JAVAFILES) $(i:s/.\$///:s/.java//)) run: - +$(COPY) integration$/forms$/*.props $(CLASSDIR)$/$(PACKAGE) && java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -sce forms_all.sce + +$(COPY) integration$/forms$/*.props $(CLASSDIR)$/$(PACKAGE) && $(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -sce forms_all.sce run_%: - +$(COPY) integration$/forms$/*.props $(CLASSDIR)$/$(PACKAGE) && java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -o integration.$(PRJNAME).$(@:s/run_//) + +$(COPY) integration$/forms$/*.props $(CLASSDIR)$/$(PACKAGE) && $(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -o integration.$(PRJNAME).$(@:s/run_//) .ELSE run: show_targets diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index ed3e85a905ec..3b6a6afaf5de 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -1977,7 +1977,6 @@ void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, co //------------------------------------------------------------------------------ void SAL_CALL OBoundControlModel::propertyChange( const PropertyChangeEvent& evt ) throw(RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setFastPropertyValue_NoBroadcast" ); // if the DBColumn value changed, transfer it to the control if ( evt.PropertyName.equals( PROPERTY_VALUE ) ) { @@ -2151,9 +2150,9 @@ sal_Bool OBoundControlModel::connectToField(const Reference<XRowSet>& rForm) try { + sal_Int32 nFieldType = DataType::OTHER; if ( xFieldCandidate.is() ) { - sal_Int32 nFieldType = 0; xFieldCandidate->getPropertyValue( PROPERTY_FIELDTYPE ) >>= nFieldType; if ( approveDbColumnType( nFieldType ) ) impl_setField_noNotify( xFieldCandidate ); @@ -2165,6 +2164,8 @@ sal_Bool OBoundControlModel::connectToField(const Reference<XRowSet>& rForm) { if( m_xField->getPropertySetInfo()->hasPropertyByName( PROPERTY_VALUE ) ) { + m_nFieldType = nFieldType; + // an wertaenderungen horchen m_xField->addPropertyChangeListener( PROPERTY_VALUE, this ); m_xColumnUpdate = Reference< XColumnUpdate >( m_xField, UNO_QUERY ); @@ -2265,6 +2266,14 @@ void OBoundControlModel::impl_connectDatabaseColumn_noNotify( bool _bFromReload m_bLoaded = sal_True; onConnectedDbColumn( xRowSet ); + // Some derived classes decide to cache the "current" (resp. "last known") control value, so operations like + // commitControlValueToDbColumn can be made a no-op when nothing actually changed. + // Normally, this cache is kept in sync with the column value, but during a reload, this synchronization is + // temporarily disable. To allow the derived classes to update their cache from the current column value, + // we call translateDbColumnToControlValue. + if ( _bFromReload && hasField() ) + translateDbColumnToControlValue(); + // initially transfer the db column value to the control, if we successfully connected to a database column if ( hasField() ) initFromField( xRowSet ); diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx index 20900f3ec3e0..92883f70a950 100644 --- a/forms/source/xforms/model_ui.cxx +++ b/forms/source/xforms/model_ui.cxx @@ -539,18 +539,21 @@ Model::XModel_t Model::newModel( const Reference<com::sun::star::frame::XModel>& const OUString& sName ) throw( RuntimeException ) { - Model* pModel = NULL; + Model::XModel_t xModel; Reference<XNameContainer> xModels = lcl_getModels( xCmp ); if( xModels.is() && ! xModels->hasByName( sName ) ) { - pModel = new Model(); + Model* pModel = new Model(); + xModel.set( pModel ); + pModel->setID( sName ); pModel->newInstance( OUString(), OUString(), sal_False ); - xModels->insertByName( sName, makeAny( Reference<XModel>( pModel ) ) ); + pModel->initialize(); + xModels->insertByName( sName, makeAny( xModel ) ); } - return pModel; + return xModel; } void Model::renameModel( const Reference<com::sun::star::frame::XModel>& xCmp, diff --git a/forms/source/xforms/xpathlib/xpathlib.cxx b/forms/source/xforms/xpathlib/xpathlib.cxx index 1c4bf3f6d14f..a4dfbe3b08e6 100644 --- a/forms/source/xforms/xpathlib/xpathlib.cxx +++ b/forms/source/xforms/xpathlib/xpathlib.cxx @@ -293,7 +293,7 @@ void xforms_nowFunction(xmlXPathParserContextPtr ctxt, int /*nargs*/) */ DateTime aDateTime; ::rtl::OString aDateTimeString = makeDateTimeString(aDateTime); - xmlChar *pString = (xmlChar*)rtl_allocateMemory(aDateTimeString.getLength()+1); + xmlChar *pString = static_cast<xmlChar*>(xmlMalloc(aDateTimeString.getLength()+1)); strncpy((char*)pString, (char*)aDateTimeString.getStr(), aDateTimeString.getLength()); pString[aDateTimeString.getLength()] = 0; xmlXPathReturnString(ctxt, pString); diff --git a/forms/util/makefile.mk b/forms/util/makefile.mk index 1e99e6446f47..1c454b1383db 100644 --- a/forms/util/makefile.mk +++ b/forms/util/makefile.mk @@ -73,7 +73,7 @@ SHL1STDLIBS= \ $(COMPHELPERLIB) \ $(DBTOOLSLIB) \ $(TKLIB) \ - $(SVXLIB) \ + $(SVXCORELIB) \ $(UCBHELPERLIB) \ $(LIBXML2LIB) \ $(ICUUCLIB) \ @@ -96,22 +96,6 @@ RES1FILELIST=\ RESLIB1NAME=$(TARGET) RESLIB1SRSFILES=$(RES1FILELIST) -.IF "$(GUI)"=="UNX" - -# [ed] 6/19/02 Only add in libraries for X11 OS X builds - -.IF "$(OS)"=="MACOSX" -.IF "$(GUIBASE)"=="unx" -SHL1STDLIBS +=\ - -lX11 -lXt -lXmu -.ENDIF -.ELSE -SHL1STDLIBS +=\ - -lX11 -.ENDIF # OS == MACOSX - -.ENDIF - .IF "$(GUI)"=="OS2" SHL1STDLIBS += pthread.lib libz.lib .ENDIF |