[Libreoffice-commits] core.git: compilerplugins/clang connectivity/source desktop/source idlc/source l10ntools/source linguistic/source sal/qa sax/source sc/source sdext/source slideshow/source sw/qa sw/source tools/qa vcl/unx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 29 08:57:47 UTC 2018
compilerplugins/clang/check.hxx | 87 ++++++-----------
compilerplugins/clang/stringconstant.cxx | 61 +++++++++++
compilerplugins/clang/test/stringconstant.cxx | 12 ++
connectivity/source/drivers/mork/MQueryHelper.cxx | 4
desktop/source/deployment/inc/lockfile.hxx | 12 +-
desktop/source/deployment/misc/lockfile.cxx | 2
idlc/source/idlc.cxx | 48 ++++-----
idlc/source/idlccompile.cxx | 4
idlc/source/parser.y | 2
l10ntools/source/helpmerge.cxx | 4
l10ntools/source/pocheck.cxx | 4
linguistic/source/dicimp.cxx | 10 -
sal/qa/rtl/strings/test_ostring.cxx | 6 -
sax/source/fastparser/fastparser.cxx | 4
sc/source/filter/excel/xepage.cxx | 4
sc/source/filter/xcl97/xcl97rec.cxx | 2
sdext/source/pdfimport/test/pdfunzip.cxx | 2
slideshow/source/engine/shapes/drawshapesubsetting.cxx | 7 -
slideshow/source/engine/shapes/drawshapesubsetting.hxx | 2
slideshow/source/engine/shapes/gdimtftools.cxx | 2
sw/qa/extras/txtexport/txtexport.cxx | 2
sw/source/filter/ww8/docxattributeoutput.cxx | 13 +-
tools/qa/cppunit/test_config.cxx | 36 +++----
vcl/unx/generic/print/common_gfx.cxx | 2
vcl/unx/generic/print/genprnpsp.cxx | 2
vcl/unx/generic/printer/cpdmgr.cxx | 14 +-
vcl/unx/generic/printer/jobdata.cxx | 2
vcl/unx/generic/printer/ppdparser.cxx | 4
28 files changed, 201 insertions(+), 153 deletions(-)
New commits:
commit 933660e591211f06a1be43e83c64ad1e8529bc2f
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Nov 29 08:46:47 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Nov 29 09:57:15 2018 +0100
loplugin:stringconstant look for unnecessary OString constructor use
and tweak the methods in check.hxx to make them more flexible when
called with
dc.Class(xxx ? "foo" : "bar")
Change-Id: I881fe628f22121ced4d8849715d6b1c92b092da1
Reviewed-on: https://gerrit.libreoffice.org/64207
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/compilerplugins/clang/check.hxx b/compilerplugins/clang/check.hxx
index 407258393eb8..4ae65f139955 100644
--- a/compilerplugins/clang/check.hxx
+++ b/compilerplugins/clang/check.hxx
@@ -24,8 +24,8 @@ class TerminalCheck;
namespace detail {
-template<std::size_t N> ContextCheck checkRecordDecl(
- clang::Decl const * decl, clang::TagTypeKind tag, char const (& id)[N]);
+inline ContextCheck checkRecordDecl(
+ clang::Decl const * decl, clang::TagTypeKind tag, llvm::StringRef id);
}
@@ -59,16 +59,13 @@ public:
TypeCheck LvalueReference() const;
- template<std::size_t N> inline ContextCheck Class(char const (& id)[N])
- const;
+ inline ContextCheck Class(llvm::StringRef id) const;
- template<std::size_t N> inline ContextCheck Struct(char const (& id)[N])
- const;
+ inline ContextCheck Struct(llvm::StringRef id) const;
TypeCheck Typedef() const;
- template<std::size_t N> inline ContextCheck Typedef(char const (& id)[N])
- const;
+ inline ContextCheck Typedef(llvm::StringRef id) const;
TypeCheck NotSubstTemplateTypeParmType() const;
@@ -84,22 +81,17 @@ public:
explicit operator bool() const { return decl_ != nullptr; }
- template<std::size_t N> inline ContextCheck Class(char const (& id)[N])
- const;
+ inline ContextCheck Class(llvm::StringRef id) const;
- template<std::size_t N> inline ContextCheck Struct(char const (& id)[N])
- const;
+ inline ContextCheck Struct(llvm::StringRef id) const;
- template<std::size_t N> inline ContextCheck Union(char const (& id)[N])
- const;
+ inline ContextCheck Union(llvm::StringRef id) const;
- template<std::size_t N> inline ContextCheck Function(char const (& id)[N])
- const;
+ inline ContextCheck Function(llvm::StringRef id) const;
ContextCheck Operator(clang::OverloadedOperatorKind op) const;
- template<std::size_t N> inline ContextCheck Var(char const (& id)[N])
- const;
+ inline ContextCheck Var(llvm::StringRef id) const;
ContextCheck MemberFunction() const;
@@ -113,24 +105,21 @@ public:
TerminalCheck GlobalNamespace() const;
- template<std::size_t N> inline ContextCheck Namespace(
- char const (& id)[N]) const;
+ inline ContextCheck Namespace(llvm::StringRef id) const;
TerminalCheck StdNamespace() const;
ContextCheck AnonymousNamespace() const;
- template<std::size_t N> inline ContextCheck Class(char const (& id)[N])
- const;
+ inline ContextCheck Class(llvm::StringRef id) const;
- template<std::size_t N> inline ContextCheck Struct(char const (& id)[N])
- const;
+ inline ContextCheck Struct(llvm::StringRef id) const;
private:
friend DeclCheck;
friend TypeCheck;
- template<std::size_t N> friend ContextCheck detail::checkRecordDecl(
- clang::Decl const * decl, clang::TagTypeKind tag, char const (& id)[N]);
+ friend ContextCheck detail::checkRecordDecl(
+ clang::Decl const * decl, clang::TagTypeKind tag, llvm::StringRef id);
explicit ContextCheck(clang::DeclContext const * context = nullptr):
context_(context) {}
@@ -153,13 +142,13 @@ private:
namespace detail {
-template<std::size_t N> ContextCheck checkRecordDecl(
- clang::Decl const * decl, clang::TagTypeKind tag, char const (& id)[N])
+ContextCheck checkRecordDecl(
+ clang::Decl const * decl, clang::TagTypeKind tag, llvm::StringRef id)
{
auto r = llvm::dyn_cast_or_null<clang::RecordDecl>(decl);
if (r != nullptr && r->getTagKind() == tag) {
auto const i = r->getIdentifier();
- if (i != nullptr && i->isStr(id)) {
+ if (i != nullptr && i->getName() == id) {
return ContextCheck(r->getDeclContext());
}
}
@@ -168,7 +157,7 @@ template<std::size_t N> ContextCheck checkRecordDecl(
}
-template<std::size_t N> ContextCheck TypeCheck::Class(char const (& id)[N])
+ContextCheck TypeCheck::Class(llvm::StringRef id)
const
{
if (!type_.isNull()) {
@@ -180,8 +169,7 @@ template<std::size_t N> ContextCheck TypeCheck::Class(char const (& id)[N])
return ContextCheck();
}
-template<std::size_t N> ContextCheck TypeCheck::Struct(char const (& id)[N])
- const
+ContextCheck TypeCheck::Struct(llvm::StringRef id) const
{
if (!type_.isNull()) {
auto const t = type_->getAs<clang::RecordType>();
@@ -192,15 +180,14 @@ template<std::size_t N> ContextCheck TypeCheck::Struct(char const (& id)[N])
return ContextCheck();
}
-template<std::size_t N> ContextCheck TypeCheck::Typedef(char const (& id)[N])
- const
+ContextCheck TypeCheck::Typedef(llvm::StringRef id) const
{
if (!type_.isNull()) {
if (auto const t = type_->getAs<clang::TypedefType>()) {
auto const d = t->getDecl();
auto const i = d->getIdentifier();
assert(i != nullptr);
- if (i->isStr(id)) {
+ if (i->getName() == id) {
return ContextCheck(d->getDeclContext());
}
}
@@ -208,58 +195,52 @@ template<std::size_t N> ContextCheck TypeCheck::Typedef(char const (& id)[N])
return ContextCheck();
}
-template<std::size_t N> ContextCheck DeclCheck::Class(char const (& id)[N])
- const
+ContextCheck DeclCheck::Class(llvm::StringRef id) const
{
return detail::checkRecordDecl(decl_, clang::TTK_Class, id);
}
-template<std::size_t N> ContextCheck DeclCheck::Struct(char const (& id)[N])
- const
+ContextCheck DeclCheck::Struct(llvm::StringRef id) const
{
return detail::checkRecordDecl(decl_, clang::TTK_Struct, id);
}
-template<std::size_t N> ContextCheck DeclCheck::Union(char const (& id)[N])
- const
+ContextCheck DeclCheck::Union(llvm::StringRef id) const
{
return detail::checkRecordDecl(decl_, clang::TTK_Union, id);
}
-template<std::size_t N> ContextCheck DeclCheck::Function(char const (& id)[N])
- const
+ContextCheck DeclCheck::Function(llvm::StringRef id) const
{
auto f = llvm::dyn_cast_or_null<clang::FunctionDecl>(decl_);
if (f != nullptr) {
auto const i = f->getIdentifier();
- if (i != nullptr && i->isStr(id)) {
+ if (i != nullptr && i->getName() == id) {
return ContextCheck(f->getDeclContext());
}
}
return ContextCheck();
}
-template<std::size_t N> ContextCheck DeclCheck::Var(char const (& id)[N])
- const
+ContextCheck DeclCheck::Var(llvm::StringRef id) const
{
auto f = llvm::dyn_cast_or_null<clang::VarDecl>(decl_);
if (f != nullptr) {
auto const i = f->getIdentifier();
- if (i != nullptr && i->isStr(id)) {
+ if (i != nullptr && i->getName() == id) {
return ContextCheck(f->getDeclContext());
}
}
return ContextCheck();
}
-template<std::size_t N> ContextCheck ContextCheck::Namespace(
- char const (& id)[N]) const
+ContextCheck ContextCheck::Namespace(llvm::StringRef id) const
{
if (context_) {
auto n = llvm::dyn_cast<clang::NamespaceDecl>(context_);
if (n != nullptr) {
auto const i = n->getIdentifier();
- if (i != nullptr && i->isStr(id)) {
+ if (i != nullptr && i->getName() == id) {
return ContextCheck(n->getParent());
}
}
@@ -267,15 +248,13 @@ template<std::size_t N> ContextCheck ContextCheck::Namespace(
return ContextCheck();
}
-template<std::size_t N> ContextCheck ContextCheck::Class(char const (& id)[N])
- const
+ContextCheck ContextCheck::Class(llvm::StringRef id) const
{
return detail::checkRecordDecl(
llvm::dyn_cast_or_null<clang::Decl>(context_), clang::TTK_Class, id);
}
-template<std::size_t N> ContextCheck ContextCheck::Struct(char const (& id)[N])
- const
+ContextCheck ContextCheck::Struct(llvm::StringRef id) const
{
return detail::checkRecordDecl(
llvm::dyn_cast_or_null<clang::Decl>(context_), clang::TTK_Struct, id);
diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx
index dd4eeff3763a..83a62a617d06 100644
--- a/compilerplugins/clang/stringconstant.cxx
+++ b/compilerplugins/clang/stringconstant.cxx
@@ -163,10 +163,23 @@ private:
CallExpr const * expr, unsigned arg, FunctionDecl const * callee,
bool explicitFunctionalCastNotation);
+ void handleOStringCtor(
+ CallExpr const * expr, unsigned arg, FunctionDecl const * callee,
+ bool explicitFunctionalCastNotation);
+
void handleOUStringCtor(
Expr const * expr, Expr const * argExpr, FunctionDecl const * callee,
bool explicitFunctionalCastNotation);
+ void handleOStringCtor(
+ Expr const * expr, Expr const * argExpr, FunctionDecl const * callee,
+ bool explicitFunctionalCastNotation);
+
+ enum class StringKind { Unicode, Char };
+ void handleStringCtor(
+ Expr const * expr, Expr const * argExpr, FunctionDecl const * callee,
+ bool explicitFunctionalCastNotation, StringKind stringKind);
+
void handleFunArgOstring(
CallExpr const * expr, unsigned arg, FunctionDecl const * callee);
@@ -268,6 +281,16 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) {
handleOUStringCtor(expr, i, fdecl, true);
}
}
+ if (loplugin::TypeCheck(t).NotSubstTemplateTypeParmType()
+ .LvalueReference().Const().NotSubstTemplateTypeParmType()
+ .Class("OString").Namespace("rtl").GlobalNamespace())
+ {
+ if (!(isLhsOfAssignment(fdecl, i)
+ || hasOverloads(fdecl, expr->getNumArgs())))
+ {
+ handleOStringCtor(expr, i, fdecl, true);
+ }
+ }
}
loplugin::DeclCheck dc(fdecl);
//TODO: u.compareToAscii("foo") -> u.???("foo")
@@ -1166,6 +1189,19 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
}
}
}
+ if (loplugin::TypeCheck(t).NotSubstTemplateTypeParmType()
+ .LvalueReference().Const().NotSubstTemplateTypeParmType()
+ .Class("OString").Namespace("rtl").GlobalNamespace())
+ {
+ auto argExpr = expr->getArg(i);
+ if (argExpr && i <= consDecl->getNumParams())
+ {
+ if (!hasOverloads(consDecl, expr->getNumArgs()))
+ {
+ handleOStringCtor(expr, argExpr, consDecl, true);
+ }
+ }
+ }
}
return true;
@@ -1785,10 +1821,31 @@ void StringConstant::handleOUStringCtor(
handleOUStringCtor(expr, expr->getArg(arg), callee, explicitFunctionalCastNotation);
}
+void StringConstant::handleOStringCtor(
+ CallExpr const * expr, unsigned arg, FunctionDecl const * callee,
+ bool explicitFunctionalCastNotation)
+{
+ handleOStringCtor(expr, expr->getArg(arg), callee, explicitFunctionalCastNotation);
+}
+
void StringConstant::handleOUStringCtor(
Expr const * expr, Expr const * argExpr, FunctionDecl const * callee,
bool explicitFunctionalCastNotation)
{
+ handleStringCtor(expr, argExpr, callee, explicitFunctionalCastNotation, StringKind::Unicode);
+}
+
+void StringConstant::handleOStringCtor(
+ Expr const * expr, Expr const * argExpr, FunctionDecl const * callee,
+ bool explicitFunctionalCastNotation)
+{
+ handleStringCtor(expr, argExpr, callee, explicitFunctionalCastNotation, StringKind::Char);
+}
+
+void StringConstant::handleStringCtor(
+ Expr const * expr, Expr const * argExpr, FunctionDecl const * callee,
+ bool explicitFunctionalCastNotation, StringKind stringKind)
+{
auto e0 = argExpr->IgnoreParenImpCasts();
auto e1 = dyn_cast<CXXFunctionalCastExpr>(e0);
if (e1 == nullptr) {
@@ -1808,7 +1865,7 @@ void StringConstant::handleOUStringCtor(
return;
}
if (!loplugin::DeclCheck(e3->getConstructor()).MemberFunction()
- .Class("OUString").Namespace("rtl").GlobalNamespace())
+ .Class(stringKind == StringKind::Unicode ? "OUString" : "OString").Namespace("rtl").GlobalNamespace())
{
return;
}
@@ -1825,7 +1882,7 @@ void StringConstant::handleOUStringCtor(
&& e3->getConstructor()->getNumParams() == 1
&& (loplugin::TypeCheck(
e3->getConstructor()->getParamDecl(0)->getType())
- .Typedef("sal_Unicode").GlobalNamespace()))
+ .Typedef(stringKind == StringKind::Unicode ? "sal_Unicode" : "char").GlobalNamespace()))
{
// It may not be easy to rewrite OUString(c), esp. given there is no
// OUString ctor taking an OUStringLiteral1 arg, so don't warn there:
diff --git a/compilerplugins/clang/test/stringconstant.cxx b/compilerplugins/clang/test/stringconstant.cxx
index 068d34f5078d..49ae3b68d035 100644
--- a/compilerplugins/clang/test/stringconstant.cxx
+++ b/compilerplugins/clang/test/stringconstant.cxx
@@ -19,6 +19,13 @@ extern void foo(OUString const &);
struct Foo {
Foo(OUString const &, int) {}
Foo(OUString const &) {}
+ void foo(OUString const &) const {}
+};
+
+struct Foo2 {
+ Foo2(OString const &, int) {}
+ Foo2(OString const &) {}
+ void foo(OString const &) const {}
};
int main() {
@@ -59,7 +66,10 @@ int main() {
Foo aFoo(OUString("xxx"), 1); // expected-error {{in call of 'Foo::Foo', replace 'OUString' constructed from a string literal directly with the string literal}}
(void)aFoo;
Foo aFoo2(OUString("xxx")); // expected-error {{in call of 'Foo::Foo', replace 'OUString' constructed from a string literal directly with the string literal}}
- (void)aFoo2;
+ aFoo2.foo(OUString("xxx")); // expected-error {{in call of 'Foo::foo', replace 'OUString' constructed from a string literal directly with the string literal}}
+
+ Foo2 aFoo3(OString("xxx")); // expected-error {{in call of 'Foo2::Foo2', replace 'OUString' constructed from a string literal directly with the string literal}}
+ aFoo3.foo(OString("xxx")); // expected-error {{in call of 'Foo2::foo', replace 'OUString' constructed from a string literal directly with the string literal}}
(void) OUString("xxx", 3, RTL_TEXTENCODING_ASCII_US); // expected-error {{simplify construction of 'OUString' with string constant argument [loplugin:stringconstant]}}
(void) OUString("xxx", 3, RTL_TEXTENCODING_ISO_8859_1); // expected-error {{suspicious 'rtl::OUString' constructor with text encoding 12 but plain ASCII content; use 'RTL_TEXTENCODING_ASCII_US' instead [loplugin:stringconstant]}}
diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx
index 6998df5e98fa..4e64e08f2ad9 100644
--- a/connectivity/source/drivers/mork/MQueryHelper.cxx
+++ b/connectivity/source/drivers/mork/MQueryHelper.cxx
@@ -165,12 +165,12 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection, MQueryExpression
else
{
// Let's try to retrieve the list in Collected Addresses book
- pMork = xConnection->getMorkParser(OString("CollectedAddressBook"));
+ pMork = xConnection->getMorkParser("CollectedAddressBook");
if (std::find(pMork->lists_.begin(), pMork->lists_.end(), m_aAddressbook) == pMork->lists_.end())
{
// so the list is in Address book
// TODO : manage case where an address book has been created
- pMork = xConnection->getMorkParser(OString("AddressBook"));
+ pMork = xConnection->getMorkParser("AddressBook");
}
handleListTable = true;
// retrieve row ids for that list table
diff --git a/desktop/source/deployment/inc/lockfile.hxx b/desktop/source/deployment/inc/lockfile.hxx
index 07dbc3446f3d..dc1e66cc0890 100644
--- a/desktop/source/deployment/inc/lockfile.hxx
+++ b/desktop/source/deployment/inc/lockfile.hxx
@@ -41,12 +41,12 @@
#include "dp_misc_api.hxx"
-#define LOCKFILE_GROUP OString( "Lockdata" )
-#define LOCKFILE_USERKEY OString( "User" )
-#define LOCKFILE_HOSTKEY OString( "Host" )
-#define LOCKFILE_STAMPKEY OString( "Stamp" )
-#define LOCKFILE_TIMEKEY OString( "Time" )
-#define LOCKFILE_IPCKEY OString( "IPCServer" )
+#define LOCKFILE_GROUP "Lockdata"
+#define LOCKFILE_USERKEY "User"
+#define LOCKFILE_HOSTKEY "Host"
+#define LOCKFILE_STAMPKEY "Stamp"
+#define LOCKFILE_TIMEKEY "Time"
+#define LOCKFILE_IPCKEY "IPCServer"
namespace desktop {
diff --git a/desktop/source/deployment/misc/lockfile.cxx b/desktop/source/deployment/misc/lockfile.cxx
index 219ccaf10431..b46da255647b 100644
--- a/desktop/source/deployment/misc/lockfile.cxx
+++ b/desktop/source/deployment/misc/lockfile.cxx
@@ -155,7 +155,7 @@ namespace desktop {
Config aConfig(aLockname);
aConfig.SetGroup(LOCKFILE_GROUP);
OString aIPCserver = aConfig.ReadKey( LOCKFILE_IPCKEY );
- if (!aIPCserver.equalsIgnoreAsciiCase(OString("true")))
+ if (!aIPCserver.equalsIgnoreAsciiCase("true"))
return false;
OString aHost = aConfig.ReadKey( LOCKFILE_HOSTKEY );
diff --git a/idlc/source/idlc.cxx b/idlc/source/idlc.cxx
index 5e530968cb9b..cd532f91320f 100644
--- a/idlc/source/idlc.cxx
+++ b/idlc/source/idlc.cxx
@@ -102,25 +102,25 @@ static void predefineXInterface(AstModule* pRoot)
{
// define the modules com::sun::star::uno
AstModule* pParentScope = pRoot;
- AstModule* pModule = new AstModule(OString("com"), pParentScope);
+ AstModule* pModule = new AstModule("com", pParentScope);
pModule->setPredefined(true);
pParentScope->addDeclaration(pModule);
pParentScope = pModule;
- pModule = new AstModule(OString("sun"), pParentScope);
+ pModule = new AstModule("sun", pParentScope);
pModule->setPredefined(true);
pParentScope->addDeclaration(pModule);
pParentScope = pModule;
- pModule = new AstModule(OString("star"), pParentScope);
+ pModule = new AstModule("star", pParentScope);
pModule->setPredefined(true);
pParentScope->addDeclaration(pModule);
pParentScope = pModule;
- pModule = new AstModule(OString("uno"), pParentScope);
+ pModule = new AstModule("uno", pParentScope);
pModule->setPredefined(true);
pParentScope->addDeclaration(pModule);
pParentScope = pModule;
// define XInterface
- AstInterface* pInterface = new AstInterface(OString("XInterface"), nullptr, pParentScope);
+ AstInterface* pInterface = new AstInterface("XInterface", nullptr, pParentScope);
pInterface->setDefined();
pInterface->setPredefined(true);
pInterface->setPublished();
@@ -128,21 +128,21 @@ static void predefineXInterface(AstModule* pRoot)
// define XInterface::queryInterface
AstOperation* pOp = new AstOperation(static_cast<AstType*>(pRoot->lookupPrimitiveType(ET_any)),
- OString("queryInterface"), pInterface);
+ "queryInterface", pInterface);
AstParameter* pParam = new AstParameter(DIR_IN, false,
static_cast<AstType*>(pRoot->lookupPrimitiveType(ET_type)),
- OString("aType"), pOp);
+ "aType", pOp);
pOp->addDeclaration(pParam);
pInterface->addMember(pOp);
// define XInterface::acquire
pOp = new AstOperation(static_cast<AstType*>(pRoot->lookupPrimitiveType(ET_void)),
- OString("acquire"), pInterface);
+ "acquire", pInterface);
pInterface->addMember(pOp);
// define XInterface::release
pOp = new AstOperation(static_cast<AstType*>(pRoot->lookupPrimitiveType(ET_void)),
- OString("release"), pInterface);
+ "release", pInterface);
pInterface->addMember(pOp);
}
@@ -150,49 +150,49 @@ static void initializePredefinedTypes(AstModule* pRoot)
{
if ( pRoot )
{
- AstBaseType* pPredefined = new AstBaseType(ET_long, OString("long"), pRoot);
+ AstBaseType* pPredefined = new AstBaseType(ET_long, "long", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_ulong, OString("unsigned long"), pRoot);
+ pPredefined = new AstBaseType(ET_ulong, "unsigned long", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_hyper, OString("hyper"), pRoot);
+ pPredefined = new AstBaseType(ET_hyper, "hyper", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_uhyper, OString("unsigned hyper"), pRoot);
+ pPredefined = new AstBaseType(ET_uhyper, "unsigned hyper", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_short, OString("short"), pRoot);
+ pPredefined = new AstBaseType(ET_short, "short", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_ushort, OString("unsigned short"), pRoot);
+ pPredefined = new AstBaseType(ET_ushort, "unsigned short", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_float, OString("float"), pRoot);
+ pPredefined = new AstBaseType(ET_float, "float", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_double, OString("double"), pRoot);
+ pPredefined = new AstBaseType(ET_double, "double", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_char, OString("char"), pRoot);
+ pPredefined = new AstBaseType(ET_char, "char", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_byte, OString("byte"), pRoot);
+ pPredefined = new AstBaseType(ET_byte, "byte", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_any, OString("any"), pRoot);
+ pPredefined = new AstBaseType(ET_any, "any", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_string, OString("string"), pRoot);
+ pPredefined = new AstBaseType(ET_string, "string", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_type, OString("type"), pRoot);
+ pPredefined = new AstBaseType(ET_type, "type", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_boolean, OString("boolean"), pRoot);
+ pPredefined = new AstBaseType(ET_boolean, "boolean", pRoot);
pRoot->addDeclaration(pPredefined);
- pPredefined = new AstBaseType(ET_void, OString("void"), pRoot);
+ pPredefined = new AstBaseType(ET_void, "void", pRoot);
pRoot->addDeclaration(pPredefined);
}
}
diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index 9f287c836d7f..62fab8e1d692 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -210,8 +210,8 @@ bool copyFile(const OString* source, const OString& target)
sal_Int32 compileFile(const OString * pathname)
{
// preprocess input file
- OString tmpFile = makeTempName(OString("idli_"));
- OString preprocFile = makeTempName(OString("idlf_"));
+ OString tmpFile = makeTempName("idli_");
+ OString preprocFile = makeTempName("idlf_");
OString fileName;
if (pathname == nullptr) {
diff --git a/idlc/source/parser.y b/idlc/source/parser.y
index 74ceb348dc46..054df1e81df7 100644
--- a/idlc/source/parser.y
+++ b/idlc/source/parser.y
@@ -626,7 +626,7 @@ interface_dcl :
&& ifc->getScopedName() != "com::sun::star::uno::XInterface")
{
addInheritedInterface(
- ifc, OString("::com::sun::star::uno::XInterface"), false,
+ ifc, "::com::sun::star::uno::XInterface", false,
OUString());
}
ifc->setDefined();
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 7608cbfa88b7..058e79ae656e 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -209,10 +209,10 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResDa
OString sSourceText(
pXMLElement->ToOString().
replaceAll(
- OString("\n"),
+ "\n",
OString()).
replaceAll(
- OString("\t"),
+ "\t",
OString()));
// re-add spaces to the beginning of translated string,
// important for indentation of Basic code examples
diff --git a/l10ntools/source/pocheck.cxx b/l10ntools/source/pocheck.cxx
index 14b9983ec20d..423f7246663f 100644
--- a/l10ntools/source/pocheck.cxx
+++ b/l10ntools/source/pocheck.cxx
@@ -237,13 +237,13 @@ static void checkFunctionNames(const OString& aLanguage)
{
case 0:
{
- PoHeader hd(OString("formula/inc"));
+ PoHeader hd("formula/inc");
aPoOutput.writeHeader(hd);
break;
}
case 1:
{
- PoHeader hd(OString("scaddins/inc"));
+ PoHeader hd("scaddins/inc");
aPoOutput.writeHeader(hd);
break;
}
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 8c4fe534d1be..100c9cab7f06 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -431,7 +431,7 @@ ErrCode DictionaryNeo::saveEntries(const OUString &rURL)
// Always write as the latest version, i.e. DIC_VERSION_7
rtl_TextEncoding eEnc = RTL_TEXTENCODING_UTF8;
- pStream->WriteLine(OString(pVerOOo7));
+ pStream->WriteLine(pVerOOo7);
ErrCode nErr = pStream->GetError();
if (nErr != ERRCODE_NONE)
return nErr;
@@ -439,7 +439,7 @@ ErrCode DictionaryNeo::saveEntries(const OUString &rURL)
* undetermined or multiple? Earlier versions did not know about 'und' and
* 'mul' and 'zxx' codes. Sync with ReadDicVersion() */
if (LinguIsUnspecified(nLanguage))
- pStream->WriteLine(OString("lang: <none>"));
+ pStream->WriteLine("lang: <none>");
else
{
OStringBuffer aLine("lang: ");
@@ -449,9 +449,9 @@ ErrCode DictionaryNeo::saveEntries(const OUString &rURL)
if (ERRCODE_NONE != (nErr = pStream->GetError()))
return nErr;
if (eDicType == DictionaryType_POSITIVE)
- pStream->WriteLine(OString("type: positive"));
+ pStream->WriteLine("type: positive");
else
- pStream->WriteLine(OString("type: negative"));
+ pStream->WriteLine("type: negative");
if (aDicName.endsWith(EXTENSION_FOR_TITLE_TEXT))
{
pStream->WriteLine(OUStringToOString("title: " +
@@ -460,7 +460,7 @@ ErrCode DictionaryNeo::saveEntries(const OUString &rURL)
}
if (ERRCODE_NONE != (nErr = pStream->GetError()))
return nErr;
- pStream->WriteLine(OString("---"));
+ pStream->WriteLine("---");
if (ERRCODE_NONE != (nErr = pStream->GetError()))
return nErr;
for (Reference<XDictionaryEntry> & aEntrie : aEntries)
diff --git a/sal/qa/rtl/strings/test_ostring.cxx b/sal/qa/rtl/strings/test_ostring.cxx
index 3732f7488bde..32738125f92a 100644
--- a/sal/qa/rtl/strings/test_ostring.cxx
+++ b/sal/qa/rtl/strings/test_ostring.cxx
@@ -43,19 +43,19 @@ void Test::testStartsWithIgnoreAsciiCase() {
{
OString r;
CPPUNIT_ASSERT(
- OString("foo").startsWithIgnoreAsciiCase(OString("F"), &r));
+ OString("foo").startsWithIgnoreAsciiCase("F", &r));
CPPUNIT_ASSERT_EQUAL(OString("oo"), r);
}
{
OString r("other");
CPPUNIT_ASSERT(
- !OString("foo").startsWithIgnoreAsciiCase(OString("bar"), &r));
+ !OString("foo").startsWithIgnoreAsciiCase("bar", &r));
CPPUNIT_ASSERT_EQUAL(OString("other"), r);
}
{
OString r("other");
CPPUNIT_ASSERT(
- !OString("foo").startsWithIgnoreAsciiCase(OString("foobar"), &r));
+ !OString("foo").startsWithIgnoreAsciiCase("foobar", &r));
CPPUNIT_ASSERT_EQUAL(OString("other"), r);
}
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index d7b5446a7423..215bef0f27f0 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -1109,7 +1109,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
if( rEntity.maNamespaceCount.empty() )
{
rEntity.maNamespaceCount.push(0);
- DefineNamespace( OString("xml"), "http://www.w3.org/XML/1998/namespace");
+ DefineNamespace( "xml", "http://www.w3.org/XML/1998/namespace");
}
else
{
@@ -1176,7 +1176,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
sNamespace = OUString( XML_CAST( namespaces[ i + 1 ] ), strlen( XML_CAST( namespaces[ i + 1 ] )), RTL_TEXTENCODING_UTF8 );
nNamespaceToken = GetNamespaceToken( sNamespace );
if( rEntity.mxNamespaceHandler.is() )
- rEvent.mxDeclAttributes->addUnknown( OString( "" ), OString( XML_CAST( namespaces[ i + 1 ] ) ) );
+ rEvent.mxDeclAttributes->addUnknown( "", OString( XML_CAST( namespaces[ i + 1 ] ) ) );
}
}
diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index fc5828ef3040..23593040291d 100644
--- a/sc/source/filter/excel/xepage.cxx
+++ b/sc/source/filter/excel/xepage.cxx
@@ -96,8 +96,8 @@ void XclExpSetup::SaveXml( XclExpXmlStream& rStrm )
}
else
{
- pAttrList->add( XML_paperWidth, OString::number( mrData.mnPaperWidth ).concat(OString("mm")).getStr() );
- pAttrList->add( XML_paperHeight, OString::number( mrData.mnPaperHeight ).concat(OString("mm")).getStr() );
+ pAttrList->add( XML_paperWidth, OString::number( mrData.mnPaperWidth ).concat("mm").getStr() );
+ pAttrList->add( XML_paperHeight, OString::number( mrData.mnPaperHeight ).concat("mm").getStr() );
// pAttrList->add( XML_paperUnits, "mm" );
}
pAttrList->add( XML_scale, OString::number( mrData.mnScaling ).getStr() );
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 16216b02affd..88d65fa9fc9e 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -647,7 +647,7 @@ void VmlCommentExporter::Commit( EscherPropertyContainer& rProps, const tools::R
sal_Int32 VmlCommentExporter::StartShape()
{
- AddShapeAttribute( XML_type, OString( "#_x0000_t202") );
+ AddShapeAttribute( XML_type, "#_x0000_t202" );
sal_Int32 nId = VMLExport::StartShape();
diff --git a/sdext/source/pdfimport/test/pdfunzip.cxx b/sdext/source/pdfimport/test/pdfunzip.cxx
index 3e5a452dee13..17807af628d6 100644
--- a/sdext/source/pdfimport/test/pdfunzip.cxx
+++ b/sdext/source/pdfimport/test/pdfunzip.cxx
@@ -508,7 +508,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
{
if( aFile.getLength() > 4 )
{
- if( aFile.matchIgnoreAsciiCase( OString( ".pdf" ), aFile.getLength()-4 ) )
+ if( aFile.matchIgnoreAsciiCase( ".pdf", aFile.getLength()-4 ) )
aOutFile.append( pInFile, aFile.getLength() - 4 );
else
aOutFile.append( aFile );
diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
index 5a0193e71928..10a5283e3b9c 100644
--- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx
+++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
@@ -23,6 +23,7 @@
#include <rtl/math.hxx>
#include <sal/log.hxx>
+#include <utility>
#include <vcl/metaact.hxx>
#include <vcl/gdimtf.hxx>
#include <basegfx/numeric/ftools.hxx>
@@ -73,7 +74,7 @@ namespace slideshow
MetaCommentAction* pAct = static_cast<MetaCommentAction*>(pCurrAct);
// skip comment if not a special XTEXT... comment
- if( pAct->GetComment().matchIgnoreAsciiCase( OString("XTEXT") ) )
+ if( pAct->GetComment().matchIgnoreAsciiCase( "XTEXT" ) )
{
// fill classification vector with NOOPs,
// then insert corresponding classes at
@@ -261,9 +262,9 @@ namespace slideshow
}
DrawShapeSubsetting::DrawShapeSubsetting( const DocTreeNode& rShapeSubset,
- const GDIMetaFileSharedPtr& rMtf ) :
+ GDIMetaFileSharedPtr rMtf ) :
maActionClassVector(),
- mpMtf( rMtf ),
+ mpMtf(std::move( rMtf )),
maSubset( rShapeSubset ),
maSubsetShapes(),
maCurrentSubsets(),
diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.hxx b/slideshow/source/engine/shapes/drawshapesubsetting.hxx
index 68e541bf7fb1..ff32a4a653cf 100644
--- a/slideshow/source/engine/shapes/drawshapesubsetting.hxx
+++ b/slideshow/source/engine/shapes/drawshapesubsetting.hxx
@@ -59,7 +59,7 @@ namespace slideshow
generated with verbose text comments switched on).
*/
DrawShapeSubsetting( const DocTreeNode& rShapeSubset,
- const ::std::shared_ptr< GDIMetaFile >& rMtf );
+ ::std::shared_ptr< GDIMetaFile > rMtf );
/// Forbid copy construction
DrawShapeSubsetting(const DrawShapeSubsetting&) = delete;
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx
index 3bce67733f1e..aa30ac3feaff 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -409,7 +409,7 @@ bool getRectanglesFromScrollMtf( ::basegfx::B2DRectangle& o_rScrollRect,
MetaCommentAction * pAct =
static_cast<MetaCommentAction *>(pCurrAct);
// skip comment if not a special XTEXT... comment
- if( pAct->GetComment().matchIgnoreAsciiCase( OString("XTEXT") ) )
+ if( pAct->GetComment().matchIgnoreAsciiCase( "XTEXT" ) )
{
if (pAct->GetComment().equalsIgnoreAsciiCase("XTEXT_SCROLLRECT"))
{
diff --git a/sw/qa/extras/txtexport/txtexport.cxx b/sw/qa/extras/txtexport/txtexport.cxx
index f57c927752eb..d7759ba12ee0 100644
--- a/sw/qa/extras/txtexport/txtexport.cxx
+++ b/sw/qa/extras/txtexport/txtexport.cxx
@@ -119,7 +119,7 @@ DECLARE_TXTIMPORT_TEST(testTdf112191, "bullets.odt")
bool bSuccess = sw::XTextRangeToSwPaM(aPaM, xPara);
CPPUNIT_ASSERT(bSuccess);
- assertExportedRange(OString("First bullet"), aPaM);
+ assertExportedRange("First bullet", aPaM);
// but when we extend to the next paragraph - now there are bullets
xPara = getParagraph(6);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 01b1aa4b0319..072c42c9478f 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -133,6 +133,7 @@
#include <txtatr.hxx>
#include <osl/file.hxx>
+#include <utility>
#include <vcl/embeddedfontshelper.hxx>
#include <svtools/miscopt.hxx>
@@ -207,14 +208,14 @@ class FFDataWriterHelper
if ( !rHelp.isEmpty() )
m_pSerializer->singleElementNS( XML_w, XML_helpText,
- FSNS(XML_w, XML_type), OString("text"),
+ FSNS(XML_w, XML_type), "text",
FSNS(XML_w, XML_val),
OUStringToOString( rHelp, RTL_TEXTENCODING_UTF8 ).getStr(),
FSEND );
if ( !rHint.isEmpty() )
m_pSerializer->singleElementNS( XML_w, XML_statusText,
- FSNS(XML_w, XML_type), OString("text"),
+ FSNS(XML_w, XML_type), "text",
FSNS(XML_w, XML_val),
OUStringToOString( rHint, RTL_TEXTENCODING_UTF8 ).getStr(),
FSEND );
@@ -225,7 +226,7 @@ class FFDataWriterHelper
m_pSerializer->endElementNS( XML_w, XML_ffData );
}
public:
- explicit FFDataWriterHelper( const ::sax_fastparser::FSHelperPtr& rSerializer ) : m_pSerializer( rSerializer ){}
+ explicit FFDataWriterHelper( ::sax_fastparser::FSHelperPtr rSerializer ) : m_pSerializer(std::move( rSerializer )){}
void WriteFormCheckbox( const OUString& rName,
const OUString& rEntryMacro,
const OUString& rExitMacro,
@@ -6769,14 +6770,14 @@ void DocxAttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement )
FSNS( XML_w, XML_val ), sIss.getStr(), FSEND );
const SvxFontHeightItem& rItem = m_rExport.GetItem(RES_CHRATR_FONTSIZE);
- if (sIss.isEmpty() || sIss.match(OString("baseline")))
+ if (sIss.isEmpty() || sIss.match("baseline"))
{
long nHeight = rItem.GetHeight();
OString sPos = OString::number( ( nHeight * nEsc + 500 ) / 1000 );
m_pSerializer->singleElementNS( XML_w, XML_position,
FSNS( XML_w, XML_val ), sPos.getStr( ), FSEND );
- if( ( 100 != nProp || sIss.match( OString( "baseline" ) ) ) && !m_rExport.m_bFontSizeWritten )
+ if( ( 100 != nProp || sIss.match( "baseline" ) ) && !m_rExport.m_bFontSizeWritten )
{
OString sSize = OString::number( ( nHeight * nProp + 500 ) / 1000 );
m_pSerializer->singleElementNS( XML_w, XML_sz,
@@ -7782,7 +7783,7 @@ void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop )
if ( nCurrTab == nCount || pInheritedTabs->At(i) < rTabStop[nCurrTab] )
{
m_pSerializer->singleElementNS( XML_w, XML_tab,
- FSNS( XML_w, XML_val ), OString("clear"),
+ FSNS( XML_w, XML_val ), "clear",
FSNS( XML_w, XML_pos ), OString::number(pInheritedTabs->At(i).GetTabPos()),
FSEND );
}
diff --git a/tools/qa/cppunit/test_config.cxx b/tools/qa/cppunit/test_config.cxx
index 4f392a3c7b50..eeb1391ab6b8 100644
--- a/tools/qa/cppunit/test_config.cxx
+++ b/tools/qa/cppunit/test_config.cxx
@@ -56,13 +56,13 @@ public:
{
Config aConfig(maConfigFile);
- aConfig.SetGroup(OString("TestGroup"));
+ aConfig.SetGroup("TestGroup");
CPPUNIT_ASSERT_EQUAL(OString("TestGroup"), aConfig.GetGroup());
// so this is a quirk of Config - you can set the group name,
// but it might not exist so you really should first check if
// it exists via HasGroup()
- aConfig.SetGroup(OString("TestGroupA"));
+ aConfig.SetGroup("TestGroupA");
CPPUNIT_ASSERT(!aConfig.HasGroup("TestGroupA"));
CPPUNIT_ASSERT_EQUAL(OString("TestGroupA"), aConfig.GetGroup());
}
@@ -72,7 +72,7 @@ public:
{
Config aConfig(maConfigFile);
- aConfig.DeleteGroup(OString("TestGroup"));
+ aConfig.DeleteGroup("TestGroup");
CPPUNIT_ASSERT(!aConfig.HasGroup("TestGroup"));
CPPUNIT_ASSERT_EQUAL(OString("TestGroup2"), aConfig.GetGroupName(0));
@@ -86,7 +86,7 @@ public:
Config aConfig(maConfigFile);
CPPUNIT_ASSERT(!aConfig.HasGroup("NonExistentTestGroup"));
- aConfig.DeleteGroup(OString("NonExistentTestGroup"));
+ aConfig.DeleteGroup("NonExistentTestGroup");
CPPUNIT_ASSERT_EQUAL(OString("TestGroup"), aConfig.GetGroupName(0));
sal_uInt16 nActual = aConfig.GetGroupCount();
@@ -106,64 +106,64 @@ public:
void testReadKey()
{
Config aConfig(maConfigFile);
- aConfig.SetGroup(OString("TestGroup"));
+ aConfig.SetGroup("TestGroup");
CPPUNIT_ASSERT_EQUAL(OString("testvalue"), aConfig.ReadKey(OString("testkey")));
CPPUNIT_ASSERT_EQUAL(OString(), aConfig.ReadKey(OString("nonexistenttestkey")));
CPPUNIT_ASSERT_EQUAL(OString("notexists"),
- aConfig.ReadKey(OString("nonexistenttestkey"), OString("notexists")));
+ aConfig.ReadKey("nonexistenttestkey", "notexists"));
- aConfig.SetGroup(OString("TestGroup2"));
+ aConfig.SetGroup("TestGroup2");
CPPUNIT_ASSERT_EQUAL(OString("testvalue"), aConfig.ReadKey(OString("testkey2")));
CPPUNIT_ASSERT_EQUAL(OString(), aConfig.ReadKey(OString("nonexistenttestkey")));
CPPUNIT_ASSERT_EQUAL(OString("notexists"),
- aConfig.ReadKey(OString("nonexistenttestkey"), OString("notexists")));
+ aConfig.ReadKey("nonexistenttestkey", "notexists"));
}
void testGetKeyName()
{
Config aConfig(maConfigFile);
- aConfig.SetGroup(OString("TestGroup"));
+ aConfig.SetGroup("TestGroup");
CPPUNIT_ASSERT_EQUAL(OString("testkey"), aConfig.GetKeyName(0));
- aConfig.SetGroup(OString("TestGroup2"));
+ aConfig.SetGroup("TestGroup2");
CPPUNIT_ASSERT_EQUAL(OString("testkey2"), aConfig.GetKeyName(0));
}
void testWriteDeleteKey()
{
Config aConfig(maConfigFile);
- aConfig.SetGroup(OString("TestGroup"));
- aConfig.WriteKey(OString("testkey_new"), OString("testvalue"));
+ aConfig.SetGroup("TestGroup");
+ aConfig.WriteKey("testkey_new", "testvalue");
sal_uInt16 nExpected = 2;
sal_uInt16 nActual = aConfig.GetKeyCount();
CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
CPPUNIT_ASSERT_EQUAL(OString("testvalue"), aConfig.ReadKey(OString("testkey_new")));
- aConfig.DeleteKey(OString("testkey_new"));
+ aConfig.DeleteKey("testkey_new");
nExpected = 1;
nActual = aConfig.GetKeyCount();
CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
CPPUNIT_ASSERT_EQUAL(OString(), aConfig.ReadKey(OString("testkey_new")));
- aConfig.SetGroup(OString("TestGroup2"));
- aConfig.WriteKey(OString("testkey_new"), OString("testvalue"));
+ aConfig.SetGroup("TestGroup2");
+ aConfig.WriteKey("testkey_new", "testvalue");
nActual = aConfig.GetKeyCount();
nExpected = 2;
CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
CPPUNIT_ASSERT_EQUAL(OString("testvalue"), aConfig.ReadKey(OString("testkey_new")));
- aConfig.DeleteKey(OString("testkey_new"));
+ aConfig.DeleteKey("testkey_new");
nActual = aConfig.GetKeyCount();
nExpected = 1;
CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
CPPUNIT_ASSERT_EQUAL(OString(), aConfig.ReadKey(OString("testkey_new")));
- aConfig.SetGroup(OString("TestGroup3"));
- aConfig.WriteKey(OString("testkey_new_group3"), OString("testvalue"));
+ aConfig.SetGroup("TestGroup3");
+ aConfig.WriteKey("testkey_new_group3", "testvalue");
nActual = aConfig.GetKeyCount();
nExpected = 1;
diff --git a/vcl/unx/generic/print/common_gfx.cxx b/vcl/unx/generic/print/common_gfx.cxx
index 85984e835736..586b59693fc6 100644
--- a/vcl/unx/generic/print/common_gfx.cxx
+++ b/vcl/unx/generic/print/common_gfx.cxx
@@ -1078,7 +1078,7 @@ PrinterGfx::DrawEPS( const tools::Rectangle& rBoundingBox, void* pPtr, sal_uInt3
char cChar = aLine[1];
if( cChar == '%' )
{
- if( aLine.matchIgnoreAsciiCase( OString( "%%BoundingBox:") ) )
+ if( aLine.matchIgnoreAsciiCase( "%%BoundingBox:" ) )
{
aLine = WhitespaceToSpace( aLine.getToken(1, ':') );
if( !aLine.isEmpty() && aLine.indexOf( "atend" ) == -1 )
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index 376da8fcf51f..69080676102f 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -254,7 +254,7 @@ static bool passFileToCommandLine( const OUString& rFilename, const OUString& rC
// setup command line for exec
if( ! bPipe )
- aCmdLine = aCmdLine.replaceAll(OString("(TMP)"), aFilename);
+ aCmdLine = aCmdLine.replaceAll("(TMP)", aFilename);
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "%s commandline: \"%s\"\n",
diff --git a/vcl/unx/generic/printer/cpdmgr.cxx b/vcl/unx/generic/printer/cpdmgr.cxx
index aedcd5b42543..c79ed672db60 100644
--- a/vcl/unx/generic/printer/cpdmgr.cxx
+++ b/vcl/unx/generic/printer/cpdmgr.cxx
@@ -625,19 +625,19 @@ void CPDManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner,
if (!sPayLoad.isEmpty()) {
OString aKey = OUStringToOString( pKey->getKey(), RTL_TEXTENCODING_ASCII_US );
OString aValue = OUStringToOString( sPayLoad, RTL_TEXTENCODING_ASCII_US );
- if (aKey.equals(OString("Duplex"))) {
+ if (aKey.equals("Duplex")) {
aKey = OString("sides");
- } else if (aKey.equals(OString("Resolution"))) {
+ } else if (aKey.equals("Resolution")) {
aKey = OString("printer-resolution");
- } else if (aKey.equals(OString("PageSize"))) {
+ } else if (aKey.equals("PageSize")) {
aKey = OString("media");
}
- if (aKey.equals(OString("sides"))) {
- if (aValue.equals(OString("None"))) {
+ if (aKey.equals("sides")) {
+ if (aValue.equals("None")) {
aValue = OString("one-sided");
- } else if (aValue.equals(OString("DuplexNoTumble"))) {
+ } else if (aValue.equals("DuplexNoTumble")) {
aValue = OString("two-sided-long-edge");
- } else if (aValue.equals(OString("DuplexTumble"))) {
+ } else if (aValue.equals("DuplexTumble")) {
aValue = OString("two-sided-short-edge");
}
}
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 28772c99db13..76de4fef3e14 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -118,7 +118,7 @@ bool JobData::getStreamBuffer( void*& pData, sal_uInt32& bytes )
SvMemoryStream aStream;
// write header job data
- aStream.WriteLine(OString("JobData 1"));
+ aStream.WriteLine("JobData 1");
OStringBuffer aLine;
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 7789459c200c..125d0c29aba4 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -710,7 +710,7 @@ PPDParser::PPDParser( const OUString& rFile ) :
OString aCurLine = aStream.ReadLine();
if( aCurLine.startsWith("*") )
{
- if (aCurLine.matchIgnoreAsciiCase(OString("*include:")))
+ if (aCurLine.matchIgnoreAsciiCase("*include:"))
{
aCurLine = aCurLine.copy(9);
aCurLine = comphelper::string::stripStart(aCurLine, ' ');
@@ -726,7 +726,7 @@ PPDParser::PPDParser( const OUString& rFile ) :
continue;
}
else if( ! bLanguageEncoding &&
- aCurLine.matchIgnoreAsciiCase(OString("*languageencoding")) )
+ aCurLine.matchIgnoreAsciiCase("*languageencoding") )
{
bLanguageEncoding = true; // generally only the first one counts
OString aLower = aCurLine.toAsciiLowerCase();
More information about the Libreoffice-commits
mailing list