diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2005-03-23 10:36:36 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2005-03-23 10:36:36 +0000 |
commit | 46b4370cda2a90f719e366242810a607b01161a1 (patch) | |
tree | 2a25783cb23fc13899ebe1354beb8f8bc26bd6dc /forms | |
parent | b0eb524e5bc39a9d0ab2623c453c7900b3e56330 (diff) |
INTEGRATION: CWS eforms4 (1.2.6); FILE MERGED
2004/12/15 11:03:17 dvo 1.2.6.1: #i35397# use model namespaces (when possible)
Issue number:
Submitted by:
Reviewed by:
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/xforms/computedexpression.cxx | 42 | ||||
-rw-r--r-- | forms/source/xforms/computedexpression.hxx | 7 | ||||
-rw-r--r-- | forms/source/xforms/evaluationcontext.hxx | 12 |
3 files changed, 23 insertions, 38 deletions
diff --git a/forms/source/xforms/computedexpression.cxx b/forms/source/xforms/computedexpression.cxx index 1f34967658ca..58e94c55d41d 100644 --- a/forms/source/xforms/computedexpression.cxx +++ b/forms/source/xforms/computedexpression.cxx @@ -2,9 +2,9 @@ * * $RCSfile: computedexpression.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: obo $ $Date: 2004-11-16 10:49:37 $ + * last change: $Author: vg $ $Date: 2005-03-23 11:35:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -102,7 +102,6 @@ namespace xforms ComputedExpression::ComputedExpression() : msExpression(), - mxNamespaces( new NameContainer<OUString>() ), mbIsEmpty( true ), mbIsSimple( true ), mxResult() @@ -129,23 +128,6 @@ void ComputedExpression::setExpression( const OUString& rExpression ) } -Reference<XNameContainer> ComputedExpression::getNamespaces() const -{ - return mxNamespaces; -} - -void ComputedExpression::setNamespaces( - const Reference<XNameContainer>& xNamespaces ) -{ - OSL_ENSURE( xNamespaces.is(), "need namespaces" ); - OSL_ENSURE( xNamespaces->getElementType() == - getCppuType( static_cast<OUString*>( NULL ) ), - "namespaces must be string container" ); - - mxNamespaces = xNamespaces; -} - - bool ComputedExpression::_checkExpression( const sal_Char* pExpression ) const { OSL_ENSURE( pExpression != NULL, "no expression?" ); @@ -272,16 +254,18 @@ Reference<XXPathAPI> ComputedExpression::_getXPathAPI(const xforms::EvaluationCo xXPath->registerExtensionInstance(aExtension); // register namespaces - OSL_ENSURE( mxNamespaces.is(), "no namespaces!" ); - Sequence<OUString> aPrefixes = mxNamespaces->getElementNames(); - sal_Int32 nCount = aPrefixes.getLength(); - const OUString* pPrefixes = aPrefixes.getConstArray(); - for( sal_Int32 i = 0; i < nCount; i++ ) + if( aContext.mxNamespaces.is() ) { - const OUString* pNamePrefix = &pPrefixes[i]; - OUString sNameURL; - mxNamespaces->getByName( *pNamePrefix ) >>= sNameURL; - xXPath->registerNS( *pNamePrefix, sNameURL ); + Sequence<OUString> aPrefixes =aContext.mxNamespaces->getElementNames(); + sal_Int32 nCount = aPrefixes.getLength(); + const OUString* pPrefixes = aPrefixes.getConstArray(); + for( sal_Int32 i = 0; i < nCount; i++ ) + { + const OUString* pNamePrefix = &pPrefixes[i]; + OUString sNameURL; + aContext.mxNamespaces->getByName( *pNamePrefix ) >>= sNameURL; + xXPath->registerNS( *pNamePrefix, sNameURL ); + } } // done, so return xXPath-object diff --git a/forms/source/xforms/computedexpression.hxx b/forms/source/xforms/computedexpression.hxx index fe180c9f51e1..397d64a5be0b 100644 --- a/forms/source/xforms/computedexpression.hxx +++ b/forms/source/xforms/computedexpression.hxx @@ -2,9 +2,9 @@ * * $RCSfile: computedexpression.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: obo $ $Date: 2004-11-16 10:49:51 $ + * last change: $Author: vg $ $Date: 2005-03-23 11:35:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,9 +95,6 @@ class ComputedExpression /// the expression string rtl::OUString msExpression; - /// the namespaces that are used to interpret the expression string - com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> mxNamespaces; - /// is msExpression empty? bool mbIsEmpty; diff --git a/forms/source/xforms/evaluationcontext.hxx b/forms/source/xforms/evaluationcontext.hxx index f7e3af28dd36..a1609ffe3660 100644 --- a/forms/source/xforms/evaluationcontext.hxx +++ b/forms/source/xforms/evaluationcontext.hxx @@ -2,9 +2,9 @@ * * $RCSfile: evaluationcontext.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: obo $ $Date: 2004-11-16 10:52:39 $ + * last change: $Author: vg $ $Date: 2005-03-23 11:36:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,6 +63,7 @@ #define _EVALUATIONCONTEXT_HXX #include <com/sun/star/xml/dom/XNode.hpp> +#include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/xforms/XModel.hpp> namespace xforms @@ -76,6 +77,7 @@ public: EvaluationContext() : mxContextNode(), mxModel(), + mxNamespaces(), mnContextPosition( 0 ), mnContextSize( 0 ) { } @@ -83,18 +85,20 @@ public: EvaluationContext( const com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode>& xContextNode, const com::sun::star::uno::Reference<com::sun::star::xforms::XModel>& xModel, + const com::sun::star::uno::Reference<com::sun::star::container::XNameContainer>& xNamespaces, sal_Int32 nPosition, sal_Int32 nSize ) : mxContextNode( xContextNode ), mxModel( xModel ), + mxNamespaces( xNamespaces ), mnContextPosition( nPosition ), mnContextSize( nSize ) { } com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode> mxContextNode; com::sun::star::uno::Reference<com::sun::star::xforms::XModel> mxModel; - // ??? - // com::sun::star::uno::Reference<com::sun::star::xforms::XXFormsModelElement> mxContextNode; + com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> mxNamespaces; + sal_Int32 mnContextPosition; sal_Int32 mnContextSize; }; |