From f712c531336b2c44636a35ad682913550640e0d3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 21 Apr 2023 10:12:53 +0200 Subject: loplugin:unnecessarygetstr extend to checking std::string::c_str Change-Id: I17398e2a6a31a2c98ba8e54b5c8045f22aee8759 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150749 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sfx2/source/doc/autoredactdialog.cxx | 10 +++++----- sfx2/source/doc/sfxbasemodel.cxx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/doc/autoredactdialog.cxx b/sfx2/source/doc/autoredactdialog.cxx index 5e61849c079a..f84af9622f95 100644 --- a/sfx2/source/doc/autoredactdialog.cxx +++ b/sfx2/source/doc/autoredactdialog.cxx @@ -367,14 +367,14 @@ boost::property_tree::ptree redactionTargetToJSON(const RedactionTarget* pTarget std::unique_ptr JSONtoRedactionTarget(const boost::property_tree::ptree::value_type& rValue) { - OUString sName = OUString::fromUtf8(rValue.second.get("sName").c_str()); + OUString sName = OUString::fromUtf8(rValue.second.get("sName")); RedactionTargetType eType = static_cast(atoi(rValue.second.get("eType").c_str())); - OUString sContent = OUString::fromUtf8(rValue.second.get("sContent").c_str()); + OUString sContent = OUString::fromUtf8(rValue.second.get("sContent")); bool bCaseSensitive - = OUString::fromUtf8(rValue.second.get("bCaseSensitive").c_str()).toBoolean(); + = OUString::fromUtf8(rValue.second.get("bCaseSensitive")).toBoolean(); bool bWholeWords - = OUString::fromUtf8(rValue.second.get("bWholeWords").c_str()).toBoolean(); + = OUString::fromUtf8(rValue.second.get("bWholeWords")).toBoolean(); sal_uInt32 nID = atoi(rValue.second.get("nID").c_str()); return std::unique_ptr( @@ -607,7 +607,7 @@ SfxAutoRedactDialog::~SfxAutoRedactDialog() boost::property_tree::write_json(aStream, aTargetsTree, false); - OUString sUserDataStr(OUString::fromUtf8(aStream.str().c_str())); + OUString sUserDataStr(OUString::fromUtf8(aStream.str())); // Store the dialog data SvtViewOptions aDlgOpt(EViewType::Dialog, m_xDialog->get_help_id()); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 73f0a3137d7e..8ff60d41ff90 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3217,7 +3217,7 @@ void SfxBaseModel::impl_store( const OUString& sURL std::stringstream aErrCode; aErrCode << nErrCode; throw task::ErrorCodeIOException( - "SfxBaseModel::impl_store <" + sURL + "> failed: " + OUString::fromUtf8(aErrCode.str().c_str()), + "SfxBaseModel::impl_store <" + sURL + "> failed: " + OUString::fromUtf8(aErrCode.str()), Reference< XInterface >(), sal_uInt32(nErrCode)); } } -- cgit