From: Richard Kimberly Heck Date: Sun, 6 Jan 2019 22:45:08 +0000 (-0500) Subject: Use combo box data rather than looking up info from InsetRef. X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=18bbeed2654028d98c82b528095bfb325cf50a10;p=features.git Use combo box data rather than looking up info from InsetRef. --- diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp index 792b85219a..0c6b12d462 100644 --- a/src/frontends/qt4/GuiRef.cpp +++ b/src/frontends/qt4/GuiRef.cpp @@ -145,10 +145,10 @@ void GuiRef::enableView(bool enable) void GuiRef::enableBoxes() { - bool const isFormatted = - (InsetRef::getName(typeCO->currentIndex()) == "formatted"); - bool const isLabelOnly = - (InsetRef::getName(typeCO->currentIndex()) == "labelonly"); + QString const reftype = + typeCO->itemData(typeCO->currentIndex()).toString(); + bool const isFormatted = (reftype == "formatted"); + bool const isLabelOnly = (reftype == "labelonly"); bool const usingRefStyle = buffer().params().use_refstyle; pluralCB->setEnabled(isFormatted && usingRefStyle); capsCB->setEnabled(isFormatted && usingRefStyle); @@ -323,8 +323,6 @@ void GuiRef::updateContents() // FIXME Bring InsetMathRef on par with InsetRef // (see #9798) - // NOTE: The order here must be kept in sync with the defintion - // of the types[] array in InsetRef.cpp. typeCO->addItem(qt_(""), "ref"); typeCO->addItem(qt_("()"), "eqref"); typeCO->addItem(qt_(""), "pageref"); diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index 4767f7b653..5ecba130b2 100644 --- a/src/insets/InsetRef.cpp +++ b/src/insets/InsetRef.cpp @@ -494,12 +494,6 @@ int InsetRef::getType(string const & name) } -string const & InsetRef::getName(int type) -{ - return types[type].latex_name; -} - - docstring InsetRef::getTOCString() const { return tooltip_.empty() ? screenLabel() : tooltip_; diff --git a/src/insets/InsetRef.h b/src/insets/InsetRef.h index 0f5a5b201d..8976e03630 100644 --- a/src/insets/InsetRef.h +++ b/src/insets/InsetRef.h @@ -31,8 +31,6 @@ public: static const type_info types[]; /// static int getType(std::string const & name); - /// - static std::string const & getName(int type); /// InsetRef(Buffer * buffer, InsetCommandParams const &);