]> git.lyx.org Git - features.git/commitdiff
Use combo box data rather than looking up info from InsetRef.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 6 Jan 2019 22:45:08 +0000 (17:45 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 6 Jan 2019 22:47:58 +0000 (17:47 -0500)
(cherry picked from commit c4fdab69937d627cba1185a978e4b2d041c22eb5)

src/frontends/qt4/GuiRef.cpp
src/insets/InsetRef.cpp
src/insets/InsetRef.h

index fac8be98817aa3e4ffa70408d11dd3029dae7e2b..0d30a68c4ff03e2dc8ce973d259938446b7717f2 100644 (file)
@@ -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);
index 2c22b1f23c8ba0244fe14e7c31e4044e1d0b46b6..c6f6ea003b44bcbf5a9a2d5b4645be8488a93332 100644 (file)
@@ -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_;
index 0f5a5b201d87983b5cd66d64dd3073240124a965..8976e03630987b0b52cdc7adf452f574d1a8bf75 100644 (file)
@@ -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 &);