X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView.C;h=8a7bee84b17775a0551cb9843ed534cf10371ba5;hb=5eb1059f506d5db92d85e93057e752422e014ec2;hp=8173fc696c290ab31c028872aff61667968f6b42;hpb=c3a34a64f10486d1bd2e00da781a0423d8420519;p=lyx.git diff --git a/src/BufferView.C b/src/BufferView.C index 8173fc696c..8a7bee84b1 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -40,7 +40,6 @@ #include "support/FileInfo.h" #include "support/filetools.h" -#include "support/lyxfunctional.h" // equal_1st_in_pair #include "support/types.h" #include "support/lyxalgo.h" // lyx_count @@ -239,12 +238,6 @@ void BufferView::toggleSelection(bool b) } -void BufferView::toggleToggle() -{ - pimpl_->toggleToggle(); -} - - void BufferView::center() { pimpl_->center(); @@ -380,7 +373,7 @@ void BufferView::setCursorFromRow(int row) } -bool BufferView::insertInset(Inset * inset, string const & lout) +bool BufferView::insertInset(InsetOld * inset, string const & lout) { return pimpl_->insertInset(inset, lout); } @@ -517,7 +510,7 @@ bool BufferView::lockInset(UpdatableInset * inset) if (text->cursor.pos() < text->cursor.par()->size() && text->cursor.par()->getChar(text->cursor.pos()) == Paragraph::META_INSET) { - Inset * in = text->cursor.par()->getInset(text->cursor.pos()); + InsetOld * in = text->cursor.par()->getInset(text->cursor.pos()); if (inset == in) { theLockingInset(inset); return true; @@ -594,13 +587,13 @@ int BufferView::unlockInset(UpdatableInset * inset) } -void BufferView::updateInset(Inset * inset) +void BufferView::updateInset(InsetOld * inset) { pimpl_->updateInset(inset); } -bool BufferView::ChangeInsets(Inset::Code code, +bool BufferView::ChangeInsets(InsetOld::Code code, string const & from, string const & to) { bool need_update = false; @@ -632,8 +625,7 @@ bool BufferView::ChangeInsets(Inset::Code code, // How to set the cursor corretly when it.size()>1 ?? if (it.size() == 1) { text->setCursorIntern(it.pit(), 0); - text->redoParagraphs(text->cursor, - boost::next(text->cursor.par())); + text->redoParagraph(text->cursor.par()); text->partialRebreak(); } } @@ -652,22 +644,7 @@ bool BufferView::ChangeRefsIfUnique(string const & from, string const & to) if (lyx::count(labels.begin(), labels.end(), from) > 1) return false; - return ChangeInsets(Inset::REF_CODE, from, to); -} - - -bool BufferView::ChangeCitationsIfUnique(string const & from, string const & to) -{ - typedef pair StringPair; - - vector keys; - buffer()->fillWithBibKeys(keys); - if (count_if(keys.begin(), keys.end(), - lyx::equal_1st_in_pair(from)) - > 1) - return false; - - return ChangeInsets(Inset::CITE_CODE, from, to); + return ChangeInsets(InsetOld::REF_CODE, from, to); } @@ -697,7 +674,7 @@ LyXText * BufferView::getLyXText() const } -LyXText * BufferView::getParentText(Inset * inset) const +LyXText * BufferView::getParentText(InsetOld * inset) const { if (inset->owner()) { LyXText * txt = inset->getLyXText(this); @@ -711,7 +688,7 @@ LyXText * BufferView::getParentText(Inset * inset) const } -Language const * BufferView::getParentLanguage(Inset * inset) const +Language const * BufferView::getParentLanguage(InsetOld * inset) const { LyXText * text = getParentText(inset); return text->cursor.par()->getFontSettings(buffer()->params,