summaryrefslogtreecommitdiff
path: root/sw/source/filter/html/htmlreqifreader.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-04-29 17:21:54 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-04-30 17:37:22 +0200
commitd3ab4fc0ba8e62d4f25caf5d759eb54d3f7ecd94 (patch)
tree659d7e0f37b6178b633c94bade75cd779028d5f5 /sw/source/filter/html/htmlreqifreader.cxx
parent6544a10541fce546034a5411cd6333c2d94fe965 (diff)
sw html/reqif export: fix size of presentation data for "real" OLE2 embedding
InsertOLE1Header() can either take its OLE1 presentation data (preview) from OLE2 or from RTF (SwOLENode). The presentation data size we wrote was incorrect in the OLE2 case case: nPresentationData is the RTF size, nBytes is the actual buffer size. In practice this made the embedded object non-editable in Word (when trying to edit the RTF fragment). This went wrong in commit 0d027abbc5609b096d2a954e77aa7354a55928ab (sw reqif-xhtml export, embedded objects: take OLE1 pres data from rtf if needed, 2020-09-02). (cherry picked from commit 58607e1c410ee89ddfd47dcd128abfa00e0ac839) Change-Id: I89019202c9a8b40c1b9a21f611f1190fd50073a5
Diffstat (limited to 'sw/source/filter/html/htmlreqifreader.cxx')
-rw-r--r--sw/source/filter/html/htmlreqifreader.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/filter/html/htmlreqifreader.cxx b/sw/source/filter/html/htmlreqifreader.cxx
index a59f56ee40ee..47cf2341e1e5 100644
--- a/sw/source/filter/html/htmlreqifreader.cxx
+++ b/sw/source/filter/html/htmlreqifreader.cxx
@@ -341,8 +341,8 @@ OString InsertOLE1Header(SvStream& rOle2, SvStream& rOle1, sal_uInt32& nWidth, s
rOle1.WriteUInt32(nWidth);
// Height.
rOle1.WriteUInt32(nHeight * -1);
- // PresentationDataSize
- rOle1.WriteUInt32(8 + nPresentationData);
+ // PresentationDataSize: size of (reserved fields + pBytes).
+ rOle1.WriteUInt32(8 + nBytes);
// Reserved1-4.
rOle1.WriteUInt16(0x0008);
rOle1.WriteUInt16(0x31b1);