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/source/xforms/computedexpression.cxx | |
parent | INTEGRATION: CWS eforms4 (1.2.6); FILE MERGED (diff) | |
download | core-46b4370cda2a90f719e366242810a607b01161a1.tar.gz core-46b4370cda2a90f719e366242810a607b01161a1.zip |
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/source/xforms/computedexpression.cxx')
-rw-r--r-- | forms/source/xforms/computedexpression.cxx | 42 |
1 files changed, 13 insertions, 29 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 |