]> git.lyx.org Git - features.git/commitdiff
* fix broken default value logic from last cleanup: only show default value if not...
authorStefan Schimanski <sts@lyx.org>
Mon, 7 Jan 2008 13:50:21 +0000 (13:50 +0000)
committerStefan Schimanski <sts@lyx.org>
Mon, 7 Jan 2008 13:50:21 +0000 (13:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22413 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/MathMacro.cpp

index 21e08e329f0e185786f8b86d7e011e8ed543df20..5e57a81f8734881fc9b204d0f38ab5ac6b2600a9 100644 (file)
@@ -52,7 +52,8 @@ public:
        void metrics(MetricsInfo & mi, Dimension & dim) const {
                mathMacro_.macro()->unlock();
                mathMacro_.cell(idx_).metrics(mi, dim);
-               if (!mathMacro_.editMetrics(mi.base.bv) && !def_.empty())
+               if (!mathMacro_.editMetrics(mi.base.bv) 
+                   && mathMacro_.cell(idx_).empty())
                        def_.metrics(mi, dim);
                mathMacro_.macro()->lock();
        }
@@ -70,21 +71,19 @@ public:
                        pi.pain.leaveMonochromeMode();
                        mathMacro_.cell(idx_).draw(pi, x, y);
                        pi.pain.enterMonochromeMode(Color_mathbg, Color_mathmacroblend);
-               } else {
-                       if (def_.empty())
-                               mathMacro_.cell(idx_).draw(pi, x, y);
-                       else {
-                               mathMacro_.cell(idx_).setXY(*pi.base.bv, x, y);
-                               def_.draw(pi, x, y);
-                       }
-               }
+               } else if (mathMacro_.cell(idx_).empty()) {
+                       mathMacro_.cell(idx_).setXY(*pi.base.bv, x, y);
+                       def_.draw(pi, x, y);
+               } else
+                       mathMacro_.cell(idx_).draw(pi, x, y);
        }
        ///
        size_t idx() const { return idx_; }
        ///
        int kerning(BufferView const * bv) const
        { 
-               if (mathMacro_.editMetrics(bv) || def_.empty())
+               if (mathMacro_.editMetrics(bv)
+                   || !mathMacro_.cell(idx_).empty())
                        return mathMacro_.cell(idx_).kerning(bv); 
                else
                        return def_.kerning(bv);