diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-04-09 11:36:51 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-04-09 11:57:29 +0200 |
commit | 626605218359df6c3f9274e57cb5ef0886b890fc (patch) | |
tree | 0adbdffd06ba27f4c57093390a8665670ab1012c /solenv/gdb/libreoffice | |
parent | b2867b01418fc7a1e80589224345d2b224bcf3fc (diff) |
pretty-print SwUnoCrsr
Change-Id: Ia79e582002c92591694815580eff905b864ea6c5
Diffstat (limited to 'solenv/gdb/libreoffice')
-rw-r--r-- | solenv/gdb/libreoffice/sw.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py index 1a06139f18b5..f5cdc292e9d3 100644 --- a/solenv/gdb/libreoffice/sw.py +++ b/solenv/gdb/libreoffice/sw.py @@ -83,6 +83,9 @@ class SwPaMPrinter(object): children.append(("prev", prev)) return children.__iter__() +class SwUnoCrsrPrinter(SwPaMPrinter): + '''Prints SwUnoCrsr.''' + class SwRectPrinter(object): '''Prints SwRect.''' @@ -119,6 +122,23 @@ class SwIMarkPrinter(object): else: return self._iterator(self.value) +class SwModifyPrinter(object): + '''Prints SwModify.''' + + def __init__(self, typename, value): + self.typename = typename + self.value = value + + def to_string(self): + return "%s" % (self.typename) + + def children(self): + if str(self.value.dynamic_type) == "SwUnoCrsr": + unoCrsr = self.value.cast(self.value.dynamic_type) + return SwUnoCrsrPrinter(self.typename, unoCrsr).children() + else: + return self._iterator(self.value) + class SwXTextRangeImplPrinter(object): '''Prints SwXTextRange::Impl.''' @@ -279,11 +299,13 @@ def build_pretty_printers(): printer.add('SwNodeIndex', SwNodeIndexPrinter) printer.add('SwIndex', SwIndexPrinter) printer.add('SwPaM', SwPaMPrinter) + printer.add('SwUnoCrsr', SwUnoCrsrPrinter) printer.add('SwRect', SwRectPrinter) printer.add('sw::mark::IMark', SwIMarkPrinter) printer.add('SwXTextRange::Impl', SwXTextRangeImplPrinter) printer.add('sw::UnoImplPtr', SwUnoImplPtrPrinter) printer.add('SwXTextRange', SwXTextRangePrinter) + printer.add('SwModify', SwModifyPrinter) def register_pretty_printers(obj): printing.register_pretty_printer(printer, obj) |