From c4fdab69937d627cba1185a978e4b2d041c22eb5 Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Sun, 6 Jan 2019 17:45:08 -0500 Subject: [PATCH] Use combo box data rather than looking up info from InsetRef. --- src/frontends/qt4/GuiRef.cpp | 10 ++++------ src/insets/InsetRef.cpp | 6 ------ src/insets/InsetRef.h | 2 -- 3 files changed, 4 insertions(+), 14 deletions(-) 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 &);