mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
XML parser fix. Mac filechooser fix.
This commit is contained in:
parent
a90aedce50
commit
ffaa06c3d0
7 changed files with 30 additions and 9 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue