]> git.lyx.org Git - features.git/blobdiff - src/Text.cpp
* Lazy MathData to avoid unneeded interpretation of macro definitions
[features.git] / src / Text.cpp
index faeb92c4b40d355e6d77adfc55be8b82dd741bd4..12ed1b85d9ee12c8d6de915f50faaea6cb7af602 100644 (file)
 
 #include <sstream>
 
-using std::auto_ptr;
-using std::string;
+using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
-using support::bformat;
-using support::contains;
-using support::split;
-using support::subst;
-
 using cap::cutSelection;
 using cap::pasteParagraphList;
 
@@ -250,7 +245,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
                change = Change(Change::UNCHANGED);
        } else if (token == "\\change_inserted") {
                lex.eatLine();
-               std::istringstream is(lex.getString());
+               istringstream is(lex.getString());
                unsigned int aid;
                time_t ct;
                is >> aid >> ct;
@@ -263,7 +258,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
                        change = Change(Change::INSERTED, bp.author_map[aid], ct);
        } else if (token == "\\change_deleted") {
                lex.eatLine();
-               std::istringstream is(lex.getString());
+               istringstream is(lex.getString());
                unsigned int aid;
                time_t ct;
                is >> aid >> ct;
@@ -1043,6 +1038,7 @@ bool Text::dissolveInset(Cursor & cur) {
                return false;
 
        cur.recordUndoInset();
+       cur.mark() = false;
        cur.selHandle(false);
        // save position
        pos_type spos = cur.pos();
@@ -1069,8 +1065,8 @@ bool Text::dissolveInset(Cursor & cur) {
                pasteParagraphList(cur, plist, b.params().getTextClassPtr(),
                                   b.errorList("Paste"));
                // restore position
-               cur.pit() = std::min(cur.lastpit(), spit);
-               cur.pos() = std::min(cur.lastpos(), spos);
+               cur.pit() = min(cur.lastpit(), spit);
+               cur.pos() = min(cur.lastpos(), spos);
        }
        cur.clearSelection();
        cur.resetAnchor();
@@ -1117,7 +1113,7 @@ void Text::getWord(CursorSlice & from, CursorSlice & to,
 }
 
 
-void Text::write(Buffer const & buf, std::ostream & os) const
+void Text::write(Buffer const & buf, ostream & os) const
 {
        ParagraphList::const_iterator pit = paragraphs().begin();
        ParagraphList::const_iterator end = paragraphs().end();
@@ -1250,7 +1246,7 @@ docstring Text::currentState(Cursor & cur)
        if (!par.empty() && cur.pos() < par.size()) {
                // Force output of code point, not character
                size_t const c = par.getChar(cur.pos());
-               os << _(", Char: 0x") << std::hex << c;
+               os << _(", Char: 0x") << hex << c;
        }
        os << _(", Boundary: ") << cur.boundary();
 //     Row & row = cur.textRow();
@@ -1396,4 +1392,16 @@ void Text::charsTranspose(Cursor & cur)
 }
 
 
+DocIterator Text::macrocontextPosition() const
+{
+       return macrocontext_position_;
+}
+
+
+void Text::setMacrocontextPosition(DocIterator const & pos)
+{
+       macrocontext_position_ = pos;
+}
+
+
 } // namespace lyx