Kaydet (Commit) 46b4370c authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

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:
üst b0eb524e
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: computedexpression.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -102,7 +102,6 @@ namespace xforms ...@@ -102,7 +102,6 @@ namespace xforms
ComputedExpression::ComputedExpression() ComputedExpression::ComputedExpression()
: msExpression(), : msExpression(),
mxNamespaces( new NameContainer<OUString>() ),
mbIsEmpty( true ), mbIsEmpty( true ),
mbIsSimple( true ), mbIsSimple( true ),
mxResult() mxResult()
...@@ -129,23 +128,6 @@ void ComputedExpression::setExpression( const OUString& rExpression ) ...@@ -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 bool ComputedExpression::_checkExpression( const sal_Char* pExpression ) const
{ {
OSL_ENSURE( pExpression != NULL, "no expression?" ); OSL_ENSURE( pExpression != NULL, "no expression?" );
...@@ -272,16 +254,18 @@ Reference<XXPathAPI> ComputedExpression::_getXPathAPI(const xforms::EvaluationCo ...@@ -272,16 +254,18 @@ Reference<XXPathAPI> ComputedExpression::_getXPathAPI(const xforms::EvaluationCo
xXPath->registerExtensionInstance(aExtension); xXPath->registerExtensionInstance(aExtension);
// register namespaces // register namespaces
OSL_ENSURE( mxNamespaces.is(), "no namespaces!" ); if( aContext.mxNamespaces.is() )
Sequence<OUString> aPrefixes = 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]; Sequence<OUString> aPrefixes =aContext.mxNamespaces->getElementNames();
OUString sNameURL; sal_Int32 nCount = aPrefixes.getLength();
mxNamespaces->getByName( *pNamePrefix ) >>= sNameURL; const OUString* pPrefixes = aPrefixes.getConstArray();
xXPath->registerNS( *pNamePrefix, sNameURL ); 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 // done, so return xXPath-object
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: computedexpression.hxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -95,9 +95,6 @@ class ComputedExpression ...@@ -95,9 +95,6 @@ class ComputedExpression
/// the expression string /// the expression string
rtl::OUString msExpression; 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? /// is msExpression empty?
bool mbIsEmpty; bool mbIsEmpty;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: evaluationcontext.hxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#define _EVALUATIONCONTEXT_HXX #define _EVALUATIONCONTEXT_HXX
#include <com/sun/star/xml/dom/XNode.hpp> #include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/xforms/XModel.hpp> #include <com/sun/star/xforms/XModel.hpp>
namespace xforms namespace xforms
...@@ -76,6 +77,7 @@ public: ...@@ -76,6 +77,7 @@ public:
EvaluationContext() EvaluationContext()
: mxContextNode(), : mxContextNode(),
mxModel(), mxModel(),
mxNamespaces(),
mnContextPosition( 0 ), mnContextPosition( 0 ),
mnContextSize( 0 ) mnContextSize( 0 )
{ } { }
...@@ -83,18 +85,20 @@ public: ...@@ -83,18 +85,20 @@ public:
EvaluationContext( EvaluationContext(
const com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode>& xContextNode, 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::xforms::XModel>& xModel,
const com::sun::star::uno::Reference<com::sun::star::container::XNameContainer>& xNamespaces,
sal_Int32 nPosition, sal_Int32 nPosition,
sal_Int32 nSize ) sal_Int32 nSize )
: mxContextNode( xContextNode ), : mxContextNode( xContextNode ),
mxModel( xModel ), mxModel( xModel ),
mxNamespaces( xNamespaces ),
mnContextPosition( nPosition ), mnContextPosition( nPosition ),
mnContextSize( nSize ) mnContextSize( nSize )
{ } { }
com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode> mxContextNode; 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::XModel> mxModel;
// ??? com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> mxNamespaces;
// com::sun::star::uno::Reference<com::sun::star::xforms::XXFormsModelElement> mxContextNode;
sal_Int32 mnContextPosition; sal_Int32 mnContextPosition;
sal_Int32 mnContextSize; sal_Int32 mnContextSize;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment