sw/source/uibase/uno/unotxdoc.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cf4b670229eb8b555dde848ef53108cb2a4ee89b
Author:     Miklos Vajna <[email protected]>
AuthorDate: Mon Jul 4 13:05:08 2022 +0200
Commit:     Gökay ŞATIR <[email protected]>
CommitDate: Tue Jul 5 11:35:28 2022 +0200

    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.
    
    (cherry picked from commit 4002a399af823055b6ba59db18ded1caba4969c9)
    
    Change-Id: Ica42939f6564da3d59396a4b302be826d3968f8d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136808
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Gökay ŞATIR <[email protected]>

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 1d68e037d949..8f9b28e01dec 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3428,7 +3428,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")

Reply via email to