[Libreoffice-commits] .: xmloff/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Oct 5 01:27:51 PDT 2011


 xmloff/source/forms/elementimport.cxx        |   23 ++++------
 xmloff/source/forms/layerimport.cxx          |    5 --
 xmloff/source/forms/propertyexport.cxx       |    9 ++-
 xmloff/source/forms/propertyimport.cxx       |   61 +++++++++++++--------------
 xmloff/source/transform/StyleOOoTContext.cxx |    2 
 5 files changed, 50 insertions(+), 50 deletions(-)

New commits:
commit bfcb6fd277a945523cec03d7022cfdc479e6344d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Oct 5 09:27:07 2011 +0100

    conversion operator is gone

diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 0c58235..6fc8d17 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -59,6 +59,7 @@
 #include <tools/diagnose_ex.h>
 #include <tools/time.hxx>
 #include <rtl/logfile.hxx>
+#include <rtl/strbuf.hxx>
 #include <comphelper/extract.hxx>
 #include <comphelper/types.hxx>
 
@@ -277,9 +278,9 @@ namespace xmloff
                 )
             {
                 OSL_ENSURE(m_xInfo->hasPropertyByName(aCheck->Name),
-                        ::rtl::OString("OElementImport::implApplySpecificProperties: read a property (")
-                    +=  ::rtl::OString(aCheck->Name.getStr(), aCheck->Name.getLength(), RTL_TEXTENCODING_ASCII_US)
-                    +=  ::rtl::OString(") which does not exist on the element!"));
+                        ::rtl::OStringBuffer("OElementImport::implApplySpecificProperties: read a property (").
+                    append(rtl::OUStringToOString(aCheck->Name, RTL_TEXTENCODING_ASCII_US)).
+                    append(") which does not exist on the element!").getStr());
             }
         }
 #endif
@@ -339,9 +340,9 @@ namespace xmloff
                 }
                 catch(Exception&)
                 {
-                    OSL_FAIL(::rtl::OString("OElementImport::implApplySpecificProperties: could not set the property \"")
-                        +=  ::rtl::OString(aPropValues->Name.getStr(), aPropValues->Name.getLength(), RTL_TEXTENCODING_ASCII_US)
-                        +=  ::rtl::OString("\"!"));
+                    OSL_FAIL(::rtl::OStringBuffer("OElementImport::implApplySpecificProperties: could not set the property \"").
+                        append(rtl::OUStringToOString(aPropValues->Name, RTL_TEXTENCODING_ASCII_US)).
+                        append("\"!").getStr());
                 }
             }
         }
@@ -481,9 +482,9 @@ namespace xmloff
             }
             catch(Exception&)
             {
-                OSL_FAIL(::rtl::OString("OElementImport::EndElement: could not set the property \"")
-                    +=  ::rtl::OString(aPropValues->Name.getStr(), aPropValues->Name.getLength(), RTL_TEXTENCODING_ASCII_US)
-                    +=  ::rtl::OString("\"!"));
+                OSL_FAIL(::rtl::OStringBuffer("OElementImport::EndElement: could not set the property \"").
+                    append(::rtl::OUStringToOString(aPropValues->Name, RTL_TEXTENCODING_ASCII_US)).
+                    append("\"!").getStr());
             }
         }
     }
@@ -643,9 +644,7 @@ namespace xmloff
         {
             Reference< XInterface > xPure = m_rFormImport.getGlobalContext().getServiceFactory()->createInstance(m_sServiceName);
             OSL_ENSURE(xPure.is(),
-                        ::rtl::OString("OElementImport::createElement: service factory gave me no object (service name: ")
-                    +=  ::rtl::OString(m_sServiceName.getStr(), m_sServiceName.getLength(), RTL_TEXTENCODING_ASCII_US)
-                    +=  ::rtl::OString(")!"));
+                        ::rtl::OStringBuffer("OElementImport::createElement: service factory gave me no object (service name: ").append(rtl::OUStringToOString(m_sServiceName, RTL_TEXTENCODING_ASCII_US)).append(")!").getStr());
             xReturn = Reference< XPropertySet >(xPure, UNO_QUERY);
         }
         else
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index f1b0262..734d6fa 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -62,6 +62,7 @@
 #include <xmloff/xmltoken.hxx>
 #include "xmloff/xmlnmspe.hxx"
 #include <rtl/logfile.hxx>
+#include <rtl/strbuf.hxx>
 #include <algorithm>
 
 SV_IMPL_REF( SvXMLStylesContext );
@@ -373,9 +374,7 @@ const SvXMLStyleContext* OFormLayerXMLImport_Impl::getStyleElement(const ::rtl::
     const SvXMLStyleContext* pControlStyle =
         m_pAutoStyles ? m_pAutoStyles->FindStyleChildContext( XML_STYLE_FAMILY_TEXT_PARAGRAPH, _rStyleName ) : NULL;
     OSL_ENSURE( pControlStyle || !m_pAutoStyles,
-                ::rtl::OString( "OFormLayerXMLImport_Impl::getStyleElement: did not find the style named \"" )
-            +=  ::rtl::OString( _rStyleName.getStr(), _rStyleName.getLength(), RTL_TEXTENCODING_ASCII_US )
-            +=  ::rtl::OString( "\"!" ) );
+                ::rtl::OStringBuffer("OFormLayerXMLImport_Impl::getStyleElement: did not find the style named \"").append(rtl::OUStringToOString(_rStyleName, RTL_TEXTENCODING_ASCII_US)).append("\"!").getStr() );
     return pControlStyle;
 }
 
diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx
index 28e53e1..5774057 100644
--- a/xmloff/source/forms/propertyexport.cxx
+++ b/xmloff/source/forms/propertyexport.cxx
@@ -37,11 +37,11 @@
 #include <xmloff/xmluconv.hxx>
 #include <xmloff/families.hxx>
 #include <osl/diagnose.h>
+#include <rtl/strbuf.hxx>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/util/Date.hpp>
 #include <com/sun/star/util/Time.hpp>
 #include <com/sun/star/util/DateTime.hpp>
-#include <osl/diagnose.h>
 #include <comphelper/extract.hxx>
 #include <comphelper/sequence.hxx>
 #include <comphelper/types.hxx>
@@ -705,9 +705,10 @@ namespace xmloff
             // the property must exist
             if (!m_xPropertyInfo->hasPropertyByName(_rPropertyName))
             {
-                OSL_FAIL(::rtl::OString("OPropertyExport::dbg_implCheckProperty: no property with the name ") +=
-                    ::rtl::OString(_rPropertyName.getStr(), _rPropertyName.getLength(), RTL_TEXTENCODING_ASCII_US) +=
-                    ::rtl::OString("!"));
+                rtl::OStringBuffer aBuf(RTL_CONSTASCII_STRINGPARAM(
+                    "OPropertyExport::dbg_implCheckProperty: no property with the name "));
+                aBuf.append(rtl::OUStringToOString(_rPropertyName, RTL_TEXTENCODING_ASCII_US)).append('!');
+                OSL_FAIL(aBuf.getStr());
                 return;
             }
 
diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx
index daea3d9..28d6ce7 100644
--- a/xmloff/source/forms/propertyimport.cxx
+++ b/xmloff/source/forms/propertyimport.cxx
@@ -44,6 +44,7 @@
 #include <com/sun/star/util/DateTime.hpp>
 #include <unotools/datetime.hxx>
 #include <rtl/logfile.hxx>
+#include <rtl/strbuf.hxx>
 
 #if OSL_DEBUG_LEVEL > 0
     #ifndef _OSL_THREAD_H_
@@ -116,9 +117,9 @@ Any PropertyConversion::convertString( SvXMLImport& _rImporter, const ::com::sun
         #endif
             _rImporter.GetMM100UnitConverter().convertBool(bValue, _rReadCharacters);
             OSL_ENSURE(bSuccess,
-                    ::rtl::OString("PropertyConversion::convertString: could not convert \"")
-                +=  ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US)
-                +=  ::rtl::OString("\" into a boolean!"));
+                    ::rtl::OStringBuffer("PropertyConversion::convertString: could not convert \"").
+                append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)).
+                append("\" into a boolean!").getStr());
             aReturn = ::cppu::bool2any(_bInvertBoolean ? !bValue : bValue);
         }
         break;
@@ -132,9 +133,9 @@ Any PropertyConversion::convertString( SvXMLImport& _rImporter, const ::com::sun
         #endif
                 _rImporter.GetMM100UnitConverter().convertNumber(nValue, _rReadCharacters);
                 OSL_ENSURE(bSuccess,
-                        ::rtl::OString("PropertyConversion::convertString: could not convert \"")
-                    +=  ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US)
-                    +=  ::rtl::OString("\" into an integer!"));
+                        ::rtl::OStringBuffer("PropertyConversion::convertString: could not convert \"").
+                    append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)).
+                    append("\" into an integer!").getStr());
                 if (TypeClass_SHORT == _rExpectedType.getTypeClass())
                     aReturn <<= (sal_Int16)nValue;
                 else
@@ -173,9 +174,9 @@ Any PropertyConversion::convertString( SvXMLImport& _rImporter, const ::com::sun
         #endif
             _rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters);
             OSL_ENSURE(bSuccess,
-                    ::rtl::OString("PropertyConversion::convertString: could not convert \"")
-                +=  ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US)
-                +=  ::rtl::OString("\" into a double!"));
+                    ::rtl::OStringBuffer("PropertyConversion::convertString: could not convert \"").
+                append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)).
+                append("\" into a double!").getStr());
             aReturn <<= (double)nValue;
         }
         break;
@@ -201,9 +202,9 @@ Any PropertyConversion::convertString( SvXMLImport& _rImporter, const ::com::sun
             #endif
                 _rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters);
                 OSL_ENSURE(bSuccess,
-                        ::rtl::OString("PropertyConversion::convertString: could not convert \"")
-                    +=  ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US)
-                    +=  ::rtl::OString("\" into a double!"));
+                        ::rtl::OStringBuffer("PropertyConversion::convertString: could not convert \"").
+                    append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)).
+                    append("\" into a double!").getStr());
 
                 // then convert it into the target type
                 switch (nType)
@@ -296,9 +297,9 @@ SvXMLImportContext* OPropertyImport::CreateChildContext(sal_uInt16 _nPrefix, con
     }
     else
     {
-        OSL_FAIL(::rtl::OString("OPropertyImport::CreateChildContext: unknown sub element (only \"properties\" is recognized, but it is ")
-            +=  ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US)
-            +=  ::rtl::OString(")!"));
+        OSL_FAIL(::rtl::OStringBuffer("OPropertyImport::CreateChildContext: unknown sub element (only \"properties\" is recognized, but it is ").
+            append(rtl::OUStringToOString(_rLocalName, RTL_TEXTENCODING_ASCII_US)).
+            append(")!").getStr());
         return SvXMLImportContext::CreateChildContext(_nPrefix, _rLocalName, _rxAttrList);
     }
 }
@@ -403,9 +404,9 @@ SvXMLImportContext* OPropertyElementsContext::CreateChildContext(sal_uInt16 _nPr
     }
     else
     {
-        OSL_FAIL(::rtl::OString("OPropertyElementsContext::CreateChildContext: unknown child element (\"")
-            +=  ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US)
-            +=  ::rtl::OString("\")!"));
+        OSL_FAIL(::rtl::OStringBuffer("OPropertyElementsContext::CreateChildContext: unknown child element (\"").
+            append(::rtl::OUStringToOString(_rLocalName, RTL_TEXTENCODING_ASCII_US)).
+            append("\")!").getStr());
         return new SvXMLImportContext(GetImport(), _nPrefix, _rLocalName);
     }
 }
@@ -442,9 +443,9 @@ OSinglePropertyContext::OSinglePropertyContext(SvXMLImport& _rImport, sal_uInt16
 SvXMLImportContext* OSinglePropertyContext::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
         const Reference< sax::XAttributeList >&)
 {
-    OSL_FAIL(::rtl::OString("OSinglePropertyContext::CreateChildContext: unknown child element (\"")
-        +=  ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US)
-        +=  ::rtl::OString("\")!"));
+    OSL_FAIL(::rtl::OStringBuffer("OSinglePropertyContext::CreateChildContext: unknown child element (\"").
+        append(::rtl::OUStringToOString(_rLocalName, RTL_TEXTENCODING_ASCII_US)).
+        append("\")!").getStr());
     return new SvXMLImportContext(GetImport(), _nPrefix, _rLocalName);
 }
 
@@ -542,9 +543,9 @@ void OListPropertyContext::StartElement( const Reference< sax::XAttributeList >&
         }
         else
         {
-            OSL_FAIL( ::rtl::OString( "OListPropertyContext::StartElement: unknown child element (\"")
-                +=  ::rtl::OString( sAttributeName.getStr(), sAttributeName.getLength(), RTL_TEXTENCODING_ASCII_US )
-                +=  ::rtl::OString( "\")!" ) );
+            OSL_FAIL( ::rtl::OStringBuffer( "OListPropertyContext::StartElement: unknown child element (\"").
+                append(rtl::OUStringToOString(sAttributeName, RTL_TEXTENCODING_ASCII_US)).
+                append("\")!").getStr() );
         }
     }
 }
@@ -586,9 +587,9 @@ SvXMLImportContext* OListPropertyContext::CreateChildContext( sal_uInt16 _nPrefi
     }
     else
     {
-        OSL_FAIL( ::rtl::OString("OListPropertyContext::CreateChildContext: unknown child element (\"")
-            +=  ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US)
-            +=  ::rtl::OString("\")!"));
+        OSL_FAIL( ::rtl::OStringBuffer("OListPropertyContext::CreateChildContext: unknown child element (\"").
+            append(rtl::OUStringToOString(_rLocalName.getStr(), RTL_TEXTENCODING_ASCII_US)).
+            append("\")!").getStr() );
         return new SvXMLImportContext( GetImport(), _nPrefix, _rLocalName );
     }
 }
@@ -626,9 +627,9 @@ void OListValueContext::StartElement( const Reference< sax::XAttributeList >& _r
             }
         }
 
-        OSL_FAIL( ::rtl::OString( "OListValueContext::StartElement: unknown child element (\"")
-            +=  ::rtl::OString( sAttributeName.getStr(), sAttributeName.getLength(), RTL_TEXTENCODING_ASCII_US )
-            +=  ::rtl::OString( "\")!" ) );
+        OSL_FAIL( ::rtl::OStringBuffer( "OListValueContext::StartElement: unknown child element (\"").
+            append(rtl::OUStringToOString(sAttributeName, RTL_TEXTENCODING_ASCII_US)).
+            append("\")!").getStr() );
     }
 }
 
diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx
index 88cff6b..a357f24 100644
--- a/xmloff/source/transform/StyleOOoTContext.cxx
+++ b/xmloff/source/transform/StyleOOoTContext.cxx
@@ -367,7 +367,7 @@ XMLTypedPropertiesOOoTContext_Impl
                                 RTL_TEXTENCODING_ASCII_US );
         aTmp += ::rtl::OString::valueOf( '>' );
 
-        OSL_ENSURE( !this, aTmp );
+        OSL_FAIL(aTmp.getStr());
     }
 #endif
 


More information about the Libreoffice-commits mailing list