cui/source/options/optasian.cxx | 44 +++++++++++++++++------------------ sw/uiconfig/swriter/ui/fldvarpage.ui | 12 ++++----- 2 files changed, 28 insertions(+), 28 deletions(-)
New commits: commit c791a4d32fa971554ef192d1e61ee56e705710d5 Author: Olivier Hallot <olivier.hal...@libreoffice.org> AuthorDate: Fri Mar 3 10:51:17 2023 -0300 Commit: Olivier Hallot <olivier.hal...@libreoffice.org> CommitDate: Fri Mar 3 16:02:57 2023 +0000 Reword extended tip for field heading numbering Change-Id: I22ad2251d9d889966bae8bcd2505d15f13f48b06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148183 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org> diff --git a/sw/uiconfig/swriter/ui/fldvarpage.ui b/sw/uiconfig/swriter/ui/fldvarpage.ui index ccdec30f13a8..67ce63bce6f9 100644 --- a/sw/uiconfig/swriter/ui/fldvarpage.ui +++ b/sw/uiconfig/swriter/ui/fldvarpage.ui @@ -283,7 +283,7 @@ </child> <child internal-child="accessible"> <object class="AtkObject" id="numformat-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|numformat">Click the format that you want to apply to the selected field, or click "Additional formats" to define a custom format.</property> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|numformat">Click the format to apply to the selected field, or click "Additional formats" to define a custom format.</property> </object> </child> </object> @@ -328,7 +328,7 @@ </child> <child internal-child="accessible"> <object class="AtkObject" id="format-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|format">In the Format list, define if the value is inserted as text or a number.</property> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|format">In the Format list, define if the value is inserted as text or as number.</property> </object> </child> </object> @@ -435,7 +435,7 @@ </items> <child internal-child="accessible"> <object class="AtkObject" id="level-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|level">Choose the maximum outline level of the heading number to prepend to the displayed field. The selected heading number comes from the first immediately prior heading with the specified outline level or less. No heading number is displayed if “None” is selected.</property> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|level">Specify the number of outline levels to show before the displayed field. The heading numbers are taken from the heading immediately before with the specified outline level or less. If [None] is selected, then no heading number is displayed.</property> </object> </child> </object> @@ -454,7 +454,7 @@ <property name="truncate-multiline">True</property> <child internal-child="accessible"> <object class="AtkObject" id="separator-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|separator">Type the character that you want to use as a separator between the heading or chapter levels.</property> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|separator">Type the character to use as a separator between the heading or chapter levels and the field.</property> </object> </child> </object> @@ -528,7 +528,7 @@ <property name="truncate-multiline">True</property> <child internal-child="accessible"> <object class="AtkObject" id="name-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|name">Type the name of the user-defined field that you want to create.</property> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|name">Type the name of the user-defined field to create.</property> </object> </child> </object> @@ -561,7 +561,7 @@ <property name="truncate-multiline">True</property> <child internal-child="accessible"> <object class="AtkObject" id="value-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|value">Enter the contents that you want to add to a user-defined field.</property> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|value">Enter the contents to add to a user-defined field.</property> </object> </child> </object> commit 43da51e9f6dbd9a90e7cd9f67d7dae6116b6a14f Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Mar 3 15:08:28 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Mar 3 16:02:54 2023 +0000 flatten SvxForbiddenChars_Impl and associated map std::map is a node-based datastructure, and ForbiddenCharacters only contains two ref-counted string data types. No need for all this indirection. Change-Id: Ib4fa49e60557c7e5c41bb73ebeb23c4db6d33406 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148179 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index 9340cb587cc3..9ef6b753b4d4 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -50,7 +50,7 @@ namespace { struct SvxForbiddenChars_Impl { bool bRemoved; - std::unique_ptr<ForbiddenCharacters> pCharacters; + std::optional<ForbiddenCharacters> oCharacters; }; } @@ -63,12 +63,12 @@ struct SvxAsianLayoutPage_Impl Reference< XForbiddenCharacters > xForbidden; Reference< XPropertySet > xPrSet; Reference< XPropertySetInfo > xPrSetInfo; - std::map< LanguageType, std::unique_ptr<SvxForbiddenChars_Impl> > + std::map< LanguageType, SvxForbiddenChars_Impl > aChangedLanguagesMap; bool hasForbiddenCharacters(LanguageType eLang); SvxForbiddenChars_Impl* getForbiddenCharacters(LanguageType eLang); - void addForbiddenCharacters(LanguageType eLang, std::unique_ptr<ForbiddenCharacters> pForbidden); + void addForbiddenCharacters(LanguageType eLang, std::optional<ForbiddenCharacters> oForbidden); }; bool SvxAsianLayoutPage_Impl::hasForbiddenCharacters(LanguageType eLang) @@ -81,25 +81,25 @@ SvxForbiddenChars_Impl* SvxAsianLayoutPage_Impl::getForbiddenCharacters(Language auto it = aChangedLanguagesMap.find( eLang ); DBG_ASSERT( ( it != aChangedLanguagesMap.end() ), "language not available"); if( it != aChangedLanguagesMap.end() ) - return it->second.get(); + return &it->second; return nullptr; } void SvxAsianLayoutPage_Impl::addForbiddenCharacters( - LanguageType eLang, std::unique_ptr<ForbiddenCharacters> pForbidden) + LanguageType eLang, std::optional<ForbiddenCharacters> oForbidden) { auto itOld = aChangedLanguagesMap.find( eLang ); if( itOld == aChangedLanguagesMap.end() ) { - std::unique_ptr<SvxForbiddenChars_Impl> pChar(new SvxForbiddenChars_Impl); - pChar->bRemoved = nullptr == pForbidden; - pChar->pCharacters = std::move(pForbidden); - aChangedLanguagesMap.emplace( eLang, std::move(pChar) ); + SvxForbiddenChars_Impl aChar; + aChar.bRemoved = !oForbidden.has_value(); + aChar.oCharacters = std::move(oForbidden); + aChangedLanguagesMap.emplace( eLang, std::move(aChar) ); } else { - itOld->second->bRemoved = nullptr == pForbidden; - itOld->second->pCharacters = std::move(pForbidden); + itOld->second.bRemoved = !oForbidden.has_value(); + itOld->second.oCharacters = std::move(oForbidden); } } @@ -175,10 +175,10 @@ bool SvxAsianLayoutPage::FillItemSet( SfxItemSet* ) for (auto const& changedLanguage : pImpl->aChangedLanguagesMap) { Locale aLocale( LanguageTag::convertToLocale(changedLanguage.first)); - if(changedLanguage.second->bRemoved) + if(changedLanguage.second.bRemoved) pImpl->xForbidden->removeForbiddenCharacters( aLocale ); - else if(changedLanguage.second->pCharacters) - pImpl->xForbidden->setForbiddenCharacters( aLocale, *( changedLanguage.second->pCharacters ) ); + else if(changedLanguage.second.oCharacters) + pImpl->xForbidden->setForbiddenCharacters( aLocale, *( changedLanguage.second.oCharacters ) ); } } catch (const Exception&) @@ -286,14 +286,14 @@ IMPL_LINK_NOARG(SvxAsianLayoutPage, LanguageHdl, weld::ComboBox&, void) if(bAvail) { SvxForbiddenChars_Impl* pElement = pImpl->getForbiddenCharacters(eSelectLanguage); - if(pElement->bRemoved || !pElement->pCharacters) + if(pElement->bRemoved || !pElement->oCharacters) { bAvail = false; } else { - sStart = pElement->pCharacters->beginLine; - sEnd = pElement->pCharacters->endLine; + sStart = pElement->oCharacters->beginLine; + sEnd = pElement->oCharacters->endLine; } } else @@ -358,13 +358,13 @@ IMPL_LINK(SvxAsianLayoutPage, ModifyHdl, weld::Entry&, rEdit, void) { if(bEnable) { - std::unique_ptr<ForbiddenCharacters> pFCSet(new ForbiddenCharacters); - pFCSet->beginLine = sStart; - pFCSet->endLine = sEnd; - pImpl->addForbiddenCharacters(eSelectLanguage, std::move(pFCSet)); + ForbiddenCharacters aFCSet; + aFCSet.beginLine = sStart; + aFCSet.endLine = sEnd; + pImpl->addForbiddenCharacters(eSelectLanguage, std::move(aFCSet)); } else - pImpl->addForbiddenCharacters(eSelectLanguage, nullptr); + pImpl->addForbiddenCharacters(eSelectLanguage, std::nullopt); } catch (const Exception&) {