]> git.lyx.org Git - features.git/commitdiff
Add native changebars
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 24 Dec 2019 17:12:22 +0000 (18:12 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:48 +0000 (15:48 +0200)
Fixes #10750

19 files changed:
development/FORMAT
lib/Makefile.am
lib/chkconfig.ltx
lib/doc/UserGuide.lyx
lib/doc/de/UserGuide.lyx
lib/layouts/changebars.module [deleted file]
lib/lyx2lyx/lyx_2_4.py
src/Buffer.cpp
src/Buffer.h
src/BufferParams.cpp
src/BufferParams.h
src/Converter.cpp
src/LaTeXFeatures.cpp
src/frontends/qt/GuiDocument.cpp
src/frontends/qt/GuiDocument.h
src/frontends/qt/Makefile.am
src/tex2lyx/Preamble.cpp
src/tex2lyx/Preamble.h
src/version.h

index e43dad5d8a965009feff54b6caa6b1bf86c630a4..4b782d54069881062a0446b2c4cc4e4b73e6de9e 100644 (file)
@@ -7,6 +7,10 @@ changes happened in particular if possible. A good example would be
 
 -----------------------
 
+2019-12-24 Jürgen Spitzmüller <spitz@lyx.org>
+       * Format incremented to 590: Add native changebar solution via buffer param
+          \change_bars.
+
 2019-08-14 Jürgen Spitzmüller <spitz@lyx.org>
        * Format incremented to 589: Height now is totalheight in graphics.
 
index d0b0b7b5a1d9759aada3f1da97fb20f39c3864cf..83e58bbf65f8dc48897b13994e0fc7a4a241226c 100644 (file)
@@ -2310,7 +2310,6 @@ dist_layouts_DATA =\
        layouts/bxjsbook.layout \
        layouts/bxjsreport.layout \
        layouts/bxjsslide.layout \
-       layouts/changebars.module \
        layouts/chess.layout \
        layouts/chessboard.module \
        layouts/cl2emult.layout \
index 73b1daa90e3b208a6225bd5092c1c1a943f13249..14230d46741c214d3ab87bc3d107f4e4e16152a2 100644 (file)
 \TestPackage{CJK}
 \TestPackage{calc}
 \TestPackage{cancel}
+\TestPackage{changebar}
 \TestPackage{chapterbib}
 \TestPackage{chemgreek}
 \TestPackage{chessboard}
index b61eb30c3e0910e2d5a0e247dcfcd6dbfc9ecabb..6f821643d0b253cce79596394a6f2d9393888b9c 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 583
+\lyxformat 590
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -149,6 +149,7 @@ logicalmkup
 \tablestyle default
 \tracking_changes true
 \output_changes false
+\change_bars false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict true
@@ -38204,6 +38205,8 @@ The toolbar has two buttons to handle notes because notes are often important
 \end_layout
 
 \begin_layout Standard
+
+\change_deleted -712698321 1577206802
 To show the changes made in the output you need the \SpecialChar LaTeX
  package 
 \series bold
@@ -38232,6 +38235,8 @@ literal "true"
 
  or in the package manager of your \SpecialChar LaTeX
 -system.
+\change_unchanged
+
 \end_layout
 
 \begin_layout Section
@@ -46862,6 +46867,42 @@ Objects
  manual.
 \end_layout
 
+\begin_layout Section
+
+\change_inserted -712698321 1577206827
+Change Tracking
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted -712698321 1577206929
+Here you can do some settings related to change tracking (see sec.
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sec:Change-Tracking"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+).
+ Alternatively to the menu or toolbar, you can set here whether changes
+ are being tracked and whether they are shown in the output.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted -712698321 1577207214
+Additionally, you can advise LyX to place a change bar in the margin of
+ the output.
+ This might be useful to make changed passages more salient.
+\end_layout
+
 \begin_layout Section
 Numbering & TOC
 \end_layout
index 5a35933f5f56c11be5fc51b360327a69d092ed63..e34f4f1dc551487361b8522f269b269798a0d979 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 583
+\lyxformat 590
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -154,6 +154,7 @@ logicalmkup
 \tablestyle default
 \tracking_changes false
 \output_changes false
+\change_bars false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
@@ -36511,38 +36512,6 @@ Die Werkzeugleiste hat zwei Schaltknöpfe, um Notizen zu behandeln, weil
  diese zur Beschreibung einer Änderung oft wichtig sind.
 \end_layout
 
-\begin_layout Standard
-Um Änderungen in der Druckausgabe anzeigen zu können, benötigen Sie das
- \SpecialChar LaTeX
--Paket 
-\series bold
-dvipost
-\series default
-
-\begin_inset Index idx
-status collapsed
-
-\begin_layout Plain Layout
-\SpecialChar LaTeX
--Paket ! dvipost
-\end_layout
-
-\end_inset
-
-.
- Sie finden es im \SpecialChar TeX
--Katalog, 
-\begin_inset CommandInset citation
-LatexCommand cite
-key "TeX-Katalog"
-literal "true"
-
-\end_inset
-
-, oder im Paket-Manager Ihres \SpecialChar LaTeX
--Systems.
-\end_layout
-
 \begin_layout Section
 Vergleich von Dokumenten
 \begin_inset CommandInset label
@@ -44336,6 +44305,37 @@ Objekte
  Handbuchs erklärt.
 \end_layout
 
+\begin_layout Section
+Änderungsverfolgung
+\end_layout
+
+\begin_layout Standard
+Hier können Sie einige Einstellungen zur Änderungsverfolgung (vgl.
+ Abschnitt
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sec:Änderungsverfolgung"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+) vornehmen.
+ Alternativ zum Menü und der Werkzeugleiste können Sie hier bestimmen, ob
+ Änderungen aufgezeichnet werden und ob sie in der Ausgabe angezeigt werden.
+\end_layout
+
+\begin_layout Standard
+Zusätzlich können Sie hier einen Änderungsbalken aktivieren, der in der
+ Ausgabe in den Seitenrand gedruckt wird, um geänderte Stellen sichtbarer
+ zu machen.
+\end_layout
+
 \begin_layout Section
 Nummerierung
 \begin_inset space ~
diff --git a/lib/layouts/changebars.module b/lib/layouts/changebars.module
deleted file mode 100644 (file)
index f0c27f3..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#\DeclareLyXModule[changebar.sty]{Change Tracking Bars}
-#\DeclareCategory{Annotation & Revision}
-#
-#DescriptionBegin
-#Enables LyX to add vertical change bars in the margin of PDF output
-#when Show Changes in Output is turned on and pdflatex output format is chosen.
-#DescriptionEnd
-#
-#Author: Paul A. Rubin (rubin@msu.edu)
-#Based on code proposed by Juergen Spitzmueller
-#(http://comments.gmane.org/gmane.editors.lyx.general/66666).
-#
-# Note: the \providecommand statements are necessary to avoid
-# error messages from the \renewcommand statements if change
-# tracking is turned off in the document.
-#
-
-Format 80
-
-AddToPreamble
-  \usepackage{changebar}
-  \providecommand{\lyxadded}[4][]{}
-  \providecommand{\lyxdeleted}{}
-  \renewcommand{\lyxadded}[4][]{
-    {\protect\cbstart\color{lyxadded}{}#4\protect\cbend}
-  }
-  \renewcommand{\lyxdeleted}[4][]{%
-    {\protect\cbstart\color{lyxdeleted}\sout{#4}\protect\cbend}
-  }
-EndPreamble
index 5b1a87c2c9a4b178566d66d0b373eea07bb76e8f..5d59e340627d328edc05d188ce537e1b8865a707 100644 (file)
@@ -3635,6 +3635,39 @@ def convert_totalheight(document):
             document.body.insert(k, "\theight " + newheight) 
         i = j + 1
 
+
+def convert_changebars(document):
+    " Converts the changebars module to native solution "
+
+    if not "changebars" in document.get_module_list():
+        return
+
+    i = find_token(document.header, "\\output_changes", 0)
+    if i == -1:
+        document.warning("Malformed LyX document! Missing \\output_changes header.")
+        document.del_module("changebars")
+        return
+
+    document.header.insert(i, "\\change_bars true")
+    document.del_module("changebars")
+
+
+def revert_changebars(document):
+    " Converts native changebar param to module "
+
+    i = find_token(document.header, "\\change_bars", 0)
+    if i == -1:
+        document.warning("Malformed LyX document! Missing \\change_bars header.")
+        return
+
+    val = get_value(document.header, "\\change_bars", i)
+
+    if val == "true":
+        document.add_module("changebars")
+
+    del document.header[i]
+
+
 ##
 # Conversion hub
 #
@@ -3685,10 +3718,12 @@ convert = [
            [586, []],
            [587, [convert_pagesizenames]],
            [588, []],
-           [589, [convert_totalheight]]
+           [589, [convert_totalheight]],
+           [590, [convert_changebars]]
           ]
 
-revert =  [[588, [revert_totalheight]],
+revert =  [[589, [revert_changebars]],
+           [588, [revert_totalheight]],
            [587, [revert_memoir_endnotes,revert_enotez,revert_theendnotes]],
            [586, [revert_pagesizenames]],
            [585, [revert_dupqualicites]],
index 6cebf5d7f6264ac03d7db0286088c14bf4e4e872..2d3160e5a65dc6434eb8d324572cce3663efa403 100644 (file)
@@ -321,7 +321,7 @@ public:
        /// If there was an error when previewing, on the next preview we do
        /// a fresh compile (e.g. in case the user installed a package that
        /// was missing).
-       bool preview_error_;
+       bool require_fresh_start_;
 
        /// Cache the references associated to a label and their positions
        /// in the buffer.
@@ -456,7 +456,7 @@ Buffer::Impl::Impl(Buffer * owner, FileName const & file, bool readonly_,
          file_fully_loaded(false), file_format(LYX_FORMAT), need_format_backup(false),
          ignore_parent(false),  toc_backend(owner), macro_lock(false),
          checksum_(0), wa_(0),  gui_(0), undo_(*owner), bibinfo_cache_valid_(false),
-         cite_labels_valid_(false), have_bibitems_(false), preview_error_(false),
+         cite_labels_valid_(false), have_bibitems_(false), require_fresh_start_(false),
          inset(0), preview_loader_(0), cloned_buffer_(cloned_buffer),
          clone_list_(0), doing_export(false),
          tracked_changes_present_(0), externally_modified_(false), parent_buffer(0),
@@ -489,7 +489,7 @@ Buffer::Impl::Impl(Buffer * owner, FileName const & file, bool readonly_,
        layout_position = cloned_buffer_->d->layout_position;
        preview_file_ = cloned_buffer_->d->preview_file_;
        preview_format_ = cloned_buffer_->d->preview_format_;
-       preview_error_ = cloned_buffer_->d->preview_error_;
+       require_fresh_start_ = cloned_buffer_->d->require_fresh_start_;
        tracked_changes_present_ = cloned_buffer_->d->tracked_changes_present_;
 }
 
@@ -1246,9 +1246,14 @@ void Buffer::setFullyLoaded(bool value)
 }
 
 
-bool Buffer::lastPreviewError() const
+bool Buffer::freshStartRequired() const
 {
-       return d->preview_error_;
+       return d->require_fresh_start_;
+}
+
+void Buffer::requireFreshStart(bool const b) const
+{
+       d->require_fresh_start_ = b;
 }
 
 
@@ -4728,7 +4733,7 @@ Buffer::ExportStatus Buffer::preview(string const & format, bool includeall) con
        Impl * theimpl = isClone() ? d->cloned_buffer_->d : d;
        theimpl->preview_file_ = previewFile;
        theimpl->preview_format_ = format;
-       theimpl->preview_error_ = (status != ExportSuccess);
+       theimpl->require_fresh_start_ = (status != ExportSuccess);
 
        if (status != ExportSuccess)
                return status;
index 7ed9f05d748a004c1084a98f29826dbc41117f8d..621c29403d7873c08be911030ba406bb23f24dc6 100644 (file)
@@ -681,7 +681,9 @@ public:
        ExportStatus preview(std::string const & format) const;
        /// true if there was a previous preview this session of this buffer and
        /// there was an error on the previous preview of this buffer.
-       bool lastPreviewError() const;
+       bool freshStartRequired() const;
+       ///
+       void requireFreshStart(bool const b) const;
 
 private:
        ///
index 3b0b8310b2a9fcfcc34f32467e1bd3a69e0ab0c9..399faa393344a97d0c7039c6a2222885b5f654d8 100644 (file)
@@ -410,6 +410,7 @@ BufferParams::BufferParams()
        save_transient_properties = true;
        track_changes = false;
        output_changes = false;
+       change_bars = false;
        use_default_options = true;
        maintain_unincluded_children = false;
        secnumdepth = 3;
@@ -951,6 +952,8 @@ string BufferParams::readToken(Lexer & lex, string const & token,
                lex >> track_changes;
        } else if (token == "\\output_changes") {
                lex >> output_changes;
+       } else if (token == "\\change_bars") {
+               lex >> change_bars;
        } else if (token == "\\branch") {
                lex.eatLine();
                docstring branch = lex.getDocString();
@@ -1468,6 +1471,10 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
           << (save_transient_properties ? convert<string>(output_changes) : "false")
           << '\n';
 
+       os << "\\change_bars "
+          << (save_transient_properties ? convert<string>(change_bars) : "false")
+          << '\n';
+
        os << "\\html_math_output " << html_math_output << '\n'
           << "\\html_css_as_file " << html_css_as_file << '\n'
           << "\\html_be_strict " << convert<string>(html_be_strict) << '\n';
@@ -1525,6 +1532,8 @@ void BufferParams::validate(LaTeXFeatures & features) const
                default:
                        break;
                }
+               if (change_bars)
+                       features.require("changebar");
        }
 
        // Floats with 'Here definitely' as default setting.
index 3a5cd29e3c813c0ed1959ad337ccabc9c3624dc0..5b5a16f67fcfbbbc774cd0e6707b17114719ebec 100644 (file)
@@ -434,6 +434,8 @@ public:
         */
        bool output_changes;
        ///
+       bool change_bars;
+       ///
        bool compressed;
 
        /// the author list for the document
index 2ffd98a42a14f68a68b93a419ee32b3c8b2ea125..d5686f666da5a6a2152b7188333d0137ad2e97f8 100644 (file)
@@ -863,7 +863,7 @@ Converters::RetVal Converters::runLaTeX(Buffer const & buffer, string const & co
        string const name = buffer.latexName();
        LaTeX latex(command, runparams, FileName(makeAbsPath(name)),
                    buffer.filePath(), buffer.layoutPos(),
-                   buffer.isClone(), buffer.lastPreviewError());
+                   buffer.isClone(), buffer.freshStartRequired());
        TeXErrors terr;
        // The connection closes itself at the end of the scope when latex is
        // destroyed. One cannot close (and destroy) buffer while the converter is
index 533f5ad69619c808fefb62134662d99f45f67180..346206768dbcfe67d2adde73657477b4d728a26c 100644 (file)
@@ -236,6 +236,18 @@ static docstring const lyxdot_def = from_ascii(
        "\\newcommand{\\lyxdot}{.}\n");
 
 static docstring const changetracking_dvipost_def = from_ascii(
+       "%% Change tracking with dvipost\n"
+       "\\dvipostlayout\n"
+       "\\dvipost{osstart color push Red}\n"
+       "\\dvipost{osend color pop}\n"
+       "\\dvipost{cbstart color push Blue}\n"
+       "\\dvipost{cbrule 0pt}\n"
+       "\\dvipost{cbend color pop}\n"
+       "\\DeclareRobustCommand{\\lyxadded}[4][]{\\changestart#4\\changeend}\n"
+       "\\DeclareRobustCommand{\\lyxdeleted}[4][]{%\n"
+       "\\changestart\\overstrikeon#4\\overstrikeoff\\changeend}\n");
+
+static docstring const changetracking_dvipost_cb_def = from_ascii(
        "%% Change tracking with dvipost\n"
        "\\dvipostlayout\n"
        "\\dvipost{osstart color push Red}\n"
@@ -252,12 +264,36 @@ static docstring const changetracking_xcolor_ulem_def = from_ascii(
        "\\DeclareRobustCommand{\\lyxdeleted}[4][]{{\\color{lyxdeleted}\\lyxsout{#4}}}\n"
        "\\DeclareRobustCommand{\\lyxsout}[1]{\\ifx\\\\#1\\else\\sout{#1}\\fi}\n");
 
+static docstring const changetracking_xcolor_ulem_cb_def = from_ascii(
+       "%% Change tracking with ulem and changebars\n"
+       "\\DeclareRobustCommand{\\lyxadded}[4][]{{%\n"
+       "    \\protect\\cbstart\\color{lyxadded}{}#4%\n"
+       "    \\protect\\cbend%\n"
+       "}}\n"
+       "\\DeclareRobustCommand{\\lyxdeleted}[4][]{{%\n"
+       "    \\protect\\cbstart\\color{lyxdeleted}\\lyxsout{#4}%\n"
+       "    \\protect\\cbend%\n"
+       "}}\n"
+       "\\DeclareRobustCommand{\\lyxsout}[1]{\\ifx\\\\#1\\else\\sout{#1}\\fi}\n");
+
 static docstring const changetracking_xcolor_ulem_hyperref_def = from_ascii(
-       "%% Change tracking with ulem\n"
+       "%% Change tracking with ulem and hyperref\n"
        "\\DeclareRobustCommand{\\lyxadded}[4][]{{\\texorpdfstring{\\color{lyxadded}{}}{}#4}}\n"
        "\\DeclareRobustCommand{\\lyxdeleted}[4][]{{\\texorpdfstring{\\color{lyxdeleted}\\lyxsout{#4}}{}}}\n"
        "\\DeclareRobustCommand{\\lyxsout}[1]{\\ifx\\\\#1\\else\\sout{#1}\\fi}\n");
 
+static docstring const changetracking_xcolor_ulem_hyperref_cb_def = from_ascii(
+       "%% Change tracking with ulem, hyperref and changebars\n"
+       "\\DeclareRobustCommand{\\lyxadded}[4][]{{%\n"
+       "    \\texorpdfstring{\\protect\\cbstart\\color{lyxadded}{}}{}#4%\n"
+       "    \\texorpdfstring{\\protect\\cbend}{}%/n"
+       "}}\n"
+       "\\DeclareRobustCommand{\\lyxdeleted}[4][]{{%\n"
+       "    \\texorpdfstring{\\protect\\cbstart\\color{lyxdeleted}\\lyxsout{#4}%\n"
+       "    \\protect\\cbend}{}%\n"
+       "}}\n"
+       "\\DeclareRobustCommand{\\lyxsout}[1]{\\ifx\\\\#1\\else\\sout{#1}\\fi}\n");
+
 static docstring const changetracking_tikz_math_sout_def = from_ascii(
        "%% Strike out display math with tikz\n"
        "\\usepackage{tikz}\n"
@@ -1176,6 +1212,10 @@ string const LaTeXFeatures::getPackages() const
        // The rest of these packages are somewhat more complicated
        // than those above.
 
+       if (mustProvide("changebar") && !mustProvide("ct-dvipost")) {
+               packages << "\\usepackage{changebar}\n";
+       }
+
        if (mustProvide("footnote")) {
                if (isRequired("hyperref"))
                        packages << "\\usepackage{footnotehyper}\n";
@@ -1615,8 +1655,12 @@ TexString LaTeXFeatures::getMacros() const
                macros << lyxref_def << '\n';
 
        // change tracking
-       if (mustProvide("ct-dvipost"))
-               macros << changetracking_dvipost_def;
+       if (mustProvide("ct-dvipost")) {
+               if (isRequired("changebar"))
+                       macros << changetracking_dvipost_cb_def;
+               else
+                       macros << changetracking_dvipost_def;
+       }
 
        if (mustProvide("ct-xcolor-ulem")) {
                streamsize const prec = macros.os().precision(2);
@@ -1631,14 +1675,21 @@ TexString LaTeXFeatures::getMacros() const
 
                macros.os().precision(prec);
 
-               if (isRequired("hyperref"))
-                       macros << changetracking_xcolor_ulem_hyperref_def;
-               else
-                       macros << changetracking_xcolor_ulem_def;
+               if (isRequired("changebar")) {
+                       if (isRequired("hyperref"))
+                               macros << changetracking_xcolor_ulem_hyperref_cb_def;
+                       else
+                               macros << changetracking_xcolor_ulem_cb_def;
+               } else {
+                       if (isRequired("hyperref"))
+                               macros << changetracking_xcolor_ulem_hyperref_def;
+                       else
+                               macros << changetracking_xcolor_ulem_def;
+               }
        }
 
        if (mustProvide("ct-tikz-math-sout"))
-                       macros << changetracking_tikz_math_sout_def;
+               macros << changetracking_tikz_math_sout_def;
 
        if (mustProvide("ct-none"))
                macros << changetracking_none_def;
index 56f44687dda61cc93e46267043e0693967222d6c..095c0a2ca4bf970596c3397e0a6899f7a8c0daa1 100644 (file)
@@ -1305,6 +1305,14 @@ GuiDocument::GuiDocument(GuiView & lv)
        connect(colorModule->delBoxBackgroundTB, SIGNAL(clicked()),
                this, SLOT(deleteBoxBackgroundColor()));
 
+       // change tracking
+       changesModule = new UiWidget<Ui::ChangeTrackingUi>(this);
+       connect(changesModule->trackChangesCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
+       connect(changesModule->outputChangesCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
+       connect(changesModule->changeBarsCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
 
        // numbering
        numberingModule = new UiWidget<Ui::NumberingUi>(this);
@@ -1743,6 +1751,7 @@ GuiDocument::GuiDocument(GuiView & lv)
        docPS->addPanel(marginsModule, N_("Page Margins"));
        docPS->addPanel(langModule, N_("Language"));
        docPS->addPanel(colorModule, N_("Colors"));
+       docPS->addPanel(changesModule, N_("Change Tracking"));
        docPS->addPanel(numberingModule, N_("Numbering & TOC"));
        docPS->addPanel(biblioModule, N_("Bibliography"));
        docPS->addPanel(indicesModule, N_("Indexes"));
@@ -3798,6 +3807,17 @@ void GuiDocument::applyView()
        pdf.quoted_options = pdf.quoted_options_check(
                                fromqstr(pdfSupportModule->optionsLE->text()));
 
+       // change tracking
+       bp_.track_changes = changesModule->trackChangesCB->isChecked();
+       bp_.output_changes = changesModule->outputChangesCB->isChecked();
+       bool const cb_switched_off = (bp_.change_bars
+                                     && !changesModule->changeBarsCB->isChecked());
+       bp_.change_bars = changesModule->changeBarsCB->isChecked();
+       if (cb_switched_off)
+               // if change bars have been switched off,
+               // we need to ditch the aux file
+               buffer().requireFreshStart(true);
+
        // reset trackers
        nonModuleChanged_ = false;
        shellescapeChanged_ = false;
@@ -4391,6 +4411,11 @@ void GuiDocument::paramsToDialog()
        pdfSupportModule->optionsLE->setText(
                toqstr(pdf.quoted_options));
 
+       // change tracking
+       changesModule->trackChangesCB->setChecked(bp_.track_changes);
+       changesModule->outputChangesCB->setChecked(bp_.output_changes);
+       changesModule->changeBarsCB->setChecked(bp_.change_bars);
+
        // Make sure that the bc is in the INITIAL state
        if (bc().policy().buttonStatus(ButtonPolicy::RESTORE))
                bc().restore();
index 9647f3b60ca4b02443f9fbb6ee84d9794e029291..4d7cc80d7cadff5e1879a9b4a1522ff9e6a8935d 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "ui_BiblioUi.h"
 #include "ui_ColorUi.h"
+#include "ui_ChangeTrackingUi.h"
 #include "ui_DocumentUi.h"
 #include "ui_FontUi.h"
 #include "ui_LanguageUi.h"
@@ -174,6 +175,7 @@ private:
        UiWidget<Ui::MarginsUi> *marginsModule;
        UiWidget<Ui::LanguageUi> *langModule;
        UiWidget<Ui::ColorUi> *colorModule;
+       UiWidget<Ui::ChangeTrackingUi> *changesModule;
        UiWidget<Ui::NumberingUi> *numberingModule;
        UiWidget<Ui::BiblioUi> *biblioModule;
        UiWidget<Ui::MathsUi> *mathsModule;
index 27b4edd8dd6ad77e7dd80901d78684279df481f8..f5f75cb19d2b5d3d081ea6e19eaf294f11afed8b 100644 (file)
@@ -279,6 +279,7 @@ UIFILES = \
        BranchUi.ui \
        BulletsUi.ui \
        ChangesUi.ui \
+       ChangeTrackingUi.ui \
        CharacterUi.ui \
        CitationUi.ui \
        ColorUi.ui \
index b48985906833db2aa4fa60b0cc98608d044e7453..8b327b100d0a04622e872e0578b5df52ead4b5bd 100644 (file)
@@ -555,6 +555,7 @@ Preamble::Preamble() : one_language(true), explicit_babel(false),
        //h_notefontcolor;
        //h_options;
        h_output_changes          = "false";
+       h_change_bars             = "false";
        h_output_sync             = "0";
        //h_output_sync_macro
        h_papercolumns            = "1";
@@ -1782,6 +1783,9 @@ void Preamble::handle_package(Parser &p, string const & name,
                }
        }
 
+       else if (name == "changebar")
+               h_output_changes = "true";
+
        else if (!in_lyx_preamble) {
                if (options.empty())
                        h_preamble << "\\usepackage{" << name << '}';
@@ -2022,6 +2026,7 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled
                os << "\\listings_params " << h_listings_params << "\n";
        os << "\\tracking_changes " << h_tracking_changes << "\n"
           << "\\output_changes " << h_output_changes << "\n"
+          << "\\change_bars " << h_change_bars << "\n"
           << "\\html_math_output " << h_html_math_output << "\n"
           << "\\html_css_as_file " << h_html_css_as_file << "\n"
           << "\\html_be_strict " << h_html_be_strict << "\n"
index de20b5ede852612c5c32472d66bdc1439b57f59a..42c6069fd24ca4609ccfcd46271ae5b7ecab52a5 100644 (file)
@@ -202,6 +202,7 @@ private:
        std::string h_notefontcolor;
        std::string h_options;
        std::string h_output_changes;
+       std::string h_change_bars;
        std::string h_output_sync;
        std::string h_output_sync_macro;
        std::string h_papercolumns;
index 4c964166f0c88873836c9b075542c3cc4aa11eef..ee529fc31348bac74d730f87ecd99ead30be68e1 100644 (file)
@@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 589 // spitz: height > totalheight
-#define LYX_FORMAT_TEX2LYX 589
+#define LYX_FORMAT_LYX 590 // spitz: changebars
+#define LYX_FORMAT_TEX2LYX 590
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER