diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-01-02 02:09:28 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-01-02 03:51:11 +0100 |
commit | 615cd2637a1c7be897ad4b7d86a4495b0720183e (patch) | |
tree | aeecf7a732345677fc5ca8246374af5c41e40790 /solenv/gdb | |
parent | 480e943f0100154fa82942db092ed1f66b76ef66 (diff) |
GDB: pretty-print more sw::mark::MarkBase classes
Generalize the UnoMark pretty printer to actually print many
objects inheriting from sw::mark::MarkBase.
Also adds the mark name to the output.
Change-Id: Idaec06ba448702ee3a47b474736df954646c0300
Diffstat (limited to 'solenv/gdb')
-rw-r--r-- | solenv/gdb/libreoffice/sw.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py index ddbbb42d8785..8ccdbf483d21 100644 --- a/solenv/gdb/libreoffice/sw.py +++ b/solenv/gdb/libreoffice/sw.py @@ -89,8 +89,8 @@ class SwRectPrinter(object): children = [ ( 'point', point), ( 'size', size ) ] return children.__iter__() -class SwUnoMarkPrinter(object): - '''Prints sw::mark::UnoMark.''' +class MarkBasePrinter(object): + '''Prints sw::mark::MarkBase.''' def __init__(self, typename, value): self.typename = typename @@ -100,11 +100,9 @@ class SwUnoMarkPrinter(object): return "%s" % (self.typename) def children(self): - unoMark = self.value.cast(self.value.dynamic_type) - pos1 = unoMark['m_pPos1'] - pos2 = unoMark['m_pPos2'] - children = [ ( 'pos1', pos1), ( 'pos2', pos2 ) ] - return children.__iter__() + m = self.value.cast(self.value.dynamic_type) + return [ ( v, m[ v ] ) + for v in ( 'm_aName', 'm_pPos1', 'm_pPos2' ) ].__iter__() class SwXTextRangeImplPrinter(object): '''Prints SwXTextRange::Impl.''' @@ -293,7 +291,10 @@ def build_pretty_printers(): printer.add('SwPaM', SwPaMPrinter) printer.add('SwUnoCrsr', SwUnoCrsrPrinter) printer.add('SwRect', SwRectPrinter) - printer.add('sw::mark::UnoMark', SwUnoMarkPrinter) + printer.add('sw::mark::Bookmark', MarkBasePrinter) + printer.add('sw::mark::MarkBase', MarkBasePrinter) + printer.add('sw::mark::UnoMark', MarkBasePrinter) + printer.add('sw::mark::IMark', MarkBasePrinter) printer.add('SwXTextRange::Impl', SwXTextRangeImplPrinter) printer.add('sw::UnoImplPtr', SwUnoImplPtrPrinter) printer.add('SwXTextRange', SwXTextRangePrinter) |