The branch, master, has been updated. - Log -----------------------------------------------------------------
commit 29e64597d045e8cb6ebebb67de75835d128f6be3 Author: Vincent van Ravesteijn <[email protected]> Date: Sat Sep 22 23:14:34 2012 +0200 Fix bug #6389: Make columns RTL in RTL document diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 2c96da3..c53d0ec 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -1163,6 +1163,9 @@ void BufferParams::validate(LaTeXFeatures & features) const { features.require(documentClass().requires()); + if (columns > 1 && language->rightToLeft()) + features.require("rtloutputdblcol"); + if (outputChanges) { bool dvipost = LaTeXFeatures::isAvailable("dvipost"); bool xcolorulem = LaTeXFeatures::isAvailable("ulem") && diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index a4955f1..169f4e6 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -277,6 +277,42 @@ static docstring const lyxref_def = from_ascii( " {\\def\\RSlemtxt{lemma~}\\newref{lem}{name = \\RSlemtxt}}\n" " {}\n"); +// Make sure the columns are also outputed as rtl +static docstring const rtloutputdblcol_def = from_ascii( + "\\def\\@outputdblcol{%\n" + " \\if@firstcolumn\n" + " \\global \\@firstcolumnfalse\n" + " \\global \\setbox\\@leftcolumn \\box\\@outputbox\n" + " \\else\n" + " \\global \\@firstcolumntrue\n" + " \\setbox\\@outputbox \\vbox {%\n" + " \\hb@xt@\\textwidth {%\n" + " \\kern\\textwidth \\kern-\\columnwidth %**\n" + " \\hb@xt@\\columnwidth {%\n" + " \\box\\@leftcolumn \\hss}%\n" + " \\kern-\\textwidth %**\n" + " \\hfil\n" + " {\\normalcolor\\vrule \\@width\\columnseprule}%\n" + " \\hfil\n" + " \\kern-\\textwidth %**\n" + " \\hb@xt@\\columnwidth {%\n" + " \\box\\@outputbox \\hss}%\n" + " \\kern-\\columnwidth \\kern\\textwidth %**\n" + " }%\n" + " }%\n" + " \\@combinedblfloats\n" + " \\@outputpage\n" + " \\begingroup\n" + " \\@dblfloatplacement\n" + " \\@startdblcolumn\n" + " \\@whilesw\\if@fcolmade \\fi\n" + " {\\@outputpage\n" + " \\@startdblcolumn}%\n" + " \\endgroup\n" + " \\fi\n" + "}\n" + "\\@mparswitchtrue\n"); + ///////////////////////////////////////////////////////////////////// // @@ -1072,6 +1108,9 @@ docstring const LaTeXFeatures::getMacros() const if (mustProvide("ct-none")) macros << changetracking_none_def; + if (mustProvide("rtloutputdblcol")) + macros << rtloutputdblcol_def; + return macros.str(); } commit 6b8ed2fa1d2cf4554fb7359f5b9d45f6dcdc2aa4 Author: Vincent van Ravesteijn <[email protected]> Date: Sat Sep 22 20:51:49 2012 +0200 Initialize toolbar pop menu button on start In 0aead96461997 it was introduced that the toolbar popup menu buttons are not initialized until they are being used (i.e. pressed at for the first time). As a consequence, these buttons are always enabled on start. Now that we have the sticky button for view and update, I'm now annoyed by this every time I start LyX. diff --git a/src/frontends/qt4/GuiToolbar.cpp b/src/frontends/qt4/GuiToolbar.cpp index d0efdbe..ec80a0b 100644 --- a/src/frontends/qt4/GuiToolbar.cpp +++ b/src/frontends/qt4/GuiToolbar.cpp @@ -166,7 +166,7 @@ public: MenuButton::MenuButton(GuiToolbar * bar, ToolbarItem const & item, bool const sticky) - : QToolButton(bar), bar_(bar), tbitem_(item), initialized_(false) + : QToolButton(bar), bar_(bar), tbitem_(item) { setPopupMode(QToolButton::InstantPopup); QString const label = qt_(to_ascii(tbitem_.label_)); @@ -189,17 +189,12 @@ MenuButton::MenuButton(GuiToolbar * bar, ToolbarItem const & item, bool const st this, SLOT(actionTriggered(QAction *))); connect(bar, SIGNAL(iconSizeChanged(QSize)), this, SLOT(setIconSize(QSize))); + initialize(); } -void MenuButton::mousePressEvent(QMouseEvent * e) -{ - if (initialized_) { - QToolButton::mousePressEvent(e); - return; - } - - initialized_ = true; +void MenuButton::initialize() +{ QString const label = qt_(to_ascii(tbitem_.label_)); ButtonMenu * m = new ButtonMenu(label, this); m->setWindowTitle(label); @@ -217,8 +212,6 @@ void MenuButton::mousePressEvent(QMouseEvent * e) if (!getStatus(it->func_).unknown()) m->add(bar_->addItem(*it)); setMenu(m); - - QToolButton::mousePressEvent(e); } diff --git a/src/frontends/qt4/GuiToolbar.h b/src/frontends/qt4/GuiToolbar.h index fb65506..f00575c 100644 --- a/src/frontends/qt4/GuiToolbar.h +++ b/src/frontends/qt4/GuiToolbar.h @@ -45,16 +45,14 @@ public: /// MenuButton(GuiToolbar * bar, ToolbarItem const & item, bool const sticky = false); - /// - void mousePressEvent(QMouseEvent * e); private: /// + void initialize(); + /// GuiToolbar * bar_; /// ToolbarItem const & tbitem_; - /// - bool initialized_; private Q_SLOTS: /// ----------------------------------------------------------------------- Summary of changes: src/BufferParams.cpp | 3 ++ src/LaTeXFeatures.cpp | 39 ++++++++++++++++++++++++++++++++++++++ src/frontends/qt4/GuiToolbar.cpp | 15 +++---------- src/frontends/qt4/GuiToolbar.h | 6 +--- 4 files changed, 48 insertions(+), 15 deletions(-) hooks/post-receive -- The LyX Source Repository
