]> git.lyx.org Git - lyx.git/commitdiff
Get rid of autoBreakRow, which is obsoleted by allowMultiPar()
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 30 Mar 2015 17:45:01 +0000 (19:45 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 31 Mar 2015 15:02:00 +0000 (17:02 +0200)
The only real user was Text::insertStringAsLine, but this got changed
in commit 2c7152ab.

While not other place did read the value, there is a side effect of
setAutobreakRow that merges exiting paragraphs. However, this is used
in two situations

* some constructors, where the inset is empty;

* InsetTabular::toggleFixedWidth, which actually contains itself some
  code to merge paragraphs.

Therefore the member and all associated code can be removed safely.

src/Buffer.cpp
src/Text.cpp
src/Text.h
src/insets/InsetCaption.cpp
src/insets/InsetCollapsable.cpp
src/insets/InsetIPA.cpp
src/insets/InsetInfo.cpp
src/insets/InsetPreview.cpp
src/insets/InsetTabular.cpp
src/insets/InsetText.cpp
src/insets/InsetText.h

index dd18db215e5fa0b4bf652cfadabb59413cac242b..10e67273a35aec5fffa6345fc2531e4356f9ec09 100644 (file)
@@ -438,7 +438,6 @@ Buffer::Buffer(string const & file, bool readonly, Buffer const * cloned_buffer)
                        it.paragraph().setId(cloned_it.paragraph().id());
        } else
                d->inset = new InsetText(this);
-       d->inset->setAutoBreakRows(true);
        d->inset->getText(0)->setMacrocontextPosition(par_iterator_begin());
 }
 
index 866423ca353cdf110fc0567561f7a36e2843b139..ead2059c0a5989778b56ed2be1fadf83469c3064 100644 (file)
@@ -198,7 +198,7 @@ void mergeParagraph(BufferParams const & bparams,
 
 
 Text::Text(InsetText * owner, bool use_default_layout)
-       : owner_(owner), autoBreakRows_(false)
+       : owner_(owner)
 {
        pars_.push_back(Paragraph());
        Paragraph & par = pars_.back();
@@ -212,7 +212,7 @@ Text::Text(InsetText * owner, bool use_default_layout)
 
 
 Text::Text(InsetText * owner, Text const & text)
-       : owner_(owner), autoBreakRows_(text.autoBreakRows_)
+       : owner_(owner)
 {
        pars_ = text.pars_;
        ParagraphList::iterator const end = pars_.end();
index 4c8ab94a6ec011a950d68f3bfc883c4fca4ac46f..7cea9dc5c100b01c76c51204b91f788bc01e1e25 100644 (file)
@@ -378,8 +378,6 @@ private:
        InsetText * owner_;
        ///
        ParagraphList pars_;
-       ///
-       bool autoBreakRows_;
        /// position of the text in the buffer.
        DocIterator macrocontext_position_;
 };
index ee0c3e0d1d24587325b226c43e2953456fff76ec..e9642396255977311c11c7269eb1ae5ea3480234 100644 (file)
@@ -53,7 +53,6 @@ namespace lyx {
 InsetCaption::InsetCaption(Buffer * buf, string const & type)
     : InsetText(buf, InsetText::PlainLayout), type_(type)
 {
-       setAutoBreakRows(true);
        setDrawFrame(true);
        setFrameColor(Color_collapsableframe);
 }
index d038cfc2813a8a277a2bd713555576c681646885..6e5051ef5fd90b141e9d618258fa46fd34f79dad 100644 (file)
@@ -45,7 +45,6 @@ namespace lyx {
 InsetCollapsable::InsetCollapsable(Buffer * buf, InsetText::UsePlain ltype)
        : InsetText(buf, ltype), status_(Open), openinlined_(false)
 {
-       setAutoBreakRows(true);
        setDrawFrame(true);
        setFrameColor(Color_collapsableframe);
 }
index 2f756f28bcb55a3383364e6f1539759f1d60991d..e1f57299145376fc64ed89b04cc816d93a888e95 100644 (file)
@@ -38,7 +38,6 @@ InsetIPA::InsetIPA(Buffer * buf)
        : InsetText(buf),
          preview_(new RenderPreview(this)), use_preview_(true)
 {
-       setAutoBreakRows(true);
        setDrawFrame(true);
        setFrameColor(Color_insetframe);
 }
index 44a290e4a5420f214ac4fecc82b26c712169578a..6e21d9b3231bef0b9afa09df56c3ecae122f8239 100644 (file)
@@ -94,7 +94,6 @@ NameTranslator const & nameTranslator()
 InsetInfo::InsetInfo(Buffer * buf, string const & name) 
        : InsetCollapsable(buf), type_(UNKNOWN_INFO), name_()
 {
-       setAutoBreakRows(true);
        setInfo(name);
        status_ = Collapsed;
 }
index 2d2f39eb4778ac17b1d8b8532996175ee4b9addc..9f6b0b893f86c6e3b2526b37ddfd12e4e56d4324 100644 (file)
@@ -35,7 +35,6 @@ InsetPreview::InsetPreview(Buffer * buf)
        : InsetText(buf),
          preview_(new RenderPreview(this)), use_preview_(true)
 {
-       setAutoBreakRows(true);
        setDrawFrame(true);
        setFrameColor(Color_previewframe);
 }
index afab4763342d9737f683045023ba05b26aa0a76b..b0f9576476aec3ae13db889a7e23816f2e1c56d7 100644 (file)
@@ -1123,7 +1123,6 @@ namespace {
  */
 void toggleFixedWidth(Cursor & cur, InsetTableCell * inset, bool fixedWidth)
 {
-       inset->setAutoBreakRows(fixedWidth);
        inset->toggleFixedWidth(fixedWidth);
        if (fixedWidth)
                return;
index 254d86641ede94953d2258498bd8926dc6d534e8..7a67123c15637f538049e21094c0ab00b2e73ef1 100644 (file)
@@ -661,27 +661,6 @@ void InsetText::setText(docstring const & data, Font const & font, bool trackCha
 }
 
 
-void InsetText::setAutoBreakRows(bool flag)
-{
-       if (flag == text_.autoBreakRows_)
-               return;
-
-       text_.autoBreakRows_ = flag;
-       if (flag)
-               return;
-
-       // remove previously existing newlines
-       ParagraphList::iterator it = paragraphs().begin();
-       ParagraphList::iterator end = paragraphs().end();
-       for (; it != end; ++it)
-               for (int i = 0; i < it->size(); ++i)
-                       if (it->isNewline(i))
-                               // do not track the change, because the user
-                               // is not allowed to revert/reject it
-                               it->eraseChar(i, false);
-}
-
-
 void InsetText::setDrawFrame(bool flag)
 {
        drawFrame_ = flag;
index 1a6d123ac6981d98f116a26add9d18d956b1e4d6..52e4702f5523dcd44c060b62ffdb009fea92656f 100644 (file)
@@ -104,10 +104,6 @@ public:
        ///
        void setText(docstring const &, Font const &, bool trackChanges);
        ///
-       void setAutoBreakRows(bool);
-       ///
-       bool getAutoBreakRows() const { return text_.autoBreakRows_; }
-       ///
        void setDrawFrame(bool);
        ///
        ColorCode frameColor() const;