tdf#144694 In direct SQL dialog, activate options 'Run SQL command
[LibreOffice.git] / solenv / gdb / libreoffice / utl.py
blob0e6de6ff94edefb6838beeb7aad0be31b2269a41
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 import gdb
12 from libreoffice.util import printing
14 class TranslateIdPrinter(object):
15 '''Prints a TranslateId.'''
17 def __init__(self, typename, value):
18 self.typename = typename
19 self.value = value
21 def to_string(self):
22 return self.value['mpContext'].format_string(format='s') + " " + self.value['mpId'].format_string(format='s')
24 printer = None
26 def build_pretty_printers():
27 global printer
29 printer = printing.Printer('libreoffice/utl')
31 # various types
32 printer.add('TranslateId', TranslateIdPrinter)
34 def register_pretty_printers(obj):
35 printing.register_pretty_printer(printer, obj)
37 build_pretty_printers()
39 # vim:set shiftwidth=4 softtabstop=4 expandtab: