[Libreoffice-commits] .: xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 29 00:45:21 PST 2013


 xmloff/source/xforms/XFormsBindContext.cxx       |   18 ++++++-------
 xmloff/source/xforms/XFormsModelContext.cxx      |    2 -
 xmloff/source/xforms/XFormsSubmissionContext.cxx |   30 +++++++++++------------
 xmloff/source/xforms/xformsapi.cxx               |    4 +--
 xmloff/source/xforms/xformsapi.hxx               |    3 --
 xmloff/source/xforms/xformsexport.cxx            |   28 ++++++++++-----------
 6 files changed, 41 insertions(+), 44 deletions(-)

New commits:
commit c4770788cba4bc3658285d955f5753e437b88998
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue Jan 29 09:43:53 2013 +0100

    xmloff: no longer necessary OUTSTRING() macro
    
    Change-Id: I60f588efb35d5968c21b7b0e0fc29bcbbd2dd50d

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


More information about the Libreoffice-commits mailing list