]> git.lyx.org Git - lyx.git/commitdiff
get rid of notes-mutate and explain that inset-forall can do the same
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 12 Jan 2010 15:54:33 +0000 (15:54 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 12 Jan 2010 15:54:33 +0000 (15:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32986 a592a061-630c-0410-9148-cb99ea01b6c8

RELEASE-NOTES
src/BufferView.cpp
src/FuncCode.h
src/LyXAction.cpp
src/insets/InsetNote.cpp
src/insets/InsetNote.h

index 9e3795f789e35767edee1c70d220f8c4da717f0b..fce58a12a53fbac5836d241e6a1bd263f2f422f3 100644 (file)
@@ -89,6 +89,10 @@ The following LyX functions have been removed:
 
 - LFUN_PARAGRAPH_SPACING ("paragraph-spacing"): use "paragraph-params" instead.
 
+- LFUN_NOTES_MUTATE ("notes-mutate"): replace
+    notes-mutate <SOURCE> <TARGET>
+  with the more general function inset-forall
+    inset-forall Note:<SOURCE> inset-modify changetype <TARGET>
 
 The following LyX functions have been changed:
 
index 24b44fd04f88e93b374025adc9011b767ec357dd..e21eddffe62a5e4ef3cee109571a3a56c85de5a5 100644 (file)
@@ -1014,7 +1014,6 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
        case LFUN_SCREEN_SHOW_CURSOR:
        case LFUN_BIBTEX_DATABASE_ADD:
        case LFUN_BIBTEX_DATABASE_DEL:
-       case LFUN_NOTES_MUTATE:
        case LFUN_ALL_INSETS_TOGGLE:
        case LFUN_STATISTICS:
        case LFUN_BRANCH_ADD_INSERT:
@@ -1686,18 +1685,6 @@ bool BufferView::dispatch(FuncRequest const & cmd)
                break;
        }
 
-       // This could be rewriten using some command like forall <insetname> <command>
-       // once the insets refactoring is done.
-       case LFUN_NOTES_MUTATE: {
-               if (cmd.argument().empty())
-                       break;
-
-               if (mutateNotes(cur, cmd.getArg(0), cmd.getArg(1))) {
-                       processUpdateFlags(Update::Force);
-               }
-               break;
-       }
-
 
        // This would be in Buffer class if only Cursor did not
        // require a bufferview
index 12996600b86a177afe837198385b8f840329ac7f..b0fb40d943312b23e9f979abfaa6c7abf08d2c77 100644 (file)
@@ -169,7 +169,7 @@ enum FuncCode
        LFUN_WORD_DELETE_BACKWARD,
        // 115
        LFUN_LINE_DELETE,
-       LFUN_NOTES_MUTATE,
+       LFUN_DEBUG_LEVEL_SET,
        LFUN_MARK_OFF,
        LFUN_MARK_ON,
        LFUN_LAYOUT,
@@ -444,7 +444,6 @@ enum FuncCode
        LFUN_SCREEN_SHOW_CURSOR,        // vfr, 20090325
        LFUN_CURSOR_FOLLOWS_SCROLLBAR_TOGGLE, // ARRae 971202
        // 345
-       LFUN_DEBUG_LEVEL_SET,
 
        LFUN_LASTACTION                 // end of the table
 };
index 425b123b1aac2f38626978e0dc3f165fe90bb204..7acdf6a957cddcc90a25d4f708f14586efb0030a 100644 (file)
@@ -575,16 +575,6 @@ void LyXAction::init()
  * \endvar
  */
                { LFUN_NOTE_NEXT, "note-next", ReadOnly, Edit },
-/*!
- * \var lyx::FuncCode lyx::LFUN_NOTES_MUTATE
- * \li Action: Changes all Note insets of a particular type (source)
-               to a different type (target) fot the current document.
- * \li Syntax: notes-mutate <SOURCE> <TARGET>
- * \li Params: <SOURCE/TARGET>: Note|Comment|Greyedout
- * \li Origin: sanda, 18 Jun 2008
- * \endvar
- */
-               { LFUN_NOTES_MUTATE, "notes-mutate", Argument, Edit },
 /*!
  * \var lyx::FuncCode lyx::LFUN_PHANTOM_INSERT
  * \li Action: Inserts phantom on the current cursor postion,
index 3d641a8a683b9ebf7d8f5699d10853734787fe61..8a0f657ac597e0176ca8ff336b2cd4bb6c9e15a1 100644 (file)
@@ -384,37 +384,4 @@ void InsetNote::string2params(string const & in, InsetNoteParams & params)
 }
 
 
-bool mutateNotes(Cursor & cur, string const & source, string const & target)
-{
-       InsetNoteParams::Type typeSrc = notetranslator().find(source);
-       InsetNoteParams::Type typeTrt = notetranslator().find(target);
-       // syntax check of arguments
-       string src = notetranslator().find(typeSrc);
-       string trt = notetranslator().find(typeTrt);
-       if (src != source || trt != target)
-               return false;
-
-       // did we found some conforming inset?
-       bool ret = false;
-
-       cur.beginUndoGroup();
-       Inset & inset = cur.buffer()->inset();
-       InsetIterator it  = inset_iterator_begin(inset);
-       InsetIterator const end = inset_iterator_end(inset);
-       for (; it != end; ++it) {
-               if (it->lyxCode() == NOTE_CODE) {
-                       InsetNote & ins = static_cast<InsetNote &>(*it);
-                       if (ins.params().type == typeSrc) {
-                               cur.buffer()->undo().recordUndo(it);
-                               FuncRequest fr(LFUN_INSET_MODIFY, "note Note " + target);
-                               ins.dispatch(cur, fr);
-                               ret = true;
-                       }
-               }
-       }
-       cur.endUndoGroup();
-
-       return ret;
-}
-
 } // namespace lyx
index f5685681a145f5eb141a6468903a46c1b9c0db25..4de8d5cd54cde3b519b50bd30b38e560dc90209e 100644 (file)
@@ -111,12 +111,6 @@ private:
        InsetNoteParams params_;
 };
 
-/**
- * Mutate all NoteInsets of "source" type to the "target" type in the document.
- * Returns true when some inset was changed.
- */
-bool mutateNotes(lyx::Cursor & cur, std::string const & source, std::string const &target);
-
 } // namespace lyx
 
 #endif // INSET_NOTE_H