office-gobmx/sw/qa/core
Miklos Vajna f9f2b7590b tdf#159379 sw: fix crash on dropping multiple as-char images
Have an empty Writer document, set preferences so images created via
drag&drop are anchored as-char, drop 2 images from a file manager,
crash.

The root of the problem is that the first image gets dropped fine, but
the second one would be anchored to the currently selected graphic node,
since commit 651527b4ef (sw: fix
double-click opening frame dialog, not graphic dialog on images,
2022-04-26).

The new SwTextCursor::GetModelPositionForViewPoint() returning a graphic
node for a point inside the image looks correct, so fix the problem by
extending SwFEShell::Insert() to take the anchor position as the anchor
for the new image, in case a graphic node is selected.

The original use-case would use SwEditWin::ExecuteDrop(), but keep the
test simple and invoke the underlying SwFEShell::Insert() instead, that
also triggers the problem.

Change-Id: Ibba57aa28d0616ded16b4abb314f04974f1b8f9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166499
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-04-23 09:48:01 +02:00
..
accessibilitycheck
attr
crsr
data
doc
docnode
draw
edit
exportdata
fields
frmedt tdf#159379 sw: fix crash on dropping multiple as-char images 2024-04-23 09:48:01 +02:00
header_footer
layout
objectpositioning
text -Werror,-Wunused-variable 2024-04-21 22:05:16 +02:00
theme
tox
txtnode
undo
unocore
view
filters-test.cxx
macros-test.cxx
performance-jobfile
Test-BigPtrArray.cxx
test_rect.cxx
test_region.cxx
test_ToxLinkProcessor.cxx
test_ToxMiscTest.cxx
test_ToxTextGenerator.cxx
test_ToxWhitespaceStripper.cxx
uwriter.cxx