Bug 168237 - FILESAVE EMF OOXML regression: 'Wall Chart' resizes after reopen DOCX containing chart pasted form Excel
Summary: FILESAVE EMF OOXML regression: 'Wall Chart' resizes after reopen DOCX contain...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.6.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest, filter:emf, filter:ooxml, regression
Depends on: 163158
Blocks: EMF-WMF DOCX-Images
  Show dependency treegraph
 
Reported: 2025-09-01 16:47 UTC by Piotr Osada
Modified: 2026-03-14 20:33 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Bug summary image (91.83 KB, image/png)
2025-09-01 16:49 UTC, Piotr Osada
Details
Bug behavior and EMF Parser logs (2.90 MB, application/pdf)
2025-09-01 17:09 UTC, Piotr Osada
Details
Example spreadsheet (28.75 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-09-01 17:28 UTC, Piotr Osada
Details
ODT works fine (53.19 KB, application/vnd.oasis.opendocument.text)
2025-09-09 08:37 UTC, Piotr Osada
Details
ODT works fine (exported PDF) (123.12 KB, application/pdf)
2025-09-09 08:37 UTC, Piotr Osada
Details
DOCX has a problem (340.39 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-09-09 08:38 UTC, Piotr Osada
Details
DOCX has a problem (exported PDF) (775.76 KB, application/pdf)
2025-09-09 08:39 UTC, Piotr Osada
Details
Regression comparison: Left 3.5.7.2, Right 4.0.6.2 (565.59 KB, image/png)
2025-10-25 12:11 UTC, Piotr Osada
Details
LO3.5.7.2 docx - correct chart (7.08 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-10-25 12:13 UTC, Piotr Osada
Details
LO4.0.6.2 docx - resized chart (5.79 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-10-25 12:13 UTC, Piotr Osada
Details
Wrong WMF image extracted from Docx (20.56 KB, image/wmf)
2026-02-15 19:10 UTC, Bartosz
Details
Unusual double EMF+ headers inside file which causing problems (127.15 KB, image/png)
2026-02-15 20:19 UTC, Bartosz
Details
Comment 16: clipboard content 7z (54.30 KB, application/x-compressed)
2026-02-16 20:49 UTC, Piotr Osada
Details
InsideClipboard's .clp content.zip (6.59 KB, application/x-zip-compressed)
2026-02-16 21:00 UTC, Piotr Osada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Osada 2025-09-01 16:47:33 UTC
+++ This bug was initially created as a clone of Bug #163158 +++

Writer loses chart ploting area ('Chart Wall') dimensions when save document with graph pasted as GDI metafile from Excel

This is an interoperability issue. When copying from Excel any chart and pasting it as vector graphic using GDI-pasted vector image, this image will be transformed in size after save as DOCX.
When copying similarly from Calc the saved DOCX retains proper graphs.



Steps:
1) In MS Excel copy any chart
2) In LO Writer: Ctrl+Shift+V
3) Paste special → Graphics Device Interface metafile (GDI)
4) Save as DOCX
5) Reopen DOCX in Writer or Word


Result:
The ‘Chart Wall’ (plot region) shows a small part (aproximately 20% x 20%) of the original chart, stretched across the entire wall starting from the top-left corner. 


Expected:
A chart inserted in document as a vector graphic (using GDI interface) should retain the same proportions as it appears in spreadsheet applications. 


Version: 25.8.1.1 (X86_64)
Build ID: 54047653041915e595ad4e45cccea684809c77b5
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded

Microsoft® Word for Microsoft 365 MSO (Version 2507 Build 16.0.19029.20136) 64-bit
Comment 1 Piotr Osada 2025-09-01 16:49:38 UTC
Created attachment 202647 [details]
Bug summary image
Comment 2 Piotr Osada 2025-09-01 17:09:40 UTC
Created attachment 202648 [details]
Bug behavior and EMF Parser logs

EMFParser can be downloaded from here:
https://download.cnet.com/download/emf-parser/3000-2383_4-10558240.html
Comment 3 Piotr Osada 2025-09-01 17:28:53 UTC
Created attachment 202649 [details]
Example spreadsheet
Comment 4 Bartosz 2025-09-08 23:30:28 UTC
Thanks Piotr.
Please paste the spreadsheet after pasting the GDI-pasted vector image.

Example file is opening correctly.
Comment 5 Piotr Osada 2025-09-09 08:33:44 UTC
Hi Bartosz,
the issue is action between MS Excel and LO Writer. 

(Not inside spreadsheet, e.g. Calc to Calc copy-paste.)
Comment 6 Piotr Osada 2025-09-09 08:37:05 UTC
Created attachment 202759 [details]
ODT works fine
Comment 7 Piotr Osada 2025-09-09 08:37:56 UTC
Created attachment 202760 [details]
ODT works fine (exported PDF)
Comment 8 Piotr Osada 2025-09-09 08:38:40 UTC
Created attachment 202761 [details]
DOCX has a problem
Comment 9 Piotr Osada 2025-09-09 08:39:08 UTC
Created attachment 202762 [details]
DOCX has a problem (exported PDF)
Comment 10 Piotr Osada 2025-09-13 09:40:35 UTC
Same behavior in:

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b33cc5a7388c1739ff4a02a84751800f3e3086ce
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded
https://dev-builds.libreoffice.org/daily/master/Win-x86_64@tb77-TDF/2025-09-12_03.31.47/
Comment 11 Piotr Osada 2025-10-25 09:42:38 UTC
LO 3.5 puts WMF into *.DOCX\word\media and image is displayed correctly (without rescaling).
LibreOffice 3.5.7.2 
Build ID: 3215f89-f603614-ab984f2-7348103-1225a5b


LO 4.0 saves EMF into *.DOCX\word\media and image is resized after reopen.
Wersja 4.0.6.2 (Build ID: 2e2573268451a50806fcd60ae2d9fe01dd0ce24)
Comment 12 Piotr Osada 2025-10-25 12:11:57 UTC
Created attachment 203533 [details]
Regression comparison: Left 3.5.7.2, Right 4.0.6.2
Comment 13 Piotr Osada 2025-10-25 12:13:14 UTC
Created attachment 203534 [details]
LO3.5.7.2 docx - correct chart
Comment 14 Piotr Osada 2025-10-25 12:13:59 UTC
Created attachment 203535 [details]
LO4.0.6.2 docx - resized chart
Comment 15 Bartosz 2026-02-15 19:10:45 UTC
Created attachment 205534 [details]
Wrong WMF image extracted from Docx
Comment 16 Bartosz 2026-02-15 19:48:29 UTC
Hi Piotr,
It would be great to get the content of the Clipboard before pasting it into LibreOffice.
To do that you could try to install external tools. like:

https://www.nirsoft.net/utils/inside_clipboard.html#:~:text=InsideClipboard%20is%20a%20small%20utility,you%20to%20save%20the%20content
or 

https://bjansen.github.io/scoop-apps/nirsoft/insideclipboard/

Some more information is also available at:
https://stackoverflow.com/questions/18602171/copy-enhanced-metafile-from-clipboard-and-save-it-as-an-image
Comment 17 Bartosz 2026-02-15 20:19:12 UTC
Created attachment 205535 [details]
Unusual double EMF+ headers inside file which causing problems
Comment 19 Piotr Osada 2026-02-16 20:49:03 UTC
Created attachment 205560 [details]
Comment 16: clipboard content 7z

(In reply to Bartosz from comment #16)

Hi Bartosz, here is the clipboard content captured using InsideClipboard v1.30 (NirSoft) after copying a chart from the attachment 202649 [details] in Excel 365 (Version 2601 Build 16.0.19628.20204) 64-bit. The archive contains all clipboard formats available at the time of copy.
Comment 20 Piotr Osada 2026-02-16 21:00:55 UTC
Created attachment 205561 [details]
InsideClipboard's .clp content.zip

What is interesting is that InsideClipboard's format (.clp) can be opened as an archive in 7-Zip, revealing a full OOXML structure inside (charts, drawings, theme, _rels, [Content_Types].xml).