office-gobmx/svtools
Mike Kaganski 7749f93138 Make replacement graphic management more atomic
Commit 8872f7121b (crashtesting: crash
on exporting kde274105-6.docx to .rtf, 2024-03-27) added some safety
code in EmbeddedObjectRef::GetReplacement. It mentioned, that there
are likely some bugs in the management of the graphic.

This tries to fix this management, avoiding the intermediate states,
and only changing the graphic when all the data is ready. This also
reverts the changes of the mentioned commit, obsoleted now; and of
commit 8780fa41dc (svtools: fix lost
replacement grpahic when updating it via OLE fails, 2018-10-30);
but keeps commit 24231f2a33 (svtools:
fix lost replacement non-rendered graphic when updating it fails,
2022-02-17).

This has revealed that the second part of unit test for tdf#143222
("Check export of embedded worksheet in slide"), introduced in
commit 92a407b7f9 (tdf143222 Handle
alternate content of graphicData element., 2021-07-08), has never
really worked: the "pGraphic != nullptr" check would never fail;
in fact, that used to always return an empty graphic. The problem
was filed as tdf#163064, and the test was modified accordingly.

Commit 5d997c029e (sw XHTML export:
improve dummy OLE object handling, 2018-08-30) made ReqIF export
handle missing replacement graphic. However, it had assumed that
SwOLENode::GetGraphic always returns a valid pointer even for the
missing data. That is fixed here in OutHTML_FrameFormatOLENodeGrf.

Other places, where the pointer was dereferenced unconditionally,
were fixed (keeping current behavior).

Change-Id: Ica97a691ecc11b856bdb003f89467ea3392684bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173716
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-21 14:57:52 +02:00
..
inc
langsupport
qa
source Make replacement graphic management more atomic 2024-09-21 14:57:52 +02:00
uiconfig/ui
util
AllLangMoTarget_svt.mk
CppunitTest_svtools_dialogs_test.mk
CppunitTest_svtools_graphic.mk
CppunitTest_svtools_html.mk
Executable_langsupport.mk
IwyuFilter_svtools.yaml
JunitTest_svtools_unoapi.mk
Library_svt.mk
Makefile
Module_svtools.mk
README.md
UIConfig_svt.mk

Tools on the Top of VCL

Common dialogs, file and print dialogs, wizards, vcl filters, lots of helper code.