diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-10-19 16:39:09 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-10-23 11:04:42 +0200 |
commit | bd6fb0cd3eee3c7d414e55a7678c0097aadc7646 (patch) | |
tree | 5f754d7e485ab31dd4e04782b8eccd50d854d91e /sw/source | |
parent | 3501c52176d1122d9de08462435f633cd21de370 (diff) |
Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]String
...in include files. This is a mix of automatic rewriting in include files and
manual fixups (mostly addressing loplugin:redundantfcast) in source files that
include those.
Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/access/acccontext.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/bookmark.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/porrst.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8glsy.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.hxx | 16 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8struc.hxx | 8 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmoutputtypepage.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/inc/bookmark.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/misc/redlndlg.cxx | 20 |
13 files changed, 37 insertions, 37 deletions
diff --git a/sw/source/core/access/acccontext.hxx b/sw/source/core/access/acccontext.hxx index d64939089622..790b7c4911f7 100644 --- a/sw/source/core/access/acccontext.hxx +++ b/sw/source/core/access/acccontext.hxx @@ -39,7 +39,7 @@ namespace accessibility { class AccessibleShape; } -inline constexpr OUStringLiteral sAccessibleServiceName = u"com.sun.star.accessibility.Accessible"; +inline constexpr OUString sAccessibleServiceName = u"com.sun.star.accessibility.Accessible"_ustr; class SwAccessibleContext : public ::cppu::WeakImplHelper< diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx index 7e792f805b8e..5b27a5b558ec 100644 --- a/sw/source/core/crsr/bookmark.cxx +++ b/sw/source/core/crsr/bookmark.cxx @@ -594,7 +594,7 @@ namespace sw::mark return; OUString fieldCommand; - (*GetParameters())[OUString(ODF_CODE_PARAM)] >>= fieldCommand; + (*GetParameters())[ODF_CODE_PARAM] >>= fieldCommand; tools::JsonWriter aJson; aJson.put("commandName", ".uno:DeleteTextFormField"); aJson.put("success", true); @@ -715,7 +715,7 @@ namespace sw::mark { if ( IsChecked() != checked ) { - (*GetParameters())[OUString(ODF_FORMCHECKBOX_RESULT)] <<= checked; + (*GetParameters())[ODF_FORMCHECKBOX_RESULT] <<= checked; // mark document as modified SwDoc& rDoc( GetMarkPos().GetDoc() ); rDoc.getIDocumentState().SetModified(); @@ -725,7 +725,7 @@ namespace sw::mark bool CheckboxFieldmark::IsChecked() const { bool bResult = false; - parameter_map_t::const_iterator pResult = GetParameters()->find(OUString(ODF_FORMCHECKBOX_RESULT)); + parameter_map_t::const_iterator pResult = GetParameters()->find(ODF_FORMCHECKBOX_RESULT); if(pResult != GetParameters()->end()) pResult->second >>= bResult; return bResult; diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 14d5d842e604..c3e718871189 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -1143,7 +1143,7 @@ namespace sw::mark { if(pResult != pParameters->end()) pResult->second >>= nCurrentIdx; - const IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(OUString(ODF_FORMDROPDOWN_LISTENTRY)); + const IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(ODF_FORMDROPDOWN_LISTENTRY); if (pListEntries != pParameters->end()) { uno::Sequence< OUString > vListEntries; diff --git a/sw/source/core/text/porrst.hxx b/sw/source/core/text/porrst.hxx index 5f6f3fca370a..c5e57c688af1 100644 --- a/sw/source/core/text/porrst.hxx +++ b/sw/source/core/text/porrst.hxx @@ -81,7 +81,7 @@ public: void dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText, TextFrameIndex& nOffset) const override; - static constexpr OUStringLiteral S_NOBREAK_FOR_REDLINE = u"\u00A0"; + static constexpr OUString S_NOBREAK_FOR_REDLINE = u"\u00A0"_ustr; void SetRedline( const RedlineType eRedline ) { m_eRedline = eRedline; } SwLineBreakClear GetClear() const; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 7e31c40af268..06f96f23d24f 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -703,14 +703,14 @@ void WW8Export::ExportDopTypography(WW8DopTypography &rTypo) !lcl_CmpBeginEndChars ( pForbidden->endLine, - OUString(WW8DopTypography::JapanNotEndLevel1).getStr(), + WW8DopTypography::JapanNotEndLevel1.getStr(), WW8DopTypography::nMaxLeading * sizeof(sal_Unicode) ) && !lcl_CmpBeginEndChars ( pForbidden->beginLine, - OUString(WW8DopTypography::JapanNotBeginLevel1).getStr(), + WW8DopTypography::JapanNotBeginLevel1.getStr(), WW8DopTypography::nMaxFollowing * sizeof(sal_Unicode) ) ) diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index 7e5d3ddd70e8..838102e68cc0 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -45,7 +45,7 @@ WW8Glossary::WW8Glossary(tools::SvRef<SotStorageStream> &refStrm, sal_uInt8 nVer if (aWwFib.m_nFibBack >= 0x6A) //Word97 { m_xTableStream = pStg->OpenSotStream( - aWwFib.m_fWhichTableStm ? OUString(SL::a1Table) : OUString(SL::a0Table), + aWwFib.m_fWhichTableStm ? SL::a1Table : SL::a0Table, StreamMode::STD_READ); if (m_xTableStream.is() && ERRCODE_NONE == m_xTableStream->GetError()) diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index c6c4563dd8cd..d2b2968608e8 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4998,7 +4998,7 @@ void SwWW8ImplReader::ReadGlobalTemplateSettings( std::u16string_view sCreatedFr refMainStream->SetEndian(SvStreamEndian::LITTLE); WW8Fib aWwFib( *refMainStream, 8 ); tools::SvRef<SotStorageStream> xTableStream = - rRoot->OpenSotStream(aWwFib.m_fWhichTableStm ? OUString(SL::a1Table) : OUString(SL::a0Table), StreamMode::STD_READ); + rRoot->OpenSotStream(aWwFib.m_fWhichTableStm ? SL::a1Table : SL::a0Table, StreamMode::STD_READ); if (xTableStream.is() && ERRCODE_NONE == xTableStream->GetError()) { @@ -5529,7 +5529,7 @@ ErrCode SwWW8ImplReader::SetSubStreams(tools::SvRef<SotStorageStream> &rTableStr } rTableStream = m_pStg->OpenSotStream( - m_xWwFib->m_fWhichTableStm ? OUString(SL::a1Table) : OUString(SL::a0Table), + m_xWwFib->m_fWhichTableStm ? SL::a1Table : SL::a0Table, StreamMode::STD_READ); m_pTableStream = rTableStream.get(); diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index f3bf7792b3bb..d69a822554f5 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -42,14 +42,14 @@ class SvStream; //Commonly used string literals for stream and storage names in word docs namespace SL { - inline constexpr OUStringLiteral aObjectPool = u"ObjectPool"; - inline constexpr OUStringLiteral a1Table = u"1Table"; - inline constexpr OUStringLiteral a0Table = u"0Table"; - inline constexpr OUStringLiteral aData = u"Data"; - inline constexpr OUStringLiteral aCheckBox = u"CheckBox"; - inline constexpr OUStringLiteral aListBox = u"ListBox"; - inline constexpr OUStringLiteral aTextField = u"TextField"; - inline constexpr OUStringLiteral aMSMacroCmds = u"MSMacroCmds"; + inline constexpr OUString aObjectPool = u"ObjectPool"_ustr; + inline constexpr OUString a1Table = u"1Table"_ustr; + inline constexpr OUString a0Table = u"0Table"_ustr; + inline constexpr OUString aData = u"Data"_ustr; + inline constexpr OUString aCheckBox = u"CheckBox"_ustr; + inline constexpr OUString aListBox = u"ListBox"_ustr; + inline constexpr OUString aTextField = u"TextField"_ustr; + inline constexpr OUString aMSMacroCmds = u"MSMacroCmds"_ustr; } struct SprmInfo diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx index 2802c383056d..a1a22d7a0501 100644 --- a/sw/source/filter/ww8/ww8struc.hxx +++ b/sw/source/filter/ww8/ww8struc.hxx @@ -394,18 +394,18 @@ public: //full document, might not matter all that much though ? enum RuleLengths {nMaxFollowing = 101, nMaxLeading = 51}; - static constexpr OUStringLiteral JapanNotBeginLevel1 + static constexpr OUString JapanNotBeginLevel1 = u"\u0021\u0025\u0029\u002c\u002e\u003a\u003b\u003f" "\u005d\u007d\u00a2\u00b0\u2019\u201d\u2030\u2032" "\u2033\u2103\u3001\u3002\u3005\u3009\u300b\u300d" "\u300f\u3011\u3015\u309b\u309c\u309d\u309e\u30fb" "\u30fd\u30fe\uff01\uff05\uff09\uff0c\uff0e\uff1a" "\uff1b\uff1f\uff3d\uff5d\uff61\uff63\uff64\uff65" - "\uff9e\uff9f\uffe0"; - static constexpr OUStringLiteral JapanNotEndLevel1 + "\uff9e\uff9f\uffe0"_ustr; + static constexpr OUString JapanNotEndLevel1 = u"\u0024\u0028\u005b\u005c\u007b\u00a3\u00a5\u2018" "\u201c\u3008\u300a\u300c\u300e\u3010\u3014\uff04" - "\uff08\uff3b\uff5b\uff62\uffe1\uffe5"; + "\uff08\uff3b\uff5b\uff62\uffe1\uffe5"_ustr; sal_Int16 m_cchFollowingPunct; // length of rgxchFPunct sal_Int16 m_cchLeadingPunct; // length of rgxchLPunct diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index c139bb0943c1..0110c0e5d0f8 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -475,7 +475,7 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> const & Application::PostUserEvent( LINK( this, SwSendMailDialog, StopSendMails ), this ); } - OUString sInsertImg(bResult ? OUString(RID_BMP_FORMULA_APPLY) : OUString(RID_BMP_FORMULA_CANCEL)); + OUString sInsertImg(bResult ? RID_BMP_FORMULA_APPLY : RID_BMP_FORMULA_CANCEL); OUString sMessage = m_sSendingTo; m_xStatus->append(); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 85bb57abba7c..f0318a4cafe3 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -70,8 +70,8 @@ namespace { OUString BuildBitmap(bool bProtect, bool bHidden) { if (bProtect) - return bHidden ? OUString(RID_BMP_PROT_HIDE) : OUString(RID_BMP_PROT_NO_HIDE); - return bHidden ? OUString(RID_BMP_HIDE) : OUString(RID_BMP_NO_HIDE); + return bHidden ? RID_BMP_PROT_HIDE : RID_BMP_PROT_NO_HIDE; + return bHidden ? RID_BMP_HIDE : RID_BMP_NO_HIDE; } OUString CollapseWhiteSpaces(std::u16string_view sName) diff --git a/sw/source/uibase/inc/bookmark.hxx b/sw/source/uibase/inc/bookmark.hxx index 4e2582432673..8017e146d756 100644 --- a/sw/source/uibase/inc/bookmark.hxx +++ b/sw/source/uibase/inc/bookmark.hxx @@ -61,7 +61,7 @@ public: int get_sort_column() const { return m_xControl->get_sort_column(); } void set_sort_column(int nColumn) { m_xControl->set_sort_column(nColumn); } - static constexpr OUStringLiteral aForbiddenChars = u"/\\@*?\",#"; + static constexpr OUString aForbiddenChars = u"/\\@*?\",#"_ustr; static const char s_cSeparator; }; diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 0f4b43006ea2..b68bacbbef5c 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -320,22 +320,22 @@ OUString SwRedlineAcceptDlg::GetActionImage(const SwRangeRedline& rRedln, sal_uI { case RedlineType::Insert: return bTableChanges ? bRowChanges - ? OUString(BMP_REDLINE_ROW_INSERTION) - : OUString(BMP_REDLINE_COL_INSERTION) + ? BMP_REDLINE_ROW_INSERTION + : BMP_REDLINE_COL_INSERTION : rRedln.IsMoved() - ? OUString(BMP_REDLINE_MOVED_INSERTION) + ? BMP_REDLINE_MOVED_INSERTION : rRedln.IsAnnotation() - ? OUString(BMP_REDLINE_COMMENT_INSERTION) - : OUString(BMP_REDLINE_INSERTED); + ? BMP_REDLINE_COMMENT_INSERTION + : BMP_REDLINE_INSERTED; case RedlineType::Delete: return bTableChanges ? bRowChanges - ? OUString(BMP_REDLINE_ROW_DELETION) - : OUString(BMP_REDLINE_COL_DELETION) + ? BMP_REDLINE_ROW_DELETION + : BMP_REDLINE_COL_DELETION : rRedln.IsMoved() - ? OUString(BMP_REDLINE_MOVED_DELETION) + ? BMP_REDLINE_MOVED_DELETION : rRedln.IsAnnotation() - ? OUString(BMP_REDLINE_COMMENT_DELETION) - : OUString(BMP_REDLINE_DELETED); + ? BMP_REDLINE_COMMENT_DELETION + : BMP_REDLINE_DELETED; case RedlineType::Format: return BMP_REDLINE_FORMATTED; case RedlineType::ParagraphFormat: return BMP_REDLINE_FORMATTED; case RedlineType::Table: return BMP_REDLINE_TABLECHG; |