From 096ac57b24a49aca63d6542bc5f2b7bf9efefc17 Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Tue, 15 Dec 2020 19:25:11 +0700 Subject: [PATCH] improve RichString --- QXlsx/header/xlsxrichstring.h | 2 +- QXlsx/source/xlsxrichstring.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/QXlsx/header/xlsxrichstring.h b/QXlsx/header/xlsxrichstring.h index ff7442c..232b6ed 100644 --- a/QXlsx/header/xlsxrichstring.h +++ b/QXlsx/header/xlsxrichstring.h @@ -41,7 +41,7 @@ class RichString { public: RichString(); - explicit RichString(const QString text); + explicit RichString(const QString& text); RichString(const RichString &other); ~RichString(); diff --git a/QXlsx/source/xlsxrichstring.cpp b/QXlsx/source/xlsxrichstring.cpp index 483aebb..9fbf4f0 100644 --- a/QXlsx/source/xlsxrichstring.cpp +++ b/QXlsx/source/xlsxrichstring.cpp @@ -47,7 +47,7 @@ RichString::RichString() /*! Constructs a plain string with the given \a text. */ -RichString::RichString(const QString text) +RichString::RichString(const QString& text) :d(new RichStringPrivate) { addFragment(text, Format()); @@ -116,7 +116,7 @@ bool RichString::isNull() const */ bool RichString::isEmtpy() const { - for (const QString &str : d->fragmentTexts) { + for (const auto& str : d->fragmentTexts) { if (!str.isEmpty()) return false; }