]> git.lyx.org Git - features.git/commitdiff
do not write colors to prefs when they have not been changed (Bug 1069)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 30 Apr 2003 15:11:25 +0000 (15:11 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 30 Apr 2003 15:11:25 +0000 (15:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6901 a592a061-630c-0410-9148-cb99ea01b6c8

po/POTFILES.in
src/frontends/qt2/ChangeLog
src/frontends/qt2/QPrefs.C

index 5c32872d9c8efb44736224ed63fd128800a56e10..084f7cad4e5e9dea50e06075e1e296b1464624ba 100644 (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
index ef4629ab5f3b9a3de7df75bdac83bf36e5f17d13..d3fbc805decd58e439a9cda0637d7637a2279275 100644 (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
index 8d811d8b0a3771d76e2183649bbb562dd7b82a03..309af0ebe8a3ac47c10bd6441870eb3510e050bb 100644 (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);
                }
        }