]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
zlib stuff
[lyx.git] / src / BufferView_pimpl.C
index e825e9962bf3de5aa7430d45000f85f3054d5651..1526c5112bed74e46ed362ca0694abdb71e8f4ef 100644 (file)
@@ -59,6 +59,7 @@
 #include "support/LAssert.h"
 #include "support/tostr.h"
 #include "support/filetools.h"
+#include "support/path_defines.h"
 
 #include <boost/bind.hpp>
 #include <boost/signals/connection.hpp>
@@ -790,7 +791,7 @@ void BufferView::Pimpl::switchKeyMap()
        LyXText * text = bv_->getLyXText();
        if (text->real_current_font.isRightToLeft()
            && !(bv_->theLockingInset()
-                && bv_->theLockingInset()->lyxCode() == Inset::ERT_CODE))
+                && bv_->theLockingInset()->lyxCode() == InsetOld::ERT_CODE))
        {
                if (owner_->getIntl().keymap == Intl::PRIMARY)
                        owner_->getIntl().KeyMapSec();
@@ -866,7 +867,7 @@ void BufferView::Pimpl::stuffClipboard(string const & stuff) const
  */
 
 
-Inset * BufferView::Pimpl::getInsetByCode(Inset::Code code)
+InsetOld * BufferView::Pimpl::getInsetByCode(InsetOld::Code code)
 {
 #if 0
        LyXCursor cursor = bv_->getLyXText()->cursor;
@@ -935,7 +936,7 @@ void BufferView::Pimpl::MenuInsertLyXFile(string const & filen)
                        make_pair(string(_("Documents|#o#O")),
                                  string(lyxrc.document_path)),
                        make_pair(string(_("Examples|#E#e")),
-                                 string(AddPath(system_lyxdir, "examples"))));
+                                 string(AddPath(system_lyxdir(), "examples"))));
 
                FileDialog::Result result =
                        fileDlg.open(initpath,
@@ -987,7 +988,7 @@ void BufferView::Pimpl::trackChanges()
 #warning changes FIXME
                //moveCursorUpdate(false);
 
-               bool found = lyxfind::findNextChange(bv_);
+               bool found = lyx::find::findNextChange(bv_);
                if (found) {
                        owner_->getDialogs().show("changes");
                        return;
@@ -1150,7 +1151,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
                string label = ev.argument;
                if (label.empty()) {
                        InsetRef * inset =
-                               static_cast<InsetRef*>(getInsetByCode(Inset::REF_CODE));
+                               static_cast<InsetRef*>(getInsetByCode(InsetOld::REF_CODE));
                        if (inset) {
                                label = inset->getContents();
                                savePosition(0);
@@ -1220,7 +1221,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
        break;
 
        case LFUN_INSET_INSERT: {
-               Inset * inset = createInset(ev);
+               InsetOld * inset = createInset(ev);
                if (inset && insertInset(inset)) {
                        updateInset(inset);
 
@@ -1241,7 +1242,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
 
        case LFUN_FLOAT_LIST:
                if (tclass.floats().typeExist(ev.argument)) {
-                       Inset * inset = new InsetFloatList(ev.argument);
+                       InsetOld * inset = new InsetFloatList(ev.argument);
                        if (!insertInset(inset, tclass.defaultLayoutName()))
                                delete inset;
                } else {
@@ -1274,7 +1275,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
                params2string(*par, data);
 
                // Will the paragraph accept changes from the dialog?
-               Inset * const inset = par->inInset();
+               InsetOld * const inset = par->inInset();
                bool const accept =
                        !(inset && inset->forceDefaultParagraphs(inset));
 
@@ -1322,7 +1323,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
 #warning FIXME changes
                //moveCursorUpdate(false);
 
-               while (lyxfind::findNextChange(bv_)) {
+               while (lyx::find::findNextChange(bv_)) {
                        bv_->getLyXText()->acceptChange();
                }
                update(BufferView::SELECT);
@@ -1335,7 +1336,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
 #warning FIXME changes
                //moveCursorUpdate(false);
 
-               while (lyxfind::findNextChange(bv_)) {
+               while (lyx::find::findNextChange(bv_)) {
                        bv_->getLyXText()->rejectChange();
                }
                update(BufferView::SELECT);
@@ -1366,7 +1367,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
 }
 
 
-bool BufferView::Pimpl::insertInset(Inset * inset, string const & lout)
+bool BufferView::Pimpl::insertInset(InsetOld * inset, string const & lout)
 {
        // if we are in a locking inset we should try to insert the
        // inset there otherwise this is a illegal function now
@@ -1377,7 +1378,7 @@ bool BufferView::Pimpl::insertInset(Inset * inset, string const & lout)
        }
 
        // not quite sure if we want this...
-       setCursorParUndo(bv_);
+       recordUndo(bv_, Undo::ATOMIC);
        freezeUndo();
 
        beforeChange(bv_->text);
@@ -1427,7 +1428,7 @@ bool BufferView::Pimpl::insertInset(Inset * inset, string const & lout)
 }
 
 
-void BufferView::Pimpl::updateInset(Inset * inset)
+void BufferView::Pimpl::updateInset(InsetOld * inset)
 {
        if (!inset || !available())
                return;
@@ -1452,7 +1453,7 @@ void BufferView::Pimpl::updateInset(Inset * inset)
        // then check if the inset is a top_level inset (has no owner)
        // if yes do the update as always otherwise we have to update the
        // toplevel inset where this inset is inside
-       Inset * tl_inset = inset;
+       InsetOld * tl_inset = inset;
        while (tl_inset->owner())
                tl_inset = tl_inset->owner();
        if (tl_inset == inset) {