summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/grfpage.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-04-28 15:14:11 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-04-28 15:14:11 +0100
commitce82146a6be87b239a0bde0b59fddf8865290b99 (patch)
treebdce5bc3ccd342e87b8e7416cdf2b426d3b80ecf /cui/source/tabpages/grfpage.cxx
parenta31991c4188e91326941fbe510ce70129d1ccde8 (diff)
parente8b97a52c96df9c8e8055407b1e40ed7cb9cfc67 (diff)
Merge remote-tracking branch 'origin/feature/vclptrmerge2'
Diffstat (limited to 'cui/source/tabpages/grfpage.cxx')
-rw-r--r--cui/source/tabpages/grfpage.cxx45
1 files changed, 35 insertions, 10 deletions
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index c416ad7c267f..af1c96b4be62 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -127,12 +127,37 @@ SvxGrfCropPage::SvxGrfCropPage ( vcl::Window *pParent, const SfxItemSet &rSet )
SvxGrfCropPage::~SvxGrfCropPage()
{
+ disposeOnce();
+}
+
+void SvxGrfCropPage::dispose()
+{
aTimer.Stop();
+ m_pCropFrame.clear();
+ m_pZoomConstRB.clear();
+ m_pSizeConstRB.clear();
+ m_pLeftMF.clear();
+ m_pRightMF.clear();
+ m_pTopMF.clear();
+ m_pBottomMF.clear();
+ m_pScaleFrame.clear();
+ m_pWidthZoomMF.clear();
+ m_pHeightZoomMF.clear();
+ m_pSizeFrame.clear();
+ m_pWidthMF.clear();
+ m_pHeightMF.clear();
+ m_pOrigSizeGrid.clear();
+ m_pOrigSizeFT.clear();
+ m_pOrigSizePB.clear();
+ m_pExampleWN.clear();
+ pLastCropField.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxGrfCropPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
+VclPtr<SfxTabPage> SvxGrfCropPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return new SvxGrfCropPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxGrfCropPage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
@@ -675,17 +700,17 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
// display original size
const FieldUnit eMetric = GetModuleFieldUnit( GetItemSet() );
- MetricField aFld(this, WB_HIDE);
- SetFieldUnit( aFld, eMetric );
- aFld.SetDecimalDigits( m_pWidthMF->GetDecimalDigits() );
- aFld.SetMax( LONG_MAX - 1 );
+ ScopedVclPtrInstance< MetricField > aFld(this, WB_HIDE);
+ SetFieldUnit( *aFld.get(), eMetric );
+ aFld->SetDecimalDigits( m_pWidthMF->GetDecimalDigits() );
+ aFld->SetMax( LONG_MAX - 1 );
- aFld.SetValue( aFld.Normalize( aOrigSize.Width() ), eUnit );
- OUString sTemp = aFld.GetText();
- aFld.SetValue( aFld.Normalize( aOrigSize.Height() ), eUnit );
+ aFld->SetValue( aFld->Normalize( aOrigSize.Width() ), eUnit );
+ OUString sTemp = aFld->GetText();
+ aFld->SetValue( aFld->Normalize( aOrigSize.Height() ), eUnit );
// multiplication sign (U+00D7)
sTemp += OUString( sal_Unicode (0x00D7) );
- sTemp += aFld.GetText();
+ sTemp += aFld->GetText();
if ( aOrigPixelSize.Width() && aOrigPixelSize.Height() ) {
sal_Int32 ax = sal_Int32(floor((float)aOrigPixelSize.Width() /