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 @@
*
* $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
......
......@@ -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;
......
......@@ -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;
};
......
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