summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-07-04 13:05:08 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-07-04 16:28:53 +0200
commit4002a399af823055b6ba59db18ded1caba4969c9 (patch)
tree93f35d6fa7807fd72806168001f55bdd09e22f03
parent895643431e6aea672158bae3772a36f26cd05cde (diff)
sw content control, picture, lok: fix change of placeholder after insert
Commit c769c369c87a46ec877b7eefee27988044a2798f (sw content controls: fix picture placeholders, 2022-07-01) fixed picture placeholders on the desktop, but left the LOK case still broken. This is a problem since picture placeholders are protected (which is wanted), and these only allow SID_CHANGE_PICTURE, not SID_INSERT_GRAPHIC. Fix the problem by adapting SwXTextDocument::executeContentControlEvent() to dispatch SID_CHANGE_PICTURE (and not SID_INSERT_GRAPHIC), but do keep the slot ID of the argument as SID_INSERT_GRAPHIC, since SwView::InsertGraphicDlg() looks for a non-interactive URL as SID_INSERT_GRAPHIC even if we're changing an image, not inserting a new one. This means that LOK clients can't use SID_INSERT_GRAPHIC to change picture placeholders, they have to go via SwXTextDocument::executeContentControlEvent(), which is what gtktiledviewer does already. Change-Id: Ica42939f6564da3d59396a4b302be826d3968f8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136797 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index b3f6e2e7487f..b59795d3c2a4 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3423,7 +3423,7 @@ void SwXTextDocument::executeContentControlEvent(const StringMap& rArguments)
// The current placeholder is selected, so this will replace, not insert.
SfxStringItem aItem(SID_INSERT_GRAPHIC, it->second);
- pView->GetViewFrame()->GetDispatcher()->ExecuteList(SID_INSERT_GRAPHIC,
+ pView->GetViewFrame()->GetDispatcher()->ExecuteList(SID_CHANGE_PICTURE,
SfxCallMode::SYNCHRON, { &aItem });
}
else if (it->second == "date")