diff options
Diffstat (limited to 'solenv')
-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) |