From cb0027442783a01d7c88be151b532c48f3120f63 Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Thu, 11 Feb 2010 11:07:03 +0000 Subject: [PATCH] Minor fixes for File::isAChildOf(), NPAPI window sizing, CodeDocument syntax parsing, and the amalgamated template file. --- amalgamation/juce_amalgamated_template.cpp | 2 +- .../browser plugins/wrapper/juce_NPAPI_GlueCode.cpp | 1 + juce_amalgamated.cpp | 11 ++++++++--- src/gui/components/code_editor/juce_CodeDocument.cpp | 2 ++ src/io/files/juce_File.cpp | 3 +++ src/native/mac/juce_mac_Fonts.mm | 2 +- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/amalgamation/juce_amalgamated_template.cpp b/amalgamation/juce_amalgamated_template.cpp index 8d9fd56c9f..5a9344093c 100644 --- a/amalgamation/juce_amalgamated_template.cpp +++ b/amalgamation/juce_amalgamated_template.cpp @@ -362,7 +362,7 @@ #include "../src/io/streams/juce_GZIPDecompressorInputStream.cpp" #endif -#if JUCE_BUILD_NATIVE +#if JUCE_BUILD_NATIVE && ! JUCE_ONLY_BUILD_CORE_LIBRARY #include "../src/audio/audio_file_formats/juce_FlacAudioFormat.cpp" #include "../src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp" #endif diff --git a/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp b/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp index a18647a8a1..4b93464824 100644 --- a/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp +++ b/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp @@ -355,6 +355,7 @@ private: return 1; case WM_WINDOWPOSCHANGING: + case WM_WINDOWPOSCHANGED: if ((((WINDOWPOS*) lParam)->flags & SWP_NOSIZE) == 0) { BrowserPluginHolderComponent* const comp = (BrowserPluginHolderComponent*) GetWindowLongPtr (hWnd, GWL_USERDATA); diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 0b34b40ef8..ae79f9e416 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -6199,6 +6199,9 @@ const String File::getFileNameWithoutExtension() const bool File::isAChildOf (const File& potentialParent) const { + if (potentialParent == File::nonexistent) + return false; + const String ourPath (getPathUpToLastSlash()); #if NAMES_ARE_CASE_SENSITIVE @@ -43968,6 +43971,8 @@ void CodeDocument::Iterator::skipToEndOfLine() if (currentLine != 0) position = currentLine->lineStartInFile; + else + position = document->getNumCharacters(); } } @@ -99402,7 +99407,7 @@ END_JUCE_NAMESPACE #endif -#if JUCE_BUILD_NATIVE +#if JUCE_BUILD_NATIVE && ! JUCE_ONLY_BUILD_CORE_LIBRARY /*** Start of inlined file: juce_FlacAudioFormat.cpp ***/ #if JUCE_USE_FLAC @@ -239567,7 +239572,7 @@ bool JUCE_CALLTYPE Process::isRunningUnderDebugger() #define SUPPORT_10_4_FONTS 1 #define NEW_CGFONT_FUNCTIONS_UNAVAILABLE (CGFontCreateWithFontName == 0) - #if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) || JUCE_PPC + #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 #define SUPPORT_ONLY_10_4_FONTS 1 #endif @@ -243999,7 +244004,7 @@ MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) #define SUPPORT_10_4_FONTS 1 #define NEW_CGFONT_FUNCTIONS_UNAVAILABLE (CGFontCreateWithFontName == 0) - #if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) || JUCE_PPC + #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 #define SUPPORT_ONLY_10_4_FONTS 1 #endif diff --git a/src/gui/components/code_editor/juce_CodeDocument.cpp b/src/gui/components/code_editor/juce_CodeDocument.cpp index 086061b9b8..2f647e71f3 100644 --- a/src/gui/components/code_editor/juce_CodeDocument.cpp +++ b/src/gui/components/code_editor/juce_CodeDocument.cpp @@ -180,6 +180,8 @@ void CodeDocument::Iterator::skipToEndOfLine() if (currentLine != 0) position = currentLine->lineStartInFile; + else + position = document->getNumCharacters(); } } diff --git a/src/io/files/juce_File.cpp b/src/io/files/juce_File.cpp index da15791e5b..742cc39722 100644 --- a/src/io/files/juce_File.cpp +++ b/src/io/files/juce_File.cpp @@ -427,6 +427,9 @@ const String File::getFileNameWithoutExtension() const bool File::isAChildOf (const File& potentialParent) const { + if (potentialParent == File::nonexistent) + return false; + const String ourPath (getPathUpToLastSlash()); #if NAMES_ARE_CASE_SENSITIVE diff --git a/src/native/mac/juce_mac_Fonts.mm b/src/native/mac/juce_mac_Fonts.mm index 0c85ea0c0d..ef6dc52270 100644 --- a/src/native/mac/juce_mac_Fonts.mm +++ b/src/native/mac/juce_mac_Fonts.mm @@ -31,7 +31,7 @@ #define SUPPORT_10_4_FONTS 1 #define NEW_CGFONT_FUNCTIONS_UNAVAILABLE (CGFontCreateWithFontName == 0) - #if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) || JUCE_PPC + #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 #define SUPPORT_ONLY_10_4_FONTS 1 #endif