]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
Juergen's compiler warning fixes
[lyx.git] / src / paragraph.C
index f45a5db3298e2419b2fb353cb11943de3fac0a45..d39d43403975ae77404bfc57d963b5c3f1df4c42 100644 (file)
@@ -53,7 +53,6 @@
 
 using lyx::pos_type;
 
-using lyx::support::contains;
 using lyx::support::subst;
 
 using std::distance;
@@ -929,8 +928,6 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                basefont = getLayoutFont(bparams, outerfont);
        }
 
-       bool const moving_arg = runparams.moving_arg | style->needprotect;
-
        // Which font is currently active?
        LyXFont running_font(basefont);
        // Do we have an open font change?
@@ -947,7 +944,8 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                        ++column;
                }
                if (!asdefault)
-                       column += startTeXParParams(bparams, os, moving_arg);
+                       column += startTeXParParams(bparams, os, 
+                                                   runparams.moving_arg);
        }
 
        for (pos_type i = 0; i < size(); ++i) {
@@ -971,7 +969,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
 
                        if (!asdefault)
                                column += startTeXParParams(bparams, os,
-                                                           moving_arg);
+                                                           runparams.moving_arg);
                }
 
                value_type c = getChar(i);
@@ -1029,7 +1027,6 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                running_change = change;
 
                OutputParams rp = runparams;
-               rp.moving_arg = moving_arg;
                rp.free_spacing = style->free_spacing;
                rp.local_language = font.language()->babel();
                rp.intitle = style->intitle;
@@ -1073,7 +1070,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
        }
 
        if (!asdefault) {
-               column += endTeXParParams(bparams, os, moving_arg);
+               column += endTeXParParams(bparams, os, runparams.moving_arg);
        }
 
        lyxerr[Debug::LATEX] << "SimpleTeXOnePar...done " << this << endl;
@@ -1356,7 +1353,7 @@ bool Paragraph::emptyTag() const
 }
 
 
-string Paragraph::getID() const
+string Paragraph::getID(Buffer const & buf, OutputParams const & runparams) const
 {
        for (pos_type i = 0; i < size(); ++i) {
                if (isInset(i)) {
@@ -1364,7 +1361,7 @@ string Paragraph::getID() const
                        InsetBase::Code lyx_code = inset->lyxCode();
                        if (lyx_code == InsetBase::LABEL_CODE) {
                                string const id = static_cast<InsetCommand const *>(inset)->getContents();
-                               return "id=\"" + sgml::cleanID(id) + "\"";
+                               return "id=\"" + sgml::cleanID(buf, runparams, id) + "\"";
                        }
                }
 
@@ -1512,34 +1509,15 @@ bool Paragraph::isLineSeparator(pos_type pos) const
 }
 
 
-bool Paragraph::isKomma(pos_type pos) const
-{
-       return IsKommaChar(getChar(pos));
-}
-
-
 /// Used by the spellchecker
 bool Paragraph::isLetter(pos_type pos) const
 {
-       value_type const c = getChar(pos);
-       if (IsLetterChar(c))
-               return true;
        if (isInset(pos))
                return getInset(pos)->isLetter();
-       // We want to pass the ' and escape chars to ispell
-       string const extra = lyxrc.isp_esc_chars + '\'';
-       return contains(extra, c);
-}
-
-
-bool Paragraph::isWord(pos_type pos) const
-{
-       if (isInset(pos))
-               return getInset(pos)->isLetter();
-       value_type const c = getChar(pos);
-       return !(IsSeparatorChar(c)
-                 || IsKommaChar(c)
-                 || IsInsetChar(c));
+       else {
+               value_type const c = getChar(pos);
+               return IsLetterChar(c) || IsDigit(c);
+       }
 }