Browse Source

CodeEditorComponent fix.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
5bd9136a3c
4 changed files with 40 additions and 18 deletions
  1. +20
    -9
      juce_amalgamated.cpp
  2. +8
    -5
      src/gui/components/code_editor/juce_CodeDocument.cpp
  3. +10
    -0
      src/native/android/juce_android_NativeCode.cpp
  4. +2
    -4
      src/native/mac/juce_mac_Files.mm

+ 20
- 9
juce_amalgamated.cpp View File

@@ -44648,9 +44648,9 @@ public:
{
String::CharPointerType t (text.getCharPointer());
int charNumInFile = 0;
bool finished = t.isEmpty();
bool finished = false;

while (! finished)
while (! (finished || t.isEmpty()))
{
String::CharPointerType startOfLine (t);
int startOfLineInFile = charNumInFile;
@@ -44711,12 +44711,15 @@ public:

String::CharPointerType t (line.getCharPointer());

while (! t.isEmpty())
for (;;)
{
++lineLength;

const juce_wchar c = t.getAndAdvance();

if (c == 0)
break;

++lineLength;

if (c != '\n' && c != '\r')
lineLengthWithoutNewLines = lineLength;
}
@@ -268808,17 +268811,15 @@ namespace FileHelpers
return [[NSURL fileURLWithPath: juceStringToNS (path)]
getResourceValue: &hidden forKey: NSURLIsHiddenKey error: &err]
&& [hidden boolValue];
#else
#if JUCE_IOS
#elif JUCE_IOS
return File (path).getFileName().startsWithChar ('.');
#else
#else
FSRef ref;
LSItemInfoRecord info;

return FSPathMakeRefWithOptions ((const UInt8*) path.toUTF8().getAddress(), kFSPathMakeRefDoNotFollowLeafSymlink, &ref, 0) == noErr
&& LSCopyItemInfoForRef (&ref, kLSRequestBasicFlagsOnly, &info) == noErr
&& (info.flags & kLSItemInfoIsInvisible) != 0;
#endif
#endif
}

@@ -283439,6 +283440,8 @@ BEGIN_JUCE_NAMESPACE
JAVACLASS (matrixClass, "android/graphics/Matrix") \
JAVACLASS (rectClass, "android/graphics/Rect") \
JAVACLASS (typefaceClass, "android/graphics/Typeface") \
JAVACLASS (audioTrackClass, "android/media/AudioTrack") \
JAVACLASS (audioRecordClass, "android/media/AudioRecord") \

// List of extra classes needed when USE_ANDROID_CANVAS is enabled
#if ! USE_ANDROID_CANVAS
@@ -283513,6 +283516,14 @@ BEGIN_JUCE_NAMESPACE
FIELD (rectClass, rectRight, "right", "I") \
FIELD (rectClass, rectTop, "top", "I") \
FIELD (rectClass, rectBottom, "bottom", "I") \
\
METHOD (audioTrackClass, audioTrackConstructor, "<init>", "(IIIIII)V") \
METHOD (audioTrackClass, audioTrackPlay, "play", "()V") \
METHOD (audioTrackClass, audioTrackStop, "stop", "()V") \
METHOD (audioTrackClass, audioTrackRelease, "release", "()V") \
METHOD (audioTrackClass, audioTrackFlush, "flush", "()V") \
METHOD (audioTrackClass, audioTrackWrite, "write", "([SII)I") \
STATICMETHOD (audioTrackClass, getMinBufferSize, "getMinBufferSize", "(III)I") \

// List of extra methods needed when USE_ANDROID_CANVAS is enabled
#if ! USE_ANDROID_CANVAS


+ 8
- 5
src/gui/components/code_editor/juce_CodeDocument.cpp View File

@@ -50,9 +50,9 @@ public:
{
String::CharPointerType t (text.getCharPointer());
int charNumInFile = 0;
bool finished = t.isEmpty();
bool finished = false;
while (! finished)
while (! (finished || t.isEmpty()))
{
String::CharPointerType startOfLine (t);
int startOfLineInFile = charNumInFile;
@@ -113,12 +113,15 @@ public:
String::CharPointerType t (line.getCharPointer());
while (! t.isEmpty())
for (;;)
{
++lineLength;
const juce_wchar c = t.getAndAdvance();
if (c == 0)
break;
++lineLength;
if (c != '\n' && c != '\r')
lineLengthWithoutNewLines = lineLength;
}


+ 10
- 0
src/native/android/juce_android_NativeCode.cpp View File

@@ -109,6 +109,8 @@ BEGIN_JUCE_NAMESPACE
JAVACLASS (matrixClass, "android/graphics/Matrix") \
JAVACLASS (rectClass, "android/graphics/Rect") \
JAVACLASS (typefaceClass, "android/graphics/Typeface") \
JAVACLASS (audioTrackClass, "android/media/AudioTrack") \
JAVACLASS (audioRecordClass, "android/media/AudioRecord") \
//==============================================================================
// List of extra classes needed when USE_ANDROID_CANVAS is enabled
@@ -186,6 +188,14 @@ BEGIN_JUCE_NAMESPACE
FIELD (rectClass, rectRight, "right", "I") \
FIELD (rectClass, rectTop, "top", "I") \
FIELD (rectClass, rectBottom, "bottom", "I") \
\
METHOD (audioTrackClass, audioTrackConstructor, "<init>", "(IIIIII)V") \
METHOD (audioTrackClass, audioTrackPlay, "play", "()V") \
METHOD (audioTrackClass, audioTrackStop, "stop", "()V") \
METHOD (audioTrackClass, audioTrackRelease, "release", "()V") \
METHOD (audioTrackClass, audioTrackFlush, "flush", "()V") \
METHOD (audioTrackClass, audioTrackWrite, "write", "([SII)I") \
STATICMETHOD (audioTrackClass, getMinBufferSize, "getMinBufferSize", "(III)I") \
//==============================================================================


+ 2
- 4
src/native/mac/juce_mac_Files.mm View File

@@ -85,17 +85,15 @@ namespace FileHelpers
return [[NSURL fileURLWithPath: juceStringToNS (path)]
getResourceValue: &hidden forKey: NSURLIsHiddenKey error: &err]
&& [hidden boolValue];
#else
#if JUCE_IOS
#elif JUCE_IOS
return File (path).getFileName().startsWithChar ('.');
#else
#else
FSRef ref;
LSItemInfoRecord info;
return FSPathMakeRefWithOptions ((const UInt8*) path.toUTF8().getAddress(), kFSPathMakeRefDoNotFollowLeafSymlink, &ref, 0) == noErr
&& LSCopyItemInfoForRef (&ref, kLSRequestBasicFlagsOnly, &info) == noErr
&& (info.flags & kLSItemInfoIsInvisible) != 0;
#endif
#endif
}


Loading…
Cancel
Save