On 2018/08/02 9:57 AM, Miklos Vajna wrote: > On Wed, Aug 01, 2018 at 04:52:14PM +0530, Saurav Chirania <saurav.chir at gmail.com> wrote: >> There are dispatch commands (like .uno:FontDialog) which open a dialog when >> executed. There are other dispatch commands (like .uno:GoDown) which don't >> open a dialog when executed. Do we have a function using which I can know >> whether or not a command opens a dialog? If not, will it be possible to >> implement such a function? Which parts of the code should I look into for >> implementing such a function? > > I don't think we have code for this at the moment. You could add a flag > in the .sdi files for this purpose, but having to go through all > commands in sdi files to add this annotation will be quite painful, I > fear. > Possible hack solution: Create a thread_local bool flag, which is cleared on entry to the dispatch logic, and is set by the create-a-dialog logic. On exit from the dispatch logic, check the flag and return true if the a dialog was created. Note that there is more than one way to create a dialog, so this flag would need to be set in a handful of places.