- if (it->lyxCode() == InsetOld::BIBTEX_CODE)
- static_cast<InsetBibtex &>(*it).fillWithBibKeys(*this, keys);
- else if (it->lyxCode() == InsetOld::INCLUDE_CODE)
- static_cast<InsetInclude &>(*it).fillWithBibKeys(keys);
- else if (it->lyxCode() == InsetOld::BIBITEM_CODE) {
- InsetBibitem & bib = static_cast<InsetBibitem &>(*it);
- string const key = bib.getContents();
- string const opt = bib.getOptions();
+ if (it->lyxCode() == InsetOld::BIBTEX_CODE) {
+ InsetBibtex const & inset =
+ dynamic_cast<InsetBibtex const &>(*it);
+ inset.fillWithBibKeys(*this, keys);
+ } else if (it->lyxCode() == InsetOld::INCLUDE_CODE) {
+ InsetInclude const & inset =
+ dynamic_cast<InsetInclude const &>(*it);
+ inset.fillWithBibKeys(*this, keys);
+ } else if (it->lyxCode() == InsetOld::BIBITEM_CODE) {
+ InsetBibitem const & inset =
+ dynamic_cast<InsetBibitem const &>(*it);
+ string const key = inset.getContents();
+ string const opt = inset.getOptions();