mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
More ScopedPointer/unique_ptr compatibility work
This commit is contained in:
parent
48a5fbd333
commit
1a60fa9765
80 changed files with 404 additions and 368 deletions
|
|
@ -221,7 +221,7 @@ void Label::showEditor()
|
|||
resized();
|
||||
repaint();
|
||||
|
||||
editorShown (editor);
|
||||
editorShown (editor.get());
|
||||
|
||||
enterModalState (false);
|
||||
editor->grabKeyboardFocus();
|
||||
|
|
@ -254,9 +254,10 @@ void Label::hideEditor (bool discardCurrentEditorContents)
|
|||
if (editor != nullptr)
|
||||
{
|
||||
WeakReference<Component> deletionChecker (this);
|
||||
ScopedPointer<TextEditor> outgoingEditor (editor);
|
||||
ScopedPointer<TextEditor> outgoingEditor;
|
||||
std::swap (outgoingEditor, editor);
|
||||
|
||||
editorAboutToBeHidden (outgoingEditor);
|
||||
editorAboutToBeHidden (outgoingEditor.get());
|
||||
|
||||
const bool changed = (! discardCurrentEditorContents)
|
||||
&& updateFromTextEditorContents (*outgoingEditor);
|
||||
|
|
@ -311,7 +312,7 @@ TextEditor* Label::createEditorComponent()
|
|||
|
||||
TextEditor* Label::getCurrentTextEditor() const noexcept
|
||||
{
|
||||
return editor;
|
||||
return editor.get();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -410,7 +411,7 @@ void Label::textEditorTextChanged (TextEditor& ed)
|
|||
{
|
||||
if (editor != nullptr)
|
||||
{
|
||||
jassert (&ed == editor);
|
||||
jassert (&ed == editor.get());
|
||||
|
||||
if (! (hasKeyboardFocus (true) || isCurrentlyBlockedByAnotherModalComponent()))
|
||||
{
|
||||
|
|
@ -426,7 +427,7 @@ void Label::textEditorReturnKeyPressed (TextEditor& ed)
|
|||
{
|
||||
if (editor != nullptr)
|
||||
{
|
||||
jassert (&ed == editor);
|
||||
jassert (&ed == editor.get());
|
||||
|
||||
WeakReference<Component> deletionChecker (this);
|
||||
bool changed = updateFromTextEditorContents (ed);
|
||||
|
|
@ -446,7 +447,7 @@ void Label::textEditorEscapeKeyPressed (TextEditor& ed)
|
|||
{
|
||||
if (editor != nullptr)
|
||||
{
|
||||
jassert (&ed == editor);
|
||||
jassert (&ed == editor.get());
|
||||
ignoreUnused (ed);
|
||||
|
||||
editor->setText (textValue.toString(), false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue