From 08f6354bc9c4d4b2630b4e6f10fdf82d4de6959a Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Fri, 2 Feb 2018 23:42:56 +0100 Subject: [PATCH] Add LFUN_DOC_ANONYMIZE, quick fix for #7259. Backport from master. --- src/BufferView.cpp | 9 +++++++++ src/FuncCode.h | 3 +++ src/LyXAction.cpp | 10 ++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index e141f34c7e..2d4e06dfeb 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -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())); diff --git a/src/FuncCode.h b/src/FuncCode.h index 92d5e35268..b8ca134325 100644 --- a/src/FuncCode.h +++ b/src/FuncCode.h @@ -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 }; diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 7cd103b1c4..2a07aaa03a 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -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". -- 2.39.5