do not write colors to prefs when they have not been changed (Bug 1069)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6901 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2003-04-30 15:11:25 +00:00
parent 1dcf372174
commit d65aa55131
3 changed files with 16 additions and 13 deletions

View File

@ -4,7 +4,6 @@ src/Chktex.C
src/CutAndPaste.C
src/LColor.C
src/LaTeX.C
src/LyXAction.C
src/MenuBackend.C
src/ParagraphParameters.C
src/buffer.C
@ -44,7 +43,6 @@ src/frontends/qt2/QBibtexDialog.C
src/frontends/qt2/QChanges.C
src/frontends/qt2/QCharacter.C
src/frontends/qt2/QCitation.C
src/frontends/qt2/QCitationDialog.C
src/frontends/qt2/QCommandBuffer.C
src/frontends/qt2/QDelimiterDialog.C
src/frontends/qt2/QDocument.C

View File

@ -1,3 +1,8 @@
2003-04-29 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* QPrefs.C (apply): only set colors if they are different from
their original values
2003-04-30 John Levon <levon@movementarian.org>
* various: change dialog titles to match new menu layout

View File

@ -294,19 +294,19 @@ void QPrefs::apply()
QListBoxItem * ib(colmod->lyxObjectsLB->item(i));
QColorItem * ci(static_cast<QColorItem*>(ib));
ostringstream ostr;
ostr << '#' << std::setbase(16) << setfill('0')
<< setw(2) << ci->color().red()
<< setw(2) << ci->color().green()
<< setw(2) << ci->color().blue();
string newhex(STRCONV(ostr.str()));
LColor::color col(dialog_->colors_[i]);
LColor::color const col(dialog_->colors_[i]);
QColor const qcol(toqstr(lcolor.getX11Name(col)));
// FIXME: dubious, but it's what xforms does
if (lcolor.getX11Name(col) != newhex) {
if (qcol != ci->color()) {
ostringstream ostr;
ostr << '#' << std::setbase(16) << setfill('0')
<< setw(2) << ci->color().red()
<< setw(2) << ci->color().green()
<< setw(2) << ci->color().blue();
string newhex(STRCONV(ostr.str()));
controller().setColor(col, newhex);
}
}