]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
Remove TextClassPtr without losing the type safety it provided.
[lyx.git] / src / insets / InsetTabular.cpp
index 0af0aa6cfa92269c7c02f3b04b59857621756618..20dbba81d97df6bc1741a99c6aefa6b7c5bf7b97 100644 (file)
@@ -345,7 +345,7 @@ bool getTokenValue(string const & str, char const * token, string & ret)
 {
        ret.erase();
        size_t token_length = strlen(token);
-       string::size_type pos = str.find(token);
+       size_t pos = str.find(token);
 
        if (pos == string::npos || pos + token_length + 1 >= str.length()
                || str[pos + token_length] != '=')
@@ -487,7 +487,7 @@ Tabular::CellData::CellData(Buffer const & buffer)
          inset(new InsetText(buffer.params()))
 {
        inset->setBuffer(const_cast<Buffer &>(buffer));
-       inset->paragraphs().back().setLayout(buffer.params().textClass().emptyLayout());
+       inset->paragraphs().back().setLayout(buffer.params().documentClass().emptyLayout());
 }
 
 
@@ -1097,7 +1097,7 @@ void toggleFixedWidth(Cursor & cur, InsetText * inset, bool fixedWidth)
        cur.push(*inset);
        // undo information has already been recorded
        inset->getText(0)->setLayout(cur.bv().buffer(), 0, cur.lastpit() + 1,
-                       bp.textClass().emptyLayoutName());
+                       bp.documentClass().emptyLayoutName());
        cur.pop();
 }
 
@@ -3175,7 +3175,7 @@ void InsetTabular::edit(Cursor & cur, bool front, EntryDirection)
 void InsetTabular::updateLabels(ParIterator const & it)
 {
        // In a longtable, tell captions what the current float is
-       Counters & cnts = buffer().params().textClass().counters();
+       Counters & cnts = buffer().params().documentClass().counters();
        string const saveflt = cnts.current_float();
        if (tabular.isLongTabular())
                cnts.current_float("table");
@@ -4697,8 +4697,8 @@ bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf,
        col_type cols = 1;
        row_type rows = 1;
        col_type maxCols = 1;
-       docstring::size_type const len = buf.length();
-       docstring::size_type p = 0;
+       size_t const len = buf.length();
+       size_t p = 0;
 
        while (p < len &&
               (p = buf.find_first_of(from_ascii("\t\n"), p)) != docstring::npos) {
@@ -4732,7 +4732,7 @@ bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf,
                row = tabular.cellRow(cell);
        }
 
-       docstring::size_type op = 0;
+       size_t op = 0;
        idx_type const cells = loctab->cellCount();
        p = 0;
        cols = ocol;
@@ -4750,7 +4750,7 @@ bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf,
                        if (cols < columns) {
                                shared_ptr<InsetText> inset = loctab->getCellInset(cell);
                                Font const font = bv.textMetrics(&inset->text_).
-                                       getDisplayFont(0, 0);
+                                       displayFont(0, 0);
                                inset->setText(buf.substr(op, p - op), font,
                                               buffer().params().trackChanges);
                                ++cols;
@@ -4762,7 +4762,7 @@ bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf,
                        if (cols < columns) {
                                shared_ptr<InsetText> inset = tabular.getCellInset(cell);
                                Font const font = bv.textMetrics(&inset->text_).
-                                       getDisplayFont(0, 0);
+                                       displayFont(0, 0);
                                inset->setText(buf.substr(op, p - op), font,
                                               buffer().params().trackChanges);
                        }
@@ -4778,7 +4778,7 @@ bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf,
        // check for the last cell if there is no trailing '\n'
        if (cell < cells && op < len) {
                shared_ptr<InsetText> inset = loctab->getCellInset(cell);
-               Font const font = bv.textMetrics(&inset->text_).getDisplayFont(0, 0);
+               Font const font = bv.textMetrics(&inset->text_).displayFont(0, 0);
                inset->setText(buf.substr(op, len - op), font,
                        buffer().params().trackChanges);
        }