svx/source/gallery2/galini.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e05e6af1ee3af91ed59da5c30fbd38e12d1f3c37
Author:     Christian Lohmaier <[email protected]>
AuthorDate: Fri Oct 17 13:43:55 2025 +0200
Commit:     Adolfo Jayme Barrientos <[email protected]>
CommitDate: Sun Oct 19 23:57:25 2025 +0200

    tdf#167704 fix gallery themes not using translations
    
    regression from d81808ec15064e7655503253dddb8ebdc58b1b29
    
    it is not substr(startPos, endPos) but substr(startPos, length)
    so the code ended up with the whole remainder of the key: 'langCode]'
    instead of just 'langCode' and that broke the lookup.
    
    Change-Id: I33eddf566e2d453dff14c123fc6c8cda97382b2d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192573
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <[email protected]>
    (cherry picked from commit 961439e8e6f7a5a179bcdd092254dd1f32a1c7c5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192672
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/svx/source/gallery2/galini.cxx b/svx/source/gallery2/galini.cxx
index c204f609ec6f..e29c9322e0d1 100644
--- a/svx/source/gallery2/galini.cxx
+++ b/svx/source/gallery2/galini.cxx
@@ -64,7 +64,7 @@ OUString 
GalleryFileStorageEntry::ReadStrFromIni(std::string_view aKeyName) cons
             if (n == std::string_view::npos || n < 1)
                 continue;
 
-            std::string_view aLocale = o3tl::trim(aKey.substr(n + 1, 
aKey.find(']', n + 2)));
+            std::string_view aLocale = o3tl::trim(aKey.substr(n + 1, 
aKey.find(']', n + 2) - n - 1));
             aKey = o3tl::trim(aKey.substr(0, n));
 
             SAL_INFO("svx", "ini file has '" << aKey << "' [ '" << aLocale << 
"' ] = '" << aValue << "'");

Reply via email to