bump product version to 5.0.4.1
[LibreOffice.git] / solenv / gdb / libreoffice / writerfilter.py
blob5b653217e239bff2f8b76b814e947979194bedf3
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 from libreoffice.util import printing
12 class OOXMLPropertySetPrinter(object):
13 '''Prints writerfilter::ooxml::OOXMLPropertySetImpl'''
15 def __init__(self, typename, value):
16 self.typename = typename
17 self.value = value
19 def to_string(self):
20 return "%s" % (self.typename)
22 def children(self):
23 children = [ ( 'properties', self.value['mProperties'] ) ]
24 return children.__iter__()
26 class OOXMLPropertyPrinter(object):
27 '''Prints writerfilter::ooxml::OOXMLPropertyImpl'''
29 def __init__(self, typename, value):
30 self.typename = typename
31 self.value = value
33 def to_string(self):
34 return "%s" % (self.typename)
36 def children(self):
37 children = [ ( 'id', self.value['mId'] ),
38 ( 'type', self.value['meType'] ),
39 ( 'value', self.value['mpValue'] ) ]
40 return children.__iter__()
42 class OOXMLPropertySetValuePrinter(object):
43 '''Prints writerfilter::ooxml::OOXMLPropertySetValue'''
45 def __init__(self, typename, value):
46 self.typename = typename
47 self.value = value
49 def to_string(self):
50 return "%s" % (self.typename)
52 class OOXMLStringValuePrinter(object):
53 '''Prints writerfilter::ooxml::OOXMLStringValue'''
55 def __init__(self, typename, value):
56 self.value = value
58 def to_string(self):
59 return "%s" % (self.value['mStr'])
61 class OOXMLIntegerValuePrinter(object):
62 '''Prints writerfilter::ooxml::OOXMLIntegerValue'''
64 def __init__(self, typename, value):
65 self.value = value
67 def to_string(self):
68 return "%d" % (self.value['mnValue'])
70 printer = None
72 def build_pretty_printers():
73 global printer
75 printer = printing.Printer("libreoffice/writerfilter")
76 printer.add('writerfilter::ooxml::OOXMLPropertyImpl', OOXMLPropertyPrinter)
77 printer.add('writerfilter::ooxml::OOXMLPropertySetImpl', OOXMLPropertySetPrinter)
78 printer.add('writerfilter::ooxml::OOXMLPropertySetValue', OOXMLPropertySetValuePrinter)
79 printer.add('writerfilter::ooxml::OOXMLStringValue', OOXMLStringValuePrinter)
80 printer.add('writerfilter::ooxml::OOXMLIntegerValue', OOXMLIntegerValuePrinter)
81 printer.add('writerfilter::ooxml::OOXMLHexValue', OOXMLIntegerValuePrinter)
83 def register_pretty_printers(obj):
84 printing.register_pretty_printer(printer, obj)
86 build_pretty_printers()
88 # vim:set shiftwidth=4 softtabstop=4 expandtab: