From 60d1f712f4d130843516f159620ece9a1cb6d87a Mon Sep 17 00:00:00 2001 From: Philippe Jung Date: Fri, 17 Mar 2017 14:39:29 +0100 Subject: [PATCH] Add script to list dispatch commands from https://wiki.documentfoundation.org/Development/DispatchCommands Change-Id: I996f3585bbbb18eb4b425cdd807f15d848cced36 Reviewed-on: https://gerrit.libreoffice.org/35337 Tested-by: Jenkins Reviewed-by: Thorsten Behrens --- bin/list-dispatch-commands.php | 147 +++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100755 bin/list-dispatch-commands.php diff --git a/bin/list-dispatch-commands.php b/bin/list-dispatch-commands.php new file mode 100755 index 000000000000..7519be9d3f07 --- /dev/null +++ b/bin/list-dispatch-commands.php @@ -0,0 +1,147 @@ +#!/usr/bin/env php +slotId = $slotId; + $allSlots[$slotName]->slotRID = $slotRID; + $allSlots[$slotName]->mode = $mode; + $allSlots[$slotName]->slotDescription = ""; + } + } + $index++; + } +} + +function analyseXCU($fileName) +{ + global $allSlots; + + $lines = file($fileName); + $index = 0; + $count = count($lines); + + while ($index < $count) + { + $aLine = $lines[$index]; + if (strpos($aLine, '') === FALSE ) { + $index++; + $aLine = $lines[$index]; + } + $aLine = str_replace('', '', $aLine); + $aLine = trim(str_replace('', '', $aLine)); + if (array_key_exists($slotName, $allSlots)) + $allSlots[$slotName]->slotDescription = str_replace('~', '', $aLine); + } + $index++; + } +} + + +if (count($argv) != 2) { + print "Syntax error: ids.php module\n\n"; + print " Module is one of:\n"; + print " basslots\n"; + print " scslots\n"; + print " sdgslots\n"; + print " sdslots\n"; + print " sfxslots\n"; + print " smslots\n"; + print " svxslots\n"; + print " swslots\n"; + exit(1); +} + +$allSlots = array(); + +foreach (getFilesList("./workdir/SdiTarget", ".hxx") as $sdiFile) + if (basename($sdiFile, ".hxx") === $argv[1]) + analyseFile($sdiFile); + +foreach (getFilesList("officecfg/registry/data/org/openoffice/Office/UI", ".xcu") as $xcuFile) + analyseXCU($xcuFile); + +ksort($allSlots); +foreach ($allSlots as $name => $props) { + printf("|-\n| %s\n| %s\n| %d\n| %s\n| %s\n", + $name, $props->slotRID, $props->slotId, $props->mode, $props->slotDescription); +} +print ("|-\n"); + +?>