diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-08-07 12:55:27 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-08-07 12:58:00 +0200 |
commit | 17de4ca19c756b169529d4426cd5df501d323382 (patch) | |
tree | 3a94a034f04b3b76aaa21e1033debe65a9dcf70f /solenv/gdb | |
parent | 36233b158b5de6c474f06c8c8772f0012b191baa (diff) |
gdb: add pretty-printer for tools Rectangle
Change-Id: I9c6f4b54254fa7a1b91f0bf1a19d16bb3778a2be
Diffstat (limited to 'solenv/gdb')
-rw-r--r-- | solenv/gdb/libreoffice/tl.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py index 36024e2a9cf6..8c717d004cd8 100644 --- a/solenv/gdb/libreoffice/tl.py +++ b/solenv/gdb/libreoffice/tl.py @@ -370,6 +370,24 @@ class SizePrinter(object): children = [('width', width), ('height', height)] return children.__iter__() +class RectanglePrinter(object): + '''Prints a Rectangle.''' + + def __init__(self, typename, value): + self.typename = typename + self.value = value + + def to_string(self): + return "%s" % (self.typename) + + def children(self): + left = self.value['nLeft'] + top = self.value['nTop'] + right = self.value['nRight'] + bottom = self.value['nBottom'] + children = [('left', left), ('top', top), ('right', right), ('bottom', bottom)] + return children.__iter__() + printer = None def build_pretty_printers(): @@ -396,6 +414,7 @@ def build_pretty_printers(): printer.add('Time', TimePrinter) printer.add('Point', PointPrinter) printer.add('Size', SizePrinter) + printer.add('Rectangle', RectanglePrinter) def register_pretty_printers(obj): printing.register_pretty_printer(printer, obj) |