[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libreoffice-users] Draw: How to Merge/Subtract/Intersect shapes via macro?


Hi Kamil,

Kamil Landa schrieb am 08-Jan-19 um 13:50:
For example I want to do it for 2 rectangles as from menu Shape ->
Merge/Subtract/Intersect

You can use the dispatcher for it. After the shapes are selected do
for example:
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:Merge", "", 0, Array())

Of cause you need to adapt the identifiers and omit already done declarations.

Array() means, that this uno-command needs no arguments.

The SID in core is SID_POLY_MERGE. Looking in https://opengrok.libreoffice.org/xref/core/svx/sdi/svx.sdi#5675
you see, that the argument brackets () are empty.

The others are accordingly .uno:Subtract and .uno:Intersect

Kind regards
Regina

--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.