]> git.lyx.org Git - lyx.git/blobdiff - src/tabular.C
fix "make dist" target
[lyx.git] / src / tabular.C
index a3515f32a2b2da3e068cd65474f78ffb9adc401a..ce8d196ee99fd69dadf8f46032d4f1f77a8bb07f 100644 (file)
@@ -115,6 +115,12 @@ LyXTabular::LyXTabular(Buffer const * buf, InsetTabular * inset, LyXLex & lex)
 
 LyXTabular & LyXTabular::operator=(LyXTabular const & lt)
 {
+#if 0
+#warning This while method should look like this: (Lgb)
+
+               LyXTabular tmp(lt);
+               tmp.swap(*this);
+#else
        // If this and lt is not of the same size we have a serious bug
        // So then it is ok to throw an exception, or for now
        // call abort()
@@ -134,7 +140,7 @@ LyXTabular & LyXTabular::operator=(LyXTabular const & lt)
        rotate = lt.rotate;
 
        Reinit();
-       
+#endif
        return *this;
 }
 
@@ -156,7 +162,7 @@ LyXTabular * LyXTabular::Clone(InsetTabular * inset)
 }
 
 
-/* activates all lines and sets all widths to 0 */
+/* activates all lines and sets all widths to 0 */ 
 void LyXTabular::Init(int rows_arg, int columns_arg, LyXTabular const * lt)
 {
        rows_ = rows_arg;
@@ -169,7 +175,7 @@ void LyXTabular::Init(int rows_arg, int columns_arg, LyXTabular const * lt)
                operator=(*lt);
                return;
        }
-       
+
        int cellno = 0;
        for (int i = 0; i < rows_; ++i) {
                for (int j = 0; j < columns_; ++j) {
@@ -480,7 +486,7 @@ int LyXTabular::GetAdditionalHeight(int row) const
 {
        if (!row || row >= rows_)
                return 0;
-       
+
        bool top = true;
        bool bottom = true;
 
@@ -1475,10 +1481,7 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
 
        LyXParagraph * par = new LyXParagraph;
        LyXParagraph * return_par = 0;
-#ifndef NEW_INSETS
-       LyXParagraph::footnote_flag footnoteflag = LyXParagraph::NO_FOOTNOTE;
-       LyXParagraph::footnote_kind footnotekind = LyXParagraph::FOOTNOTE;
-#endif
+
        string tmptok;
        int pos = 0;
        char depth = 0;
@@ -1499,14 +1502,7 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
                if (owner_->BufferOwner()->parseSingleLyXformat2Token(lex, par,
                                                                                                                          return_par,
                                                                                                                          token, pos,
-                                                                                                                         depth, font
-#ifndef NEW_INSETS
-                                                                                                                         ,
-                                                                                                                         footnoteflag,
-                                                                                                                         footnotekind
-#endif
-                                                                                                                         ))
-               {
+                                                                                                                         depth, font)) {
                        // the_end read
                        lex.pushToken(token);
                        break;
@@ -1524,12 +1520,7 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
        InsetText * inset = GetCellInset(cell);
        int row;
 
-#ifndef NEW_INSETS
-       for (int i = 0; i < par->Last(); ++i)
-#else
-       for (int i = 0; i < par->size(); ++i)
-#endif
-       {
+       for (int i = 0; i < par->size(); ++i) {
                if (par->IsNewline(i)) {
                        ++cell;
                        if (cell > GetNumberOfCells()) {
@@ -1558,11 +1549,7 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
                        }
                }
                par->CopyIntoMinibuffer(*owner_->BufferOwner(), i);
-#ifndef NEW_INSETS
-               inset->par->InsertFromMinibuffer(inset->par->Last());
-#else
                inset->par->InsertFromMinibuffer(inset->par->size());
-#endif
        }
        delete par;
        Reinit();
@@ -2165,11 +2152,8 @@ int LyXTabular::Latex(Buffer const * buf,
                        InsetText * inset = GetCellInset(cell);
 
                        bool rtl = inset->par->isRightToLeftPar(buf->params) &&
-#ifndef NEW_INSETS
-                               inset->par->Last() > 0 && GetPWidth(cell).empty();
-#else
-                       inset->par->size() > 0 && GetPWidth(cell).empty();
-#endif
+                                       inset->par->size() > 0 && GetPWidth(cell).empty();
+
                        if (rtl)
                                os << "\\R{";
                        ret += inset->Latex(buf, os, fragile, fp);
@@ -2565,20 +2549,6 @@ std::vector<string> const LyXTabular::getLabelList() const
 }
 
                        
-#ifndef NEW_INSETS
-LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
-{
-       LyXParagraph * par = GetCellInset(cell)->par;
-
-       for (; par; par = par->next_) {
-               for (int i = 0; i < par->Last(); ++i) {
-                       if (par->GetChar(i)     == LyXParagraph::META_NEWLINE)
-                               return BOX_PARBOX;
-               }
-       }
-       return BOX_NONE;
-}
-#else
 LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
 {
        LyXParagraph * par = GetCellInset(cell)->par;
@@ -2591,7 +2561,7 @@ LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
        }
        return BOX_NONE;
 }
-#endif
+
 /* Emacs:
  * Local variables:
  * tab-width: 4