Kaydet (Commit) c4770788 authored tarafından Miklos Vajna's avatar Miklos Vajna

xmloff: no longer necessary OUTSTRING() macro

Change-Id: I60f588efb35d5968c21b7b0e0fc29bcbbd2dd50d
üst 78fde59e
...@@ -90,28 +90,28 @@ void XFormsBindContext::HandleAttribute( sal_uInt16 nToken, ...@@ -90,28 +90,28 @@ void XFormsBindContext::HandleAttribute( sal_uInt16 nToken,
switch( nToken ) switch( nToken )
{ {
case XML_NODESET: case XML_NODESET:
xforms_setValue( mxBinding, OUSTRING("BindingExpression"), rValue ); xforms_setValue( mxBinding, "BindingExpression", rValue );
break; break;
case XML_ID: case XML_ID:
xforms_setValue( mxBinding, OUSTRING("BindingID"), rValue ); xforms_setValue( mxBinding, "BindingID", rValue );
break; break;
case XML_READONLY: case XML_READONLY:
xforms_setValue( mxBinding, OUSTRING("ReadonlyExpression"), rValue ); xforms_setValue( mxBinding, "ReadonlyExpression", rValue );
break; break;
case XML_RELEVANT: case XML_RELEVANT:
xforms_setValue( mxBinding, OUSTRING("RelevantExpression"), rValue ); xforms_setValue( mxBinding, "RelevantExpression", rValue );
break; break;
case XML_REQUIRED: case XML_REQUIRED:
xforms_setValue( mxBinding, OUSTRING("RequiredExpression"), rValue ); xforms_setValue( mxBinding, "RequiredExpression", rValue );
break; break;
case XML_CONSTRAINT: case XML_CONSTRAINT:
xforms_setValue( mxBinding, OUSTRING("ConstraintExpression"), rValue ); xforms_setValue( mxBinding, "ConstraintExpression", rValue );
break; break;
case XML_CALCULATE: case XML_CALCULATE:
xforms_setValue( mxBinding, OUSTRING("CalculateExpression"), rValue ); xforms_setValue( mxBinding, "CalculateExpression", rValue );
break; break;
case XML_TYPE: case XML_TYPE:
xforms_setValue( mxBinding, OUSTRING("Type"), xforms_setValue( mxBinding, "Type",
makeAny( xforms_getTypeName( mxModel->getDataTypeRepository(), makeAny( xforms_getTypeName( mxModel->getDataTypeRepository(),
GetImport().GetNamespaceMap(), GetImport().GetNamespaceMap(),
rValue ) ) ); rValue ) ) );
...@@ -127,7 +127,7 @@ void XFormsBindContext::StartElement( ...@@ -127,7 +127,7 @@ void XFormsBindContext::StartElement(
{ {
// we need to register the namespaces // we need to register the namespaces
Reference<XNameContainer> xContainer( Reference<XNameContainer> xContainer(
mxBinding->getPropertyValue( OUSTRING("BindingNamespaces") ), mxBinding->getPropertyValue( "BindingNamespaces" ),
UNO_QUERY ); UNO_QUERY );
DBG_ASSERT( xContainer.is(), "binding should have a namespace container" ); DBG_ASSERT( xContainer.is(), "binding should have a namespace container" );
......
...@@ -91,7 +91,7 @@ void XFormsModelContext::HandleAttribute( ...@@ -91,7 +91,7 @@ void XFormsModelContext::HandleAttribute(
switch( nToken ) switch( nToken )
{ {
case XML_ID: case XML_ID:
mxModel->setPropertyValue( OUSTRING("ID"), makeAny( rValue ) ); mxModel->setPropertyValue( "ID", makeAny( rValue ) );
break; break;
case XML_SCHEMA: case XML_SCHEMA:
GetImport().SetError( XMLERROR_XFORMS_NO_SCHEMA_SUPPORT ); GetImport().SetError( XMLERROR_XFORMS_NO_SCHEMA_SUPPORT );
......
...@@ -106,50 +106,50 @@ void XFormsSubmissionContext::HandleAttribute( sal_uInt16 nToken, ...@@ -106,50 +106,50 @@ void XFormsSubmissionContext::HandleAttribute( sal_uInt16 nToken,
switch( nToken ) switch( nToken )
{ {
case XML_ID: case XML_ID:
xforms_setValue( mxSubmission, OUSTRING("ID"), rValue ); xforms_setValue( mxSubmission, "ID", rValue );
break; break;
case XML_BIND: case XML_BIND:
xforms_setValue( mxSubmission, OUSTRING("Bind"), rValue ); xforms_setValue( mxSubmission, "Bind", rValue );
break; break;
case XML_REF: case XML_REF:
xforms_setValue( mxSubmission, OUSTRING("Ref"), rValue ); xforms_setValue( mxSubmission, "Ref", rValue );
break; break;
case XML_ACTION: case XML_ACTION:
xforms_setValue( mxSubmission, OUSTRING("Action"), rValue ); xforms_setValue( mxSubmission, "Action", rValue );
break; break;
case XML_METHOD: case XML_METHOD:
xforms_setValue( mxSubmission, OUSTRING("Method"), rValue ); xforms_setValue( mxSubmission, "Method", rValue );
break; break;
case XML_VERSION: case XML_VERSION:
xforms_setValue( mxSubmission, OUSTRING("Version"), rValue ); xforms_setValue( mxSubmission, "Version", rValue );
break; break;
case XML_INDENT: case XML_INDENT:
xforms_setValue( mxSubmission, OUSTRING("Indent"), toBool( rValue ) ); xforms_setValue( mxSubmission, "Indent", toBool( rValue ) );
break; break;
case XML_MEDIATYPE: case XML_MEDIATYPE:
xforms_setValue( mxSubmission, OUSTRING("MediaType"), rValue ); xforms_setValue( mxSubmission, "MediaType", rValue );
break; break;
case XML_ENCODING: case XML_ENCODING:
xforms_setValue( mxSubmission, OUSTRING("Encoding"), rValue ); xforms_setValue( mxSubmission, "Encoding", rValue );
break; break;
case XML_OMIT_XML_DECLARATION: case XML_OMIT_XML_DECLARATION:
xforms_setValue( mxSubmission, OUSTRING("OmitXmlDeclaration"), xforms_setValue( mxSubmission, "OmitXmlDeclaration",
toBool( rValue ) ); toBool( rValue ) );
break; break;
case XML_STANDALONE: case XML_STANDALONE:
xforms_setValue( mxSubmission, OUSTRING("Standalone"), toBool( rValue ) ); xforms_setValue( mxSubmission, "Standalone", toBool( rValue ) );
break; break;
case XML_CDATA_SECTION_ELEMENTS: case XML_CDATA_SECTION_ELEMENTS:
xforms_setValue( mxSubmission, OUSTRING("CDataSectionElement"), rValue ); xforms_setValue( mxSubmission, "CDataSectionElement", rValue );
break; break;
case XML_REPLACE: case XML_REPLACE:
xforms_setValue( mxSubmission, OUSTRING("Replace"), rValue ); xforms_setValue( mxSubmission, "Replace", rValue );
break; break;
case XML_SEPARATOR: case XML_SEPARATOR:
xforms_setValue( mxSubmission, OUSTRING("Separator"), rValue ); xforms_setValue( mxSubmission, "Separator", rValue );
break; break;
case XML_INCLUDENAMESPACEPREFIXES: case XML_INCLUDENAMESPACEPREFIXES:
xforms_setValue( mxSubmission, OUSTRING("IncludeNamespacePrefixes"), rValue ); xforms_setValue( mxSubmission, "IncludeNamespacePrefixes", rValue );
break; break;
default: default:
OSL_FAIL( "unknown attribute" ); OSL_FAIL( "unknown attribute" );
......
...@@ -71,7 +71,7 @@ static Reference<XPropertySet> lcl_createPropertySet( const OUString& rServiceNa ...@@ -71,7 +71,7 @@ static Reference<XPropertySet> lcl_createPropertySet( const OUString& rServiceNa
Reference<XPropertySet> xforms_createXFormsModel() Reference<XPropertySet> xforms_createXFormsModel()
{ {
return lcl_createPropertySet( OUSTRING( "com.sun.star.xforms.Model" ) ); return lcl_createPropertySet( "com.sun.star.xforms.Model" );
} }
void xforms_addXFormsModel( void xforms_addXFormsModel(
...@@ -88,7 +88,7 @@ void xforms_addXFormsModel( ...@@ -88,7 +88,7 @@ void xforms_addXFormsModel(
if( xForms.is() ) if( xForms.is() )
{ {
OUString sName; OUString sName;
xModel->getPropertyValue( OUSTRING("ID")) >>= sName; xModel->getPropertyValue("ID") >>= sName;
xForms->insertByName( sName, makeAny( xModel ) ); xForms->insertByName( sName, makeAny( xModel ) );
bSuccess = true; bSuccess = true;
} }
......
...@@ -35,9 +35,6 @@ namespace com { namespace sun { namespace star { ...@@ -35,9 +35,6 @@ namespace com { namespace sun { namespace star {
} } } } } }
class SvXMLNamespaceMap; class SvXMLNamespaceMap;
#define OUSTRING(msg) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(msg))
com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xforms_createXFormsModel(); com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xforms_createXFormsModel();
void xforms_addXFormsModel( void xforms_addXFormsModel(
......
...@@ -284,16 +284,16 @@ void exportXFormsBinding( SvXMLExport& rExport, ...@@ -284,16 +284,16 @@ void exportXFormsBinding( SvXMLExport& rExport,
// name check; generate binding ID if necessary // name check; generate binding ID if necessary
{ {
OUString sName; OUString sName;
xBinding->getPropertyValue( OUSTRING("BindingID") ) >>= sName; xBinding->getPropertyValue( "BindingID" ) >>= sName;
if( sName.isEmpty() ) if( sName.isEmpty() )
{ {
// if we don't have a name yet, generate one on the fly // if we don't have a name yet, generate one on the fly
OUStringBuffer aBuffer; OUStringBuffer aBuffer;
aBuffer.append( OUSTRING("bind_" ) ); aBuffer.append( "bind_" );
sal_Int64 nId = reinterpret_cast<sal_uInt64>( xBinding.get() ); sal_Int64 nId = reinterpret_cast<sal_uInt64>( xBinding.get() );
aBuffer.append( nId , 16 ); aBuffer.append( nId , 16 );
sName = aBuffer.makeStringAndClear(); sName = aBuffer.makeStringAndClear();
xBinding->setPropertyValue( OUSTRING("BindingID"), makeAny(sName)); xBinding->setPropertyValue( "BindingID", makeAny(sName));
} }
} }
...@@ -302,14 +302,14 @@ void exportXFormsBinding( SvXMLExport& rExport, ...@@ -302,14 +302,14 @@ void exportXFormsBinding( SvXMLExport& rExport,
// handle type attribute // handle type attribute
{ {
OUString sTypeName; OUString sTypeName;
xBinding->getPropertyValue( OUSTRING("Type") ) >>= sTypeName; xBinding->getPropertyValue( "Type" ) >>= sTypeName;
try try
{ {
// now get type, and determine whether its a standard type. If // now get type, and determine whether its a standard type. If
// so, export the XSD name // so, export the XSD name
Reference<com::sun::star::xforms::XModel> xModel( Reference<com::sun::star::xforms::XModel> xModel(
xBinding->getPropertyValue( OUSTRING("Model") ), xBinding->getPropertyValue( "Model" ),
UNO_QUERY ); UNO_QUERY );
Reference<XDataTypeRepository> xRepository( Reference<XDataTypeRepository> xRepository(
xModel.is() ? xModel->getDataTypeRepository() : Reference<XDataTypeRepository>() ); xModel.is() ? xModel->getDataTypeRepository() : Reference<XDataTypeRepository>() );
...@@ -322,7 +322,7 @@ void exportXFormsBinding( SvXMLExport& rExport, ...@@ -322,7 +322,7 @@ void exportXFormsBinding( SvXMLExport& rExport,
// if it's a basic data type, write out the XSD name // if it's a basic data type, write out the XSD name
// for the XSD type class // for the XSD type class
bool bIsBasic = false; bool bIsBasic = false;
xDataType->getPropertyValue( OUSTRING("IsBasic") ) >>= bIsBasic; xDataType->getPropertyValue( "IsBasic" ) >>= bIsBasic;
if( bIsBasic ) if( bIsBasic )
sTypeName = lcl_getXSDType( rExport, xDataType ); sTypeName = lcl_getXSDType( rExport, xDataType );
} }
...@@ -344,7 +344,7 @@ void exportXFormsBinding( SvXMLExport& rExport, ...@@ -344,7 +344,7 @@ void exportXFormsBinding( SvXMLExport& rExport,
// to do so, we will write out all missing namespace declaractions. // to do so, we will write out all missing namespace declaractions.
const SvXMLNamespaceMap& rMap = rExport.GetNamespaceMap(); const SvXMLNamespaceMap& rMap = rExport.GetNamespaceMap();
Reference<XNameAccess> xNamespaces( Reference<XNameAccess> xNamespaces(
xBinding->getPropertyValue( OUSTRING("ModelNamespaces") ), UNO_QUERY); xBinding->getPropertyValue( "ModelNamespaces" ), UNO_QUERY);
if( xNamespaces.is() ) if( xNamespaces.is() )
{ {
// iterate over Prefixes for this binding // iterate over Prefixes for this binding
...@@ -364,7 +364,7 @@ void exportXFormsBinding( SvXMLExport& rExport, ...@@ -364,7 +364,7 @@ void exportXFormsBinding( SvXMLExport& rExport,
if( nKey == XML_NAMESPACE_UNKNOWN || if( nKey == XML_NAMESPACE_UNKNOWN ||
rMap.GetNameByKey( nKey ) != sURI ) rMap.GetNameByKey( nKey ) != sURI )
{ {
rExport.AddAttribute( OUSTRING("xmlns:") + rPrefix, sURI ); rExport.AddAttribute( "xmlns:" + rPrefix, sURI );
} }
} }
} }
...@@ -481,7 +481,7 @@ static OUString lcl_getXSDType( SvXMLExport& rExport, ...@@ -481,7 +481,7 @@ static OUString lcl_getXSDType( SvXMLExport& rExport,
XMLTokenEnum eToken = XML_STRING; XMLTokenEnum eToken = XML_STRING;
sal_uInt16 nDataTypeClass = 0; sal_uInt16 nDataTypeClass = 0;
xType->getPropertyValue( OUSTRING("TypeClass") ) >>= nDataTypeClass; xType->getPropertyValue( "TypeClass" ) >>= nDataTypeClass;
switch( nDataTypeClass ) switch( nDataTypeClass )
{ {
case com::sun::star::xsd::DataTypeClass::STRING: case com::sun::star::xsd::DataTypeClass::STRING:
...@@ -540,7 +540,7 @@ static void lcl_exportDataType( SvXMLExport& rExport, ...@@ -540,7 +540,7 @@ static void lcl_exportDataType( SvXMLExport& rExport,
{ {
// we do not need to export basic types; exit if we have one // we do not need to export basic types; exit if we have one
bool bIsBasic = false; bool bIsBasic = false;
xType->getPropertyValue( OUSTRING("IsBasic") ) >>= bIsBasic; xType->getPropertyValue( "IsBasic" ) >>= bIsBasic;
if( bIsBasic ) if( bIsBasic )
return; return;
...@@ -548,7 +548,7 @@ static void lcl_exportDataType( SvXMLExport& rExport, ...@@ -548,7 +548,7 @@ static void lcl_exportDataType( SvXMLExport& rExport,
// <xsd:simpleType name="..."> // <xsd:simpleType name="...">
OUString sName; OUString sName;
xType->getPropertyValue( OUSTRING("Name") ) >>= sName; xType->getPropertyValue( "Name" ) >>= sName;
rExport.AddAttribute( XML_NAMESPACE_NONE, XML_NAME, sName ); rExport.AddAttribute( XML_NAMESPACE_NONE, XML_NAME, sName );
SvXMLElementExport aSimpleType( rExport, SvXMLElementExport aSimpleType( rExport,
XML_NAMESPACE_XSD, XML_SIMPLETYPE, XML_NAMESPACE_XSD, XML_SIMPLETYPE,
...@@ -596,7 +596,7 @@ void exportXFormsSchemas( SvXMLExport& rExport, ...@@ -596,7 +596,7 @@ void exportXFormsSchemas( SvXMLExport& rExport,
if( xPropSet.is() ) if( xPropSet.is() )
{ {
Reference<XDocument> xDocument( Reference<XDocument> xDocument(
xPropSet->getPropertyValue( OUSTRING("ForeignSchema") ), xPropSet->getPropertyValue( "ForeignSchema" ),
UNO_QUERY ); UNO_QUERY );
if( xDocument.is() ) if( xDocument.is() )
...@@ -726,7 +726,7 @@ OUString xforms_whitespace( const Any& rAny ) ...@@ -726,7 +726,7 @@ OUString xforms_whitespace( const Any& rAny )
/// return name of Binding /// return name of Binding
static OUString lcl_getXFormsBindName( const Reference<XPropertySet>& xBinding ) static OUString lcl_getXFormsBindName( const Reference<XPropertySet>& xBinding )
{ {
OUString sProp( OUSTRING( "BindingID" ) ); OUString sProp( "BindingID" );
OUString sReturn; OUString sReturn;
if( xBinding.is() && if( xBinding.is() &&
...@@ -767,7 +767,7 @@ OUString getXFormsSubmissionName( const Reference<XPropertySet>& xBinding ) ...@@ -767,7 +767,7 @@ OUString getXFormsSubmissionName( const Reference<XPropertySet>& xBinding )
{ {
Reference<XPropertySet> xPropertySet( Reference<XPropertySet> xPropertySet(
xSubmissionSupplier->getSubmission(), UNO_QUERY ); xSubmissionSupplier->getSubmission(), UNO_QUERY );
OUString sProp( OUSTRING("ID") ); OUString sProp( "ID" );
if( xPropertySet.is() && if( xPropertySet.is() &&
xPropertySet->getPropertySetInfo()->hasPropertyByName( sProp ) ) xPropertySet->getPropertySetInfo()->hasPropertyByName( sProp ) )
{ {
......
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