From d65aa55131f3c474f46f34148d00ac0b0064c30b Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 30 Apr 2003 15:11:25 +0000 Subject: [PATCH] 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 --- po/POTFILES.in | 2 -- src/frontends/qt2/ChangeLog | 5 +++++ src/frontends/qt2/QPrefs.C | 22 +++++++++++----------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 5c32872d9c..084f7cad4e 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -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 diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index ef4629ab5f..d3fbc805de 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2003-04-29 Jean-Marc Lasgouttes + + * QPrefs.C (apply): only set colors if they are different from + their original values + 2003-04-30 John Levon * various: change dialog titles to match new menu layout diff --git a/src/frontends/qt2/QPrefs.C b/src/frontends/qt2/QPrefs.C index 8d811d8b0a..309af0ebe8 100644 --- a/src/frontends/qt2/QPrefs.C +++ b/src/frontends/qt2/QPrefs.C @@ -294,19 +294,19 @@ void QPrefs::apply() QListBoxItem * ib(colmod->lyxObjectsLB->item(i)); QColorItem * ci(static_cast(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); } } -- 2.39.2