From 32871c1284f15265f652ff01c438e539a7c8181f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Sun, 29 Apr 2007 13:39:47 +0000 Subject: [PATCH] rename InsetBase to Inset git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18089 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Bidi.cpp | 2 +- src/Buffer.cpp | 20 +-- src/Buffer.h | 6 +- src/BufferView.cpp | 38 ++-- src/BufferView.h | 6 +- src/CoordCache.cpp | 29 ++-- src/CoordCache.h | 8 +- src/Cursor.cpp | 28 +-- src/Cursor.h | 12 +- src/CursorSlice.cpp | 2 +- src/CursorSlice.h | 10 +- src/CutAndPaste.cpp | 30 ++-- src/DocIterator.cpp | 30 ++-- src/DocIterator.h | 24 +-- src/InsetIterator.cpp | 6 +- src/InsetIterator.h | 10 +- src/InsetList.cpp | 8 +- src/InsetList.h | 12 +- src/LyX.cpp | 2 +- src/LyX.h | 4 +- src/LyXFunc.cpp | 42 ++--- src/LyXText.h | 8 +- src/ParIterator.cpp | 14 +- src/ParIterator.h | 12 +- src/Paragraph.cpp | 86 +++++----- src/Paragraph.h | 26 +-- src/TextMetrics.cpp | 4 +- src/TocBackend.cpp | 8 +- src/Undo.cpp | 2 +- src/buffer_funcs.cpp | 30 ++-- src/bufferview_funcs.cpp | 18 +- src/bufferview_funcs.h | 10 +- src/factory.cpp | 8 +- src/factory.h | 6 +- src/frontends/Dialogs.cpp | 12 +- src/frontends/Dialogs.h | 12 +- src/frontends/LyXView.cpp | 4 +- src/frontends/LyXView.h | 6 +- src/frontends/controllers/ControlTabular.cpp | 2 +- src/graphics/PreviewLoader.cpp | 6 +- src/graphics/Previews.cpp | 4 +- src/insets/{InsetBase.cpp => Inset.cpp} | 172 +++++++++---------- src/insets/{InsetBase.h => Inset.h} | 40 ++--- src/insets/InsetBibitem.cpp | 6 +- src/insets/InsetBibitem.h | 4 +- src/insets/InsetBibtex.cpp | 4 +- src/insets/InsetBibtex.h | 4 +- src/insets/InsetBox.cpp | 4 +- src/insets/InsetBox.h | 8 +- src/insets/InsetBranch.cpp | 4 +- src/insets/InsetBranch.h | 8 +- src/insets/InsetCaption.cpp | 8 +- src/insets/InsetCaption.h | 10 +- src/insets/InsetCharStyle.cpp | 4 +- src/insets/InsetCharStyle.h | 6 +- src/insets/InsetCitation.h | 6 +- src/insets/InsetCollapsable.cpp | 4 +- src/insets/InsetCollapsable.h | 8 +- src/insets/InsetCommand.cpp | 4 +- src/insets/InsetCommand.h | 8 +- src/insets/InsetERT.cpp | 6 +- src/insets/InsetERT.h | 10 +- src/insets/InsetEnvironment.cpp | 10 +- src/insets/InsetEnvironment.h | 8 +- src/insets/InsetExternal.cpp | 10 +- src/insets/InsetExternal.h | 10 +- src/insets/InsetFloat.cpp | 12 +- src/insets/InsetFloat.h | 10 +- src/insets/InsetFloatList.cpp | 4 +- src/insets/InsetFloatList.h | 6 +- src/insets/InsetFoot.cpp | 4 +- src/insets/InsetFoot.h | 6 +- src/insets/InsetFootlike.cpp | 8 +- src/insets/InsetFootlike.h | 2 +- src/insets/InsetGraphics.cpp | 12 +- src/insets/InsetGraphics.h | 10 +- src/insets/InsetHFill.cpp | 4 +- src/insets/InsetHFill.h | 4 +- src/insets/InsetInclude.cpp | 10 +- src/insets/InsetInclude.h | 10 +- src/insets/InsetIndex.cpp | 8 +- src/insets/InsetIndex.h | 12 +- src/insets/InsetLabel.cpp | 6 +- src/insets/InsetLabel.h | 4 +- src/insets/InsetLine.h | 10 +- src/insets/InsetMarginal.cpp | 4 +- src/insets/InsetMarginal.h | 4 +- src/insets/InsetNewline.h | 10 +- src/insets/InsetNomencl.cpp | 12 +- src/insets/InsetNomencl.h | 12 +- src/insets/InsetNote.cpp | 4 +- src/insets/InsetNote.h | 8 +- src/insets/InsetOptArg.cpp | 4 +- src/insets/InsetOptArg.h | 4 +- src/insets/InsetPagebreak.h | 18 +- src/insets/InsetQuotes.cpp | 8 +- src/insets/InsetQuotes.h | 10 +- src/insets/InsetRef.h | 4 +- src/insets/InsetSpace.cpp | 4 +- src/insets/InsetSpace.h | 8 +- src/insets/InsetSpecialChar.cpp | 4 +- src/insets/InsetSpecialChar.h | 8 +- src/insets/InsetTOC.cpp | 10 +- src/insets/InsetTOC.h | 4 +- src/insets/InsetTabular.cpp | 16 +- src/insets/InsetTabular.h | 16 +- src/insets/InsetText.cpp | 8 +- src/insets/InsetText.h | 8 +- src/insets/InsetTheorem.cpp | 20 +-- src/insets/InsetTheorem.h | 12 +- src/insets/InsetUrl.h | 6 +- src/insets/InsetVSpace.cpp | 6 +- src/insets/InsetVSpace.h | 8 +- src/insets/InsetWrap.cpp | 6 +- src/insets/InsetWrap.h | 10 +- src/insets/MailInset.h | 4 +- src/insets/Makefile.am | 4 +- src/insets/RenderBase.h | 4 +- src/insets/RenderButton.cpp | 2 +- src/insets/RenderButton.h | 2 +- src/insets/RenderGraphic.cpp | 22 +-- src/insets/RenderGraphic.h | 6 +- src/insets/RenderPreview.cpp | 12 +- src/insets/RenderPreview.h | 10 +- src/insets/pch.h | 2 +- src/mathed/CommandInset.cpp | 6 +- src/mathed/CommandInset.h | 4 +- src/mathed/InsetFormulaMacro.cpp | 4 +- src/mathed/InsetFormulaMacro.h | 4 +- src/mathed/InsetMath.h | 4 +- src/mathed/InsetMathAMSArray.cpp | 4 +- src/mathed/InsetMathAMSArray.h | 2 +- src/mathed/InsetMathArray.cpp | 4 +- src/mathed/InsetMathArray.h | 2 +- src/mathed/InsetMathBig.cpp | 4 +- src/mathed/InsetMathBig.h | 2 +- src/mathed/InsetMathBinom.cpp | 4 +- src/mathed/InsetMathBinom.h | 2 +- src/mathed/InsetMathBoldSymbol.cpp | 4 +- src/mathed/InsetMathBoldSymbol.h | 2 +- src/mathed/InsetMathBox.cpp | 4 +- src/mathed/InsetMathBox.h | 2 +- src/mathed/InsetMathBoxed.cpp | 4 +- src/mathed/InsetMathBoxed.h | 2 +- src/mathed/InsetMathBrace.cpp | 4 +- src/mathed/InsetMathBrace.h | 2 +- src/mathed/InsetMathCases.cpp | 4 +- src/mathed/InsetMathCases.h | 2 +- src/mathed/InsetMathChar.cpp | 4 +- src/mathed/InsetMathChar.h | 2 +- src/mathed/InsetMathColor.cpp | 4 +- src/mathed/InsetMathColor.h | 2 +- src/mathed/InsetMathComment.cpp | 4 +- src/mathed/InsetMathComment.h | 2 +- src/mathed/InsetMathDFrac.cpp | 4 +- src/mathed/InsetMathDFrac.h | 2 +- src/mathed/InsetMathDecoration.cpp | 4 +- src/mathed/InsetMathDecoration.h | 2 +- src/mathed/InsetMathDelim.cpp | 4 +- src/mathed/InsetMathDelim.h | 2 +- src/mathed/InsetMathDiff.cpp | 4 +- src/mathed/InsetMathDiff.h | 2 +- src/mathed/InsetMathDots.cpp | 4 +- src/mathed/InsetMathDots.h | 2 +- src/mathed/InsetMathEnv.cpp | 4 +- src/mathed/InsetMathEnv.h | 2 +- src/mathed/InsetMathExFunc.cpp | 4 +- src/mathed/InsetMathExFunc.h | 2 +- src/mathed/InsetMathExInt.cpp | 4 +- src/mathed/InsetMathExInt.h | 2 +- src/mathed/InsetMathFBox.cpp | 4 +- src/mathed/InsetMathFBox.h | 2 +- src/mathed/InsetMathFont.cpp | 4 +- src/mathed/InsetMathFont.h | 2 +- src/mathed/InsetMathFontOld.cpp | 4 +- src/mathed/InsetMathFontOld.h | 2 +- src/mathed/InsetMathFrac.cpp | 4 +- src/mathed/InsetMathFrac.h | 2 +- src/mathed/InsetMathFrameBox.cpp | 4 +- src/mathed/InsetMathFrameBox.h | 2 +- src/mathed/InsetMathGrid.cpp | 6 +- src/mathed/InsetMathGrid.h | 2 +- src/mathed/InsetMathHull.cpp | 10 +- src/mathed/InsetMathHull.h | 4 +- src/mathed/InsetMathKern.cpp | 4 +- src/mathed/InsetMathKern.h | 2 +- src/mathed/InsetMathLefteqn.cpp | 4 +- src/mathed/InsetMathLefteqn.h | 2 +- src/mathed/InsetMathLim.cpp | 4 +- src/mathed/InsetMathLim.h | 2 +- src/mathed/InsetMathMBox.cpp | 4 +- src/mathed/InsetMathMBox.h | 2 +- src/mathed/InsetMathMakebox.cpp | 4 +- src/mathed/InsetMathMakebox.h | 2 +- src/mathed/InsetMathMatrix.cpp | 4 +- src/mathed/InsetMathMatrix.h | 2 +- src/mathed/InsetMathNest.cpp | 6 +- src/mathed/InsetMathNest.h | 2 +- src/mathed/InsetMathNumber.cpp | 4 +- src/mathed/InsetMathNumber.h | 2 +- src/mathed/InsetMathOverset.cpp | 4 +- src/mathed/InsetMathOverset.h | 2 +- src/mathed/InsetMathPar.cpp | 4 +- src/mathed/InsetMathPar.h | 2 +- src/mathed/InsetMathPhantom.cpp | 4 +- src/mathed/InsetMathPhantom.h | 2 +- src/mathed/InsetMathRef.cpp | 4 +- src/mathed/InsetMathRef.h | 2 +- src/mathed/InsetMathRoot.cpp | 4 +- src/mathed/InsetMathRoot.h | 2 +- src/mathed/InsetMathScript.cpp | 6 +- src/mathed/InsetMathScript.h | 2 +- src/mathed/InsetMathSize.cpp | 4 +- src/mathed/InsetMathSize.h | 2 +- src/mathed/InsetMathSpace.cpp | 4 +- src/mathed/InsetMathSpace.h | 2 +- src/mathed/InsetMathSplit.cpp | 4 +- src/mathed/InsetMathSplit.h | 2 +- src/mathed/InsetMathSqrt.cpp | 4 +- src/mathed/InsetMathSqrt.h | 2 +- src/mathed/InsetMathStackrel.cpp | 4 +- src/mathed/InsetMathStackrel.h | 2 +- src/mathed/InsetMathString.cpp | 4 +- src/mathed/InsetMathString.h | 2 +- src/mathed/InsetMathSubstack.cpp | 4 +- src/mathed/InsetMathSubstack.h | 2 +- src/mathed/InsetMathSymbol.cpp | 4 +- src/mathed/InsetMathSymbol.h | 2 +- src/mathed/InsetMathTFrac.cpp | 4 +- src/mathed/InsetMathTFrac.h | 2 +- src/mathed/InsetMathTabular.cpp | 4 +- src/mathed/InsetMathTabular.h | 2 +- src/mathed/InsetMathUnderset.cpp | 4 +- src/mathed/InsetMathUnderset.h | 2 +- src/mathed/InsetMathUnknown.cpp | 4 +- src/mathed/InsetMathUnknown.h | 2 +- src/mathed/InsetMathXArrow.cpp | 4 +- src/mathed/InsetMathXArrow.h | 2 +- src/mathed/InsetMathXYArrow.cpp | 4 +- src/mathed/InsetMathXYArrow.h | 2 +- src/mathed/InsetMathXYMatrix.cpp | 4 +- src/mathed/InsetMathXYMatrix.h | 2 +- src/mathed/MacroTable.cpp | 2 +- src/mathed/MathAtom.cpp | 2 +- src/mathed/MathAtom.h | 4 +- src/mathed/MathMacro.cpp | 12 +- src/mathed/MathMacro.h | 4 +- src/mathed/MathMacroArgument.cpp | 4 +- src/mathed/MathMacroArgument.h | 4 +- src/mathed/MathMacroTemplate.cpp | 4 +- src/mathed/MathMacroTemplate.h | 4 +- src/output_latex.cpp | 2 +- src/output_plaintext.cpp | 4 +- src/paragraph_funcs.cpp | 4 +- src/paragraph_funcs.h | 2 +- src/rowpainter.cpp | 8 +- src/text.cpp | 22 +-- src/text2.cpp | 18 +- src/text3.cpp | 100 +++++------ 259 files changed, 1006 insertions(+), 1005 deletions(-) rename src/insets/{InsetBase.cpp => Inset.cpp} (54%) rename src/insets/{InsetBase.h => Inset.h} (94%) diff --git a/src/Bidi.cpp b/src/Bidi.cpp index 5a979eff55..4df26662cb 100644 --- a/src/Bidi.cpp +++ b/src/Bidi.cpp @@ -59,7 +59,7 @@ void Bidi::computeTables(Paragraph const & par, return; } - if (par.ownerCode() == InsetBase::ERT_CODE) { + if (par.ownerCode() == Inset::ERT_CODE) { start_ = -1; return; } diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 1ab2f17814..1ce02e81e5 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -242,7 +242,7 @@ LyXText & Buffer::text() const } -InsetBase & Buffer::inset() const +Inset & Buffer::inset() const { return const_cast(pimpl_->inset); } @@ -1254,15 +1254,15 @@ void Buffer::fillWithBibKeys(vector > & keys) } for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) { - if (it->lyxCode() == InsetBase::BIBTEX_CODE) { + if (it->lyxCode() == Inset::BIBTEX_CODE) { InsetBibtex const & inset = static_cast(*it); inset.fillWithBibKeys(*this, keys); - } else if (it->lyxCode() == InsetBase::INCLUDE_CODE) { + } else if (it->lyxCode() == Inset::INCLUDE_CODE) { InsetInclude const & inset = static_cast(*it); inset.fillWithBibKeys(*this, keys); - } else if (it->lyxCode() == InsetBase::BIBITEM_CODE) { + } else if (it->lyxCode() == Inset::BIBITEM_CODE) { InsetBibitem const & inset = static_cast(*it); // FIXME UNICODE @@ -1290,14 +1290,14 @@ void Buffer::updateBibfilesCache() bibfilesCache_.clear(); for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) { - if (it->lyxCode() == InsetBase::BIBTEX_CODE) { + if (it->lyxCode() == Inset::BIBTEX_CODE) { InsetBibtex const & inset = static_cast(*it); vector const bibfiles = inset.getFiles(*this); bibfilesCache_.insert(bibfilesCache_.end(), bibfiles.begin(), bibfiles.end()); - } else if (it->lyxCode() == InsetBase::INCLUDE_CODE) { + } else if (it->lyxCode() == Inset::INCLUDE_CODE) { InsetInclude & inset = static_cast(*it); inset.updateBibfilesCache(*this); @@ -1604,7 +1604,7 @@ void Buffer::buildMacros() InsetList::const_iterator end = insets.end(); for ( ; it != end; ++it) { //lyxerr << "found inset code " << it->inset->lyxCode() << std::endl; - if (it->inset->lyxCode() == InsetBase::MATHMACRO_CODE) { + if (it->inset->lyxCode() == Inset::MATHMACRO_CODE) { MathMacroTemplate const & mac = static_cast(*it->inset); insertMacro(mac.name(), mac.asMacroData()); @@ -1622,14 +1622,14 @@ void Buffer::saveCursor(StableDocIterator cur, StableDocIterator anc) void Buffer::changeRefsIfUnique(docstring const & from, docstring const & to, - InsetBase::Code code) + Inset::Code code) { //FIXME: This does not work for child documents yet. - BOOST_ASSERT(code == InsetBase::CITE_CODE || code == InsetBase::REF_CODE); + BOOST_ASSERT(code == Inset::CITE_CODE || code == Inset::REF_CODE); // Check if the label 'from' appears more than once vector labels; - if (code == InsetBase::CITE_CODE) { + if (code == Inset::CITE_CODE) { vector > keys; fillWithBibKeys(keys); vector >::const_iterator bit = keys.begin(); diff --git a/src/Buffer.h b/src/Buffer.h index 90c700aa37..21794d4788 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -38,7 +38,7 @@ namespace lyx { class BufferParams; class ErrorItem; class FuncRequest; -class InsetBase; +class Inset; class InsetText; class LyXFont; class Lexer; @@ -352,7 +352,7 @@ public: LyXText & text() const; /// Our top InsetText! - InsetBase & inset() const; + Inset & inset() const; // // Macro handling @@ -374,7 +374,7 @@ public: StableDocIterator getAnchor() const { return anchor_; } /// void changeRefsIfUnique(docstring const & from, docstring const & to, - InsetBase::Code code); + Inset::Code code); /// get source code (latex/docbook) for some paragraphs, or all paragraphs /// including preamble void getSourceCode(odocstream & os, pit_type par_begin, pit_type par_end, bool full_source); diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 62b91fae76..5770e6926d 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -107,7 +107,7 @@ namespace { /// Return an inset of this class if it exists at the current cursor position template -T * getInsetByCode(Cursor & cur, InsetBase::Code code) +T * getInsetByCode(Cursor & cur, Inset::Code code) { T * inset = 0; DocIterator it = cur; @@ -588,7 +588,7 @@ boost::tuple BufferView::moveToPosition(pit_type bottom // crash lyx when the cursor can not be set to these insets. size_t const n = dit.depth(); for (size_t i = 0; i < n; ++i) - if (dit[i].inset().editable() != InsetBase::HIGHLY_EDITABLE) { + if (dit[i].inset().editable() != Inset::HIGHLY_EDITABLE) { dit.resize(i); break; } @@ -696,7 +696,7 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd) case LFUN_LABEL_GOTO: { flag.enabled(!cmd.argument().empty() - || getInsetByCode(cursor_, InsetBase::REF_CODE)); + || getInsetByCode(cursor_, Inset::REF_CODE)); break; } @@ -806,7 +806,7 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd) if (label.empty()) { InsetRef * inset = getInsetByCode(cursor_, - InsetBase::REF_CODE); + Inset::REF_CODE); if (inset) { label = inset->getParam("reference"); // persistent=false: use temp_bookmark @@ -872,13 +872,13 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd) break; case LFUN_NOTE_NEXT: - bv_funcs::gotoInset(this, InsetBase::NOTE_CODE, false); + bv_funcs::gotoInset(this, Inset::NOTE_CODE, false); break; case LFUN_REFERENCE_NEXT: { - vector tmp; - tmp.push_back(InsetBase::LABEL_CODE); - tmp.push_back(InsetBase::REF_CODE); + vector tmp; + tmp.push_back(Inset::LABEL_CODE); + tmp.push_back(Inset::REF_CODE); bv_funcs::gotoInset(this, tmp, true); break; } @@ -958,9 +958,9 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd) case LFUN_BIBTEX_DATABASE_ADD: { Cursor tmpcur = cursor_; - bv_funcs::findInset(tmpcur, InsetBase::BIBTEX_CODE, false); + bv_funcs::findInset(tmpcur, Inset::BIBTEX_CODE, false); InsetBibtex * inset = getInsetByCode(tmpcur, - InsetBase::BIBTEX_CODE); + Inset::BIBTEX_CODE); if (inset) { if (inset->addDatabase(to_utf8(cmd.argument()))) buffer_->updateBibfilesCache(); @@ -970,9 +970,9 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd) case LFUN_BIBTEX_DATABASE_DEL: { Cursor tmpcur = cursor_; - bv_funcs::findInset(tmpcur, InsetBase::BIBTEX_CODE, false); + bv_funcs::findInset(tmpcur, Inset::BIBTEX_CODE, false); InsetBibtex * inset = getInsetByCode(tmpcur, - InsetBase::BIBTEX_CODE); + Inset::BIBTEX_CODE); if (inset) { if (inset->delDatabase(to_utf8(cmd.argument()))) buffer_->updateBibfilesCache(); @@ -1020,7 +1020,7 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd) FuncRequest tmpcmd = FuncRequest(LFUN_INSET_TOGGLE, cmd.origin); // if there is an inset at cursor, see whether it // wants to toggle. - InsetBase * inset = cur.nextInset(); + Inset * inset = cur.nextInset(); if (inset && inset->isActive()) { Cursor tmpcur = cur; tmpcur.pushLeft(*inset); @@ -1102,7 +1102,7 @@ void BufferView::workAreaResize(int width, int height) } -InsetBase const * BufferView::getCoveringInset(LyXText const & text, int x, int y) +Inset const * BufferView::getCoveringInset(LyXText const & text, int x, int y) { pit_type pit = text.getPitNearY(*this, y); BOOST_ASSERT(pit != -1); @@ -1117,7 +1117,7 @@ InsetBase const * BufferView::getCoveringInset(LyXText const & text, int x, int InsetList::const_iterator iit = par.insetlist.begin(); InsetList::const_iterator iend = par.insetlist.end(); for (; iit != iend; ++iit) { - InsetBase * const inset = iit->inset; + Inset * const inset = iit->inset; if (inset->covers(*this, x, y)) { if (!inset->descendable()) // No need to go further down if the inset is not @@ -1130,7 +1130,7 @@ InsetBase const * BufferView::getCoveringInset(LyXText const & text, int x, int LyXText const * inner_text = inset->getText(i); if (inner_text) { // Try deeper. - InsetBase const * inset_deeper = + Inset const * inset_deeper = getCoveringInset(*inner_text, x, y); if (inset_deeper) return inset_deeper; @@ -1175,7 +1175,7 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0) if (cmd.action == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none) { // Get inset under mouse, if there is one. - InsetBase const * covering_inset = + Inset const * covering_inset = getCoveringInset(buffer_->text(), cmd.x, cmd.y); if (covering_inset == last_inset_) // Same inset, no need to do anything... @@ -1183,7 +1183,7 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0) bool need_redraw = false; // const_cast because of setMouseHover(). - InsetBase * inset = const_cast(covering_inset); + Inset * inset = const_cast(covering_inset); if (last_inset_) // Remove the hint on the last hovered inset (if any). need_redraw |= last_inset_->setMouseHover(false); @@ -1226,7 +1226,7 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0) } // Build temporary cursor. - InsetBase * inset = buffer_->text().editXY(cur, cmd.x, cmd.y); + Inset * inset = buffer_->text().editXY(cur, cmd.x, cmd.y); // Put anchor at the same position. cur.resetAnchor(); diff --git a/src/BufferView.h b/src/BufferView.h index 3929c68892..6ba483adf5 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -238,7 +238,7 @@ public: /// This signal is emitted when some inset dialogs needs to be shown. boost::signal showInsetDialog; + Inset * inset)> showInsetDialog; /// This signal is emitted when some dialogs needs to be updated. boost::signal const intl_; /// last visited inset (kept to send setMouseHover(false) ) - InsetBase * last_inset_; + Inset * last_inset_; /// A map from a LyXText to the associated text metrics typedef std::map TextMetricsCache; diff --git a/src/CoordCache.cpp b/src/CoordCache.cpp index b540679544..7fb00c8055 100644 --- a/src/CoordCache.cpp +++ b/src/CoordCache.cpp @@ -14,7 +14,7 @@ #include "LyXText.h" -#include "insets/InsetBase.h" +#include "insets/Inset.h" #include @@ -62,27 +62,28 @@ Point CoordCache::get(LyXText const * text, pit_type pit) const void CoordCache::dump() const { lyxerr << "ParPosCache contains:" << std::endl; - for (ParPosCache::const_iterator i = getParPos().begin(); i != getParPos().end(); ++i) { - LyXText const * lt = (*i).first; - InnerParPosCache const & cache = (*i).second; + for (ParPosCache::const_iterator it = getParPos().begin(); it != getParPos().end(); ++it) { + LyXText const * lt = it->first; + InnerParPosCache const & cache = it->second; lyxerr << "LyXText:" << lt << std::endl; - for (InnerParPosCache::const_iterator j = cache.begin(); j != cache.end(); ++j) { - pit_type pit = (*j).first; + for (InnerParPosCache::const_iterator jt = cache.begin(); jt != cache.end(); ++jt) { + pit_type pit = jt->first; Paragraph const & par = lt->getPar(pit); - Point p = (*j).second; + Point p = jt->second; lyxerr << "Paragraph " << pit << ": \""; - for (int k = 0; k < std::min(static_cast(10), par.size()); ++k) { - lyxerr << to_utf8(docstring(1,par.getChar(k))); - } + int const n = std::min(static_cast(10), par.size()); + for (int k = 0; k < n; ++k) + lyxerr << to_utf8(docstring(1, par.getChar(k))); lyxerr << "\" has point " << p.x_ << "," << p.y_ << std::endl; } } lyxerr << "InsetCache contains:" << std::endl; - for (CoordCacheBase::cache_type::const_iterator i = getInsets().getData().begin(); i != getInsets().getData().end(); ++i) { - InsetBase const * inset = (*i).first; - Point p = (*i).second; - lyxerr << "Inset " << inset << "(" << to_utf8(inset->getInsetName()) << ") has point " << p.x_ << "," << p.y_ << std::endl; + for (CoordCacheBase::cache_type::const_iterator it = getInsets().getData().begin(); it != getInsets().getData().end(); ++it) { + Inset const * inset = it->first; + Point const p = it->second; + lyxerr << "Inset " << inset << "(" << to_utf8(inset->insetName()) + << ") has point " << p.x_ << "," << p.y_ << std::endl; } } diff --git a/src/CoordCache.h b/src/CoordCache.h index 830a2a5634..28e75462b7 100644 --- a/src/CoordCache.h +++ b/src/CoordCache.h @@ -20,7 +20,7 @@ namespace lyx { -class InsetBase; +class Inset; class LyXText; class MathData; class Paragraph; @@ -126,8 +126,8 @@ public: CoordCacheBase & arrays() { return arrays_; } CoordCacheBase const & getArrays() const { return arrays_; } /// A map from insets to positions on the screen - CoordCacheBase & insets() { return insets_; } - CoordCacheBase const & getInsets() const { return insets_; } + CoordCacheBase & insets() { return insets_; } + CoordCacheBase const & getInsets() const { return insets_; } /// A map from (LyXText, paragraph) pair to screen positions ParPosCache & parPos() { return pars_; } ParPosCache const & getParPos() const { return pars_; } @@ -147,7 +147,7 @@ private: /// MathDatas CoordCacheBase arrays_; // All insets - CoordCacheBase insets_; + CoordCacheBase insets_; /// Paragraph grouped by owning text ParPosCache pars_; /// Used with boundary == 0 diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 5c4b3ab7da..c49673cf4c 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -93,10 +93,10 @@ namespace { for (size_t i = 0;; ++i) { int xo; int yo; - InsetBase const * inset = &it.inset(); - std::map const & data = + Inset const * inset = &it.inset(); + std::map const & data = c.bv().coordCache().getInsets().getData(); - std::map::const_iterator I = data.find(inset); + std::map::const_iterator I = data.find(inset); // FIXME: in the case where the inset is not in the cache, this // means that no part of it is visible on screen. In this case @@ -134,7 +134,7 @@ namespace { int x, int y, int xlow, int xhigh, int ylow, int yhigh) { BOOST_ASSERT(!cursor.empty()); - InsetBase & inset = cursor[0].inset(); + Inset & inset = cursor[0].inset(); BufferView & bv = cursor.bv(); CoordCache::InnerParPosCache const & cache = @@ -203,7 +203,7 @@ namespace { // << " xlow: " << xlow << " xhigh: " << xhigh // << " ylow: " << ylow << " yhigh: " << yhigh // << endl; - InsetBase & inset = bv.buffer()->inset(); + Inset & inset = bv.buffer()->inset(); DocIterator it = doc_iterator_begin(inset); it.pit() = from; DocIterator et = doc_iterator_end(inset); @@ -256,7 +256,7 @@ Cursor::Cursor(BufferView & bv) {} -void Cursor::reset(InsetBase & inset) +void Cursor::reset(Inset & inset) { clear(); push_back(CursorSlice(inset)); @@ -341,13 +341,13 @@ void Cursor::pop() } -void Cursor::push(InsetBase & p) +void Cursor::push(Inset & p) { push_back(CursorSlice(p)); } -void Cursor::pushLeft(InsetBase & p) +void Cursor::pushLeft(Inset & p) { BOOST_ASSERT(!empty()); //lyxerr << "Entering inset " << t << " left" << endl; @@ -387,10 +387,10 @@ int Cursor::currentMode() BOOST_ASSERT(!empty()); for (int i = depth() - 1; i >= 0; --i) { int res = operator[](i).inset().currentMode(); - if (res != InsetBase::UNDECIDED_MODE) + if (res != Inset::UNDECIDED_MODE) return res; } - return InsetBase::TEXT_MODE; + return Inset::TEXT_MODE; } @@ -541,7 +541,7 @@ void Cursor::info(odocstream & os) const os << " "; } if (pos() != 0) { - InsetBase const * inset = prevInset(); + Inset const * inset = prevInset(); // prevInset() can return 0 in certain case. if (inset) prevInset()->infoize2(os); @@ -608,7 +608,7 @@ namespace lyx { //#define FILEDEBUG 1 -bool Cursor::isInside(InsetBase const * p) +bool Cursor::isInside(Inset const * p) { for (size_t i = 0; i != depth(); ++i) if (&operator[](i).inset() == p) @@ -617,7 +617,7 @@ bool Cursor::isInside(InsetBase const * p) } -void Cursor::leaveInset(InsetBase const & inset) +void Cursor::leaveInset(Inset const & inset) { for (size_t i = 0; i != depth(); ++i) { if (&operator[](i).inset() == &inset) { @@ -712,7 +712,7 @@ void Cursor::insert(MathAtom const & t) } -void Cursor::insert(InsetBase * inset) +void Cursor::insert(Inset * inset) { if (inMathed()) insert(MathAtom(inset)); diff --git a/src/Cursor.h b/src/Cursor.h index 13ca0e7cdd..2d0e4386f5 100644 --- a/src/Cursor.h +++ b/src/Cursor.h @@ -47,9 +47,9 @@ public: /// get the resut of the last dispatch DispatchResult result() const; /// add a new cursor slice - void push(InsetBase & inset); + void push(Inset & inset); /// add a new cursor slice, place cursor on left end - void pushLeft(InsetBase & inset); + void pushLeft(Inset & inset); /// pop one level off the cursor void pop(); /// pop one slice off the cursor stack and go left @@ -57,7 +57,7 @@ public: /// pop one slice off the cursor stack and go right bool popRight(); /// make sure we are outside of given inset - void leaveInset(InsetBase const & inset); + void leaveInset(Inset const & inset); /// sets cursor part void setCursor(DocIterator const & it); @@ -115,7 +115,7 @@ public: bool posRight(); /// insert an inset - void insert(InsetBase *); + void insert(Inset *); /// insert a single char void insert(char_type c); /// insert a string @@ -146,7 +146,7 @@ public: int currentMode(); /// reset cursor bottom to the beginning of the given inset // (sort of 'chroot' environment...) - void reset(InsetBase &); + void reset(Inset &); /// for spellchecking void replaceWord(std::string const & replacestring); /** @@ -272,7 +272,7 @@ public: // selection in given cell of atom void handleNest(MathAtom const & at, int cell = 0); /// - bool isInside(InsetBase const *); + bool isInside(Inset const *); /// make sure cursor position is valid void normalize(); diff --git a/src/CursorSlice.cpp b/src/CursorSlice.cpp index 09a9ca86e3..78e91be5fd 100644 --- a/src/CursorSlice.cpp +++ b/src/CursorSlice.cpp @@ -34,7 +34,7 @@ CursorSlice::CursorSlice() {} -CursorSlice::CursorSlice(InsetBase & p) +CursorSlice::CursorSlice(Inset & p) : inset_(&p), idx_(0), pit_(0), pos_(0) { BOOST_ASSERT(inset_); diff --git a/src/CursorSlice.h b/src/CursorSlice.h index a3d4d4c8dd..cf32cc611d 100644 --- a/src/CursorSlice.h +++ b/src/CursorSlice.h @@ -17,8 +17,8 @@ #ifndef CURSORSLICE_H #define CURSORSLICE_H -#include "insets/InsetBase.h" #include "support/types.h" +#include "insets/Inset.h" #include #include @@ -26,7 +26,7 @@ namespace lyx { -class InsetBase; +class Inset; class MathData; class LyXText; class Paragraph; @@ -50,10 +50,10 @@ public: /// CursorSlice(); /// - explicit CursorSlice(InsetBase &); + explicit CursorSlice(Inset &); /// the current inset - InsetBase & inset() const { return *inset_; } + Inset & inset() const { return *inset_; } /// return the cell this cursor is in idx_type idx() const { return idx_; } /// return the cell this cursor is in @@ -115,7 +115,7 @@ public: friend std::ostream & operator<<(std::ostream &, CursorSlice const &); public: /// pointer to 'owning' inset. This is some kind of cache. - InsetBase * inset_; + Inset * inset_; private: /*! * Cell index of a position in this inset. diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 6eb7e64f1e..5c04ed88a4 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -83,10 +83,10 @@ bool dirty_tabular_stack_ = false; void region(CursorSlice const & i1, CursorSlice const & i2, - InsetBase::row_type & r1, InsetBase::row_type & r2, - InsetBase::col_type & c1, InsetBase::col_type & c2) + Inset::row_type & r1, Inset::row_type & r2, + Inset::col_type & c1, Inset::col_type & c2) { - InsetBase & p = i1.inset(); + Inset & p = i1.inset(); c1 = p.col(i1.idx()); c2 = p.col(i2.idx()); if (c1 > c2) @@ -128,7 +128,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist, // Convert newline to paragraph break in ERT inset. // This should not be here! if (pars[pit].inInset() && - pars[pit].inInset()->lyxCode() == InsetBase::ERT_CODE) { + pars[pit].inInset()->lyxCode() == Inset::ERT_CODE) { for (ParagraphList::size_type i = 0; i < insertion.size(); ++i) { for (pos_type j = 0; j < insertion[i].size(); ++j) { if (insertion[i].isNewline(j)) { @@ -220,7 +220,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist, for (; lit != eit; ++lit) { switch (lit->inset->lyxCode()) { - case InsetBase::TABULAR_CODE: { + case Inset::TABULAR_CODE: { InsetTabular * it = static_cast(lit->inset); it->buffer(&buffer); break; @@ -374,7 +374,7 @@ void copySelectionHelper(Buffer const & buf, ParagraphList & pars, // ERT paragraphs have the Language latex_language. // This is invalid outside of ERT, so we need to change it // to the buffer language. - if (it->ownerCode() == InsetBase::ERT_CODE) { + if (it->ownerCode() == Inset::ERT_CODE) { it->changeLanguage(buf.params(), latex_language, buf.getLanguage()); } @@ -446,7 +446,7 @@ void switchBetweenClasses(textclass_type c1, textclass_type c2, // character styles InsetIterator const i_end = inset_iterator_end(in); for (InsetIterator it = inset_iterator_begin(in); it != i_end; ++it) { - if (it->lyxCode() == InsetBase::CHARSTYLE_CODE) { + if (it->lyxCode() == Inset::CHARSTYLE_CODE) { InsetCharStyle & inset = static_cast(*it); string const name = inset.params().type; @@ -835,11 +835,11 @@ void eraseSelection(Cursor & cur) cur.pos() = cur.lastpos(); } else { InsetMath * p = i1.asInsetMath(); - InsetBase::row_type r1, r2; - InsetBase::col_type c1, c2; + Inset::row_type r1, r2; + Inset::col_type c1, c2; region(i1, i2, r1, r2, c1, c2); - for (InsetBase::row_type row = r1; row <= r2; ++row) - for (InsetBase::col_type col = c1; col <= c2; ++col) + for (Inset::row_type row = r1; row <= r2; ++row) + for (Inset::col_type col = c1; col <= c2; ++col) p->cell(p->index(row, col)).clear(); // We've deleted the whole cell. Only pos 0 is valid. cur.pos() = 0; @@ -898,16 +898,16 @@ docstring grabSelection(Cursor const & cur) } } - InsetBase::row_type r1, r2; - InsetBase::col_type c1, c2; + Inset::row_type r1, r2; + Inset::col_type c1, c2; region(i1, i2, r1, r2, c1, c2); docstring data; if (i1.inset().asInsetMath()) { - for (InsetBase::row_type row = r1; row <= r2; ++row) { + for (Inset::row_type row = r1; row <= r2; ++row) { if (row > r1) data += "\\\\"; - for (InsetBase::col_type col = c1; col <= c2; ++col) { + for (Inset::col_type col = c1; col <= c2; ++col) { if (col > c1) data += '&'; data += asString(i1.asInsetMath()-> diff --git a/src/DocIterator.cpp b/src/DocIterator.cpp index 6c71e0e5a9..af3ed12d15 100644 --- a/src/DocIterator.cpp +++ b/src/DocIterator.cpp @@ -38,12 +38,12 @@ DocIterator::DocIterator() {} -DocIterator::DocIterator(InsetBase & inset) +DocIterator::DocIterator(Inset & inset) : boundary_(false), inset_(&inset) {} -DocIterator doc_iterator_begin(InsetBase & inset) +DocIterator doc_iterator_begin(Inset & inset) { DocIterator dit(inset); dit.forwardPos(); @@ -51,13 +51,13 @@ DocIterator doc_iterator_begin(InsetBase & inset) } -DocIterator doc_iterator_end(InsetBase & inset) +DocIterator doc_iterator_end(Inset & inset) { return DocIterator(inset); } -InsetBase * DocIterator::nextInset() +Inset * DocIterator::nextInset() { BOOST_ASSERT(!empty()); if (pos() == lastpos()) @@ -72,7 +72,7 @@ InsetBase * DocIterator::nextInset() } -InsetBase * DocIterator::prevInset() +Inset * DocIterator::prevInset() { BOOST_ASSERT(!empty()); if (pos() == 0) @@ -89,7 +89,7 @@ InsetBase * DocIterator::prevInset() } -InsetBase const * DocIterator::prevInset() const +Inset const * DocIterator::prevInset() const { BOOST_ASSERT(!empty()); if (pos() == 0) @@ -106,11 +106,11 @@ InsetBase const * DocIterator::prevInset() const } -InsetBase * DocIterator::realInset() const +Inset * DocIterator::realInset() const { BOOST_ASSERT(inTexted()); // if we are in a tabular, we need the cell - if (inset().lyxCode() == InsetBase::TABULAR_CODE) { + if (inset().lyxCode() == Inset::TABULAR_CODE) { InsetTabular & tabular = static_cast(inset()); return tabular.cell(idx()).get(); } @@ -269,7 +269,7 @@ LyXText const * DocIterator::innerText() const } -InsetBase * DocIterator::innerInsetOfType(int code) const +Inset * DocIterator::innerInsetOfType(int code) const { for (int i = depth() - 1; i >= 0; --i) if (slices_[i].inset_->lyxCode() == code) @@ -286,12 +286,12 @@ void DocIterator::forwardPos(bool ignorecollapsed) return; } - InsetBase * const nextinset = nextInset(); + Inset * const nextinset = nextInset(); // jump over collapsables if they are collapsed // FIXME: the check for asInsetMath() shouldn't be necessary // but math insets do not return a sensible editable() state yet. if (ignorecollapsed && nextinset && (!nextinset->asInsetMath() - && nextinset->editable() != InsetBase::HIGHLY_EDITABLE)) { + && nextinset->editable() != Inset::HIGHLY_EDITABLE)) { ++top().pos(); return; } @@ -303,7 +303,7 @@ void DocIterator::forwardPos(bool ignorecollapsed) pos_type const lastp = lastpos(); // move into an inset to the right if possible - InsetBase * n = 0; + Inset * n = 0; if (tip.pos() != lastp) { // this is impossible for pos() == size() @@ -481,7 +481,7 @@ void DocIterator::backwardPos() } // move into an inset to the left if possible - InsetBase * n = 0; + Inset * n = 0; if (inMathed()) { n = (tip.cell().begin() + tip.pos())->nucleus(); @@ -510,7 +510,7 @@ bool DocIterator::hasPart(DocIterator const & it) const } -void DocIterator::updateInsets(InsetBase * inset) +void DocIterator::updateInsets(Inset * inset) { // this function re-creates the cache of inset pointers. // code taken in part from StableDocIterator::asDocIterator. @@ -548,7 +548,7 @@ StableDocIterator::StableDocIterator(DocIterator const & dit) } -DocIterator StableDocIterator::asDocIterator(InsetBase * inset) const +DocIterator StableDocIterator::asDocIterator(Inset * inset) const { // this function re-creates the cache of inset pointers //lyxerr << "converting:\n" << *this << endl; diff --git a/src/DocIterator.h b/src/DocIterator.h index fd4050cec8..117e92383f 100644 --- a/src/DocIterator.h +++ b/src/DocIterator.h @@ -49,7 +49,7 @@ public: /// DocIterator(); /// - explicit DocIterator(InsetBase & inset); + explicit DocIterator(Inset & inset); /// access slice at position \p i CursorSlice const & operator[](size_t i) const { return slices_[i]; } @@ -80,7 +80,7 @@ public: /// how many nested insets do we have? size_t depth() const { return slices_.size(); } /// the containing inset - InsetBase & inset() const { return top().inset(); } + Inset & inset() const { return top().inset(); } /// return the cell of the inset this cursor is in idx_type idx() const { return top().idx(); } /// return the cell of the inset this cursor is in @@ -115,11 +115,11 @@ public: /// return the last column of the top grid col_type lastcol() const { return ncols() - 1; } /// the inset just behind the cursor - InsetBase * nextInset(); + Inset * nextInset(); /// the inset just in front of the cursor - InsetBase * prevInset(); + Inset * prevInset(); /// the inset just in front of the cursor - InsetBase const * prevInset() const; + Inset const * prevInset() const; /// bool boundary() const { return boundary_; } /// @@ -162,9 +162,9 @@ public: /// LyXText const * text() const; /// the containing inset or the cell, respectively - InsetBase * realInset() const; + Inset * realInset() const; /// - InsetBase * innerInsetOfType(int code) const; + Inset * innerInsetOfType(int code) const; /// LyXText * innerText(); /// @@ -218,7 +218,7 @@ public: /// void pop_back() { slices_.pop_back(); } /// recompute the inset parts of the cursor from the document data - void updateInsets(InsetBase * inset); + void updateInsets(Inset * inset); private: /** @@ -244,12 +244,12 @@ private: /// std::vector slices_; /// - InsetBase * inset_; + Inset * inset_; }; -DocIterator doc_iterator_begin(InsetBase & inset); -DocIterator doc_iterator_end(InsetBase & inset); +DocIterator doc_iterator_begin(Inset & inset); +DocIterator doc_iterator_end(Inset & inset); inline @@ -277,7 +277,7 @@ public: /// non-explicit intended StableDocIterator(const DocIterator & it); /// - DocIterator asDocIterator(InsetBase * start) const; + DocIterator asDocIterator(Inset * start) const; /// size_t size() const { return data_.size(); } /// return the position within the paragraph diff --git a/src/InsetIterator.cpp b/src/InsetIterator.cpp index 4277d4fae7..c36b7e63d3 100644 --- a/src/InsetIterator.cpp +++ b/src/InsetIterator.cpp @@ -19,13 +19,13 @@ namespace lyx { -InsetIterator::InsetIterator(InsetBase & inset) +InsetIterator::InsetIterator(Inset & inset) : DocIterator(inset) { } -InsetIterator inset_iterator_begin(InsetBase & inset) +InsetIterator inset_iterator_begin(Inset & inset) { InsetIterator it = InsetIterator(inset); it.forwardInset(); @@ -33,7 +33,7 @@ InsetIterator inset_iterator_begin(InsetBase & inset) } -InsetIterator inset_iterator_end(InsetBase & inset) +InsetIterator inset_iterator_end(Inset & inset) { return InsetIterator(inset); } diff --git a/src/InsetIterator.h b/src/InsetIterator.h index 9f0bbd82cb..75bb08e9d3 100644 --- a/src/InsetIterator.h +++ b/src/InsetIterator.h @@ -22,20 +22,20 @@ class InsetIterator : public DocIterator { public: /// - explicit InsetIterator(InsetBase & inset); + explicit InsetIterator(Inset & inset); /// void operator++() { forwardInset(); } /// void operator--(); /// - InsetBase * operator->() { return nextInset(); } + Inset * operator->() { return nextInset(); } /// - InsetBase & operator*() { return *nextInset(); } + Inset & operator*() { return *nextInset(); } }; -InsetIterator inset_iterator_begin(InsetBase & inset); +InsetIterator inset_iterator_begin(Inset & inset); -InsetIterator inset_iterator_end(InsetBase & inset); +InsetIterator inset_iterator_end(Inset & inset); diff --git a/src/InsetList.cpp b/src/InsetList.cpp index 27e59280f3..61d418410c 100644 --- a/src/InsetList.cpp +++ b/src/InsetList.cpp @@ -71,7 +71,7 @@ InsetList::const_iterator InsetList::insetIterator(pos_type pos) const } -void InsetList::insert(InsetBase * inset, pos_type pos) +void InsetList::insert(Inset * inset, pos_type pos) { List::iterator end = list_.end(); List::iterator it = insetIterator(pos); @@ -95,12 +95,12 @@ void InsetList::erase(pos_type pos) } -InsetBase * InsetList::release(pos_type pos) +Inset * InsetList::release(pos_type pos) { List::iterator end = list_.end(); List::iterator it = insetIterator(pos); if (it != end && it->pos == pos) { - InsetBase * tmp = it->inset; + Inset * tmp = it->inset; it->inset = 0; return tmp; } @@ -108,7 +108,7 @@ InsetBase * InsetList::release(pos_type pos) } -InsetBase * InsetList::get(pos_type pos) const +Inset * InsetList::get(pos_type pos) const { List::const_iterator end = list_.end(); List::const_iterator it = insetIterator(pos); diff --git a/src/InsetList.h b/src/InsetList.h index 3e287ad1c7..13beeb0b9c 100644 --- a/src/InsetList.h +++ b/src/InsetList.h @@ -19,7 +19,7 @@ namespace lyx { -class InsetBase; +class Inset; class Buffer; @@ -30,11 +30,11 @@ public: class InsetTable { public: /// - InsetTable(pos_type p, InsetBase * i) : pos(p), inset(i) {} + InsetTable(pos_type p, Inset * i) : pos(p), inset(i) {} /// pos_type pos; /// - InsetBase * inset; + Inset * inset; }; /// typedef std::vector List; @@ -60,13 +60,13 @@ public: /// const_iterator insetIterator(pos_type pos) const; /// - void insert(InsetBase * inset, pos_type pos); + void insert(Inset * inset, pos_type pos); /// void erase(pos_type pos); /// - InsetBase * release(pos_type); + Inset * release(pos_type); /// - InsetBase * get(pos_type pos) const; + Inset * get(pos_type pos) const; /// void increasePosAfterPos(pos_type pos); /// diff --git a/src/LyX.cpp b/src/LyX.cpp index 77d5b179e1..6e6d64502f 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -360,7 +360,7 @@ void LyX::setGuiLanguage(std::string const & language) } -Buffer const * const LyX::updateInset(InsetBase const * inset) const +Buffer const * const LyX::updateInset(Inset const * inset) const { if (!inset) return 0; diff --git a/src/LyX.h b/src/LyX.h index f2e27a3498..8dc2661e5a 100644 --- a/src/LyX.h +++ b/src/LyX.h @@ -25,7 +25,7 @@ class Buffer; class BufferList; class Converters; class ErrorItem; -class InsetBase; +class Inset; class LyXFunc; class LyXServer; class LyXServerSocket; @@ -97,7 +97,7 @@ public: /** redraw \c inset in all the BufferViews in which it is currently * visible. If successful return a pointer to the owning Buffer. */ - Buffer const * const updateInset(InsetBase const *) const; + Buffer const * const updateInset(Inset const *) const; /// Execute batch commands if available. void execBatchCommands(); diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index f13a2970dc..a4aeb0f531 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -467,7 +467,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const break; case LFUN_LAYOUT_TABULAR: - enable = cur.innerInsetOfType(InsetBase::TABULAR_CODE); + enable = cur.innerInsetOfType(Inset::TABULAR_CODE); break; case LFUN_LAYOUT: @@ -496,27 +496,27 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const enable = false; if (!cur) break; - InsetBase::Code code = cur.inset().lyxCode(); + Inset::Code code = cur.inset().lyxCode(); switch (code) { - case InsetBase::TABULAR_CODE: + case Inset::TABULAR_CODE: enable = cmd.argument() == "tabular"; break; - case InsetBase::ERT_CODE: + case Inset::ERT_CODE: enable = cmd.argument() == "ert"; break; - case InsetBase::FLOAT_CODE: + case Inset::FLOAT_CODE: enable = cmd.argument() == "float"; break; - case InsetBase::WRAP_CODE: + case Inset::WRAP_CODE: enable = cmd.argument() == "wrap"; break; - case InsetBase::NOTE_CODE: + case Inset::NOTE_CODE: enable = cmd.argument() == "note"; break; - case InsetBase::BRANCH_CODE: + case Inset::BRANCH_CODE: enable = cmd.argument() == "branch"; break; - case InsetBase::BOX_CODE: + case Inset::BOX_CODE: enable = cmd.argument() == "box"; break; default: @@ -527,7 +527,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const case LFUN_INSET_APPLY: { string const name = cmd.getArg(0); - InsetBase * inset = lyx_view_->getDialogs().getOpenInset(name); + Inset * inset = lyx_view_->getDialogs().getOpenInset(name); if (inset) { FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument()); FuncStatus fs; @@ -555,7 +555,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const enable = Exporter::isExportable(*buf, "dvi") && lyxrc.print_command != "none"; else if (name == "character") - enable = cur.inset().lyxCode() != InsetBase::ERT_CODE; + enable = cur.inset().lyxCode() != Inset::ERT_CODE; else if (name == "latexlog") enable = isFileReadable(FileName(buf->getLogName().second)); else if (name == "spellchecker") @@ -570,8 +570,8 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const } case LFUN_DIALOG_SHOW_NEW_INSET: - enable = cur.inset().lyxCode() != InsetBase::ERT_CODE; - if (cur.inset().lyxCode() == InsetBase::CAPTION_CODE) { + enable = cur.inset().lyxCode() != Inset::ERT_CODE; + if (cur.inset().lyxCode() == Inset::CAPTION_CODE) { FuncStatus flag; if (cur.inset().getStatus(cur, cmd, flag)) return flag; @@ -1345,7 +1345,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) BOOST_ASSERT(lyx_view_); string const & name = argument; // Can only update a dialog connected to an existing inset - InsetBase * inset = lyx_view_->getDialogs().getOpenInset(name); + Inset * inset = lyx_view_->getDialogs().getOpenInset(name); if (inset) { FuncRequest fr(LFUN_INSET_DIALOG_UPDATE, cmd.argument()); inset->dispatch(view()->cursor(), fr); @@ -1535,7 +1535,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) case LFUN_INSET_APPLY: { BOOST_ASSERT(lyx_view_); string const name = cmd.getArg(0); - InsetBase * inset = lyx_view_->getDialogs().getOpenInset(name); + Inset * inset = lyx_view_->getDialogs().getOpenInset(name); if (inset) { FuncRequest fr(LFUN_INSET_MODIFY, argument); inset->dispatch(view()->cursor(), fr); @@ -1553,18 +1553,18 @@ void LyXFunc::dispatch(FuncRequest const & cmd) BOOST_ASSERT(lyx_view_); string action; string const name = split(argument, action, ' '); - InsetBase::Code const inset_code = - InsetBase::translate(name); + Inset::Code const inset_code = + Inset::translate(name); Cursor & cur = view()->cursor(); FuncRequest fr(LFUN_INSET_TOGGLE, action); - InsetBase & inset = lyx_view_->buffer()->inset(); + Inset & inset = lyx_view_->buffer()->inset(); InsetIterator it = inset_iterator_begin(inset); InsetIterator const end = inset_iterator_end(inset); for (; it != end; ++it) { if (!it->asInsetMath() - && (inset_code == InsetBase::NO_CODE + && (inset_code == Inset::NO_CODE || inset_code == it->lyxCode())) { Cursor tmpcur = cur; tmpcur.pushLeft(*it); @@ -1638,11 +1638,11 @@ void LyXFunc::dispatch(FuncRequest const & cmd) Cursor & cur = view()->cursor(); FuncRequest fr(LFUN_INSET_REFRESH); - InsetBase & inset = lyx_view_->buffer()->inset(); + Inset & inset = lyx_view_->buffer()->inset(); InsetIterator it = inset_iterator_begin(inset); InsetIterator const end = inset_iterator_end(inset); for (; it != end; ++it) - if (it->lyxCode() == InsetBase::CITE_CODE) + if (it->lyxCode() == Inset::CITE_CODE) it->dispatch(cur, fr); break; } diff --git a/src/LyXText.h b/src/LyXText.h index aeb8ed6a92..14da93146d 100644 --- a/src/LyXText.h +++ b/src/LyXText.h @@ -34,7 +34,7 @@ class DocIterator; class ErrorList; class FuncRequest; class FuncStatus; -class InsetBase; +class Inset; class Color_color; class Cursor; class PainterInfo; @@ -102,7 +102,7 @@ public: void insertChar(Cursor & cur, char_type c); /// insert an inset at cursor position /// FIXME: replace Cursor with DocIterator. - void insertInset(Cursor & cur, InsetBase * inset); + void insertInset(Cursor & cur, Inset * inset); /// draw text (only used for insets) void draw(PainterInfo & pi, int x, int y) const; @@ -189,7 +189,7 @@ public: /// FIXME: move to TextMetrics. /// FIXME: cleanup to use BufferView::getCoveringInset() and /// setCursorFromCoordinates() instead of checkInsetHit(). - InsetBase * editXY(Cursor & cur, int x, int y); + Inset * editXY(Cursor & cur, int x, int y); /// Move cursor one line up. /** @@ -284,7 +284,7 @@ public: /// \warning This method is not recursive! It will return the /// outermost inset within this LyXText. /// \sa BufferView::getCoveringInset() to get the innermost inset. - InsetBase * checkInsetHit(BufferView &, int x, int y); + Inset * checkInsetHit(BufferView &, int x, int y); /// /// FIXME: move to TextMetrics. diff --git a/src/ParIterator.cpp b/src/ParIterator.cpp index 1fbca725b3..76cb6fe1a8 100644 --- a/src/ParIterator.cpp +++ b/src/ParIterator.cpp @@ -15,7 +15,7 @@ #include "Paragraph.h" #include "LyXText.h" -#include "insets/InsetBase.h" +#include "insets/Inset.h" namespace lyx { @@ -29,13 +29,13 @@ ParIterator::ParIterator(DocIterator const & cur) {} -ParIterator par_iterator_begin(InsetBase & inset) +ParIterator par_iterator_begin(Inset & inset) { return ParIterator(doc_iterator_begin(inset)); } -ParIterator par_iterator_end(InsetBase & inset) +ParIterator par_iterator_end(Inset & inset) { return ParIterator(doc_iterator_end(inset)); } @@ -183,15 +183,15 @@ bool operator!=(ParConstIterator const & iter1, ParConstIterator const & iter2) #warning const correctness! #endif -ParConstIterator par_const_iterator_begin(InsetBase const & inset) +ParConstIterator par_const_iterator_begin(Inset const & inset) { - return ParConstIterator(doc_iterator_begin(const_cast(inset))); + return ParConstIterator(doc_iterator_begin(const_cast(inset))); } -ParConstIterator par_const_iterator_end(InsetBase const & inset) +ParConstIterator par_const_iterator_end(Inset const & inset) { - return ParConstIterator(doc_iterator_end(const_cast(inset))); + return ParConstIterator(doc_iterator_end(const_cast(inset))); } diff --git a/src/ParIterator.h b/src/ParIterator.h index e06a3b5032..2d16dcce33 100644 --- a/src/ParIterator.h +++ b/src/ParIterator.h @@ -21,7 +21,7 @@ namespace lyx { -class InsetBase; +class Inset; class LyXText; class ParagraphList; @@ -41,7 +41,7 @@ public: ParIterator() : DocIterator() {} /// - ParIterator(InsetBase &, pit_type pit); + ParIterator(Inset &, pit_type pit); /// ParIterator(ParIterator const &); /// @@ -73,9 +73,9 @@ public: DocIterator makeDocIterator(ParIterator const &, pos_type); -ParIterator par_iterator_begin(InsetBase & inset); +ParIterator par_iterator_begin(Inset & inset); -ParIterator par_iterator_end(InsetBase & inset); +ParIterator par_iterator_end(Inset & inset); /// @@ -116,9 +116,9 @@ bool operator!=(ParConstIterator const & iter1, ParConstIterator const & iter2); -ParConstIterator par_const_iterator_begin(InsetBase const & inset); +ParConstIterator par_const_iterator_begin(Inset const & inset); -ParConstIterator par_const_iterator_end(InsetBase const & inset); +ParConstIterator par_const_iterator_end(Inset const & inset); diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 1e736efd99..71262f4858 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -110,13 +110,13 @@ public: /// void insertChar(pos_type pos, value_type c, Change const & change); /// - void insertInset(pos_type pos, InsetBase * inset, Change const & change); + void insertInset(pos_type pos, Inset * inset, Change const & change); /// (logically) erase the char at pos; return true if it was actually erased bool eraseChar(pos_type pos, bool trackChanges); /// (logically) erase the given range; return the number of chars actually erased int eraseChars(pos_type start, pos_type end, bool trackChanges); /// - InsetBase * inset_owner; + Inset * inset_owner; /** A font entry covers a range of positions. Notice that the entries in the list are inserted in random order. @@ -457,7 +457,7 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c, Change const & cha } -void Paragraph::Pimpl::insertInset(pos_type pos, InsetBase * inset, +void Paragraph::Pimpl::insertInset(pos_type pos, Inset * inset, Change const & change) { BOOST_ASSERT(inset); @@ -687,14 +687,14 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf, // and then split to handle the two modes separately. switch (c) { case Paragraph::META_INSET: { - InsetBase * inset = owner_->getInset(i); + Inset * inset = owner_->getInset(i); // FIXME: remove this check if (!inset) break; // FIXME: move this to InsetNewline::latex - if (inset->lyxCode() == InsetBase::NEWLINE_CODE) { + if (inset->lyxCode() == Inset::NEWLINE_CODE) { // newlines are handled differently here than // the default in simpleTeXSpecialChars(). if (!style.newline_allowed) { @@ -740,9 +740,9 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf, bool close = false; odocstream::pos_type const len = os.tellp(); - if ((inset->lyxCode() == InsetBase::GRAPHICS_CODE - || inset->lyxCode() == InsetBase::MATH_CODE - || inset->lyxCode() == InsetBase::URL_CODE) + if ((inset->lyxCode() == Inset::GRAPHICS_CODE + || inset->lyxCode() == Inset::MATH_CODE + || inset->lyxCode() == Inset::URL_CODE) && running_font.isRightToLeft()) { os << "\\L{"; close = true; @@ -1005,7 +1005,7 @@ void Paragraph::Pimpl::validate(LaTeXFeatures & features, if (icit->inset) { icit->inset->validate(features); if (layout.needprotect && - icit->inset->lyxCode() == InsetBase::FOOT_CODE) + icit->inset->lyxCode() == Inset::FOOT_CODE) features.require("NeedLyXFootnoteCode"); } } @@ -1139,7 +1139,7 @@ void Paragraph::write(Buffer const & buf, ostream & os, switch (c) { case META_INSET: { - InsetBase const * inset = getInset(i); + Inset const * inset = getInset(i); if (inset) if (inset->directWrite()) { // international char, let it write @@ -1242,14 +1242,14 @@ void Paragraph::insertChar(pos_type pos, Paragraph::value_type c, } -void Paragraph::insertInset(pos_type pos, InsetBase * inset, +void Paragraph::insertInset(pos_type pos, Inset * inset, Change const & change) { pimpl_->insertInset(pos, inset, change); } -void Paragraph::insertInset(pos_type pos, InsetBase * inset, +void Paragraph::insertInset(pos_type pos, Inset * inset, LyXFont const & font, Change const & change) { pimpl_->insertInset(pos, inset, change); @@ -1257,7 +1257,7 @@ void Paragraph::insertInset(pos_type pos, InsetBase * inset, } -bool Paragraph::insetAllowed(InsetBase_code code) +bool Paragraph::insetAllowed(Inset_code code) { return !pimpl_->inset_owner || pimpl_->inset_owner->insetAllowed(code); } @@ -1688,7 +1688,7 @@ void Paragraph::setBeginOfBody() // returns -1 if inset not found -int Paragraph::getPositionOfInset(InsetBase const * inset) const +int Paragraph::getPositionOfInset(Inset const * inset) const { // Find the entry. InsetList::const_iterator it = insetlist.begin(); @@ -1703,8 +1703,8 @@ int Paragraph::getPositionOfInset(InsetBase const * inset) const InsetBibitem * Paragraph::bibitem() const { if (!insetlist.empty()) { - InsetBase * inset = insetlist.begin()->inset; - if (inset->lyxCode() == InsetBase::BIBITEM_CODE) + Inset * inset = insetlist.begin()->inset; + if (inset->lyxCode() == Inset::BIBITEM_CODE) return static_cast(inset); } return 0; @@ -1722,9 +1722,9 @@ namespace { // paragraphs inside floats need different alignment tags to avoid // unwanted space -bool noTrivlistCentering(InsetBase::Code code) +bool noTrivlistCentering(Inset::Code code) { - return code == InsetBase::FLOAT_CODE || code == InsetBase::WRAP_CODE; + return code == Inset::FLOAT_CODE || code == Inset::WRAP_CODE; } @@ -1741,7 +1741,7 @@ string correction(string const & orig) string const corrected_env(string const & suffix, string const & env, - InsetBase::Code code) + Inset::Code code) { string output = suffix + "{"; if (noTrivlistCentering(code)) @@ -2169,14 +2169,14 @@ bool Paragraph::emptyTag() const { for (pos_type i = 0; i < size(); ++i) { if (isInset(i)) { - InsetBase const * inset = getInset(i); - InsetBase::Code lyx_code = inset->lyxCode(); - if (lyx_code != InsetBase::TOC_CODE && - lyx_code != InsetBase::INCLUDE_CODE && - lyx_code != InsetBase::GRAPHICS_CODE && - lyx_code != InsetBase::ERT_CODE && - lyx_code != InsetBase::FLOAT_CODE && - lyx_code != InsetBase::TABULAR_CODE) { + Inset const * inset = getInset(i); + Inset::Code lyx_code = inset->lyxCode(); + if (lyx_code != Inset::TOC_CODE && + lyx_code != Inset::INCLUDE_CODE && + lyx_code != Inset::GRAPHICS_CODE && + lyx_code != Inset::ERT_CODE && + lyx_code != Inset::FLOAT_CODE && + lyx_code != Inset::TABULAR_CODE) { return false; } } else { @@ -2193,9 +2193,9 @@ string Paragraph::getID(Buffer const & buf, OutputParams const & runparams) cons { for (pos_type i = 0; i < size(); ++i) { if (isInset(i)) { - InsetBase const * inset = getInset(i); - InsetBase::Code lyx_code = inset->lyxCode(); - if (lyx_code == InsetBase::LABEL_CODE) { + Inset const * inset = getInset(i); + Inset::Code lyx_code = inset->lyxCode(); + if (lyx_code == Inset::LABEL_CODE) { string const id = static_cast(inset)->getContents(); return "id='" + to_utf8(sgml::cleanID(buf, runparams, from_utf8(id))) + "'"; } @@ -2211,7 +2211,7 @@ pos_type Paragraph::getFirstWord(Buffer const & buf, odocstream & os, OutputPara pos_type i; for (i = 0; i < size(); ++i) { if (isInset(i)) { - InsetBase const * inset = getInset(i); + Inset const * inset = getInset(i); inset->docbook(buf, os, runparams); } else { value_type c = getChar(i); @@ -2272,7 +2272,7 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf, } if (isInset(i)) { - InsetBase const * inset = getInset(i); + Inset const * inset = getInset(i); inset->docbook(buf, os, runparams); } else { value_type c = getChar(i); @@ -2299,7 +2299,7 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf, bool Paragraph::isNewline(pos_type pos) const { return isInset(pos) - && getInset(pos)->lyxCode() == InsetBase::NEWLINE_CODE; + && getInset(pos)->lyxCode() == Inset::NEWLINE_CODE; } @@ -2340,7 +2340,7 @@ bool Paragraph::isRightToLeftPar(BufferParams const & bparams) const { return lyxrc.rtl_support && getParLanguage(bparams)->rightToLeft() - && ownerCode() != InsetBase::ERT_CODE; + && ownerCode() != Inset::ERT_CODE; } @@ -2402,7 +2402,7 @@ docstring const Paragraph::asString(Buffer const & buffer, } -void Paragraph::setInsetOwner(InsetBase * inset) +void Paragraph::setInsetOwner(Inset * inset) { pimpl_->inset_owner = inset; } @@ -2469,16 +2469,16 @@ void Paragraph::layout(LyXLayout_ptr const & new_layout) } -InsetBase * Paragraph::inInset() const +Inset * Paragraph::inInset() const { return pimpl_->inset_owner; } -InsetBase::Code Paragraph::ownerCode() const +Inset::Code Paragraph::ownerCode() const { return pimpl_->inset_owner - ? pimpl_->inset_owner->lyxCode() : InsetBase::NO_CODE; + ? pimpl_->inset_owner->lyxCode() : Inset::NO_CODE; } @@ -2500,8 +2500,8 @@ bool Paragraph::isFreeSpacing() const return true; // for now we just need this, later should we need this in some - // other way we can always add a function to InsetBase too. - return ownerCode() == InsetBase::ERT_CODE; + // other way we can always add a function to Inset too. + return ownerCode() == Inset::ERT_CODE; } @@ -2509,7 +2509,7 @@ bool Paragraph::allowEmpty() const { if (layout()->keepempty) return true; - return ownerCode() == InsetBase::ERT_CODE; + return ownerCode() == Inset::ERT_CODE; } @@ -2598,13 +2598,13 @@ bool Paragraph::checkBiblio(bool track_changes) bool hasbibitem = !insetlist.empty() // Insist on it being in pos 0 && getChar(0) == Paragraph::META_INSET - && insetlist.begin()->inset->lyxCode() == InsetBase::BIBITEM_CODE; + && insetlist.begin()->inset->lyxCode() == Inset::BIBITEM_CODE; if (hasbibitem) return false; InsetBibitem * inset(new InsetBibitem(InsetCommandParams("bibitem"))); - insertInset(0, static_cast(inset), + insertInset(0, static_cast(inset), Change(track_changes ? Change::INSERTED : Change::UNCHANGED)); return true; diff --git a/src/Paragraph.h b/src/Paragraph.h index 2d8ad9fe6c..c345a5bb6f 100644 --- a/src/Paragraph.h +++ b/src/Paragraph.h @@ -22,7 +22,7 @@ #include "lyxlayout_ptr_fwd.h" #include "RowList_fwd.h" -#include "insets/InsetBase.h" // only for InsetBase::Code +#include "insets/Inset.h" // only for Inset::Code namespace lyx { @@ -31,10 +31,10 @@ namespace lyx { class Buffer; class BufferParams; class Counters; -class InsetBase; +class Inset; class InsetBibitem; class LaTeXFeatures; -class InsetBase_code; +class Inset_code; class Language; class LyXFont; class LyXFont_size; @@ -158,11 +158,11 @@ public: void makeSameLayout(Paragraph const & par); /// - void setInsetOwner(InsetBase * inset); + void setInsetOwner(Inset * inset); /// - InsetBase * inInset() const; + Inset * inInset() const; /// - InsetBase::Code ownerCode() const; + Inset::Code ownerCode() const; /// bool forceDefaultParagraphs() const; @@ -303,26 +303,26 @@ public: void insertChar(pos_type pos, value_type c, LyXFont const &, Change const & change); /// - void insertInset(pos_type pos, InsetBase * inset, + void insertInset(pos_type pos, Inset * inset, Change const & change); /// - void insertInset(pos_type pos, InsetBase * inset, + void insertInset(pos_type pos, Inset * inset, LyXFont const &, Change const & change); /// - bool insetAllowed(InsetBase_code code); + bool insetAllowed(Inset_code code); /// - InsetBase * getInset(pos_type pos) { + Inset * getInset(pos_type pos) { return insetlist.get(pos); } /// - InsetBase const * getInset(pos_type pos) const { + Inset const * getInset(pos_type pos) const { return insetlist.get(pos); } /// bool isHfill(pos_type pos) const { return isInset(pos) - && getInset(pos)->lyxCode() == InsetBase::HFILL_CODE; + && getInset(pos)->lyxCode() == Inset::HFILL_CODE; } /// hinted by profiler bool isInset(pos_type pos) const { @@ -339,7 +339,7 @@ public: bool isLetter(pos_type pos) const; /// returns -1 if inset not found - int getPositionOfInset(InsetBase const * inset) const; + int getPositionOfInset(Inset const * inset) const; /// returns true if at least one line break or line separator has been deleted /// at the beginning of the paragraph (either physically or logically) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 1ad906907c..ee2a093734 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -201,7 +201,7 @@ bool TextMetrics::redoParagraph(pit_type const pit) // redo insets // FIXME: We should always use getFont(), see documentation of - // noFontChange() in InsetBase.h. + // noFontChange() in Inset.h. LyXFont const bufferfont = buffer.params().getFont(); InsetList::const_iterator ii = par.insetlist.begin(); InsetList::const_iterator iend = par.insetlist.end(); @@ -334,7 +334,7 @@ RowMetrics TextMetrics::computeRowMetrics(pit_type const pit, int const ns = numberOfSeparators(par, row); bool disp_inset = false; if (row.endpos() < par.size()) { - InsetBase const * in = par.getInset(row.endpos()); + Inset const * in = par.getInset(row.endpos()); if (in) disp_inset = in->display(); } diff --git a/src/TocBackend.cpp b/src/TocBackend.cpp index 1b33dc0f7a..fb196e46fc 100644 --- a/src/TocBackend.cpp +++ b/src/TocBackend.cpp @@ -135,8 +135,8 @@ void TocBackend::updateItem(ParConstIterator const & par_it) InsetList::const_iterator it = toc_item->par_it_->insetlist.begin(); InsetList::const_iterator end = toc_item->par_it_->insetlist.end(); for (; it != end; ++it) { - InsetBase & inset = *it->inset; - if (inset.lyxCode() == InsetBase::OPTARG_CODE) { + Inset & inset = *it->inset; + if (inset.lyxCode() == Inset::OPTARG_CODE) { if (!tocstring.empty()) break; Paragraph const & par = @@ -179,10 +179,10 @@ void TocBackend::update() InsetList::const_iterator it = pit->insetlist.begin(); InsetList::const_iterator end = pit->insetlist.end(); for (; it != end; ++it) { - InsetBase & inset = *it->inset; + Inset & inset = *it->inset; inset.addToToc(tocs_, *buffer_); switch (inset.lyxCode()) { - case InsetBase::OPTARG_CODE: { + case Inset::OPTARG_CODE: { if (!tocstring.empty()) break; Paragraph const & par = diff --git a/src/Undo.cpp b/src/Undo.cpp index 6b05ae484b..241e368e9b 100644 --- a/src/Undo.cpp +++ b/src/Undo.cpp @@ -28,7 +28,7 @@ #include "mathed/MathSupport.h" #include "mathed/MathData.h" -#include "insets/InsetBase.h" +#include "insets/Inset.h" #include diff --git a/src/buffer_funcs.cpp b/src/buffer_funcs.cpp index 7578bc997e..396ca2153d 100644 --- a/src/buffer_funcs.cpp +++ b/src/buffer_funcs.cpp @@ -352,7 +352,7 @@ bool needEnumCounterReset(ParIterator const & it) } -void setCaptionLabels(InsetBase & inset, string const & type, +void setCaptionLabels(Inset & inset, string const & type, docstring const label, Counters & counters) { LyXText * text = inset.getText(0); @@ -372,10 +372,10 @@ void setCaptionLabels(InsetBase & inset, string const & type, // Any caption within this float should have the same // label prefix but different numbers. for (; it2 != end2; ++it2) { - InsetBase & icap = *it2->inset; + Inset & icap = *it2->inset; // Look deeper just in case. setCaptionLabels(icap, type, label, counters); - if (icap.lyxCode() == InsetBase::CAPTION_CODE) { + if (icap.lyxCode() == Inset::CAPTION_CODE) { // We found a caption! counters.step(counter); int number = counters.value(counter); @@ -399,10 +399,10 @@ void setCaptions(Paragraph & par, LyXTextClass const & textclass) InsetList::iterator it = par.insetlist.begin(); InsetList::iterator end = par.insetlist.end(); for (; it != end; ++it) { - InsetBase & inset = *it->inset; - if (inset.lyxCode() == InsetBase::FLOAT_CODE - || inset.lyxCode() == InsetBase::WRAP_CODE) { - docstring const & name = inset.getInsetName(); + Inset & inset = *it->inset; + if (inset.lyxCode() == Inset::FLOAT_CODE + || inset.lyxCode() == Inset::WRAP_CODE) { + docstring const & name = inset.insetName(); if (name.empty()) continue; @@ -412,7 +412,7 @@ void setCaptions(Paragraph & par, LyXTextClass const & textclass) docstring const label = from_utf8(fl.name()); setCaptionLabels(inset, type, label, counters); } - else if (inset.lyxCode() == InsetBase::TABULAR_CODE + else if (inset.lyxCode() == Inset::TABULAR_CODE && static_cast(inset).tabular.isLongTabular()) { // FIXME: are "table" and "Table" the correct type and label? setCaptionLabels(inset, "table", from_ascii("Table"), counters); @@ -549,23 +549,23 @@ void setLabel(Buffer const & buf, ParIterator & it, LyXTextClass const & textcla } else if (layout->labeltype == LABEL_SENSITIVE) { // Search for the first float or wrap inset in the iterator size_t i = it.depth(); - InsetBase * in = 0; + Inset * in = 0; while (i > 0) { --i; - InsetBase::Code const code = it[i].inset().lyxCode(); - if (code == InsetBase::FLOAT_CODE || - code == InsetBase::WRAP_CODE) { + Inset::Code const code = it[i].inset().lyxCode(); + if (code == Inset::FLOAT_CODE || + code == Inset::WRAP_CODE) { in = &it[i].inset(); break; } } - // FIXME Can getInsetName() return an empty name for wide or + // FIXME Can insetName() return an empty name for wide or // float insets? If not we can put the definition of type // inside the if (in) clause and use that instead of // if (!type.empty()). docstring type; if (in) - type = in->getInsetName(); + type = in->insetName(); if (!type.empty()) { Floating const & fl = textclass.floats().getType(to_ascii(type)); @@ -688,7 +688,7 @@ void updateLabels(Buffer const & buf, bool childonly) InsetList::const_iterator iit = it->insetlist.begin(); InsetList::const_iterator end = it->insetlist.end(); for (; iit != end; ++iit) { - if (iit->inset->lyxCode() == InsetBase::INCLUDE_CODE) + if (iit->inset->lyxCode() == Inset::INCLUDE_CODE) static_cast(iit->inset) ->updateLabels(buf); } diff --git a/src/bufferview_funcs.cpp b/src/bufferview_funcs.cpp index b8358ab8ad..29169dbe5b 100644 --- a/src/bufferview_funcs.cpp +++ b/src/bufferview_funcs.cpp @@ -239,13 +239,13 @@ CurStatus status(BufferView const * bv, DocIterator const & dit) namespace { bool findNextInset(DocIterator & dit, - vector const & codes, + vector const & codes, string const & contents) { DocIterator tmpdit = dit; while (tmpdit) { - InsetBase const * inset = tmpdit.nextInset(); + Inset const * inset = tmpdit.nextInset(); if (inset && find(codes.begin(), codes.end(), inset->lyxCode()) != codes.end() && (contents.empty() || @@ -262,7 +262,7 @@ bool findNextInset(DocIterator & dit, } // namespace anon -bool findInset(DocIterator & dit, vector const & codes, +bool findInset(DocIterator & dit, vector const & codes, bool same_content) { string contents; @@ -272,7 +272,7 @@ bool findInset(DocIterator & dit, vector const & codes, return false; if (same_content) { - InsetBase const * inset = tmpdit.nextInset(); + Inset const * inset = tmpdit.nextInset(); if (inset && find(codes.begin(), codes.end(), inset->lyxCode()) != codes.end()) { contents = static_cast(inset)->getContents(); @@ -294,13 +294,13 @@ bool findInset(DocIterator & dit, vector const & codes, } -void findInset(DocIterator & dit, InsetBase_code code, bool same_content) +void findInset(DocIterator & dit, Inset_code code, bool same_content) { - findInset(dit, vector(1, code), same_content); + findInset(dit, vector(1, code), same_content); } -void gotoInset(BufferView * bv, vector const & codes, +void gotoInset(BufferView * bv, vector const & codes, bool same_content) { Cursor tmpcur = bv->cursor(); @@ -314,9 +314,9 @@ void gotoInset(BufferView * bv, vector const & codes, } -void gotoInset(BufferView * bv, InsetBase_code code, bool same_content) +void gotoInset(BufferView * bv, Inset_code code, bool same_content) { - gotoInset(bv, vector(1, code), same_content); + gotoInset(bv, vector(1, code), same_content); } diff --git a/src/bufferview_funcs.h b/src/bufferview_funcs.h index c2268f8a29..a295c7af0f 100644 --- a/src/bufferview_funcs.h +++ b/src/bufferview_funcs.h @@ -22,7 +22,7 @@ namespace lyx { class Point; class BufferView; class DocIterator; -class InsetBase_code; +class Inset_code; class LyXFont; namespace bv_funcs { @@ -53,18 +53,18 @@ CurStatus status(BufferView const * bv, DocIterator const & dit); Point coordOffset(BufferView const & bv, DocIterator const & dit, bool boundary); /// Moves cursor to the next inset with one of the given codes. -void gotoInset(BufferView * bv, std::vector const & codes, +void gotoInset(BufferView * bv, std::vector const & codes, bool same_content); /// Moves cursor to the next inset with given code. -void gotoInset(BufferView * bv, InsetBase_code code, bool same_content); +void gotoInset(BufferView * bv, Inset_code code, bool same_content); /// Looks for next inset with one of the the given code -bool findInset(DocIterator & dit, std::vector const & codes, +bool findInset(DocIterator & dit, std::vector const & codes, bool same_content); /// Looks for next inset with the given code -void findInset(DocIterator & dit, InsetBase_code code, bool same_content); +void findInset(DocIterator & dit, Inset_code code, bool same_content); } // namespace bv_funcs diff --git a/src/factory.cpp b/src/factory.cpp index 1343dfb50b..3d21819847 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -80,7 +80,7 @@ using std::endl; using std::string; -InsetBase * createInset(BufferView * bv, FuncRequest const & cmd) +Inset * createInset(BufferView * bv, FuncRequest const & cmd) { BufferParams const & params = bv->buffer()->params(); @@ -372,7 +372,7 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd) } -InsetBase * readInset(Lexer & lex, Buffer const & buf) +Inset * readInset(Lexer & lex, Buffer const & buf) { // consistency check if (lex.getString() != "\\begin_inset") { @@ -380,7 +380,7 @@ InsetBase * readInset(Lexer & lex, Buffer const & buf) << endl; } - auto_ptr inset; + auto_ptr inset; LyXTextClass tclass = buf.params().getLyXTextClass(); @@ -531,7 +531,7 @@ InsetBase * readInset(Lexer & lex, Buffer const & buf) #ifdef WITH_WARNINGS #warning hack.. #endif - if (inset->lyxCode() == InsetBase::MATHMACRO_CODE) { + if (inset->lyxCode() == Inset::MATHMACRO_CODE) { MathMacroTemplate const * tmpl = static_cast(inset.get()); MacroTable::globalMacros().insert diff --git a/src/factory.h b/src/factory.h index 811c78c84a..65d33b6db0 100644 --- a/src/factory.h +++ b/src/factory.h @@ -17,15 +17,15 @@ namespace lyx { class Buffer; class BufferView; class FuncRequest; -class InsetBase; +class Inset; class Lexer; /// creates inset according to 'cmd' -InsetBase * createInset(BufferView * bv, FuncRequest const & cmd); +Inset * createInset(BufferView * bv, FuncRequest const & cmd); /// read inset from a file -InsetBase * readInset(Lexer & lex, Buffer const & buf); +Inset * readInset(Lexer & lex, Buffer const & buf); } // namespace lyx diff --git a/src/frontends/Dialogs.cpp b/src/frontends/Dialogs.cpp index 13132814e5..35d4e013d7 100644 --- a/src/frontends/Dialogs.cpp +++ b/src/frontends/Dialogs.cpp @@ -51,12 +51,12 @@ private: namespace { -BugfixSignal > hideSignal; +BugfixSignal > hideSignal; } -void Dialogs::hide(string const & name, InsetBase* inset) +void Dialogs::hide(string const & name, Inset* inset) { // Don't send the signal if we are quitting, because on MSVC it is // destructed before the cut stack in CutAndPaste.cpp, and this method @@ -106,7 +106,7 @@ void Dialogs::show(string const & name, string const & data) } -void Dialogs::show(string const & name, string const & data, InsetBase * inset) +void Dialogs::show(string const & name, string const & data, Inset * inset) { if (in_show_) { return; @@ -145,7 +145,7 @@ void Dialogs::update(string const & name, string const & data) } -void Dialogs::hideSlot(string const & name, InsetBase * inset) +void Dialogs::hideSlot(string const & name, Inset * inset) { std::map::const_iterator it = dialogs_.find(name); @@ -172,12 +172,12 @@ void Dialogs::disconnect(string const & name) } -InsetBase * Dialogs::getOpenInset(string const & name) const +Inset * Dialogs::getOpenInset(string const & name) const { if (!isValidName(name)) return 0; - std::map::const_iterator it = + std::map::const_iterator it = open_insets_.find(name); return it == open_insets_.end() ? 0 : it->second; } diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h index f91ea7efd9..323deee995 100644 --- a/src/frontends/Dialogs.h +++ b/src/frontends/Dialogs.h @@ -20,7 +20,7 @@ namespace lyx { -class InsetBase; +class Inset; class LyXView; namespace frontend { class Dialog; } @@ -73,7 +73,7 @@ public: dialog on 'Apply'; should it be used to create a new inset at the current cursor position or modify an existing, 'open' inset? */ - void show(std::string const & name, std::string const & data, InsetBase * inset); + void show(std::string const & name, std::string const & data, Inset * inset); /** \param name == "citation", "bibtex" etc; an identifier used to update the contents of a particular dialog with \param data. @@ -87,14 +87,14 @@ public: /** All Dialogs of the given \param name will be closed if they are connected to the given \param inset. */ - static void hide(std::string const & name, InsetBase * inset); + static void hide(std::string const & name, Inset * inset); /// void disconnect(std::string const & name); /// - InsetBase * getOpenInset(std::string const & name) const; + Inset * getOpenInset(std::string const & name) const; private: /// - void hideSlot(std::string const & name, InsetBase * inset); + void hideSlot(std::string const & name, Inset * inset); /// void redraw() const; /// @@ -109,7 +109,7 @@ private: /// LyXView & lyxview_; /// - std::map open_insets_; + std::map open_insets_; /// std::map dialogs_; diff --git a/src/frontends/LyXView.cpp b/src/frontends/LyXView.cpp index 64712c23b0..380d6dc0bf 100644 --- a/src/frontends/LyXView.cpp +++ b/src/frontends/LyXView.cpp @@ -290,7 +290,7 @@ void LyXView::showDialogWithData(string const & name, string const & data) void LyXView::showInsetDialog(string const & name, string const & data, - InsetBase * inset) + Inset * inset) { getDialogs().show(name, data, inset); } @@ -442,7 +442,7 @@ void LyXView::dispatch(FuncRequest const & cmd) } -Buffer const * const LyXView::updateInset(InsetBase const * inset) const +Buffer const * const LyXView::updateInset(Inset const * inset) const { Buffer const * buffer_ptr = 0; if (inset) { diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h index 6e12df9b5d..ae9f770807 100644 --- a/src/frontends/LyXView.h +++ b/src/frontends/LyXView.h @@ -30,7 +30,7 @@ namespace lyx { namespace support { class FileName; } class Buffer; -class InsetBase; +class Inset; class Menubar; class BufferView; @@ -186,7 +186,7 @@ public: /** redraw \c inset in all the BufferViews in which it is currently * visible. If successful return a pointer to the owning Buffer. */ - Buffer const * const updateInset(InsetBase const *) const; + Buffer const * const updateInset(Inset const *) const; /// returns true if this view has the focus. virtual bool hasFocus() const = 0; @@ -268,7 +268,7 @@ private: void showDialogWithData(std::string const & name, std::string const & data); void showInsetDialog(std::string const & name, - std::string const & data, InsetBase * inset); + std::string const & data, Inset * inset); void updateDialog(std::string const & name, std::string const & data); //@} diff --git a/src/frontends/controllers/ControlTabular.cpp b/src/frontends/controllers/ControlTabular.cpp index 75cade5780..f6f1f55443 100644 --- a/src/frontends/controllers/ControlTabular.cpp +++ b/src/frontends/controllers/ControlTabular.cpp @@ -38,7 +38,7 @@ bool ControlTabular::initialiseParams(string const & data) // get the innermost tabular inset; // assume that it is "ours" for (int i = cur.depth() - 1; i >= 0; --i) - if (cur[i].inset().lyxCode() == InsetBase::TABULAR_CODE) { + if (cur[i].inset().lyxCode() == Inset::TABULAR_CODE) { active_cell_ = cur[i].idx(); break; } diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index f0c1b7ca5f..986346aa9b 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -26,7 +26,7 @@ #include "frontends/Application.h" // hexName -#include "insets/InsetBase.h" +#include "insets/Inset.h" #include "support/filetools.h" #include "support/Forkedcall.h" @@ -702,12 +702,12 @@ void PreviewLoader::Impl::dumpPreamble(odocstream & os) const << "\n"; // Loop over the insets in the buffer and dump all the math-macros. - InsetBase & inset = buffer_.inset(); + Inset & inset = buffer_.inset(); InsetIterator it = inset_iterator_begin(inset); InsetIterator const end = inset_iterator_end(inset); for (; it != end; ++it) - if (it->lyxCode() == InsetBase::MATHMACRO_CODE) + if (it->lyxCode() == Inset::MATHMACRO_CODE) it->latex(buffer_, os, runparams); // All equation labels appear as "(#)" + preview.sty's rendering of diff --git a/src/graphics/Previews.cpp b/src/graphics/Previews.cpp index 8e5cef0239..8842faf234 100644 --- a/src/graphics/Previews.cpp +++ b/src/graphics/Previews.cpp @@ -18,7 +18,7 @@ #include "LyXRC.h" #include "Paragraph.h" -#include "insets/InsetBase.h" +#include "insets/Inset.h" namespace lyx { @@ -85,7 +85,7 @@ void Previews::generateBufferPreviews(Buffer const & buffer) const { PreviewLoader & ploader = loader(buffer); - InsetBase & inset = buffer.inset(); + Inset & inset = buffer.inset(); InsetIterator it = inset_iterator_begin(inset); InsetIterator const end = inset_iterator_end(inset); diff --git a/src/insets/InsetBase.cpp b/src/insets/Inset.cpp similarity index 54% rename from src/insets/InsetBase.cpp rename to src/insets/Inset.cpp index 941bb4cc4d..c57add1045 100644 --- a/src/insets/InsetBase.cpp +++ b/src/insets/Inset.cpp @@ -1,5 +1,5 @@ /** - * \file InsetBase.cpp + * \file Inset.cpp * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -14,7 +14,7 @@ #include -#include "InsetBase.h" +#include "Inset.h" #include "Buffer.h" #include "BufferView.h" @@ -44,67 +44,67 @@ namespace lyx { class InsetName { public: - InsetName(std::string const & n, InsetBase::Code c) + InsetName(std::string const & n, Inset::Code c) : name(n), code(c) {} std::string name; - InsetBase::Code code; + Inset::Code code; }; -typedef std::map TranslatorMap; +typedef std::map TranslatorMap; static TranslatorMap const build_translator() { InsetName const insetnames[] = { - InsetName("toc", InsetBase::TOC_CODE), - InsetName("quote", InsetBase::QUOTE_CODE), - InsetName("ref", InsetBase::REF_CODE), - InsetName("url", InsetBase::URL_CODE), - InsetName("htmlurl", InsetBase::HTMLURL_CODE), - InsetName("separator", InsetBase::SEPARATOR_CODE), - InsetName("ending", InsetBase::ENDING_CODE), - InsetName("label", InsetBase::LABEL_CODE), - InsetName("note", InsetBase::NOTE_CODE), - InsetName("accent", InsetBase::ACCENT_CODE), - InsetName("math", InsetBase::MATH_CODE), - InsetName("index", InsetBase::INDEX_CODE), - InsetName("nomenclature", InsetBase::NOMENCL_CODE), - InsetName("include", InsetBase::INCLUDE_CODE), - InsetName("graphics", InsetBase::GRAPHICS_CODE), - InsetName("bibitem", InsetBase::BIBITEM_CODE), - InsetName("bibtex", InsetBase::BIBTEX_CODE), - InsetName("text", InsetBase::TEXT_CODE), - InsetName("ert", InsetBase::ERT_CODE), - InsetName("foot", InsetBase::FOOT_CODE), - InsetName("margin", InsetBase::MARGIN_CODE), - InsetName("float", InsetBase::FLOAT_CODE), - InsetName("wrap", InsetBase::WRAP_CODE), - InsetName("specialchar", InsetBase::SPECIALCHAR_CODE), - InsetName("tabular", InsetBase::TABULAR_CODE), - InsetName("external", InsetBase::EXTERNAL_CODE), - InsetName("caption", InsetBase::CAPTION_CODE), - InsetName("mathmacro", InsetBase::MATHMACRO_CODE), - InsetName("cite", InsetBase::CITE_CODE), - InsetName("float_list", InsetBase::FLOAT_LIST_CODE), - InsetName("index_print", InsetBase::INDEX_PRINT_CODE), - InsetName("nomencl_print", InsetBase::NOMENCL_PRINT_CODE), - InsetName("optarg", InsetBase::OPTARG_CODE), - InsetName("environment", InsetBase::ENVIRONMENT_CODE), - InsetName("hfill", InsetBase::HFILL_CODE), - InsetName("newline", InsetBase::NEWLINE_CODE), - InsetName("line", InsetBase::LINE_CODE), - InsetName("branch", InsetBase::BRANCH_CODE), - InsetName("box", InsetBase::BOX_CODE), - InsetName("charstyle", InsetBase::CHARSTYLE_CODE), - InsetName("vspace", InsetBase::VSPACE_CODE), - InsetName("mathmacroarg", InsetBase::MATHMACROARG_CODE), + InsetName("toc", Inset::TOC_CODE), + InsetName("quote", Inset::QUOTE_CODE), + InsetName("ref", Inset::REF_CODE), + InsetName("url", Inset::URL_CODE), + InsetName("htmlurl", Inset::HTMLURL_CODE), + InsetName("separator", Inset::SEPARATOR_CODE), + InsetName("ending", Inset::ENDING_CODE), + InsetName("label", Inset::LABEL_CODE), + InsetName("note", Inset::NOTE_CODE), + InsetName("accent", Inset::ACCENT_CODE), + InsetName("math", Inset::MATH_CODE), + InsetName("index", Inset::INDEX_CODE), + InsetName("nomenclature", Inset::NOMENCL_CODE), + InsetName("include", Inset::INCLUDE_CODE), + InsetName("graphics", Inset::GRAPHICS_CODE), + InsetName("bibitem", Inset::BIBITEM_CODE), + InsetName("bibtex", Inset::BIBTEX_CODE), + InsetName("text", Inset::TEXT_CODE), + InsetName("ert", Inset::ERT_CODE), + InsetName("foot", Inset::FOOT_CODE), + InsetName("margin", Inset::MARGIN_CODE), + InsetName("float", Inset::FLOAT_CODE), + InsetName("wrap", Inset::WRAP_CODE), + InsetName("specialchar", Inset::SPECIALCHAR_CODE), + InsetName("tabular", Inset::TABULAR_CODE), + InsetName("external", Inset::EXTERNAL_CODE), + InsetName("caption", Inset::CAPTION_CODE), + InsetName("mathmacro", Inset::MATHMACRO_CODE), + InsetName("cite", Inset::CITE_CODE), + InsetName("float_list", Inset::FLOAT_LIST_CODE), + InsetName("index_print", Inset::INDEX_PRINT_CODE), + InsetName("nomencl_print", Inset::NOMENCL_PRINT_CODE), + InsetName("optarg", Inset::OPTARG_CODE), + InsetName("environment", Inset::ENVIRONMENT_CODE), + InsetName("hfill", Inset::HFILL_CODE), + InsetName("newline", Inset::NEWLINE_CODE), + InsetName("line", Inset::LINE_CODE), + InsetName("branch", Inset::BRANCH_CODE), + InsetName("box", Inset::BOX_CODE), + InsetName("charstyle", Inset::CHARSTYLE_CODE), + InsetName("vspace", Inset::VSPACE_CODE), + InsetName("mathmacroarg", Inset::MATHMACROARG_CODE), }; std::size_t const insetnames_size = sizeof(insetnames) / sizeof(insetnames[0]); - std::map data; + std::map data; for (std::size_t i = 0; i != insetnames_size; ++i) { InsetName const & var = insetnames[i]; data[var.name] = var.code; @@ -115,31 +115,31 @@ static TranslatorMap const build_translator() /// pretty arbitrary dimensions -InsetBase::InsetBase() +Inset::Inset() : dim_(10, 10, 10), background_color_(Color::background) {} -InsetBase::InsetBase(InsetBase const & inset) +Inset::Inset(Inset const & inset) : dim_(inset.dim_), background_color_(inset.background_color_) {} -std::auto_ptr InsetBase::clone() const +std::auto_ptr Inset::clone() const { - std::auto_ptr b = doClone(); + std::auto_ptr b = doClone(); BOOST_ASSERT(typeid(*b) == typeid(*this)); return b; } -docstring InsetBase::getInsetName() const +docstring Inset::insetName() const { return from_ascii("unknown"); } -InsetBase::Code InsetBase::translate(std::string const & name) +Inset::Code Inset::translate(std::string const & name) { static TranslatorMap const translator = build_translator(); @@ -148,7 +148,7 @@ InsetBase::Code InsetBase::translate(std::string const & name) } -void InsetBase::dispatch(Cursor & cur, FuncRequest & cmd) +void Inset::dispatch(Cursor & cur, FuncRequest & cmd) { cur.updateFlags(Update::Force | Update::FitCursor); cur.dispatched(); @@ -156,14 +156,14 @@ void InsetBase::dispatch(Cursor & cur, FuncRequest & cmd) } -void InsetBase::doDispatch(Cursor & cur, FuncRequest &) +void Inset::doDispatch(Cursor & cur, FuncRequest &) { cur.noUpdate(); cur.undispatched(); } -bool InsetBase::getStatus(Cursor &, FuncRequest const & cmd, +bool Inset::getStatus(Cursor &, FuncRequest const & cmd, FuncStatus & flag) const { // LFUN_INSET_APPLY is sent from the dialogs when the data should @@ -195,14 +195,14 @@ bool InsetBase::getStatus(Cursor &, FuncRequest const & cmd, } -void InsetBase::edit(Cursor &, bool) +void Inset::edit(Cursor &, bool) { LYXERR(Debug::INSETS) << BOOST_CURRENT_FUNCTION << ": edit left/right" << std::endl; } -InsetBase * InsetBase::editXY(Cursor &, int x, int y) +Inset * Inset::editXY(Cursor &, int x, int y) { LYXERR(Debug::INSETS) << BOOST_CURRENT_FUNCTION << ": x=" << x << " y= " << y @@ -211,7 +211,7 @@ InsetBase * InsetBase::editXY(Cursor &, int x, int y) } -InsetBase::idx_type InsetBase::index(row_type row, col_type col) const +Inset::idx_type Inset::index(row_type row, col_type col) const { if (row != 0) lyxerr << BOOST_CURRENT_FUNCTION @@ -223,66 +223,66 @@ InsetBase::idx_type InsetBase::index(row_type row, col_type col) const } -bool InsetBase::idxBetween(idx_type idx, idx_type from, idx_type to) const +bool Inset::idxBetween(idx_type idx, idx_type from, idx_type to) const { return from <= idx && idx <= to; } -bool InsetBase::idxUpDown(Cursor &, bool) const +bool Inset::idxUpDown(Cursor &, bool) const { return false; } -int InsetBase::docbook(Buffer const &, +int Inset::docbook(Buffer const &, odocstream &, OutputParams const &) const { return 0; } -bool InsetBase::directWrite() const +bool Inset::directWrite() const { return false; } -InsetBase::EDITABLE InsetBase::editable() const +Inset::EDITABLE Inset::editable() const { return NOT_EDITABLE; } -bool InsetBase::autoDelete() const +bool Inset::autoDelete() const { return false; } -docstring const InsetBase::editMessage() const +docstring const Inset::editMessage() const { return _("Opened inset"); } -void InsetBase::cursorPos(BufferView const & /*bv*/, CursorSlice const &, +void Inset::cursorPos(BufferView const & /*bv*/, CursorSlice const &, bool, int & x, int & y) const { - lyxerr << "InsetBase::cursorPos called directly" << std::endl; + lyxerr << "Inset::cursorPos called directly" << std::endl; x = 100; y = 100; } -void InsetBase::metricsMarkers(Dimension & dim, int framesize) const +void Inset::metricsMarkers(Dimension & dim, int framesize) const { dim.wid += 2 * framesize; dim.asc += framesize; } -void InsetBase::metricsMarkers2(Dimension & dim, int framesize) const +void Inset::metricsMarkers2(Dimension & dim, int framesize) const { dim.wid += 2 * framesize; dim.asc += framesize; @@ -290,7 +290,7 @@ void InsetBase::metricsMarkers2(Dimension & dim, int framesize) const } -void InsetBase::drawMarkers(PainterInfo & pi, int x, int y) const +void Inset::drawMarkers(PainterInfo & pi, int x, int y) const { Color::color pen_color = editing(pi.base.bv)? Color::mathframe : Color::background; @@ -305,7 +305,7 @@ void InsetBase::drawMarkers(PainterInfo & pi, int x, int y) const } -void InsetBase::drawMarkers2(PainterInfo & pi, int x, int y) const +void Inset::drawMarkers2(PainterInfo & pi, int x, int y) const { Color::color pen_color = editing(pi.base.bv)? Color::mathframe : Color::background; @@ -321,27 +321,27 @@ void InsetBase::drawMarkers2(PainterInfo & pi, int x, int y) const } -bool InsetBase::editing(BufferView * bv) const +bool Inset::editing(BufferView * bv) const { return bv->cursor().isInside(this); } -int InsetBase::xo(BufferView const & bv) const +int Inset::xo(BufferView const & bv) const { return bv.coordCache().getInsets().x(this); } -int InsetBase::yo(BufferView const & bv) const +int Inset::yo(BufferView const & bv) const { return bv.coordCache().getInsets().y(this); } -bool InsetBase::covers(BufferView const & bv, int x, int y) const +bool Inset::covers(BufferView const & bv, int x, int y) const { - //lyxerr << "InsetBase::covers, x: " << x << " y: " << y + //lyxerr << "Inset::covers, x: " << x << " y: " << y // << " xo: " << xo(bv) << " yo: " << yo() // << " x1: " << xo(bv) << " x2: " << xo() + width() // << " y1: " << yo(bv) - ascent() << " y2: " << yo() + descent() @@ -354,43 +354,43 @@ bool InsetBase::covers(BufferView const & bv, int x, int y) const } -void InsetBase::dump() const +void Inset::dump() const { Buffer buf("foo", 1); write(buf, lyxerr); } -void InsetBase::setBackgroundColor(Color_color color) +void Inset::setBackgroundColor(Color_color color) { background_color_ = color; } -Color_color InsetBase::backgroundColor() const +Color_color Inset::backgroundColor() const { return Color::color(background_color_); } -void InsetBase::setPosCache(PainterInfo const & pi, int x, int y) const +void Inset::setPosCache(PainterInfo const & pi, int x, int y) const { - //lyxerr << "InsetBase:: position cache to " << x << " " << y << std::endl; + //lyxerr << "Inset:: position cache to " << x << " " << y << std::endl; pi.base.bv->coordCache().insets().add(this, x, y); } ///////////////////////////////////////// -bool isEditableInset(InsetBase const * inset) +bool isEditableInset(Inset const * inset) { return inset && inset->editable(); } -bool isHighlyEditableInset(InsetBase const * inset) +bool isHighlyEditableInset(Inset const * inset) { - return inset && inset->editable() == InsetBase::HIGHLY_EDITABLE; + return inset && inset->editable() == Inset::HIGHLY_EDITABLE; } diff --git a/src/insets/InsetBase.h b/src/insets/Inset.h similarity index 94% rename from src/insets/InsetBase.h rename to src/insets/Inset.h index effdbfb2b1..1809ddcf81 100644 --- a/src/insets/InsetBase.h +++ b/src/insets/Inset.h @@ -1,6 +1,6 @@ // -*- C++ -*- /** - * \file InsetBase.h + * \file Inset.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -54,7 +54,7 @@ namespace graphics { class PreviewLoader; } // everything storing large quantities of insets. Mathed e.g. would // suffer. -class InsetBase { +class Inset { public: /// typedef ptrdiff_t difference_type; @@ -70,9 +70,9 @@ public: typedef size_t col_type; /// virtual base class destructor - virtual ~InsetBase() {} + virtual ~Inset() {} /// replicate ourselves - std::auto_ptr clone() const; + std::auto_ptr clone() const; /// identification as math inset virtual InsetMath * asInsetMath() { return 0; } @@ -93,9 +93,9 @@ public: * - A request that is disabled in getStatus() does not need to * appear in doDispatch(). It is guaranteed that doDispatch() * is never called with this request. - * - A few requests are en- or disabled in InsetBase::getStatus(). + * - A few requests are en- or disabled in Inset::getStatus(). * These need to be handled in the doDispatch() methods of the - * derived insets, since InsetBase::doDispatch() has not enough + * derived insets, since Inset::doDispatch() has not enough * information to handle them. * - LFUN_MOUSE_* need not to be handled in getStatus(), because these * are dispatched directly @@ -106,7 +106,7 @@ public: /// cursor enters virtual void edit(Cursor & cur, bool left); /// cursor enters - virtual InsetBase * editXY(Cursor & cur, int x, int y); + virtual Inset * editXY(Cursor & cur, int x, int y); /// compute the size of the object returned in dim /// \retval true if metrics changed. @@ -249,7 +249,7 @@ public: /** This is not quite the correct place for this enum. I think the correct would be to let each subclass of Inset declare - its own enum code. Actually the notion of an InsetBase::Code + its own enum code. Actually the notion of an Inset::Code should be avoided, but I am not sure how this could be done in a cleaner way. */ enum Code { @@ -365,7 +365,7 @@ public: virtual bool hasFixedWidth() const { return false; } /// - virtual docstring getInsetName() const; + virtual docstring insetName() const; /// used to toggle insets /// is the inset open? /// should this inset be handled like a normal charater @@ -464,8 +464,8 @@ public: enum { TEXT_TO_INSET_OFFSET = 4 }; protected: - InsetBase(); - InsetBase(InsetBase const & i); + Inset(); + Inset(Inset const & i); /** The real dispatcher. * Gets normally called from Cursor::dispatch(). Cursor::dispatch() * assumes the common case of 'LFUN handled, need update'. @@ -482,7 +482,7 @@ protected: /// Cached dimensions of the inset. mutable Dimension dim_; private: - virtual std::auto_ptr doClone() const = 0; + virtual std::auto_ptr doClone() const = 0; /** We store the Color::color value as an int to get Color.h out * of the header file. */ @@ -494,25 +494,25 @@ private: * returns true if pointer argument is valid * and points to an editable inset */ -bool isEditableInset(InsetBase const * inset); +bool isEditableInset(Inset const * inset); /** * returns true if pointer argument is valid * and points to a highly editable inset */ -bool isHighlyEditableInset(InsetBase const * inset); +bool isHighlyEditableInset(Inset const * inset); -/** \c InsetBase_code is a wrapper for InsetBase::Code. +/** \c Inset_code is a wrapper for Inset::Code. * It can be forward-declared and passed as a function argument without - * having to expose InsetBase.h. + * having to expose Inset.h. */ -class InsetBase_code { - InsetBase::Code val_; +class Inset_code { + Inset::Code val_; public: - InsetBase_code(InsetBase::Code val) : val_(val) {} - operator InsetBase::Code() const { return val_; } + Inset_code(Inset::Code val) : val_(val) {} + operator Inset::Code() const { return val_; } }; diff --git a/src/insets/InsetBibitem.cpp b/src/insets/InsetBibitem.cpp index e2747abfc0..a3a970c280 100644 --- a/src/insets/InsetBibitem.cpp +++ b/src/insets/InsetBibitem.cpp @@ -46,11 +46,11 @@ InsetBibitem::InsetBibitem(InsetCommandParams const & p) } -auto_ptr InsetBibitem::doClone() const +auto_ptr InsetBibitem::doClone() const { auto_ptr b(new InsetBibitem(params())); b->setCounter(counter); - return auto_ptr(b); + return auto_ptr(b); } @@ -67,7 +67,7 @@ void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd) } if (p["key"] != params()["key"]) cur.bv().buffer()->changeRefsIfUnique(params()["key"], - p["key"], InsetBase::CITE_CODE); + p["key"], Inset::CITE_CODE); setParams(p); } diff --git a/src/insets/InsetBibitem.h b/src/insets/InsetBibitem.h index 700cd4edd6..6dfaf2cc22 100644 --- a/src/insets/InsetBibitem.h +++ b/src/insets/InsetBibitem.h @@ -34,7 +34,7 @@ public: /// EDITABLE editable() const { return IS_EDITABLE; } /// - InsetBase::Code lyxCode() const { return InsetBase::BIBITEM_CODE; } + Inset::Code lyxCode() const { return Inset::BIBITEM_CODE; } /// void setCounter(int); /// @@ -47,7 +47,7 @@ protected: /// virtual void doDispatch(Cursor & cur, FuncRequest & cmd); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// int counter; diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index 9bd9f1d79d..20c75556c5 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -76,9 +76,9 @@ InsetBibtex::InsetBibtex(InsetCommandParams const & p) {} -std::auto_ptr InsetBibtex::doClone() const +std::auto_ptr InsetBibtex::doClone() const { - return std::auto_ptr(new InsetBibtex(*this)); + return std::auto_ptr(new InsetBibtex(*this)); } diff --git a/src/insets/InsetBibtex.h b/src/insets/InsetBibtex.h index 0c47462f33..b9c97f08c6 100644 --- a/src/insets/InsetBibtex.h +++ b/src/insets/InsetBibtex.h @@ -32,7 +32,7 @@ public: /// EDITABLE editable() const { return IS_EDITABLE; } /// - InsetBase::Code lyxCode() const { return InsetBase::BIBTEX_CODE; } + Inset::Code lyxCode() const { return Inset::BIBTEX_CODE; } /// bool display() const { return true; } /// @@ -51,7 +51,7 @@ public: protected: virtual void doDispatch(Cursor & cur, FuncRequest & cmd); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index bb3090b4dd..f429ec40bf 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -114,9 +114,9 @@ InsetBox::~InsetBox() } -auto_ptr InsetBox::doClone() const +auto_ptr InsetBox::doClone() const { - return auto_ptr(new InsetBox(*this)); + return auto_ptr(new InsetBox(*this)); } diff --git a/src/insets/InsetBox.h b/src/insets/InsetBox.h index 094bf191c2..9f18e20c79 100644 --- a/src/insets/InsetBox.h +++ b/src/insets/InsetBox.h @@ -64,7 +64,7 @@ public: /// virtual docstring const editMessage() const; /// - InsetBase::Code lyxCode() const { return InsetBase::BOX_CODE; } + Inset::Code lyxCode() const { return Inset::BOX_CODE; } /// void write(Buffer const &, std::ostream &) const; /// @@ -110,11 +110,11 @@ protected: /// Is the width forced to some value? virtual bool hasFixedWidth() const; /// - virtual docstring getInsetName() const { return from_ascii("Box"); } + virtual docstring insetName() const { return from_ascii("Box"); } private: friend class InsetBoxParams; - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// used by the constructors void init(); @@ -128,7 +128,7 @@ public: /// InsetBoxMailer(InsetBox & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp index 8738bae0fd..e2f186d86a 100644 --- a/src/insets/InsetBranch.cpp +++ b/src/insets/InsetBranch.cpp @@ -64,9 +64,9 @@ InsetBranch::~InsetBranch() } -auto_ptr InsetBranch::doClone() const +auto_ptr InsetBranch::doClone() const { - return auto_ptr(new InsetBranch(*this)); + return auto_ptr(new InsetBranch(*this)); } diff --git a/src/insets/InsetBranch.h b/src/insets/InsetBranch.h index a116448630..f6f90dbe98 100644 --- a/src/insets/InsetBranch.h +++ b/src/insets/InsetBranch.h @@ -45,7 +45,7 @@ public: /// virtual docstring const editMessage() const; /// - InsetBase::Code lyxCode() const { return InsetBase::BRANCH_CODE; } + Inset::Code lyxCode() const { return Inset::BRANCH_CODE; } /// void write(Buffer const &, std::ostream &) const; /// @@ -85,11 +85,11 @@ protected: /// virtual void doDispatch(Cursor & cur, FuncRequest & cmd); /// - docstring getInsetName() const { return from_ascii("Branch"); } + docstring insetName() const { return from_ascii("Branch"); } private: friend class InsetBranchParams; - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// used by the constructors void init(); @@ -103,7 +103,7 @@ public: /// InsetBranchMailer(InsetBranch & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp index be9d77efd7..101647052e 100644 --- a/src/insets/InsetCaption.cpp +++ b/src/insets/InsetCaption.cpp @@ -181,14 +181,14 @@ void InsetCaption::edit(Cursor & cur, bool left) } -InsetBase * InsetCaption::editXY(Cursor & cur, int x, int y) +Inset * InsetCaption::editXY(Cursor & cur, int x, int y) { cur.push(*this); return InsetText::editXY(cur, x, y); } -bool InsetCaption::insetAllowed(InsetBase::Code code) const +bool InsetCaption::insetAllowed(Inset::Code code) const { switch (code) { case FLOAT_CODE: @@ -282,9 +282,9 @@ void InsetCaption::computeFullLabel() const } -auto_ptr InsetCaption::doClone() const +auto_ptr InsetCaption::doClone() const { - return auto_ptr(new InsetCaption(*this)); + return auto_ptr(new InsetCaption(*this)); } diff --git a/src/insets/InsetCaption.h b/src/insets/InsetCaption.h index a7d957c508..8ea685edbe 100644 --- a/src/insets/InsetCaption.h +++ b/src/insets/InsetCaption.h @@ -35,7 +35,7 @@ public: /// virtual bool neverIndent(Buffer const &) const { return true; } /// - virtual InsetBase::Code lyxCode() const; + virtual Inset::Code lyxCode() const; /// virtual docstring const editMessage() const; /// @@ -52,9 +52,9 @@ public: /// virtual void edit(Cursor & cur, bool left); /// - virtual InsetBase * editXY(Cursor & cur, int x, int y); + virtual Inset * editXY(Cursor & cur, int x, int y); /// - bool insetAllowed(InsetBase::Code code) const; + bool insetAllowed(Inset::Code code) const; /// virtual bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const; /// @@ -85,7 +85,7 @@ private: /// void computeFullLabel() const; /// - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// mutable docstring full_label_; /// @@ -109,7 +109,7 @@ bool InsetCaption::display() const inline -InsetBase::Code InsetCaption::lyxCode() const +Inset::Code InsetCaption::lyxCode() const { return CAPTION_CODE; } diff --git a/src/insets/InsetCharStyle.cpp b/src/insets/InsetCharStyle.cpp index c25e345510..3b040286ec 100644 --- a/src/insets/InsetCharStyle.cpp +++ b/src/insets/InsetCharStyle.cpp @@ -82,9 +82,9 @@ InsetCharStyle::InsetCharStyle(InsetCharStyle const & in) } -auto_ptr InsetCharStyle::doClone() const +auto_ptr InsetCharStyle::doClone() const { - return auto_ptr(new InsetCharStyle(*this)); + return auto_ptr(new InsetCharStyle(*this)); } diff --git a/src/insets/InsetCharStyle.h b/src/insets/InsetCharStyle.h index f049a09b2e..970cdabcd9 100644 --- a/src/insets/InsetCharStyle.h +++ b/src/insets/InsetCharStyle.h @@ -53,7 +53,7 @@ public: /// InsetCharStyle(BufferParams const &, CharStyles::iterator); /// - docstring getInsetName() const { return from_ascii("CharStyle"); } + docstring insetName() const { return from_ascii("CharStyle"); } /// Is this character style defined in the document's textclass? /// May be wrong after textclass change or paste from another document bool undefined() const; @@ -64,7 +64,7 @@ public: /// virtual docstring const editMessage() const; /// - InsetBase::Code lyxCode() const { return InsetBase::CHARSTYLE_CODE; } + Inset::Code lyxCode() const { return Inset::CHARSTYLE_CODE; } /// void write(Buffer const &, std::ostream &) const; /// @@ -106,7 +106,7 @@ protected: private: friend class InsetCharStyleParams; - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// used by the constructors void init(); diff --git a/src/insets/InsetCitation.h b/src/insets/InsetCitation.h index 5b6a24964e..032ed379ef 100644 --- a/src/insets/InsetCitation.h +++ b/src/insets/InsetCitation.h @@ -33,7 +33,7 @@ public: /// EDITABLE editable() const { return IS_EDITABLE; } /// - InsetBase::Code lyxCode() const { return InsetBase::CITE_CODE; } + Inset::Code lyxCode() const { return Inset::CITE_CODE; } /// int latex(Buffer const &, odocstream &, OutputParams const &) const; @@ -52,9 +52,9 @@ public: void replaceContents(std::string const & from, std::string const & to); private: - virtual std::auto_ptr doClone() const + virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetCitation(params())); + return std::auto_ptr(new InsetCitation(params())); } /// This function does the donkey work of creating the pretty label diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 9d085a26e7..02b7a5d06c 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -257,7 +257,7 @@ void InsetCollapsable::cursorPos(BufferView const & bv, } -InsetBase::EDITABLE InsetCollapsable::editable() const +Inset::EDITABLE InsetCollapsable::editable() const { return status() != Collapsed ? HIGHLY_EDITABLE : IS_EDITABLE; } @@ -304,7 +304,7 @@ void InsetCollapsable::edit(Cursor & cur, bool left) } -InsetBase * InsetCollapsable::editXY(Cursor & cur, int x, int y) +Inset * InsetCollapsable::editXY(Cursor & cur, int x, int y) { //lyxerr << "InsetCollapsable: edit xy" << endl; if (status() == Collapsed || (button_dim.contains(x, y) && status() != Inlined)) diff --git a/src/insets/InsetCollapsable.h b/src/insets/InsetCollapsable.h index 5166d19014..c14cadfc73 100644 --- a/src/insets/InsetCollapsable.h +++ b/src/insets/InsetCollapsable.h @@ -14,7 +14,7 @@ #ifndef INSETCOLLAPSABLE_H #define INSETCOLLAPSABLE_H -#include "InsetBase.h" +#include "Inset.h" #include "InsetText.h" #include "Box.h" @@ -44,7 +44,7 @@ public: /// InsetCollapsable(InsetCollapsable const & rhs); /// - docstring getInsetName() const { return from_ascii("Collapsable"); } + docstring insetName() const { return from_ascii("Collapsable"); } /// void read(Buffer const &, Lexer &); /// @@ -97,7 +97,7 @@ protected: /// void edit(Cursor & cur, bool left); /// - InsetBase * editXY(Cursor & cur, int x, int y); + Inset * editXY(Cursor & cur, int x, int y); /// void setInlined() { status_ = Inlined; } /// @@ -128,7 +128,7 @@ private: }; // A helper function that pushes the cursor out of the inset. -void leaveInset(Cursor & cur, InsetBase const & in); +void leaveInset(Cursor & cur, Inset const & in); } // namespace lyx diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index 267ecb7d5f..ce6abb9f26 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -138,7 +138,7 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd) } default: - InsetBase::doDispatch(cur, cmd); + Inset::doDispatch(cur, cmd); break; } @@ -160,7 +160,7 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd, status.enabled(true); return true; default: - return InsetBase::getStatus(cur, cmd, status); + return Inset::getStatus(cur, cmd, status); } } diff --git a/src/insets/InsetCommand.h b/src/insets/InsetCommand.h index e3662b872d..a1525146a9 100644 --- a/src/insets/InsetCommand.h +++ b/src/insets/InsetCommand.h @@ -13,7 +13,7 @@ #ifndef INSET_LATEXCOMMAND_H #define INSET_LATEXCOMMAND_H -#include "InsetBase.h" +#include "Inset.h" #include "InsetCommandParams.h" #include "RenderButton.h" #include "MailInset.h" @@ -31,7 +31,7 @@ namespace lyx { */ /// -class InsetCommand : public InsetBase { +class InsetCommand : public Inset { public: /// InsetCommand(InsetCommandParams const &, std::string const & mailer_name); @@ -54,7 +54,7 @@ public: /// int docbook(Buffer const &, odocstream &, OutputParams const & runparams) const; /// - InsetBase::Code lyxCode() const { return InsetBase::NO_CODE; } + Inset::Code lyxCode() const { return Inset::NO_CODE; } /// InsetCommandParams const & params() const { return p_; } @@ -125,7 +125,7 @@ public: /// InsetCommandMailer(std::string const & name, InsetCommand & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/InsetERT.cpp b/src/insets/InsetERT.cpp index 975190c531..ba4ac6d049 100644 --- a/src/insets/InsetERT.cpp +++ b/src/insets/InsetERT.cpp @@ -77,9 +77,9 @@ InsetERT::InsetERT(InsetERT const & in) } -auto_ptr InsetERT::doClone() const +auto_ptr InsetERT::doClone() const { - return auto_ptr(new InsetERT(*this)); + return auto_ptr(new InsetERT(*this)); } @@ -388,7 +388,7 @@ void InsetERT::setButtonLabel() } -bool InsetERT::insetAllowed(InsetBase::Code /* code */) const +bool InsetERT::insetAllowed(Inset::Code /* code */) const { return false; } diff --git a/src/insets/InsetERT.h b/src/insets/InsetERT.h index 9598754853..99875c97cf 100644 --- a/src/insets/InsetERT.h +++ b/src/insets/InsetERT.h @@ -42,9 +42,9 @@ public: /// ~InsetERT(); /// - InsetBase::Code lyxCode() const { return InsetBase::ERT_CODE; } + Inset::Code lyxCode() const { return Inset::ERT_CODE; } /// - docstring getInsetName() const { return from_ascii("ERT"); } + docstring insetName() const { return from_ascii("ERT"); } /// void write(Buffer const & buf, std::ostream & os) const; /// @@ -52,7 +52,7 @@ public: /// virtual docstring const editMessage() const; /// - bool insetAllowed(InsetBase::Code code) const; + bool insetAllowed(Inset::Code code) const; /// int latex(Buffer const &, odocstream &, OutputParams const &) const; @@ -83,7 +83,7 @@ protected: /// bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// void init(); /// @@ -98,7 +98,7 @@ public: /// InsetERTMailer(InsetERT & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/InsetEnvironment.cpp b/src/insets/InsetEnvironment.cpp index 318c8992c2..c3a45c6043 100644 --- a/src/insets/InsetEnvironment.cpp +++ b/src/insets/InsetEnvironment.cpp @@ -41,15 +41,15 @@ InsetEnvironment::InsetEnvironment(InsetEnvironment const & in) {} -auto_ptr InsetEnvironment::doClone() const +auto_ptr InsetEnvironment::doClone() const { - return auto_ptr(new InsetEnvironment(*this)); + return auto_ptr(new InsetEnvironment(*this)); } void InsetEnvironment::write(Buffer const & buf, ostream & os) const { - os << "Environment " << to_utf8(getInsetName()) << "\n"; + os << "Environment " << to_utf8(insetName()) << "\n"; InsetText::write(buf, os); } @@ -62,7 +62,7 @@ void InsetEnvironment::read(Buffer const & buf, Lexer & lex) docstring const InsetEnvironment::editMessage() const { - return _("Opened Environment Inset: ") + getInsetName(); + return _("Opened Environment Inset: ") + insetName(); } @@ -83,7 +83,7 @@ int InsetEnvironment::latex(Buffer const & buf, odocstream & os, int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os, OutputParams const & runparams) const { - os << '[' << to_utf8(getInsetName()) << ":\n"; + os << '[' << to_utf8(insetName()) << ":\n"; InsetText::plaintext(buf, os, runparams); os << "\n]"; diff --git a/src/insets/InsetEnvironment.h b/src/insets/InsetEnvironment.h index 72e6f4755b..14d944126a 100644 --- a/src/insets/InsetEnvironment.h +++ b/src/insets/InsetEnvironment.h @@ -23,13 +23,13 @@ public: /// InsetEnvironment(BufferParams const &, std::string const & name); /// - docstring getInsetName() const { return name_; } + docstring insetName() const { return name_; } /// void write(Buffer const & buf, std::ostream & os) const; /// void read(Buffer const & buf, Lexer & lex); /// - InsetBase::Code lyxCode() const { return InsetBase::ENVIRONMENT_CODE; } + Inset::Code lyxCode() const { return Inset::ENVIRONMENT_CODE; } /// int latex(Buffer const &, odocstream &, OutputParams const &) const; @@ -39,7 +39,7 @@ public: /// virtual docstring const editMessage() const; /// - InsetBase::EDITABLE editable() const { return HIGHLY_EDITABLE; } + Inset::EDITABLE editable() const { return HIGHLY_EDITABLE; } /// LyXLayout_ptr const & layout() const; /** returns true if, when outputing LaTeX, font changes should @@ -49,7 +49,7 @@ public: protected: InsetEnvironment(InsetEnvironment const &); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// the layout LyXLayout_ptr layout_; /// diff --git a/src/insets/InsetExternal.cpp b/src/insets/InsetExternal.cpp index 60f4b25b7e..0cffe1a8c8 100644 --- a/src/insets/InsetExternal.cpp +++ b/src/insets/InsetExternal.cpp @@ -400,16 +400,16 @@ InsetExternal::InsetExternal() InsetExternal::InsetExternal(InsetExternal const & other) - : InsetBase(other), + : Inset(other), boost::signals::trackable(), params_(other.params_), renderer_(other.renderer_->clone(this)) {} -auto_ptr InsetExternal::doClone() const +auto_ptr InsetExternal::doClone() const { - return auto_ptr(new InsetExternal(*this)); + return auto_ptr(new InsetExternal(*this)); } @@ -454,7 +454,7 @@ void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd) break; default: - InsetBase::doDispatch(cur, cmd); + Inset::doDispatch(cur, cmd); } } @@ -471,7 +471,7 @@ bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd, return true; default: - return InsetBase::getStatus(cur, cmd, flag); + return Inset::getStatus(cur, cmd, flag); } } diff --git a/src/insets/InsetExternal.h b/src/insets/InsetExternal.h index 155cf82d66..96e9ebab42 100644 --- a/src/insets/InsetExternal.h +++ b/src/insets/InsetExternal.h @@ -12,7 +12,7 @@ #ifndef INSET_EXTERNAL_H #define INSET_EXTERNAL_H -#include "InsetBase.h" +#include "Inset.h" #include "ExternalTransforms.h" #include "support/FileName.h" @@ -104,14 +104,14 @@ private: class RenderBase; /// -class InsetExternal : public InsetBase, public boost::signals::trackable +class InsetExternal : public Inset, public boost::signals::trackable { public: InsetExternal(); /// virtual ~InsetExternal(); /// - virtual InsetBase::Code lyxCode() const { return EXTERNAL_CODE; } + virtual Inset::Code lyxCode() const { return EXTERNAL_CODE; } /// virtual EDITABLE editable() const { return IS_EDITABLE; } @@ -153,7 +153,7 @@ protected: /// virtual void doDispatch(Cursor & cur, FuncRequest & cmd); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /** This method is connected to the graphics loader, so we are * informed when the image has been loaded. @@ -177,7 +177,7 @@ public: /// InsetExternalMailer(InsetExternal & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index 61c7411b6e..2222e77a15 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -266,9 +266,9 @@ void InsetFloat::validate(LaTeXFeatures & features) const } -auto_ptr InsetFloat::doClone() const +auto_ptr InsetFloat::doClone() const { - return auto_ptr(new InsetFloat(*this)); + return auto_ptr(new InsetFloat(*this)); } @@ -350,11 +350,11 @@ int InsetFloat::docbook(Buffer const & buf, odocstream & os, } -bool InsetFloat::insetAllowed(InsetBase::Code code) const +bool InsetFloat::insetAllowed(Inset::Code code) const { - return code != InsetBase::FLOAT_CODE - && code != InsetBase::FOOT_CODE - && code != InsetBase::MARGIN_CODE; + return code != Inset::FLOAT_CODE + && code != Inset::FOOT_CODE + && code != Inset::MARGIN_CODE; } diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h index fc95581e3b..1c53db3f54 100644 --- a/src/insets/InsetFloat.h +++ b/src/insets/InsetFloat.h @@ -49,7 +49,7 @@ public: /// ~InsetFloat(); /// - docstring getInsetName() const { return name_; } + docstring insetName() const { return name_; } /// void write(Buffer const & buf, std::ostream & os) const; /// @@ -57,7 +57,7 @@ public: /// void validate(LaTeXFeatures & features) const; /// - InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; } + Inset::Code lyxCode() const { return Inset::FLOAT_CODE; } /// virtual bool wide() const { return false; } /// @@ -72,7 +72,7 @@ public: /// virtual docstring const editMessage() const; /// - bool insetAllowed(InsetBase::Code) const; + bool insetAllowed(Inset::Code) const; /** returns true if, when outputing LaTeX, font changes should be closed before generating this inset. This is needed for insets that may contain several paragraphs */ @@ -93,7 +93,7 @@ protected: virtual void doDispatch(Cursor & cur, FuncRequest & cmd); private: /// - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// InsetFloatParams params_; /// @@ -106,7 +106,7 @@ public: /// InsetFloatMailer(InsetFloat & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/InsetFloatList.cpp b/src/insets/InsetFloatList.cpp index da5d0f6358..54711a87d0 100644 --- a/src/insets/InsetFloatList.cpp +++ b/src/insets/InsetFloatList.cpp @@ -60,9 +60,9 @@ docstring const InsetFloatList::getScreenLabel(Buffer const & buf) const } -InsetBase::Code InsetFloatList::lyxCode() const +Inset::Code InsetFloatList::lyxCode() const { - return InsetBase::FLOAT_LIST_CODE; + return Inset::FLOAT_LIST_CODE; } diff --git a/src/insets/InsetFloatList.h b/src/insets/InsetFloatList.h index 069bd21c29..3c0d0b62c5 100644 --- a/src/insets/InsetFloatList.h +++ b/src/insets/InsetFloatList.h @@ -31,7 +31,7 @@ public: /// EDITABLE editable() const { return IS_EDITABLE; } /// - InsetBase::Code lyxCode() const; + Inset::Code lyxCode() const; /// bool display() const { return true; } /// @@ -50,9 +50,9 @@ public: /// void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const + virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetFloatList(to_ascii(getParam("type")))); + return std::auto_ptr(new InsetFloatList(to_ascii(getParam("type")))); } }; diff --git a/src/insets/InsetFoot.cpp b/src/insets/InsetFoot.cpp index 6379cc0e9a..21d32ac8ac 100644 --- a/src/insets/InsetFoot.cpp +++ b/src/insets/InsetFoot.cpp @@ -45,9 +45,9 @@ InsetFoot::InsetFoot(InsetFoot const & in) } -auto_ptr InsetFoot::doClone() const +auto_ptr InsetFoot::doClone() const { - return auto_ptr(new InsetFoot(*this)); + return auto_ptr(new InsetFoot(*this)); } diff --git a/src/insets/InsetFoot.h b/src/insets/InsetFoot.h index 725f3ef2c5..c4ece96cec 100644 --- a/src/insets/InsetFoot.h +++ b/src/insets/InsetFoot.h @@ -26,9 +26,9 @@ public: /// InsetFoot(BufferParams const &); /// - InsetBase::Code lyxCode() const { return InsetBase::FOOT_CODE; } + Inset::Code lyxCode() const { return Inset::FOOT_CODE; } /// - docstring getInsetName() const { return from_ascii("Foot"); } + docstring insetName() const { return from_ascii("Foot"); } /// int latex(Buffer const &, odocstream &, OutputParams const &) const; @@ -43,7 +43,7 @@ public: protected: InsetFoot(InsetFoot const &); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/insets/InsetFootlike.cpp b/src/insets/InsetFootlike.cpp index eee2c8c693..7c9fcb204c 100644 --- a/src/insets/InsetFootlike.cpp +++ b/src/insets/InsetFootlike.cpp @@ -67,15 +67,15 @@ void InsetFootlike::draw(PainterInfo & pi, int x, int y) const void InsetFootlike::write(Buffer const & buf, std::ostream & os) const { - os << to_utf8(getInsetName()) << "\n"; + os << to_utf8(insetName()) << "\n"; InsetCollapsable::write(buf, os); } -bool InsetFootlike::insetAllowed(InsetBase::Code code) const +bool InsetFootlike::insetAllowed(Inset::Code code) const { - if (code == InsetBase::FOOT_CODE || code == InsetBase::MARGIN_CODE - || code == InsetBase::FLOAT_CODE) + if (code == Inset::FOOT_CODE || code == Inset::MARGIN_CODE + || code == Inset::FLOAT_CODE) return false; return InsetCollapsable::insetAllowed(code); } diff --git a/src/insets/InsetFootlike.h b/src/insets/InsetFootlike.h index bc1ce1ab91..1a30aff2db 100644 --- a/src/insets/InsetFootlike.h +++ b/src/insets/InsetFootlike.h @@ -33,7 +33,7 @@ public: /// void write(Buffer const & buf, std::ostream & os) const; /// - bool insetAllowed(InsetBase::Code) const; + bool insetAllowed(Inset::Code) const; /** returns true if, when outputing LaTeX, font changes should be closed before generating this inset. This is needed for insets that may contain several paragraphs */ diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index 40550f5207..c4aaf12d1f 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -153,7 +153,7 @@ InsetGraphics::InsetGraphics() InsetGraphics::InsetGraphics(InsetGraphics const & ig) - : InsetBase(ig), + : Inset(ig), boost::signals::trackable(), graphic_label(sgml::uniqueID(from_ascii("graph"))), graphic_(new RenderGraphic(*ig.graphic_, this)) @@ -162,9 +162,9 @@ InsetGraphics::InsetGraphics(InsetGraphics const & ig) } -auto_ptr InsetGraphics::doClone() const +auto_ptr InsetGraphics::doClone() const { - return auto_ptr(new InsetGraphics(*this)); + return auto_ptr(new InsetGraphics(*this)); } @@ -205,7 +205,7 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd) break; default: - InsetBase::doDispatch(cur, cmd); + Inset::doDispatch(cur, cmd); break; } } @@ -222,7 +222,7 @@ bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd, return true; default: - return InsetBase::getStatus(cur, cmd, flag); + return Inset::getStatus(cur, cmd, flag); } } @@ -249,7 +249,7 @@ void InsetGraphics::draw(PainterInfo & pi, int x, int y) const } -InsetBase::EDITABLE InsetGraphics::editable() const +Inset::EDITABLE InsetGraphics::editable() const { return IS_EDITABLE; } diff --git a/src/insets/InsetGraphics.h b/src/insets/InsetGraphics.h index 08a3f6406e..4e30dfb0e7 100644 --- a/src/insets/InsetGraphics.h +++ b/src/insets/InsetGraphics.h @@ -13,7 +13,7 @@ #ifndef INSET_GRAPHICS_H #define INSET_GRAPHICS_H -#include "InsetBase.h" +#include "Inset.h" #include "InsetGraphicsParams.h" #include "MailInset.h" @@ -28,7 +28,7 @@ class RenderGraphic; class LaTeXFeatures; /// -class InsetGraphics : public InsetBase, public boost::signals::trackable { +class InsetGraphics : public Inset, public boost::signals::trackable { public: /// InsetGraphics(); @@ -62,7 +62,7 @@ public: void validate(LaTeXFeatures & features) const; /// returns LyX code associated with the inset. Used for TOC, ...) - InsetBase::Code lyxCode() const { return InsetBase::GRAPHICS_CODE; } + Inset::Code lyxCode() const { return Inset::GRAPHICS_CODE; } /** Set the inset parameters, used by the GUIndependent dialog. Return true of new params are different from what was so far. @@ -86,7 +86,7 @@ protected: private: friend class InsetGraphicsMailer; - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// Read the inset native format void readInsetGraphics(Lexer & lex, std::string const & bufpath); @@ -118,7 +118,7 @@ public: /// InsetGraphicsMailer(InsetGraphics & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/InsetHFill.cpp b/src/insets/InsetHFill.cpp index c2e386d458..681b3f1a0f 100644 --- a/src/insets/InsetHFill.cpp +++ b/src/insets/InsetHFill.cpp @@ -26,9 +26,9 @@ InsetHFill::InsetHFill() {} -std::auto_ptr InsetHFill::doClone() const +std::auto_ptr InsetHFill::doClone() const { - return std::auto_ptr(new InsetHFill); + return std::auto_ptr(new InsetHFill); } diff --git a/src/insets/InsetHFill.h b/src/insets/InsetHFill.h index a1d777b706..ec1eac8118 100644 --- a/src/insets/InsetHFill.h +++ b/src/insets/InsetHFill.h @@ -27,7 +27,7 @@ public: /// docstring const getScreenLabel(Buffer const &) const; /// - InsetBase::Code lyxCode() const { return InsetBase::HFILL_CODE; } + Inset::Code lyxCode() const { return Inset::HFILL_CODE; } /// int plaintext(Buffer const &, odocstream &, OutputParams const &) const; @@ -42,7 +42,7 @@ public: // a line separator)? bool isSpace() const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 995e0da61c..0f3776447c 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -104,7 +104,7 @@ InsetInclude::InsetInclude(InsetCommandParams const & p) InsetInclude::InsetInclude(InsetInclude const & other) - : InsetBase(other), + : Inset(other), params_(other.params_), include_label(other.include_label), preview_(new RenderMonitoredPreview(this)), @@ -144,7 +144,7 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd) break; default: - InsetBase::doDispatch(cur, cmd); + Inset::doDispatch(cur, cmd); break; } } @@ -161,7 +161,7 @@ bool InsetInclude::getStatus(Cursor & cur, FuncRequest const & cmd, return true; default: - return InsetBase::getStatus(cur, cmd, flag); + return Inset::getStatus(cur, cmd, flag); } } @@ -243,9 +243,9 @@ void InsetInclude::set(InsetCommandParams const & p, Buffer const & buffer) } -auto_ptr InsetInclude::doClone() const +auto_ptr InsetInclude::doClone() const { - return auto_ptr(new InsetInclude(*this)); + return auto_ptr(new InsetInclude(*this)); } diff --git a/src/insets/InsetInclude.h b/src/insets/InsetInclude.h index cc4acc5a82..88bbc2ddfe 100644 --- a/src/insets/InsetInclude.h +++ b/src/insets/InsetInclude.h @@ -12,7 +12,7 @@ #ifndef INSET_INCLUDE_H #define INSET_INCLUDE_H -#include "InsetBase.h" +#include "Inset.h" #include "InsetCommandParams.h" #include "RenderButton.h" #include "MailInset.h" @@ -30,7 +30,7 @@ class RenderMonitoredPreview; /// for including tex/lyx files -class InsetInclude : public InsetBase { +class InsetInclude : public Inset { public: /// InsetInclude(InsetCommandParams const &); @@ -47,7 +47,7 @@ public: InsetCommandParams const & params() const; /// - InsetBase::Code lyxCode() const { return InsetBase::INCLUDE_CODE; } + Inset::Code lyxCode() const { return Inset::INCLUDE_CODE; } /** Fills \c list * \param buffer the Buffer containing this inset. * \param list the list of labels in the child buffer. @@ -104,7 +104,7 @@ protected: /// virtual void doDispatch(Cursor & cur, FuncRequest & cmd); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /** Slot receiving a signal that the external file has changed * and the preview should be regenerated. @@ -141,7 +141,7 @@ public: /// InsetIncludeMailer(InsetInclude & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index b43e183116..6ac5cb54eb 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -53,9 +53,9 @@ int InsetIndex::docbook(Buffer const &, odocstream & os, } -InsetBase::Code InsetIndex::lyxCode() const +Inset::Code InsetIndex::lyxCode() const { - return InsetBase::INDEX_CODE; + return Inset::INDEX_CODE; } @@ -82,9 +82,9 @@ void InsetPrintIndex::validate(LaTeXFeatures & features) const } -InsetBase::Code InsetPrintIndex::lyxCode() const +Inset::Code InsetPrintIndex::lyxCode() const { - return InsetBase::INDEX_PRINT_CODE; + return Inset::INDEX_PRINT_CODE; } diff --git a/src/insets/InsetIndex.h b/src/insets/InsetIndex.h index 9a60c5d757..1fe5da82fb 100644 --- a/src/insets/InsetIndex.h +++ b/src/insets/InsetIndex.h @@ -31,13 +31,13 @@ public: /// EDITABLE editable() const { return IS_EDITABLE; } /// - InsetBase::Code lyxCode() const; + Inset::Code lyxCode() const; /// int docbook(Buffer const &, odocstream &, OutputParams const &) const; private: - virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetIndex(params())); + virtual std::auto_ptr doClone() const { + return std::auto_ptr(new InsetIndex(params())); } }; @@ -51,14 +51,14 @@ public: /// EDITABLE editable() const { return NOT_EDITABLE; } /// - InsetBase::Code lyxCode() const; + Inset::Code lyxCode() const; /// bool display() const { return true; } /// docstring const getScreenLabel(Buffer const &) const; private: - virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetPrintIndex(params())); + virtual std::auto_ptr doClone() const { + return std::auto_ptr(new InsetPrintIndex(params())); } }; diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp index 84a44c7eef..8ecd0e56e4 100644 --- a/src/insets/InsetLabel.cpp +++ b/src/insets/InsetLabel.cpp @@ -41,9 +41,9 @@ InsetLabel::InsetLabel(InsetCommandParams const & p) {} -std::auto_ptr InsetLabel::doClone() const +std::auto_ptr InsetLabel::doClone() const { - return std::auto_ptr(new InsetLabel(params())); + return std::auto_ptr(new InsetLabel(params())); } @@ -73,7 +73,7 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd) } if (p["name"] != params()["name"]) cur.bv().buffer()->changeRefsIfUnique(params()["name"], - p["name"], InsetBase::REF_CODE); + p["name"], Inset::REF_CODE); setParams(p); break; } diff --git a/src/insets/InsetLabel.h b/src/insets/InsetLabel.h index 746a0cbb4a..b5df459e1b 100644 --- a/src/insets/InsetLabel.h +++ b/src/insets/InsetLabel.h @@ -26,7 +26,7 @@ public: /// EDITABLE editable() const { return IS_EDITABLE; } /// - InsetBase::Code lyxCode() const { return InsetBase::LABEL_CODE; } + Inset::Code lyxCode() const { return Inset::LABEL_CODE; } /// Appends \c list with this label void getLabelList(Buffer const &, std::vector & list) const; /// @@ -38,7 +38,7 @@ public: protected: virtual void doDispatch(Cursor & cur, FuncRequest & cmd); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/insets/InsetLine.h b/src/insets/InsetLine.h index 0541411ce2..77123ac049 100644 --- a/src/insets/InsetLine.h +++ b/src/insets/InsetLine.h @@ -13,17 +13,17 @@ #define INSET_LINE_H -#include "InsetBase.h" +#include "Inset.h" namespace lyx { -class InsetLine : public InsetBase { +class InsetLine : public Inset { public: InsetLine() {} - InsetBase::Code lyxCode() const { return InsetBase::LINE_CODE; } + Inset::Code lyxCode() const { return Inset::LINE_CODE; } bool metrics(MetricsInfo &, Dimension &) const; @@ -48,9 +48,9 @@ public: /// void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const + virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetLine); + return std::auto_ptr(new InsetLine); } }; diff --git a/src/insets/InsetMarginal.cpp b/src/insets/InsetMarginal.cpp index 83a42f287a..aa0214f22f 100644 --- a/src/insets/InsetMarginal.cpp +++ b/src/insets/InsetMarginal.cpp @@ -41,9 +41,9 @@ InsetMarginal::InsetMarginal(InsetMarginal const & in) } -auto_ptr InsetMarginal::doClone() const +auto_ptr InsetMarginal::doClone() const { - return auto_ptr(new InsetMarginal(*this)); + return auto_ptr(new InsetMarginal(*this)); } diff --git a/src/insets/InsetMarginal.h b/src/insets/InsetMarginal.h index 6fce74306a..4001180cdb 100644 --- a/src/insets/InsetMarginal.h +++ b/src/insets/InsetMarginal.h @@ -27,7 +27,7 @@ public: /// InsetMarginal(BufferParams const &); /// - InsetBase::Code lyxCode() const { return InsetBase::MARGIN_CODE; } + Inset::Code lyxCode() const { return Inset::MARGIN_CODE; } /// int latex(Buffer const &, odocstream &, OutputParams const &) const; @@ -42,7 +42,7 @@ public: protected: InsetMarginal(InsetMarginal const &); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/insets/InsetNewline.h b/src/insets/InsetNewline.h index 998cb42a9a..54ca6699df 100644 --- a/src/insets/InsetNewline.h +++ b/src/insets/InsetNewline.h @@ -13,17 +13,17 @@ #define INSET_NEWLINE_H -#include "InsetBase.h" +#include "Inset.h" namespace lyx { -class InsetNewline : public InsetBase { +class InsetNewline : public Inset { public: InsetNewline() {} - InsetBase::Code lyxCode() const { return InsetBase::NEWLINE_CODE; } + Inset::Code lyxCode() const { return Inset::NEWLINE_CODE; } bool metrics(MetricsInfo &, Dimension &) const; @@ -44,9 +44,9 @@ public: // a line separator)? bool isSpace() const; private: - virtual std::auto_ptr doClone() const + virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetNewline); + return std::auto_ptr(new InsetNewline); } }; diff --git a/src/insets/InsetNomencl.cpp b/src/insets/InsetNomencl.cpp index 838cf552bc..11384b535c 100644 --- a/src/insets/InsetNomencl.cpp +++ b/src/insets/InsetNomencl.cpp @@ -70,9 +70,9 @@ void InsetNomencl::validate(LaTeXFeatures & features) const } -InsetBase::Code InsetNomencl::lyxCode() const +Inset::Code InsetNomencl::lyxCode() const { - return InsetBase::NOMENCL_CODE; + return Inset::NOMENCL_CODE; } @@ -93,10 +93,10 @@ int InsetPrintNomencl::docbook(Buffer const & buf, odocstream & os, os << "\n"; int newlines = 2; for (InsetIterator it = inset_iterator_begin(buf.inset()); it;) { - if (it->lyxCode() == InsetBase::NOMENCL_CODE) { + if (it->lyxCode() == Inset::NOMENCL_CODE) { newlines += static_cast(*it).docbookGlossary(os); ++it; - } else if(it->lyxCode() == InsetBase::NOTE_CODE && + } else if(it->lyxCode() == Inset::NOTE_CODE && static_cast(*it).params().type == InsetNoteParams::Note) { // Don't output anything nested in note insets size_t const depth = it.depth(); @@ -118,9 +118,9 @@ void InsetPrintNomencl::validate(LaTeXFeatures & features) const } -InsetBase::Code InsetPrintNomencl::lyxCode() const +Inset::Code InsetPrintNomencl::lyxCode() const { - return InsetBase::NOMENCL_PRINT_CODE; + return Inset::NOMENCL_PRINT_CODE; } diff --git a/src/insets/InsetNomencl.h b/src/insets/InsetNomencl.h index db09d60829..c76669badf 100644 --- a/src/insets/InsetNomencl.h +++ b/src/insets/InsetNomencl.h @@ -34,15 +34,15 @@ public: /// Updates needed features for this inset. void validate(LaTeXFeatures & features) const; /// - InsetBase::Code lyxCode() const; + Inset::Code lyxCode() const; /// int docbook(Buffer const &, odocstream &, OutputParams const &) const; /// int docbookGlossary(odocstream &) const; private: - virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetNomencl(params())); + virtual std::auto_ptr doClone() const { + return std::auto_ptr(new InsetNomencl(params())); } /// unique id for this glossary entry for docbook export docstring glossary_entry_id; @@ -65,14 +65,14 @@ public: int docbook(Buffer const &, odocstream &, OutputParams const &) const; /// - InsetBase::Code lyxCode() const; + Inset::Code lyxCode() const; /// bool display() const { return true; } /// docstring const getScreenLabel(Buffer const &) const; private: - virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetPrintNomencl(params())); + virtual std::auto_ptr doClone() const { + return std::auto_ptr(new InsetPrintNomencl(params())); } }; diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index 83fb70a185..a0adac4279 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -137,9 +137,9 @@ InsetNote::~InsetNote() } -auto_ptr InsetNote::doClone() const +auto_ptr InsetNote::doClone() const { - return auto_ptr(new InsetNote(*this)); + return auto_ptr(new InsetNote(*this)); } diff --git a/src/insets/InsetNote.h b/src/insets/InsetNote.h index df4e7b4263..054a6fce47 100644 --- a/src/insets/InsetNote.h +++ b/src/insets/InsetNote.h @@ -50,9 +50,9 @@ public: /// virtual docstring const editMessage() const; /// - InsetBase::Code lyxCode() const { return InsetBase::NOTE_CODE; } + Inset::Code lyxCode() const { return Inset::NOTE_CODE; } /// - docstring getInsetName() const { return from_ascii("Note"); } + docstring insetName() const { return from_ascii("Note"); } /// void write(Buffer const &, std::ostream &) const; /// @@ -80,7 +80,7 @@ protected: private: friend class InsetNoteParams; - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// used by the constructors void init(); @@ -94,7 +94,7 @@ public: /// InsetNoteMailer(InsetNote & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/InsetOptArg.cpp b/src/insets/InsetOptArg.cpp index d6a85574bb..7522637126 100644 --- a/src/insets/InsetOptArg.cpp +++ b/src/insets/InsetOptArg.cpp @@ -48,9 +48,9 @@ InsetOptArg::InsetOptArg(InsetOptArg const & in) } -auto_ptr InsetOptArg::doClone() const +auto_ptr InsetOptArg::doClone() const { - return auto_ptr(new InsetOptArg(*this)); + return auto_ptr(new InsetOptArg(*this)); } diff --git a/src/insets/InsetOptArg.h b/src/insets/InsetOptArg.h index d12eb75a9c..7f57c87a5f 100644 --- a/src/insets/InsetOptArg.h +++ b/src/insets/InsetOptArg.h @@ -28,7 +28,7 @@ public: InsetOptArg(BufferParams const &); /// code of the inset - InsetBase::Code lyxCode() const { return InsetBase::OPTARG_CODE; } + Inset::Code lyxCode() const { return Inset::OPTARG_CODE; } /// return an message upon editing virtual docstring const editMessage() const; /// @@ -55,7 +55,7 @@ public: protected: InsetOptArg(InsetOptArg const &); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/insets/InsetPagebreak.h b/src/insets/InsetPagebreak.h index 42297dbc61..8a8896d334 100644 --- a/src/insets/InsetPagebreak.h +++ b/src/insets/InsetPagebreak.h @@ -13,17 +13,17 @@ #define INSET_PAGEBREAK_H -#include "InsetBase.h" +#include "Inset.h" #include "gettext.h" namespace lyx { -class InsetPagebreak : public InsetBase { +class InsetPagebreak : public Inset { public: InsetPagebreak() {} - InsetBase::Code lyxCode() const { return InsetBase::PAGEBREAK_CODE; } + Inset::Code lyxCode() const { return Inset::PAGEBREAK_CODE; } bool metrics(MetricsInfo &, Dimension &) const; @@ -51,9 +51,9 @@ public: virtual std::string getCmdName() const { return "\\newpage"; } private: - virtual std::auto_ptr doClone() const + virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetPagebreak); + return std::auto_ptr(new InsetPagebreak); } }; @@ -67,9 +67,9 @@ public: std::string getCmdName() const { return "\\clearpage"; } private: - virtual std::auto_ptr doClone() const + virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetClearPage); + return std::auto_ptr(new InsetClearPage); } }; @@ -83,9 +83,9 @@ public: std::string getCmdName() const { return "\\cleardoublepage"; } private: - virtual std::auto_ptr doClone() const + virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetClearDoublePage); + return std::auto_ptr(new InsetClearDoublePage); } }; diff --git a/src/insets/InsetQuotes.cpp b/src/insets/InsetQuotes.cpp index 117863d67c..b822ff3e16 100644 --- a/src/insets/InsetQuotes.cpp +++ b/src/insets/InsetQuotes.cpp @@ -386,15 +386,15 @@ void InsetQuotes::validate(LaTeXFeatures & features) const } -auto_ptr InsetQuotes::doClone() const +auto_ptr InsetQuotes::doClone() const { - return auto_ptr(new InsetQuotes(language_, side_, times_)); + return auto_ptr(new InsetQuotes(language_, side_, times_)); } -InsetBase::Code InsetQuotes::lyxCode() const +Inset::Code InsetQuotes::lyxCode() const { - return InsetBase::QUOTE_CODE; + return Inset::QUOTE_CODE; } diff --git a/src/insets/InsetQuotes.h b/src/insets/InsetQuotes.h index 89f13ef803..3ff1cd3750 100644 --- a/src/insets/InsetQuotes.h +++ b/src/insets/InsetQuotes.h @@ -13,7 +13,7 @@ #define INSET_QUOTES_H -#include "InsetBase.h" +#include "Inset.h" #include "support/types.h" @@ -28,7 +28,7 @@ class LaTeXFeatures; /** Quotes. Used for the various quotes. German, English, French, all either double or single **/ -class InsetQuotes : public InsetBase { +class InsetQuotes : public Inset { public: /// enum quote_language { @@ -74,7 +74,7 @@ public: /// Direct access to inner/outer quotation marks InsetQuotes(char_type c, quote_language l, quote_times t); /// - docstring getInsetName() const { return from_ascii("Quotes"); } + docstring insetName() const { return from_ascii("Quotes"); } /// bool metrics(MetricsInfo &, Dimension &) const; /// @@ -100,12 +100,12 @@ public: /// void validate(LaTeXFeatures &) const; /// - InsetBase::Code lyxCode() const; + Inset::Code lyxCode() const; // should this inset be handled like a normal character bool isChar() const { return true; } private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// quote_language language_; diff --git a/src/insets/InsetRef.h b/src/insets/InsetRef.h index 381978c36d..3a8c4637b6 100644 --- a/src/insets/InsetRef.h +++ b/src/insets/InsetRef.h @@ -63,8 +63,8 @@ protected: /// virtual void doDispatch(Cursor & cur, FuncRequest & cmd); private: - virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetRef(*this)); + virtual std::auto_ptr doClone() const { + return std::auto_ptr(new InsetRef(*this)); } /// bool isLatex; diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp index bdfdbe0beb..2c1639cf0f 100644 --- a/src/insets/InsetSpace.cpp +++ b/src/insets/InsetSpace.cpp @@ -235,9 +235,9 @@ int InsetSpace::textString(Buffer const & buf, odocstream & os, } -auto_ptr InsetSpace::doClone() const +auto_ptr InsetSpace::doClone() const { - return auto_ptr(new InsetSpace(kind_)); + return auto_ptr(new InsetSpace(kind_)); } diff --git a/src/insets/InsetSpace.h b/src/insets/InsetSpace.h index e0c4b65eb2..040316fc6d 100644 --- a/src/insets/InsetSpace.h +++ b/src/insets/InsetSpace.h @@ -16,7 +16,7 @@ #define INSET_SPACE_H -#include "InsetBase.h" +#include "Inset.h" namespace lyx { @@ -24,7 +24,7 @@ namespace lyx { class LaTeXFeatures; /// Used to insert different kinds of spaces -class InsetSpace : public InsetBase { +class InsetSpace : public Inset { public: /// The different kinds of spaces we support @@ -76,7 +76,7 @@ public: virtual int textString(Buffer const &, odocstream &, OutputParams const &) const; /// - InsetBase::Code lyxCode() const { return InsetBase::SPACE_CODE; } + Inset::Code lyxCode() const { return Inset::SPACE_CODE; } /// We don't need \begin_inset and \end_inset bool directWrite() const { return true; } @@ -88,7 +88,7 @@ public: // a line separator)? bool isSpace() const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// And which kind is this? Kind kind_; diff --git a/src/insets/InsetSpecialChar.cpp b/src/insets/InsetSpecialChar.cpp index f863b27bc2..afbdfc3e4e 100644 --- a/src/insets/InsetSpecialChar.cpp +++ b/src/insets/InsetSpecialChar.cpp @@ -240,9 +240,9 @@ int InsetSpecialChar::textString(Buffer const & buf, odocstream & os, } -auto_ptr InsetSpecialChar::doClone() const +auto_ptr InsetSpecialChar::doClone() const { - return auto_ptr(new InsetSpecialChar(kind_)); + return auto_ptr(new InsetSpecialChar(kind_)); } diff --git a/src/insets/InsetSpecialChar.h b/src/insets/InsetSpecialChar.h index 18cbcf8ee1..548f4fea78 100644 --- a/src/insets/InsetSpecialChar.h +++ b/src/insets/InsetSpecialChar.h @@ -15,7 +15,7 @@ #define INSET_SPECIALCHAR_H -#include "InsetBase.h" +#include "Inset.h" namespace lyx { @@ -23,7 +23,7 @@ namespace lyx { class LaTeXFeatures; /// Used to insert special chars -class InsetSpecialChar : public InsetBase { +class InsetSpecialChar : public Inset { public: /// The different kinds of special chars we support @@ -68,7 +68,7 @@ public: virtual int textString(Buffer const &, odocstream &, OutputParams const &) const; /// - InsetBase::Code lyxCode() const { return InsetBase::SPECIALCHAR_CODE; } + Inset::Code lyxCode() const { return Inset::SPECIALCHAR_CODE; } /// We don't need \begin_inset and \end_inset bool directWrite() const { return true; } /// @@ -81,7 +81,7 @@ public: // should we break lines after this inset? bool isLineSeparator() const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// And which kind is this? Kind kind_; diff --git a/src/insets/InsetTOC.cpp b/src/insets/InsetTOC.cpp index f583810ff0..801e5aa565 100644 --- a/src/insets/InsetTOC.cpp +++ b/src/insets/InsetTOC.cpp @@ -34,9 +34,9 @@ InsetTOC::InsetTOC(InsetCommandParams const & p) {} -std::auto_ptr InsetTOC::doClone() const +std::auto_ptr InsetTOC::doClone() const { - return std::auto_ptr(new InsetTOC(*this)); + return std::auto_ptr(new InsetTOC(*this)); } @@ -48,11 +48,11 @@ docstring const InsetTOC::getScreenLabel(Buffer const &) const } -InsetBase::Code InsetTOC::lyxCode() const +Inset::Code InsetTOC::lyxCode() const { if (getCmdName() == "tableofcontents") - return InsetBase::TOC_CODE; - return InsetBase::NO_CODE; + return Inset::TOC_CODE; + return Inset::NO_CODE; } diff --git a/src/insets/InsetTOC.h b/src/insets/InsetTOC.h index 334a0a33e0..ebcd554cde 100644 --- a/src/insets/InsetTOC.h +++ b/src/insets/InsetTOC.h @@ -28,7 +28,7 @@ public: /// EDITABLE editable() const { return IS_EDITABLE; } /// - InsetBase::Code lyxCode() const; + Inset::Code lyxCode() const; /// bool display() const { return true; } /// @@ -38,7 +38,7 @@ public: int docbook(Buffer const &, odocstream &, OutputParams const &) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index b34f86a4fd..2c0f9ebf8f 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -2803,7 +2803,7 @@ void Tabular::setCellInset(row_type row, col_type column, Tabular::idx_type -Tabular::getCellFromInset(InsetBase const * inset) const +Tabular::getCellFromInset(Inset const * inset) const { // is this inset part of the tabular? if (!inset) { @@ -2874,7 +2874,7 @@ InsetTabular::InsetTabular(Buffer const & buf, row_type rows, InsetTabular::InsetTabular(InsetTabular const & tab) - : InsetBase(tab), tabular(tab.tabular), + : Inset(tab), tabular(tab.tabular), buffer_(tab.buffer_), scx_(0), is_deleted_(false) {} @@ -2886,9 +2886,9 @@ InsetTabular::~InsetTabular() } -auto_ptr InsetTabular::doClone() const +auto_ptr InsetTabular::doClone() const { - return auto_ptr(new InsetTabular(*this)); + return auto_ptr(new InsetTabular(*this)); } @@ -3804,7 +3804,7 @@ int InsetTabular::docbook(Buffer const & buf, odocstream & os, OutputParams const & runparams) const { int ret = 0; - InsetBase * master = 0; + Inset * master = 0; #ifdef WITH_WARNINGS #warning Why not pass a proper DocIterator here? @@ -3813,7 +3813,7 @@ int InsetTabular::docbook(Buffer const & buf, odocstream & os, // if the table is inside a float it doesn't need the informaltable // wrapper. Search for it. for (master = owner(); master; master = master->owner()) - if (master->lyxCode() == InsetBase::FLOAT_CODE) + if (master->lyxCode() == Inset::FLOAT_CODE) break; #endif @@ -3883,7 +3883,7 @@ int InsetTabular::dist(BufferView & bv, idx_type const cell, int x, int y) const { int xx = 0; int yy = 0; - InsetBase const & inset = *tabular.getCellInset(cell); + Inset const & inset = *tabular.getCellInset(cell); Point o = bv.coordCache().getInsets().xy(&inset); int const xbeg = o.x_ - tabular.getBeginningOfTextInCell(cell); int const xend = xbeg + tabular.getWidthOfColumn(cell); @@ -3910,7 +3910,7 @@ int InsetTabular::dist(BufferView & bv, idx_type const cell, int x, int y) const } -InsetBase * InsetTabular::editXY(Cursor & cur, int x, int y) +Inset * InsetTabular::editXY(Cursor & cur, int x, int y) { //lyxerr << "InsetTabular::editXY: " << this << endl; cur.selection() = false; diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 71b75cda98..7f26ba1c9c 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -36,7 +36,7 @@ #ifndef INSETTABULAR_H #define INSETTABULAR_H -#include "InsetBase.h" +#include "Inset.h" #include "MailInset.h" #include "Length.h" #include "InsetText.h" @@ -444,7 +444,7 @@ public: boost::shared_ptr) const; /// Search for \param inset in the tabular, with the /// - idx_type getCellFromInset(InsetBase const * inset) const; + idx_type getCellFromInset(Inset const * inset) const; /// row_type rows() const { return rows_; } /// @@ -661,7 +661,7 @@ private: -class InsetTabular : public InsetBase { +class InsetTabular : public Inset { public: /// InsetTabular(Buffer const &, row_type rows = 1, @@ -683,7 +683,7 @@ public: /// EDITABLE editable() const { return HIGHLY_EDITABLE; } /// - bool insetAllowed(InsetBase::Code) const { return true; } + bool insetAllowed(Inset::Code) const { return true; } /// bool allowSpellCheck() const { return true; } /// @@ -706,7 +706,7 @@ public: /// void validate(LaTeXFeatures & features) const; /// - Code lyxCode() const { return InsetBase::TABULAR_CODE; } + Code lyxCode() const { return Inset::TABULAR_CODE; } /// get offset of this cursor slice relative to our upper left corner void cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const; @@ -751,7 +751,7 @@ public: /// lock cell with given index void edit(Cursor & cur, bool left); /// - InsetBase * editXY(Cursor & cur, int x, int y); + Inset * editXY(Cursor & cur, int x, int y); /// can we go further down on mouse click? bool descendable() const { return true; } @@ -771,7 +771,7 @@ protected: int scroll() const { return scx_; } private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// void drawCellLines(frontend::Painter &, int x, int y, row_type row, @@ -827,7 +827,7 @@ public: /// InsetTabularMailer(InsetTabular const & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 03e690031f..a626187edc 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -89,7 +89,7 @@ InsetText::InsetText(BufferParams const & bp) InsetText::InsetText(InsetText const & in) - : InsetBase(in), text_() + : Inset(in), text_() { text_.autoBreakRows_ = in.text_.autoBreakRows_; drawFrame_ = in.drawFrame_; @@ -128,9 +128,9 @@ void InsetText::clear() } -auto_ptr InsetText::doClone() const +auto_ptr InsetText::doClone() const { - return auto_ptr(new InsetText(*this)); + return auto_ptr(new InsetText(*this)); } @@ -248,7 +248,7 @@ void InsetText::edit(Cursor & cur, bool left) } -InsetBase * InsetText::editXY(Cursor & cur, int x, int y) +Inset * InsetText::editXY(Cursor & cur, int x, int y) { return text_.editXY(cur, x, y); } diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h index f8e64960a9..46a1875cd0 100644 --- a/src/insets/InsetText.h +++ b/src/insets/InsetText.h @@ -12,7 +12,7 @@ #ifndef INSETTEXT_H #define INSETTEXT_H -#include "InsetBase.h" +#include "Inset.h" #include "RowList_fwd.h" #include "LyXFont.h" #include "LyXText.h" @@ -37,7 +37,7 @@ class ParagraphList; A text inset is like a TeX box to write full text (including styles and other insets) in a given space. */ -class InsetText : public InsetBase { +class InsetText : public Inset { public: /// explicit InsetText(BufferParams const &); @@ -117,7 +117,7 @@ public: /// void edit(Cursor & cur, bool left); /// - InsetBase * editXY(Cursor & cur, int x, int y); + Inset * editXY(Cursor & cur, int x, int y); /// number of cells in this inset size_t nargs() const { return 1; } @@ -144,7 +144,7 @@ protected: private: /// - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// void init(); diff --git a/src/insets/InsetTheorem.cpp b/src/insets/InsetTheorem.cpp index 746bc27525..5aed74af9d 100644 --- a/src/insets/InsetTheorem.cpp +++ b/src/insets/InsetTheorem.cpp @@ -1,5 +1,5 @@ /** - * \file InsetBase.heorem.cpp + * \file Inset.heorem.cpp * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -10,7 +10,7 @@ #include -#include "InsetBase.heorem.h" +#include "Inset.heorem.h" #include "insets/InsetText.h" #include "debug.h" @@ -35,7 +35,7 @@ using std::ostream; user. */ -InsetBase.heorem::InsetTheorem() +Inset.heorem::InsetTheorem() : InsetCollapsable() { setLabel(_("theorem")); @@ -51,25 +51,25 @@ InsetBase.heorem::InsetTheorem() } -void InsetBase.heorem::write(Buffer const * buf, ostream & os) const +void Inset.heorem::write(Buffer const * buf, ostream & os) const { - os << getInsetName() << "\n"; + os << insetName() << "\n"; InsetCollapsable::write(buf, os); } -auto_ptr InsetBase.heorem::doClone() const +auto_ptr Inset.heorem::doClone() const { #ifdef WITH_WARNINGS #warning Is this inset used? If YES this is WRONG!!! (Jug) #endif - auto_ptr result(new InsetTheorem); + auto_ptr result(new InsetTheorem); result->setCollapsed(!isOpen()); return result; } -bool InsetBase.heorem::metrics(MetricsInfo & mi, Dimension & dim) const +bool Inset.heorem::metrics(MetricsInfo & mi, Dimension & dim) const { InsetCollapsable::metrics(mi, dim); center_indent_ = (mi.base.textwidth - dim.wid) / 2; @@ -86,13 +86,13 @@ void InsetTOC::draw(PainterInfo & pi, int x, int y) const } -string const InsetBase.heorem::editMessage() const +string const Inset.heorem::editMessage() const { return _("Opened Theorem Inset"); } -int InsetBase.heorem::latex(Buffer const * buf, odocstream & os, +int Inset.heorem::latex(Buffer const * buf, odocstream & os, OutputParams const & runparams) const { os << "\\begin{theorem}%\n"; diff --git a/src/insets/InsetTheorem.h b/src/insets/InsetTheorem.h index 479e1bb262..0b337323cb 100644 --- a/src/insets/InsetTheorem.h +++ b/src/insets/InsetTheorem.h @@ -1,6 +1,6 @@ // -*- C++ -*- /** - * \file InsetBase.heorem.h + * \file Inset.heorem.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -9,8 +9,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef InsetBase.heorem_H -#define InsetBase.heorem_H +#ifndef Inset.heorem_H +#define Inset.heorem_H #include "InsetCollapsable.h" @@ -21,10 +21,10 @@ namespace lyx { /** The theorem inset */ -class InsetBase.heorem : public InsetCollapsable { +class Inset.heorem : public InsetCollapsable { public: /// - InsetBase.heorem(); + Inset.heorem(); /// void write(Buffer const & buf, std::ostream & os) const; /// @@ -39,7 +39,7 @@ public: /// virtual docstring const editMessage() const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// mutable unsigned int center_indent_; diff --git a/src/insets/InsetUrl.h b/src/insets/InsetUrl.h index f60b11cf39..a0c11801c3 100644 --- a/src/insets/InsetUrl.h +++ b/src/insets/InsetUrl.h @@ -28,7 +28,7 @@ public: explicit InsetUrl(InsetCommandParams const &); /// - InsetBase::Code lyxCode() const { return InsetBase::URL_CODE; } + Inset::Code lyxCode() const { return Inset::URL_CODE; } /// void validate(LaTeXFeatures &) const; /// @@ -50,8 +50,8 @@ public: virtual int textString(Buffer const &, odocstream &, OutputParams const &) const; private: - virtual std::auto_ptr doClone() const { - return std::auto_ptr(new InsetUrl(params())); + virtual std::auto_ptr doClone() const { + return std::auto_ptr(new InsetUrl(params())); } }; diff --git a/src/insets/InsetVSpace.cpp b/src/insets/InsetVSpace.cpp index fb0c8dbe87..20e3340a28 100644 --- a/src/insets/InsetVSpace.cpp +++ b/src/insets/InsetVSpace.cpp @@ -57,9 +57,9 @@ InsetVSpace::~InsetVSpace() } -std::auto_ptr InsetVSpace::doClone() const +std::auto_ptr InsetVSpace::doClone() const { - return std::auto_ptr(new InsetVSpace(*this)); + return std::auto_ptr(new InsetVSpace(*this)); } @@ -77,7 +77,7 @@ void InsetVSpace::doDispatch(Cursor & cur, FuncRequest & cmd) break; default: - InsetBase::doDispatch(cur, cmd); + Inset::doDispatch(cur, cmd); break; } } diff --git a/src/insets/InsetVSpace.h b/src/insets/InsetVSpace.h index e3a22dfcd7..adf6012249 100644 --- a/src/insets/InsetVSpace.h +++ b/src/insets/InsetVSpace.h @@ -13,14 +13,14 @@ #define INSET_VSPACE_H -#include "InsetBase.h" +#include "Inset.h" #include "VSpace.h" #include "MailInset.h" namespace lyx { -class InsetVSpace : public InsetBase { +class InsetVSpace : public Inset { public: /// InsetVSpace() {} @@ -55,7 +55,7 @@ protected: virtual void doDispatch(Cursor & cur, FuncRequest & cmd); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// docstring const label() const; @@ -69,7 +69,7 @@ public: /// InsetVSpaceMailer(InsetVSpace & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/InsetWrap.cpp b/src/insets/InsetWrap.cpp index 9e9504a10b..0272b33270 100644 --- a/src/insets/InsetWrap.cpp +++ b/src/insets/InsetWrap.cpp @@ -166,9 +166,9 @@ void InsetWrap::validate(LaTeXFeatures & features) const } -auto_ptr InsetWrap::doClone() const +auto_ptr InsetWrap::doClone() const { - return auto_ptr(new InsetWrap(*this)); + return auto_ptr(new InsetWrap(*this)); } @@ -213,7 +213,7 @@ int InsetWrap::docbook(Buffer const & buf, odocstream & os, } -bool InsetWrap::insetAllowed(InsetBase::Code code) const +bool InsetWrap::insetAllowed(Inset::Code code) const { switch(code) { case FLOAT_CODE: diff --git a/src/insets/InsetWrap.h b/src/insets/InsetWrap.h index 7629844c42..93f875de1d 100644 --- a/src/insets/InsetWrap.h +++ b/src/insets/InsetWrap.h @@ -51,7 +51,7 @@ public: /// void validate(LaTeXFeatures & features) const; /// - InsetBase::Code lyxCode() const { return InsetBase::WRAP_CODE; } + Inset::Code lyxCode() const { return Inset::WRAP_CODE; } /// int latex(Buffer const &, odocstream &, OutputParams const &) const; @@ -64,7 +64,7 @@ public: /// virtual docstring const editMessage() const; /// - bool insetAllowed(InsetBase::Code) const; + bool insetAllowed(Inset::Code) const; /// void addToToc(TocList &, Buffer const &) const; /// @@ -77,9 +77,9 @@ protected: /// virtual void doDispatch(Cursor & cur, FuncRequest & cmd); /// - virtual docstring getInsetName() const { return name_; } + virtual docstring insetName() const { return name_; } private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// InsetWrapParams params_; @@ -93,7 +93,7 @@ public: /// InsetWrapMailer(InsetWrap & inset); /// - virtual InsetBase & inset() const { return inset_; } + virtual Inset & inset() const { return inset_; } /// virtual std::string const & name() const { return name_; } /// diff --git a/src/insets/MailInset.h b/src/insets/MailInset.h index f19249b22f..9fca43e8c4 100644 --- a/src/insets/MailInset.h +++ b/src/insets/MailInset.h @@ -18,7 +18,7 @@ namespace lyx { -class InsetBase; +class Inset; class Buffer; class BufferView; @@ -38,7 +38,7 @@ public: protected: /// - virtual InsetBase & inset() const = 0; + virtual Inset & inset() const = 0; /// virtual std::string const & name() const = 0; }; diff --git a/src/insets/Makefile.am b/src/insets/Makefile.am index bbc07e0abb..1cd44dab40 100644 --- a/src/insets/Makefile.am +++ b/src/insets/Makefile.am @@ -27,8 +27,8 @@ libinsets_la_SOURCES = \ RenderGraphic.h \ RenderPreview.cpp \ RenderPreview.h \ - InsetBase.h \ - InsetBase.cpp \ + Inset.h \ + Inset.cpp \ InsetBibitem.cpp \ InsetBibitem.h \ InsetBibtex.cpp \ diff --git a/src/insets/RenderBase.h b/src/insets/RenderBase.h index 9657f48f5b..098614e249 100644 --- a/src/insets/RenderBase.h +++ b/src/insets/RenderBase.h @@ -19,7 +19,7 @@ namespace lyx { -class InsetBase; +class Inset; class MetricsInfo; class PainterInfo; @@ -32,7 +32,7 @@ class RenderBase { public: virtual ~RenderBase() {} - virtual std::auto_ptr clone(InsetBase const *) const = 0; + virtual std::auto_ptr clone(Inset const *) const = 0; /// compute the size of the object returned in dim. /// \retval true if the metrics has changed. diff --git a/src/insets/RenderButton.cpp b/src/insets/RenderButton.cpp index cce32e334f..3e151e4659 100644 --- a/src/insets/RenderButton.cpp +++ b/src/insets/RenderButton.cpp @@ -30,7 +30,7 @@ RenderButton::RenderButton() {} -auto_ptr RenderButton::clone(InsetBase const *) const +auto_ptr RenderButton::clone(Inset const *) const { return auto_ptr(new RenderButton(*this)); } diff --git a/src/insets/RenderButton.h b/src/insets/RenderButton.h index 59d09bb711..82a474e6c6 100644 --- a/src/insets/RenderButton.h +++ b/src/insets/RenderButton.h @@ -25,7 +25,7 @@ class RenderButton : public RenderBase public: RenderButton(); - std::auto_ptr clone(InsetBase const *) const; + std::auto_ptr clone(Inset const *) const; /// compute the size of the object returned in dim virtual bool metrics(MetricsInfo & mi, Dimension & dim) const; diff --git a/src/insets/RenderGraphic.cpp b/src/insets/RenderGraphic.cpp index 0e778d40e1..a04b7cad2a 100644 --- a/src/insets/RenderGraphic.cpp +++ b/src/insets/RenderGraphic.cpp @@ -12,7 +12,7 @@ #include "RenderGraphic.h" -#include "insets/InsetBase.h" +#include "insets/Inset.h" #include "gettext.h" #include "Color.h" @@ -38,7 +38,7 @@ using std::string; using std::auto_ptr; -RenderGraphic::RenderGraphic(InsetBase const * inset) +RenderGraphic::RenderGraphic(Inset const * inset) { loader_.connect(boost::bind(&LyX::updateInset, boost::cref(LyX::cref()), inset)); @@ -46,7 +46,7 @@ RenderGraphic::RenderGraphic(InsetBase const * inset) RenderGraphic::RenderGraphic(RenderGraphic const & other, - InsetBase const * inset) + Inset const * inset) : RenderBase(other), loader_(other.loader_), params_(other.params_) @@ -56,7 +56,7 @@ RenderGraphic::RenderGraphic(RenderGraphic const & other, } -auto_ptr RenderGraphic::clone(InsetBase const * inset) const +auto_ptr RenderGraphic::clone(Inset const * inset) const { return auto_ptr(new RenderGraphic(*this, inset)); } @@ -149,7 +149,7 @@ bool RenderGraphic::metrics(MetricsInfo & mi, Dimension & dim) const if (image_ready) { dim.wid = loader_.image()->getWidth() + - 2 * InsetBase::TEXT_TO_INSET_OFFSET; + 2 * Inset::TEXT_TO_INSET_OFFSET; } else { int font_width = 0; @@ -194,16 +194,16 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const // loaded yet, we draw just a rectangle. if (displayGraphic(params_) && readyToDisplay(loader_)) { - pi.pain.image(x + InsetBase::TEXT_TO_INSET_OFFSET, + pi.pain.image(x + Inset::TEXT_TO_INSET_OFFSET, y - dim_.asc, - dim_.wid - 2 * InsetBase::TEXT_TO_INSET_OFFSET, + dim_.wid - 2 * Inset::TEXT_TO_INSET_OFFSET, dim_.asc + dim_.des, *loader_.image()); } else { - pi.pain.rectangle(x + InsetBase::TEXT_TO_INSET_OFFSET, + pi.pain.rectangle(x + Inset::TEXT_TO_INSET_OFFSET, y - dim_.asc, - dim_.wid - 2 * InsetBase::TEXT_TO_INSET_OFFSET, + dim_.wid - 2 * Inset::TEXT_TO_INSET_OFFSET, dim_.asc + dim_.des, Color::foreground); @@ -214,7 +214,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const if (!justname.empty()) { msgFont.setSize(LyXFont::SIZE_FOOTNOTE); - pi.pain.text(x + InsetBase::TEXT_TO_INSET_OFFSET + 6, + pi.pain.text(x + Inset::TEXT_TO_INSET_OFFSET + 6, y - theFontMetrics(msgFont).maxAscent() - 4, from_utf8(justname), msgFont); } @@ -223,7 +223,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const docstring const msg = statusMessage(params_, loader_.status()); if (!msg.empty()) { msgFont.setSize(LyXFont::SIZE_TINY); - pi.pain.text(x + InsetBase::TEXT_TO_INSET_OFFSET + 6, + pi.pain.text(x + Inset::TEXT_TO_INSET_OFFSET + 6, y - 4, msg, msgFont); } } diff --git a/src/insets/RenderGraphic.h b/src/insets/RenderGraphic.h index 0d0727b3b3..49db0e2c1f 100644 --- a/src/insets/RenderGraphic.h +++ b/src/insets/RenderGraphic.h @@ -24,9 +24,9 @@ namespace lyx { class RenderGraphic : public RenderBase { public: - RenderGraphic(InsetBase const *); - RenderGraphic(RenderGraphic const &, InsetBase const *); - std::auto_ptr clone(InsetBase const *) const; + RenderGraphic(Inset const *); + RenderGraphic(RenderGraphic const &, Inset const *); + std::auto_ptr clone(Inset const *) const; /// compute the size of the object returned in dim bool metrics(MetricsInfo & mi, Dimension & dim) const; diff --git a/src/insets/RenderPreview.cpp b/src/insets/RenderPreview.cpp index 69a5eb991b..d2cbd2e0bd 100644 --- a/src/insets/RenderPreview.cpp +++ b/src/insets/RenderPreview.cpp @@ -11,7 +11,7 @@ #include #include "insets/RenderPreview.h" -#include "insets/InsetBase.h" +#include "insets/Inset.h" #include "BufferView.h" #include "Color.h" @@ -48,13 +48,13 @@ LyXRC_PreviewStatus RenderPreview::status() } -RenderPreview::RenderPreview(InsetBase const * inset) +RenderPreview::RenderPreview(Inset const * inset) : parent_(inset) {} RenderPreview::RenderPreview(RenderPreview const & other, - InsetBase const * inset) + Inset const * inset) : RenderBase(other), boost::signals::trackable(), snippet_(other.snippet_), @@ -62,7 +62,7 @@ RenderPreview::RenderPreview(RenderPreview const & other, {} -auto_ptr RenderPreview::clone(InsetBase const * inset) const +auto_ptr RenderPreview::clone(Inset const * inset) const { return auto_ptr(new RenderPreview(*this, inset)); } @@ -154,7 +154,7 @@ void RenderPreview::draw(PainterInfo & pi, int x, int y) const *image); } else { - int const offset = InsetBase::TEXT_TO_INSET_OFFSET; + int const offset = Inset::TEXT_TO_INSET_OFFSET; pi.pain.rectangle(x + offset, y - dim_.asc, @@ -241,7 +241,7 @@ void RenderPreview::imageReady(graphics::PreviewImage const & pimage) } -RenderMonitoredPreview::RenderMonitoredPreview(InsetBase const * inset) +RenderMonitoredPreview::RenderMonitoredPreview(Inset const * inset) : RenderPreview(inset), monitor_(FileName(), 2000) {} diff --git a/src/insets/RenderPreview.h b/src/insets/RenderPreview.h index dc0a723282..e46911bd23 100644 --- a/src/insets/RenderPreview.h +++ b/src/insets/RenderPreview.h @@ -47,9 +47,9 @@ public: /// a wrapper for Previews::status() static LyXRC_PreviewStatus status(); - RenderPreview(InsetBase const *); - RenderPreview(RenderPreview const &, InsetBase const *); - std::auto_ptr clone(InsetBase const *) const; + RenderPreview(Inset const *); + RenderPreview(RenderPreview const &, Inset const *); + std::auto_ptr clone(Inset const *) const; /// Compute the size of the object, returned in dim bool metrics(MetricsInfo &, Dimension & dim) const; @@ -100,13 +100,13 @@ private: boost::signals::connection ploader_connection_; /// Inform the core that the inset has changed. - InsetBase const * parent_; + Inset const * parent_; }; class RenderMonitoredPreview : public RenderPreview { public: - RenderMonitoredPreview(InsetBase const *); + RenderMonitoredPreview(Inset const *); /// void draw(PainterInfo & pi, int x, int y) const; /// diff --git a/src/insets/pch.h b/src/insets/pch.h index c8f624adfe..5ad521e188 100644 --- a/src/insets/pch.h +++ b/src/insets/pch.h @@ -1,6 +1,6 @@ #include -#include "InsetBase.h" +#include "Inset.h" #include #include diff --git a/src/mathed/CommandInset.cpp b/src/mathed/CommandInset.cpp index 303ca931ca..a53a233555 100644 --- a/src/mathed/CommandInset.cpp +++ b/src/mathed/CommandInset.cpp @@ -31,9 +31,9 @@ CommandInset::CommandInset(docstring const & name) } -auto_ptr CommandInset::doClone() const +auto_ptr CommandInset::doClone() const { - return auto_ptr(new CommandInset(*this)); + return auto_ptr(new CommandInset(*this)); } @@ -51,7 +51,7 @@ bool CommandInset::metrics(MetricsInfo & mi, Dimension & dim) const } -InsetBase * CommandInset::editXY(Cursor & cur, int /*x*/, int /*y*/) +Inset * CommandInset::editXY(Cursor & cur, int /*x*/, int /*y*/) { edit(cur, true); return this; diff --git a/src/mathed/CommandInset.h b/src/mathed/CommandInset.h index 22cdb1935e..bc7b839dd7 100644 --- a/src/mathed/CommandInset.h +++ b/src/mathed/CommandInset.h @@ -31,7 +31,7 @@ public: /// void draw(PainterInfo & pi, int x, int y) const; /// - InsetBase * editXY(Cursor &, int, int); + Inset * editXY(Cursor &, int, int); /// void write(WriteStream & os) const; // @@ -41,7 +41,7 @@ public: /// docstring const & commandname() const { return name_; } private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// docstring name_; diff --git a/src/mathed/InsetFormulaMacro.cpp b/src/mathed/InsetFormulaMacro.cpp index cbf2058aaa..1e425c87fe 100644 --- a/src/mathed/InsetFormulaMacro.cpp +++ b/src/mathed/InsetFormulaMacro.cpp @@ -64,9 +64,9 @@ InsetFormulaMacro::InsetFormulaMacro(string const & s) } -auto_ptr InsetFormulaMacro::clone() const +auto_ptr InsetFormulaMacro::clone() const { - return auto_ptr(new InsetFormulaMacro(*this)); + return auto_ptr(new InsetFormulaMacro(*this)); } diff --git a/src/mathed/InsetFormulaMacro.h b/src/mathed/InsetFormulaMacro.h index 01ad367a91..55b3176159 100644 --- a/src/mathed/InsetFormulaMacro.h +++ b/src/mathed/InsetFormulaMacro.h @@ -54,9 +54,9 @@ public: OutputParams const &) const; /// - std::auto_ptr clone() const; + std::auto_ptr clone() const; /// - InsetBase::Code lyxCode() const { return MATHMACRO_CODE; } + Inset::Code lyxCode() const { return MATHMACRO_CODE; } /// docstring const & getInsetName() const { return name_; } /// diff --git a/src/mathed/InsetMath.h b/src/mathed/InsetMath.h index 8bc070ee32..87cf74ef95 100644 --- a/src/mathed/InsetMath.h +++ b/src/mathed/InsetMath.h @@ -15,7 +15,7 @@ #include "MathData.h" -#include "insets/InsetBase.h" +#include "insets/Inset.h" namespace lyx { @@ -90,7 +90,7 @@ class TextMetricsInfo; class ReplaceData; -class InsetMath : public InsetBase { +class InsetMath : public Inset { public: /// identification as math inset InsetMath * asInsetMath() { return this; } diff --git a/src/mathed/InsetMathAMSArray.cpp b/src/mathed/InsetMathAMSArray.cpp index 4ccd56c2fc..d74ed1db30 100644 --- a/src/mathed/InsetMathAMSArray.cpp +++ b/src/mathed/InsetMathAMSArray.cpp @@ -41,9 +41,9 @@ InsetMathAMSArray::InsetMathAMSArray(docstring const & name) {} -auto_ptr InsetMathAMSArray::doClone() const +auto_ptr InsetMathAMSArray::doClone() const { - return auto_ptr(new InsetMathAMSArray(*this)); + return auto_ptr(new InsetMathAMSArray(*this)); } diff --git a/src/mathed/InsetMathAMSArray.h b/src/mathed/InsetMathAMSArray.h index b3dcd10bd9..c4e59b4ff6 100644 --- a/src/mathed/InsetMathAMSArray.h +++ b/src/mathed/InsetMathAMSArray.h @@ -45,7 +45,7 @@ public: /// void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// char const * name_left() const; /// diff --git a/src/mathed/InsetMathArray.cpp b/src/mathed/InsetMathArray.cpp index 8732f50c9c..544d6a47d1 100644 --- a/src/mathed/InsetMathArray.cpp +++ b/src/mathed/InsetMathArray.cpp @@ -73,9 +73,9 @@ InsetMathArray::InsetMathArray(docstring const & name, docstring const & str) } -auto_ptr InsetMathArray::doClone() const +auto_ptr InsetMathArray::doClone() const { - return auto_ptr(new InsetMathArray(*this)); + return auto_ptr(new InsetMathArray(*this)); } diff --git a/src/mathed/InsetMathArray.h b/src/mathed/InsetMathArray.h index 0dd387dada..7387b6ae4c 100644 --- a/src/mathed/InsetMathArray.h +++ b/src/mathed/InsetMathArray.h @@ -50,7 +50,7 @@ public: /// void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// docstring name_; }; diff --git a/src/mathed/InsetMathBig.cpp b/src/mathed/InsetMathBig.cpp index e56acca078..13d8a3686c 100644 --- a/src/mathed/InsetMathBig.cpp +++ b/src/mathed/InsetMathBig.cpp @@ -36,9 +36,9 @@ docstring InsetMathBig::name() const } -auto_ptr InsetMathBig::doClone() const +auto_ptr InsetMathBig::doClone() const { - return auto_ptr(new InsetMathBig(*this)); + return auto_ptr(new InsetMathBig(*this)); } diff --git a/src/mathed/InsetMathBig.h b/src/mathed/InsetMathBig.h index 5a983d19e7..5c2bbb80f5 100644 --- a/src/mathed/InsetMathBig.h +++ b/src/mathed/InsetMathBig.h @@ -40,7 +40,7 @@ public: static bool isBigInsetDelim(docstring const &); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// size_type size() const; /// diff --git a/src/mathed/InsetMathBinom.cpp b/src/mathed/InsetMathBinom.cpp index 0a08e7bea3..7d0aa7b27f 100644 --- a/src/mathed/InsetMathBinom.cpp +++ b/src/mathed/InsetMathBinom.cpp @@ -28,9 +28,9 @@ InsetMathBinom::InsetMathBinom(bool choose) {} -auto_ptr InsetMathBinom::doClone() const +auto_ptr InsetMathBinom::doClone() const { - return auto_ptr(new InsetMathBinom(*this)); + return auto_ptr(new InsetMathBinom(*this)); } diff --git a/src/mathed/InsetMathBinom.h b/src/mathed/InsetMathBinom.h index baf2b8d6bf..d3dd51a289 100644 --- a/src/mathed/InsetMathBinom.h +++ b/src/mathed/InsetMathBinom.h @@ -37,7 +37,7 @@ public: /// bool extraBraces() const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// int dw() const; /// diff --git a/src/mathed/InsetMathBoldSymbol.cpp b/src/mathed/InsetMathBoldSymbol.cpp index 1d7c6f6760..7e2ba27a51 100644 --- a/src/mathed/InsetMathBoldSymbol.cpp +++ b/src/mathed/InsetMathBoldSymbol.cpp @@ -27,9 +27,9 @@ InsetMathBoldSymbol::InsetMathBoldSymbol() {} -auto_ptr InsetMathBoldSymbol::doClone() const +auto_ptr InsetMathBoldSymbol::doClone() const { - return auto_ptr(new InsetMathBoldSymbol(*this)); + return auto_ptr(new InsetMathBoldSymbol(*this)); } diff --git a/src/mathed/InsetMathBoldSymbol.h b/src/mathed/InsetMathBoldSymbol.h index b9f7e78e5f..229f28c985 100644 --- a/src/mathed/InsetMathBoldSymbol.h +++ b/src/mathed/InsetMathBoldSymbol.h @@ -38,7 +38,7 @@ public: /// void infoize(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathBox.cpp b/src/mathed/InsetMathBox.cpp index 0447e84467..0872973dbf 100644 --- a/src/mathed/InsetMathBox.cpp +++ b/src/mathed/InsetMathBox.cpp @@ -28,9 +28,9 @@ InsetMathBox::InsetMathBox(docstring const & name) {} -auto_ptr InsetMathBox::doClone() const +auto_ptr InsetMathBox::doClone() const { - return auto_ptr(new InsetMathBox(*this)); + return auto_ptr(new InsetMathBox(*this)); } diff --git a/src/mathed/InsetMathBox.h b/src/mathed/InsetMathBox.h index 0bb2744d0a..3758631916 100644 --- a/src/mathed/InsetMathBox.h +++ b/src/mathed/InsetMathBox.h @@ -42,7 +42,7 @@ public: void infoize(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// docstring name_; }; diff --git a/src/mathed/InsetMathBoxed.cpp b/src/mathed/InsetMathBoxed.cpp index cac33db435..60835be301 100644 --- a/src/mathed/InsetMathBoxed.cpp +++ b/src/mathed/InsetMathBoxed.cpp @@ -30,9 +30,9 @@ InsetMathBoxed::InsetMathBoxed() {} -auto_ptr InsetMathBoxed::doClone() const +auto_ptr InsetMathBoxed::doClone() const { - return auto_ptr(new InsetMathBoxed(*this)); + return auto_ptr(new InsetMathBoxed(*this)); } diff --git a/src/mathed/InsetMathBoxed.h b/src/mathed/InsetMathBoxed.h index 930c7b3aa0..078a32a877 100644 --- a/src/mathed/InsetMathBoxed.h +++ b/src/mathed/InsetMathBoxed.h @@ -36,7 +36,7 @@ public: /// void infoize(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathBrace.cpp b/src/mathed/InsetMathBrace.cpp index f7b18cdc3a..9f754887f0 100644 --- a/src/mathed/InsetMathBrace.cpp +++ b/src/mathed/InsetMathBrace.cpp @@ -39,9 +39,9 @@ InsetMathBrace::InsetMathBrace(MathData const & ar) } -auto_ptr InsetMathBrace::doClone() const +auto_ptr InsetMathBrace::doClone() const { - return auto_ptr(new InsetMathBrace(*this)); + return auto_ptr(new InsetMathBrace(*this)); } diff --git a/src/mathed/InsetMathBrace.h b/src/mathed/InsetMathBrace.h index e22bb7cfc1..c4481bae39 100644 --- a/src/mathed/InsetMathBrace.h +++ b/src/mathed/InsetMathBrace.h @@ -48,7 +48,7 @@ public: /// void infoize(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathCases.cpp b/src/mathed/InsetMathCases.cpp index 7155b723f9..27ec6c3b95 100644 --- a/src/mathed/InsetMathCases.cpp +++ b/src/mathed/InsetMathCases.cpp @@ -41,9 +41,9 @@ InsetMathCases::InsetMathCases(row_type n) {} -auto_ptr InsetMathCases::doClone() const +auto_ptr InsetMathCases::doClone() const { - return auto_ptr(new InsetMathCases(*this)); + return auto_ptr(new InsetMathCases(*this)); } diff --git a/src/mathed/InsetMathCases.h b/src/mathed/InsetMathCases.h index b2d72f2470..41616b93e3 100644 --- a/src/mathed/InsetMathCases.h +++ b/src/mathed/InsetMathCases.h @@ -45,7 +45,7 @@ public: /// void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp index 347b82da21..5e523c88a2 100644 --- a/src/mathed/InsetMathChar.cpp +++ b/src/mathed/InsetMathChar.cpp @@ -51,9 +51,9 @@ InsetMathChar::InsetMathChar(char_type c) -auto_ptr InsetMathChar::doClone() const +auto_ptr InsetMathChar::doClone() const { - return auto_ptr(new InsetMathChar(*this)); + return auto_ptr(new InsetMathChar(*this)); } diff --git a/src/mathed/InsetMathChar.h b/src/mathed/InsetMathChar.h index 347e8533f6..f01f3f0447 100644 --- a/src/mathed/InsetMathChar.h +++ b/src/mathed/InsetMathChar.h @@ -50,7 +50,7 @@ public: bool isRelOp() const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// the character char_type char_; /// cached kerning for superscript diff --git a/src/mathed/InsetMathColor.cpp b/src/mathed/InsetMathColor.cpp index f237eb9c4f..08959b98b2 100644 --- a/src/mathed/InsetMathColor.cpp +++ b/src/mathed/InsetMathColor.cpp @@ -35,9 +35,9 @@ InsetMathColor::InsetMathColor(bool oldstyle, docstring const & color) {} -auto_ptr InsetMathColor::doClone() const +auto_ptr InsetMathColor::doClone() const { - return auto_ptr(new InsetMathColor(*this)); + return auto_ptr(new InsetMathColor(*this)); } diff --git a/src/mathed/InsetMathColor.h b/src/mathed/InsetMathColor.h index 1c15c8e07d..01f53298bf 100644 --- a/src/mathed/InsetMathColor.h +++ b/src/mathed/InsetMathColor.h @@ -44,7 +44,7 @@ public: /// void infoize(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// width of '[' in current font mutable int w_; /// diff --git a/src/mathed/InsetMathComment.cpp b/src/mathed/InsetMathComment.cpp index ca0de54262..57d74a9499 100644 --- a/src/mathed/InsetMathComment.cpp +++ b/src/mathed/InsetMathComment.cpp @@ -36,9 +36,9 @@ InsetMathComment::InsetMathComment(docstring const & str) } -auto_ptr InsetMathComment::doClone() const +auto_ptr InsetMathComment::doClone() const { - return auto_ptr(new InsetMathComment(*this)); + return auto_ptr(new InsetMathComment(*this)); } diff --git a/src/mathed/InsetMathComment.h b/src/mathed/InsetMathComment.h index 02986ed1f6..f084bb52b7 100644 --- a/src/mathed/InsetMathComment.h +++ b/src/mathed/InsetMathComment.h @@ -48,7 +48,7 @@ public: /// void infoize(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; } // namespace lyx diff --git a/src/mathed/InsetMathDFrac.cpp b/src/mathed/InsetMathDFrac.cpp index 70da736cf9..43abab93c6 100644 --- a/src/mathed/InsetMathDFrac.cpp +++ b/src/mathed/InsetMathDFrac.cpp @@ -31,9 +31,9 @@ InsetMathDFrac::InsetMathDFrac() {} -auto_ptr InsetMathDFrac::doClone() const +auto_ptr InsetMathDFrac::doClone() const { - return auto_ptr(new InsetMathDFrac(*this)); + return auto_ptr(new InsetMathDFrac(*this)); } diff --git a/src/mathed/InsetMathDFrac.h b/src/mathed/InsetMathDFrac.h index 3c62c8a664..0ef6791c54 100644 --- a/src/mathed/InsetMathDFrac.h +++ b/src/mathed/InsetMathDFrac.h @@ -34,7 +34,7 @@ public: /// void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp index f7a038bec8..7409a28ca7 100644 --- a/src/mathed/InsetMathDecoration.cpp +++ b/src/mathed/InsetMathDecoration.cpp @@ -33,9 +33,9 @@ InsetMathDecoration::InsetMathDecoration(latexkeys const * key) } -std::auto_ptr InsetMathDecoration::doClone() const +std::auto_ptr InsetMathDecoration::doClone() const { - return std::auto_ptr(new InsetMathDecoration(*this)); + return std::auto_ptr(new InsetMathDecoration(*this)); } diff --git a/src/mathed/InsetMathDecoration.h b/src/mathed/InsetMathDecoration.h index d7019ae1e8..b755a1635f 100644 --- a/src/mathed/InsetMathDecoration.h +++ b/src/mathed/InsetMathDecoration.h @@ -41,7 +41,7 @@ public: void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// bool upper() const; /// diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index f7c1f24aa5..7e03e24afe 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -52,9 +52,9 @@ InsetMathDelim::InsetMathDelim } -auto_ptr InsetMathDelim::doClone() const +auto_ptr InsetMathDelim::doClone() const { - return auto_ptr(new InsetMathDelim(*this)); + return auto_ptr(new InsetMathDelim(*this)); } diff --git a/src/mathed/InsetMathDelim.h b/src/mathed/InsetMathDelim.h index 61c230e4e9..abb7db6097 100644 --- a/src/mathed/InsetMathDelim.h +++ b/src/mathed/InsetMathDelim.h @@ -63,7 +63,7 @@ public: /// docstring right_; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// mutable int dw_; }; diff --git a/src/mathed/InsetMathDiff.cpp b/src/mathed/InsetMathDiff.cpp index d598746f99..3ec1160bdf 100644 --- a/src/mathed/InsetMathDiff.cpp +++ b/src/mathed/InsetMathDiff.cpp @@ -27,9 +27,9 @@ InsetMathDiff::InsetMathDiff() {} -auto_ptr InsetMathDiff::doClone() const +auto_ptr InsetMathDiff::doClone() const { - return auto_ptr(new InsetMathDiff(*this)); + return auto_ptr(new InsetMathDiff(*this)); } diff --git a/src/mathed/InsetMathDiff.h b/src/mathed/InsetMathDiff.h index 2a8a5a53cc..8d07857699 100644 --- a/src/mathed/InsetMathDiff.h +++ b/src/mathed/InsetMathDiff.h @@ -45,7 +45,7 @@ public: /// void write(WriteStream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathDots.cpp b/src/mathed/InsetMathDots.cpp index 6673d04838..a8dcec6aa0 100644 --- a/src/mathed/InsetMathDots.cpp +++ b/src/mathed/InsetMathDots.cpp @@ -30,9 +30,9 @@ InsetMathDots::InsetMathDots(latexkeys const * key) {} -auto_ptr InsetMathDots::doClone() const +auto_ptr InsetMathDots::doClone() const { - return auto_ptr(new InsetMathDots(*this)); + return auto_ptr(new InsetMathDots(*this)); } diff --git a/src/mathed/InsetMathDots.h b/src/mathed/InsetMathDots.h index 86173a0b37..f8148a20e8 100644 --- a/src/mathed/InsetMathDots.h +++ b/src/mathed/InsetMathDots.h @@ -36,7 +36,7 @@ protected: /// latexkeys const * key_; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; } // namespace lyx diff --git a/src/mathed/InsetMathEnv.cpp b/src/mathed/InsetMathEnv.cpp index 110d09b259..e70b09cb1f 100644 --- a/src/mathed/InsetMathEnv.cpp +++ b/src/mathed/InsetMathEnv.cpp @@ -29,9 +29,9 @@ InsetMathEnv::InsetMathEnv(docstring const & name) {} -auto_ptr InsetMathEnv::doClone() const +auto_ptr InsetMathEnv::doClone() const { - return auto_ptr(new InsetMathEnv(*this)); + return auto_ptr(new InsetMathEnv(*this)); } diff --git a/src/mathed/InsetMathEnv.h b/src/mathed/InsetMathEnv.h index 49922d4cc9..7d73a875d5 100644 --- a/src/mathed/InsetMathEnv.h +++ b/src/mathed/InsetMathEnv.h @@ -37,7 +37,7 @@ public: void infoize(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// name of that environment docstring name_; }; diff --git a/src/mathed/InsetMathExFunc.cpp b/src/mathed/InsetMathExFunc.cpp index b716af8b80..1b097e928e 100644 --- a/src/mathed/InsetMathExFunc.cpp +++ b/src/mathed/InsetMathExFunc.cpp @@ -36,9 +36,9 @@ InsetMathExFunc::InsetMathExFunc(docstring const & name, MathData const & ar) } -auto_ptr InsetMathExFunc::doClone() const +auto_ptr InsetMathExFunc::doClone() const { - return auto_ptr(new InsetMathExFunc(*this)); + return auto_ptr(new InsetMathExFunc(*this)); } diff --git a/src/mathed/InsetMathExFunc.h b/src/mathed/InsetMathExFunc.h index aa44fda798..9c03873cb1 100644 --- a/src/mathed/InsetMathExFunc.h +++ b/src/mathed/InsetMathExFunc.h @@ -48,7 +48,7 @@ public: void octave(OctaveStream &) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// docstring const name_; }; diff --git a/src/mathed/InsetMathExInt.cpp b/src/mathed/InsetMathExInt.cpp index 23fca486bc..543daa89e5 100644 --- a/src/mathed/InsetMathExInt.cpp +++ b/src/mathed/InsetMathExInt.cpp @@ -38,9 +38,9 @@ InsetMathExInt::InsetMathExInt(docstring const & name) // 3 - upper -auto_ptr InsetMathExInt::doClone() const +auto_ptr InsetMathExInt::doClone() const { - return auto_ptr(new InsetMathExInt(*this)); + return auto_ptr(new InsetMathExInt(*this)); } diff --git a/src/mathed/InsetMathExInt.h b/src/mathed/InsetMathExInt.h index f1f51d45f4..5ed5a4ca87 100644 --- a/src/mathed/InsetMathExInt.h +++ b/src/mathed/InsetMathExInt.h @@ -46,7 +46,7 @@ public: /// void write(WriteStream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// bool hasScripts() const; diff --git a/src/mathed/InsetMathFBox.cpp b/src/mathed/InsetMathFBox.cpp index 642c9cd64a..de0e3559f1 100644 --- a/src/mathed/InsetMathFBox.cpp +++ b/src/mathed/InsetMathFBox.cpp @@ -29,9 +29,9 @@ InsetMathFBox::InsetMathFBox() {} -auto_ptr InsetMathFBox::doClone() const +auto_ptr InsetMathFBox::doClone() const { - return auto_ptr(new InsetMathFBox(*this)); + return auto_ptr(new InsetMathFBox(*this)); } diff --git a/src/mathed/InsetMathFBox.h b/src/mathed/InsetMathFBox.h index 9e8e1a4575..e7273b9608 100644 --- a/src/mathed/InsetMathFBox.h +++ b/src/mathed/InsetMathFBox.h @@ -36,7 +36,7 @@ public: /// void infoize(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathFont.cpp b/src/mathed/InsetMathFont.cpp index e079868a1a..bfeeeff397 100644 --- a/src/mathed/InsetMathFont.cpp +++ b/src/mathed/InsetMathFont.cpp @@ -28,9 +28,9 @@ InsetMathFont::InsetMathFont(latexkeys const * key) {} -auto_ptr InsetMathFont::doClone() const +auto_ptr InsetMathFont::doClone() const { - return auto_ptr(new InsetMathFont(*this)); + return auto_ptr(new InsetMathFont(*this)); } diff --git a/src/mathed/InsetMathFont.h b/src/mathed/InsetMathFont.h index 72a0728a6a..bfa380d191 100644 --- a/src/mathed/InsetMathFont.h +++ b/src/mathed/InsetMathFont.h @@ -49,7 +49,7 @@ public: int kerning() const { return cell(0).kerning(); } private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// the font to be used on screen latexkeys const * key_; }; diff --git a/src/mathed/InsetMathFontOld.cpp b/src/mathed/InsetMathFontOld.cpp index d061280118..c68a75c6d1 100644 --- a/src/mathed/InsetMathFontOld.cpp +++ b/src/mathed/InsetMathFontOld.cpp @@ -30,9 +30,9 @@ InsetMathFontOld::InsetMathFontOld(latexkeys const * key) } -auto_ptr InsetMathFontOld::doClone() const +auto_ptr InsetMathFontOld::doClone() const { - return auto_ptr(new InsetMathFontOld(*this)); + return auto_ptr(new InsetMathFontOld(*this)); } diff --git a/src/mathed/InsetMathFontOld.h b/src/mathed/InsetMathFontOld.h index 3cdf775602..f0d9d79f57 100644 --- a/src/mathed/InsetMathFontOld.h +++ b/src/mathed/InsetMathFontOld.h @@ -47,7 +47,7 @@ public: int kerning() const { return cell(0).kerning(); } private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// the font to be used on screen latexkeys const * key_; }; diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index 0237227f8e..6ba3d797b0 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -33,9 +33,9 @@ InsetMathFrac::InsetMathFrac(Kind kind) {} -auto_ptr InsetMathFrac::doClone() const +auto_ptr InsetMathFrac::doClone() const { - return auto_ptr(new InsetMathFrac(*this)); + return auto_ptr(new InsetMathFrac(*this)); } diff --git a/src/mathed/InsetMathFrac.h b/src/mathed/InsetMathFrac.h index ae361f0b99..e80389281b 100644 --- a/src/mathed/InsetMathFrac.h +++ b/src/mathed/InsetMathFrac.h @@ -62,7 +62,7 @@ public: /// void validate(LaTeXFeatures & features) const; public: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// Kind kind_; }; diff --git a/src/mathed/InsetMathFrameBox.cpp b/src/mathed/InsetMathFrameBox.cpp index 5bd9b9302e..2e7508fe30 100644 --- a/src/mathed/InsetMathFrameBox.cpp +++ b/src/mathed/InsetMathFrameBox.cpp @@ -28,9 +28,9 @@ InsetMathFrameBox::InsetMathFrameBox() {} -auto_ptr InsetMathFrameBox::doClone() const +auto_ptr InsetMathFrameBox::doClone() const { - return auto_ptr(new InsetMathFrameBox(*this)); + return auto_ptr(new InsetMathFrameBox(*this)); } diff --git a/src/mathed/InsetMathFrameBox.h b/src/mathed/InsetMathFrameBox.h index 445bc1468e..fc38c0bd26 100644 --- a/src/mathed/InsetMathFrameBox.h +++ b/src/mathed/InsetMathFrameBox.h @@ -34,7 +34,7 @@ public: /// mode_type currentMode() const { return TEXT_MODE; } private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// width of '[' in current font mutable int w_; }; diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index c0f13b7983..0d6918d1bb 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -71,7 +71,7 @@ public: } protected: - InsetBase & inset() const { return inset_; } + Inset & inset() const { return inset_; } InsetMathGrid & inset_; }; @@ -184,9 +184,9 @@ InsetMathGrid::InsetMathGrid(col_type m, row_type n, char v, docstring const & h } -auto_ptr InsetMathGrid::doClone() const +auto_ptr InsetMathGrid::doClone() const { - return auto_ptr(new InsetMathGrid(*this)); + return auto_ptr(new InsetMathGrid(*this)); } diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h index ba221fdc48..3faa33f4ea 100644 --- a/src/mathed/InsetMathGrid.h +++ b/src/mathed/InsetMathGrid.h @@ -245,7 +245,7 @@ protected: /// char v_align_; // add approp. type private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 612e08d352..a26f7556b3 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -188,9 +188,9 @@ InsetMathHull::~InsetMathHull() {} -auto_ptr InsetMathHull::doClone() const +auto_ptr InsetMathHull::doClone() const { - return auto_ptr(new InsetMathHull(*this)); + return auto_ptr(new InsetMathHull(*this)); } @@ -208,7 +208,7 @@ InsetMathHull & InsetMathHull::operator=(InsetMathHull const & other) } -InsetBase * InsetMathHull::editXY(Cursor & cur, int x, int y) +Inset * InsetMathHull::editXY(Cursor & cur, int x, int y) { if (use_preview_) { edit(cur, true); @@ -1128,7 +1128,7 @@ void InsetMathHull::doDispatch(Cursor & cur, FuncRequest & cmd) docstring old = label(r); if (str != old) { cur.bv().buffer()->changeRefsIfUnique(old, str, - InsetBase::REF_CODE); + Inset::REF_CODE); label(r, str); } break; @@ -1367,7 +1367,7 @@ void InsetMathHull::revealCodes(Cursor & cur) const } -InsetBase::Code InsetMathHull::lyxCode() const +Inset::Code InsetMathHull::lyxCode() const { return MATH_CODE; } diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h index 027488149f..f858e76f9c 100644 --- a/src/mathed/InsetMathHull.h +++ b/src/mathed/InsetMathHull.h @@ -133,7 +133,7 @@ protected: docstring eolString(row_type row, bool emptyline, bool fragile) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// void setType(HullType type); /// @@ -198,7 +198,7 @@ public: /// void edit(Cursor & cur, bool left); /// - InsetBase * editXY(Cursor & cur, int x, int y); + Inset * editXY(Cursor & cur, int x, int y); /// bool display() const; /// diff --git a/src/mathed/InsetMathKern.cpp b/src/mathed/InsetMathKern.cpp index d9fb774993..2b2b1efc53 100644 --- a/src/mathed/InsetMathKern.cpp +++ b/src/mathed/InsetMathKern.cpp @@ -46,9 +46,9 @@ InsetMathKern::InsetMathKern(docstring const & s) } -auto_ptr InsetMathKern::doClone() const +auto_ptr InsetMathKern::doClone() const { - return auto_ptr(new InsetMathKern(*this)); + return auto_ptr(new InsetMathKern(*this)); } diff --git a/src/mathed/InsetMathKern.h b/src/mathed/InsetMathKern.h index cb75de0134..8a1e3ee047 100644 --- a/src/mathed/InsetMathKern.h +++ b/src/mathed/InsetMathKern.h @@ -39,7 +39,7 @@ public: /// void normalize(NormalStream & ns) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// width in em Length wid_; }; diff --git a/src/mathed/InsetMathLefteqn.cpp b/src/mathed/InsetMathLefteqn.cpp index 4122d781f9..3c3dc4d572 100644 --- a/src/mathed/InsetMathLefteqn.cpp +++ b/src/mathed/InsetMathLefteqn.cpp @@ -27,9 +27,9 @@ InsetMathLefteqn::InsetMathLefteqn() {} -auto_ptr InsetMathLefteqn::doClone() const +auto_ptr InsetMathLefteqn::doClone() const { - return auto_ptr(new InsetMathLefteqn(*this)); + return auto_ptr(new InsetMathLefteqn(*this)); } diff --git a/src/mathed/InsetMathLefteqn.h b/src/mathed/InsetMathLefteqn.h index aecffbfe6c..7526113b5f 100644 --- a/src/mathed/InsetMathLefteqn.h +++ b/src/mathed/InsetMathLefteqn.h @@ -33,7 +33,7 @@ public: /// void infoize(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathLim.cpp b/src/mathed/InsetMathLim.cpp index d088d80fa3..ccde5013e1 100644 --- a/src/mathed/InsetMathLim.cpp +++ b/src/mathed/InsetMathLim.cpp @@ -32,9 +32,9 @@ InsetMathLim::InsetMathLim } -auto_ptr InsetMathLim::doClone() const +auto_ptr InsetMathLim::doClone() const { - return auto_ptr(new InsetMathLim(*this)); + return auto_ptr(new InsetMathLim(*this)); } diff --git a/src/mathed/InsetMathLim.h b/src/mathed/InsetMathLim.h index 2a8f3e390b..bc95d0e38d 100644 --- a/src/mathed/InsetMathLim.h +++ b/src/mathed/InsetMathLim.h @@ -43,7 +43,7 @@ public: /// void write(WriteStream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathMBox.cpp b/src/mathed/InsetMathMBox.cpp index bdc95de8d6..1b009cf3e8 100644 --- a/src/mathed/InsetMathMBox.cpp +++ b/src/mathed/InsetMathMBox.cpp @@ -49,9 +49,9 @@ InsetMathMBox::InsetMathMBox(LyXLayout_ptr const & layout) } -auto_ptr InsetMathMBox::doClone() const +auto_ptr InsetMathMBox::doClone() const { - return auto_ptr(new InsetMathMBox(*this)); + return auto_ptr(new InsetMathMBox(*this)); } diff --git a/src/mathed/InsetMathMBox.h b/src/mathed/InsetMathMBox.h index ed10e0b49d..35acd9f66d 100644 --- a/src/mathed/InsetMathMBox.h +++ b/src/mathed/InsetMathMBox.h @@ -61,7 +61,7 @@ protected: mutable LyXText text_; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathMakebox.cpp b/src/mathed/InsetMathMakebox.cpp index fb6a0b09a4..ee863e1d46 100644 --- a/src/mathed/InsetMathMakebox.cpp +++ b/src/mathed/InsetMathMakebox.cpp @@ -28,9 +28,9 @@ InsetMathMakebox::InsetMathMakebox() {} -auto_ptr InsetMathMakebox::doClone() const +auto_ptr InsetMathMakebox::doClone() const { - return auto_ptr(new InsetMathMakebox(*this)); + return auto_ptr(new InsetMathMakebox(*this)); } diff --git a/src/mathed/InsetMathMakebox.h b/src/mathed/InsetMathMakebox.h index 1c459f2ea1..480f42d70a 100644 --- a/src/mathed/InsetMathMakebox.h +++ b/src/mathed/InsetMathMakebox.h @@ -37,7 +37,7 @@ public: /// void infoize(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// width of '[' in current font mutable int w_; }; diff --git a/src/mathed/InsetMathMatrix.cpp b/src/mathed/InsetMathMatrix.cpp index feb56cb3df..ef1ac7d8dc 100644 --- a/src/mathed/InsetMathMatrix.cpp +++ b/src/mathed/InsetMathMatrix.cpp @@ -25,9 +25,9 @@ InsetMathMatrix::InsetMathMatrix(InsetMathGrid const & p) {} -auto_ptr InsetMathMatrix::doClone() const +auto_ptr InsetMathMatrix::doClone() const { - return auto_ptr(new InsetMathMatrix(*this)); + return auto_ptr(new InsetMathMatrix(*this)); } diff --git a/src/mathed/InsetMathMatrix.h b/src/mathed/InsetMathMatrix.h index d0b3c9f39d..0b65634c64 100644 --- a/src/mathed/InsetMathMatrix.h +++ b/src/mathed/InsetMathMatrix.h @@ -44,7 +44,7 @@ public: /// void octave(OctaveStream &) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 517c045c31..fbeeac1752 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -831,7 +831,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) case LFUN_MATH_MODE: { #if 1 // ignore math-mode on when already in math mode - if (currentMode() == InsetBase::MATH_MODE && cmd.argument() == "on") + if (currentMode() == Inset::MATH_MODE && cmd.argument() == "on") break; cur.macroModeClose(); docstring const save_selection = grabAndEraseSelection(cur); @@ -842,7 +842,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) cur.pushLeft(*cur.nextInset()); cur.niceInsert(save_selection); #else - if (currentMode() == InsetBase::TEXT_MODE) { + if (currentMode() == Inset::TEXT_MODE) { cur.niceInsert(MathAtom(new InsetMathHull("simple"))); cur.message(_("create new math text environment ($...$)")); } else { @@ -1101,7 +1101,7 @@ void InsetMathNest::edit(Cursor & cur, bool left) } -InsetBase * InsetMathNest::editXY(Cursor & cur, int x, int y) +Inset * InsetMathNest::editXY(Cursor & cur, int x, int y) { int idx_min = 0; int dist_min = 1000000; diff --git a/src/mathed/InsetMathNest.h b/src/mathed/InsetMathNest.h index 1ae230a284..0460e93e8d 100644 --- a/src/mathed/InsetMathNest.h +++ b/src/mathed/InsetMathNest.h @@ -48,7 +48,7 @@ public: /// void edit(Cursor & cur, bool left); /// - InsetBase * editXY(Cursor & cur, int x, int y); + Inset * editXY(Cursor & cur, int x, int y); /// order of movement through the cells when pressing the left key bool idxLeft(Cursor &) const; diff --git a/src/mathed/InsetMathNumber.cpp b/src/mathed/InsetMathNumber.cpp index 0a56cb01e9..5247af4877 100644 --- a/src/mathed/InsetMathNumber.cpp +++ b/src/mathed/InsetMathNumber.cpp @@ -27,9 +27,9 @@ InsetMathNumber::InsetMathNumber(docstring const & s) {} -auto_ptr InsetMathNumber::doClone() const +auto_ptr InsetMathNumber::doClone() const { - return auto_ptr(new InsetMathNumber(*this)); + return auto_ptr(new InsetMathNumber(*this)); } diff --git a/src/mathed/InsetMathNumber.h b/src/mathed/InsetMathNumber.h index 606603e6df..e9142256a3 100644 --- a/src/mathed/InsetMathNumber.h +++ b/src/mathed/InsetMathNumber.h @@ -48,7 +48,7 @@ public: void write(WriteStream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// the number as string docstring str_; }; diff --git a/src/mathed/InsetMathOverset.cpp b/src/mathed/InsetMathOverset.cpp index 15727f9086..7cf16f20e7 100644 --- a/src/mathed/InsetMathOverset.cpp +++ b/src/mathed/InsetMathOverset.cpp @@ -24,9 +24,9 @@ using std::max; using std::auto_ptr; -auto_ptr InsetMathOverset::doClone() const +auto_ptr InsetMathOverset::doClone() const { - return auto_ptr(new InsetMathOverset(*this)); + return auto_ptr(new InsetMathOverset(*this)); } diff --git a/src/mathed/InsetMathOverset.h b/src/mathed/InsetMathOverset.h index cb15781591..078ccf5571 100644 --- a/src/mathed/InsetMathOverset.h +++ b/src/mathed/InsetMathOverset.h @@ -36,7 +36,7 @@ public: /// void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathPar.cpp b/src/mathed/InsetMathPar.cpp index 4fef89efe3..cb63ec8454 100644 --- a/src/mathed/InsetMathPar.cpp +++ b/src/mathed/InsetMathPar.cpp @@ -60,9 +60,9 @@ void InsetMathPar::infoize(odocstream & os) const } -auto_ptr InsetMathPar::doClone() const +auto_ptr InsetMathPar::doClone() const { - return auto_ptr(new InsetMathPar(*this)); + return auto_ptr(new InsetMathPar(*this)); } diff --git a/src/mathed/InsetMathPar.h b/src/mathed/InsetMathPar.h index 29d62b98d4..500428c796 100644 --- a/src/mathed/InsetMathPar.h +++ b/src/mathed/InsetMathPar.h @@ -36,7 +36,7 @@ public: void write(WriteStream & os) const; private: /// - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathPhantom.cpp b/src/mathed/InsetMathPhantom.cpp index 21ecfe9e50..4e18c7661e 100644 --- a/src/mathed/InsetMathPhantom.cpp +++ b/src/mathed/InsetMathPhantom.cpp @@ -29,9 +29,9 @@ InsetMathPhantom::InsetMathPhantom(Kind k) {} -std::auto_ptr InsetMathPhantom::doClone() const +std::auto_ptr InsetMathPhantom::doClone() const { - return std::auto_ptr(new InsetMathPhantom(*this)); + return std::auto_ptr(new InsetMathPhantom(*this)); } diff --git a/src/mathed/InsetMathPhantom.h b/src/mathed/InsetMathPhantom.h index edefb74dff..3b5c6067da 100644 --- a/src/mathed/InsetMathPhantom.h +++ b/src/mathed/InsetMathPhantom.h @@ -39,7 +39,7 @@ public: void infoize(odocstream & os) const; private: /// - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// Kind kind_; }; diff --git a/src/mathed/InsetMathRef.cpp b/src/mathed/InsetMathRef.cpp index a944341049..501e67b979 100644 --- a/src/mathed/InsetMathRef.cpp +++ b/src/mathed/InsetMathRef.cpp @@ -46,9 +46,9 @@ InsetMathRef::InsetMathRef(docstring const & data) {} -auto_ptr InsetMathRef::doClone() const +auto_ptr InsetMathRef::doClone() const { - return auto_ptr(new InsetMathRef(*this)); + return auto_ptr(new InsetMathRef(*this)); } diff --git a/src/mathed/InsetMathRef.h b/src/mathed/InsetMathRef.h index fb208d9b96..7683ca587f 100644 --- a/src/mathed/InsetMathRef.h +++ b/src/mathed/InsetMathRef.h @@ -62,7 +62,7 @@ protected: bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; private: /// - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathRoot.cpp b/src/mathed/InsetMathRoot.cpp index 9da52c7e65..fc7d1d5ade 100644 --- a/src/mathed/InsetMathRoot.cpp +++ b/src/mathed/InsetMathRoot.cpp @@ -32,9 +32,9 @@ InsetMathRoot::InsetMathRoot() {} -auto_ptr InsetMathRoot::doClone() const +auto_ptr InsetMathRoot::doClone() const { - return auto_ptr(new InsetMathRoot(*this)); + return auto_ptr(new InsetMathRoot(*this)); } diff --git a/src/mathed/InsetMathRoot.h b/src/mathed/InsetMathRoot.h index e19978eda1..ee0bea3f14 100644 --- a/src/mathed/InsetMathRoot.h +++ b/src/mathed/InsetMathRoot.h @@ -44,7 +44,7 @@ public: /// void octave(OctaveStream &) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp index 71aeeff773..ebb90bad29 100644 --- a/src/mathed/InsetMathScript.cpp +++ b/src/mathed/InsetMathScript.cpp @@ -52,9 +52,9 @@ InsetMathScript::InsetMathScript(MathAtom const & at, bool up) } -auto_ptr InsetMathScript::doClone() const +auto_ptr InsetMathScript::doClone() const { - return auto_ptr(new InsetMathScript(*this)); + return auto_ptr(new InsetMathScript(*this)); } @@ -440,7 +440,7 @@ bool InsetMathScript::hasDown() const } -InsetBase::idx_type InsetMathScript::idxOfScript(bool up) const +Inset::idx_type InsetMathScript::idxOfScript(bool up) const { if (nargs() == 1) return 0; diff --git a/src/mathed/InsetMathScript.h b/src/mathed/InsetMathScript.h index b13d163289..0d43f95d6e 100644 --- a/src/mathed/InsetMathScript.h +++ b/src/mathed/InsetMathScript.h @@ -105,7 +105,7 @@ public: protected: virtual void doDispatch(Cursor & cur, FuncRequest & cmd); private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// returns x offset for main part int dxx() const; /// returns width of nucleus if any diff --git a/src/mathed/InsetMathSize.cpp b/src/mathed/InsetMathSize.cpp index 23eb69812a..c94700b5d4 100644 --- a/src/mathed/InsetMathSize.cpp +++ b/src/mathed/InsetMathSize.cpp @@ -29,9 +29,9 @@ InsetMathSize::InsetMathSize(latexkeys const * l) {} -auto_ptr InsetMathSize::doClone() const +auto_ptr InsetMathSize::doClone() const { - return auto_ptr(new InsetMathSize(*this)); + return auto_ptr(new InsetMathSize(*this)); } diff --git a/src/mathed/InsetMathSize.h b/src/mathed/InsetMathSize.h index d71c3b2356..0795a2f126 100644 --- a/src/mathed/InsetMathSize.h +++ b/src/mathed/InsetMathSize.h @@ -40,7 +40,7 @@ public: /// void infoize(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// latexkeys const * key_; /// diff --git a/src/mathed/InsetMathSpace.cpp b/src/mathed/InsetMathSpace.cpp index 144a6c534e..eab748dfda 100644 --- a/src/mathed/InsetMathSpace.cpp +++ b/src/mathed/InsetMathSpace.cpp @@ -75,9 +75,9 @@ InsetMathSpace::InsetMathSpace(docstring const & name) } -auto_ptr InsetMathSpace::doClone() const +auto_ptr InsetMathSpace::doClone() const { - return auto_ptr(new InsetMathSpace(*this)); + return auto_ptr(new InsetMathSpace(*this)); } diff --git a/src/mathed/InsetMathSpace.h b/src/mathed/InsetMathSpace.h index abb7129ee7..c421bc1a84 100644 --- a/src/mathed/InsetMathSpace.h +++ b/src/mathed/InsetMathSpace.h @@ -49,7 +49,7 @@ public: /// void write(WriteStream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// int space_; }; diff --git a/src/mathed/InsetMathSplit.cpp b/src/mathed/InsetMathSplit.cpp index 781c6ec2c8..2b68fc3478 100644 --- a/src/mathed/InsetMathSplit.cpp +++ b/src/mathed/InsetMathSplit.cpp @@ -38,9 +38,9 @@ InsetMathSplit::InsetMathSplit(docstring const & name, char valign) } -auto_ptr InsetMathSplit::doClone() const +auto_ptr InsetMathSplit::doClone() const { - return auto_ptr(new InsetMathSplit(*this)); + return auto_ptr(new InsetMathSplit(*this)); } diff --git a/src/mathed/InsetMathSplit.h b/src/mathed/InsetMathSplit.h index b258958e39..959c013b1d 100644 --- a/src/mathed/InsetMathSplit.h +++ b/src/mathed/InsetMathSplit.h @@ -39,7 +39,7 @@ public: char defaultColAlign(col_type); private: /// - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// docstring name_; }; diff --git a/src/mathed/InsetMathSqrt.cpp b/src/mathed/InsetMathSqrt.cpp index 9df6fca71b..95df08bd2b 100644 --- a/src/mathed/InsetMathSqrt.cpp +++ b/src/mathed/InsetMathSqrt.cpp @@ -28,9 +28,9 @@ InsetMathSqrt::InsetMathSqrt() {} -auto_ptr InsetMathSqrt::doClone() const +auto_ptr InsetMathSqrt::doClone() const { - return auto_ptr(new InsetMathSqrt(*this)); + return auto_ptr(new InsetMathSqrt(*this)); } diff --git a/src/mathed/InsetMathSqrt.h b/src/mathed/InsetMathSqrt.h index a4407d4a28..bd8f466066 100644 --- a/src/mathed/InsetMathSqrt.h +++ b/src/mathed/InsetMathSqrt.h @@ -46,7 +46,7 @@ public: /// void mathmlize(MathStream &) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathStackrel.cpp b/src/mathed/InsetMathStackrel.cpp index 9f1a9baba9..c45ae2c78a 100644 --- a/src/mathed/InsetMathStackrel.cpp +++ b/src/mathed/InsetMathStackrel.cpp @@ -26,9 +26,9 @@ InsetMathStackrel::InsetMathStackrel() {} -auto_ptr InsetMathStackrel::doClone() const +auto_ptr InsetMathStackrel::doClone() const { - return auto_ptr(new InsetMathStackrel(*this)); + return auto_ptr(new InsetMathStackrel(*this)); } diff --git a/src/mathed/InsetMathStackrel.h b/src/mathed/InsetMathStackrel.h index 75c07f7f62..e9537b4580 100644 --- a/src/mathed/InsetMathStackrel.h +++ b/src/mathed/InsetMathStackrel.h @@ -37,7 +37,7 @@ public: /// void normalize(NormalStream &) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathString.cpp b/src/mathed/InsetMathString.cpp index ab4a13704e..3ca3e898b3 100644 --- a/src/mathed/InsetMathString.cpp +++ b/src/mathed/InsetMathString.cpp @@ -27,9 +27,9 @@ InsetMathString::InsetMathString(docstring const & s) {} -auto_ptr InsetMathString::doClone() const +auto_ptr InsetMathString::doClone() const { - return auto_ptr(new InsetMathString(*this)); + return auto_ptr(new InsetMathString(*this)); } diff --git a/src/mathed/InsetMathString.h b/src/mathed/InsetMathString.h index 495de2f005..ad0a22312e 100644 --- a/src/mathed/InsetMathString.h +++ b/src/mathed/InsetMathString.h @@ -50,7 +50,7 @@ public: void write(WriteStream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// the string docstring str_; }; diff --git a/src/mathed/InsetMathSubstack.cpp b/src/mathed/InsetMathSubstack.cpp index c285f0f650..0084eac345 100644 --- a/src/mathed/InsetMathSubstack.cpp +++ b/src/mathed/InsetMathSubstack.cpp @@ -36,9 +36,9 @@ InsetMathSubstack::InsetMathSubstack() {} -auto_ptr InsetMathSubstack::doClone() const +auto_ptr InsetMathSubstack::doClone() const { - return auto_ptr(new InsetMathSubstack(*this)); + return auto_ptr(new InsetMathSubstack(*this)); } diff --git a/src/mathed/InsetMathSubstack.h b/src/mathed/InsetMathSubstack.h index a25029db75..f2b9e5c0aa 100644 --- a/src/mathed/InsetMathSubstack.h +++ b/src/mathed/InsetMathSubstack.h @@ -45,7 +45,7 @@ public: /// void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp index 143caf84c5..32bde73aa8 100644 --- a/src/mathed/InsetMathSymbol.cpp +++ b/src/mathed/InsetMathSymbol.cpp @@ -44,9 +44,9 @@ InsetMathSymbol::InsetMathSymbol(docstring const & name) {} -auto_ptr InsetMathSymbol::doClone() const +auto_ptr InsetMathSymbol::doClone() const { - return auto_ptr(new InsetMathSymbol(*this)); + return auto_ptr(new InsetMathSymbol(*this)); } diff --git a/src/mathed/InsetMathSymbol.h b/src/mathed/InsetMathSymbol.h index 9a1e9ac897..c5f91de0ae 100644 --- a/src/mathed/InsetMathSymbol.h +++ b/src/mathed/InsetMathSymbol.h @@ -72,7 +72,7 @@ public: void infoize2(odocstream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// latexkeys const * sym_; /// diff --git a/src/mathed/InsetMathTFrac.cpp b/src/mathed/InsetMathTFrac.cpp index 92019717a7..5a1fd86df8 100644 --- a/src/mathed/InsetMathTFrac.cpp +++ b/src/mathed/InsetMathTFrac.cpp @@ -34,9 +34,9 @@ InsetMathTFrac::InsetMathTFrac() {} -auto_ptr InsetMathTFrac::doClone() const +auto_ptr InsetMathTFrac::doClone() const { - return auto_ptr(new InsetMathTFrac(*this)); + return auto_ptr(new InsetMathTFrac(*this)); } diff --git a/src/mathed/InsetMathTFrac.h b/src/mathed/InsetMathTFrac.h index ee8f4c9524..5299b0b11a 100644 --- a/src/mathed/InsetMathTFrac.h +++ b/src/mathed/InsetMathTFrac.h @@ -34,7 +34,7 @@ public: /// void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathTabular.cpp b/src/mathed/InsetMathTabular.cpp index 7445044e3e..f93b2884a3 100644 --- a/src/mathed/InsetMathTabular.cpp +++ b/src/mathed/InsetMathTabular.cpp @@ -45,9 +45,9 @@ InsetMathTabular::InsetMathTabular(docstring const & name, char valign, {} -auto_ptr InsetMathTabular::doClone() const +auto_ptr InsetMathTabular::doClone() const { - return auto_ptr(new InsetMathTabular(*this)); + return auto_ptr(new InsetMathTabular(*this)); } diff --git a/src/mathed/InsetMathTabular.h b/src/mathed/InsetMathTabular.h index 4e86b44ab9..1d591924a5 100644 --- a/src/mathed/InsetMathTabular.h +++ b/src/mathed/InsetMathTabular.h @@ -47,7 +47,7 @@ public: void maple(MapleStream &) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// docstring name_; }; diff --git a/src/mathed/InsetMathUnderset.cpp b/src/mathed/InsetMathUnderset.cpp index 0f91a963f4..87392bd4e0 100644 --- a/src/mathed/InsetMathUnderset.cpp +++ b/src/mathed/InsetMathUnderset.cpp @@ -25,9 +25,9 @@ using std::auto_ptr; -auto_ptr InsetMathUnderset::doClone() const +auto_ptr InsetMathUnderset::doClone() const { - return auto_ptr(new InsetMathUnderset(*this)); + return auto_ptr(new InsetMathUnderset(*this)); } diff --git a/src/mathed/InsetMathUnderset.h b/src/mathed/InsetMathUnderset.h index aaf79a588d..c195eb10b6 100644 --- a/src/mathed/InsetMathUnderset.h +++ b/src/mathed/InsetMathUnderset.h @@ -38,7 +38,7 @@ public: /// void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/InsetMathUnknown.cpp b/src/mathed/InsetMathUnknown.cpp index e26e9180ea..a50ac259ec 100644 --- a/src/mathed/InsetMathUnknown.cpp +++ b/src/mathed/InsetMathUnknown.cpp @@ -29,9 +29,9 @@ InsetMathUnknown::InsetMathUnknown(docstring const & nm, bool final, bool black) {} -auto_ptr InsetMathUnknown::doClone() const +auto_ptr InsetMathUnknown::doClone() const { - return auto_ptr(new InsetMathUnknown(*this)); + return auto_ptr(new InsetMathUnknown(*this)); } diff --git a/src/mathed/InsetMathUnknown.h b/src/mathed/InsetMathUnknown.h index 9d30e19807..3391f938c9 100644 --- a/src/mathed/InsetMathUnknown.h +++ b/src/mathed/InsetMathUnknown.h @@ -54,7 +54,7 @@ public: /// int kerning() const { return kerning_; } private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// docstring name_; /// are we finished creating the name? diff --git a/src/mathed/InsetMathXArrow.cpp b/src/mathed/InsetMathXArrow.cpp index dbd16ac31c..02a1e4147b 100644 --- a/src/mathed/InsetMathXArrow.cpp +++ b/src/mathed/InsetMathXArrow.cpp @@ -30,9 +30,9 @@ InsetMathXArrow::InsetMathXArrow(docstring const & name) {} -auto_ptr InsetMathXArrow::doClone() const +auto_ptr InsetMathXArrow::doClone() const { - return auto_ptr(new InsetMathXArrow(*this)); + return auto_ptr(new InsetMathXArrow(*this)); } diff --git a/src/mathed/InsetMathXArrow.h b/src/mathed/InsetMathXArrow.h index 0355b15fd0..f76758c0d9 100644 --- a/src/mathed/InsetMathXArrow.h +++ b/src/mathed/InsetMathXArrow.h @@ -35,7 +35,7 @@ public: void validate(LaTeXFeatures & features) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// bool upper() const; /// diff --git a/src/mathed/InsetMathXYArrow.cpp b/src/mathed/InsetMathXYArrow.cpp index 5520ca47d5..3449271568 100644 --- a/src/mathed/InsetMathXYArrow.cpp +++ b/src/mathed/InsetMathXYArrow.cpp @@ -28,9 +28,9 @@ InsetMathXYArrow::InsetMathXYArrow() {} -std::auto_ptr InsetMathXYArrow::clone() const +std::auto_ptr InsetMathXYArrow::clone() const { - return std::auto_ptr(new InsetMathXYArrow(*this)); + return std::auto_ptr(new InsetMathXYArrow(*this)); } diff --git a/src/mathed/InsetMathXYArrow.h b/src/mathed/InsetMathXYArrow.h index 447e9604e1..98e6636ba2 100644 --- a/src/mathed/InsetMathXYArrow.h +++ b/src/mathed/InsetMathXYArrow.h @@ -28,7 +28,7 @@ public: /// InsetMathXYArrow(); /// - virtual std::auto_ptr clone() const; + virtual std::auto_ptr clone() const; /// bool metrics(MetricsInfo & mi) const; /// diff --git a/src/mathed/InsetMathXYMatrix.cpp b/src/mathed/InsetMathXYMatrix.cpp index e5250f897b..367d522e51 100644 --- a/src/mathed/InsetMathXYMatrix.cpp +++ b/src/mathed/InsetMathXYMatrix.cpp @@ -25,9 +25,9 @@ InsetMathXYMatrix::InsetMathXYMatrix(Length const & s, char c) {} -std::auto_ptr InsetMathXYMatrix::doClone() const +std::auto_ptr InsetMathXYMatrix::doClone() const { - return std::auto_ptr(new InsetMathXYMatrix(*this)); + return std::auto_ptr(new InsetMathXYMatrix(*this)); } diff --git a/src/mathed/InsetMathXYMatrix.h b/src/mathed/InsetMathXYMatrix.h index 5c7f1b2a3a..9afc176347 100644 --- a/src/mathed/InsetMathXYMatrix.h +++ b/src/mathed/InsetMathXYMatrix.h @@ -46,7 +46,7 @@ public: void validate(LaTeXFeatures & features) const; private: /// - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// extra spacing, may be empty Length spacing_; /// diff --git a/src/mathed/MacroTable.cpp b/src/mathed/MacroTable.cpp index 871dc6edb6..b090ef5709 100644 --- a/src/mathed/MacroTable.cpp +++ b/src/mathed/MacroTable.cpp @@ -55,7 +55,7 @@ void MacroData::expand(vector const & args, MathData & to) const for (DocIterator it = doc_iterator_begin(inset); it; it.forwardChar()) { if (!it.nextInset()) continue; - if (it.nextInset()->lyxCode() != InsetBase::MATHMACROARG_CODE) + if (it.nextInset()->lyxCode() != Inset::MATHMACROARG_CODE) continue; //it.cell().erase(it.pos()); //it.cell().insert(it.pos(), it.nextInset()->asInsetMath() diff --git a/src/mathed/MathAtom.cpp b/src/mathed/MathAtom.cpp index 87a569d821..dfb4329bb8 100644 --- a/src/mathed/MathAtom.cpp +++ b/src/mathed/MathAtom.cpp @@ -24,7 +24,7 @@ MathAtom::MathAtom() {} -MathAtom::MathAtom(InsetBase * p) +MathAtom::MathAtom(Inset * p) : nucleus_(static_cast(p)) {} diff --git a/src/mathed/MathAtom.h b/src/mathed/MathAtom.h index 2d5247931b..5a0adf8672 100644 --- a/src/mathed/MathAtom.h +++ b/src/mathed/MathAtom.h @@ -42,7 +42,7 @@ Andre' namespace lyx { -class InsetBase; +class Inset; class InsetMath; class MathAtom { @@ -51,7 +51,7 @@ public: // std::containers MathAtom(); /// the "real constructor" - explicit MathAtom(InsetBase * p); + explicit MathAtom(Inset * p); /// copy constructor, invokes nucleus_->clone() MathAtom(MathAtom const &); /// we really need to clean up diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index f12c14e490..dc34f00479 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -46,15 +46,15 @@ public: void draw(PainterInfo &, int x, int y) const; private: - std::auto_ptr doClone() const; + std::auto_ptr doClone() const; MathData const * value_; docstring macroName_; }; -auto_ptr MathMacroArgumentValue::doClone() const +auto_ptr MathMacroArgumentValue::doClone() const { - return auto_ptr(new MathMacroArgumentValue(*this)); + return auto_ptr(new MathMacroArgumentValue(*this)); } @@ -86,9 +86,9 @@ MathMacro::MathMacro(docstring const & name, int numargs) {} -auto_ptr MathMacro::doClone() const +auto_ptr MathMacro::doClone() const { - return auto_ptr(new MathMacro(*this)); + return auto_ptr(new MathMacro(*this)); } @@ -208,7 +208,7 @@ void MathMacro::validate(LaTeXFeatures & features) const } -InsetBase * MathMacro::editXY(Cursor & cur, int x, int y) +Inset * MathMacro::editXY(Cursor & cur, int x, int y) { // We may have 0 arguments, but InsetMathNest requires at least one. if (nargs() > 0) { diff --git a/src/mathed/MathMacro.h b/src/mathed/MathMacro.h index e5d4196b97..5d1428c7c0 100644 --- a/src/mathed/MathMacro.h +++ b/src/mathed/MathMacro.h @@ -42,7 +42,7 @@ public: void cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const; /// - InsetBase * editXY(Cursor & cur, int x, int y); + Inset * editXY(Cursor & cur, int x, int y); /// target pos when we enter the inset from the left by pressing "Right" bool idxFirst(Cursor &) const; /// target pos when we enter the inset from the right by pressing "Left" @@ -69,7 +69,7 @@ public: void infoize2(odocstream &) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// void updateExpansion() const; /// diff --git a/src/mathed/MathMacroArgument.cpp b/src/mathed/MathMacroArgument.cpp index 4d2badb9e0..d1735f1544 100644 --- a/src/mathed/MathMacroArgument.cpp +++ b/src/mathed/MathMacroArgument.cpp @@ -42,9 +42,9 @@ MathMacroArgument::MathMacroArgument(size_t n) } -auto_ptr MathMacroArgument::doClone() const +auto_ptr MathMacroArgument::doClone() const { - return auto_ptr(new MathMacroArgument(*this)); + return auto_ptr(new MathMacroArgument(*this)); } diff --git a/src/mathed/MathMacroArgument.h b/src/mathed/MathMacroArgument.h index 1fe0f2ea9f..8a8ef5ea6a 100644 --- a/src/mathed/MathMacroArgument.h +++ b/src/mathed/MathMacroArgument.h @@ -31,7 +31,7 @@ public: /// std::size_t number() const { return number_; } /// - InsetBase::Code lyxCode() const { return MATHMACROARG_CODE; } + Inset::Code lyxCode() const { return MATHMACROARG_CODE; } /// void normalize(NormalStream &) const; @@ -39,7 +39,7 @@ public: void write(WriteStream & os) const; private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// A number between 1 and 9 std::size_t number_; /// diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index 5650b4012f..fef5d4dd81 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -72,9 +72,9 @@ MathMacroTemplate::MathMacroTemplate(docstring const & str) } -auto_ptr MathMacroTemplate::doClone() const +auto_ptr MathMacroTemplate::doClone() const { - return auto_ptr(new MathMacroTemplate(*this)); + return auto_ptr(new MathMacroTemplate(*this)); } diff --git a/src/mathed/MathMacroTemplate.h b/src/mathed/MathMacroTemplate.h index b657ea4793..7dd81890a9 100644 --- a/src/mathed/MathMacroTemplate.h +++ b/src/mathed/MathMacroTemplate.h @@ -65,10 +65,10 @@ public: /// identifies macro templates MathMacroTemplate const * asMacroTemplate() const { return this; } /// - InsetBase::Code lyxCode() const { return MATHMACRO_CODE; } + Inset::Code lyxCode() const { return MATHMACRO_CODE; } private: - virtual std::auto_ptr doClone() const; + virtual std::auto_ptr doClone() const; /// prefix in inset docstring prefix() const; diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 4ff83566f7..93d359824a 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -219,7 +219,7 @@ int latexOptArgInsets(Buffer const & buf, Paragraph const & par, InsetList::const_iterator it = par.insetlist.begin(); InsetList::const_iterator end = par.insetlist.end(); for (; it != end && number > 0 ; ++it) { - if (it->inset->lyxCode() == InsetBase::OPTARG_CODE) { + if (it->inset->lyxCode() == Inset::OPTARG_CODE) { InsetOptArg * ins = static_cast(it->inset); lines += ins->latexOptional(buf, os, runparams); diff --git a/src/output_plaintext.cpp b/src/output_plaintext.cpp index 0bbd748856..76987b7b4b 100644 --- a/src/output_plaintext.cpp +++ b/src/output_plaintext.cpp @@ -209,8 +209,8 @@ void writePlaintextParagraph(Buffer const & buf, OutputParams rp = runparams; rp.depth = par.params().depth(); int len = par.getInset(i)->plaintext(buf, os, rp); - if (len >= InsetBase::PLAINTEXT_NEWLINE) - currlinelen = len - InsetBase::PLAINTEXT_NEWLINE; + if (len >= Inset::PLAINTEXT_NEWLINE) + currlinelen = len - Inset::PLAINTEXT_NEWLINE; else currlinelen += len; break; diff --git a/src/paragraph_funcs.cpp b/src/paragraph_funcs.cpp index d5f1fe240c..0ad45a897f 100644 --- a/src/paragraph_funcs.cpp +++ b/src/paragraph_funcs.cpp @@ -36,7 +36,7 @@ static bool moveItem(Paragraph & fromPar, pos_type fromPos, Change const tmpChange = fromPar.lookupChange(fromPos); if (tmpChar == Paragraph::META_INSET) { - InsetBase * tmpInset = 0; + Inset * tmpInset = 0; if (fromPar.getInset(fromPos)) { // the inset is not in the paragraph any more tmpInset = fromPar.insetlist.release(fromPos); @@ -310,7 +310,7 @@ int numberOfOptArgs(Paragraph const & par) InsetList::const_iterator it = par.insetlist.begin(); InsetList::const_iterator end = par.insetlist.end(); for (; it != end ; ++it) { - if (it->inset->lyxCode() == InsetBase::OPTARG_CODE) + if (it->inset->lyxCode() == Inset::OPTARG_CODE) ++num; } return num; diff --git a/src/paragraph_funcs.h b/src/paragraph_funcs.h index 3593a65d24..92dc4331e7 100644 --- a/src/paragraph_funcs.h +++ b/src/paragraph_funcs.h @@ -19,7 +19,7 @@ namespace lyx { class Buffer; class BufferParams; -class InsetBase; +class Inset; class LyXFont; class Paragraph; class ParagraphList; diff --git a/src/rowpainter.cpp b/src/rowpainter.cpp index ba4c120586..cb8ea41127 100644 --- a/src/rowpainter.cpp +++ b/src/rowpainter.cpp @@ -172,11 +172,11 @@ int RowPainter::leftMargin() const void RowPainter::paintInset(pos_type const pos, LyXFont const & font) { - InsetBase const * inset = par_.getInset(pos); + Inset const * inset = par_.getInset(pos); BOOST_ASSERT(inset); PainterInfo pi(const_cast(&bv_), pain_); // FIXME: We should always use font, see documentation of - // noFontChange() in InsetBase.h. + // noFontChange() in Inset.h. pi.base.font = inset->noFontChange() ? bv_.buffer()->params().getFont() : font; @@ -882,7 +882,7 @@ bool inNarrowInset(PainterInfo & pi) // check whether the current inset is nested in a non-wide inset Cursor & cur = pi.base.bv->cursor(); for (int i = cur.depth() - 1; --i >= 0; ) { - InsetBase * const in = &cur[i].inset(); + Inset * const in = &cur[i].inset(); if (in) { InsetText * t = const_cast(in->asTextInset()); @@ -939,7 +939,7 @@ void paintPar // JSpitzm: We should aim at removing wide() altogether while retaining // typing speed within insets. for (pos_type i = rit->pos() ; i != rit->endpos(); ++i) { - InsetBase const * const in = par.getInset(i); + Inset const * const in = par.getInset(i); if (in) { InsetText * t = const_cast(in->asTextInset()); if (t) diff --git a/src/text.cpp b/src/text.cpp index 34add3a582..42950ecd53 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -156,7 +156,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex, << lex.getLineNo() << "\n" << "Missing \\begin_inset?.\n"; } else if (token == "\\begin_inset") { - InsetBase * inset = readInset(lex, buf); + Inset * inset = readInset(lex, buf); if (inset) par.insertInset(par.size(), inset, font, change); else { @@ -230,7 +230,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex, } } } else { - auto_ptr inset; + auto_ptr inset; if (token == "\\SpecialChar" ) inset.reset(new InsetSpecialChar); else @@ -242,11 +242,11 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex, } else if (token == "\\backslash") { par.insertChar(par.size(), '\\', font, change); } else if (token == "\\newline") { - auto_ptr inset(new InsetNewline); + auto_ptr inset(new InsetNewline); inset->read(buf, lex); par.insertInset(par.size(), inset.release(), font, change); } else if (token == "\\LyXTable") { - auto_ptr inset(new InsetTabular(buf)); + auto_ptr inset(new InsetTabular(buf)); inset->read(buf, lex); par.insertInset(par.size(), inset.release(), font, change); } else if (token == "\\hfill") { @@ -896,14 +896,14 @@ void LyXText::acceptOrRejectChanges(Cursor & cur, ChangeOp op) // skip if this is not the last paragraph of the document // note: the user should be able to accept/reject the par break of the last par! - if (pit == endPit && pit != pars_.size() - 1) + if (pit == endPit && pit + 1 != int(pars_.size())) break; // last iteration anway if (op == ACCEPT) { if (pars_[pit].isInserted(pos)) { pars_[pit].setChange(pos, Change(Change::UNCHANGED)); } else if (pars_[pit].isDeleted(pos)) { - if (pit == pars_.size() - 1) { + if (pit + 1 == int(pars_.size())) { // we cannot remove a par break at the end of the last paragraph; // instead, we mark it unchanged pars_[pit].setChange(pos, Change(Change::UNCHANGED)); @@ -917,7 +917,7 @@ void LyXText::acceptOrRejectChanges(Cursor & cur, ChangeOp op) if (pars_[pit].isDeleted(pos)) { pars_[pit].setChange(pos, Change(Change::UNCHANGED)); } else if (pars_[pit].isInserted(pos)) { - if (pit == pars_.size() - 1) { + if (pit + 1 == int(pars_.size())) { // we mark the par break at the end of the last paragraph unchanged pars_[pit].setChange(pos, Change(Change::UNCHANGED)); } else { @@ -1809,18 +1809,18 @@ docstring LyXText::getPossibleLabel(Cursor & cur) const name = from_ascii(layout->latexname()); // for captions, we just take the caption type - InsetBase * caption_inset = cur.innerInsetOfType(InsetBase::CAPTION_CODE); + Inset * caption_inset = cur.innerInsetOfType(Inset::CAPTION_CODE); if (caption_inset) name = from_ascii(static_cast(caption_inset)->type()); // Inside floats or wraps, if none of the above worked // we want by default the abbreviation of the float type. if (name.empty()) { - InsetBase * float_inset = cur.innerInsetOfType(InsetBase::FLOAT_CODE); + Inset * float_inset = cur.innerInsetOfType(Inset::FLOAT_CODE); if (!float_inset) - float_inset = cur.innerInsetOfType(InsetBase::WRAP_CODE); + float_inset = cur.innerInsetOfType(Inset::WRAP_CODE); if (float_inset) - name = float_inset->getInsetName(); + name = float_inset->insetName(); } // Create a correct prefix for prettyref diff --git a/src/text2.cpp b/src/text2.cpp index 3cc575ea98..7e9db5ff08 100644 --- a/src/text2.cpp +++ b/src/text2.cpp @@ -87,7 +87,7 @@ bool LyXText::isMainText(Buffer const & buffer) const //takes screen x,y coordinates -InsetBase * LyXText::checkInsetHit(BufferView & bv, int x, int y) +Inset * LyXText::checkInsetHit(BufferView & bv, int x, int y) { pit_type pit = getPitNearY(bv, y); BOOST_ASSERT(pit != -1); @@ -103,7 +103,7 @@ InsetBase * LyXText::checkInsetHit(BufferView & bv, int x, int y) InsetList::const_iterator iit = par.insetlist.begin(); InsetList::const_iterator iend = par.insetlist.end(); for (; iit != iend; ++iit) { - InsetBase * inset = iit->inset; + Inset * inset = iit->inset; #if 1 LYXERR(Debug::DEBUG) << BOOST_CURRENT_FUNCTION @@ -358,7 +358,7 @@ void LyXText::setLayout(Cursor & cur, string const & layout) lyx::dispatch(FuncRequest(LFUN_LINE_BEGIN)); lyx::dispatch(FuncRequest(LFUN_LINE_END_SELECT)); lyx::dispatch(FuncRequest(LFUN_CUT)); - InsetBase * inset = new InsetEnvironment(params, layout); + Inset * inset = new InsetEnvironment(params, layout); insertInset(cur, inset); //inset->edit(cur, true); //lyx::dispatch(FuncRequest(LFUN_PASTE)); @@ -623,7 +623,7 @@ void LyXText::setParagraph(Cursor & cur, // this really should just insert the inset and not move the cursor. -void LyXText::insertInset(Cursor & cur, InsetBase * inset) +void LyXText::insertInset(Cursor & cur, Inset * inset) { BOOST_ASSERT(this == cur.text()); BOOST_ASSERT(inset); @@ -846,7 +846,7 @@ Row const & LyXText::getRowNearY(BufferView const & bv, int y, pit_type pit) con // x,y are absolute screen coordinates // sets cursor recursively descending into nested editable insets -InsetBase * LyXText::editXY(Cursor & cur, int x, int y) +Inset * LyXText::editXY(Cursor & cur, int x, int y) { if (lyxerr.debugging(Debug::WORKAREA)) { lyxerr << "LyXText::editXY(cur, " << x << ", " << y << ")" << std::endl; @@ -868,7 +868,7 @@ InsetBase * LyXText::editXY(Cursor & cur, int x, int y) cur.x_target() = x; // try to descend into nested insets - InsetBase * inset = checkInsetHit(cur.bv(), x, y); + Inset * inset = checkInsetHit(cur.bv(), x, y); //lyxerr << "inset " << inset << " hit at x: " << x << " y: " << y << endl; if (!inset) { // Either we deconst editXY or better we move current_font @@ -877,8 +877,8 @@ InsetBase * LyXText::editXY(Cursor & cur, int x, int y) return 0; } - InsetBase * insetBefore = pos? pars_[pit].getInset(pos - 1): 0; - //InsetBase * insetBehind = pars_[pit].getInset(pos); + Inset * insetBefore = pos? pars_[pit].getInset(pos - 1): 0; + //Inset * insetBehind = pars_[pit].getInset(pos); // This should be just before or just behind the // cursor position set above. @@ -905,7 +905,7 @@ bool LyXText::checkAndActivateInset(Cursor & cur, bool front) return false; if (cur.pos() == cur.lastpos()) return false; - InsetBase * inset = cur.nextInset(); + Inset * inset = cur.nextInset(); if (!isHighlyEditableInset(inset)) return false; inset->edit(cur, front); diff --git a/src/text3.cpp b/src/text3.cpp index 7fde18822c..357f6e2b73 100644 --- a/src/text3.cpp +++ b/src/text3.cpp @@ -253,7 +253,7 @@ void specialChar(Cursor & cur, InsetSpecialChar::Kind kind) bool doInsertInset(Cursor & cur, LyXText * text, FuncRequest const & cmd, bool edit, bool pastesel) { - InsetBase * inset = createInset(&cur.bv(), cmd); + Inset * inset = createInset(&cur.bv(), cmd); if (!inset) return false; @@ -728,7 +728,7 @@ void LyXText::dispatch(Cursor & cur, FuncRequest & cmd) case LFUN_INSET_INSERT: { recordUndo(cur); - InsetBase * inset = createInset(bv, cmd); + Inset * inset = createInset(bv, cmd); if (inset) { // FIXME (Abdel 01/02/2006): // What follows would be a partial fix for bug 2154: @@ -741,7 +741,7 @@ void LyXText::dispatch(Cursor & cur, FuncRequest & cmd) // other feature like "automatic labelling". /* Paragraph & par = pars_[cur.pit()]; - if (inset->lyxCode() == InsetBase::LABEL_CODE + if (inset->lyxCode() == Inset::LABEL_CODE && par.layout()->labeltype == LABEL_COUNTER) { // Go to the end of the paragraph // Warning: Because of Change-Tracking, the last @@ -1257,7 +1257,7 @@ void LyXText::dispatch(Cursor & cur, FuncRequest & cmd) case LFUN_INDEX_INSERT: case LFUN_NOMENCL_INSERT: { - InsetBase * inset = createInset(&cur.bv(), cmd); + Inset * inset = createInset(&cur.bv(), cmd); if (!inset) break; recordUndo(cur); @@ -1636,7 +1636,7 @@ bool LyXText::getStatus(Cursor & cur, FuncRequest const & cmd, LyXFont const & font = real_current_font; bool enable = true; - InsetBase::Code code = InsetBase::NO_CODE; + Inset::Code code = Inset::NO_CODE; switch (cmd.action) { @@ -1658,123 +1658,123 @@ bool LyXText::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_DIALOG_SHOW_NEW_INSET: if (cmd.argument() == "bibitem") - code = InsetBase::BIBITEM_CODE; + code = Inset::BIBITEM_CODE; else if (cmd.argument() == "bibtex") - code = InsetBase::BIBTEX_CODE; + code = Inset::BIBTEX_CODE; else if (cmd.argument() == "box") - code = InsetBase::BOX_CODE; + code = Inset::BOX_CODE; else if (cmd.argument() == "branch") - code = InsetBase::BRANCH_CODE; + code = Inset::BRANCH_CODE; else if (cmd.argument() == "citation") - code = InsetBase::CITE_CODE; + code = Inset::CITE_CODE; else if (cmd.argument() == "ert") - code = InsetBase::ERT_CODE; + code = Inset::ERT_CODE; else if (cmd.argument() == "external") - code = InsetBase::EXTERNAL_CODE; + code = Inset::EXTERNAL_CODE; else if (cmd.argument() == "float") - code = InsetBase::FLOAT_CODE; + code = Inset::FLOAT_CODE; else if (cmd.argument() == "graphics") - code = InsetBase::GRAPHICS_CODE; + code = Inset::GRAPHICS_CODE; else if (cmd.argument() == "include") - code = InsetBase::INCLUDE_CODE; + code = Inset::INCLUDE_CODE; else if (cmd.argument() == "index") - code = InsetBase::INDEX_CODE; + code = Inset::INDEX_CODE; else if (cmd.argument() == "nomenclature") - code = InsetBase::NOMENCL_CODE; + code = Inset::NOMENCL_CODE; else if (cmd.argument() == "label") - code = InsetBase::LABEL_CODE; + code = Inset::LABEL_CODE; else if (cmd.argument() == "note") - code = InsetBase::NOTE_CODE; + code = Inset::NOTE_CODE; else if (cmd.argument() == "ref") - code = InsetBase::REF_CODE; + code = Inset::REF_CODE; else if (cmd.argument() == "toc") - code = InsetBase::TOC_CODE; + code = Inset::TOC_CODE; else if (cmd.argument() == "url") - code = InsetBase::URL_CODE; + code = Inset::URL_CODE; else if (cmd.argument() == "vspace") - code = InsetBase::VSPACE_CODE; + code = Inset::VSPACE_CODE; else if (cmd.argument() == "wrap") - code = InsetBase::WRAP_CODE; + code = Inset::WRAP_CODE; break; case LFUN_ERT_INSERT: - code = InsetBase::ERT_CODE; + code = Inset::ERT_CODE; break; case LFUN_FOOTNOTE_INSERT: - code = InsetBase::FOOT_CODE; + code = Inset::FOOT_CODE; break; case LFUN_TABULAR_INSERT: - code = InsetBase::TABULAR_CODE; + code = Inset::TABULAR_CODE; break; case LFUN_MARGINALNOTE_INSERT: - code = InsetBase::MARGIN_CODE; + code = Inset::MARGIN_CODE; break; case LFUN_FLOAT_INSERT: case LFUN_FLOAT_WIDE_INSERT: - code = InsetBase::FLOAT_CODE; + code = Inset::FLOAT_CODE; break; case LFUN_WRAP_INSERT: - code = InsetBase::WRAP_CODE; + code = Inset::WRAP_CODE; break; case LFUN_FLOAT_LIST: - code = InsetBase::FLOAT_LIST_CODE; + code = Inset::FLOAT_LIST_CODE; break; #if 0 case LFUN_LIST_INSERT: - code = InsetBase::LIST_CODE; + code = Inset::LIST_CODE; break; case LFUN_THEOREM_INSERT: - code = InsetBase::THEOREM_CODE; + code = Inset::THEOREM_CODE; break; #endif case LFUN_CAPTION_INSERT: - code = InsetBase::CAPTION_CODE; + code = Inset::CAPTION_CODE; break; case LFUN_NOTE_INSERT: - code = InsetBase::NOTE_CODE; + code = Inset::NOTE_CODE; break; case LFUN_CHARSTYLE_INSERT: - code = InsetBase::CHARSTYLE_CODE; + code = Inset::CHARSTYLE_CODE; if (cur.buffer().params().getLyXTextClass().charstyles().empty()) enable = false; break; case LFUN_BOX_INSERT: - code = InsetBase::BOX_CODE; + code = Inset::BOX_CODE; break; case LFUN_BRANCH_INSERT: - code = InsetBase::BRANCH_CODE; + code = Inset::BRANCH_CODE; if (cur.buffer().getMasterBuffer()->params().branchlist().empty()) enable = false; break; case LFUN_LABEL_INSERT: - code = InsetBase::LABEL_CODE; + code = Inset::LABEL_CODE; break; case LFUN_OPTIONAL_INSERT: - code = InsetBase::OPTARG_CODE; + code = Inset::OPTARG_CODE; enable = numberOfOptArgs(cur.paragraph()) < cur.paragraph().layout()->optionalargs; break; case LFUN_ENVIRONMENT_INSERT: - code = InsetBase::BOX_CODE; + code = Inset::BOX_CODE; break; case LFUN_INDEX_INSERT: - code = InsetBase::INDEX_CODE; + code = Inset::INDEX_CODE; break; case LFUN_INDEX_PRINT: - code = InsetBase::INDEX_PRINT_CODE; + code = Inset::INDEX_PRINT_CODE; break; case LFUN_NOMENCL_INSERT: - code = InsetBase::NOMENCL_CODE; + code = Inset::NOMENCL_CODE; break; case LFUN_NOMENCL_PRINT: - code = InsetBase::NOMENCL_PRINT_CODE; + code = Inset::NOMENCL_PRINT_CODE; break; case LFUN_TOC_INSERT: - code = InsetBase::TOC_CODE; + code = Inset::TOC_CODE; break; case LFUN_HTML_INSERT: case LFUN_URL_INSERT: - code = InsetBase::URL_CODE; + code = Inset::URL_CODE; break; case LFUN_QUOTE_INSERT: // always allow this, since we will inset a raw quote @@ -1786,12 +1786,12 @@ bool LyXText::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_MENU_SEPARATOR_INSERT: case LFUN_DOTS_INSERT: case LFUN_END_OF_SENTENCE_PERIOD_INSERT: - code = InsetBase::SPECIALCHAR_CODE; + code = Inset::SPECIALCHAR_CODE; break; case LFUN_SPACE_INSERT: // slight hack: we know this is allowed in math mode if (cur.inTexted()) - code = InsetBase::SPACE_CODE; + code = Inset::SPACE_CODE; break; case LFUN_INSET_MODIFY: @@ -1982,7 +1982,7 @@ bool LyXText::getStatus(Cursor & cur, FuncRequest const & cmd, return false; } - if (code != InsetBase::NO_CODE + if (code != Inset::NO_CODE && (cur.empty() || !cur.inset().insetAllowed(code))) enable = false;