]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
Revert "Objective-C compililation support with cmake and C++11"
[lyx.git] / src / Paragraph.cpp
index ed0ddd00675a026e65b572f7aa1c4f321d556231..3751cfd933e9ce9e12e3e208eec20df7fa02b82d 100644 (file)
@@ -3347,7 +3347,7 @@ docstring Paragraph::asString(int options) const
 }
 
 
-docstring Paragraph::asString(pos_type beg, pos_type end, int options) const
+docstring Paragraph::asString(pos_type beg, pos_type end, int options, const OutputParams *runparams) const
 {
        odocstringstream os;
 
@@ -3364,9 +3364,14 @@ docstring Paragraph::asString(pos_type beg, pos_type end, int options) const
                    || (c == '\n' && (options & AS_STR_NEWLINES)))
                        os.put(c);
                else if (c == META_INSET && (options & AS_STR_INSETS)) {
-                       getInset(i)->toString(os);
-                       if (getInset(i)->asInsetMath())
-                               os << " ";
+                       if (c == META_INSET && (options & AS_STR_PLAINTEXT)) {
+                               LASSERT(runparams != 0, return docstring());
+                               getInset(i)->plaintext(os, *runparams);
+                       } else {
+                               getInset(i)->toString(os);
+                               if (getInset(i)->asInsetMath())
+                                       os << " ";
+                       }
                }
        }
 
@@ -3392,33 +3397,6 @@ void Paragraph::forOutliner(docstring & os, size_t maxlen) const
 }
 
 
-docstring Paragraph::stringify(pos_type beg, pos_type end, int options,
-        OutputParams const & runparams) const
-{
-       odocstringstream os;
-
-       if (beg == 0
-               && options & AS_STR_LABEL
-               && !d->params_.labelString().empty())
-               os << d->params_.labelString() << ' ';
-
-       OutputParams op = runparams;
-       op.for_search = true;
-
-       for (pos_type i = beg; i < end; ++i) {
-               char_type const c = d->text_[i];
-               if (isPrintable(c) || c == '\t'
-                   || (c == '\n' && (options & AS_STR_NEWLINES)))
-                       os.put(c);
-               else if (c == META_INSET && (options & AS_STR_INSETS)) {
-                       getInset(i)->plaintext(os, op);
-               }
-       }
-
-       return os.str();
-}
-
-
 void Paragraph::setInsetOwner(Inset const * inset)
 {
        d->inset_owner_ = inset;