Enhancement

- Swapped std::string::find for find (from text.cpp) to allow
  configurable case sensitivity.
This commit is contained in:
Paul Beckingham 2010-06-20 20:22:39 -04:00
parent 99bce308e6
commit 4f4a32b405

View file

@ -2036,6 +2036,8 @@ int handleDenotate (std::string &outs)
if (context.sequence.size () == 0)
throw std::string ("A task ID is needed to delete an annotation.");
bool sensitive = context.config.getBoolean ("search.case.sensitive");
std::stringstream out;
std::vector <Task> tasks;
@ -2078,7 +2080,8 @@ int handleDenotate (std::string &outs)
for (i = annotations.begin (); i != annotations.end (); ++i)
{
anno = i->value ();
std::string::size_type loc = anno.find (desc, 0);
std::string::size_type loc = find (anno, desc, sensitive);
if (loc != std::string::npos && loc == 0)
{
match = true;
@ -2088,6 +2091,7 @@ int handleDenotate (std::string &outs)
}
}
}
if (taskDiff (before, *task))
{
if (permission.confirmed (before, taskDifferences (before, *task) + "Proceed with change?"))
@ -2113,6 +2117,7 @@ int handleDenotate (std::string &outs)
outs = out.str ();
context.hooks.trigger ("post-denotate-command");
}
return rc;
}