From cc642c58b08401683207c2b42b84e41f445ef15e Mon Sep 17 00:00:00 2001 From: twanvl Date: Mon, 30 Apr 2007 15:00:11 +0000 Subject: [PATCH] Fixed cursor position before s git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@313 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/script/script_manager.cpp | 37 ----------------------------------- src/util/tagged_string.cpp | 2 +- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/src/script/script_manager.cpp b/src/script/script_manager.cpp index 6291039d..3a8d85ff 100644 --- a/src/script/script_manager.cpp +++ b/src/script/script_manager.cpp @@ -316,42 +316,5 @@ void SetScriptManager::alsoUpdate(deque& to_update, const vectordata.at(ds.index); - toUpdate.push_back(ToUpdate(&*value)); - } else if (ds.type == DependendScript.cardField) { - // from the same card's data - assert(card); - ValueP value = card->data.at(ds.index); - toUpdate.push_back(ToUpdate(&*value, card)); - } else if (ds.type == DependendScript.cardsField) { - // something invalidates a card value for all cards, so all cards need updating - FOR_EACH(card, set)->cards { - ValueP value = card->data.at(ds.index); - toUpdate.push_back(ToUpdate(&*value, card)); - } - } else if (ds.type >= DependendScript.choiceImage) { - // a generated image has become invalid, there is not much we can do - // because the index is not exact enough, it only gives the field - // TODO : Indicate what style - //CardStyleP style = set->styleOf(card) // WRONG? - CardStyle* style = CardStyle.getByIndex(ds.type - DependendScript.choiceImage); - StyleP s = style->cardStyle.at(ds.index); - s->invalidate(); - // something changed, send event - ScriptStyleEvent change(&*s); - set->actions.tellListeners(change); - } else if (ds.type == DependendScript.cardCopyDep) { - // propagate dependencies from another field - FieldP f = game->cardFields#(ds.index); - alsoUpdate(toUpdate, f->dependendScripts, card); - } else if (ds.type == DependendScript.setCopyDep) { - // propagate dependencies from another field - FieldP f = game->setFields#(ds.index); - alsoUpdate(toUpdate, f->dependendScripts, card); - } else { - assert(false); // only setField, cardField and cardsField should be possible - }*/ } } diff --git a/src/util/tagged_string.cpp b/src/util/tagged_string.cpp index e875e658..b6b98fa7 100644 --- a/src/util/tagged_string.cpp +++ b/src/util/tagged_string.cpp @@ -264,7 +264,7 @@ void cursor_to_index_range(const String& str, size_t cursor, size_t& start, size // a tag if (is_substr(str, i, _("= cursor) break; + if (cur >= cursor) { ++i; break; } // skip tag contents, tag counts as a single 'character' i = match_close_tag_end(str, i); } else {