Problem: When canceling the color selection dialog the color of the selected item is changed to black.

Solution: Add a test whether the color returned from the color dialog is valid.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18245 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bernhard Roider 2007-05-09 19:52:24 +00:00
parent e5df7b6978
commit 43419ef0bd

View File

@ -578,7 +578,7 @@ void PrefColors::change_color()
QString color = newcolors_[row];
QColor c(QColorDialog::getColor(QColor(color), qApp->focusWidget()));
if (c.name() != color) {
if (c.isValid() && c.name() != color) {
newcolors_[row] = c.name();
QPixmap coloritem(32, 32);
coloritem.fill(c);