1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00

Added Value support to the Button's toggle state and TextEditor content. Refactored the atomic operation functions to live inside a class called Atomic, and the byte order functions into a class called ByteOrder.

This commit is contained in:
Julian Storer 2010-01-10 22:00:59 +00:00
parent 3ddbc82f9f
commit 18ffeba9da
64 changed files with 3721 additions and 3609 deletions

View file

@ -470,7 +470,7 @@ const String CodeDocument::getTextBetween (const Position& start, const Position
String result;
result.preallocateStorage (end.getPosition() - start.getPosition() + 4);
tchar* dest = (tchar*) (const tchar*) result;
String::Concatenator concatenator (result);
const int maxLine = jmin (lines.size() - 1, endLine);
@ -482,26 +482,19 @@ const String CodeDocument::getTextBetween (const Position& start, const Position
if (i == startLine)
{
const int index = start.getIndexInLine();
len -= index;
line->line.substring (index).copyToBuffer (dest, len);
dest += len;
concatenator.append (line->line.substring (index, len));
}
else if (i == endLine)
{
len = end.getIndexInLine();
line->line.copyToBuffer (dest, len);
dest += len;
concatenator.append (line->line.substring (0, len));
}
else
{
line->line.copyToBuffer (dest, len);
dest += len;
concatenator.append (line->line);
}
}
// check we preallocated enough space..
jassert ((dest - (const tchar*) result) <= end.getPosition() - start.getPosition());
return result;
}