office-gobmx/sw/sdi/_grfsh.sdi
Miklos Vajna c769c369c8 sw content controls: fix picture placeholders
This went wrong in commit c321498f91 (sw
content controls: reject typing inside checkbox or picture content
controls, 2022-06-10), now a freshly inserted picture content control is
not replaced with an image on click.

The problem is that we want to forbid typing into a picture content
control (it should only host a single as-char image), but changing the
picture's bitmap is meant to be still possible.

Fix the problem by allowing SID_CHANGE_PICTURE even if the cursor is
protected: this allows changing the picture again, and a real read-only
document still doesn't show the "change" menu item in its context menu.

If we later find some other corner-case where this command should be
still disabled, we can extend SwGrfShell::GetAttrState(), similar to how
e.g. inserting images in input fields is disabled there.

Change-Id: I8b55e930330b9748ecda950dedae907b86c57e2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136729
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-07-01 13:08:55 +02:00

271 lines
7.9 KiB
Text

/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
interface BaseTextGraphic
{
SID_FLIP_VERTICAL
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_FLIP_HORIZONTAL
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
FN_FORMAT_GRAFIC_DLG // status(final|play)
[
ExecMethod = Execute ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
FN_DRAW_WRAP_DLG // status(final|play)
[
ExecMethod = Execute ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_SAVE_GRAPHIC
[
ExecMethod = Execute ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_COMPRESS_GRAPHIC
[
ExecMethod = Execute ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_CHANGE_PICTURE
[
ExecMethod = Execute ;
StateMethod = GetAttrState ;
]
SID_EXTERNAL_EDIT
[
ExecMethod = Execute ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ROTATE_GRAPHIC_LEFT
[
ExecMethod = ExecuteRotation ;
StateMethod = GetAttrStateForRotation ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ROTATE_GRAPHIC_180
[
ExecMethod = ExecuteRotation ;
StateMethod = GetAttrStateForRotation ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ROTATE_GRAPHIC_RIGHT
[
ExecMethod = ExecuteRotation ;
StateMethod = GetAttrStateForRotation ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ROTATE_GRAPHIC_RESET
[
ExecMethod = ExecuteRotation ;
StateMethod = GetAttrStateForRotation ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_TRANSFORM_ANGLE
[
ExecMethod = ExecuteRotation ;
StateMethod = GetAttrStateForRotation ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_OBJECT_CROP
[
ExecMethod = Execute ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_INSERT_GRAPHIC // points to FN_FORMAT_GRAFIC_DLG
[
ExecMethod = Execute ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_TWAIN_TRANSFER
[
ExecMethod = Execute ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
FN_GRAPHIC_MIRROR_ON_EVEN_PAGES // status(final|play|rec)
[
ExecMethod = Execute ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GRAF_LUMINANCE // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GRAF_CONTRAST // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GRAF_RED // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GRAF_GREEN // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GRAF_BLUE // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GRAF_GAMMA // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GRAF_TRANSPARENCE // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GRAF_INVERT // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GRAF_MODE // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER_INVERT // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER_SMOOTH // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER_SHARPEN // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER_REMOVENOISE // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER_SOBEL // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER_MOSAIC // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER_EMBOSS // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER_POSTER // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER_POPART // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER_SEPIA // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_GRFFILTER_SOLARIZE // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_COLOR_SETTINGS // status(final|play|rec)
[
ExecMethod = ExecAttr ;
StateMethod = GetAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
}