]> 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:46:40 +0000 (17:46 -0500)
src/frontends/qt4/GuiRef.cpp
src/insets/InsetRef.cpp
src/insets/InsetRef.h

index 792b85219a329dbad2f31c850a022dc3d1a689bf..0c6b12d46214fcd56f14a449c7335e93113c0416 100644 (file)
@@ -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_("<reference>"), "ref");
        typeCO->addItem(qt_("(<reference>)"), "eqref");
        typeCO->addItem(qt_("<page>"), "pageref");
index 4767f7b653a3f22d434abcd3a7676478f5d82ad8..5ecba130b296b6c1b6c135d66a54b522deeb19c7 100644 (file)
@@ -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_;
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 &);