sw/qa/extras/layout/layout5.cxx     |   28 ++++++++++++++++++++++++++++
 sw/source/uibase/shells/txtattr.cxx |    3 ++-
 2 files changed, 30 insertions(+), 1 deletion(-)

New commits:
commit 7cbd793cfcd5513c8e5d85686fa0e29c021bd6f2
Author:     Jonathan Clark <[email protected]>
AuthorDate: Wed Oct 15 10:28:23 2025 -0600
Commit:     Jonathan Clark <[email protected]>
CommitDate: Thu Oct 16 00:24:40 2025 +0200

    tdf#72341 sw: Make inc/dec font size affect all scripts
    
    This change updates the FN_GROW_FONT_SIZE and FN_SHRINK_FONT_SIZE
    handlers to scale fonts for all script types, even if the
    currently-selected text does not contain a particular type.
    
    This fixes the reported issue that bullets in RTL context are not
    resized if a selected list item does not contain CTL characters. This
    also fixes the broader issue of inserted text not reflecting earlier
    size changes, simply because the script type for that inserted text
    wasn't present at the time.
    
    Change-Id: I881f0b90b5c3aecbbf2e40ee2ad6758de9c5bad3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192459
    Reviewed-by: Jonathan Clark <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/qa/extras/layout/layout5.cxx b/sw/qa/extras/layout/layout5.cxx
index 8ea10d69accd..15563999ed79 100644
--- a/sw/qa/extras/layout/layout5.cxx
+++ b/sw/qa/extras/layout/layout5.cxx
@@ -2087,6 +2087,34 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf168116)
     assertXPath(pXmlDoc, "//body/txt[1]/SwParaPortion/SwLineLayout", 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf72341GrowAllScripts)
+{
+    createSwDoc();
+
+    auto* pWrtShell = getSwDocShell()->GetWrtShell();
+
+    pWrtShell->Insert(u"AAAAאאאא"_ustr);
+    pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect*/ false, 7, 
/*bBasicCall*/ false);
+    pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect*/ true, 2, 
/*bBasicCall*/ false);
+
+    for (size_t i = 0; i < 4; ++i)
+    {
+        dispatchCommand(mxComponent, u".uno:Grow"_ustr, {});
+    }
+
+    pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect*/ false, 1, 
/*bBasicCall*/ false);
+    pWrtShell->Insert(u"אאאא"_ustr);
+
+    auto pXmlDoc = parseLayoutDump();
+
+    auto nWidthAlephResized
+        = getXPath(pXmlDoc, "//SwLineLayout/SwMultiPortion[1]", 
"width").toInt32();
+    auto nWidthAlephInitial
+        = getXPath(pXmlDoc, "//SwLineLayout/SwMultiPortion[2]", 
"width").toInt32();
+
+    CPPUNIT_ASSERT_GREATER(nWidthAlephInitial, nWidthAlephResized);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/shells/txtattr.cxx 
b/sw/source/uibase/shells/txtattr.cxx
index 083cae765969..eee4503fb501 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -261,7 +261,8 @@ void SwTextShell::ExecCharAttrArgs(SfxRequest &rReq)
             rWrtSh.GetCurAttr( aSetItem.GetItemSet() );
             SfxItemSet aAttrSet( rPool, aSetItem.GetItemSet().GetRanges() );
 
-            SvtScriptType nScriptTypes = rWrtSh.GetScriptType();
+            SvtScriptType nScriptTypes
+                = SvtScriptType::LATIN | SvtScriptType::ASIAN | 
SvtScriptType::COMPLEX;
             const SvxFontHeightItem* pSize( static_cast<const 
SvxFontHeightItem*>(
                                         aSetItem.GetItemOfScript( nScriptTypes 
) ) );
             std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> 
>> vItems;

Reply via email to