diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-16 21:32:18 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 11:32:47 +0100 |
commit | ad194534994a50f691c4ea15123b215cb93cc802 (patch) | |
tree | 6de6b6b3e4b2f1756367cfaeea8c08ccd3fb6009 /sw | |
parent | 29e8c9ca3167b1366bd3b455df64ace5aea75bc1 (diff) |
sw, sd: more toolkit API cleanup.
Change-Id: I2015f517695682f17fe5c03a8df0171a427717bf
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/view/printdata.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 16 |
2 files changed, 11 insertions, 10 deletions
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index f0c11fe2611c..f549dda609ad 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -471,11 +471,12 @@ bool SwPrintUIOptions::processPropertiesAndCheckFormat( const uno::Sequence< bea uno::Any aVal( getValue( "RenderDevice" ) ); aVal >>= xRenderDevice; - OutputDevice* pOut = 0; + VclPtr< OutputDevice > pOut; if (xRenderDevice.is()) { VCLXDevice* pDevice = VCLXDevice::GetImplementation( xRenderDevice ); - pOut = pDevice ? pDevice->GetOutputDevice() : 0; + if (pDevice) + pOut = pDevice->GetOutputDevice(); } bChanged = bChanged || (pOut != m_pLast); if( pOut ) diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 5feadbf3b6af..685260fdc65a 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -2320,9 +2320,9 @@ Any SAL_CALL SwXTextDocument::getPropertyDefault( const OUString& rPropertyName return aAny; } -static OutputDevice * lcl_GetOutputDevice( const SwPrintUIOptions &rPrintUIOptions ) +static VclPtr< OutputDevice > lcl_GetOutputDevice( const SwPrintUIOptions &rPrintUIOptions ) { - OutputDevice *pOut = 0; + VclPtr< OutputDevice > pOut; uno::Any aAny( rPrintUIOptions.getValue( "RenderDevice" )); uno::Reference< awt::XDevice > xRenderDevice; @@ -2330,7 +2330,7 @@ static OutputDevice * lcl_GetOutputDevice( const SwPrintUIOptions &rPrintUIOptio if (xRenderDevice.is()) { VCLXDevice* pDevice = VCLXDevice::GetImplementation( xRenderDevice ); - pOut = pDevice ? pDevice->GetOutputDevice() : 0; + pOut = pDevice ? pDevice->GetOutputDevice() : VclPtr< OutputDevice >(); } return pOut; @@ -2519,7 +2519,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( if (bIsSwSrcView) { SwSrcView& rSwSrcView = dynamic_cast<SwSrcView&>(*pView); - OutputDevice *pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); + VclPtr< OutputDevice> pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); nRet = rSwSrcView.PrintSource( pOutDev, 1 /* dummy */, true /* get page count only */ ); } else @@ -2634,7 +2634,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( const sal_Int16 nPostItMode = (sal_Int16) m_pPrintUIOptions->getIntValue( "PrintAnnotationMode", 0 ); if (nPostItMode != POSTITS_NONE) { - OutputDevice *pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); + VclPtr< OutputDevice > pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); m_pRenderData->CreatePostItData( pDoc, pViewShell->GetViewOptions(), pOutDev ); } @@ -2758,7 +2758,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( // Sometimes 'getRenderer' is only called to get "ExtraPrintUIOptions", in this // case we won't get an OutputDevice here, but then the caller also has no need // for the correct PageSisze right now... - Printer *pPrinter = dynamic_cast< Printer * >(lcl_GetOutputDevice( *m_pPrintUIOptions )); + VclPtr< Printer > pPrinter = dynamic_cast< Printer * >(lcl_GetOutputDevice( *m_pPrintUIOptions ).get()); if (pPrinter) { // HTML source view and prospect adapt to the printer's paper size @@ -2976,7 +2976,7 @@ void SAL_CALL SwXTextDocument::render( if (bIsSwSrcView) { SwSrcView& rSwSrcView = dynamic_cast<SwSrcView&>(*pView); - OutputDevice *pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); + VclPtr< OutputDevice > pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); rSwSrcView.PrintSource(pOutDev, nRenderer + 1, false); } else @@ -2998,7 +2998,7 @@ void SAL_CALL SwXTextDocument::render( } // get output device to use - OutputDevice * pOut = lcl_GetOutputDevice( *m_pPrintUIOptions ); + VclPtr< OutputDevice > pOut = lcl_GetOutputDevice( *m_pPrintUIOptions ); if(pVwSh && pOut && m_pRenderData->HasSwPrtOptions()) { |