summaryrefslogtreecommitdiff
path: root/framework/source/xml
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-06-24 16:07:47 +0000
committerKurt Zenker <kz@openoffice.org>2008-06-24 16:07:47 +0000
commitef96ab10bef47b3a44e9388c0671f4196464a5bd (patch)
treec0cbd82af3b4b4406e5f0e52718094055f6f5e6b /framework/source/xml
parent7bd6c13b077869284176feefe9bea3ecc18512d6 (diff)
INTEGRATION: CWS obo30 (1.5.40); FILE MERGED
2008/06/06 06:38:58 obo 1.5.40.2: #i90100# EOL missing 2008/05/30 08:31:13 obo 1.5.40.1: #i90100# ambigous Reference during ENABLE_PCH build
Diffstat (limited to 'framework/source/xml')
-rw-r--r--framework/source/xml/xmlnamespaces.cxx46
1 files changed, 23 insertions, 23 deletions
diff --git a/framework/source/xml/xmlnamespaces.cxx b/framework/source/xml/xmlnamespaces.cxx
index 708279c27d..bfe32e18eb 100644
--- a/framework/source/xml/xmlnamespaces.cxx
+++ b/framework/source/xml/xmlnamespaces.cxx
@@ -1,13 +1,13 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xmlnamespaces.cxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
* This file is part of OpenOffice.org.
*
@@ -33,11 +33,10 @@
#include <xml/xmlnamespaces.hxx>
-using namespace ::rtl;
using namespace ::com::sun::star::xml::sax;
using namespace ::com::sun::star::uno;
-const OUString aXMLAttributeNamespace( RTL_CONSTASCII_USTRINGPARAM( "xmlns" ));
+const ::rtl::OUString aXMLAttributeNamespace( RTL_CONSTASCII_USTRINGPARAM( "xmlns" ));
namespace framework
{
@@ -56,10 +55,10 @@ XMLNamespaces::~XMLNamespaces()
{
}
-void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue ) throw( SAXException )
+void XMLNamespaces::addNamespace( const ::rtl::OUString& aName, const ::rtl::OUString& aValue ) throw( SAXException )
{
NamespaceMap::iterator p;
- OUString aNamespaceName( aName );
+ ::rtl::OUString aNamespaceName( aName );
sal_Int32 nXMLNamespaceLength = aXMLAttributeNamespace.getLength();
// delete preceding "xmlns"
@@ -67,16 +66,16 @@ void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue
{
if ( aNamespaceName.getLength() == nXMLNamespaceLength )
{
- aNamespaceName = OUString();
+ aNamespaceName = ::rtl::OUString();
}
else if ( aNamespaceName.getLength() >= nXMLNamespaceLength+2 )
- {
+ {
aNamespaceName = aNamespaceName.copy( nXMLNamespaceLength+1 );
}
else
{
// a xml namespace without name is not allowed (e.g. "xmlns:" )
- OUString aErrorMessage( RTL_CONSTASCII_USTRINGPARAM( "A xml namespace without name is not allowed!" ));
+ ::rtl::OUString aErrorMessage( RTL_CONSTASCII_USTRINGPARAM( "A xml namespace without name is not allowed!" ));
throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
}
}
@@ -85,7 +84,7 @@ void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue
{
// namespace should be reseted - as xml draft states this is only allowed
// for the default namespace - check and throw exception if check fails
- OUString aErrorMessage( RTL_CONSTASCII_USTRINGPARAM( "Clearing xml namespace only allowed for default namespace!" ));
+ ::rtl::OUString aErrorMessage( RTL_CONSTASCII_USTRINGPARAM( "Clearing xml namespace only allowed for default namespace!" ));
throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
}
else
@@ -100,7 +99,7 @@ void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue
// replace current namespace definition
m_aNamespaceMap.erase( p );
m_aNamespaceMap.insert( NamespaceMap::value_type( aNamespaceName, aValue ));
- }
+ }
else
{
m_aNamespaceMap.insert( NamespaceMap::value_type( aNamespaceName, aValue ));
@@ -109,7 +108,7 @@ void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue
}
}
-OUString XMLNamespaces::applyNSToAttributeName( const OUString& aName ) const throw( SAXException )
+::rtl::OUString XMLNamespaces::applyNSToAttributeName( const ::rtl::OUString& aName ) const throw( SAXException )
{
// xml draft: there is no default namespace for attributes!
@@ -118,15 +117,15 @@ OUString XMLNamespaces::applyNSToAttributeName( const OUString& aName ) const th
{
if ( aName.getLength() > index+1 )
{
- OUString aAttributeName = getNamespaceValue( aName.copy( 0, index ) );
- aAttributeName += OUString::createFromAscii( "^" );
+ ::rtl::OUString aAttributeName = getNamespaceValue( aName.copy( 0, index ) );
+ aAttributeName += ::rtl::OUString::createFromAscii( "^" );
aAttributeName += aName.copy( index+1 );
return aAttributeName;
}
else
{
// attribute with namespace but without name "namespace:" is not allowed!!
- OUString aErrorMessage( RTL_CONSTASCII_USTRINGPARAM( "Attribute has no name only preceding namespace!" ));
+ ::rtl::OUString aErrorMessage( RTL_CONSTASCII_USTRINGPARAM( "Attribute has no name only preceding namespace!" ));
throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
}
}
@@ -134,13 +133,13 @@ OUString XMLNamespaces::applyNSToAttributeName( const OUString& aName ) const th
return aName;
}
-OUString XMLNamespaces::applyNSToElementName( const OUString& aName ) const throw( SAXException )
+::rtl::OUString XMLNamespaces::applyNSToElementName( const ::rtl::OUString& aName ) const throw( SAXException )
{
// xml draft: element names can have a default namespace
int index = aName.indexOf( ':' );
- OUString aNamespace;
- OUString aElementName = aName;
+ ::rtl::OUString aNamespace;
+ ::rtl::OUString aElementName = aName;
if ( index > 0 )
aNamespace = getNamespaceValue( aName.copy( 0, index ) );
@@ -150,7 +149,7 @@ OUString XMLNamespaces::applyNSToElementName( const OUString& aName ) const thro
if ( aNamespace.getLength() > 0 )
{
aElementName = aNamespace;
- aElementName += OUString::createFromAscii( "^" );
+ aElementName += ::rtl::OUString::createFromAscii( "^" );
}
else
return aName;
@@ -162,17 +161,17 @@ OUString XMLNamespaces::applyNSToElementName( const OUString& aName ) const thro
else
{
// attribute with namespace but without a name is not allowed (e.g. "cfg:" )
- OUString aErrorMessage( RTL_CONSTASCII_USTRINGPARAM( "Attribute has no name only preceding namespace!" ));
+ ::rtl::OUString aErrorMessage( RTL_CONSTASCII_USTRINGPARAM( "Attribute has no name only preceding namespace!" ));
throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
}
}
else
aElementName += aName;
-
+
return aElementName;
}
-OUString XMLNamespaces::getNamespaceValue( const OUString& aNamespace ) const throw( SAXException )
+::rtl::OUString XMLNamespaces::getNamespaceValue( const ::rtl::OUString& aNamespace ) const throw( SAXException )
{
if ( aNamespace.getLength() == 0 )
return m_aDefaultNamespace;
@@ -185,10 +184,11 @@ OUString XMLNamespaces::getNamespaceValue( const OUString& aNamespace ) const th
else
{
// namespace not defined => throw exception!
- OUString aErrorMessage( RTL_CONSTASCII_USTRINGPARAM( "XML namespace used but not defined!" ));
+ ::rtl::OUString aErrorMessage( RTL_CONSTASCII_USTRINGPARAM( "XML namespace used but not defined!" ));
throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
}
}
}
}
+