Kaydet (Commit) 385bae4b authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Meeks

vclwidget: some small fixes

Change-Id: I094163c894ff9accf70050d5a4fab83e905a282b
üst a6e5ac3b
...@@ -135,7 +135,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r ...@@ -135,7 +135,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
if ( pVCLPopupMenu ) if ( pVCLPopupMenu )
{ {
boost::scoped_ptr<FontList> pFontList; boost::scoped_ptr<FontList> pFontList;
boost::scoped_ptr<Printer> pInfoPrinter; ScopedVclPtr<Printer> pInfoPrinter;
OUString aPrinterName; OUString aPrinterName;
SolarMutexGuard aSolarMutexGuard; SolarMutexGuard aSolarMutexGuard;
......
...@@ -51,6 +51,7 @@ public: ...@@ -51,6 +51,7 @@ public:
const JobSetup &rTheOrigJobSetup ); const JobSetup &rTheOrigJobSetup );
SfxPrinter( const SfxPrinter &rPrinter ); SfxPrinter( const SfxPrinter &rPrinter );
virtual ~SfxPrinter(); virtual ~SfxPrinter();
virtual void dispose() SAL_OVERRIDE;
SfxPrinter* Clone() const; SfxPrinter* Clone() const;
......
...@@ -290,7 +290,7 @@ public: ...@@ -290,7 +290,7 @@ public:
SAL_DLLPRIVATE void ResetAllClients_Impl( SfxInPlaceClient *pIP ); SAL_DLLPRIVATE void ResetAllClients_Impl( SfxInPlaceClient *pIP );
SAL_DLLPRIVATE void DiscardClients_Impl(); SAL_DLLPRIVATE void DiscardClients_Impl();
SAL_DLLPRIVATE SfxPrinter* SetPrinter_Impl( SfxPrinter *pNewPrinter ); SAL_DLLPRIVATE SfxPrinter* SetPrinter_Impl( VclPtr<SfxPrinter>& pNewPrinter );
SAL_DLLPRIVATE bool IsShowView_Impl() const; SAL_DLLPRIVATE bool IsShowView_Impl() const;
SAL_DLLPRIVATE bool HandleNotifyEvent_Impl( NotifyEvent& rEvent ); SAL_DLLPRIVATE bool HandleNotifyEvent_Impl( NotifyEvent& rEvent );
......
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
private: private:
Reference<rendering::XBitmap> mxBitmap; Reference<rendering::XBitmap> mxBitmap;
cppcanvas::CanvasSharedPtr mpCanvas; cppcanvas::CanvasSharedPtr mpCanvas;
VirtualDevice* mpOutputDevice; VclPtr<VirtualDevice> mpOutputDevice;
EditEngine* mpEditEngine; EditEngine* mpEditEngine;
SfxItemPool* mpEditEngineItemPool; SfxItemPool* mpEditEngineItemPool;
Size maSize; Size maSize;
...@@ -261,7 +261,7 @@ PresenterTextView::Implementation::~Implementation (void) ...@@ -261,7 +261,7 @@ PresenterTextView::Implementation::~Implementation (void)
{ {
delete mpEditEngine; delete mpEditEngine;
SfxItemPool::Free(mpEditEngineItemPool); SfxItemPool::Free(mpEditEngineItemPool);
delete mpOutputDevice; mpOutputDevice.disposeAndClear();
} }
EditEngine * PresenterTextView::Implementation::GetEditEngine (void) EditEngine * PresenterTextView::Implementation::GetEditEngine (void)
...@@ -453,8 +453,7 @@ Reference<rendering::XBitmap> PresenterTextView::Implementation::GetBitmap (void ...@@ -453,8 +453,7 @@ Reference<rendering::XBitmap> PresenterTextView::Implementation::GetBitmap (void
if ( ! mxBitmap.is()) if ( ! mxBitmap.is())
{ {
if (mpOutputDevice != NULL) mpOutputDevice.disposeAndClear();
delete mpOutputDevice;
mpOutputDevice = new VirtualDevice(*Application::GetDefaultDevice(), 0, 0); mpOutputDevice = new VirtualDevice(*Application::GetDefaultDevice(), 0, 0);
mpOutputDevice->SetMapMode(MAP_PIXEL); mpOutputDevice->SetMapMode(MAP_PIXEL);
mpOutputDevice->SetOutputSizePixel(maSize, true); mpOutputDevice->SetOutputSizePixel(maSize, true);
......
...@@ -188,9 +188,15 @@ SfxPrinter* SfxPrinter::Clone() const ...@@ -188,9 +188,15 @@ SfxPrinter* SfxPrinter::Clone() const
SfxPrinter::~SfxPrinter() SfxPrinter::~SfxPrinter()
{
disposeOnce();
}
void SfxPrinter::dispose()
{ {
delete pOptions; delete pOptions;
delete pImpl; delete pImpl;
Printer::dispose();
} }
......
...@@ -469,7 +469,7 @@ IMPL_LINK_NOARG(SfxDialogExecutor_Impl, Execute) ...@@ -469,7 +469,7 @@ IMPL_LINK_NOARG(SfxDialogExecutor_Impl, Execute)
Internal method for setting the differences between 'pNewPrinter' to the Internal method for setting the differences between 'pNewPrinter' to the
current printer. pNewPrinter is either taken over or deleted. current printer. pNewPrinter is either taken over or deleted.
*/ */
SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter ) SfxPrinter* SfxViewShell::SetPrinter_Impl( VclPtr<SfxPrinter>& pNewPrinter )
{ {
// get current Printer // get current Printer
SfxPrinter *pDocPrinter = GetPrinter(); SfxPrinter *pDocPrinter = GetPrinter();
...@@ -558,7 +558,7 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter ) ...@@ -558,7 +558,7 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
// Keep old changed Printer. // Keep old changed Printer.
pDocPrinter->SetPrinterProps( pNewPrinter ); pDocPrinter->SetPrinterProps( pNewPrinter );
delete pNewPrinter; pNewPrinter.disposeAndClear();
} }
if ( SfxPrinterChangeFlags::NONE != nChangedFlags ) if ( SfxPrinterChangeFlags::NONE != nChangedFlags )
......
...@@ -174,7 +174,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh, ...@@ -174,7 +174,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh,
{ {
bool bDelPrinter = false; bool bDelPrinter = false;
SfxPrinter* pPrt = pDoc ? pDoc->getIDocumentDeviceAccess().getPrinter(false) : 0; VclPtr<SfxPrinter> pPrt = pDoc ? pDoc->getIDocumentDeviceAccess().getPrinter(false) : 0;
if( !pPrt ) if( !pPrt )
{ {
SfxItemSet* pSet = new SfxItemSet( rDocSh.GetPool(), SfxItemSet* pSet = new SfxItemSet( rDocSh.GetPool(),
...@@ -211,7 +211,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh, ...@@ -211,7 +211,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh,
m_pFontLB->SelectEntry( aOpt.GetFontName() ); m_pFontLB->SelectEntry( aOpt.GetFontName() );
if( bDelPrinter ) if( bDelPrinter )
delete pPrt; pPrt.disposeAndClear();
} }
} }
......
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