]> git.lyx.org Git - features.git/commitdiff
We don't want InsetCommand to have a function updateCommand while this is not a speci...
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 25 Oct 2010 23:20:05 +0000 (23:20 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 25 Oct 2010 23:20:05 +0000 (23:20 +0000)
This also fixes compilation again. I forgot to cherry-pick all commits in git ;)...

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35845 a592a061-630c-0410-9148-cb99ea01b6c8

src/CutAndPaste.cpp
src/insets/InsetBibitem.h

index dba8e7bc58f77d0f2c383e6541ee6c38054781fd..e716cc3a817ca35306ab119f33549b0741904461 100644 (file)
@@ -36,6 +36,7 @@
 #include "ParagraphParameters.h"
 #include "ParIterator.h"
 
+#include "insets/InsetBibitem.h"
 #include "insets/InsetBranch.h"
 #include "insets/InsetCommand.h"
 #include "insets/InsetFlex.h"
@@ -271,7 +272,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
 
                case LABEL_CODE: {
                        // check for duplicates
-                       InsetCommand & lab = static_cast<InsetCommand &>(*it);
+                       InsetLabel & lab = dynamic_cast<InsetLabel &>(*it);
                        docstring const oldname = lab.getParam("name");
                        lab.updateCommand(oldname, false);
                        // We need to update the buffer reference cache.
@@ -309,7 +310,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
 
                case BIBITEM_CODE: {
                        // check for duplicates
-                       InsetCommand & bib = static_cast<InsetCommand &>(*it);
+                       InsetBibitem & bib = dynamic_cast<InsetBibitem &>(*it);
                        docstring const oldkey = bib.getParam("key");
                        bib.updateCommand(oldkey, false);
                        // We need to update the buffer reference cache.
index 200630355f7cfd5e319b616943a74d985f5f737b..f42ddadb069bf0235382031a6760a93d176c006e 100644 (file)
@@ -42,6 +42,8 @@ public:
        ///
        static bool isCompatibleCommand(std::string const & s) 
                { return s == "bibitem"; }
+       ///
+       void updateCommand(docstring const & new_key, bool dummy = false);
 private:
        /// verify label and update references.
        /// Overloaded from Inset::initView.
@@ -67,8 +69,6 @@ private:
        /// Update the counter of this inset
        void updateBuffer(ParIterator const &, UpdateType);
        ///
-       void updateCommand(docstring const & new_key, bool dummy = false);
-       ///
        void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
        Inset * clone() const { return new InsetBibitem(*this); }