diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-19 13:18:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-05 09:39:11 +0200 |
commit | 14cfff500e93f0d6cbf8412065feea85c01ea81d (patch) | |
tree | 76e3fb8fbf2b0d8a12c8406d8cf994ea6a37aaff /solenv | |
parent | d924ce30e0ca260682bd2aed192b8b1b2ca3e7c0 (diff) |
Pass context and resource string down to boost::locale separately
because this is often on a hot path, and we can avoid the splitting and
joining of strings like this.
Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'solenv')
-rwxr-xr-x | solenv/bin/install-gdb-printers | 3 | ||||
-rw-r--r-- | solenv/gdb/libreoffice/utl.py | 39 |
2 files changed, 41 insertions, 1 deletions
diff --git a/solenv/bin/install-gdb-printers b/solenv/bin/install-gdb-printers index aae4020a4532..3eae4d9efe2b 100755 --- a/solenv/bin/install-gdb-printers +++ b/solenv/bin/install-gdb-printers @@ -124,7 +124,7 @@ if [[ ${DESTDIR}${pythondir} != ${GDBDIR} ]]; then fi if [[ -n "${MERGELIBS}" ]]; then - make_autoload merged program libmergedlo."$DYLIB" merge svl tl basegfx vcl + make_autoload merged program libmergedlo."$DYLIB" merge svl tl basegfx vcl utl make_autoload cppu program libuno_cppu."$DYLIB".3 make_autoload sal program libuno_sal."$DYLIB".3 make_autoload sw program libswlo."$DYLIB" @@ -135,6 +135,7 @@ else make_autoload svl program libsvllo."$DYLIB" make_autoload sw program libswlo."$DYLIB" make_autoload tl program libtllo."$DYLIB" + make_autoload utl program libutllo."$DYLIB" make_autoload vcl program libvcllo."$DYLIB" fi make_autoload writerfilter program libwriterfilterlo."$DYLIB" diff --git a/solenv/gdb/libreoffice/utl.py b/solenv/gdb/libreoffice/utl.py new file mode 100644 index 000000000000..0e6de6ff94ed --- /dev/null +++ b/solenv/gdb/libreoffice/utl.py @@ -0,0 +1,39 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +import gdb + +from libreoffice.util import printing + +class TranslateIdPrinter(object): + '''Prints a TranslateId.''' + + def __init__(self, typename, value): + self.typename = typename + self.value = value + + def to_string(self): + return self.value['mpContext'].format_string(format='s') + " " + self.value['mpId'].format_string(format='s') + +printer = None + +def build_pretty_printers(): + global printer + + printer = printing.Printer('libreoffice/utl') + + # various types + printer.add('TranslateId', TranslateIdPrinter) + +def register_pretty_printers(obj): + printing.register_pretty_printer(printer, obj) + +build_pretty_printers() + +# vim:set shiftwidth=4 softtabstop=4 expandtab: |