1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00

Replaced all usage of ScopedPointer with std::unique_ptr

This commit is contained in:
Tom Poole 2018-04-19 15:55:04 +01:00
parent e6104e3fed
commit ab863a6dc2
401 changed files with 1091 additions and 1113 deletions

View file

@ -59,7 +59,7 @@ void ComponentLayout::perform (UndoableAction* action, const String& actionName)
}
else
{
ScopedPointer<UndoableAction> deleter (action);
std::unique_ptr<UndoableAction> deleter (action);
action->perform();
}
}
@ -107,7 +107,7 @@ public:
int indexAdded;
private:
ScopedPointer<XmlElement> xml;
std::unique_ptr<XmlElement> xml;
ComponentLayout& layout;
static void showCorrectTab()
@ -155,7 +155,7 @@ public:
}
private:
ScopedPointer<XmlElement> xml;
std::unique_ptr<XmlElement> xml;
int oldIndex;
};
@ -272,7 +272,7 @@ void ComponentLayout::copySelectedToClipboard()
void ComponentLayout::paste()
{
XmlDocument clip (SystemClipboard::getTextFromClipboard());
ScopedPointer<XmlElement> doc (clip.getDocumentElement());
std::unique_ptr<XmlElement> doc (clip.getDocumentElement());
if (doc != nullptr && doc->hasTagName (clipboardXmlTag))
{
@ -408,7 +408,7 @@ void ComponentLayout::bringLostItemsBackOnScreen (int width, int height)
Component* ComponentLayout::addNewComponent (ComponentTypeHandler* const type, int x, int y)
{
ScopedPointer<Component> c (type->createNewComponent (getDocument()));
std::unique_ptr<Component> c (type->createNewComponent (getDocument()));
jassert (c != nullptr);
if (c != nullptr)
@ -419,7 +419,7 @@ Component* ComponentLayout::addNewComponent (ComponentTypeHandler* const type, i
c->getProperties().set ("id", nextCompUID++);
ScopedPointer<XmlElement> xml (type->createXmlFor (c.get(), this));
std::unique_ptr<XmlElement> xml (type->createXmlFor (c.get(), this));
c.reset (addComponentFromXml (*xml, true));
String memberName (CodeHelpers::makeValidIdentifier (type->getClassName (c.get()), true, true, false));
@ -444,7 +444,7 @@ Component* ComponentLayout::addComponentFromXml (const XmlElement& xml, const bo
if (ComponentTypeHandler* const type
= ComponentTypeHandler::getHandlerForXmlTag (xml.getTagName()))
{
ScopedPointer<Component> newComp (type->createNewComponent (getDocument()));
std::unique_ptr<Component> newComp (type->createNewComponent (getDocument()));
if (type->restoreFromXml (xml, newComp.get(), this))
{