From 90d56cbb4acf15fa8e6891a3ce6563e16747b7c3 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. (cherry picked from commit c4fdab69937d627cba1185a978e4b2d041c22eb5) --- src/frontends/qt4/GuiRef.cpp | 8 ++++---- src/insets/InsetRef.cpp | 6 ------ src/insets/InsetRef.h | 2 -- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp index fac8be9881..0d30a68c4f 100644 --- a/src/frontends/qt4/GuiRef.cpp +++ b/src/frontends/qt4/GuiRef.cpp @@ -148,10 +148,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); diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index 2c22b1f23c..c6f6ea003b 100644 --- a/src/insets/InsetRef.cpp +++ b/src/insets/InsetRef.cpp @@ -492,12 +492,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 &); -- 2.39.5