]> git.lyx.org Git - features.git/commitdiff
Add LFUN_DOC_ANONYMIZE, quick fix for #7259.
authorPavel Sanda <sanda@lyx.org>
Fri, 2 Feb 2018 22:42:56 +0000 (23:42 +0100)
committerPavel Sanda <sanda@lyx.org>
Thu, 15 Feb 2018 10:47:10 +0000 (11:47 +0100)
Backport from master.

src/BufferView.cpp
src/FuncCode.h
src/LyXAction.cpp

index e141f34c7ec3784864a547f0014b7e0384b45463..2d4e06dfeba5d8ec065c6b55bac79d184f7403d9 100644 (file)
@@ -1112,6 +1112,7 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
        case LFUN_WORD_FIND_FORWARD:
        case LFUN_WORD_FIND_BACKWARD:
        case LFUN_WORD_REPLACE:
+       case LFUN_DOC_ANONYMIZE:
        case LFUN_MARK_OFF:
        case LFUN_MARK_ON:
        case LFUN_MARK_TOGGLE:
@@ -1575,6 +1576,14 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                break;
        }
 
+       case LFUN_DOC_ANONYMIZE: {
+               for(char c = '0'; c <='Z'; c++) {
+                 odocstringstream ss;
+                 ss << "a\n" << c << "\n0 0 1 1 0"; 
+                 lyx::dispatch(FuncRequest(LFUN_WORD_REPLACE, ss.str()));
+               }
+       }
+
        case LFUN_WORD_FINDADV: {
                FindAndReplaceOptions opt;
                istringstream iss(to_utf8(cmd.argument()));
index 92d5e3526858b84a0a7c412d22ba8aaba226e29b..b8ca13432544496040ce98c86f53c0dacb9c6537 100644 (file)
@@ -474,6 +474,9 @@ enum FuncCode
        LFUN_TOOLBAR_MOVABLE,           // daniel, 20160712
        LFUN_FONT_CROSSOUT,             // uwestoehr 20170404
        LFUN_DEVEL_MODE_TOGGLE,         // lasgouttes 20170723
+       //370
+       LFUN_EXPORT_CANCEL,             // rgh, 20171227
+       LFUN_DOC_ANONYMIZE,             // sanda, 20180201
        LFUN_LASTACTION                 // end of the table
 };
 
index 7cd103b1c40866493ac2bf06dd99ba8faeb7073e..2a07aaa03a437c983926545c6e0b953e9a035f12 100644 (file)
@@ -4209,6 +4209,16 @@ void LyXAction::init()
  */
                { LFUN_WORD_REPLACE, "word-replace", Noop, Edit },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_DOC_ANONYMIZE
+ * \li Action: For debug purposes only. Convert all [a-zA-Z0-1] characters to
+               single character. Useful when submitting docs to list or bugzilla.
+ * \li Syntax: doc-anonymize
+ * \li Origin: sanda, Feb 1 2018
+ * \endvar
+ */
+               { LFUN_DOC_ANONYMIZE, "doc-anonymize", Noop, Edit },
+
 /*!
  * \var lyx::FuncCode lyx::LFUN_WORD_RIGHT
  * \li Action: Moves the cursor to the next beginning of a word "on the right".