diff options
31 files changed, 373 insertions, 395 deletions
diff --git a/comphelper/inc/comphelper/documentconstants.hxx b/comphelper/inc/comphelper/documentconstants.hxx index 7d211036f140..1f8dbd2f14ef 100644 --- a/comphelper/inc/comphelper/documentconstants.hxx +++ b/comphelper/inc/comphelper/documentconstants.hxx @@ -32,26 +32,26 @@ #define MIMETYPE_VND_SUN_XML_MATH_ASCII "application/vnd.sun.xml.math" #define MIMETYPE_VND_SUN_XML_BASE_ASCII "application/vnd.sun.xml.base" -#define MIMETYPE_VND_SUN_XML_WRITER ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_WRITER_ASCII ) ) -#define MIMETYPE_VND_SUN_XML_WRITER_WEB ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_WRITER_WEB_ASCII ) ) -#define MIMETYPE_VND_SUN_XML_WRITER_GLOBAL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_WRITER_GLOBAL_ASCII ) ) -#define MIMETYPE_VND_SUN_XML_DRAW ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_DRAW_ASCII ) ) -#define MIMETYPE_VND_SUN_XML_IMPRESS ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_IMPRESS_ASCII ) ) -#define MIMETYPE_VND_SUN_XML_CALC ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_CALC_ASCII ) ) -#define MIMETYPE_VND_SUN_XML_CHART ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_CHART_ASCII ) ) -#define MIMETYPE_VND_SUN_XML_MATH ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_MATH_ASCII ) ) -#define MIMETYPE_VND_SUN_XML_BASE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_BASE_ASCII ) ) +#define MIMETYPE_VND_SUN_XML_WRITER ::rtl::OUString( MIMETYPE_VND_SUN_XML_WRITER_ASCII ) +#define MIMETYPE_VND_SUN_XML_WRITER_WEB ::rtl::OUString( MIMETYPE_VND_SUN_XML_WRITER_WEB_ASCII ) +#define MIMETYPE_VND_SUN_XML_WRITER_GLOBAL ::rtl::OUString( MIMETYPE_VND_SUN_XML_WRITER_GLOBAL_ASCII ) +#define MIMETYPE_VND_SUN_XML_DRAW ::rtl::OUString( MIMETYPE_VND_SUN_XML_DRAW_ASCII ) +#define MIMETYPE_VND_SUN_XML_IMPRESS ::rtl::OUString( MIMETYPE_VND_SUN_XML_IMPRESS_ASCII ) +#define MIMETYPE_VND_SUN_XML_CALC ::rtl::OUString( MIMETYPE_VND_SUN_XML_CALC_ASCII ) +#define MIMETYPE_VND_SUN_XML_CHART ::rtl::OUString( MIMETYPE_VND_SUN_XML_CHART_ASCII ) +#define MIMETYPE_VND_SUN_XML_MATH ::rtl::OUString( MIMETYPE_VND_SUN_XML_MATH_ASCII ) +#define MIMETYPE_VND_SUN_XML_BASE ::rtl::OUString( MIMETYPE_VND_SUN_XML_BASE_ASCII ) // template formats of SO6/7 -#define MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE_ASCII "application/vnd.sun.xml.writer.template" -#define MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE_ASCII "application/vnd.sun.xml.draw.template" -#define MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE_ASCII "application/vnd.sun.xml.impress.template" -#define MIMETYPE_VND_SUN_XML_CALC_TEMPLATE_ASCII "application/vnd.sun.xml.calc.template" +#define MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE_ASCII "application/vnd.sun.xml.writer.template" +#define MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE_ASCII "application/vnd.sun.xml.draw.template" +#define MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE_ASCII "application/vnd.sun.xml.impress.template" +#define MIMETYPE_VND_SUN_XML_CALC_TEMPLATE_ASCII "application/vnd.sun.xml.calc.template" -#define MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_WRITER_ASCII ) ) -#define MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_DRAW_ASCII ) ) -#define MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_IMPRESS_ASCII ) ) -#define MIMETYPE_VND_SUN_XML_CALC_TEMPLATE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_VND_SUN_XML_CALC_ASCII ) ) +#define MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE ::rtl::OUString( MIMETYPE_VND_SUN_XML_WRITER_ASCII ) +#define MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE ::rtl::OUString( MIMETYPE_VND_SUN_XML_DRAW_ASCII ) +#define MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE ::rtl::OUString( MIMETYPE_VND_SUN_XML_IMPRESS_ASCII ) +#define MIMETYPE_VND_SUN_XML_CALC_TEMPLATE ::rtl::OUString( MIMETYPE_VND_SUN_XML_CALC_ASCII ) // formats of SO8 #define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII "application/vnd.oasis.opendocument.text" @@ -66,17 +66,17 @@ #define MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII "application/vnd.sun.xml.report" #define MIMETYPE_OASIS_OPENDOCUMENT_REPORT_CHART_ASCII "application/vnd.sun.xml.report.chart" -#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_CHART ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_DATABASE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_REPORT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_REPORT_CHART ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_REPORT_CHART_ASCII ) ) +#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT ::rtl::OUString( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB ::rtl::OUString( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL ::rtl::OUString( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING ::rtl::OUString( MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION ::rtl::OUString( MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET ::rtl::OUString( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_CHART ::rtl::OUString( MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA ::rtl::OUString( MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_DATABASE ::rtl::OUString( MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_REPORT ::rtl::OUString( MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_REPORT_CHART ::rtl::OUString( MIMETYPE_OASIS_OPENDOCUMENT_REPORT_CHART_ASCII ) // template formats of SO8 #define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII "application/vnd.oasis.opendocument.text-template" @@ -86,21 +86,21 @@ #define MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE_ASCII "application/vnd.oasis.opendocument.chart-template" #define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII "application/vnd.oasis.opendocument.formula-template" -#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE_ASCII ) ) -#define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII ) ) +#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE_ASCII ) +#define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII ) // ODF versions #define ODFVER_010_TEXT_ASCII "1.0" #define ODFVER_011_TEXT_ASCII "1.1" #define ODFVER_012_TEXT_ASCII "1.2" -#define ODFVER_010_TEXT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ODFVER_010_TEXT_ASCII ) ) -#define ODFVER_011_TEXT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ODFVER_011_TEXT_ASCII ) ) -#define ODFVER_012_TEXT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ODFVER_012_TEXT_ASCII ) ) +#define ODFVER_010_TEXT ::rtl::OUString( ODFVER_010_TEXT_ASCII ) +#define ODFVER_011_TEXT ::rtl::OUString( ODFVER_011_TEXT_ASCII ) +#define ODFVER_012_TEXT ::rtl::OUString( ODFVER_012_TEXT_ASCII ) #endif // filter flags diff --git a/comphelper/inc/comphelper/sequenceasvector.hxx b/comphelper/inc/comphelper/sequenceasvector.hxx index 88c757315c3e..4f4ceb70501a 100644 --- a/comphelper/inc/comphelper/sequenceasvector.hxx +++ b/comphelper/inc/comphelper/sequenceasvector.hxx @@ -163,7 +163,7 @@ class SequenceAsVector : public ::std::vector< TElementType > ::com::sun::star::uno::Sequence< TElementType > lSource; if (!(aSource >>= lSource)) throw ::com::sun::star::beans::IllegalTypeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SequenceAsVector operator<<(Any) was called with an unsupported Any type.")), + OUString("SequenceAsVector operator<<(Any) was called with an unsupported Any type."), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >()); (*this) << lSource; diff --git a/comphelper/inc/comphelper/storagehelper.hxx b/comphelper/inc/comphelper/storagehelper.hxx index 2c0a45518b02..5bbbebe2ae19 100644 --- a/comphelper/inc/comphelper/storagehelper.hxx +++ b/comphelper/inc/comphelper/storagehelper.hxx @@ -28,13 +28,13 @@ #include "comphelper/comphelperdllapi.h" -#define PACKAGE_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageFormat" ) ) -#define ZIP_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ZipFormat" ) ) -#define OFOPXML_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OFOPXMLFormat" ) ) +#define PACKAGE_STORAGE_FORMAT_STRING ::rtl::OUString( "PackageFormat" ) +#define ZIP_STORAGE_FORMAT_STRING ::rtl::OUString( "ZipFormat" ) +#define OFOPXML_STORAGE_FORMAT_STRING ::rtl::OUString( "OFOPXMLFormat" ) -#define PACKAGE_ENCRYPTIONDATA_SHA256UTF8 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA256UTF8EncryptionKey" ) ) -#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1UTF8EncryptionKey" ) ) -#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1MS1252EncryptionKey" ) ) +#define PACKAGE_ENCRYPTIONDATA_SHA256UTF8 ::rtl::OUString( "PackageSHA256UTF8EncryptionKey" ) +#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8 ::rtl::OUString( "PackageSHA1UTF8EncryptionKey" ) +#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 ::rtl::OUString( "PackageSHA1MS1252EncryptionKey" ) namespace com { namespace sun { namespace star { namespace beans { struct NamedValue; } diff --git a/comphelper/inc/comphelper/unwrapargs.hxx b/comphelper/inc/comphelper/unwrapargs.hxx index bdd8d769de4a..ca4681b8992c 100644 --- a/comphelper/inc/comphelper/unwrapargs.hxx +++ b/comphelper/inc/comphelper/unwrapargs.hxx @@ -47,15 +47,14 @@ inline void extract( { if (nArg >= seq.getLength()) { throw ::com::sun::star::lang::IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "No such argument available!") ), + OUString( "No such argument available!"), xErrorContext, static_cast<sal_Int16>(nArg) ); } if (! (seq[nArg] >>= v)) { ::rtl::OUStringBuffer buf; - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("Cannot extract ANY { ") ); + buf.append( "Cannot extract ANY { " ); buf.append( seq[nArg].getValueType().getTypeName() ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" } to ") ); + buf.append( " } to " ); buf.append( ::cppu::UnoType<T>::get().getTypeName() ); buf.append( static_cast<sal_Unicode>('!') ); throw ::com::sun::star::lang::IllegalArgumentException( diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx index 9061dc40d0c8..dd22c4b64875 100644 --- a/comphelper/qa/string/test_string.cxx +++ b/comphelper/qa/string/test_string.cxx @@ -62,7 +62,7 @@ public: void TestString::testDecimalStringToNumber() { - rtl::OUString s1(RTL_CONSTASCII_USTRINGPARAM("1234")); + rtl::OUString s1("1234"); CPPUNIT_ASSERT_EQUAL((sal_uInt32)1234, comphelper::string::decimalStringToNumber(s1)); s1 += rtl::OUString(static_cast<sal_Unicode>(0x07C6)); CPPUNIT_ASSERT_EQUAL((sal_uInt32)12346, comphelper::string::decimalStringToNumber(s1)); @@ -74,10 +74,10 @@ void TestString::testDecimalStringToNumber() void TestString::testIsdigitAsciiString() { - rtl::OString s1(RTL_CONSTASCII_STRINGPARAM("1234")); + rtl::OString s1("1234"); CPPUNIT_ASSERT_EQUAL(comphelper::string::isdigitAsciiString(s1), true); - rtl::OString s2(RTL_CONSTASCII_STRINGPARAM("1A34")); + rtl::OString s2("1A34"); CPPUNIT_ASSERT_EQUAL(comphelper::string::isdigitAsciiString(s2), false); rtl::OString s3; @@ -223,70 +223,70 @@ void TestString::testNatural() // --- Some generic tests to ensure we do not alter original behavior // outside what we want CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("ABC"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("ABC"))), xCollator, xBI, lang::Locale()) == 0 + compareNatural("ABC", "ABC", xCollator, xBI, lang::Locale()) == 0 ); // Case sensitivity CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("ABC"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("abc"))), xCollator, xBI, lang::Locale()) < 0 + compareNatural("ABC", "abc", xCollator, xBI, lang::Locale()) < 0 ); // Reverse CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("abc"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("ABC"))), xCollator, xBI, lang::Locale()) > 0 + compareNatural("abc", "ABC", xCollator, xBI, lang::Locale()) > 0 ); // First shorter CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("alongstring"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("alongerstring"))), xCollator, xBI, lang::Locale()) > 0 + compareNatural("alongstring", "alongerstring", xCollator, xBI, lang::Locale()) > 0 ); // Second shorter CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("alongerstring"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("alongstring"))), xCollator, xBI, lang::Locale()) < 0 + compareNatural("alongerstring", "alongstring", xCollator, xBI, lang::Locale()) < 0 ); // -- Here we go on natural order, each one is followed by classic compare and the reverse comparison // That's why we originally made the patch CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("Heading 9"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("Heading 10"))), xCollator, xBI, lang::Locale()) < 0 + compareNatural("Heading 9", "Heading 10", xCollator, xBI, lang::Locale()) < 0 ); // Original behavior CPPUNIT_ASSERT( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("Heading 9"))).compareTo(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("Heading 10")))) > 0 + OUString("Heading 9").compareTo("Heading 10") > 0 ); CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("Heading 10"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("Heading 9"))), xCollator, xBI, lang::Locale()) > 0 + compareNatural("Heading 10", "Heading 9", xCollator, xBI, lang::Locale()) > 0 ); // Harder CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("July, the 4th"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("July, the 10th"))), xCollator, xBI, lang::Locale()) < 0 + compareNatural("July, the 4th", "July, the 10th", xCollator, xBI, lang::Locale()) < 0 ); CPPUNIT_ASSERT( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("July, the 4th"))).compareTo(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("July, the 10th")))) > 0 + OUString("July, the 4th").compareTo("July, the 10th") > 0 ); CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("July, the 10th"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("July, the 4th"))), xCollator, xBI, lang::Locale()) > 0 + compareNatural("July, the 10th", "July, the 4th", xCollator, xBI, lang::Locale()) > 0 ); // Hardest CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("abc08"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("abc010"))), xCollator, xBI, lang::Locale()) < 0 + compareNatural("abc08", "abc010", xCollator, xBI, lang::Locale()) < 0 ); CPPUNIT_ASSERT( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("abc08"))).compareTo(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("abc010")))) > 0 + OUString("abc08").compareTo("abc010") > 0 ); CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("abc010"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("abc08"))), xCollator, xBI, lang::Locale()) > 0 + compareNatural("abc010", "abc08", xCollator, xBI, lang::Locale()) > 0 ); CPPUNIT_ASSERT( - compareNatural(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("apple10apple"))), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(("apple10apple"))), xCollator, xBI, lang::Locale()) == 0 + compareNatural("apple10apple", "apple10apple", xCollator, xBI, lang::Locale()) == 0 ); } void TestString::testRemove() { - ::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("abc")); + ::rtl::OString aIn("abc"); ::rtl::OString aOut; aOut = ::comphelper::string::remove(aIn, 'b'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("ac"))); + CPPUNIT_ASSERT(aOut == "ac"); - aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aaa")); + aIn = "aaa"; aOut = ::comphelper::string::remove(aIn, 'a'); CPPUNIT_ASSERT(aOut.isEmpty()); @@ -294,80 +294,80 @@ void TestString::testRemove() void TestString::testStripStart() { - ::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("abc")); + ::rtl::OString aIn("abc"); ::rtl::OString aOut; aOut = ::comphelper::string::stripStart(aIn, 'b'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("abc"))); + CPPUNIT_ASSERT(aOut == "abc"); aOut = ::comphelper::string::stripStart(aIn, 'a'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("bc"))); + CPPUNIT_ASSERT(aOut == "bc"); - aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aaa")); + aIn = "aaa"; aOut = ::comphelper::string::stripStart(aIn, 'a'); CPPUNIT_ASSERT(aOut.isEmpty()); - aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aba")); + aIn = "aba"; aOut = ::comphelper::string::stripStart(aIn, 'a'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("ba"))); + CPPUNIT_ASSERT(aOut == "ba"); } void TestString::testStripEnd() { - ::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("abc")); + ::rtl::OString aIn("abc"); ::rtl::OString aOut; aOut = ::comphelper::string::stripEnd(aIn, 'b'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("abc"))); + CPPUNIT_ASSERT(aOut == "abc"); aOut = ::comphelper::string::stripEnd(aIn, 'c'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("ab"))); + CPPUNIT_ASSERT(aOut == "ab"); - aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aaa")); + aIn = "aaa"; aOut = ::comphelper::string::stripEnd(aIn, 'a'); CPPUNIT_ASSERT(aOut.isEmpty()); - aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aba")); + aIn = "aba"; aOut = ::comphelper::string::stripEnd(aIn, 'a'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("ab"))); + CPPUNIT_ASSERT(aOut == "ab"); } void TestString::testStrip() { - ::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("abc")); + ::rtl::OString aIn("abc"); ::rtl::OString aOut; aOut = ::comphelper::string::strip(aIn, 'b'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("abc"))); + CPPUNIT_ASSERT(aOut == "abc"); aOut = ::comphelper::string::strip(aIn, 'c'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("ab"))); + CPPUNIT_ASSERT(aOut == "ab"); - aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aaa")); + aIn = "aaa"; aOut = ::comphelper::string::strip(aIn, 'a'); CPPUNIT_ASSERT(aOut.isEmpty()); - aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aba")); + aIn = "aba"; aOut = ::comphelper::string::strip(aIn, 'a'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("b"))); + CPPUNIT_ASSERT(aOut == "b"); } void TestString::testToken() { - ::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("10.11.12")); + ::rtl::OString aIn("10.11.12"); ::rtl::OString aOut; aOut = ::comphelper::string::getToken(aIn, -1, '.'); CPPUNIT_ASSERT(aOut.isEmpty()); aOut = ::comphelper::string::getToken(aIn, 0, '.'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("10"))); + CPPUNIT_ASSERT(aOut == "10"); aOut = ::comphelper::string::getToken(aIn, 1, '.'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("11"))); + CPPUNIT_ASSERT(aOut == "11"); aOut = ::comphelper::string::getToken(aIn, 2, '.'); - CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("12"))); + CPPUNIT_ASSERT(aOut == "12"); aOut = ::comphelper::string::getToken(aIn, 3, '.'); CPPUNIT_ASSERT(aOut.isEmpty()); @@ -375,7 +375,7 @@ void TestString::testToken() void TestString::testTokenCount() { - ::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("10.11.12")); + ::rtl::OString aIn("10.11.12"); sal_Int32 nOut; nOut = ::comphelper::string::getTokenCount(aIn, '.'); diff --git a/comphelper/source/compare/AnyCompareFactory.cxx b/comphelper/source/compare/AnyCompareFactory.cxx index 69ce7d19ec84..f9653e5d6008 100644 --- a/comphelper/source/compare/AnyCompareFactory.cxx +++ b/comphelper/source/compare/AnyCompareFactory.cxx @@ -139,12 +139,12 @@ OUString SAL_CALL AnyCompareFactory::getImplementationName( ) throw( RuntimeExc OUString SAL_CALL AnyCompareFactory::getImplementationName_static( ) { - return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AnyCompareFactory" ) ); + return OUString( "AnyCompareFactory" ); } sal_Bool SAL_CALL AnyCompareFactory::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.AnyCompareFactory" ) ); + OUString aServiceName( "com.sun.star.ucb.AnyCompareFactory" ); return aServiceName == ServiceName; } @@ -155,8 +155,8 @@ Sequence< OUString > SAL_CALL AnyCompareFactory::getSupportedServiceNames( ) th Sequence< OUString > SAL_CALL AnyCompareFactory::getSupportedServiceNames_static( ) { - const rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.AnyCompareFactory" ) ); - const Sequence< rtl::OUString > aSeq( &aServiceName, 1 ); + const OUString aServiceName( "com.sun.star.ucb.AnyCompareFactory" ); + const Sequence< OUString > aSeq( &aServiceName, 1 ); return aSeq; } diff --git a/comphelper/source/container/IndexedPropertyValuesContainer.cxx b/comphelper/source/container/IndexedPropertyValuesContainer.cxx index 5e6ffe03c449..6e2062598f7f 100644 --- a/comphelper/source/container/IndexedPropertyValuesContainer.cxx +++ b/comphelper/source/container/IndexedPropertyValuesContainer.cxx @@ -219,14 +219,14 @@ sal_Bool SAL_CALL IndexedPropertyValuesContainer::hasElements( ) return getImplementationName_static(); } -::rtl::OUString SAL_CALL IndexedPropertyValuesContainer::getImplementationName_static( ) +OUString SAL_CALL IndexedPropertyValuesContainer::getImplementationName_static( ) { - return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IndexedPropertyValuesContainer" ) ); + return OUString( "IndexedPropertyValuesContainer" ); } sal_Bool SAL_CALL IndexedPropertyValuesContainer::supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException) { - rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.IndexedPropertyValues" ) ); + OUString aServiceName( "com.sun.star.document.IndexedPropertyValues" ); return aServiceName == ServiceName; } @@ -238,8 +238,8 @@ sal_Bool SAL_CALL IndexedPropertyValuesContainer::supportsService( const ::rtl:: ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL IndexedPropertyValuesContainer::getSupportedServiceNames_static( ) { - const rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.IndexedPropertyValues" ) ); - const uno::Sequence< rtl::OUString > aSeq( &aServiceName, 1 ); + const OUString aServiceName( "com.sun.star.document.IndexedPropertyValues" ); + const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); return aSeq; } diff --git a/comphelper/source/container/NamedPropertyValuesContainer.cxx b/comphelper/source/container/NamedPropertyValuesContainer.cxx index 6ad6a47d806b..83c1a395cfa6 100644 --- a/comphelper/source/container/NamedPropertyValuesContainer.cxx +++ b/comphelper/source/container/NamedPropertyValuesContainer.cxx @@ -192,14 +192,14 @@ sal_Bool SAL_CALL NamedPropertyValuesContainer::hasElements( ) return getImplementationName_static(); } -::rtl::OUString SAL_CALL NamedPropertyValuesContainer::getImplementationName_static( ) +OUString SAL_CALL NamedPropertyValuesContainer::getImplementationName_static( ) { - return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NamedPropertyValuesContainer" ) ); + return OUString( "NamedPropertyValuesContainer" ); } -sal_Bool SAL_CALL NamedPropertyValuesContainer::supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException) +sal_Bool SAL_CALL NamedPropertyValuesContainer::supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException) { - rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.NamedPropertyValues" ) ); + OUString aServiceName( "com.sun.star.document.NamedPropertyValues" ); return aServiceName == ServiceName; } @@ -211,8 +211,8 @@ sal_Bool SAL_CALL NamedPropertyValuesContainer::supportsService( const ::rtl::OU ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL NamedPropertyValuesContainer::getSupportedServiceNames_static( ) { - const rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.NamedPropertyValues" ) ); - const uno::Sequence< rtl::OUString > aSeq( &aServiceName, 1 ); + const OUString aServiceName( "com.sun.star.document.NamedPropertyValues" ); + const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); return aSeq; } diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index f4b8b99fdb56..60a4126a377e 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -98,12 +98,12 @@ const uno::Reference < embed::XStorage >& EmbedImpl::GetReplacements() try { mxImageStorage = mxStorage->openStorageElement( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ObjectReplacements")), embed::ElementModes::READWRITE ); + OUString("ObjectReplacements"), embed::ElementModes::READWRITE ); } catch (const uno::Exception&) { mxImageStorage = mxStorage->openStorageElement( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ObjectReplacements")), embed::ElementModes::READ ); + OUString("ObjectReplacements"), embed::ElementModes::READ ); } } @@ -161,7 +161,7 @@ sal_Bool EmbeddedObjectContainer::CommitImageSubStorage() { // get the open mode from the parent storage sal_Int32 nMode = 0; - uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OpenMode")) ); + uno::Any aAny = xSet->getPropertyValue( OUString("OpenMode") ); if ( aAny >>= nMode ) bReadOnlyMode = !(nMode & embed::ElementModes::WRITE ); } // if ( xSet.is() ) @@ -230,15 +230,15 @@ void EmbeddedObjectContainer::CloseEmbeddedObjects() } } -::rtl::OUString EmbeddedObjectContainer::CreateUniqueObjectName() +OUString EmbeddedObjectContainer::CreateUniqueObjectName() { - ::rtl::OUString aPersistName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Object ") ); - ::rtl::OUString aStr; + OUString aPersistName("Object "); + OUString aStr; sal_Int32 i=1; do { aStr = aPersistName; - aStr += ::rtl::OUString::valueOf( i++ ); + aStr += OUString::valueOf( i++ ); } while( HasEmbeddedObject( aStr ) ); // TODO/LATER: should we consider deleted objects? @@ -353,7 +353,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::Get_Impl( con { // get the open mode from the parent storage sal_Int32 nMode = 0; - uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OpenMode")) ); + uno::Any aAny = xSet->getPropertyValue( OUString("OpenMode") ); if ( aAny >>= nMode ) bReadOnlyMode = !(nMode & embed::ElementModes::WRITE ); } @@ -362,16 +362,16 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::Get_Impl( con //TODO/LATER: it would be good to detect an error when an object should be created already, but isn't (not an "inside" call) uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() ); uno::Sequence< beans::PropertyValue > aObjDescr( xCopy.is() ? 2 : 1 ); - aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) ); + aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); if ( xCopy.is() ) { - aObjDescr[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CloneFrom" ) ); + aObjDescr[1].Name = "CloneFrom"; aObjDescr[1].Value <<= xCopy; } uno::Sequence< beans::PropertyValue > aMediaDescr( 1 ); - aMediaDescr[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); + aMediaDescr[0].Name = "ReadOnly"; aMediaDescr[0].Value <<= bReadOnlyMode; xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitFromEntry( pImpl->mxStorage, rName, @@ -404,7 +404,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbedde uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() ); uno::Sequence< beans::PropertyValue > aObjDescr( rArgs.getLength() + 1 ); - aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) ); + aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); ::std::copy( rArgs.getConstArray(), rArgs.getConstArray() + rArgs.getLength(), aObjDescr.getArray() + 1 ); xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew( @@ -582,9 +582,8 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde // it is correct so for now, but what if somebody introduces a new stream based embedded object? // Probably introducing of such an object must be restricted ( a storage must be used! ). uno::Reference< beans::XPropertySet > xProps( xNewStream, uno::UNO_QUERY_THROW ); - xProps->setPropertyValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ), - uno::makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/vnd.sun.star.oleobject" ) ) ) ); + xProps->setPropertyValue( OUString( "MediaType" ), + uno::makeAny( OUString( "application/vnd.sun.star.oleobject" ) ) ); } catch (const uno::Exception&) { @@ -620,7 +619,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde { uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() ); uno::Sequence< beans::PropertyValue > aObjDescr( 1 ); - aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) ); + aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitFromMediaDescriptor( pImpl->mxStorage, rNewName, aMedium, aObjDescr ), uno::UNO_QUERY ); @@ -654,7 +653,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde { uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create(::comphelper::getProcessComponentContext()); uno::Sequence< beans::PropertyValue > aObjDescr( 1 ); - aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) ); + aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceLink( pImpl->mxStorage, rNewName, aMedium, aObjDescr ), uno::UNO_QUERY ); @@ -740,10 +739,10 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() ); uno::Sequence< beans::PropertyValue > aMediaDescr( 1 ); - aMediaDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ); + aMediaDescr[0].Name = "URL"; aMediaDescr[0].Value <<= aURL; uno::Sequence< beans::PropertyValue > aObjDescr( 1 ); - aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) ); + aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); xResult = uno::Reference < embed::XEmbeddedObject >( xCreator->createInstanceLink( @@ -767,7 +766,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() ); uno::Sequence< beans::PropertyValue > aObjDescr( 1 ); - aObjDescr[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent" ) ); + aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); xResult = uno::Reference < embed::XEmbeddedObject >( xCreator->createInstanceInitNew( @@ -1022,7 +1021,7 @@ sal_Bool EmbeddedObjectContainer::RemoveEmbeddedObject( const uno::Reference < e pImpl->mxTempStorage = ::comphelper::OStorageHelper::GetTemporaryStorage(); uno::Sequence < beans::PropertyValue > aSeq; - ::rtl::OUString aTmpPersistName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Object ") ); + ::rtl::OUString aTmpPersistName = ::rtl::OUString( "Object " ); aTmpPersistName += ::rtl::OUString::valueOf( (sal_Int32) pImpl->maTempObjectContainer.size() ); xPersist->storeAsEntry( pImpl->mxTempStorage, aTmpPersistName, aSeq, aSeq ); @@ -1040,7 +1039,7 @@ sal_Bool EmbeddedObjectContainer::RemoveEmbeddedObject( const uno::Reference < e // the media type will be provided with object insertion ::rtl::OUString aOrigStorMediaType; uno::Reference< beans::XPropertySet > xStorProps( pImpl->mxStorage, uno::UNO_QUERY_THROW ); - static const ::rtl::OUString s_sMediaType(RTL_CONSTASCII_USTRINGPARAM("MediaType")); + static const OUString s_sMediaType("MediaType"); xStorProps->getPropertyValue( s_sMediaType ) >>= aOrigStorMediaType; OSL_ENSURE( !aOrigStorMediaType.isEmpty(), "No valuable media type in the storage!\n" ); @@ -1176,7 +1175,7 @@ uno::Reference < io::XInputStream > EmbeddedObjectContainer::GetGraphicStream( c uno::Reference < beans::XPropertySet > xSet( xStream, uno::UNO_QUERY ); if ( xSet.is() ) { - uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ); + uno::Any aAny = xSet->getPropertyValue( OUString("MediaType") ); aAny >>= *pMediaType; } } @@ -1231,13 +1230,13 @@ sal_Bool EmbeddedObjectContainer::InsertGraphicStream( const com::sun::star::uno if ( !xPropSet.is() ) throw uno::RuntimeException(); - xPropSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption")), + xPropSet->setPropertyValue( OUString("UseCommonStoragePasswordEncryption"), uno::makeAny( (sal_Bool)sal_True ) ); uno::Any aAny; aAny <<= rMediaType; - xPropSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aAny ); + xPropSet->setPropertyValue( OUString("MediaType"), aAny ); - xPropSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed")), + xPropSet->setPropertyValue( OUString("Compressed"), uno::makeAny( (sal_Bool)sal_True ) ); } catch (const uno::Exception&) @@ -1259,11 +1258,11 @@ sal_Bool EmbeddedObjectContainer::InsertGraphicStreamDirectly( const com::sun::s // store it into the subfolder uno::Sequence< beans::PropertyValue > aProps( 3 ); - aProps[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); + aProps[0].Name = "MediaType"; aProps[0].Value <<= rMediaType; - aProps[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" ) ); + aProps[1].Name = "UseCommonStoragePasswordEncryption"; aProps[1].Value <<= (sal_Bool)sal_True; - aProps[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Compressed" ) ); + aProps[2].Name = "Compressed"; aProps[2].Value <<= (sal_Bool)sal_True; if ( xReplacement->hasByName( rObjectName ) ) @@ -1306,7 +1305,7 @@ namespace { try { uno::Reference< embed::XStorage > xPictures = xDocStor->openStorageElement( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Pictures" ) ), + OUString( "Pictures" ), embed::ElementModes::READWRITE ); uno::Reference< io::XStream > xObjReplStr = xPictures->openStreamElement( aStreamName, @@ -1394,16 +1393,16 @@ sal_Bool EmbeddedObjectContainer::StoreAsChildren(sal_Bool _bOasisFormat,sal_Boo if ( xPersist.is() ) { uno::Sequence< beans::PropertyValue > aArgs( _bOasisFormat ? 2 : 3 ); - aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StoreVisualReplacement" ) ); + aArgs[0].Name = "StoreVisualReplacement"; aArgs[0].Value <<= (sal_Bool)( !_bOasisFormat ); // if it is an embedded object or the optimized inserting fails the normal inserting should be done - aArgs[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CanTryOptimization" ) ); + aArgs[1].Name = "CanTryOptimization"; aArgs[1].Value <<= !_bCreateEmbedded; if ( !_bOasisFormat ) { // if object has no cached replacement it will use this one - aArgs[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VisualReplacement" ) ); + aArgs[2].Name = "VisualReplacement"; aArgs[2].Value <<= xStream; } @@ -1434,7 +1433,7 @@ sal_Bool EmbeddedObjectContainer::StoreAsChildren(sal_Bool _bOasisFormat,sal_Boo try { // the substorage still can not be locked by the embedded object conteiner - ::rtl::OUString aObjReplElement( RTL_CONSTASCII_USTRINGPARAM( "ObjectReplacements" ) ); + OUString aObjReplElement( "ObjectReplacements" ); if ( _xStorage->hasByName( aObjReplElement ) && _xStorage->isStorageElement( aObjReplElement ) ) _xStorage->removeElement( aObjReplElement ); } @@ -1532,7 +1531,7 @@ sal_Bool EmbeddedObjectContainer::StoreChildren(sal_Bool _bOasisFormat,sal_Bool try { ReleaseImageSubStorage(); - ::rtl::OUString aObjReplElement( RTL_CONSTASCII_USTRINGPARAM( "ObjectReplacements" ) ); + OUString aObjReplElement( "ObjectReplacements" ); if ( !_bOasisFormat && pImpl->mxStorage->hasByName( aObjReplElement ) && pImpl->mxStorage->isStorageElement( aObjReplElement ) ) pImpl->mxStorage->removeElement( aObjReplElement ); } diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx index 058310e4cd09..c4800e8746e8 100644 --- a/comphelper/source/container/enumerablemap.cxx +++ b/comphelper/source/container/enumerablemap.cxx @@ -374,27 +374,27 @@ namespace comphelper Type aKeyType, aValueType; if ( !( _arguments[0] >>= aKeyType ) ) - throw IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.Type expected.")), *this, 1 ); + throw IllegalArgumentException( OUString("com.sun.star.uno.Type expected."), *this, 1 ); if ( !( _arguments[1] >>= aValueType ) ) - throw IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.Type expected.")), *this, 2 ); + throw IllegalArgumentException( OUString("com.sun.star.uno.Type expected."), *this, 2 ); Sequence< Pair< Any, Any > > aInitialValues; bool bMutable = true; if ( nArgumentCount == 3 ) { if ( !( _arguments[2] >>= aInitialValues ) ) - throw IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]com.sun.star.beans.Pair<any,any> expected.")), *this, 2 ); + throw IllegalArgumentException( OUString("[]com.sun.star.beans.Pair<any,any> expected."), *this, 2 ); bMutable = false; } // for the value, anything is allowed, except VOID if ( ( aValueType.getTypeClass() == TypeClass_VOID ) || ( aValueType.getTypeClass() == TypeClass_UNKNOWN ) ) - throw IllegalTypeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported value type." ) ), *this ); + throw IllegalTypeException( OUString( "Unsupported value type." ), *this ); // create the comparator for the KeyType, and throw if the type is not supported ::std::auto_ptr< IKeyPredicateLess > pComparator( getStandardLessPredicate( aKeyType, NULL ) ); if ( !pComparator.get() ) - throw IllegalTypeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), *this ); + throw IllegalTypeException( OUString( "Unsupported key type." ), *this ); // init members m_aData.m_aKeyType = aKeyType; @@ -516,7 +516,7 @@ namespace comphelper if ( _keyOrValue >>= nValue ) if ( ::rtl::math::isNan( nValue ) ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NaN (not-a-number) not supported by this implementation." ) ), + OUString( "NaN (not-a-number) not supported by this implementation." ), *const_cast< EnumerableMap* >( this ), 0 ); // (note that the case of _key not containing a float/double value is handled in the // respective IKeyPredicateLess implementation, so there's no need to handle this here.) @@ -528,7 +528,7 @@ namespace comphelper { if ( !_key.hasValue() ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NULL keys not supported by this implementation." ) ), + OUString( "NULL keys not supported by this implementation." ), *const_cast< EnumerableMap* >( this ), 0 ); impl_checkNaN_throw( _key, m_aData.m_aKeyType ); @@ -539,7 +539,7 @@ namespace comphelper { if ( !m_aData.m_bMutable ) throw NoSupportException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The map is immutable." ) ), + OUString( "The map is immutable." ), *const_cast< EnumerableMap* >( this ) ); } @@ -712,16 +712,16 @@ namespace comphelper } //-------------------------------------------------------------------- - ::rtl::OUString SAL_CALL EnumerableMap::getImplementationName_static( ) + OUString SAL_CALL EnumerableMap::getImplementationName_static( ) { - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.comphelper.EnumerableMap" ) ); + return OUString( "org.openoffice.comp.comphelper.EnumerableMap" ); } //-------------------------------------------------------------------- - Sequence< ::rtl::OUString > SAL_CALL EnumerableMap::getSupportedServiceNames_static( ) + Sequence< OUString > SAL_CALL EnumerableMap::getSupportedServiceNames_static( ) { - Sequence< ::rtl::OUString > aServiceNames(1); - aServiceNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.container.EnumerableMap" ) ); + Sequence< OUString > aServiceNames(1); + aServiceNames[0] = "com.sun.star.container.EnumerableMap"; return aServiceNames; } @@ -746,9 +746,9 @@ namespace comphelper Any MapEnumerator::nextElement() { if ( m_disposed ) - throw DisposedException( ::rtl::OUString(), m_rParent ); + throw DisposedException( OUString(), m_rParent ); if ( m_mapPos == m_rMapData.m_pValues->end() ) - throw NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No more elements." ) ), m_rParent ); + throw NoSuchElementException( OUString( "No more elements." ), m_rParent ); Any aNextElement; switch ( m_eType ) diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx index 32ab38973407..0fea4be3a072 100644 --- a/comphelper/source/eventattachermgr/eventattachermgr.cxx +++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx @@ -370,7 +370,7 @@ ImplEventAttacherManager::ImplEventAttacherManager( const Reference< XIntrospect if ( xContext.is() ) { Reference< XInterface > xIFace( xContext->getServiceManager()->createInstanceWithContext( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.EventAttacher" )), xContext) ); + OUString( "com.sun.star.script.EventAttacher" ), xContext) ); if ( xIFace.is() ) { xAttacher = Reference< XEventAttacher2 >::query( xIFace ); @@ -752,7 +752,7 @@ void SAL_CALL ImplEventAttacherManager::removeScriptListener(const Reference< XS OUString SAL_CALL ImplEventAttacherManager::getServiceName(void) throw( RuntimeException ) { - return OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.script.EventAttacherManager") ); + return OUString( "com.sun.star.uno.script.EventAttacherManager" ); } void SAL_CALL ImplEventAttacherManager::write(const Reference< XObjectOutputStream >& OutStream) diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx index 5bf52017d6ae..bd7373353c2c 100644 --- a/comphelper/source/misc/mediadescriptor.cxx +++ b/comphelper/source/misc/mediadescriptor.cxx @@ -152,147 +152,147 @@ const ::rtl::OUString& MediaDescriptor::PROP_MEDIATYPE() return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_MINIMIZED() +const OUString& MediaDescriptor::PROP_MINIMIZED() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Minimized")); + static const OUString sProp("Minimized"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_NOAUTOSAVE() +const OUString& MediaDescriptor::PROP_NOAUTOSAVE() { - static const ::rtl::OUString sProp("NoAutoSave"); + static const OUString sProp("NoAutoSave"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_OPENNEWVIEW() +const OUString& MediaDescriptor::PROP_OPENNEWVIEW() { - static const ::rtl::OUString sProp("OpenNewView"); + static const OUString sProp("OpenNewView"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_OUTPUTSTREAM() +const OUString& MediaDescriptor::PROP_OUTPUTSTREAM() { - static const ::rtl::OUString sProp("OutputStream"); + static const OUString sProp("OutputStream"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_POSTDATA() +const OUString& MediaDescriptor::PROP_POSTDATA() { - static const ::rtl::OUString sProp("PostData"); + static const OUString sProp("PostData"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_PREVIEW() +const OUString& MediaDescriptor::PROP_PREVIEW() { - static const ::rtl::OUString sProp("Preview"); + static const OUString sProp("Preview"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_READONLY() +const OUString& MediaDescriptor::PROP_READONLY() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); + static const OUString sProp("ReadOnly"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_REFERRER() +const OUString& MediaDescriptor::PROP_REFERRER() { - static const ::rtl::OUString sProp("Referer"); + static const OUString sProp("Referer"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_STATUSINDICATOR() +const OUString& MediaDescriptor::PROP_STATUSINDICATOR() { - static const ::rtl::OUString sProp("StatusIndicator"); + static const OUString sProp("StatusIndicator"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_STREAM() +const OUString& MediaDescriptor::PROP_STREAM() { - static const ::rtl::OUString sProp("Stream"); + static const OUString sProp("Stream"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_STREAMFOROUTPUT() +const OUString& MediaDescriptor::PROP_STREAMFOROUTPUT() { - static const ::rtl::OUString sProp("StreamForOutput"); + static const OUString sProp("StreamForOutput"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_TEMPLATENAME() +const OUString& MediaDescriptor::PROP_TEMPLATENAME() { - static const ::rtl::OUString sProp("TemplateName"); + static const OUString sProp("TemplateName"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_TYPENAME() +const OUString& MediaDescriptor::PROP_TYPENAME() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("TypeName")); + static const OUString sProp("TypeName"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_UCBCONTENT() +const OUString& MediaDescriptor::PROP_UCBCONTENT() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("UCBContent")); + static const OUString sProp("UCBContent"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_UPDATEDOCMODE() +const OUString& MediaDescriptor::PROP_UPDATEDOCMODE() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("UpdateDocMode")); + static const OUString sProp("UpdateDocMode"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_URL() +const OUString& MediaDescriptor::PROP_URL() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("URL")); + static const OUString sProp("URL"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_VERSION() +const OUString& MediaDescriptor::PROP_VERSION() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Version")); + static const OUString sProp("Version"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_DOCUMENTTITLE() +const OUString& MediaDescriptor::PROP_DOCUMENTTITLE() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")); + static const OUString sProp("DocumentTitle"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_MODEL() +const OUString& MediaDescriptor::PROP_MODEL() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Model")); + static const OUString sProp("Model"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_PASSWORD() +const OUString& MediaDescriptor::PROP_PASSWORD() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Password")); + static const OUString sProp("Password"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_TITLE() +const OUString& MediaDescriptor::PROP_TITLE() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Title")); + static const OUString sProp("Title"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_SALVAGEDFILE() +const OUString& MediaDescriptor::PROP_SALVAGEDFILE() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("SalvagedFile")); + static const OUString sProp("SalvagedFile"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_VIEWONLY() +const OUString& MediaDescriptor::PROP_VIEWONLY() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("ViewOnly")); + static const OUString sProp("ViewOnly"); return sProp; } -const ::rtl::OUString& MediaDescriptor::PROP_DOCUMENTBASEURL() +const OUString& MediaDescriptor::PROP_DOCUMENTBASEURL() { - static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("DocumentBaseURL")); + static const OUString sProp("DocumentBaseURL"); return sProp; } @@ -308,9 +308,9 @@ MediaDescriptor::MediaDescriptor(const css::uno::Sequence< css::beans::PropertyV sal_Bool MediaDescriptor::isStreamReadOnly() const { - static ::rtl::OUString CONTENTSCHEME_FILE( RTL_CONSTASCII_USTRINGPARAM( "file" )); - static ::rtl::OUString CONTENTPROP_ISREADONLY( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" )); - static sal_Bool READONLY_FALLBACK = sal_False; + static OUString CONTENTSCHEME_FILE( "file" ); + static OUString CONTENTPROP_ISREADONLY( "IsReadOnly" ); + static sal_Bool READONLY_FALLBACK = sal_False; sal_Bool bReadOnly = READONLY_FALLBACK; @@ -460,8 +460,7 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool bLockFile ) // b) ... or we must get it from the given URL ::rtl::OUString sURL = getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), ::rtl::OUString()); if (sURL.isEmpty()) - throw css::uno::Exception( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Found no URL." )), + throw css::uno::Exception( OUString( "Found no URL." ), css::uno::Reference< css::uno::XInterface >()); // Parse URL! Only the main part has to be used further. E.g. a jumpmark can make trouble @@ -488,8 +487,7 @@ sal_Bool MediaDescriptor::impl_openStreamWithPostData( const css::uno::Reference throw(::com::sun::star::uno::RuntimeException) { if ( !_rxPostData.is() ) - throw css::lang::IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Found invalid PostData." )), + throw css::lang::IllegalArgumentException( OUString( "Found invalid PostData." ), css::uno::Reference< css::uno::XInterface >(), 1); // PostData can't be used in read/write mode! @@ -507,12 +505,12 @@ sal_Bool MediaDescriptor::impl_openStreamWithPostData( const css::uno::Reference ::rtl::OUString sMediaType = getUnpackedValueOrDefault(MediaDescriptor::PROP_MEDIATYPE(), ::rtl::OUString()); if (sMediaType.isEmpty()) { - sMediaType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-www-form-urlencoded" )); + sMediaType = "application/x-www-form-urlencoded"; (*this)[MediaDescriptor::PROP_MEDIATYPE()] <<= sMediaType; } // url - ::rtl::OUString sURL( getUnpackedValueOrDefault( PROP_URL(), ::rtl::OUString() ) ); + OUString sURL( getUnpackedValueOrDefault( PROP_URL(), OUString() ) ); css::uno::Reference< css::io::XInputStream > xResultStream; try @@ -533,7 +531,7 @@ sal_Bool MediaDescriptor::impl_openStreamWithPostData( const css::uno::Reference aPostArgument.MediaType = sMediaType; aPostArgument.Referer = getUnpackedValueOrDefault( PROP_REFERRER(), ::rtl::OUString() ); - ::rtl::OUString sCommandName( RTL_CONSTASCII_USTRINGPARAM( "post" ) ); + OUString sCommandName( "post" ); aContent.executeCommand( sCommandName, css::uno::makeAny( aPostArgument ) ); // get result @@ -555,7 +553,7 @@ sal_Bool MediaDescriptor::impl_openStreamWithPostData( const css::uno::Reference } /*-----------------------------------------------*/ -sal_Bool MediaDescriptor::impl_openStreamWithURL( const ::rtl::OUString& sURL, sal_Bool bLockFile ) +sal_Bool MediaDescriptor::impl_openStreamWithURL( const OUString& sURL, sal_Bool bLockFile ) throw(::com::sun::star::uno::RuntimeException) { // prepare the environment @@ -631,7 +629,7 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const ::rtl::OUString& sURL, s // or failed by an error - we must try it in readonly mode. if (!xInputStream.is()) { - rtl::OUString aScheme; + OUString aScheme; try { @@ -644,12 +642,12 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const ::rtl::OUString& sURL, s // Only file system content provider is able to provide XStream // so for this content impossibility to create XStream triggers // switch to readonly mode in case of opening with locking on - if( bLockFile && aScheme.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("file")) ) + if( bLockFile && aScheme.equalsIgnoreAsciiCase("file") ) bReadOnly = sal_True; else { sal_Bool bRequestReadOnly = bReadOnly; - aContent.getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ) ) >>= bReadOnly; + aContent.getPropertyValue( OUString( "IsReadOnly" ) ) >>= bReadOnly; if ( bReadOnly && !bRequestReadOnly && bModeRequestedExplicitly ) return sal_False; // the document is explicitly requested with WRITEABLE mode } @@ -667,7 +665,7 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const ::rtl::OUString& sURL, s try { // all the contents except file-URLs should be opened as usual - if ( bLockFile || !aScheme.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("file")) ) + if ( bLockFile || !aScheme.equalsIgnoreAsciiCase("file") ) xInputStream = aContent.openStream(); else xInputStream = aContent.openStreamNoLock(); diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx index 61c667e81cf0..c483c1ea4654 100644 --- a/comphelper/source/misc/mimeconfighelper.cxx +++ b/comphelper/source/misc/mimeconfighelper.cxx @@ -44,14 +44,14 @@ MimeConfigurationHelper::MimeConfigurationHelper( const uno::Reference< uno::XCo //----------------------------------------------------------------------- ::rtl::OUString MimeConfigurationHelper::GetStringClassIDRepresentation( const uno::Sequence< sal_Int8 >& aClassID ) { - ::rtl::OUString aResult; + OUString aResult; if ( aClassID.getLength() == 16 ) { for ( sal_Int32 nInd = 0; nInd < aClassID.getLength(); nInd++ ) { if ( nInd == 4 || nInd == 6 || nInd == 8 || nInd == 10 ) - aResult += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "-" )); + aResult += "-"; sal_Int32 nDigit1 = (sal_Int32)( (sal_uInt8)aClassID[nInd] / 16 ); sal_Int32 nDigit2 = (sal_uInt8)aClassID[nInd] % 16; @@ -126,13 +126,13 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetConfigurati uno::Sequence< uno::Any > aArgs( 1 ); beans::PropertyValue aPathProp; - aPathProp.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" )); + aPathProp.Name = "nodepath"; aPathProp.Value <<= aPath; aArgs[0] <<= aPathProp; xConfig = uno::Reference< container::XNameAccess >( m_xConfigProvider->createInstanceWithArguments( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" )), + OUString( "com.sun.star.configuration.ConfigurationAccess" ), aArgs ), uno::UNO_QUERY ); } @@ -149,7 +149,7 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetObjConfigur if ( !m_xObjectConfig.is() ) m_xObjectConfig = GetConfigurationByPath( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Embedding/Objects" )) ); + OUString( "/org.openoffice.Office.Embedding/Objects" ) ); return m_xObjectConfig; } @@ -161,7 +161,7 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetVerbsConfig if ( !m_xVerbsConfig.is() ) m_xVerbsConfig = GetConfigurationByPath( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Embedding/Verbs" )) ); + OUString( "/org.openoffice.Office.Embedding/Verbs" )); return m_xVerbsConfig; } @@ -173,7 +173,7 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetMediaTypeCo if ( !m_xMediaTypeConfig.is() ) m_xMediaTypeConfig = GetConfigurationByPath( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Embedding/MimeTypeClassIDRelations" )) ); + ::rtl::OUString( "/org.openoffice.Office.Embedding/MimeTypeClassIDRelations" )); return m_xMediaTypeConfig; } @@ -230,7 +230,7 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetFilterFacto { // make query for all types matching the properties uno::Sequence < beans::NamedValue > aSeq( 1 ); - aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" )); + aSeq[0].Name = "MediaType"; aSeq[0].Value <<= aMediaType; uno::Reference < container::XEnumeration > xEnum = xTypeCFG->createSubSetEnumerationByProperties( aSeq ); @@ -241,11 +241,11 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetFilterFacto { for ( sal_Int32 nInd = 0; nInd < aType.getLength(); nInd++ ) { - ::rtl::OUString aFilterName; - if ( aType[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PreferredFilter" ) ) + OUString aFilterName; + if ( aType[nInd].Name == "PreferredFilter" && ( aType[nInd].Value >>= aFilterName ) && !aFilterName.isEmpty() ) { - ::rtl::OUString aDocumentName = GetDocServiceNameFromFilter( aFilterName ); + OUString aDocumentName = GetDocServiceNameFromFilter( aFilterName ); if ( !aDocumentName.isEmpty() ) return aDocumentName; } @@ -273,12 +273,12 @@ sal_Bool MimeConfigurationHelper::GetVerbByShortcut( const ::rtl::OUString& aVer if ( xVerbsConfig.is() && ( xVerbsConfig->getByName( aVerbShortcut ) >>= xVerbsProps ) && xVerbsProps.is() ) { embed::VerbDescriptor aTempDescr; - if ( ( xVerbsProps->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VerbID" )) ) >>= aTempDescr.VerbID ) - && ( xVerbsProps->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VerbUIName" )) ) >>= aTempDescr.VerbName ) - && ( xVerbsProps->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VerbFlags" )) ) >>= aTempDescr.VerbFlags ) - && ( xVerbsProps->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VerbAttributes" )) ) >>= aTempDescr.VerbAttributes ) ) + if ( ( xVerbsProps->getByName( OUString( "VerbID" ) ) >>= aTempDescr.VerbID ) + && ( xVerbsProps->getByName( OUString( "VerbUIName" ) ) >>= aTempDescr.VerbName ) + && ( xVerbsProps->getByName( OUString( "VerbFlags" ) ) >>= aTempDescr.VerbFlags ) + && ( xVerbsProps->getByName( OUString( "VerbAttributes" ) ) >>= aTempDescr.VerbAttributes ) ) { - aDescriptor = aTempDescr; + aDescriptor = aTempDescr; bResult = sal_True; } } @@ -304,7 +304,7 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjPropsFromConfi uno::Sequence< ::rtl::OUString > aObjPropNames = xObjectProps->getElementNames(); aResult.realloc( aObjPropNames.getLength() + 1 ); - aResult[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ClassID" )); + aResult[0].Name = "ClassID"; aResult[0].Value <<= aClassID; for ( sal_Int32 nInd = 0; nInd < aObjPropNames.getLength(); nInd++ ) @@ -368,9 +368,9 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByStri if ( ClassIDsEqual( aClassID, GetSequenceClassID( SO3_DUMMY_CLASSID ) ) ) { aObjProps.realloc(2); - aObjProps[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ObjectFactory" )); - aObjProps[0].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OOoSpecialEmbeddedObjectFactory" )); - aObjProps[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ClassID" )); + aObjProps[0].Name = "ObjectFactory"; + aObjProps[0].Value <<= OUString( "com.sun.star.embed.OOoSpecialEmbeddedObjectFactory" ); + aObjProps[1].Name = "ClassID"; aObjProps[1].Value <<= aClassID; return aObjProps; } @@ -401,9 +401,9 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByClas if ( ClassIDsEqual( aClassID, GetSequenceClassID( SO3_DUMMY_CLASSID ) ) ) { aObjProps.realloc(2); - aObjProps[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ObjectFactory" )); - aObjProps[0].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OOoSpecialEmbeddedObjectFactory" )); - aObjProps[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ClassID" )); + aObjProps[0].Name = "ObjectFactory"; + aObjProps[0].Value <<= ::rtl::OUString( "com.sun.star.embed.OOoSpecialEmbeddedObjectFactory" ); + aObjProps[1].Name = "ClassID"; aObjProps[1].Value <<= aClassID; } @@ -451,7 +451,7 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByFilt } //----------------------------------------------------------------------- -uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocumentName( const ::rtl::OUString& aDocName ) +uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocumentName( const OUString& aDocName ) { if ( !aDocName.isEmpty() ) { @@ -464,12 +464,11 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocu for ( sal_Int32 nInd = 0; nInd < aClassIDs.getLength(); nInd++ ) { uno::Reference< container::XNameAccess > xObjectProps; - ::rtl::OUString aEntryDocName; + OUString aEntryDocName; if ( ( xObjConfig->getByName( aClassIDs[nInd] ) >>= xObjectProps ) && xObjectProps.is() - && ( xObjectProps->getByName( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ObjectDocumentServiceName" )) ) >>= aEntryDocName ) - && aEntryDocName.equals( aDocName ) ) + && ( xObjectProps->getByName( OUString( "ObjectDocumentServiceName" ) ) >>= aEntryDocName ) + && aEntryDocName == aDocName ) { return GetObjPropsFromConfigEntry( GetSequenceClassIDRepresentation( aClassIDs[nInd] ), xObjectProps ); @@ -502,13 +501,13 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocu try { if ( xObjConfig.is() && ( xObjConfig->getByName( aStringClassID.toAsciiUpperCase() ) >>= xObjectProps ) && xObjectProps.is() ) - xObjectProps->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ObjectFactory" )) ) >>= aResult; + xObjectProps->getByName( ::rtl::OUString( "ObjectFactory" ) ) >>= aResult; } catch( uno::Exception& ) { uno::Sequence< sal_Int8 > aClassID = GetSequenceClassIDRepresentation( aStringClassID ); if ( ClassIDsEqual( aClassID, GetSequenceClassID( SO3_DUMMY_CLASSID ) ) ) - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OOoSpecialEmbeddedObjectFactory" )); + return ::rtl::OUString( "com.sun.star.embed.OOoSpecialEmbeddedObjectFactory" ); } } @@ -531,14 +530,14 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocu for ( sal_Int32 nInd = 0; nInd < aClassIDs.getLength(); nInd++ ) { uno::Reference< container::XNameAccess > xObjectProps; - ::rtl::OUString aEntryDocName; + OUString aEntryDocName; if ( ( xObjConfig->getByName( aClassIDs[nInd] ) >>= xObjectProps ) && xObjectProps.is() && ( xObjectProps->getByName( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ObjectDocumentServiceName" )) ) >>= aEntryDocName ) - && aEntryDocName.equals( aDocName ) ) + OUString( "ObjectDocumentServiceName" ) ) >>= aEntryDocName ) + && aEntryDocName == aDocName ) { - xObjectProps->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ObjectFactory" )) ) >>= aResult; + xObjectProps->getByName( OUString( "ObjectFactory" ) ) >>= aResult; break; } } @@ -604,7 +603,7 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocu { sal_Int32 nOldLen = aMediaDescr.getLength(); aMediaDescr.realloc( nOldLen + 1 ); - aMediaDescr[nOldLen].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" )); + aMediaDescr[nOldLen].Name = "FilterName"; aMediaDescr[ nOldLen ].Value <<= aFilterName; } @@ -617,11 +616,11 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocu { for ( sal_Int32 nInd = 0; nInd < aTypes.getLength(); nInd++ ) { - if ( aTypes[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PreferredFilter" ) ) && ( aTypes[nInd].Value >>= aFilterName ) ) + if ( aTypes[nInd].Name == "PreferredFilter" && ( aTypes[nInd].Value >>= aFilterName ) ) { sal_Int32 nOldLen = aMediaDescr.getLength(); aMediaDescr.realloc( nOldLen + 1 ); - aMediaDescr[nOldLen].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" )); + aMediaDescr[nOldLen].Name = "FilterName"; aMediaDescr[ nOldLen ].Value = aTypes[nInd].Value; break; } @@ -661,7 +660,7 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocu { sal_Int32 nOldLen = aMediaDescr.getLength(); aMediaDescr.realloc( nOldLen + 1 ); - aMediaDescr[nOldLen].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentService" )); + aMediaDescr[nOldLen].Name = "DocumentService"; aMediaDescr[nOldLen].Value <<= aDocName; } @@ -686,7 +685,7 @@ sal_Int32 MimeConfigurationHelper::GetFilterFlags( const ::rtl::OUString& aFilte if ( aFilterAny >>= aData ) { SequenceAsHashMap aFilterHM( aData ); - nFlags = aFilterHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Flags")), (sal_Int32)0 ); + nFlags = aFilterHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 ); } } } catch( uno::Exception& ) @@ -725,9 +724,9 @@ sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile( uno::UNO_QUERY_THROW ); uno::Sequence< beans::NamedValue > aSearchRequest( 2 ); - aSearchRequest[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentService" )); + aSearchRequest[0].Name = "DocumentService"; aSearchRequest[0].Value <<= aServiceName; - aSearchRequest[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FileFormatVersion" )); + aSearchRequest[1].Name = "FileFormatVersion"; aSearchRequest[1].Value <<= nVersion; uno::Sequence< beans::PropertyValue > aFilterProps; @@ -742,8 +741,7 @@ sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile( if ( xFilterEnum->nextElement() >>= aProps ) { SequenceAsHashMap aPropsHM( aProps ); - sal_Int32 nFlags = aPropsHM.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Flags" )), - (sal_Int32)0 ); + sal_Int32 nFlags = aPropsHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 ); // that should be import, export, own filter and not a template filter ( TemplatePath flag ) sal_Int32 nRequired = ( SFX_FILTER_OWN | SFX_FILTER_EXPORT | SFX_FILTER_IMPORT ); @@ -752,10 +750,9 @@ sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile( // if there are more than one filter the preffered one should be used // if there is no preffered filter the first one will be used if ( aResult.isEmpty() || ( nFlags & SFX_FILTER_PREFERED ) ) - aResult = aPropsHM.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" )), - ::rtl::OUString() ); + aResult = aPropsHM.getUnpackedValueOrDefault( "Name", OUString() ); if ( nFlags & SFX_FILTER_PREFERED ) - break; // the preffered filter was found + break; // the preferred filter was found } } } @@ -784,8 +781,7 @@ sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile( if ( aImpFilterAny >>= aImpData ) { SequenceAsHashMap aImpFilterHM( aImpData ); - sal_Int32 nFlags = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Flags")), - (sal_Int32)0 ); + sal_Int32 nFlags = aImpFilterHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 ); if ( !( nFlags & SFX_FILTER_IMPORT ) ) { @@ -799,16 +795,16 @@ sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile( } else { - ::rtl::OUString aDocumentServiceName = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentService")), ::rtl::OUString() ); - ::rtl::OUString aTypeName = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Type")), ::rtl::OUString() ); + OUString aDocumentServiceName = aImpFilterHM.getUnpackedValueOrDefault( "DocumentService", OUString() ); + OUString aTypeName = aImpFilterHM.getUnpackedValueOrDefault( "Type", OUString() ); OSL_ENSURE( !aDocumentServiceName.isEmpty() && !aTypeName.isEmpty(), "Incomplete filter data!" ); if ( !(aDocumentServiceName.isEmpty() || aTypeName.isEmpty()) ) { uno::Sequence< beans::NamedValue > aSearchRequest( 2 ); - aSearchRequest[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Type")); + aSearchRequest[0].Name = "Type"; aSearchRequest[0].Value <<= aTypeName; - aSearchRequest[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentService")); + aSearchRequest[1].Name = "DocumentService"; aSearchRequest[1].Value <<= aDocumentServiceName; uno::Sequence< beans::PropertyValue > aExportFilterProps = SearchForFilter( @@ -820,7 +816,7 @@ sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile( if ( aExportFilterProps.getLength() ) { SequenceAsHashMap aExpPropsHM( aExportFilterProps ); - aExportFilterName = aExpPropsHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), ::rtl::OUString() ); + aExportFilterName = aExpPropsHM.getUnpackedValueOrDefault( "Name", OUString() ); } } } @@ -855,7 +851,7 @@ uno::Sequence< beans::PropertyValue > MimeConfigurationHelper::SearchForFilter( if ( xFilterEnum->nextElement() >>= aProps ) { SequenceAsHashMap aPropsHM( aProps ); - sal_Int32 nFlags = aPropsHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Flags")), + sal_Int32 nFlags = aPropsHM.getUnpackedValueOrDefault( ::rtl::OUString("Flags"), (sal_Int32)0 ); if ( ( ( nFlags & nMustFlags ) == nMustFlags ) && !( nFlags & nDontFlags ) ) { diff --git a/comphelper/source/misc/numberedcollection.cxx b/comphelper/source/misc/numberedcollection.cxx index a23690ecfdd9..88839ad8cc65 100644 --- a/comphelper/source/misc/numberedcollection.cxx +++ b/comphelper/source/misc/numberedcollection.cxx @@ -109,7 +109,7 @@ void SAL_CALL NumberedCollection::releaseNumber(::sal_Int32 nNumber) ::osl::ResettableMutexGuard aLock(m_aMutex); if (nNumber == css::frame::UntitledNumbersConst::INVALID_NUMBER) - throw css::lang::IllegalArgumentException (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Special valkud INVALID_NUMBER not allowed as input parameter.")), m_xOwner.get(), 1); + throw css::lang::IllegalArgumentException (OUString("Special valkud INVALID_NUMBER not allowed as input parameter."), m_xOwner.get(), 1); TDeadItemList lDeadItems; TNumberedItemHash::iterator pComponent; diff --git a/comphelper/source/misc/numbers.cxx b/comphelper/source/misc/numbers.cxx index 8ea7e264f010..48b232ba334f 100644 --- a/comphelper/source/misc/numbers.cxx +++ b/comphelper/source/misc/numbers.cxx @@ -42,7 +42,7 @@ sal_Int16 getNumberFormatType(const staruno::Reference<starutil::XNumberFormats> { staruno::Reference<starbeans::XPropertySet> xFormat(xFormats->getByKey(nKey)); if (xFormat.is()) - xFormat->getPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ))) >>= nReturn; + xFormat->getPropertyValue(OUString( "Type" )) >>= nReturn; } catch(...) { @@ -72,7 +72,7 @@ staruno::Any getNumberFormatDecimals(const staruno::Reference<starutil::XNumberF staruno::Reference<starbeans::XPropertySet> xFormat( xFormats->getByKey(nKey)); if (xFormat.is()) { - static ::rtl::OUString PROPERTY_DECIMALS( RTL_CONSTASCII_USTRINGPARAM( "Decimals" )); + static ::rtl::OUString PROPERTY_DECIMALS( "Decimals" ); return xFormat->getPropertyValue(PROPERTY_DECIMALS); } } diff --git a/comphelper/source/misc/officeresourcebundle.cxx b/comphelper/source/misc/officeresourcebundle.cxx index 53434d58f251..3c201bc030ed 100644 --- a/comphelper/source/misc/officeresourcebundle.cxx +++ b/comphelper/source/misc/officeresourcebundle.cxx @@ -163,8 +163,7 @@ namespace comphelper try { Any aValue( m_xContext->getValueByName( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "/singletons/com.sun.star.resource.OfficeResourceLoader" ) ) ) ); + OUString( "/singletons/com.sun.star.resource.OfficeResourceLoader" ) ) ); OSL_VERIFY( aValue >>= xLoader ); } catch( const Exception& ) diff --git a/comphelper/source/misc/officerestartmanager.cxx b/comphelper/source/misc/officerestartmanager.cxx index dfbd2070d9a2..fed0410ab134 100644 --- a/comphelper/source/misc/officerestartmanager.cxx +++ b/comphelper/source/misc/officerestartmanager.cxx @@ -40,21 +40,21 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OOfficeRestartManager::getSupportedSer } // ---------------------------------------------------------- -::rtl::OUString SAL_CALL OOfficeRestartManager::getImplementationName_static() +OUString SAL_CALL OOfficeRestartManager::getImplementationName_static() { - return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.task.OfficeRestartManager" ) ); + return OUString( "com.sun.star.comp.task.OfficeRestartManager" ); } // ---------------------------------------------------------- -::rtl::OUString SAL_CALL OOfficeRestartManager::getSingletonName_static() +OUString SAL_CALL OOfficeRestartManager::getSingletonName_static() { - return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ); + return OUString( "com.sun.star.task.OfficeRestartManager" ); } // ---------------------------------------------------------- -::rtl::OUString SAL_CALL OOfficeRestartManager::getServiceName_static() +OUString SAL_CALL OOfficeRestartManager::getServiceName_static() { - return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.task.OfficeRestartManager" ) ); + return OUString( "com.sun.star.comp.task.OfficeRestartManager" ); } // ---------------------------------------------------------- @@ -93,7 +93,7 @@ void SAL_CALL OOfficeRestartManager::requestRestart( const uno::Reference< task: uno::Reference< awt::XRequestCallback > xRequestCallback( xFactory->createInstanceWithContext( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.AsyncCallback" )), + OUString( "com.sun.star.awt.AsyncCallback" ), m_xContext ), uno::UNO_QUERY_THROW ); @@ -133,7 +133,7 @@ void SAL_CALL OOfficeRestartManager::notify( const uno::Any& /* aData */ ) // Turn Quickstarter veto off uno::Reference< beans::XPropertySet > xPropertySet( xDesktop, uno::UNO_QUERY_THROW ); - ::rtl::OUString aVetoPropName( RTL_CONSTASCII_USTRINGPARAM( "SuspendQuickstartVeto" ) ); + ::rtl::OUString aVetoPropName( "SuspendQuickstartVeto" ); uno::Any aValue; aValue <<= (sal_Bool)sal_True; xPropertySet->setPropertyValue( aVetoPropName, aValue ); diff --git a/comphelper/source/misc/scopeguard.cxx b/comphelper/source/misc/scopeguard.cxx index 0277d96472a4..3d3bac67e39b 100644 --- a/comphelper/source/misc/scopeguard.cxx +++ b/comphelper/source/misc/scopeguard.cxx @@ -36,9 +36,7 @@ ScopeGuard::~ScopeGuard() catch (com::sun::star::uno::Exception & exc) { (void) exc; // avoid warning about unused variable OSL_FAIL( - rtl::OUStringToOString( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "UNO exception occurred: ") ) + + rtl::OUStringToOString( "UNO exception occurred: " + exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() ); } catch (...) { diff --git a/comphelper/source/misc/sequenceashashmap.cxx b/comphelper/source/misc/sequenceashashmap.cxx index 2867447222c4..d11153ee8ee0 100644 --- a/comphelper/source/misc/sequenceashashmap.cxx +++ b/comphelper/source/misc/sequenceashashmap.cxx @@ -76,7 +76,7 @@ void SequenceAsHashMap::operator<<(const css::uno::Any& aSource) } throw css::beans::IllegalTypeException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Any contains wrong type." )), + OUString( "Any contains wrong type." ), css::uno::Reference< css::uno::XInterface >()); } @@ -96,7 +96,7 @@ void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lS (!lP.Value.hasValue()) ) throw css::beans::IllegalTypeException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PropertyValue struct contains no usefull informations." )), + OUString( "PropertyValue struct contains no usefull informations." ), css::uno::Reference< css::uno::XInterface >()); (*this)[lP.Name] = lP.Value; continue; @@ -110,7 +110,7 @@ void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lS (!lN.Value.hasValue()) ) throw css::beans::IllegalTypeException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NamedValue struct contains no usefull informations." )), + OUString( "NamedValue struct contains no usefull informations." ), css::uno::Reference< css::uno::XInterface >()); (*this)[lN.Name] = lN.Value; continue; @@ -119,7 +119,7 @@ void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lS // ignore VOID Any ... but reject wrong filled ones! if (lSource[i].hasValue()) throw css::beans::IllegalTypeException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Any contains wrong type." )), + OUString( "Any contains wrong type." ), css::uno::Reference< css::uno::XInterface >()); } } diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index b7190663a7e0..4fc2302bbb0c 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -229,8 +229,8 @@ sal_Int32 OStorageHelper::GetXStorageFormat( { uno::Reference< beans::XPropertySet > xStorProps( xStorage, uno::UNO_QUERY_THROW ); - ::rtl::OUString aMediaType; - xStorProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" )) ) >>= aMediaType; + OUString aMediaType; + xStorProps->getPropertyValue( OUString( "MediaType" ) ) >>= aMediaType; sal_Int32 nResult = 0; @@ -290,12 +290,12 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromURL( throw ( uno::Exception ) { uno::Sequence< beans::PropertyValue > aProps( 1 ); - aProps[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StorageFormat" ) ); + aProps[0].Name = "StorageFormat"; aProps[0].Value <<= aFormat; if ( bRepairStorage ) { aProps.realloc( 2 ); - aProps[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RepairPackage" ) ); + aProps[1].Name = "RepairPackage"; aProps[1].Value <<= bRepairStorage; } @@ -321,12 +321,12 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromInputStr throw ( uno::Exception ) { uno::Sequence< beans::PropertyValue > aProps( 1 ); - aProps[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StorageFormat" ) ); + aProps[0].Name = "StorageFormat"; aProps[0].Value <<= aFormat; if ( bRepairStorage ) { aProps.realloc( 2 ); - aProps[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RepairPackage" ) ); + aProps[1].Name = "RepairPackage"; aProps[1].Value <<= bRepairStorage; } @@ -353,12 +353,12 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromStream( throw ( uno::Exception ) { uno::Sequence< beans::PropertyValue > aProps( 1 ); - aProps[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StorageFormat" ) ); + aProps[0].Name = "StorageFormat"; aProps[0].Value <<= aFormat; if ( bRepairStorage ) { aProps.realloc( 2 ); - aProps[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RepairPackage" ) ); + aProps[1].Name = "RepairPackage"; aProps[1].Value <<= bRepairStorage; } @@ -390,7 +390,7 @@ uno::Sequence< beans::NamedValue > OStorageHelper::CreatePackageEncryptionData( if ( !xFactory.is() ) throw uno::RuntimeException(); - uno::Reference< xml::crypto::XDigestContextSupplier > xDigestContextSupplier( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.crypto.NSSInitializer" ) ) ), uno::UNO_QUERY_THROW ); + uno::Reference< xml::crypto::XDigestContextSupplier > xDigestContextSupplier( xFactory->createInstance( OUString( "com.sun.star.xml.crypto.NSSInitializer" ) ), uno::UNO_QUERY_THROW ); uno::Reference< xml::crypto::XDigestContext > xDigestContext( xDigestContextSupplier->getDigestContext( xml::crypto::DigestID::SHA256, uno::Sequence< beans::NamedValue >() ), uno::UNO_SET_THROW ); ::rtl::OString aUTF8Password( ::rtl::OUStringToOString( aPassword, RTL_TEXTENCODING_UTF8 ) ); @@ -481,11 +481,11 @@ sal_Bool OStorageHelper::PathHasSegment( const ::rtl::OUString& aPath, const ::r if ( !aSegment.isEmpty() && nPathLen >= nSegLen ) { - ::rtl::OUString aEndSegment( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); + OUString aEndSegment( "/" ); aEndSegment += aSegment; - ::rtl::OUString aInternalSegment( aEndSegment ); - aInternalSegment += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); + OUString aInternalSegment( aEndSegment ); + aInternalSegment += "/"; if ( aPath.indexOf( aInternalSegment ) >= 0 ) bResult = sal_True; @@ -496,7 +496,7 @@ sal_Bool OStorageHelper::PathHasSegment( const ::rtl::OUString& aPath, const ::r bResult = sal_True; } - if ( !bResult && nPathLen > nSegLen && aPath.copy( nPathLen - nSegLen - 1, nSegLen + 1 ).equals( aEndSegment ) ) + if ( !bResult && nPathLen > nSegLen && aPath.copy( nPathLen - nSegLen - 1, nSegLen + 1 ) == aEndSegment ) bResult = sal_True; } diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx index 0674f9a7b065..d5e42468a88f 100644 --- a/comphelper/source/misc/string.cxx +++ b/comphelper/source/misc/string.cxx @@ -250,7 +250,7 @@ using namespace ::com::sun::star; ::comphelper::intersperse( ::comphelper::stl_begin(i_rSeq), ::comphelper::stl_end(i_rSeq), ::comphelper::OUStringBufferAppender(buf), - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ", " ))); + OUString( ", " )); return buf.makeStringAndClear(); } diff --git a/comphelper/source/misc/synchronousdispatch.cxx b/comphelper/source/misc/synchronousdispatch.cxx index 598ca7b6b8f9..bb0d28aa80a5 100644 --- a/comphelper/source/misc/synchronousdispatch.cxx +++ b/comphelper/source/misc/synchronousdispatch.cxx @@ -27,7 +27,6 @@ #include "comphelper/synchronousdispatch.hxx" #include "comphelper/processfactory.hxx" -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) //......................................................................... namespace comphelper @@ -50,7 +49,7 @@ uno::Reference< lang::XComponent > SynchronousDispatch::dispatch( util::URL aURL; aURL.Complete = sURL; uno::Reference < util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - UNISTRING("com.sun.star.util.URLTransformer" )), + "com.sun.star.util.URLTransformer"), uno::UNO_QUERY ); if ( xTrans.is() ) xTrans->parseStrict( aURL ); @@ -76,7 +75,7 @@ uno::Reference< lang::XComponent > SynchronousDispatch::dispatch( } catch ( uno::Exception& ) { - rtl::OUString aMsg = UNISTRING( "SynchronousDispatch::dispatch() Error while dispatching! "); + OUString aMsg = "SynchronousDispatch::dispatch() Error while dispatching! "; OSL_FAIL( OUStringToOString(aMsg, RTL_TEXTENCODING_ASCII_US).getStr()); } } diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx index dead4a6943f8..49928ddb32f1 100644 --- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx +++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx @@ -91,9 +91,9 @@ static bool makeCanonicalFileURL( rtl::OUString & rURL ) OfficeInstallationDirectories::OfficeInstallationDirectories( const uno::Reference< uno::XComponentContext > & xCtx ) -: m_aOfficeBrandDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(brandbaseurl)" ) ), - m_aOfficeBaseDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(baseinsturl)" ) ), - m_aUserDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(userdataurl)" ) ), +: m_aOfficeBrandDirMacro( "$(brandbaseurl)" ), + m_aOfficeBaseDirMacro( "$(baseinsturl)" ), + m_aUserDirMacro( "$(userdataurl)" ), m_xCtx( xCtx ), m_pOfficeBrandDir( 0 ), m_pUserDir( 0 ) @@ -247,29 +247,23 @@ OfficeInstallationDirectories::getSupportedServiceNames() rtl::OUString SAL_CALL OfficeInstallationDirectories::getImplementationName_static() { - return rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.util.OfficeInstallationDirectories" ) ); + return OUString("com.sun.star.comp.util.OfficeInstallationDirectories"); } //========================================================================= // static -uno::Sequence< ::rtl::OUString > SAL_CALL +uno::Sequence< OUString > SAL_CALL OfficeInstallationDirectories::getSupportedServiceNames_static() { - const rtl::OUString aServiceName( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.util.OfficeInstallationDirectories" ) ); - return uno::Sequence< rtl::OUString >( &aServiceName, 1 ); + const OUString aServiceName("com.sun.star.util.OfficeInstallationDirectories"); + return uno::Sequence< OUString >( &aServiceName, 1 ); } //========================================================================= // static -rtl::OUString SAL_CALL OfficeInstallationDirectories::getSingletonName_static() +OUString SAL_CALL OfficeInstallationDirectories::getSingletonName_static() { - return rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.util.theOfficeInstallationDirectories" ) ); + return OUString("com.sun.star.util.theOfficeInstallationDirectories"); } //========================================================================= @@ -299,8 +293,7 @@ void OfficeInstallationDirectories::initDirs() uno::Reference< util::XMacroExpander > xExpander; m_xCtx->getValueByName( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "/singletons/com.sun.star.util.theMacroExpander" ) ) ) + OUString("/singletons/com.sun.star.util.theMacroExpander")) >>= xExpander; OSL_ENSURE( xExpander.is(), @@ -310,7 +303,7 @@ void OfficeInstallationDirectories::initDirs() { *m_pOfficeBrandDir = xExpander->expandMacros( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "$BRAND_BASE_DIR" ) ) ); + OUString( "$BRAND_BASE_DIR" ) ); OSL_ENSURE( !m_pOfficeBrandDir->isEmpty(), "Unable to obtain office brand installation directory!" ); @@ -319,8 +312,7 @@ void OfficeInstallationDirectories::initDirs() *m_pUserDir = xExpander->expandMacros( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":UserInstallation}" ) ) ); + OUString("${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":UserInstallation}" ) ); OSL_ENSURE( !m_pUserDir->isEmpty(), "Unable to obtain office user data directory!" ); diff --git a/comphelper/source/processfactory/processfactory.cxx b/comphelper/source/processfactory/processfactory.cxx index deb9b4f80260..fe6c96b2af4a 100644 --- a/comphelper/source/processfactory/processfactory.cxx +++ b/comphelper/source/processfactory/processfactory.cxx @@ -74,8 +74,7 @@ Reference< XComponentContext > getComponentContext( uno::Reference<beans::XPropertySet> const xProps( factory, uno::UNO_QUERY ); if (xProps.is()) { try { - xRet.set( xProps->getPropertyValue( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ), + xRet.set( xProps->getPropertyValue( OUString("DefaultContext") ), uno::UNO_QUERY ); } catch (beans::UnknownPropertyException & e) { diff --git a/comphelper/source/property/genericpropertyset.cxx b/comphelper/source/property/genericpropertyset.cxx index c7886dea1b78..92f220787392 100644 --- a/comphelper/source/property/genericpropertyset.cxx +++ b/comphelper/source/property/genericpropertyset.cxx @@ -267,14 +267,14 @@ sal_Bool SAL_CALL GenericPropertySet::supportsService( const OUString& ServiceN OUString SAL_CALL GenericPropertySet::getImplementationName() throw( RuntimeException ) { - return OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.comphelper.GenericPropertySet") ); + return OUString( "com.sun.star.comp.comphelper.GenericPropertySet" ); } Sequence< OUString > SAL_CALL GenericPropertySet::getSupportedServiceNames( ) throw( RuntimeException ) { Sequence< OUString > aSNS( 1 ); - aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.XPropertySet" )); + aSNS.getArray()[0] = "com.sun.star.beans.XPropertySet"; return aSNS; } diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx index 40764a409816..ebb3dfa4175b 100644 --- a/comphelper/source/property/opropertybag.cxx +++ b/comphelper/source/property/opropertybag.cxx @@ -78,10 +78,10 @@ namespace comphelper IMPLEMENT_FORWARD_XTYPEPROVIDER2( OPropertyBag, OPropertyBag_Base, OPropertyBag_PBase ) //-------------------------------------------------------------------- - Sequence< ::rtl::OUString > OPropertyBag::getSupportedServiceNames_static() throw( RuntimeException ) + Sequence< OUString > OPropertyBag::getSupportedServiceNames_static() throw( RuntimeException ) { - Sequence< ::rtl::OUString > aServices(1); - aServices[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.PropertyBag" ) ); + Sequence< OUString > aServices(1); + aServices[0] = "com.sun.star.beans.PropertyBag"; return aServices; } @@ -109,9 +109,9 @@ namespace comphelper } //-------------------------------------------------------------------- - ::rtl::OUString OPropertyBag::getImplementationName_static() throw( RuntimeException ) + OUString OPropertyBag::getImplementationName_static() throw( RuntimeException ) { - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.comphelper.OPropertyBag" ) ); + return OUString( "com.sun.star.comp.comphelper.OPropertyBag" ); } //-------------------------------------------------------------------- diff --git a/comphelper/source/property/propertybag.cxx b/comphelper/source/property/propertybag.cxx index 41d517a295c7..44285bfab808 100644 --- a/comphelper/source/property/propertybag.cxx +++ b/comphelper/source/property/propertybag.cxx @@ -82,7 +82,7 @@ namespace comphelper { if ( !_allowEmpty && _name.isEmpty() ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The property name must not be empty." ) ), + OUString( "The property name must not be empty." ), // TODO: resource NULL, 1 @@ -93,7 +93,7 @@ namespace comphelper { if ( _container.hasPropertyByName( _name ) || _container.hasPropertyByHandle( _handle ) ) throw PropertyExistException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Property name or handle already used." ) ), + OUString( "Property name or handle already used." ), // TODO: resource NULL ); @@ -105,7 +105,7 @@ namespace comphelper { if ( _rType.getTypeClass() == TypeClass_VOID ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Illegal property type: VOID" ) ), + OUString( "Illegal property type: VOID" ), // TODO: resource NULL, 1 @@ -130,7 +130,7 @@ namespace comphelper Type aPropertyType = _rInitialValue.getValueType(); if ( aPropertyType.getTypeClass() == TypeClass_VOID ) throw IllegalTypeException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The initial value must be non-NULL to determine the property type." ) ), + OUString( "The initial value must be non-NULL to determine the property type." ), // TODO: resource NULL ); diff --git a/comphelper/source/streaming/memorystream.cxx b/comphelper/source/streaming/memorystream.cxx index 1dd6188c6ab1..fb654abb4f23 100644 --- a/comphelper/source/streaming/memorystream.cxx +++ b/comphelper/source/streaming/memorystream.cxx @@ -148,7 +148,7 @@ void SAL_CALL UNOMemoryStream::closeInput() throw (NotConnectedException, IOExce void SAL_CALL UNOMemoryStream::seek( sal_Int64 location ) throw (IllegalArgumentException, IOException, RuntimeException) { if( (location < 0) || (location > SAL_MAX_INT32) ) - throw IllegalArgumentException( OUString(RTL_CONSTASCII_USTRINGPARAM("this implementation does not support more than 2GB!")), Reference< XInterface >(static_cast<OWeakObject*>(this)), 0 ); + throw IllegalArgumentException( OUString("this implementation does not support more than 2GB!"), Reference< XInterface >(static_cast<OWeakObject*>(this)), 0 ); // seek operation should be able to resize the stream if ( location > static_cast< sal_Int64 >( maData.size() ) ) @@ -180,7 +180,7 @@ void SAL_CALL UNOMemoryStream::writeBytes( const Sequence< sal_Int8 >& aData ) t if( nNewSize > SAL_MAX_INT32 ) { OSL_ASSERT(false); - throw IOException( OUString(RTL_CONSTASCII_USTRINGPARAM("this implementation does not support more than 2GB!")), Reference< XInterface >(static_cast<OWeakObject*>(this)) ); + throw IOException( OUString("this implementation does not support more than 2GB!"), Reference< XInterface >(static_cast<OWeakObject*>(this)) ); } if( static_cast< sal_Int32 >( nNewSize ) > static_cast< sal_Int32 >( maData.size() ) ) diff --git a/comphelper/source/streaming/seqinputstreamserv.cxx b/comphelper/source/streaming/seqinputstreamserv.cxx index 9f7b74c4d777..c26c7bd9bbff 100644 --- a/comphelper/source/streaming/seqinputstreamserv.cxx +++ b/comphelper/source/streaming/seqinputstreamserv.cxx @@ -95,9 +95,9 @@ SequenceInputStreamService::SequenceInputStreamService() return getImplementationName_static(); } -::rtl::OUString SAL_CALL SequenceInputStreamService::getImplementationName_static() +OUString SAL_CALL SequenceInputStreamService::getImplementationName_static() { - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.SequenceInputStreamService" ) ); + return OUString( "com.sun.star.comp.SequenceInputStreamService" ); } ::sal_Bool SAL_CALL SequenceInputStreamService::supportsService( ::rtl::OUString const & serviceName ) throw ( uno::RuntimeException ) @@ -115,11 +115,10 @@ uno::Sequence< ::rtl::OUString > SAL_CALL SequenceInputStreamService::getSupport return getSupportedServiceNames_static(); } -uno::Sequence< ::rtl::OUString > SAL_CALL SequenceInputStreamService::getSupportedServiceNames_static() +uno::Sequence< OUString > SAL_CALL SequenceInputStreamService::getSupportedServiceNames_static() { - uno::Sequence< ::rtl::OUString > s( 1 ); - s[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.io.SequenceInputStream" ) ); + uno::Sequence< OUString > s( 1 ); + s[0] = "com.sun.star.io.SequenceInputStream"; return s; } @@ -213,7 +212,7 @@ void SAL_CALL SequenceInputStreamService::initialize( const uno::Sequence< ::com throw frame::DoubleInitializationException(); if ( aArguments.getLength() != 1 ) - throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Wrong number of arguments!\n")), + throw lang::IllegalArgumentException( OUString("Wrong number of arguments!\n"), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); @@ -229,7 +228,7 @@ void SAL_CALL SequenceInputStreamService::initialize( const uno::Sequence< ::com m_bInitialized = sal_True; } else - throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unexpected type of argument!\n")), + throw lang::IllegalArgumentException( OUString("Unexpected type of argument!\n"), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); } diff --git a/comphelper/source/streaming/seqoutputstreamserv.cxx b/comphelper/source/streaming/seqoutputstreamserv.cxx index f8b5fc01bd1b..9dc868b461e9 100644 --- a/comphelper/source/streaming/seqoutputstreamserv.cxx +++ b/comphelper/source/streaming/seqoutputstreamserv.cxx @@ -81,9 +81,9 @@ SequenceOutputStreamService::SequenceOutputStreamService() return getImplementationName_static(); } -::rtl::OUString SAL_CALL SequenceOutputStreamService::getImplementationName_static() +OUString SAL_CALL SequenceOutputStreamService::getImplementationName_static() { - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.SequenceOutputStreamService" ) ); + return OUString("com.sun.star.comp.SequenceOutputStreamService"); } ::sal_Bool SAL_CALL SequenceOutputStreamService::supportsService( ::rtl::OUString const & serviceName ) throw ( uno::RuntimeException ) @@ -101,10 +101,10 @@ uno::Sequence< ::rtl::OUString > SAL_CALL SequenceOutputStreamService::getSuppor return getSupportedServiceNames_static(); } -uno::Sequence< ::rtl::OUString > SAL_CALL SequenceOutputStreamService::getSupportedServiceNames_static() +uno::Sequence< OUString > SAL_CALL SequenceOutputStreamService::getSupportedServiceNames_static() { - uno::Sequence< ::rtl::OUString > s( 1 ); - s[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.SequenceOutputStream" ) ); + uno::Sequence< OUString > s( 1 ); + s[0] = "com.sun.star.io.SequenceOutputStream"; return s; } diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx index 41f5a5ca620c..609ae165a8c6 100644 --- a/comphelper/source/xml/ofopxmlhelper.cxx +++ b/comphelper/source/xml/ofopxmlhelper.cxx @@ -41,7 +41,7 @@ namespace comphelper { uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::ReadRelationsInfoSequence( const uno::Reference< io::XInputStream >& xInStream, const ::rtl::OUString aStreamName, const uno::Reference< uno::XComponentContext > xContext ) throw( uno::Exception ) { - ::rtl::OUString aStringID = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels/" ) ); + OUString aStringID = OUString( "_rels/" ); aStringID += aStreamName; return ReadSequence_Impl( xInStream, aStringID, RELATIONINFO_FORMAT, xContext ); } @@ -50,7 +50,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::Read uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::ReadContentTypeSequence( const uno::Reference< io::XInputStream >& xInStream, const uno::Reference< uno::XComponentContext > xContext ) throw( uno::Exception ) { - ::rtl::OUString aStringID = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "[Content_Types].xml" ) ); + OUString aStringID = OUString( "[Content_Types].xml" ); return ReadSequence_Impl( xInStream, aStringID, CONTENTTYPE_FORMAT, xContext ); } @@ -65,22 +65,22 @@ void SAL_CALL OFOPXMLHelper::WriteRelationsInfoSequence( const uno::Reference< i xWriter->setOutputStream( xOutStream ); - ::rtl::OUString aRelListElement( RTL_CONSTASCII_USTRINGPARAM( "Relationships" ) ); - ::rtl::OUString aRelElement( RTL_CONSTASCII_USTRINGPARAM( "Relationship" ) ); - ::rtl::OUString aIDAttr( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ); - ::rtl::OUString aTypeAttr( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ); - ::rtl::OUString aTargetModeAttr( RTL_CONSTASCII_USTRINGPARAM( "TargetMode" ) ); - ::rtl::OUString aTargetAttr( RTL_CONSTASCII_USTRINGPARAM( "Target" ) ); - ::rtl::OUString aCDATAString( RTL_CONSTASCII_USTRINGPARAM ( "CDATA" ) ); - ::rtl::OUString aWhiteSpace( RTL_CONSTASCII_USTRINGPARAM ( " " ) ); + OUString aRelListElement( "Relationships" ); + OUString aRelElement( "Relationship" ); + OUString aIDAttr( "Id" ); + OUString aTypeAttr( "Type" ); + OUString aTargetModeAttr( "TargetMode" ); + OUString aTargetAttr( "Target" ); + OUString aCDATAString( "CDATA" ); + OUString aWhiteSpace( " " ); // write the namespace AttributeList* pRootAttrList = new AttributeList; uno::Reference< xml::sax::XAttributeList > xRootAttrList( pRootAttrList ); pRootAttrList->AddAttribute( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "xmlns" ) ), + OUString( "xmlns" ), aCDATAString, - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "http://schemas.openxmlformats.org/package/2006/relationships" ) ) ); + OUString( "http://schemas.openxmlformats.org/package/2006/relationships" ) ); xWriter->startDocument(); xWriter->startElement( aRelListElement, xRootAttrList ); @@ -126,22 +126,22 @@ void SAL_CALL OFOPXMLHelper::WriteContentSequence( const uno::Reference< io::XOu xWriter->setOutputStream( xOutStream ); - ::rtl::OUString aTypesElement( RTL_CONSTASCII_USTRINGPARAM( "Types" ) ); - ::rtl::OUString aDefaultElement( RTL_CONSTASCII_USTRINGPARAM( "Default" ) ); - ::rtl::OUString aOverrideElement( RTL_CONSTASCII_USTRINGPARAM( "Override" ) ); - ::rtl::OUString aExtensionAttr( RTL_CONSTASCII_USTRINGPARAM( "Extension" ) ); - ::rtl::OUString aPartNameAttr( RTL_CONSTASCII_USTRINGPARAM( "PartName" ) ); - ::rtl::OUString aContentTypeAttr( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ); - ::rtl::OUString aCDATAString( RTL_CONSTASCII_USTRINGPARAM ( "CDATA" ) ); - ::rtl::OUString aWhiteSpace( RTL_CONSTASCII_USTRINGPARAM ( " " ) ); + ::rtl::OUString aTypesElement( "Types" ); + ::rtl::OUString aDefaultElement( "Default" ); + ::rtl::OUString aOverrideElement( "Override" ); + ::rtl::OUString aExtensionAttr( "Extension" ); + ::rtl::OUString aPartNameAttr( "PartName" ); + ::rtl::OUString aContentTypeAttr( "ContentType" ); + ::rtl::OUString aCDATAString( "CDATA" ); + ::rtl::OUString aWhiteSpace( " " ); // write the namespace AttributeList* pRootAttrList = new AttributeList; uno::Reference< xml::sax::XAttributeList > xRootAttrList( pRootAttrList ); pRootAttrList->AddAttribute( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "xmlns" ) ), + OUString( "xmlns" ), aCDATAString, - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "http://schemas.openxmlformats.org/package/2006/content-types" ) ) ); + OUString( "http://schemas.openxmlformats.org/package/2006/content-types" ) ); xWriter->startDocument(); xWriter->startElement( aTypesElement, xRootAttrList ); @@ -204,18 +204,18 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::Read // ----------------------------------- OFOPXMLHelper::OFOPXMLHelper( sal_uInt16 nFormat ) : m_nFormat( nFormat ) -, m_aRelListElement( RTL_CONSTASCII_USTRINGPARAM( "Relationships" ) ) -, m_aRelElement( RTL_CONSTASCII_USTRINGPARAM( "Relationship" ) ) -, m_aIDAttr( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ) -, m_aTypeAttr( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ) -, m_aTargetModeAttr( RTL_CONSTASCII_USTRINGPARAM( "TargetMode" ) ) -, m_aTargetAttr( RTL_CONSTASCII_USTRINGPARAM( "Target" ) ) -, m_aTypesElement( RTL_CONSTASCII_USTRINGPARAM( "Types" ) ) -, m_aDefaultElement( RTL_CONSTASCII_USTRINGPARAM( "Default" ) ) -, m_aOverrideElement( RTL_CONSTASCII_USTRINGPARAM( "Override" ) ) -, m_aExtensionAttr( RTL_CONSTASCII_USTRINGPARAM( "Extension" ) ) -, m_aPartNameAttr( RTL_CONSTASCII_USTRINGPARAM( "PartName" ) ) -, m_aContentTypeAttr( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ) +, m_aRelListElement( "Relationships" ) +, m_aRelElement( "Relationship" ) +, m_aIDAttr( "Id" ) +, m_aTypeAttr( "Type" ) +, m_aTargetModeAttr( "TargetMode" ) +, m_aTargetAttr( "Target" ) +, m_aTypesElement( "Types" ) +, m_aDefaultElement( "Default" ) +, m_aOverrideElement( "Override" ) +, m_aExtensionAttr( "Extension" ) +, m_aPartNameAttr( "PartName" ) +, m_aContentTypeAttr( "ContentType" ) { } |