diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-10 11:54:27 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-09-02 16:39:28 +0200 |
commit | 64989e44b28efef7ff90362f8a13a76c73a53bc4 (patch) | |
tree | df649be340f571343ec280fc954c2123006b7da0 | |
parent | 878de7be446bca37c1067e552998830e75a615bd (diff) |
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
-rw-r--r-- | sw/source/filter/html/htmlreqifreader.cxx | 12 |
1 files 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( |