Don't use 'this' in ctor
Change-Id: I405160743609aae92a37b2359bea5aa42ee66519
This commit is contained in:
@@ -65,7 +65,7 @@ class SFX2_DLLPUBLIC SidebarController
|
|||||||
public SidebarControllerInterfaceBase
|
public SidebarControllerInterfaceBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SidebarController(
|
static rtl::Reference<SidebarController> create(
|
||||||
SidebarDockingWindow* pParentWindow,
|
SidebarDockingWindow* pParentWindow,
|
||||||
const css::uno::Reference<css::frame::XFrame>& rxFrame);
|
const css::uno::Reference<css::frame::XFrame>& rxFrame);
|
||||||
virtual ~SidebarController() override;
|
virtual ~SidebarController() override;
|
||||||
@@ -163,6 +163,9 @@ public:
|
|||||||
void FadeOut();
|
void FadeOut();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
SidebarController(
|
||||||
|
SidebarDockingWindow* pParentWindow,
|
||||||
|
const css::uno::Reference<css::frame::XFrame>& rxFrame);
|
||||||
|
|
||||||
VclPtr<Deck> mpCurrentDeck;
|
VclPtr<Deck> mpCurrentDeck;
|
||||||
VclPtr<SidebarDockingWindow> mpParentWindow;
|
VclPtr<SidebarDockingWindow> mpParentWindow;
|
||||||
|
@@ -116,24 +116,34 @@ SidebarController::SidebarController (
|
|||||||
{
|
{
|
||||||
// Decks and panel collections for this sidebar
|
// Decks and panel collections for this sidebar
|
||||||
mpResourceManager = o3tl::make_unique<ResourceManager>();
|
mpResourceManager = o3tl::make_unique<ResourceManager>();
|
||||||
|
}
|
||||||
|
|
||||||
registerSidebarForFrame(this, mxFrame->getController());
|
rtl::Reference<SidebarController> SidebarController::create(
|
||||||
|
SidebarDockingWindow* pParentWindow,
|
||||||
|
const css::uno::Reference<css::frame::XFrame>& rxFrame)
|
||||||
|
{
|
||||||
|
rtl::Reference<SidebarController> instance(
|
||||||
|
new SidebarController(pParentWindow, rxFrame));
|
||||||
|
|
||||||
|
registerSidebarForFrame(instance.get(), rxFrame->getController());
|
||||||
// Listen for window events.
|
// Listen for window events.
|
||||||
mpParentWindow->AddEventListener(LINK(this, SidebarController, WindowEventHandler));
|
instance->mpParentWindow->AddEventListener(LINK(instance.get(), SidebarController, WindowEventHandler));
|
||||||
|
|
||||||
// Listen for theme property changes.
|
// Listen for theme property changes.
|
||||||
Theme::GetPropertySet()->addPropertyChangeListener(
|
Theme::GetPropertySet()->addPropertyChangeListener(
|
||||||
"",
|
"",
|
||||||
static_cast<css::beans::XPropertyChangeListener*>(this));
|
static_cast<css::beans::XPropertyChangeListener*>(instance.get()));
|
||||||
|
|
||||||
// Get the dispatch object as preparation to listen for changes of
|
// Get the dispatch object as preparation to listen for changes of
|
||||||
// the read-only state.
|
// the read-only state.
|
||||||
const util::URL aURL (Tools::GetURL(gsReadOnlyCommandName));
|
const util::URL aURL (Tools::GetURL(gsReadOnlyCommandName));
|
||||||
mxReadOnlyModeDispatch = Tools::GetDispatch(mxFrame, aURL);
|
instance->mxReadOnlyModeDispatch = Tools::GetDispatch(rxFrame, aURL);
|
||||||
if (mxReadOnlyModeDispatch.is())
|
if (instance->mxReadOnlyModeDispatch.is())
|
||||||
mxReadOnlyModeDispatch->addStatusListener(this, aURL);
|
instance->mxReadOnlyModeDispatch->addStatusListener(instance.get(), aURL);
|
||||||
|
|
||||||
SwitchToDeck(gsDefaultDeckId);
|
instance->SwitchToDeck(gsDefaultDeckId);
|
||||||
|
|
||||||
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
SidebarController::~SidebarController()
|
SidebarController::~SidebarController()
|
||||||
|
@@ -44,7 +44,7 @@ SidebarDockingWindow::SidebarDockingWindow(SfxBindings* pSfxBindings, SidebarChi
|
|||||||
{
|
{
|
||||||
const SfxViewFrame* pViewFrame = pSfxBindings->GetDispatcher()->GetFrame();
|
const SfxViewFrame* pViewFrame = pSfxBindings->GetDispatcher()->GetFrame();
|
||||||
const SfxFrame& rFrame = pViewFrame->GetFrame();
|
const SfxFrame& rFrame = pViewFrame->GetFrame();
|
||||||
mpSidebarController.set(new sfx2::sidebar::SidebarController(this, rFrame.GetFrameInterface()));
|
mpSidebarController.set(sfx2::sidebar::SidebarController::create(this, rFrame.GetFrameInterface()).get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user