Kaydet (Commit) 62532bf1 authored tarafından Michael Meeks's avatar Michael Meeks

framework: convert new to ::Create.

Change-Id: I436ae2e58b3f79e7a0418d25532f275f5c16154f
üst 40313fc3
...@@ -180,7 +180,7 @@ void FwkTabPage::Resize() ...@@ -180,7 +180,7 @@ void FwkTabPage::Resize()
// class FwkTabWindow --------------------------------------------- // class FwkTabWindow ---------------------------------------------
FwkTabWindow::FwkTabWindow( vcl::Window* pParent ) FwkTabWindow::FwkTabWindow( vcl::Window* pParent )
: Window(pParent) : Window(pParent)
, m_aTabCtrl(new FwkTabControl(this)) , m_aTabCtrl(VclPtr<FwkTabControl>::Create(this))
{ {
m_xWinProvider = awt::ContainerWindowProvider::create( ::comphelper::getProcessComponentContext() ); m_xWinProvider = awt::ContainerWindowProvider::create( ::comphelper::getProcessComponentContext() );
...@@ -265,7 +265,7 @@ IMPL_LINK_NOARG(FwkTabWindow, ActivatePageHdl) ...@@ -265,7 +265,7 @@ IMPL_LINK_NOARG(FwkTabWindow, ActivatePageHdl)
TabEntry* pEntry = FindEntry( nId ); TabEntry* pEntry = FindEntry( nId );
if ( pEntry ) if ( pEntry )
{ {
pTabPage = new FwkTabPage( m_aTabCtrl.get(), pEntry->m_sPageURL, pEntry->m_xEventHdl, m_xWinProvider ); pTabPage = VclPtr<FwkTabPage>::Create( m_aTabCtrl.get(), pEntry->m_sPageURL, pEntry->m_xEventHdl, m_xWinProvider );
pEntry->m_pPage = pTabPage; pEntry->m_pPage = pTabPage;
m_aTabCtrl->SetTabPage( nId, pTabPage ); m_aTabCtrl->SetTabPage( nId, pTabPage );
pTabPage->Show(); pTabPage->Show();
......
...@@ -48,7 +48,7 @@ void SAL_CALL VCLStatusIndicator::start(const OUString& sText , ...@@ -48,7 +48,7 @@ void SAL_CALL VCLStatusIndicator::start(const OUString& sText ,
vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(m_xParentWindow); vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(m_xParentWindow);
if (!m_pStatusBar) if (!m_pStatusBar)
m_pStatusBar = new StatusBar(pParentWindow, WB_3DLOOK|WB_BORDER); m_pStatusBar = VclPtr<StatusBar>::Create(pParentWindow, WB_3DLOOK|WB_BORDER);
VCLStatusIndicator::impl_recalcLayout(m_pStatusBar, pParentWindow); VCLStatusIndicator::impl_recalcLayout(m_pStatusBar, pParentWindow);
......
...@@ -902,7 +902,7 @@ void LayoutManager::implts_createProgressBar() ...@@ -902,7 +902,7 @@ void LayoutManager::implts_createProgressBar()
vcl::Window* pWindow = VCLUnoHelper::GetWindow( xContainerWindow ); vcl::Window* pWindow = VCLUnoHelper::GetWindow( xContainerWindow );
if ( pWindow ) if ( pWindow )
{ {
StatusBar* pStatusBar = new StatusBar( pWindow, WinBits( WB_LEFT | WB_3DLOOK ) ); VclPtrInstance<StatusBar> pStatusBar( pWindow, WinBits( WB_LEFT | WB_3DLOOK ) );
Reference< awt::XWindow > xStatusBarWindow2( VCLUnoHelper::GetInterface( pStatusBar )); Reference< awt::XWindow > xStatusBarWindow2( VCLUnoHelper::GetInterface( pStatusBar ));
pWrapper->setStatusBar( xStatusBarWindow2, true ); pWrapper->setStatusBar( xStatusBarWindow2, true );
} }
......
...@@ -114,7 +114,7 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument ...@@ -114,7 +114,7 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument
{ {
sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE; sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
pToolBar = new ToolBox( pWindow, nStyles ); pToolBar = VclPtr<ToolBox>::Create( pWindow, nStyles );
pToolBarManager = new AddonsToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar ); pToolBarManager = new AddonsToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY ); m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
} }
......
...@@ -149,7 +149,7 @@ ComboboxToolbarController::ComboboxToolbarController( ...@@ -149,7 +149,7 @@ ComboboxToolbarController::ComboboxToolbarController(
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand ) ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
, m_pComboBox( 0 ) , m_pComboBox( 0 )
{ {
m_pComboBox = new ComboBoxControl( m_pToolbar, WB_DROPDOWN, this ); m_pComboBox = VclPtr<ComboBoxControl>::Create( m_pToolbar, WB_DROPDOWN, this );
if ( nWidth == 0 ) if ( nWidth == 0 )
nWidth = 100; nWidth = 100;
......
...@@ -132,7 +132,7 @@ DropdownToolbarController::DropdownToolbarController( ...@@ -132,7 +132,7 @@ DropdownToolbarController::DropdownToolbarController(
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand ) ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
, m_pListBoxControl( 0 ) , m_pListBoxControl( 0 )
{ {
m_pListBoxControl = new ListBoxControl( m_pToolbar, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER, this ); m_pListBoxControl = VclPtr<ListBoxControl>::Create( m_pToolbar, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER, this );
if ( nWidth == 0 ) if ( nWidth == 0 )
nWidth = 100; nWidth = 100;
......
...@@ -131,7 +131,7 @@ EditToolbarController::EditToolbarController( ...@@ -131,7 +131,7 @@ EditToolbarController::EditToolbarController(
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand ) ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
, m_pEditControl( 0 ) , m_pEditControl( 0 )
{ {
m_pEditControl = new EditControl( m_pToolbar, WB_BORDER, this ); m_pEditControl = VclPtr<EditControl>::Create( m_pToolbar, WB_BORDER, this );
if ( nWidth == 0 ) if ( nWidth == 0 )
nWidth = 100; nWidth = 100;
......
...@@ -144,7 +144,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r ...@@ -144,7 +144,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
aPrinterName = retrievePrinterName( m_xFrame ); aPrinterName = retrievePrinterName( m_xFrame );
if ( !aPrinterName.isEmpty() ) if ( !aPrinterName.isEmpty() )
{ {
pInfoPrinter.reset(new Printer( aPrinterName )); pInfoPrinter.reset(VclPtr<Printer>::Create( aPrinterName ));
if ( pInfoPrinter && pInfoPrinter->GetDevFontCount() > 0 ) if ( pInfoPrinter && pInfoPrinter->GetDevFontCount() > 0 )
pFontList.reset(new FontList( pInfoPrinter.get() )); pFontList.reset(new FontList( pInfoPrinter.get() ));
} }
......
...@@ -192,7 +192,7 @@ SpinfieldToolbarController::SpinfieldToolbarController( ...@@ -192,7 +192,7 @@ SpinfieldToolbarController::SpinfieldToolbarController(
, m_nStep( 0.0 ) , m_nStep( 0.0 )
, m_pSpinfieldControl( 0 ) , m_pSpinfieldControl( 0 )
{ {
m_pSpinfieldControl = new SpinfieldControl( m_pToolbar, WB_SPIN|WB_BORDER, this ); m_pSpinfieldControl = VclPtr<SpinfieldControl>::Create( m_pToolbar, WB_SPIN|WB_BORDER, this );
if ( nWidth == 0 ) if ( nWidth == 0 )
nWidth = 100; nWidth = 100;
......
...@@ -110,7 +110,7 @@ void SAL_CALL StatusBarWrapper::initialize( const Sequence< Any >& aArguments ) ...@@ -110,7 +110,7 @@ void SAL_CALL StatusBarWrapper::initialize( const Sequence< Any >& aArguments )
{ {
sal_uLong nStyles = WinBits( WB_LEFT | WB_3DLOOK ); sal_uLong nStyles = WinBits( WB_LEFT | WB_3DLOOK );
pStatusBar = new FrameworkStatusBar( pWindow, nStyles ); pStatusBar = VclPtr<FrameworkStatusBar>::Create( pWindow, nStyles );
pStatusBarManager = new StatusBarManager( m_xContext, xFrame, m_aResourceURL, pStatusBar ); pStatusBarManager = new StatusBarManager( m_xContext, xFrame, m_aResourceURL, pStatusBar );
static_cast<FrameworkStatusBar*>(pStatusBar)->SetStatusBarManager( pStatusBarManager ); static_cast<FrameworkStatusBar*>(pStatusBar)->SetStatusBarManager( pStatusBarManager );
m_xStatusBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pStatusBarManager ), UNO_QUERY ); m_xStatusBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pStatusBarManager ), UNO_QUERY );
......
...@@ -150,7 +150,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th ...@@ -150,7 +150,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th
{ {
sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE; sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
pToolBar = new ToolBox( pWindow, nStyles ); pToolBar = VclPtr<ToolBox>::Create( pWindow, nStyles );
pToolBarManager = new ToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar ); pToolBarManager = new ToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY ); m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
pToolBar->WillUsePopupMode( bPopupMode ); pToolBar->WillUsePopupMode( bPopupMode );
......
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