From 64989e44b28efef7ff90362f8a13a76c73a53bc4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 10 Oct 2019 11:54:27 +0200 Subject: convert WriteCharPtr..getStr to WriteOString and improve the WriteOString method, we can avoid the strlen here, we already have the length One change in behaviour to be noted - if the string contains trailing zero bytes, which ARE INCLUDED IN THE STRING LENGTH, i.e. I'm not talking about the normal terminating zero, then this patch changes behaviour because we will now write those zeros to the stream. [ Just the sw/source/filter/html/htmlreqifreader.cxx part. ] (cherry picked from commit 241bee7e4be6a205fae0d3f5508e084462c7ca55) Change-Id: I4668b9b9eb877f820b1dc70d6cd10ba2623bc0a2 --- sw/source/filter/html/htmlreqifreader.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sw/source/filter/html/htmlreqifreader.cxx b/sw/source/filter/html/htmlreqifreader.cxx index 91197d5a5efc..c2c0df2e54cb 100644 --- a/sw/source/filter/html/htmlreqifreader.cxx +++ b/sw/source/filter/html/htmlreqifreader.cxx @@ -324,13 +324,13 @@ void WrapOleGraphicInRtf(SvStream& rRtf, const SwOLENode& rOLENode, const Graphi rRtf.WriteCharPtr(OOO_STRING_SVTOOLS_RTF_WMETAFILE "8"); Size aSize(rOLENode.GetTwipSize()); rRtf.WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PICW); - rRtf.WriteCharPtr(OString::number(aSize.getWidth()).getStr()); + rRtf.WriteOString(OString::number(aSize.getWidth())); rRtf.WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PICH); - rRtf.WriteCharPtr(OString::number(aSize.getHeight()).getStr()); + rRtf.WriteOString(OString::number(aSize.getHeight())); rRtf.WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PICWGOAL); - rRtf.WriteCharPtr(OString::number(aSize.getWidth()).getStr()); + rRtf.WriteOString(OString::number(aSize.getWidth())); rRtf.WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PICHGOAL); - rRtf.WriteCharPtr(OString::number(aSize.getHeight()).getStr()); + rRtf.WriteOString(OString::number(aSize.getHeight())); SvMemoryStream aGraphicStream; if (GraphicConverter::Export(aGraphicStream, rGraphic, ConvertDataFormat::WMF) == ERRCODE_NONE) { @@ -417,9 +417,9 @@ bool WrapOleInRtf(SvStream& rOle2, SvStream& rRtf, SwOLENode& rOLENode) // Object size. rRtf.WriteCharPtr(OOO_STRING_SVTOOLS_RTF_OBJW); - rRtf.WriteCharPtr(OString::number(nWidth).getStr()); + rRtf.WriteOString(OString::number(nWidth)); rRtf.WriteCharPtr(OOO_STRING_SVTOOLS_RTF_OBJH); - rRtf.WriteCharPtr(OString::number(nHeight).getStr()); + rRtf.WriteOString(OString::number(nHeight)); // Start objdata. rRtf.WriteCharPtr( -- cgit v1.2.3