24#include <com/sun/star/beans/XPropertySet.hpp>
25#include <com/sun/star/container/ElementExistException.hpp>
26#include <com/sun/star/container/NoSuchElementException.hpp>
27#include <com/sun/star/container/XNameAccess.hpp>
28#include <com/sun/star/container/XNameContainer.hpp>
29#include <com/sun/star/lang/Locale.hpp>
30#include <com/sun/star/lang/XSingleServiceFactory.hpp>
31#include <com/sun/star/uno/Any.hxx>
32#include <com/sun/star/uno/Reference.hxx>
33#include <com/sun/star/uno/Sequence.hxx>
36#include <officecfg/Office/Common.hxx>
37#include <rtl/ustring.hxx>
45OUString
toString(css::lang::Locale
const & locale) {
46 SAL_WARN_IF( locale.Language.indexOf(
'-') != -1,
"svl",
47 "Locale language \"" << locale.Language <<
"\" contains \"-\"");
48 SAL_WARN_IF( locale.Country.indexOf(
'-') != -1,
"svl",
49 "Locale country \"" << locale.Country <<
"\" contains \"-\"");
63 std::shared_ptr< comphelper::ConfigurationChanges >
batch;
71 impl_->batch->commit();
76 officecfg::Office::Common::AsianLayout::IsKerningWesternTextOnly::get();
80 officecfg::Office::Common::AsianLayout::IsKerningWesternTextOnly::set(
85 return static_cast<CharCompressType>(officecfg::Office::Common::AsianLayout::CompressCharacterDistance::get());
89 officecfg::Office::Common::AsianLayout::CompressCharacterDistance::set(
96 const css::uno::Sequence< OUString >
ns(
97 officecfg::Office::Common::AsianLayout::StartEndCharacters::get()->
99 css::uno::Sequence< css::lang::Locale > ls(
ns.getLength());
100 std::transform(
ns.begin(),
ns.end(), ls.getArray(),
101 [](
const OUString& rName) -> css::lang::Locale {
102 return LanguageTag::convertToLocale( rName, false); });
107 css::lang::Locale
const & locale, OUString & startChars,
108 OUString & endChars)
const
110 css::uno::Reference< css::container::XNameAccess >
set(
111 officecfg::Office::Common::AsianLayout::StartEndCharacters::get());
115 }
catch (css::container::NoSuchElementException &) {
118 css::uno::Reference< css::beans::XPropertySet > el(
119 v.get< css::uno::Reference< css::beans::XPropertySet > >(),
120 css::uno::UNO_SET_THROW);
121 startChars = el->getPropertyValue(
"StartCharacters").get< OUString >();
122 endChars = el->getPropertyValue(
"EndCharacters").get< OUString >();
127 css::lang::Locale
const & locale, OUString
const * startChars,
128 OUString
const * endChars)
130 assert((startChars ==
nullptr) == (endChars ==
nullptr));
131 css::uno::Reference< css::container::XNameContainer >
set(
132 officecfg::Office::Common::AsianLayout::StartEndCharacters::get(
135 if (startChars ==
nullptr) {
138 }
catch (css::container::NoSuchElementException &) {}
145 }
catch (css::container::NoSuchElementException &) {
149 css::uno::Reference< css::beans::XPropertySet > el(
150 v.get< css::uno::Reference< css::beans::XPropertySet > >(),
151 css::uno::UNO_SET_THROW);
152 el->setPropertyValue(
"StartCharacters", css::uno::Any(*startChars));
153 el->setPropertyValue(
"EndCharacters", css::uno::Any(*endChars));
155 css::uno::Reference< css::beans::XPropertySet > el(
156 (css::uno::Reference< css::lang::XSingleServiceFactory >(
157 set, css::uno::UNO_QUERY_THROW)->
159 css::uno::UNO_QUERY_THROW);
160 el->setPropertyValue(
"StartCharacters", css::uno::Any(*startChars));
161 el->setPropertyValue(
"EndCharacters", css::uno::Any(*endChars));
162 css::uno::Any v2(el);
165 }
catch (css::container::ElementExistException &) {
166 SAL_INFO(
"svl",
"Concurrent update race for \"" <<
name <<
'"');
HRESULT createInstance(REFIID iid, Ifc **ppIfc)
CharCompressType
These constants define character compression in Asian text.
static OUString convertToBcp47(LanguageType nLangID)
CharCompressType GetCharDistanceCompression() const
bool GetStartEndChars(css::lang::Locale const &locale, OUString &startChars, OUString &endChars) const
void SetKerningWesternTextOnly(bool value)
css::uno::Sequence< css::lang::Locale > GetStartEndCharLocales() const
void SetStartEndChars(css::lang::Locale const &locale, OUString const *startChars, OUString const *endChars)
bool IsKerningWesternTextOnly() const
void SetCharDistanceCompression(CharCompressType value)
std::unique_ptr< Impl > impl_
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
void set(css::uno::UnoInterfaceReference const &value)
css::uno::Reference< css::deployment::XPackageRegistry > create(css::uno::Reference< css::deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)
OUString toString(OptionInfo const *info)
Impl & operator=(const Impl &)=delete
Impl(const Impl &)=delete
std::shared_ptr< comphelper::ConfigurationChanges > batch