cui/qa/uitest/dialogs/chardlg.py       |    4 ++--
 cui/qa/uitest/tabpages/tpcolor.py      |    4 ++--
 svx/source/tbxctrls/PaletteManager.cxx |    6 +++++-
 3 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit f5e740941dcef556b9330454d45ac95bbb90fd47
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Thu Aug 31 16:19:13 2023 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Fri Sep 1 22:49:52 2023 +0200

    tdf#157034: FILESAVE loext:theme-type is off by one
    
    nItemId begins with 1 but list of themes begin with 0 so decrement nItemId
    part of bt here:
    https://bugs.documentfoundation.org/show_bug.cgi?id=157034#c1
    
    + adapt QA tests
    
    Change-Id: I7913ea0f71abb9ff98039a9c45a49fdb8f709ae0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156350
    Tested-by: Jenkins
    Reviewed-by: Regina Henschel <rb.hensc...@t-online.de>
    (cherry picked from commit 85aa230aebfe383eecdb4fc6704d093db8a18402)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156434
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/cui/qa/uitest/dialogs/chardlg.py b/cui/qa/uitest/dialogs/chardlg.py
index 85e60f766238..d6ebffac3e1e 100644
--- a/cui/qa/uitest/dialogs/chardlg.py
+++ b/cui/qa/uitest/dialogs/chardlg.py
@@ -106,9 +106,9 @@ class Test(UITestCase):
             portion = portions.nextElement()
 
             # Without the accompanying fix in place, this test would have 
failed with:
-            # AssertionError: -1 != 4
+            # AssertionError: -1 != 3
             # i.e. no theme index was set, instead of accent1 (index into the 
above color scheme).
-            self.assertEqual(portion.CharColorTheme, 4)
+            self.assertEqual(portion.CharColorTheme, 3)
 
             # Then make sure that '80% lighter' is lum-mod=2000 and 
lum-off=8000:
             # Without the accompanying fix in place, this test would have 
failed with:
diff --git a/cui/qa/uitest/tabpages/tpcolor.py 
b/cui/qa/uitest/tabpages/tpcolor.py
index ad52711857e4..820ffa634eb1 100644
--- a/cui/qa/uitest/tabpages/tpcolor.py
+++ b/cui/qa/uitest/tabpages/tpcolor.py
@@ -61,9 +61,9 @@ class Test(UITestCase):
             # Then make sure the doc model is updated accordingly:
             shape = drawPage.getByIndex(0)
             # Without the accompanying fix in place, this test would have 
failed with:
-            # AssertionError: -1 != 4
+            # AssertionError: -1 != 3
             # i.e. the theme metadata of the selected fill color was lost.
-            self.assertEqual(shape.FillColorTheme, 4)
+            self.assertEqual(shape.FillColorTheme, 3)
 
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index 70b11a977266..2480d8ab2cfa 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -162,7 +162,11 @@ bool PaletteManager::IsThemePaletteSelected() const
 
 bool PaletteManager::GetThemeAndEffectIndex(sal_uInt16 nItemId, sal_uInt16& 
rThemeIndex, sal_uInt16& rEffectIndex)
 {
-     // Each column is the same color with different effects.
+    // tdf#157034, nItemId begins with 1 but list of themes begin with 0
+    // so decrement nItemId
+    --nItemId;
+
+    // Each column is the same color with different effects.
     rThemeIndex = nItemId % 12;
 
     rEffectIndex = nItemId / 12;

Reply via email to