]> git.lyx.org Git - lyx.git/commitdiff
FindAdv: Re-add 'size' to the list of possible ignored formats
authorKornel Benko <kornel@lyx.org>
Sat, 30 Apr 2022 07:30:15 +0000 (09:30 +0200)
committerKornel Benko <kornel@lyx.org>
Sat, 30 Apr 2022 07:30:15 +0000 (09:30 +0200)
src/Font.cpp
src/lyxfind.cpp

index 514bf03725fc40f6b3584b6920bab9eabeade35b..7b7585df20fa15496653a393ad8e98e5cbf24c11 100644 (file)
@@ -336,11 +336,18 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
        p.reduce(prev.bits_);
 
        if (f.size() != INHERIT_SIZE) {
        p.reduce(prev.bits_);
 
        if (f.size() != INHERIT_SIZE) {
-               os << '{';
-               ++count;
-               os << '\\'
-                  << LaTeXSizeSwitchNames[f.size()] << termcmd;
-               count += strlen(LaTeXSizeSwitchNames[f.size()]) + 1;
+               if (runparams.for_search == OutputParams::NoSearch) {
+                       os << '{';
+                       ++count;
+                       os << '\\'
+                          << LaTeXSizeSwitchNames[f.size()] << termcmd;
+                       count += strlen(LaTeXSizeSwitchNames[f.size()]) + 1;
+               }
+               else {
+                       os << '\\'
+                          << LaTeXSizeSwitchNames[f.size()] << '{';
+                       count += strlen(LaTeXSizeSwitchNames[f.size()]) + 2;
+               }
        }
        if (f.family() != INHERIT_FAMILY) {
                if (non_inherit_inset) {
        }
        if (f.family() != INHERIT_FAMILY) {
                if (non_inherit_inset) {
index c0d86409f9c3987ea81e0ed4f7822dc6522f6484..ee925235515dafa062aede6d09449a1c9f1a91ee 100644 (file)
@@ -88,6 +88,8 @@ class IgnoreFormats {
        ///
        bool getShape() const { return ignoreShape_; }
        ///
        ///
        bool getShape() const { return ignoreShape_; }
        ///
+       bool getSize() const { return ignoreSize_; }
+       ///
        bool getUnderline() const { return ignoreUnderline_; }
        ///
        bool getMarkUp() const { return ignoreMarkUp_; }
        bool getUnderline() const { return ignoreUnderline_; }
        ///
        bool getMarkUp() const { return ignoreMarkUp_; }
@@ -118,6 +120,8 @@ private:
        ///
        bool ignoreShape_ = false;
        ///
        ///
        bool ignoreShape_ = false;
        ///
+       bool ignoreSize_ = true;
+       ///
        bool ignoreUnderline_ = false;
        ///
        bool ignoreMarkUp_ = false;
        bool ignoreUnderline_ = false;
        ///
        bool ignoreMarkUp_ = false;
@@ -166,6 +170,9 @@ void IgnoreFormats::setIgnoreFormat(string const & type, bool value, bool fromUs
        else if (type == "shape") {
                ignoreShape_ = value;
        }
        else if (type == "shape") {
                ignoreShape_ = value;
        }
+       else if (type == "size") {
+               ignoreSize_ = value;
+       }
        else if (type == "family") {
                ignoreFamily_ = value;
        }
        else if (type == "family") {
                ignoreFamily_ = value;
        }
@@ -2757,7 +2764,7 @@ void LatexInfo::buildKeys(bool isPatternString)
        makeKey("textgreek|textcyrillic", KeyInfo(KeyInfo::isStandard, 1, true), false);
        makeKey("parbox", KeyInfo(KeyInfo::doRemove, 1, true), isPatternString);
        // like ('tiny{}' or '\tiny ' ... )
        makeKey("textgreek|textcyrillic", KeyInfo(KeyInfo::isStandard, 1, true), false);
        makeKey("parbox", KeyInfo(KeyInfo::doRemove, 1, true), isPatternString);
        // like ('tiny{}' or '\tiny ' ... )
-       makeKey("footnotesize|tiny|scriptsize|small|large|Large|LARGE|huge|Huge", KeyInfo(KeyInfo::isSize, 0, false), isPatternString);
+       makeKey("footnotesize|tiny|scriptsize|small|large|Large|LARGE|huge|Huge", KeyInfo(KeyInfo::isSize, 0, ignoreFormats.getSize()), isPatternString);
 
        // Survives, like known character
        // makeKey("lyx|LyX|latex|LaTeX|latexe|LaTeXe|tex|TeX", KeyInfo(KeyInfo::isChar, 0, false), isPatternString);
 
        // Survives, like known character
        // makeKey("lyx|LyX|latex|LaTeX|latexe|LaTeXe|tex|TeX", KeyInfo(KeyInfo::isChar, 0, false), isPatternString);