diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-07-11 09:15:32 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-07-11 09:23:20 +0200 |
commit | d323a8a0b5d32385835afb6a109d16e001721fb2 (patch) | |
tree | 770d0ea7fd959f5b50dd7051d722b73df8e7597d /solenv/gdb | |
parent | 3396c06c55ad5d5345aabfcf7efc674aaaa7f9a6 (diff) |
gdb: add pretty-printer for tools Size
Change-Id: I3ff6568e34698d414ca7e4c631d32156b9d28cf0
Diffstat (limited to 'solenv/gdb')
-rw-r--r-- | solenv/gdb/libreoffice/tl.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py index b8007108dc47..36024e2a9cf6 100644 --- a/solenv/gdb/libreoffice/tl.py +++ b/solenv/gdb/libreoffice/tl.py @@ -354,6 +354,22 @@ class PointPrinter(object): children = [('x', x), ('y', y)] return children.__iter__() +class SizePrinter(object): + '''Prints a Size.''' + + def __init__(self, typename, value): + self.typename = typename + self.value = value + + def to_string(self): + return "%s" % (self.typename) + + def children(self): + width = self.value['nA'] + height = self.value['nB'] + children = [('width', width), ('height', height)] + return children.__iter__() + printer = None def build_pretty_printers(): @@ -379,6 +395,7 @@ def build_pretty_printers(): printer.add('Date', DatePrinter) printer.add('Time', TimePrinter) printer.add('Point', PointPrinter) + printer.add('Size', SizePrinter) def register_pretty_printers(obj): printing.register_pretty_printer(printer, obj) |