[Libreoffice-commits] .: solenv/gdb

Miklos Vajna vmiklos at kemper.freedesktop.org
Tue Jul 10 08:48:14 PDT 2012


 solenv/gdb/libreoffice/tl.py |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 53f9b54f73f313814b7f1217a4e37f5dc6bd5a45
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue Jul 10 17:47:02 2012 +0200

    gdb: add pretty-printer for tools Point
    
    nA is X, nB is Y, but finally it's now pointless to remember that
    
    Change-Id: I9fb1f6518e33862663a5bd5e28876979f0f1e05f

diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py
index 9571573..b800710 100644
--- a/solenv/gdb/libreoffice/tl.py
+++ b/solenv/gdb/libreoffice/tl.py
@@ -338,6 +338,22 @@ class TablePrinter(ContainerHelper):
     def display_hint(self):
         return 'map'
 
+class PointPrinter(object):
+    '''Prints a Point.'''
+
+    def __init__(self, typename, value):
+        self.typename = typename
+        self.value = value
+
+    def to_string(self):
+        return "%s" % (self.typename)
+
+    def children(self):
+        x = self.value['nA']
+        y = self.value['nB']
+        children = [('x', x), ('y', y)]
+        return children.__iter__()
+
 printer = None
 
 def build_pretty_printers():
@@ -362,6 +378,7 @@ def build_pretty_printers():
     printer.add('DateTime', DateTimePrinter)
     printer.add('Date', DatePrinter)
     printer.add('Time', TimePrinter)
+    printer.add('Point', PointPrinter)
 
 def register_pretty_printers(obj):
     printing.register_pretty_printer(printer, obj)


More information about the Libreoffice-commits mailing list