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 a70b613e6b5d95362f34f57df5cda22a74cb670e
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Thu Aug 31 16:19:13 2023 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Mon Sep 4 19:51:06 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/+/156389
    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 9fcefd34d1c8..343448c8e788 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -161,7 +161,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