From 15e19deed337dff477f427c7fdeacf6d984c9da0 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 19 Feb 2010 09:03:39 +0000 Subject: [PATCH] Really fix table borders toggling. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33506 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiTabular.cpp | 20 ++++++++++++-------- src/frontends/qt4/GuiTabular.h | 5 +++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/frontends/qt4/GuiTabular.cpp b/src/frontends/qt4/GuiTabular.cpp index d014d5dc73..56f59ce21c 100644 --- a/src/frontends/qt4/GuiTabular.cpp +++ b/src/frontends/qt4/GuiTabular.cpp @@ -377,13 +377,13 @@ docstring GuiTabular::dialogToParams() const && !borders->getRight()) setParam(param_str, Tabular::UNSET_ALL_LINES); else { - if (borders->getLeft()) + if (borders->getLeft() != left_border_set_) setParam(param_str, Tabular::TOGGLE_LINE_LEFT); - if (borders->getRight()) + if (borders->getRight() != right_border_set_) setParam(param_str, Tabular::TOGGLE_LINE_RIGHT); - if (borders->getTop()) + if (borders->getTop() != top_border_set_) setParam(param_str, Tabular::TOGGLE_LINE_TOP); - if (borders->getBottom()) + if (borders->getBottom() != bottom_border_set_) setParam(param_str, Tabular::TOGGLE_LINE_BOTTOM); } @@ -555,10 +555,14 @@ void GuiTabular::paramsToDialog(Inset const * inset) longTabularCB->setChecked(tabular.is_long_tabular); // - borders->setTop(tabular.topLine(cell)); - borders->setBottom(tabular.bottomLine(cell)); - borders->setLeft(tabular.leftLine(cell)); - borders->setRight(tabular.rightLine(cell)); + top_border_set_ = tabular.topLine(cell); + bottom_border_set_ = tabular.bottomLine(cell); + left_border_set_ = tabular.leftLine(cell); + right_border_set_ = tabular.rightLine(cell); + borders->setTop(top_border_set_); + borders->setBottom(bottom_border_set_); + borders->setLeft(left_border_set_); + borders->setRight(right_border_set_); // repaint the setborder widget borders->update(); diff --git a/src/frontends/qt4/GuiTabular.h b/src/frontends/qt4/GuiTabular.h index ac5f353bdf..bd045b4383 100644 --- a/src/frontends/qt4/GuiTabular.h +++ b/src/frontends/qt4/GuiTabular.h @@ -48,6 +48,11 @@ private: void setVAlign(std::string & param_str) const; /// void setTableAlignment(std::string & param_str) const; + /// + bool left_border_set_; + bool right_border_set_; + bool top_border_set_; + bool bottom_border_set_; }; } // namespace frontend