Browse Source

XML parser fix. Mac filechooser fix.

tags/2021-05-28
jules 13 years ago
parent
commit
ffaa06c3d0
7 changed files with 30 additions and 9 deletions
  1. +4
    -0
      extras/Introjucer/Source/Application/jucer_DocumentEditorComponent.cpp
  2. +0
    -1
      extras/Introjucer/Source/Project/jucer_Project.cpp
  3. +0
    -1
      extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp
  4. +2
    -0
      modules/juce_core/xml/juce_XmlDocument.cpp
  5. +15
    -6
      modules/juce_cryptography/hashing/juce_SHA256.cpp
  6. +8
    -0
      modules/juce_cryptography/hashing/juce_SHA256.h
  7. +1
    -1
      modules/juce_gui_basics/native/juce_mac_FileChooser.mm

+ 4
- 0
extras/Introjucer/Source/Application/jucer_DocumentEditorComponent.cpp View File

@@ -98,7 +98,11 @@ void DocumentEditorComponent::getCommandInfo (const CommandID commandID, Applica
result.setInfo ("Close" + name,
"Closes the current document",
CommandCategories::general, 0);
#if JUCE_MAC
result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::ctrlModifier, 0));
#else
result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
#endif
break;
default:


+ 0
- 1
extras/Introjucer/Source/Project/jucer_Project.cpp View File

@@ -864,7 +864,6 @@ void Project::removeModule (const String& moduleID)
modules.removeChild (i, getUndoManagerFor (modules));
}
void Project::createRequiredModules (const ModuleList& availableModules, OwnedArray<LibraryModule>& modules) const
{
for (int i = 0; i < availableModules.modules.size(); ++i)


+ 0
- 1
extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp View File

@@ -223,7 +223,6 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
"Closes the current project",
CommandCategories::general, 0);
result.setActive (project != nullptr);
result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
break;
case CommandIDs::openInIDE:


+ 2
- 0
modules/juce_core/xml/juce_XmlDocument.cpp View File

@@ -271,6 +271,7 @@ void XmlDocument::skipNextWhiteSpace()
&& input[2] == '-'
&& input[3] == '-')
{
input += 4;
const int closeComment = input.indexOf (CharPointer_UTF8 ("-->"));
if (closeComment < 0)
@@ -284,6 +285,7 @@ void XmlDocument::skipNextWhiteSpace()
}
else if (input[1] == '?')
{
input += 2;
const int closeBracket = input.indexOf (CharPointer_UTF8 ("?>"));
if (closeBracket < 0)


+ 15
- 6
modules/juce_cryptography/hashing/juce_SHA256.cpp View File

@@ -176,16 +176,12 @@ SHA256& SHA256::operator= (const SHA256& other) noexcept
SHA256::SHA256 (const MemoryBlock& data)
{
MemoryInputStream m (data, false);
SHA256Processor processor;
processor.processStream (m, -1, result);
process (data.getData(), data.getSize());
}
SHA256::SHA256 (const void* const data, const size_t numBytes)
{
MemoryInputStream m (data, numBytes, false);
SHA256Processor processor;
processor.processStream (m, -1, result);
process (data, numBytes);
}
SHA256::SHA256 (InputStream& input, const int64 numBytesToRead)
@@ -209,6 +205,19 @@ SHA256::SHA256 (const File& file)
}
}
SHA256::SHA256 (const CharPointer_UTF8& utf8) noexcept
{
jassert (utf8.getAddress() != nullptr);
process (utf8.getAddress(), utf8.sizeInBytes() - 1);
}
void SHA256::process (const void* const data, size_t numBytes)
{
MemoryInputStream m (data, numBytes, false);
SHA256Processor processor;
processor.processStream (m, -1, result);
}
MemoryBlock SHA256::getRawData() const
{
return MemoryBlock (result, sizeof (result));


+ 8
- 0
modules/juce_cryptography/hashing/juce_SHA256.h View File

@@ -77,6 +77,13 @@ public:
*/
explicit SHA256 (const File& file);
/** Creates a checksum from a UTF-8 buffer.
E.g.
@code SHA256 checksum (myString.toUTF8());
@endcode
*/
explicit SHA256 (const CharPointer_UTF8& utf8Text) noexcept;
//==============================================================================
/** Returns the hash as a 32-byte block of data. */
MemoryBlock getRawData() const;
@@ -92,6 +99,7 @@ public:
private:
//==============================================================================
uint8 result [32];
void process (const void*, size_t);
JUCE_LEAK_DETECTOR (SHA256);
};


+ 1
- 1
modules/juce_gui_basics/native/juce_mac_FileChooser.mm View File

@@ -193,7 +193,7 @@ void FileChooser::showPlatformDialog (Array<File>& results,
filename = currentFileOrDirectory.getFileName();
}
#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
#if defined (MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
[panel setDirectoryURL: [NSURL fileURLWithPath: juceStringToNS (directory)]];
[panel setNameFieldStringValue: juceStringToNS (filename)];


Loading…
Cancel
Save