diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-11 11:09:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-11 17:18:51 +0200 |
commit | 38640d7cb4dd6c19cd9f0c944536dfc1ccec1bf8 (patch) | |
tree | 221a7b8fa6aa53b6d69414f821ea128997fa301d /sw | |
parent | 8ac1dd864bc535a25caa91c44e7d94b8b8ab9024 (diff) |
use more string_view in filter
Change-Id: Icbccd81fd0fa18fc15a32aa2729b1c5f9a3ee542
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150220
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.hxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.hxx | 6 |
5 files changed, 17 insertions, 17 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index ce6e28e26407..70e5156644e3 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2703,7 +2703,7 @@ void DocxAttributeOutput::DoWriteCmd( std::u16string_view rCmd ) std::u16string_view sCmd = o3tl::trim(rCmd); if (o3tl::starts_with(sCmd, u"SEQ")) { - OUString sSeqName( o3tl::trim(msfilter::util::findQuotedText(sCmd, "SEQ ", '\\')) ); + OUString sSeqName( o3tl::trim(msfilter::util::findQuotedText(sCmd, u"SEQ ", '\\')) ); m_aSeqBookmarksNames[sSeqName].push_back(m_sLastOpenedBookmark); } // Write the Field command diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index f5134d4da2e2..53ba6418a904 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1706,10 +1706,10 @@ void RtfAttributeOutput::NumberingLevel(sal_uInt8 nLevel, sal_uInt16 nStart, } void RtfAttributeOutput::WriteField_Impl(const SwField* const pField, ww::eField /*eType*/, - const OUString& rFieldCmd, FieldFlags nMode) + std::u16string_view rFieldCmd, FieldFlags nMode) { // If there are no field instructions, don't export it as a field. - bool bHasInstructions = !rFieldCmd.isEmpty(); + bool bHasInstructions = !rFieldCmd.empty(); if (FieldFlags::All == nMode) { if (bHasInstructions) @@ -3959,7 +3959,7 @@ MSWordExportBase& RtfAttributeOutput::GetExport() { return m_rExport; } // These are used by wwFont::WriteRtf() /// Start the font. -void RtfAttributeOutput::StartFont(const OUString& rFamilyName) const +void RtfAttributeOutput::StartFont(std::u16string_view rFamilyName) const { // write the font name hex-encoded, but without Unicode - Word at least // cannot read *both* Unicode and fallback as written by OutString @@ -3975,7 +3975,7 @@ void RtfAttributeOutput::EndFont() const } /// Alternate name for the font. -void RtfAttributeOutput::FontAlternateName(const OUString& rName) const +void RtfAttributeOutput::FontAlternateName(std::u16string_view rName) const { m_rExport.Strm() .WriteChar('{') @@ -4047,7 +4047,7 @@ void RtfAttributeOutput::FontPitchType(FontPitch ePitch) const m_rExport.Strm().WriteNumberAsString(nVal); } -static void lcl_AppendSP(OStringBuffer& rBuffer, const char cName[], const OUString& rValue, +static void lcl_AppendSP(OStringBuffer& rBuffer, std::string_view cName, std::u16string_view rValue, const RtfExport& rExport) { rBuffer.append("{" OOO_STRING_SVTOOLS_RTF_SP "{"); // "{\sp{" @@ -4088,7 +4088,7 @@ static OString ExportPICT(const SwFlyFrameFormat* pFlyFrameFormat, const Size& r MirrorGraph eMirror = pAttrSet->Get(RES_GRFATR_MIRRORGRF).GetValue(); if (eMirror == MirrorGraph::Vertical || eMirror == MirrorGraph::Both) // Mirror on the vertical axis is a horizontal flip. - lcl_AppendSP(aRet, "fFlipH", "1", rExport); + lcl_AppendSP(aRet, "fFlipH", u"1", rExport); } aRet.append("}"); //"}" diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 985df695b2d9..fdd5ed09d3bc 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -226,7 +226,7 @@ public: const OUString& rNumberingString, const SvxBrushItem* pBrush) override; //For i120928,to export graphic of bullet - void WriteField_Impl(const SwField* pField, ww::eField eType, const OUString& rFieldCmd, + void WriteField_Impl(const SwField* pField, ww::eField eType, std::u16string_view rFieldCmd, FieldFlags nMode); void WriteBookmarks_Impl(std::vector<OUString>& rStarts, std::vector<OUString>& rEnds); void WriteAnnotationMarks_Impl(std::vector<OUString>& rStarts, std::vector<OUString>& rEnds); @@ -663,13 +663,13 @@ public: // These are used by wwFont::WriteRtf() /// Start the font. - void StartFont(const OUString& rFamilyName) const; + void StartFont(std::u16string_view rFamilyName) const; /// End the font. void EndFont() const; /// Alternate name for the font. - void FontAlternateName(const OUString& rName) const; + void FontAlternateName(std::u16string_view rName) const; /// Font charset. void FontCharset(sal_uInt8 nCharSet) const; diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index b59012b857d7..ccde1138c76c 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -575,7 +575,7 @@ void RtfExport::WriteUserPropType(int nType) Strm().WriteOString(OOO_STRING_SVTOOLS_RTF_PROPTYPE).WriteNumberAsString(nType); } -void RtfExport::WriteUserPropValue(const OUString& rValue) +void RtfExport::WriteUserPropValue(std::u16string_view rValue) { Strm().WriteOString("{" OOO_STRING_SVTOOLS_RTF_STATICVAL " "); Strm().WriteOString(msfilter::rtfutil::OutString(rValue, m_eDefaultEncoding)); @@ -1182,9 +1182,9 @@ OString RtfExport::getStream() void RtfExport::resetStream() { m_pStream.reset(); } -void RtfExport::OutUnicode(const char* pToken, const OUString& rContent, bool bUpr) +void RtfExport::OutUnicode(std::string_view pToken, std::u16string_view rContent, bool bUpr) { - if (rContent.isEmpty()) + if (rContent.empty()) return; if (!bUpr) @@ -1197,7 +1197,7 @@ void RtfExport::OutUnicode(const char* pToken, const OUString& rContent, bool bU Strm().WriteOString(msfilter::rtfutil::OutStringUpr(pToken, rContent, m_eCurrentEncoding)); } -void RtfExport::OutDateTime(const char* pStr, const util::DateTime& rDT) +void RtfExport::OutDateTime(std::string_view pStr, const util::DateTime& rDT) { Strm().WriteChar('{').WriteOString(pStr).WriteOString(OOO_STRING_SVTOOLS_RTF_YR); Strm().WriteNumberAsString(rDT.Year).WriteOString(OOO_STRING_SVTOOLS_RTF_MO); diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index ff6ae87bd072..6098ad912e66 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -186,8 +186,8 @@ public: OString getStream(); /// Return back to the real stream. void resetStream(); - void OutUnicode(const char* pToken, const OUString& rContent, bool bUpr = false); - void OutDateTime(const char* pStr, const css::util::DateTime& rDT); + void OutUnicode(std::string_view pToken, std::u16string_view rContent, bool bUpr = false); + void OutDateTime(std::string_view pStr, const css::util::DateTime& rDT); void OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirstPage); sal_uInt16 GetColor(const Color& rColor) const; @@ -211,7 +211,7 @@ private: /// Writes a single user property type. void WriteUserPropType(int nType); /// Writes a single user property value. - void WriteUserPropValue(const OUString& rValue); + void WriteUserPropValue(std::u16string_view rValue); /// Writes the userprops group: user defined document properties. void WriteUserProps(); /// Writes document variables |