#include "bufferparams.h"
#include "cursor.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "factory.h"
#include "FloatList.h"
#include "funcrequest.h"
#include "paragraph.h"
#include "paragraph_funcs.h"
#include "ParagraphParameters.h"
-#include "TextCache.h"
#include "undo.h"
#include "vspace.h"
bv_->showErrorList(_("Parse"));
if (tolastfiles)
- lastfiles->newFile(b->fileName());
+ LyX::ref().lastfiles().newFile(b->fileName());
return true;
}
<< b << ')' << endl;
if (buffer_) {
disconnectBuffer();
- // Put the old text into the TextCache, but
- // only if the buffer is still loaded.
- // Also set the owner of the test to 0
- // bv_->text->owner(0);
- textcache.add(buffer_, workarea().workWidth(), bv_->text);
- if (lyxerr.debugging())
- textcache.show(lyxerr, "BufferView::buffer");
-
+ delete bv_->text;
bv_->text = 0;
}
} else {
lyxerr[Debug::INFO] << " No Buffer!" << endl;
owner_->getDialogs().hideBufferDependent();
-
- // Also remove all remaining text's from the testcache.
- // (there should not be any!) (if there is any it is a
- // bug!)
- if (lyxerr.debugging())
- textcache.show(lyxerr, "buffer delete all");
- textcache.clear();
}
update();
bv_->text->fullRebreak();
update();
} else {
- lyxerr << "text not available!" << endl;
- // See if we have a text in TextCache that fits
- // the new buffer_ with the correct width.
- bv_->text = textcache.findFit(buffer_, workarea().workWidth());
- if (bv_->text) {
- lyxerr << "text in cache!" << endl;
- if (lyxerr.debugging()) {
- lyxerr << "Found a LyXText that fits:" << endl;
- textcache.show(lyxerr, make_pair(buffer_, make_pair(workarea().workWidth(), bv_->text)));
- }
- // Set the owner of the newly found text
- // bv_->text->owner(bv_);
- if (lyxerr.debugging())
- textcache.show(lyxerr, "resizeCurrentBuffer");
- } else {
- lyxerr << "no text in cache!" << endl;
bv_->text = new LyXText(bv_, 0, false, bv_->buffer()->paragraphs());
bv_->text->init(bv_);
- }
}
-#warning does not help much
- //bv_->text->redoParagraphs(bv_->text->ownerParagraphs().begin(),
- // bv_->text->ownerParagraphs().end());
-
if (par != -1) {
bv_->text->selection.set(true);
// At this point just to avoid the Delete-Empty-Paragraph-
if (widthChange) {
// The visible LyXView need a resize
resizeCurrentBuffer();
-
- // Remove all texts from the textcache
- // This is not _really_ what we want to do. What
- // we really want to do is to delete in textcache
- // that does not have a BufferView with matching
- // width, but as long as we have only one BufferView
- // deleting all gives the same result.
- if (lyxerr.debugging())
- textcache.show(lyxerr, "Expose delete all");
- textcache.clear();
}
}
// Note that the localDispatch performs updateInset
// also.
FuncRequest fr(bv_, LFUN_INSET_MODIFY, ev.argument);
- inset->localDispatch(fr);
+ inset->dispatch(fr);
} else {
FuncRequest fr(bv_, LFUN_INSET_INSERT, ev.argument);
dispatch(fr);
break;
default:
- return bv_->getLyXText()->dispatch(FuncRequest(ev, bv_));
+ return bv_->getLyXText()->dispatch(FuncRequest(ev, bv_)).dispatched();
} // end of switch
return true;
bv_->text->setLayout(lay);
- bv_->text->setParagraph(0, 0,
- 0, 0,
+ bv_->text->setParagraph(
VSpace(VSpace::NONE), VSpace(VSpace::NONE),
Spacing(),
LYX_ALIGN_LAYOUT,