Kaydet (Commit) 0baadcea authored tarafından Michael Meeks's avatar Michael Meeks

Re-work app side-bar code to manage objects correctly.

Change-Id: Ie0eb8fe41a9fd4f996f724c47d20d6edecba3672
üst 26fced1c
...@@ -218,7 +218,7 @@ IMPL_LINK(AlignmentPropertyPanel, CBOXWrapTextClkHdl, void*, EMPTYARG) ...@@ -218,7 +218,7 @@ IMPL_LINK(AlignmentPropertyPanel, CBOXWrapTextClkHdl, void*, EMPTYARG)
return 0; return 0;
} }
AlignmentPropertyPanel* AlignmentPropertyPanel::Create ( VclPtr<vcl::Window> AlignmentPropertyPanel::Create (
vcl::Window* pParent, vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame, const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings) SfxBindings* pBindings)
...@@ -230,10 +230,10 @@ AlignmentPropertyPanel* AlignmentPropertyPanel::Create ( ...@@ -230,10 +230,10 @@ AlignmentPropertyPanel* AlignmentPropertyPanel::Create (
if (pBindings == NULL) if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to AlignmentPropertyPanel::Create", NULL, 2); throw lang::IllegalArgumentException("no SfxBindings given to AlignmentPropertyPanel::Create", NULL, 2);
return new AlignmentPropertyPanel( return VclPtr<vcl::Window>(
pParent, new AlignmentPropertyPanel(
rxFrame, pParent, rxFrame, pBindings),
pBindings); SAL_NO_ACQUIRE);
} }
void AlignmentPropertyPanel::DataChanged( void AlignmentPropertyPanel::DataChanged(
......
...@@ -39,7 +39,7 @@ class AlignmentPropertyPanel ...@@ -39,7 +39,7 @@ class AlignmentPropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{ {
public: public:
static AlignmentPropertyPanel* Create( static VclPtr<vcl::Window> Create(
vcl::Window* pParent, vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame, const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings); SfxBindings* pBindings);
......
...@@ -235,7 +235,7 @@ IMPL_LINK(CellAppearancePropertyPanel, CBOXGridShowClkHdl, void*, EMPTYARG) ...@@ -235,7 +235,7 @@ IMPL_LINK(CellAppearancePropertyPanel, CBOXGridShowClkHdl, void*, EMPTYARG)
return 0; return 0;
} }
CellAppearancePropertyPanel* CellAppearancePropertyPanel::Create ( VclPtr<vcl::Window> CellAppearancePropertyPanel::Create (
vcl::Window* pParent, vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame, const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings) SfxBindings* pBindings)
...@@ -247,10 +247,10 @@ CellAppearancePropertyPanel* CellAppearancePropertyPanel::Create ( ...@@ -247,10 +247,10 @@ CellAppearancePropertyPanel* CellAppearancePropertyPanel::Create (
if (pBindings == NULL) if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to CellAppearancePropertyPanel::Create", NULL, 2); throw lang::IllegalArgumentException("no SfxBindings given to CellAppearancePropertyPanel::Create", NULL, 2);
return new CellAppearancePropertyPanel( return VclPtr<vcl::Window>(
pParent, new CellAppearancePropertyPanel(
rxFrame, pParent, rxFrame, pBindings),
pBindings); SAL_NO_ACQUIRE);
} }
void CellAppearancePropertyPanel::DataChanged( void CellAppearancePropertyPanel::DataChanged(
......
...@@ -50,7 +50,7 @@ private: ...@@ -50,7 +50,7 @@ private:
friend class CellBorderStyleControl; friend class CellBorderStyleControl;
public: public:
static CellAppearancePropertyPanel* Create( static VclPtr<vcl::Window> Create(
vcl::Window* pParent, vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame, const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings); SfxBindings* pBindings);
......
...@@ -178,7 +178,7 @@ IMPL_LINK( NumberFormatPropertyPanel, NumFormatValueHdl, void*, EMPTYARG ) ...@@ -178,7 +178,7 @@ IMPL_LINK( NumberFormatPropertyPanel, NumFormatValueHdl, void*, EMPTYARG )
return 0L; return 0L;
} }
NumberFormatPropertyPanel* NumberFormatPropertyPanel::Create ( VclPtr<vcl::Window> NumberFormatPropertyPanel::Create (
vcl::Window* pParent, vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame, const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings) SfxBindings* pBindings)
...@@ -190,10 +190,10 @@ NumberFormatPropertyPanel* NumberFormatPropertyPanel::Create ( ...@@ -190,10 +190,10 @@ NumberFormatPropertyPanel* NumberFormatPropertyPanel::Create (
if (pBindings == NULL) if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to NumberFormatPropertyPanel::Create", NULL, 2); throw lang::IllegalArgumentException("no SfxBindings given to NumberFormatPropertyPanel::Create", NULL, 2);
return new NumberFormatPropertyPanel( return VclPtr<vcl::Window>(
pParent, new NumberFormatPropertyPanel(
rxFrame, pParent, rxFrame, pBindings),
pBindings); SAL_NO_ACQUIRE);
} }
void NumberFormatPropertyPanel::DataChanged( void NumberFormatPropertyPanel::DataChanged(
......
...@@ -37,7 +37,7 @@ class NumberFormatPropertyPanel ...@@ -37,7 +37,7 @@ class NumberFormatPropertyPanel
{ {
public: public:
public: public:
static NumberFormatPropertyPanel* Create( static VclPtr<vcl::Window> Create(
vcl::Window* pParent, vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame, const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings); SfxBindings* pBindings);
......
...@@ -108,51 +108,31 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement ( ...@@ -108,51 +108,31 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
"PanelFactory::createUIElement called without SfxBindings", "PanelFactory::createUIElement called without SfxBindings",
NULL); NULL);
sal_Int32 nMinimumSize = -1;
VclPtr<vcl::Window> pPanel;
if (rsResourceURL.endsWith("/AlignmentPropertyPanel")) if (rsResourceURL.endsWith("/AlignmentPropertyPanel"))
{ pPanel = AlignmentPropertyPanel::Create( pParentWindow, xFrame, pBindings );
AlignmentPropertyPanel* pPanel = AlignmentPropertyPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
pPanel,
ui::LayoutSize(-1,-1,-1));
}
else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel")) else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel"))
{ pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
CellAppearancePropertyPanel* pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
pPanel,
ui::LayoutSize(-1,-1,-1));
}
else if (rsResourceURL.endsWith("/NumberFormatPropertyPanel")) else if (rsResourceURL.endsWith("/NumberFormatPropertyPanel"))
{ pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
NumberFormatPropertyPanel* pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
pPanel,
ui::LayoutSize(-1,-1,-1));
}
else if (rsResourceURL.endsWith("/NavigatorPanel")) else if (rsResourceURL.endsWith("/NavigatorPanel"))
{ {
vcl::Window* pPanel = new ScNavigatorDlg(pBindings, NULL, pParentWindow, false); pPanel = VclPtr<vcl::Window>(new ScNavigatorDlg(pBindings, NULL, pParentWindow, false), SAL_NO_ACQUIRE);
xElement = sfx2::sidebar::SidebarPanelBase::Create( nMinimumSize = 0;
rsResourceURL,
xFrame,
pPanel,
ui::LayoutSize(0,-1,-1));
} }
else if (rsResourceURL.endsWith("/FunctionsPanel")) else if (rsResourceURL.endsWith("/FunctionsPanel"))
{ {
vcl::Window* pPanel = new ScFunctionDockWin(pBindings, NULL, pParentWindow, ScResId(FID_FUNCTION_BOX)); pPanel = VclPtr<vcl::Window>(new ScFunctionDockWin(pBindings, NULL, pParentWindow, ScResId(FID_FUNCTION_BOX)), SAL_NO_ACQUIRE);;
nMinimumSize = 0;
}
if (pPanel)
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL, rsResourceURL,
xFrame, xFrame,
pPanel, pPanel,
ui::LayoutSize(0,-1,-1)); ui::LayoutSize(nMinimumSize,-1,-1));
}
} }
catch (const uno::RuntimeException &) catch (const uno::RuntimeException &)
{ {
......
...@@ -77,7 +77,7 @@ public: ...@@ -77,7 +77,7 @@ public:
SortedMasterPageDescriptorList (void) {} SortedMasterPageDescriptorList (void) {}
}; };
MasterPagesSelector* AllMasterPagesSelector::Create ( VclPtr<vcl::Window> AllMasterPagesSelector::Create (
vcl::Window* pParent, vcl::Window* pParent,
ViewShellBase& rViewShellBase, ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar) const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
...@@ -88,13 +88,14 @@ MasterPagesSelector* AllMasterPagesSelector::Create ( ...@@ -88,13 +88,14 @@ MasterPagesSelector* AllMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer()); ::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
MasterPagesSelector* pSelector( VclPtr<MasterPagesSelector> pSelector(
new AllMasterPagesSelector ( new AllMasterPagesSelector (
pParent, pParent,
*pDocument, *pDocument,
rViewShellBase, rViewShellBase,
pContainer, pContainer,
rxSidebar)); rxSidebar),
SAL_NO_ACQUIRE);
pSelector->LateInit(); pSelector->LateInit();
pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_ALL); pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_ALL);
......
...@@ -37,7 +37,7 @@ class AllMasterPagesSelector ...@@ -37,7 +37,7 @@ class AllMasterPagesSelector
: public MasterPagesSelector : public MasterPagesSelector
{ {
public: public:
static MasterPagesSelector* Create ( static VclPtr<vcl::Window> Create (
vcl::Window* pParent, vcl::Window* pParent,
ViewShellBase& rViewShellBase, ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar); const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
......
...@@ -42,7 +42,7 @@ using namespace ::com::sun::star; ...@@ -42,7 +42,7 @@ using namespace ::com::sun::star;
namespace sd { namespace sidebar { namespace sd { namespace sidebar {
MasterPagesSelector* CurrentMasterPagesSelector::Create ( VclPtr<vcl::Window> CurrentMasterPagesSelector::Create (
vcl::Window* pParent, vcl::Window* pParent,
ViewShellBase& rViewShellBase, ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar) const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
...@@ -53,13 +53,14 @@ MasterPagesSelector* CurrentMasterPagesSelector::Create ( ...@@ -53,13 +53,14 @@ MasterPagesSelector* CurrentMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer()); ::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
MasterPagesSelector* pSelector( VclPtr<MasterPagesSelector> pSelector(
new CurrentMasterPagesSelector ( new CurrentMasterPagesSelector (
pParent, pParent,
*pDocument, *pDocument,
rViewShellBase, rViewShellBase,
pContainer, pContainer,
rxSidebar)); rxSidebar),
SAL_NO_ACQUIRE);
pSelector->LateInit(); pSelector->LateInit();
pSelector->SetHelpId( HID_SD_TASK_PANE_PREVIEW_CURRENT ); pSelector->SetHelpId( HID_SD_TASK_PANE_PREVIEW_CURRENT );
......
...@@ -35,7 +35,7 @@ class CurrentMasterPagesSelector ...@@ -35,7 +35,7 @@ class CurrentMasterPagesSelector
public SfxListener public SfxListener
{ {
public: public:
static MasterPagesSelector* Create ( static VclPtr<vcl::Window> Create (
vcl::Window* pParent, vcl::Window* pParent,
ViewShellBase& rViewShellBase, ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar); const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
......
...@@ -120,14 +120,14 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( ...@@ -120,14 +120,14 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue); SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue);
// Create a framework view. // Create a framework view.
vcl::Window* pControl = NULL; VclPtr<vcl::Window> pControl;
css::ui::LayoutSize aLayoutSize (-1,-1,-1); css::ui::LayoutSize aLayoutSize (-1,-1,-1);
#define EndsWith(s,t) s.endsWithAsciiL(t,strlen(t)) #define EndsWith(s,t) s.endsWithAsciiL(t,strlen(t))
if (EndsWith(rsUIElementResourceURL, gsResourceNameCustomAnimations)) if (EndsWith(rsUIElementResourceURL, gsResourceNameCustomAnimations))
pControl = new CustomAnimationPanel(pParentWindow, *pBase, xFrame); pControl = VclPtr<vcl::Window>(new CustomAnimationPanel(pParentWindow, *pBase, xFrame), SAL_NO_ACQUIRE);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameLayouts)) else if (EndsWith(rsUIElementResourceURL, gsResourceNameLayouts))
pControl = new LayoutMenu(pParentWindow, *pBase, xSidebar); pControl = VclPtr<vcl::Window>(new LayoutMenu(pParentWindow, *pBase, xSidebar), SAL_NO_ACQUIRE);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameAllMasterPages)) else if (EndsWith(rsUIElementResourceURL, gsResourceNameAllMasterPages))
pControl = AllMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar); pControl = AllMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameRecentMasterPages)) else if (EndsWith(rsUIElementResourceURL, gsResourceNameRecentMasterPages))
...@@ -135,14 +135,14 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( ...@@ -135,14 +135,14 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
else if (EndsWith(rsUIElementResourceURL, gsResourceNameUsedMasterPages)) else if (EndsWith(rsUIElementResourceURL, gsResourceNameUsedMasterPages))
pControl = CurrentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar); pControl = CurrentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameSlideTransitions)) else if (EndsWith(rsUIElementResourceURL, gsResourceNameSlideTransitions))
pControl = new SlideTransitionPanel(pParentWindow, *pBase, xFrame); pControl = VclPtr<vcl::Window>(new SlideTransitionPanel(pParentWindow, *pBase, xFrame), SAL_NO_ACQUIRE);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameTableDesign)) else if (EndsWith(rsUIElementResourceURL, gsResourceNameTableDesign))
pControl = new TableDesignPanel(pParentWindow, *pBase); pControl = VclPtr<vcl::Window>(new TableDesignPanel(pParentWindow, *pBase), SAL_NO_ACQUIRE);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameNavigator)) else if (EndsWith(rsUIElementResourceURL, gsResourceNameNavigator))
pControl = new NavigatorWrapper(pParentWindow, *pBase, pBindings); pControl = VclPtr<vcl::Window>(new NavigatorWrapper(pParentWindow, *pBase, pBindings), SAL_NO_ACQUIRE);
#undef EndsWith #undef EndsWith
if (pControl == NULL) if (!pControl)
throw lang::IllegalArgumentException(); throw lang::IllegalArgumentException();
// Create a wrapper around the control that implements the // Create a wrapper around the control that implements the
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
namespace sd { namespace sidebar { namespace sd { namespace sidebar {
MasterPagesSelector* RecentMasterPagesSelector::Create ( VclPtr<vcl::Window> RecentMasterPagesSelector::Create (
vcl::Window* pParent, vcl::Window* pParent,
ViewShellBase& rViewShellBase, ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar) const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
...@@ -43,13 +43,14 @@ MasterPagesSelector* RecentMasterPagesSelector::Create ( ...@@ -43,13 +43,14 @@ MasterPagesSelector* RecentMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer()); ::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
MasterPagesSelector* pSelector( VclPtr<MasterPagesSelector> pSelector(
new RecentMasterPagesSelector ( new RecentMasterPagesSelector (
pParent, pParent,
*pDocument, *pDocument,
rViewShellBase, rViewShellBase,
pContainer, pContainer,
rxSidebar)); rxSidebar),
SAL_NO_ACQUIRE);
pSelector->LateInit(); pSelector->LateInit();
pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_RECENT); pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_RECENT);
......
...@@ -30,7 +30,7 @@ class RecentMasterPagesSelector ...@@ -30,7 +30,7 @@ class RecentMasterPagesSelector
: public MasterPagesSelector : public MasterPagesSelector
{ {
public: public:
static MasterPagesSelector* Create ( static VclPtr<vcl::Window> Create (
vcl::Window* pParent, vcl::Window* pParent,
ViewShellBase& rViewShellBase, ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar); const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
......
...@@ -83,7 +83,7 @@ namespace { ...@@ -83,7 +83,7 @@ namespace {
namespace sw { namespace sidebar { namespace sw { namespace sidebar {
PagePropertyPanel* PagePropertyPanel::Create ( VclPtr<vcl::Window> PagePropertyPanel::Create (
vcl::Window* pParent, vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame,
SfxBindings* pBindings) SfxBindings* pBindings)
...@@ -95,10 +95,12 @@ PagePropertyPanel* PagePropertyPanel::Create ( ...@@ -95,10 +95,12 @@ PagePropertyPanel* PagePropertyPanel::Create (
if (pBindings == NULL) if (pBindings == NULL)
throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to PagePropertyPanel::Create", NULL, 2); throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to PagePropertyPanel::Create", NULL, 2);
return new PagePropertyPanel( return VclPtr<vcl::Window>(
pParent, new PagePropertyPanel(
rxFrame, pParent,
pBindings); rxFrame,
pBindings),
SAL_NO_ACQUIRE);
} }
PagePropertyPanel::PagePropertyPanel( PagePropertyPanel::PagePropertyPanel(
......
...@@ -55,7 +55,7 @@ namespace sw { namespace sidebar { ...@@ -55,7 +55,7 @@ namespace sw { namespace sidebar {
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{ {
public: public:
static PagePropertyPanel* Create( static VclPtr<vcl::Window> Create(
vcl::Window* pParent, vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame,
SfxBindings* pBindings ); SfxBindings* pBindings );
......
...@@ -119,7 +119,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( ...@@ -119,7 +119,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
if (rsResourceURL.endsWith("/PagePropertyPanel")) if (rsResourceURL.endsWith("/PagePropertyPanel"))
{ {
sw::sidebar::PagePropertyPanel* pPanel = sw::sidebar::PagePropertyPanel::Create( pParentWindow, xFrame, pBindings ); VclPtr<vcl::Window> pPanel = sw::sidebar::PagePropertyPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL, rsResourceURL,
xFrame, xFrame,
...@@ -128,7 +128,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( ...@@ -128,7 +128,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
} }
else if (rsResourceURL.endsWith("/WrapPropertyPanel")) else if (rsResourceURL.endsWith("/WrapPropertyPanel"))
{ {
sw::sidebar::WrapPropertyPanel* pPanel = sw::sidebar::WrapPropertyPanel::Create( pParentWindow, xFrame, pBindings ); VclPtr<vcl::Window> pPanel = sw::sidebar::WrapPropertyPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL, rsResourceURL,
xFrame, xFrame,
...@@ -137,7 +137,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( ...@@ -137,7 +137,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
} }
else if (rsResourceURL.endsWith("/NavigatorPanel")) else if (rsResourceURL.endsWith("/NavigatorPanel"))
{ {
vcl::Window* pPanel = new SwNavigationPI(pBindings, NULL, pParentWindow); VclPtr<vcl::Window> pPanel( new SwNavigationPI(pBindings, NULL, pParentWindow), SAL_NO_ACQUIRE );
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL, rsResourceURL,
xFrame, xFrame,
...@@ -146,7 +146,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( ...@@ -146,7 +146,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
} }
else if (rsResourceURL.endsWith("/ManageChangesPanel")) else if (rsResourceURL.endsWith("/ManageChangesPanel"))
{ {
vcl::Window* pPanel = new SwRedlineAcceptPanel(pParentWindow, xFrame); VclPtr<vcl::Window> pPanel( new SwRedlineAcceptPanel(pParentWindow, xFrame), SAL_NO_ACQUIRE );
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL, rsResourceURL,
xFrame, xFrame,
......
...@@ -42,7 +42,7 @@ const char UNO_WRAPIDEAL[] = ".uno:WrapIdeal"; ...@@ -42,7 +42,7 @@ const char UNO_WRAPIDEAL[] = ".uno:WrapIdeal";
namespace sw { namespace sidebar { namespace sw { namespace sidebar {
WrapPropertyPanel* WrapPropertyPanel::Create ( VclPtr<vcl::Window> WrapPropertyPanel::Create (
vcl::Window* pParent, vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
SfxBindings* pBindings) SfxBindings* pBindings)
...@@ -54,10 +54,12 @@ WrapPropertyPanel* WrapPropertyPanel::Create ( ...@@ -54,10 +54,12 @@ WrapPropertyPanel* WrapPropertyPanel::Create (
if (pBindings == NULL) if (pBindings == NULL)
throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to WrapPropertyPanel::Create", NULL, 2); throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to WrapPropertyPanel::Create", NULL, 2);
return new WrapPropertyPanel( return VclPtr<vcl::Window>(
pParent, new WrapPropertyPanel(
rxFrame, pParent,
pBindings); rxFrame,
pBindings),
SAL_NO_ACQUIRE);
} }
WrapPropertyPanel::WrapPropertyPanel( WrapPropertyPanel::WrapPropertyPanel(
......
...@@ -35,7 +35,7 @@ namespace sw { namespace sidebar { ...@@ -35,7 +35,7 @@ namespace sw { namespace sidebar {
, public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface , public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{ {
public: public:
static WrapPropertyPanel* Create( static VclPtr<vcl::Window> Create(
vcl::Window* pParent, vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame,
SfxBindings* pBindings ); SfxBindings* pBindings );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment