https://bugs.documentfoundation.org/show_bug.cgi?id=157034

Julien Nabet <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Julien Nabet <[email protected]> ---
On pc Debian x86-64 with master sources updated today, I could reproduce this.

When selecting Light1, I get this bt:
#0  PaletteManager::GetThemeAndEffectIndex(unsigned short, unsigned short&,
unsigned short&) (nItemId=2, rThemeIndex=@0x7ffe9d172eae: 0,
rEffectIndex=@0x7ffe9d172eac: 32766)
    at svx/source/tbxctrls/PaletteManager.cxx:165
#1  0x00007f1922b4e2d9 in SvxColorTabPage::SelectValSetHdl_Impl(ValueSet*)
(this=0x56115d44fb90, pValSet=0x56115d732170) at
cui/source/tabpages/tpcolor.cxx:511
#2  0x00007f1922b4cd7d in SvxColorTabPage::LinkStubSelectValSetHdl_Impl(void*,
ValueSet*) (instance=0x56115d44fb90, data=0x56115d732170) at
cui/source/tabpages/tpcolor.cxx:492

With this patch, it seems to work:
diff --git a/svx/source/tbxctrls/PaletteManager.cxx
b/svx/source/tbxctrls/PaletteManager.cxx
index 9b8f144f66b0..77cbab82207d 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -161,7 +161,10 @@ 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;

Regina: does it seem to you?

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to