Files
loongoffice/drawinglayer/source/processor2d/getdigitlanguage.cxx
Noel Grandin b542d90447 tdf#155376 partially convert SvCTLOptions to officecfg
When accessibility is enabled, Calc will add tens of thousands of
listeners.

We then spend a significant chunk of time creating SvCTLOptions objects
(attached to ImpEditEngine) and adding and removing those objects from
the related listener lists.

But the required information is already globally cached by the officecfg
module, so we can avoid that overhead and just fetch it directly from
officecfg.

Change-Id: I7ff55fd7c4926866eb7086812275ba8bd6e84c75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152645
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-07 15:55:33 +02:00

32 lines
971 B
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-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/.
*/
#include <sal/config.h>
#include <i18nlangtag/lang.h>
#include <i18nlangtag/languagetag.hxx>
#include <svl/ctloptions.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include "getdigitlanguage.hxx"
LanguageType drawinglayer::detail::getDigitLanguage() {
switch (SvtCTLOptions::GetCTLTextNumerals()) {
case SvtCTLOptions::NUMERALS_ARABIC:
return LANGUAGE_ENGLISH;
case SvtCTLOptions::NUMERALS_HINDI:
return LANGUAGE_ARABIC_SAUDI_ARABIA;
default:
return Application::GetSettings().GetLanguageTag().getLanguageType();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */