diff options
37 files changed, 182 insertions, 182 deletions
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index 28a85da55b6f..ea93303e41c8 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -471,7 +471,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) // old readers will not read this data after having read legacy data, and will proceed // straight to the end of the record. So no version restriction here. r.WriteUInt32(nUnicodeDataMagicNumber); - write_uInt16s_FromOUString(r, OUString(pStrings.get(), nStringSize)); + write_uInt16s_FromOUString(r, std::u16string_view(pStrings.get(), nStringSize)); SbiCloseRecord( r, nPos ); } diff --git a/idl/inc/object.hxx b/idl/inc/object.hxx index 822e562c26e1..6beb837688c2 100644 --- a/idl/inc/object.hxx +++ b/idl/inc/object.hxx @@ -57,14 +57,14 @@ public: SvMetaAttribute & rAttr ) const; private: - static void WriteSlotStubs( const OString& rShellName, + static void WriteSlotStubs( std::string_view rShellName, SvSlotElementList & rSlotList, std::vector<OString> & rList, SvStream & rOutStm ); static sal_uInt16 WriteSlotParamArray( SvIdlDataBase & rBase, SvSlotElementList & rSlotList, SvStream & rOutStm ); - static sal_uInt16 WriteSlots( const OString& rShellName, + static sal_uInt16 WriteSlots( std::string_view rShellName, SvSlotElementList & rSlotList, SvIdlDataBase & rBase, SvStream & rOutStm ); diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx index 16c273e3efea..1b8eec2ab66a 100644 --- a/idl/inc/slot.hxx +++ b/idl/inc/slot.hxx @@ -50,8 +50,8 @@ public: sal_uLong nListPos; SvBOOL aReadOnlyDoc; - void WriteSlot( const OString& rShellName, - sal_uInt16 nCount, const OString& rSlotId, + void WriteSlot( std::string_view rShellName, + sal_uInt16 nCount, std::string_view rSlotId, SvSlotElementList &rList, size_t nStart, SvIdlDataBase & rBase, SvStream & rOutStm ); @@ -115,10 +115,10 @@ public: SvTokenStream & rInStm ) override; virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; virtual void Insert( SvSlotElementList& ) override; - void WriteSlotStubs( const OString& rShellName, + void WriteSlotStubs( std::string_view rShellName, std::vector<OString> & rList, SvStream & rOutStm ) const; - sal_uInt16 WriteSlotMap( const OString& rShellName, + sal_uInt16 WriteSlotMap( std::string_view rShellName, sal_uInt16 nCount, SvSlotElementList&, size_t nStart, diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx index 298e863c6663..1648efc3d56a 100644 --- a/idl/inc/types.hxx +++ b/idl/inc/types.hxx @@ -56,7 +56,7 @@ class SvMetaType : public SvMetaReference MetaTypeType nType; bool bIsItem; - void WriteSfxItem( const OString& rItemName, SvIdlDataBase const & rBase, + void WriteSfxItem( std::string_view rItemName, SvIdlDataBase const & rBase, SvStream & rOutStm ); protected: bool ReadHeaderSvIdl( SvTokenStream & rInStm ); diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx index 1c8299b132d4..627b158b3da4 100644 --- a/idl/source/objects/object.cxx +++ b/idl/source/objects/object.cxx @@ -148,7 +148,7 @@ sal_uInt16 SvMetaClass::WriteSlotParamArray( SvIdlDataBase & rBase, return nCount; } -sal_uInt16 SvMetaClass::WriteSlots( const OString& rShellName, +sal_uInt16 SvMetaClass::WriteSlots( std::string_view rShellName, SvSlotElementList & rSlotList, SvIdlDataBase & rBase, SvStream & rOutStm ) @@ -250,7 +250,7 @@ void SvMetaClass::FillClasses( SvMetaClassList & rList ) } -void SvMetaClass::WriteSlotStubs( const OString& rShellName, +void SvMetaClass::WriteSlotStubs( std::string_view rShellName, SvSlotElementList & rSlotList, std::vector<OString> & rList, SvStream & rOutStm ) diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx index fcdbbb8e95d0..df4cebf9c8e0 100644 --- a/idl/source/objects/slot.cxx +++ b/idl/source/objects/slot.cxx @@ -333,7 +333,7 @@ static OString MakeSlotName( SvStringHashEntry const * pEntry ) return "SfxSlotMode::" + pEntry->GetName().toAsciiUpperCase(); }; -void SvMetaSlot::WriteSlotStubs( const OString& rShellName, +void SvMetaSlot::WriteSlotStubs( std::string_view rShellName, std::vector<OString> & rList, SvStream & rOutStm ) const { @@ -387,8 +387,8 @@ void SvMetaSlot::WriteSlotStubs( const OString& rShellName, } } -void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount, - const OString& rSlotId, +void SvMetaSlot::WriteSlot( std::string_view rShellName, sal_uInt16 nCount, + std::string_view rSlotId, SvSlotElementList& rSlotList, size_t nStart, SvIdlDataBase & rBase, SvStream & rOutStm ) @@ -599,7 +599,7 @@ sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rO return 0; } -sal_uInt16 SvMetaSlot::WriteSlotMap( const OString& rShellName, sal_uInt16 nCount, +sal_uInt16 SvMetaSlot::WriteSlotMap( std::string_view rShellName, sal_uInt16 nCount, SvSlotElementList& rSlotList, size_t nStart, SvIdlDataBase & rBase, diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index a0238d9b4c78..9622d85aebf5 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -218,10 +218,10 @@ size_t SvMetaType::MakeSfx( OStringBuffer& rAttrArray ) } void SvMetaType::WriteSfxItem( - const OString& rItemName, SvIdlDataBase const & rBase, SvStream& rOutStm ) + std::string_view rItemName, SvIdlDataBase const & rBase, SvStream& rOutStm ) { WriteStars( rOutStm ); - OString aVarName = " a" + rItemName + "_Impl"; + OString aVarName = OString::Concat(" a") + rItemName + "_Impl"; OStringBuffer aAttrArray(1024); size_t nAttrCount = MakeSfx( aAttrArray ); diff --git a/include/svtools/HtmlWriter.hxx b/include/svtools/HtmlWriter.hxx index 61bebed54bae..1821336fb678 100644 --- a/include/svtools/HtmlWriter.hxx +++ b/include/svtools/HtmlWriter.hxx @@ -42,18 +42,18 @@ public: void flushStack(); - void attribute(const OString& aAttribute, const char* aValue); - void attribute(const OString& aAttribute, sal_Int32 aValue); - void attribute(const OString& aAttribute, const OString& aValue); - void attribute(const OString& aAttribute, std::u16string_view aValue); + void attribute(std::string_view aAttribute, const char* aValue); + void attribute(std::string_view aAttribute, sal_Int32 aValue); + void attribute(std::string_view aAttribute, std::string_view aValue); + void attribute(std::string_view aAttribute, std::u16string_view aValue); // boolean attribute e.g. <img ismap> - void attribute(const OString& aAttribute); + void attribute(std::string_view aAttribute); void single(const OString& aContent); void endAttribute(); /// Writes character data. - void characters(const OString& rChars); + void characters(std::string_view rChars); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/htmlout.hxx b/include/svtools/htmlout.hxx index a3b3c36bd217..14065fe4c801 100644 --- a/include/svtools/htmlout.hxx +++ b/include/svtools/htmlout.hxx @@ -58,7 +58,7 @@ struct HTMLOutFuncs rtl_TextEncoding eDestEnc, OUString *pNonConvertableChars ); - SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, const OString& rStr, + SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, std::string_view rStr, bool bOn = true); SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_uInt32 cChar, HTMLOutContext& rContext, @@ -107,7 +107,7 @@ struct HTMLOutFuncs struct HtmlWriterHelper { - SVT_DLLPUBLIC static void applyColor( HtmlWriter& rHtmlWriter, const OString &aAttributeName, const Color& rColor); + SVT_DLLPUBLIC static void applyColor( HtmlWriter& rHtmlWriter, std::string_view aAttributeName, const Color& rColor); SVT_DLLPUBLIC static void applyEvents(HtmlWriter& rHtmlWriter, const SvxMacroTableDtor& rMacroTable, const HTMLOutEvent* pEventTable, bool bOutStarBasic); }; diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index fab4b005b40b..b55a45ff3022 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -247,8 +247,8 @@ public: SvStream& WriteInt64( sal_Int64 nInt64 ); SvStream& WriteUInt8( sal_uInt8 nuInt8 ); SvStream& WriteUnicode( sal_Unicode ); - SvStream& WriteOString(const OString& rStr) - { WriteBytes(rStr.getStr(), rStr.getLength()); return *this; } + SvStream& WriteOString(std::string_view rStr) + { WriteBytes(rStr.data(), rStr.size()); return *this; } SvStream& WriteStream( SvStream& rStream ); sal_uInt64 WriteStream( SvStream& rStream, sal_uInt64 nSize ); @@ -291,7 +291,7 @@ public: causing endless loops ... */ bool ReadLine( OString& rStr, sal_Int32 nMaxBytesToRead = 0xFFFE ); - bool WriteLine( const OString& rStr ); + bool WriteLine( std::string_view rStr ); /** Read a line of bytes. @@ -339,7 +339,7 @@ public: /** Write a 32bit length prefixed sequence of utf-16 if eSrcCharSet==RTL_TEXTENCODING_UNICODE, otherwise convert to eSrcCharSet and write a 16bit length prefixed sequence of bytes */ - SvStream& WriteUniOrByteString( const OUString& rStr, rtl_TextEncoding eDestCharSet ); + SvStream& WriteUniOrByteString( std::u16string_view rStr, rtl_TextEncoding eDestCharSet ); /** Read a line of Unicode if eSrcCharSet==RTL_TEXTENCODING_UNICODE, otherwise read a line of Bytecode and convert from eSrcCharSet @@ -361,8 +361,8 @@ public: /** Write a sequence of Unicode characters if eDestCharSet==RTL_TEXTENCODING_UNICODE, otherwise write a sequence of Bytecodes converted to eDestCharSet */ - bool WriteUnicodeOrByteText( const OUString& rStr, rtl_TextEncoding eDestCharSet ); - bool WriteUnicodeOrByteText( const OUString& rStr ) + bool WriteUnicodeOrByteText(std::u16string_view rStr, rtl_TextEncoding eDestCharSet ); + bool WriteUnicodeOrByteText(std::u16string_view rStr ) { return WriteUnicodeOrByteText( rStr, GetStreamCharSet() ); } /** Write a Unicode character if eDestCharSet==RTL_TEXTENCODING_UNICODE, @@ -471,25 +471,25 @@ inline OUString read_uInt32_lenPrefixed_uInt16s_ToOUString(SvStream& rStrm) /// Attempt to write a prefixed sequence of nUnits 16bit units from an OUString, /// returned value is number of bytes written TOOLS_DLLPUBLIC std::size_t write_uInt16s_FromOUString(SvStream& rStrm, - const OUString& rStr, std::size_t nUnits); + std::u16string_view rStr, std::size_t nUnits); inline std::size_t write_uInt16s_FromOUString(SvStream& rStrm, - const OUString& rStr) + std::u16string_view rStr) { - return write_uInt16s_FromOUString(rStrm, rStr, rStr.getLength()); + return write_uInt16s_FromOUString(rStrm, rStr, rStr.size()); } /// Attempt to write a pascal-style length (of type prefix) prefixed sequence /// of 16bit units from an OUString, returned value is number of bytes written /// (including byte-count of prefix) std::size_t write_uInt32_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, - const OUString &rStr); + std::u16string_view rStr); /// Attempt to write a pascal-style length (of type prefix) prefixed sequence /// of 16bit units from an OUString, returned value is number of bytes written /// (including byte-count of prefix) TOOLS_DLLPUBLIC std::size_t write_uInt16_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, - const OUString &rStr); + std::u16string_view rStr); /// Attempt to read 8bit units to an OString until a zero terminator is /// encountered, returned OString's length is number of units *definitely* @@ -539,22 +539,22 @@ inline OUString read_uInt8_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm, /// Attempt to write a prefixed sequence of nUnits 8bit units from an OString, /// returned value is number of bytes written -inline std::size_t write_uInt8s_FromOString(SvStream& rStrm, const OString& rStr, +inline std::size_t write_uInt8s_FromOString(SvStream& rStrm, std::string_view rStr, std::size_t nUnits) { - return rStrm.WriteBytes(rStr.getStr(), nUnits); + return rStrm.WriteBytes(rStr.data(), nUnits); } -inline std::size_t write_uInt8s_FromOString(SvStream& rStrm, const OString& rStr) +inline std::size_t write_uInt8s_FromOString(SvStream& rStrm, std::string_view rStr) { - return write_uInt8s_FromOString(rStrm, rStr, rStr.getLength()); + return write_uInt8s_FromOString(rStrm, rStr, rStr.size()); } /// Attempt to write a pascal-style length (of type prefix) prefixed /// sequence of units from a string-type, returned value is number of bytes /// written (including byte-count of prefix) TOOLS_DLLPUBLIC std::size_t write_uInt16_lenPrefixed_uInt8s_FromOString(SvStream& rStrm, - const OString &rStr); + std::string_view rStr); /// Attempt to write a pascal-style length (of type prefix) prefixed sequence /// of 8bit units from an OUString, returned value is number of bytes written diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 97a41ced3024..3ba3c9d2effa 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -450,9 +450,9 @@ ErrCode DictionaryNeo::saveEntries(const OUString &rURL) pStream->WriteLine("type: negative"); if (aDicName.endsWith(EXTENSION_FOR_TITLE_TEXT)) { - pStream->WriteLine("title: " + OUStringToOString( + pStream->WriteLine(OString("title: " + OUStringToOString( // strip EXTENSION_FOR_TITLE_TEXT - aDicName.subView(0, aDicName.lastIndexOf(EXTENSION_FOR_TITLE_TEXT)), eEnc)); + aDicName.subView(0, aDicName.lastIndexOf(EXTENSION_FOR_TITLE_TEXT)), eEnc))); } if (ERRCODE_NONE != (nErr = pStream->GetError())) return nErr; diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx index a5b249182a3d..69ba12cbf21a 100644 --- a/opencl/source/opencl_device.cxx +++ b/opencl/source/opencl_device.cxx @@ -429,13 +429,13 @@ public: : maStream(aFileName, StreamMode::WRITE) {} - void text(const OString& rText) + void text(std::string_view rText) { maStream.WriteOString(rText); maStream.WriteChar('\n'); } - void log(const OString& rKey, const OString& rValue) + void log(std::string_view rKey, std::string_view rValue) { maStream.WriteOString(rKey); maStream.WriteCharPtr(": "); @@ -443,12 +443,12 @@ public: maStream.WriteChar('\n'); } - void log(const OString& rKey, int rValue) + void log(std::string_view rKey, int rValue) { log(rKey, OString::number(rValue)); } - void log(const OString& rKey, bool rValue) + void log(std::string_view rKey, bool rValue) { log(rKey, OString::boolean(rValue)); } diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx index 5a8caec39eca..a113318d408d 100644 --- a/sc/source/filter/html/htmlexp2.cxx +++ b/sc/source/filter/html/htmlexp2.cxx @@ -171,7 +171,7 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE ) } void ScHTMLExport::WriteImage( OUString& rLinkName, const Graphic& rGrf, - const OString& rImgOptions, XOutFlags nXOutFlags ) + std::string_view rImgOptions, XOutFlags nXOutFlags ) { // Embedded graphic -> create an image file if( rLinkName.isEmpty() ) @@ -216,7 +216,7 @@ void ScHTMLExport::WriteImage( OUString& rLinkName, const Graphic& rGrf, HTMLOutFuncs::Out_String( rStrm, URIHelper::simpleNormalizedMakeRelative( aBaseURL, rLinkName ), eDestEnc ).WriteChar( '\"' ); - if ( !rImgOptions.isEmpty() ) + if ( !rImgOptions.empty() ) rStrm.WriteOString( rImgOptions ); rStrm.WriteChar( '>' ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() ); } diff --git a/sc/source/filter/inc/htmlexp.hxx b/sc/source/filter/inc/htmlexp.hxx index 318bbbfbbf62..6aee6b953526 100644 --- a/sc/source/filter/inc/htmlexp.hxx +++ b/sc/source/filter/inc/htmlexp.hxx @@ -139,7 +139,7 @@ class ScHTMLExport : public ScExportBase void WriteCell( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol, SCROW nRow, SCTAB nTab ); void WriteGraphEntry( ScHTMLGraphEntry* ); void WriteImage( OUString& rLinkName, - const Graphic&, const OString& rImgOptions, + const Graphic&, std::string_view rImgOptions, XOutFlags nXOutFlags = XOutFlags::NONE ); // nXOutFlags for XOutBitmap::WriteGraphic diff --git a/svl/source/inc/stringio.hxx b/svl/source/inc/stringio.hxx index 41a89d992808..51d52abeb336 100644 --- a/svl/source/inc/stringio.hxx +++ b/svl/source/inc/stringio.hxx @@ -40,7 +40,7 @@ OUString readByteString(SvStream& rStream); @param rString Some Unicode string. */ -void writeByteString(SvStream& rStream, const OUString& rString); +void writeByteString(SvStream& rStream, std::u16string_view rString); #endif // INCLUDED_SVL_SOURCE_INC_STRINGIO_HXX diff --git a/svl/source/items/stringio.cxx b/svl/source/items/stringio.cxx index e937e77cc72d..5345e165aa34 100644 --- a/svl/source/items/stringio.cxx +++ b/svl/source/items/stringio.cxx @@ -26,7 +26,7 @@ OUString readByteString(SvStream& rStream) return rStream.ReadUniOrByteString(rStream.GetStreamCharSet()); } -void writeByteString(SvStream& rStream, const OUString& rString) +void writeByteString(SvStream& rStream, std::u16string_view rString) { rStream.WriteUniOrByteString(rString, rStream.GetStreamCharSet()); } diff --git a/svtools/qa/unit/testHtmlWriter.cxx b/svtools/qa/unit/testHtmlWriter.cxx index 601287342c4b..7154b770a682 100644 --- a/svtools/qa/unit/testHtmlWriter.cxx +++ b/svtools/qa/unit/testHtmlWriter.cxx @@ -156,7 +156,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAttributeValues) HtmlWriter aHtml(aStream); aHtml.prettyPrint(false); aHtml.start("abc"); - aHtml.attribute("one", OString("one")); + aHtml.attribute("one", "one"); aHtml.attribute("two", u"two"); aHtml.attribute("three", sal_Int32(12)); aHtml.end(); diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 7e39f8eab8c2..8d5f8836a0c3 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -414,7 +414,7 @@ void FontNameBox::SaveMRUEntries(const OUString& aFontMRUEntriesFile) const aStream.SetLineDelimiter( LINEEND_LF ); aStream.WriteLine( aEntries ); - aStream.WriteLine( OString() ); + aStream.WriteLine( "" ); } void FontNameBox::LoadMRUEntries( const OUString& aFontMRUEntriesFile ) diff --git a/svtools/source/svhtml/HtmlWriter.cxx b/svtools/source/svhtml/HtmlWriter.cxx index dd2f40c6d16f..a4d1b0e3b5ea 100644 --- a/svtools/source/svhtml/HtmlWriter.cxx +++ b/svtools/source/svhtml/HtmlWriter.cxx @@ -51,7 +51,7 @@ void HtmlWriter::start(const OString& aElement) } mrStream.WriteChar('<'); - mrStream.WriteOString(maNamespace + aElement); + mrStream.WriteOString(OString(maNamespace + aElement)); mbElementOpen = true; } @@ -98,7 +98,7 @@ void HtmlWriter::end() } } mrStream.WriteCharPtr("</"); - mrStream.WriteOString(maNamespace + maElementStack.back()); + mrStream.WriteOString(OString(maNamespace + maElementStack.back())); mrStream.WriteCharPtr(">"); if (mbPrettyPrint) mrStream.WriteCharPtr("\n"); @@ -108,9 +108,9 @@ void HtmlWriter::end() mbCharactersWritten = false; } -void HtmlWriter::attribute(const OString &aAttribute, const OString& aValue) +void HtmlWriter::attribute(std::string_view aAttribute, std::string_view aValue) { - if (mbElementOpen && !aAttribute.isEmpty() && !aValue.isEmpty()) + if (mbElementOpen && !aAttribute.empty() && !aValue.empty()) { mrStream.WriteChar(' '); mrStream.WriteOString(aAttribute); @@ -121,31 +121,31 @@ void HtmlWriter::attribute(const OString &aAttribute, const OString& aValue) } } -void HtmlWriter::attribute(const OString& aAttribute, const sal_Int32 aValue) +void HtmlWriter::attribute(std::string_view aAttribute, const sal_Int32 aValue) { attribute(aAttribute, OString::number(aValue)); } -void HtmlWriter::attribute(const OString& aAttribute, const char* pValue) +void HtmlWriter::attribute(std::string_view aAttribute, const char* pValue) { - attribute(aAttribute, OString(pValue)); + attribute(aAttribute, std::string_view(pValue)); } -void HtmlWriter::attribute(const OString& aAttribute, std::u16string_view aValue) +void HtmlWriter::attribute(std::string_view aAttribute, std::u16string_view aValue) { attribute(aAttribute, OUStringToOString(aValue, RTL_TEXTENCODING_UTF8)); } -void HtmlWriter::attribute(const OString& aAttribute) +void HtmlWriter::attribute(std::string_view aAttribute) { - if (mbElementOpen && !aAttribute.isEmpty()) + if (mbElementOpen && !aAttribute.empty()) { mrStream.WriteChar(' '); mrStream.WriteOString(aAttribute); } } -void HtmlWriter::characters(const OString& rChars) +void HtmlWriter::characters(std::string_view rChars) { if (!mbCharactersWritten) mrStream.WriteCharPtr(">"); diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index c148f49dc92f..48beab0039cd 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -516,7 +516,7 @@ OString HTMLOutFuncs::ConvertStringToHTML( const OUString& rSrc, return aDest.makeStringAndClear(); } -SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, const OString& rStr, +SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, std::string_view rStr, bool bOn ) { if(bOn) @@ -993,7 +993,7 @@ bool HTMLOutFuncs::PrivateURLToInternalImg( OUString& rURL ) return false; } -void HtmlWriterHelper::applyColor(HtmlWriter& rHtmlWriter, const OString &aAttributeName, const Color& rColor) +void HtmlWriterHelper::applyColor(HtmlWriter& rHtmlWriter, std::string_view aAttributeName, const Color& rColor) { OStringBuffer sBuffer; diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index 0171adca8c6b..107d32da0750 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -276,7 +276,7 @@ void SgaObjectBmp::WriteData( SvStream& rOut, const OUString& rDestDir ) const SgaObject::WriteData( rOut, rDestDir ); char const aDummy[ 10 ] = { 0 }; rOut.WriteBytes(aDummy, 10); - write_uInt16_lenPrefixed_uInt8s_FromOString(rOut, OString()); //dummy + write_uInt16_lenPrefixed_uInt8s_FromOString(rOut, ""); //dummy write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8); } diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 4b5086983d1e..bff20654c895 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -289,7 +289,7 @@ static Writer& OutASC_SwTextNode( Writer& rWrt, SwContentNode& rNode ) } if (!level.isEmpty() || !numString.isEmpty()) - rWrt.Strm().WriteUnicodeOrByteText(level + numString + " "); + rWrt.Strm().WriteUnicodeOrByteText(OUString(level + numString + " ")); } OUString aStr( rNd.GetText() ); diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 9a98ce61fc94..a5b6deeca699 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -321,7 +321,7 @@ void SwHTMLWriter::OutCSS1_Property( const char *pProp, } else { - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false ); return; } break; @@ -571,7 +571,7 @@ void SwHTMLWriter::OutStyleSheet( const SwPageDesc& rPageDesc ) DecIndentLevel(); OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_style, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_style), false ); } else { @@ -2800,7 +2800,7 @@ static Writer& OutCSS1_SwFormatDrop( Writer& rWrt, const SfxPoolItem& rHt ) } else { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false ); } return rWrt; @@ -3324,7 +3324,7 @@ Writer& OutCSS1_SvxBox( Writer& rWrt, const SfxPoolItem& rHt ) } else { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false ); return rWrt; } } diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index ba1111d37054..94e41f538afa 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -134,7 +134,7 @@ void SwHTMLWriter::OutAndSetDefList( sal_uInt16 nNewLvl ) { if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_deflist ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_deflist) ); IncIndentLevel(); m_bLFPossible = true; } @@ -146,7 +146,7 @@ void SwHTMLWriter::OutAndSetDefList( sal_uInt16 nNewLvl ) DecIndentLevel(); if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_deflist, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_deflist), false ); m_bLFPossible = true; } } @@ -158,7 +158,7 @@ void SwHTMLWriter::ChangeParaToken( HtmlTokenId nNew ) { if( nNew != m_nLastParaToken && HtmlTokenId::PREFORMTXT_ON == m_nLastParaToken ) { - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_preformtxt, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_preformtxt), false ); m_bLFPossible = true; } m_nLastParaToken = nNew; @@ -764,13 +764,13 @@ static void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, if( USHRT_MAX != nNumStart ) html.attribute(OOO_STRING_SVTOOLS_HTML_O_value, OString::number(nNumStart)); // Finish the opening element, but don't close it. - html.characters(OString()); + html.characters(""); } if( rHWrt.m_nDefListLvl > 0 && !bForceDL ) { OString aTag = bDT ? OOO_STRING_SVTOOLS_HTML_dt : OOO_STRING_SVTOOLS_HTML_dd; - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHWrt.GetNamespace() + aTag ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHWrt.GetNamespace() + aTag) ); } if( pAdjItem && @@ -803,7 +803,7 @@ static void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, if( (!rHWrt.m_bCfgOutStyles || rHWrt.mbXHTML) && rInfo.bParaPossible && !bPara && (bHasParSpace || pAdjItem) ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHWrt.GetNamespace() + rInfo.aToken ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHWrt.GetNamespace() + rInfo.aToken) ); aToken = OOO_STRING_SVTOOLS_HTML_parabreak; bPara = true; rHWrt.m_bNoAlign = false; @@ -998,9 +998,9 @@ static void OutHTML_SwFormatOff( Writer& rWrt, const SwHTMLTextCollOutputInfo& r // - no styles are written and // - a lower spacing exists if( rInfo.bParaPossible && rInfo.bOutPara ) - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_parabreak, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_parabreak), false ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHWrt.GetNamespace() + rInfo.aToken, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHWrt.GetNamespace() + rInfo.aToken), false ); rHWrt.m_bLFPossible = rInfo.aToken != OOO_STRING_SVTOOLS_HTML_dt && rInfo.aToken != OOO_STRING_SVTOOLS_HTML_dd && @@ -1011,7 +1011,7 @@ static void OutHTML_SwFormatOff( Writer& rWrt, const SwHTMLTextCollOutputInfo& r rHWrt.DecIndentLevel(); if( rHWrt.m_bLFPossible ) rHWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_division, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_division), false ); rHWrt.m_bLFPossible = true; } @@ -2574,7 +2574,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) // dot leaders: print the skipped page number in a different span element if (nIndexTab > -1) { OString sOut = OUStringToOString(rStr.subView(nIndexTab + 1), RTL_TEXTENCODING_ASCII_US); - rWrt.Strm().WriteOString( "</span><span>" + sOut + "</span>" ); + rWrt.Strm().WriteOString( OString("</span><span>" + sOut + "</span>") ); } rHTMLWrt.m_bTagOn = false; @@ -2653,9 +2653,9 @@ static Writer& OutHTML_SvxColor( Writer& rWrt, const SfxPoolItem& rHt ) { if (rHTMLWrt.mbXHTML) HTMLOutFuncs::Out_AsciiTag( - rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false); + rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false); else - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_font, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_font), false ); } return rWrt; @@ -2670,7 +2670,7 @@ static Writer& OutHTML_SwPosture( Writer& rWrt, const SfxPoolItem& rHt ) const FontItalic nPosture = static_cast<const SvxPostureItem&>(rHt).GetPosture(); if( ITALIC_NORMAL == nPosture ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_italic, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_italic), rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2719,9 +2719,9 @@ static Writer& OutHTML_SvxFont( Writer& rWrt, const SfxPoolItem& rHt ) { if (rHTMLWrt.mbXHTML) HTMLOutFuncs::Out_AsciiTag( - rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false); + rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false); else - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_font, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_font), false ); } return rWrt; @@ -2773,9 +2773,9 @@ static Writer& OutHTML_SvxFontHeight( Writer& rWrt, const SfxPoolItem& rHt ) { if (rHTMLWrt.mbXHTML) HTMLOutFuncs::Out_AsciiTag( - rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false); + rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false); else - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_font, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_font), false ); } return rWrt; @@ -2800,7 +2800,7 @@ static Writer& OutHTML_SvxLanguage( Writer& rWrt, const SfxPoolItem& rHt ) } else { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false ); } return rWrt; @@ -2814,7 +2814,7 @@ static Writer& OutHTML_SwWeight( Writer& rWrt, const SfxPoolItem& rHt ) const FontWeight nBold = static_cast<const SvxWeightItem&>(rHt).GetWeight(); if( WEIGHT_BOLD == nBold ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_bold, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_bold), rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2835,7 +2835,7 @@ static Writer& OutHTML_SwCrossedOut( Writer& rWrt, const SfxPoolItem& rHt ) const FontStrikeout nStrike = static_cast<const SvxCrossedOutItem&>(rHt).GetStrikeout(); if( STRIKEOUT_NONE != nStrike && !rHTMLWrt.mbReqIF ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_strike, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_strike), rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2865,7 +2865,7 @@ static Writer& OutHTML_SvxEscapement( Writer& rWrt, const SfxPoolItem& rHt ) if( !aTag.isEmpty() ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + aTag, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + aTag), rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2885,7 +2885,7 @@ static Writer& OutHTML_SwUnderline( Writer& rWrt, const SfxPoolItem& rHt ) const FontLineStyle eUnder = static_cast<const SvxUnderlineItem&>(rHt).GetLineStyle(); if( LINESTYLE_NONE != eUnder && !rHTMLWrt.mbReqIF ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_underline, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_underline), rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2921,7 +2921,7 @@ static Writer& OutHTML_SwBlink( Writer& rWrt, const SfxPoolItem& rHt ) if( static_cast<const SvxBlinkItem&>(rHt).GetValue() ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_blink, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_blink), rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2947,7 +2947,7 @@ Writer& OutHTML_INetFormat( Writer& rWrt, const SwFormatINetFormat& rINetFormat, // bOn controls if we are writing the opening or closing tag if( !bOn ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor), false ); return rWrt; } @@ -3164,7 +3164,7 @@ static Writer& OutHTML_SwTextCharFormat( Writer& rWrt, const SfxPoolItem& rHt ) { OString aTag = !pFormatInfo->aToken.isEmpty() ? pFormatInfo->aToken.getStr() : OOO_STRING_SVTOOLS_HTML_span; - HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rHTMLWrt.GetNamespace() + aTag, false); + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + aTag), false); } return rWrt; diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx index 62325b40a2e3..504bf766f78c 100644 --- a/sw/source/filter/html/htmldrawwriter.cxx +++ b/sw/source/filter/html/htmldrawwriter.cxx @@ -276,7 +276,7 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt, HTMLOutFuncs::Out_String( rWrt.Strm(), aText, rHTMLWrt.m_eDestEnc, &rHTMLWrt.m_aNonConvertableCharacters ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_marquee, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_marquee), false ); if( !aEndTags.isEmpty() ) rWrt.Strm().WriteOString( aEndTags ); diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index 18234a8a554c..dac2ffc2108b 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -435,7 +435,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, // Output the closing tag. if( pTypeStr ) - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_sdfield, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_sdfield), false ); return rWrt; } @@ -573,7 +573,7 @@ Writer& OutHTML_SwFormatField( Writer& rWrt, const SfxPoolItem& rHt ) if (bFieldShadings) HTMLOutFuncs::Out_AsciiTag( - rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false); + rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false); } } return rWrt; diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 442114fb48c3..2d323864a4e3 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -510,11 +510,11 @@ void SwHTMLWriter::OutFrameFormat( AllHtmlFlags nMode, const SwFrameFormat& rFra DecIndentLevel(); if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_division, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_division), false ); m_bLFPossible = true; } else if( HtmlContainerFlags::Span == nCntnrMode ) - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false ); } OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, @@ -1641,7 +1641,7 @@ static Writer & OutHTML_FrameFormatAsMulticol( Writer& rWrt, rHTMLWrt.DecIndentLevel(); // indent the content of Multicol; if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_multicol, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_multicol), false ); rHTMLWrt.m_bLFPossible = true; return rWrt; @@ -1728,7 +1728,7 @@ static Writer& OutHTML_FrameFormatAsDivOrSpan( Writer& rWrt, rHTMLWrt.DecIndentLevel(); // indent the content of Multicol; if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + aTag, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + aTag), false ); if( !aEndTags.isEmpty() ) rWrt.Strm().WriteOString( aEndTags ); @@ -1887,8 +1887,8 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF // Refer to this data. aFileName = URIHelper::simpleNormalizedMakeRelative(rWrt.GetBaseURL(), aFileName); - rWrt.Strm().WriteOString("<" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_object); - rWrt.Strm().WriteOString(" data=\"" + aFileName.toUtf8() + "\""); + rWrt.Strm().WriteOString(OString("<" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_object)); + rWrt.Strm().WriteOString(OString(" data=\"" + aFileName.toUtf8() + "\"")); rWrt.Strm().WriteOString(" type=\"text/rtf\""); rWrt.Strm().WriteOString(">"); rHTMLWrt.OutNewLine(); @@ -1898,7 +1898,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF pGrfNd->GetTwipSize(), nFrameFlags, "graphic", nullptr, aMimeType ); if (rHTMLWrt.mbReqIF) - rWrt.Strm().WriteOString("</" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_object ">"); + rWrt.Strm().WriteOString(OString("</" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_object ">")); return rWrt; } @@ -1944,7 +1944,7 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat, sOut.append(OOO_STRING_SVTOOLS_HTML_division).append(' ') .append(OOO_STRING_SVTOOLS_HTML_O_title).append("=\"") .append( bHeader ? "header" : "footer" ).append("\""); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + sOut.makeStringAndClear().getStr() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + sOut) ); rHTMLWrt.IncIndentLevel(); // indent the content of Multicol; @@ -1979,7 +1979,7 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat, if( !bHeader && !aSpacer.isEmpty() ) { rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + aSpacer.getStr() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + aSpacer) ); } { @@ -2000,12 +2000,12 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat, if( bHeader && !aSpacer.isEmpty() ) { rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + aSpacer.getStr() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + aSpacer) ); } rHTMLWrt.DecIndentLevel(); // indent the content of Multicol; rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_division, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_division), false ); rHTMLWrt.m_nHeaderFooterSpace = 0; diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index b02875822482..fabccbb8a2e0 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -437,7 +437,7 @@ void SwHTMLWriter::OutForm( bool bOn, DecIndentLevel(); // indent content of form if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_form, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_form), false ); m_bLFPossible = true; return; @@ -1220,12 +1220,12 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, HTMLOutFuncs::Out_String( rWrt.Strm(), pStrings[i], rHTMLWrt.m_eDestEnc, &rHTMLWrt.m_aNonConvertableCharacters ); } - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_option, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_option), false ); rHTMLWrt.DecIndentLevel(); rHTMLWrt.OutNewLine();// the </SELECT> gets its own line } - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_select, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_select), false ); } else if( TAG_TEXTAREA == eTag ) { @@ -1252,7 +1252,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, rHTMLWrt.m_eDestEnc, &rHTMLWrt.m_aNonConvertableCharacters ); } } - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_textarea, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_textarea), false ); } else if( TYPE_CHECKBOX == eType || TYPE_RADIO == eType ) { diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx index cec1d3df6326..4dbe9f3250dd 100644 --- a/sw/source/filter/html/htmlftn.cxx +++ b/sw/source/filter/html/htmlftn.cxx @@ -287,12 +287,12 @@ Writer& OutHTML_SwFormatFootnote( Writer& rWrt, const SfxPoolItem& rHt ) sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_sdfixed); sOut.append(">"); rWrt.Strm().WriteOString( sOut.makeStringAndClear() ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_superscript ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_superscript )); HTMLOutFuncs::Out_String( rWrt.Strm(), rFormatFootnote.GetViewNumStr(*rWrt.m_pDoc, nullptr), rHTMLWrt.m_eDestEnc, &rHTMLWrt.m_aNonConvertableCharacters ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_superscript, false ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_superscript), false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor), false ); return rWrt; } @@ -350,7 +350,7 @@ void SwHTMLWriter::OutFootEndNotes() DecIndentLevel(); // indent content of <DIV> if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_division, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_division), false ); m_bLFPossible = true; OSL_ENSURE( !m_pFormatFootnote, @@ -449,7 +449,7 @@ void SwHTMLWriter::OutFootEndNoteSym( const SwFormatFootnote& rFormatFootnote, Strm().WriteOString( sOut.makeStringAndClear() ); HTMLOutFuncs::Out_String( Strm(), rNum, m_eDestEnc, &m_aNonConvertableCharacters ); - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor), false ); } static int lcl_html_fillEndNoteInfo( const SwEndNoteInfo& rInfo, diff --git a/sw/source/filter/html/htmlnumwriter.cxx b/sw/source/filter/html/htmlnumwriter.cxx index 87f273ab7bb0..6040dfecb14d 100644 --- a/sw/source/filter/html/htmlnumwriter.cxx +++ b/sw/source/filter/html/htmlnumwriter.cxx @@ -286,7 +286,7 @@ Writer& OutHTML_NumberBulletListEnd( SwHTMLWriter& rWrt, if (bListEnd || (!bListEnd && rNextInfo.IsNumbered())) { HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), - rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_li, false); + OString(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_li), false); } } @@ -314,7 +314,7 @@ Writer& OutHTML_NumberBulletListEnd( SwHTMLWriter& rWrt, aTag = OOO_STRING_SVTOOLS_HTML_unorderlist; else aTag = OOO_STRING_SVTOOLS_HTML_orderlist; - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + aTag, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rWrt.GetNamespace() + aTag), false ); rWrt.m_bLFPossible = true; } diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index a744e6cb64ff..95dbd157c620 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1404,7 +1404,7 @@ Writer& OutHTML_FrameFormatOLENode( Writer& rWrt, const SwFrameFormat& rFrameFor rHTMLWrt.DecIndentLevel(); // indent the applet content if( aCommands.size() ) rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_applet, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_applet), false ); } else if( aGlobName == SvGlobalName( SO3_PLUGIN_CLASSID ) ) { @@ -1437,7 +1437,7 @@ Writer& OutHTML_FrameFormatOLENode( Writer& rWrt, const SwFrameFormat& rFrameFor // and for Floating-Frames just output another </IFRAME> rHTMLWrt.Strm().WriteChar( '>' ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_iframe, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_iframe), false ); } if( !aEndTags.isEmpty() ) @@ -1494,9 +1494,9 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame SAL_WARN_IF(aStream.GetSize()>=o3tl::make_unsigned(SAL_MAX_INT32), "sw.html", "Stream can't fit in OString"); OString aData(static_cast<const char*>(aStream.GetData()), static_cast<sal_Int32>(aStream.GetSize())); // Wrap output in a <span> tag to avoid 'HTML parser error: Unexpected end tag: p' - HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span); + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span)); rWrt.Strm().WriteOString(aData); - HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false); + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false); } catch ( uno::Exception& ) { @@ -1608,10 +1608,10 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame // Refer to this data. if (rHTMLWrt.m_bLFPossible) rHTMLWrt.OutNewLine(); - rWrt.Strm().WriteOString("<" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_object); - rWrt.Strm().WriteOString(" data=\"" + aFileName.toUtf8() + "\""); + rWrt.Strm().WriteOString(OString("<" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_object)); + rWrt.Strm().WriteOString(OString(" data=\"" + aFileName.toUtf8() + "\"")); if (!aFileType.isEmpty()) - rWrt.Strm().WriteOString(" type=\"" + aFileType.toUtf8() + "\""); + rWrt.Strm().WriteOString(OString(" type=\"" + aFileType.toUtf8() + "\"")); rWrt.Strm().WriteOString(">"); bObjectOpened = true; rHTMLWrt.m_bLFPossible = true; @@ -1667,8 +1667,8 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame if (bObjectOpened) // Close native data. - rWrt.Strm().WriteOString("</" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_object - ">"); + rWrt.Strm().WriteOString(OString("</" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_object + ">")); return rWrt; } diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index 8c1ace39bc2e..817d74784356 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -500,7 +500,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, if( rWrt.m_bLFPossible ) rWrt.OutNewLine(); aTag = bHead ? OOO_STRING_SVTOOLS_HTML_tableheader : OOO_STRING_SVTOOLS_HTML_tabledata; - HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rWrt.GetNamespace() + aTag, false); + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OString(rWrt.GetNamespace() + aTag), false); rWrt.m_bLFPossible = true; } @@ -530,7 +530,7 @@ void SwHTMLWrtTable::OutTableCells( SwHTMLWriter& rWrt, } rWrt.OutNewLine(); // <TR> in new line - rWrt.Strm().WriteChar( '<' ).WriteOString( rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow ); + rWrt.Strm().WriteChar( '<' ).WriteOString( OString(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow) ); if( pBrushItem ) { rWrt.OutBackground( pBrushItem, false ); @@ -562,7 +562,7 @@ void SwHTMLWrtTable::OutTableCells( SwHTMLWriter& rWrt, rWrt.DecIndentLevel(); // indent content of <TR>...</TR> rWrt.OutNewLine(); // </TR> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow), false ); } void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, @@ -721,9 +721,9 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, sOutStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).append("=\"") .append(bTopCaption ? OOO_STRING_SVTOOLS_HTML_VA_top : OOO_STRING_SVTOOLS_HTML_VA_bottom) .append("\""); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + sOutStr.getStr() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rWrt.GetNamespace() + sOutStr) ); HTMLOutFuncs::Out_String( rWrt.Strm(), *pCaption, rWrt.m_eDestEnc, &rWrt.m_aNonConvertableCharacters ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_caption, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_caption), false ); } const SwWriteTableCols::size_type nCols = m_aCols.size(); @@ -736,7 +736,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, if( bColGroups ) { rWrt.OutNewLine(); // <COLGRP> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup) ); rWrt.IncIndentLevel(); // indent content of <COLGRP> } @@ -764,7 +764,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, } if( bRel ) - html.attribute(OOO_STRING_SVTOOLS_HTML_O_width, OString::number(nWidth) + "*"); + html.attribute(OOO_STRING_SVTOOLS_HTML_O_width, OString(OString::number(nWidth) + "*")); else html.attribute(OOO_STRING_SVTOOLS_HTML_O_width, OString::number(SwHTMLWriter::ToPixel(nWidth,false))); html.end(); @@ -773,10 +773,10 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, { rWrt.DecIndentLevel(); // indent content of <COLGRP> rWrt.OutNewLine(); // </COLGRP> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup, + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup), false ); rWrt.OutNewLine(); // <COLGRP> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup) ); rWrt.IncIndentLevel(); // indent content of <COLGRP> } } @@ -785,7 +785,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, rWrt.DecIndentLevel(); // indent content of <COLGRP> rWrt.OutNewLine(); // </COLGRP> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup, + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup), false ); } } @@ -810,7 +810,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, { rWrt.OutNewLine(); // <THEAD>/<TDATA> in new line OString aTag = bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody; - HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rWrt.GetNamespace() + aTag); + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OString(rWrt.GetNamespace() + aTag)); rWrt.IncIndentLevel(); // indent content of <THEAD>/<TDATA> } @@ -826,8 +826,8 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, for( auto nCnt = (pRow2->nBottomBorder / DEF_LINE_WIDTH_1) - 1; nCnt; --nCnt ) { rWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow, + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow )); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow), false ); } } @@ -838,14 +838,14 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, rWrt.DecIndentLevel(); // indent content of <THEAD>/<TDATA> rWrt.OutNewLine(); // </THEAD>/</TDATA> in new line OString aTag = bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody; - HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rWrt.GetNamespace() + aTag, false); + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OString(rWrt.GetNamespace() + aTag), false); rWrt.OutNewLine(); // <THEAD>/<TDATA> in new line if( bTHead && nRow==m_nHeadEndRow ) bTHead = false; aTag = bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody; - HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rWrt.GetNamespace() + aTag); + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OString(rWrt.GetNamespace() + aTag)); rWrt.IncIndentLevel(); // indent content of <THEAD>/<TDATA> } } @@ -856,13 +856,13 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, rWrt.OutNewLine(); // </THEAD>/</TDATA> in new line OString aTag = bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody; - HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rWrt.GetNamespace() + aTag, false); + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OString(rWrt.GetNamespace() + aTag), false); } rWrt.DecIndentLevel(); // indent content of <TABLE> rWrt.OutNewLine(); // </TABLE> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_table, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_table), false ); rWrt.m_nDirection = nOldDirection; } @@ -1012,7 +1012,7 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode, { if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_dd ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_dd) ); } // eFlyHoriOri and eTabHoriOri now only contain the values of @@ -1069,13 +1069,13 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode, if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine(); // <CENTER> in new line if( text::HoriOrientation::CENTER==eDivHoriOri ) - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_center ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_center) ); else { - OString sOut = OOO_STRING_SVTOOLS_HTML_division + OStringLiteral sOut = OOO_STRING_SVTOOLS_HTML_division " " OOO_STRING_SVTOOLS_HTML_O_align "=\"" OOO_STRING_SVTOOLS_HTML_AL_right "\""; - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + sOut.getStr() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + sOut) ); } rHTMLWrt.IncIndentLevel(); // indent content of <CENTER> rHTMLWrt.m_bLFPossible = true; @@ -1122,7 +1122,7 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode, OString aTag = text::HoriOrientation::CENTER == eDivHoriOri ? OOO_STRING_SVTOOLS_HTML_center : OOO_STRING_SVTOOLS_HTML_division; - HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rHTMLWrt.GetNamespace() + aTag, false); + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OString(rHTMLWrt.GetNamespace() + aTag), false); rHTMLWrt.m_bLFPossible = true; } diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 1908bd732fa6..ca438b5894b1 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -492,13 +492,13 @@ ErrCode SwHTMLWriter::WriteStream() OutNewLine(); if (!mbSkipHeaderFooter) { - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_body, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_body), false ); OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_html, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_html), false ); } else if (mbReqIF) // ReqIF: end xhtml.BlkStruct.class. - HTMLOutFuncs::Out_AsciiTag(Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_division, false); + HTMLOutFuncs::Out_AsciiTag(Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_division), false); // delete the table with floating frames OSL_ENSURE( !m_pHTMLPosFlyFrames, "Were not all frames output?" ); @@ -709,7 +709,7 @@ static void lcl_html_OutSectionEndTag( SwHTMLWriter& rHTMLWrt ) rHTMLWrt.DecIndentLevel(); if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rHTMLWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_division, false ); + HTMLOutFuncs::Out_AsciiTag( rHTMLWrt.Strm(), OString(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_division), false ); rHTMLWrt.m_bLFPossible = true; } @@ -992,10 +992,10 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs ) // build prelude OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_html ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_html) ); OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_head ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_head) ); IncIndentLevel(); // indent content of <HEAD> @@ -1064,7 +1064,7 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs ) DecIndentLevel(); // indent content of <HEAD> OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_head, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_head), false ); // the body won't be indented, because then everything would be indented! OutNewLine(); @@ -1108,7 +1108,7 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs ) } else if (mbReqIF) // ReqIF: start xhtml.BlkStruct.class. - HTMLOutFuncs::Out_AsciiTag(Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_division); + HTMLOutFuncs::Out_AsciiTag(Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_division)); return pPageDesc; } @@ -1131,7 +1131,7 @@ void SwHTMLWriter::OutAnchor( const OUString& rName ) Strm().WriteOString( sOut.makeStringAndClear() ); HTMLOutFuncs::Out_String( Strm(), rName.replace(' ', '_'), m_eDestEnc, &m_aNonConvertableCharacters ).WriteCharPtr( "\">" ); } - HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), OString(GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor), false ); } void SwHTMLWriter::OutBookmarks() diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 2b7f8b08b1a3..7ea8b205ff5b 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -664,19 +664,19 @@ OUString read_zeroTerminated_uInt8s_ToOUString(SvStream& rStream, rtl_TextEncodi /** Attempt to write a prefixed sequence of nUnits 16bit units from an OUString, returned value is number of bytes written */ -std::size_t write_uInt16s_FromOUString(SvStream& rStrm, const OUString& rStr, +std::size_t write_uInt16s_FromOUString(SvStream& rStrm, std::u16string_view rStr, std::size_t nUnits) { DBG_ASSERT( sizeof(sal_Unicode) == sizeof(sal_uInt16), "write_uInt16s_FromOUString: swapping sizeof(sal_Unicode) not implemented" ); std::size_t nWritten; if (!rStrm.IsEndianSwap()) - nWritten = rStrm.WriteBytes(rStr.getStr(), nUnits * sizeof(sal_Unicode)); + nWritten = rStrm.WriteBytes(rStr.data(), nUnits * sizeof(sal_Unicode)); else { std::size_t nLen = nUnits; sal_Unicode aBuf[384]; sal_Unicode* const pTmp = ( nLen > 384 ? new sal_Unicode[nLen] : aBuf); - memcpy( pTmp, rStr.getStr(), nLen * sizeof(sal_Unicode) ); + memcpy( pTmp, rStr.data(), nLen * sizeof(sal_Unicode) ); sal_Unicode* p = pTmp; const sal_Unicode* const pStop = pTmp + nLen; while ( p < pStop ) @@ -691,11 +691,11 @@ std::size_t write_uInt16s_FromOUString(SvStream& rStrm, const OUString& rStr, return nWritten; } -bool SvStream::WriteUnicodeOrByteText( const OUString& rStr, rtl_TextEncoding eDestCharSet ) +bool SvStream::WriteUnicodeOrByteText( std::u16string_view rStr, rtl_TextEncoding eDestCharSet ) { if ( eDestCharSet == RTL_TEXTENCODING_UNICODE ) { - write_uInt16s_FromOUString(*this, rStr, rStr.getLength()); + write_uInt16s_FromOUString(*this, rStr, rStr.size()); return m_nError == ERRCODE_NONE; } else @@ -711,9 +711,9 @@ bool SvStream::WriteByteStringLine( std::u16string_view rStr, rtl_TextEncoding e return WriteLine(OUStringToOString(rStr, eDestCharSet)); } -bool SvStream::WriteLine(const OString& rStr) +bool SvStream::WriteLine(std::string_view rStr) { - WriteBytes(rStr.getStr(), rStr.getLength()); + WriteBytes(rStr.data(), rStr.size()); endl(*this); return m_nError == ERRCODE_NONE; } @@ -1208,7 +1208,7 @@ OUString SvStream::ReadUniOrByteString( rtl_TextEncoding eSrcCharSet ) return read_uInt16_lenPrefixed_uInt8s_ToOUString(*this, eSrcCharSet); } -SvStream& SvStream::WriteUniOrByteString( const OUString& rStr, rtl_TextEncoding eDestCharSet ) +SvStream& SvStream::WriteUniOrByteString( std::u16string_view rStr, rtl_TextEncoding eDestCharSet ) { // write UTF-16 string directly into stream ? if (eDestCharSet == RTL_TEXTENCODING_UNICODE) @@ -2082,11 +2082,11 @@ OUString convertLineEnd(const OUString &rIn, LineEnd eLineEnd) } std::size_t write_uInt32_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, - const OUString &rStr) + std::u16string_view rStr) { std::size_t nWritten = 0; - sal_uInt32 nUnits = std::min<std::size_t>(rStr.getLength(), std::numeric_limits<sal_uInt32>::max()); - SAL_WARN_IF(static_cast<std::size_t>(nUnits) != static_cast<std::size_t>(rStr.getLength()), + sal_uInt32 nUnits = std::min<std::size_t>(rStr.size(), std::numeric_limits<sal_uInt32>::max()); + SAL_WARN_IF(static_cast<std::size_t>(nUnits) != static_cast<std::size_t>(rStr.size()), "tools.stream", "string too long for prefix count to fit in output type"); rStrm.WriteUInt32(nUnits); @@ -2099,11 +2099,11 @@ std::size_t write_uInt32_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, } std::size_t write_uInt16_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, - const OUString &rStr) + std::u16string_view rStr) { std::size_t nWritten = 0; - sal_uInt16 nUnits = std::min<std::size_t>(rStr.getLength(), std::numeric_limits<sal_uInt16>::max()); - SAL_WARN_IF(nUnits != rStr.getLength(), + sal_uInt16 nUnits = std::min<std::size_t>(rStr.size(), std::numeric_limits<sal_uInt16>::max()); + SAL_WARN_IF(nUnits != rStr.size(), "tools.stream", "string too long for prefix count to fit in output type"); rStrm.WriteUInt16(nUnits); @@ -2116,11 +2116,11 @@ std::size_t write_uInt16_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, } std::size_t write_uInt16_lenPrefixed_uInt8s_FromOString(SvStream& rStrm, - const OString &rStr) + std::string_view rStr) { std::size_t nWritten = 0; - sal_uInt16 nUnits = std::min<std::size_t>(rStr.getLength(), std::numeric_limits<sal_uInt16>::max()); - SAL_WARN_IF(static_cast<std::size_t>(nUnits) != static_cast<std::size_t>(rStr.getLength()), + sal_uInt16 nUnits = std::min<std::size_t>(rStr.size(), std::numeric_limits<sal_uInt16>::max()); + SAL_WARN_IF(static_cast<std::size_t>(nUnits) != static_cast<std::size_t>(rStr.size()), "tools.stream", "string too long for sal_uInt16 count to fit in output type"); rStrm.WriteUInt16( nUnits ); diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx index e17592696195..f4faea88a47d 100644 --- a/vcl/source/animate/Animation.cxx +++ b/vcl/source/animate/Animation.cxx @@ -586,7 +586,7 @@ SvStream& WriteAnimation(SvStream& rOStm, const Animation& rAnimation) rOStm.WriteUInt32(nDummy32); // Unused rOStm.WriteUInt32(nDummy32); // Unused rOStm.WriteUInt32(nDummy32); // Unused - write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, OString()); // dummy + write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, ""); // dummy rOStm.WriteUInt16(nRest); // Count of remaining structures } } diff --git a/vcl/source/gdi/TypeSerializer.cxx b/vcl/source/gdi/TypeSerializer.cxx index 329c9b3f0e6a..4fc05ec5c5d7 100644 --- a/vcl/source/gdi/TypeSerializer.cxx +++ b/vcl/source/gdi/TypeSerializer.cxx @@ -392,7 +392,7 @@ void TypeSerializer::writeGraphic(const Graphic& rGraphic) mrStream.WriteBytes(pVectorGraphicData->getBinaryDataContainer().getData(), nSize); // For backwards compatibility, used to serialize path - mrStream.WriteUniOrByteString(OUString(), mrStream.GetStreamCharSet()); + mrStream.WriteUniOrByteString(u"", mrStream.GetStreamCharSet()); } else if (aGraphic.IsAnimated()) { diff --git a/vcl/source/treelist/imap.cxx b/vcl/source/treelist/imap.cxx index afcc6a8f5a49..02eeec49c8d8 100644 --- a/vcl/source/treelist/imap.cxx +++ b/vcl/source/treelist/imap.cxx @@ -930,7 +930,7 @@ void ImageMap::Write( SvStream& rOStm ) const rOStm.WriteCharPtr( IMAPMAGIC ); rOStm.WriteUInt16( IMAGE_MAP_VERSION ); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aImageName, eEncoding); - write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, OString()); //dummy + write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, ""); //dummy rOStm.WriteUInt16( nCount ); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aImageName, eEncoding); |