Widen the unique pointer a bit more.
This commit is contained in:
@ -425,18 +425,16 @@ void Layout::removeWidget ()
|
|||||||
updateCursor ();
|
updateCursor ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Layout::setWidget (Widget *widget)
|
void Layout::setWidget (std::unique_ptr< Widget > widget)
|
||||||
{
|
{
|
||||||
DBG_OBJ_ASSOC_CHILD (widget);
|
DBG_OBJ_ASSOC_CHILD (widget.get());
|
||||||
|
|
||||||
widgetAtPoint = NULL;
|
widgetAtPoint = NULL;
|
||||||
if (topLevel) {
|
if (topLevel) {
|
||||||
topLevel.reset();
|
topLevel.reset();
|
||||||
}
|
}
|
||||||
textZone->zoneFree ();
|
textZone->zoneFree ();
|
||||||
std::unique_ptr< Widget > widget_unique;
|
addWidget (std::move( widget ));
|
||||||
widget_unique.reset( widget );
|
|
||||||
addWidget (std::move( widget_unique ));
|
|
||||||
|
|
||||||
updateCursor ();
|
updateCursor ();
|
||||||
|
|
||||||
|
|||||||
@ -283,7 +283,7 @@ public:
|
|||||||
lout::misc::ZoneAllocator *textZone;
|
lout::misc::ZoneAllocator *textZone;
|
||||||
|
|
||||||
void addWidget (std::unique_ptr< Widget > widget);
|
void addWidget (std::unique_ptr< Widget > widget);
|
||||||
void setWidget (Widget *widget);
|
void setWidget (std::unique_ptr< Widget > widget);
|
||||||
|
|
||||||
void attachView (View *view);
|
void attachView (View *view);
|
||||||
void detachView (View *view);
|
void detachView (View *view);
|
||||||
|
|||||||
4
dw/ui.cc
4
dw/ui.cc
@ -348,7 +348,9 @@ void ComplexButtonResource::init (Widget *widget)
|
|||||||
layout = new Layout (createPlatform (), false);
|
layout = new Layout (createPlatform (), false);
|
||||||
setLayout (layout);
|
setLayout (layout);
|
||||||
DBG_OBJ_ASSOC_CHILD (layout);
|
DBG_OBJ_ASSOC_CHILD (layout);
|
||||||
layout->setWidget (widget);
|
std::unique_ptr< Widget > widget_unique;
|
||||||
|
widget_unique.reset( widget );
|
||||||
|
layout->setWidget (std::move( widget_unique ));
|
||||||
layout->connect (&layoutReceiver);
|
layout->connect (&layoutReceiver);
|
||||||
|
|
||||||
if (getEmbed ())
|
if (getEmbed ())
|
||||||
|
|||||||
@ -85,7 +85,9 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *Web,
|
|||||||
dw->setStyle (styleEngine.style (Web->bw));
|
dw->setStyle (styleEngine.style (Web->bw));
|
||||||
|
|
||||||
/* This method frees the old dw if any */
|
/* This method frees the old dw if any */
|
||||||
layout->setWidget(dw);
|
std::unique_ptr< Widget > dw_unique;
|
||||||
|
dw_unique.reset( dw );
|
||||||
|
layout->setWidget(std::move( dw_unique ));
|
||||||
|
|
||||||
/* Set the page title with the bare filename (e.g. for images),
|
/* Set the page title with the bare filename (e.g. for images),
|
||||||
* HTML pages with a <TITLE> tag will overwrite it later */
|
* HTML pages with a <TITLE> tag will overwrite it later */
|
||||||
|
|||||||
Reference in New Issue
Block a user