mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
GuiBox: do not rely on count (as explained on lyx-devel)
This commit is contained in:
parent
a98cfe1874
commit
7d67e94cd0
@ -246,8 +246,8 @@ void GuiBox::on_frameColorCO_currentIndexChanged(int index)
|
|||||||
{
|
{
|
||||||
// if there is a non-black frame color the background cannot be uncolored
|
// if there is a non-black frame color the background cannot be uncolored
|
||||||
// therefore remove the entry "none" in this case
|
// therefore remove the entry "none" in this case
|
||||||
|
int const n = backgroundColorCO->findData("none");
|
||||||
if (index != frameColorCO->findData("black")) {
|
if (index != frameColorCO->findData("black")) {
|
||||||
int const n = backgroundColorCO->findData("none");
|
|
||||||
if (n != -1) {
|
if (n != -1) {
|
||||||
if (backgroundColorCO->currentIndex() == n)
|
if (backgroundColorCO->currentIndex() == n)
|
||||||
backgroundColorCO->setCurrentIndex(
|
backgroundColorCO->setCurrentIndex(
|
||||||
@ -255,7 +255,7 @@ void GuiBox::on_frameColorCO_currentIndexChanged(int index)
|
|||||||
backgroundColorCO->removeItem(n);
|
backgroundColorCO->removeItem(n);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (backgroundColorCO->count() == color_codes_.count() - 1)
|
if (n == -1)
|
||||||
backgroundColorCO->insertItem(0, toqstr(translateIfPossible((lcolor.getGUIName(Color_none)))),
|
backgroundColorCO->insertItem(0, toqstr(translateIfPossible((lcolor.getGUIName(Color_none)))),
|
||||||
toqstr(lcolor.getLaTeXName(Color_none)));
|
toqstr(lcolor.getLaTeXName(Color_none)));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user