summaryrefslogtreecommitdiff
path: root/extensions/source/propctrlr
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/propctrlr')
-rw-r--r--extensions/source/propctrlr/MasterDetailLinkDialog.cxx4
-rw-r--r--extensions/source/propctrlr/MasterDetailLinkDialog.hxx2
-rw-r--r--extensions/source/propctrlr/browserline.cxx37
-rw-r--r--extensions/source/propctrlr/browserline.hxx12
-rw-r--r--extensions/source/propctrlr/browserlistbox.cxx123
-rw-r--r--extensions/source/propctrlr/browserlistbox.hxx8
-rw-r--r--extensions/source/propctrlr/browserpage.cxx22
-rw-r--r--extensions/source/propctrlr/browserpage.hxx7
-rw-r--r--extensions/source/propctrlr/browserview.cxx13
-rw-r--r--extensions/source/propctrlr/browserview.hxx3
-rw-r--r--extensions/source/propctrlr/commoncontrol.cxx15
-rw-r--r--extensions/source/propctrlr/commoncontrol.hxx2
-rw-r--r--extensions/source/propctrlr/controlfontdialog.cxx7
-rw-r--r--extensions/source/propctrlr/controlfontdialog.hxx2
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx29
-rw-r--r--extensions/source/propctrlr/formlinkdialog.cxx41
-rw-r--r--extensions/source/propctrlr/formlinkdialog.hxx19
-rw-r--r--extensions/source/propctrlr/inspectorhelpwindow.cxx47
-rw-r--r--extensions/source/propctrlr/inspectorhelpwindow.hxx6
-rw-r--r--extensions/source/propctrlr/listselectiondlg.cxx11
-rw-r--r--extensions/source/propctrlr/listselectiondlg.hxx4
-rw-r--r--extensions/source/propctrlr/newdatatype.cxx11
-rw-r--r--extensions/source/propctrlr/newdatatype.hxx6
-rw-r--r--extensions/source/propctrlr/pcrunodialogs.cxx4
-rw-r--r--extensions/source/propctrlr/pcrunodialogs.hxx2
-rw-r--r--extensions/source/propctrlr/propcontroller.cxx5
-rw-r--r--extensions/source/propctrlr/propcontroller.hxx4
-rw-r--r--extensions/source/propctrlr/propertyeditor.cxx131
-rw-r--r--extensions/source/propctrlr/propertyeditor.hxx9
-rw-r--r--extensions/source/propctrlr/selectlabeldialog.cxx10
-rw-r--r--extensions/source/propctrlr/selectlabeldialog.hxx7
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx56
-rw-r--r--extensions/source/propctrlr/standardcontrol.hxx7
-rw-r--r--extensions/source/propctrlr/taborder.cxx12
-rw-r--r--extensions/source/propctrlr/taborder.hxx11
-rw-r--r--extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx10
36 files changed, 409 insertions, 290 deletions
diff --git a/extensions/source/propctrlr/MasterDetailLinkDialog.cxx b/extensions/source/propctrlr/MasterDetailLinkDialog.cxx
index 8f7f24b9d5cd..7803b2951f20 100644
--- a/extensions/source/propctrlr/MasterDetailLinkDialog.cxx
+++ b/extensions/source/propctrlr/MasterDetailLinkDialog.cxx
@@ -103,9 +103,9 @@ namespace pcr
}
- Dialog* MasterDetailLinkDialog::createDialog(vcl::Window* _pParent)
+ VclPtr<Dialog> MasterDetailLinkDialog::createDialog(vcl::Window* _pParent)
{
- return new FormLinkDialog(_pParent,m_xDetail,m_xMaster, m_aContext
+ return VclPtr<FormLinkDialog>::Create(_pParent,m_xDetail,m_xMaster, m_aContext
,m_sExplanation,m_sDetailLabel,m_sMasterLabel);
}
diff --git a/extensions/source/propctrlr/MasterDetailLinkDialog.hxx b/extensions/source/propctrlr/MasterDetailLinkDialog.hxx
index 28a6ddfa7875..a00f852028b2 100644
--- a/extensions/source/propctrlr/MasterDetailLinkDialog.hxx
+++ b/extensions/source/propctrlr/MasterDetailLinkDialog.hxx
@@ -60,7 +60,7 @@ namespace pcr
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
virtual void implInitialize(const com::sun::star::uno::Any& _rValue) SAL_OVERRIDE;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xDetail;
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index bd0b335f6af7..174c01eef667 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -55,7 +55,7 @@ namespace pcr
OBrowserLine::OBrowserLine( const OUString& _rEntryName, vcl::Window* pParent )
:m_sEntryName( _rEntryName )
- ,m_aFtTitle(pParent)
+ ,m_aFtTitle(VclPtr<FixedText>::Create(pParent))
,m_pControlWindow( NULL )
,m_pBrowseButton(NULL)
,m_pAdditionalBrowseButton( NULL )
@@ -66,7 +66,7 @@ namespace pcr
,m_bIndentTitle( false )
,m_bReadOnly( false )
{
- m_aFtTitle.Show();
+ m_aFtTitle->Show();
}
@@ -109,7 +109,7 @@ namespace pcr
void OBrowserLine::setControl( const Reference< XPropertyControl >& _rxControl )
{
m_xControl = _rxControl;
- m_pControlWindow = m_xControl.is() ? VCLUnoHelper::GetWindow( _rxControl->getControlWindow() ) : NULL;
+ m_pControlWindow = m_xControl.is() ? VCLUnoHelper::GetWindow( _rxControl->getControlWindow() ) : VclPtr<vcl::Window>();
DBG_ASSERT( m_pControlWindow, "OBrowserLine::setControl: setting NULL controls/windows is not allowed!" );
if ( m_pControlWindow )
@@ -123,7 +123,7 @@ namespace pcr
vcl::Window* OBrowserLine::GetRefWindow()
{
- vcl::Window* pRefWindow=&m_aFtTitle;
+ vcl::Window* pRefWindow = m_aFtTitle.get();
if(m_pBrowseButton)
{
@@ -139,9 +139,9 @@ namespace pcr
void OBrowserLine::SetTabOrder(vcl::Window* pRefWindow, sal_uInt16 nFlags )
{
- m_aFtTitle.SetZOrder(pRefWindow,nFlags);
+ m_aFtTitle->SetZOrder(pRefWindow,nFlags);
if ( m_pControlWindow )
- m_pControlWindow->SetZOrder( (vcl::Window*)&m_aFtTitle, WINDOW_ZORDER_BEHIND );
+ m_pControlWindow->SetZOrder( m_aFtTitle.get(), WINDOW_ZORDER_BEHIND );
if ( m_pBrowseButton && m_pControlWindow )
m_pBrowseButton->SetZOrder( m_pControlWindow, WINDOW_ZORDER_BEHIND );
@@ -185,7 +185,7 @@ namespace pcr
void OBrowserLine::Show(bool bFlag)
{
- m_aFtTitle.Show(bFlag);
+ m_aFtTitle->Show(bFlag);
if ( m_pControlWindow )
m_pControlWindow->Show( bFlag );
if ( m_pBrowseButton )
@@ -203,7 +203,7 @@ namespace pcr
bool OBrowserLine::IsVisible()
{
- return m_aFtTitle.IsVisible();
+ return m_aFtTitle->IsVisible();
}
@@ -219,7 +219,7 @@ namespace pcr
aTitlePos.X() += aIndent.Width();
aTitleSize.Width() -= aIndent.Width();
}
- m_aFtTitle.SetPosSizePixel( aTitlePos, aTitleSize );
+ m_aFtTitle->SetPosSizePixel( aTitlePos, aTitleSize );
}
sal_Int32 nBrowseButtonSize = m_aOutputSize.Height() - 4;
@@ -255,7 +255,7 @@ namespace pcr
if ( GetTitle() == _rNewTtile )
return;
// #99102# --------------
- m_aFtTitle.SetText( _rNewTtile );
+ m_aFtTitle->SetText( _rNewTtile );
if ( m_pControlWindow )
m_pControlWindow->SetAccessibleName( _rNewTtile );
if ( m_pBrowseButton )
@@ -268,7 +268,7 @@ namespace pcr
{
if( m_pTheParent )
{
- OUStringBuffer aText( m_aFtTitle.GetText() );
+ OUStringBuffer aText( m_aFtTitle->GetText() );
while( m_pTheParent->GetTextWidth( aText.toString() ) < m_nNameWidth )
aText.append("...........");
@@ -280,14 +280,14 @@ namespace pcr
aText.append( OUString(cRTL_mark) );
}
- m_aFtTitle.SetText( aText.makeStringAndClear() );
+ m_aFtTitle->SetText( aText.makeStringAndClear() );
}
}
OUString OBrowserLine::GetTitle() const
{
- OUString sDisplayName = m_aFtTitle.GetText();
+ OUString sDisplayName = m_aFtTitle->GetText();
// for Issue 69452
if (AllSettings::GetLayoutRTL())
@@ -341,7 +341,7 @@ namespace pcr
void OBrowserLine::implUpdateEnabledDisabled()
{
- implEnable( &m_aFtTitle, m_nEnableFlags, PropertyLineElement::CompleteLine );
+ implEnable( m_aFtTitle.get(), m_nEnableFlags, PropertyLineElement::CompleteLine );
if ( m_pControlWindow )
implEnable( m_pControlWindow, m_nEnableFlags, PropertyLineElement::CompleteLine | PropertyLineElement::InputControl );
@@ -376,11 +376,11 @@ namespace pcr
PushButton& OBrowserLine::impl_ensureButton( bool _bPrimary )
{
- PushButton*& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton;
+ VclPtr<PushButton>& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton;
if ( !rpButton )
{
- rpButton = new PushButton( m_pTheParent, WB_NOPOINTERFOCUS );
+ rpButton = VclPtr<PushButton>::Create( m_pTheParent, WB_NOPOINTERFOCUS );
rpButton->SetGetFocusHdl( LINK( this, OBrowserLine, OnButtonFocus ) );
rpButton->SetClickHdl( LINK( this, OBrowserLine, OnButtonClicked ) );
rpButton->SetText(OUString("..."));
@@ -443,13 +443,12 @@ namespace pcr
void OBrowserLine::implHideBrowseButton( bool _bPrimary, bool _bReLayout )
{
- PushButton*& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton;
+ VclPtr<PushButton>& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton;
if ( rpButton )
{
rpButton->Hide();
- delete rpButton;
- rpButton = NULL;
+ rpButton.disposeAndClear();
}
if ( _bReLayout )
diff --git a/extensions/source/propctrlr/browserline.hxx b/extensions/source/propctrlr/browserline.hxx
index 1fa64a89a47c..9f39ec6277f3 100644
--- a/extensions/source/propctrlr/browserline.hxx
+++ b/extensions/source/propctrlr/browserline.hxx
@@ -50,17 +50,17 @@ namespace pcr
class OBrowserLine
{
private:
- OUString m_sEntryName;
- FixedText m_aFtTitle;
+ OUString m_sEntryName;
+ VclPtr<FixedText> m_aFtTitle;
Size m_aOutputSize;
Point m_aLinePos;
::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >
m_xControl;
- vcl::Window* m_pControlWindow;
- PushButton* m_pBrowseButton;
- PushButton* m_pAdditionalBrowseButton;
+ VclPtr<vcl::Window> m_pControlWindow;
+ VclPtr<PushButton> m_pBrowseButton;
+ VclPtr<PushButton> m_pAdditionalBrowseButton;
IButtonClickListener* m_pClickListener;
- vcl::Window* m_pTheParent;
+ VclPtr<vcl::Window> m_pTheParent;
sal_uInt16 m_nNameWidth;
sal_uInt16 m_nEnableFlags;
bool m_bIndentTitle;
diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
index f31fd5de1a82..13b2df89e334 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -345,9 +345,9 @@ namespace pcr
OBrowserListBox::OBrowserListBox( vcl::Window* pParent, WinBits nWinStyle)
:Control(pParent, nWinStyle| WB_CLIPCHILDREN)
- ,m_aLinesPlayground(this,WB_DIALOGCONTROL | WB_CLIPCHILDREN)
- ,m_aVScroll(this,WB_VSCROLL|WB_REPEAT|WB_DRAG)
- ,m_pHelpWindow( new InspectorHelpWindow( this ) )
+ ,m_aLinesPlayground(VclPtr<vcl::Window>::Create(this,WB_DIALOGCONTROL | WB_CLIPCHILDREN))
+ ,m_aVScroll(VclPtr<ScrollBar>::Create(this,WB_VSCROLL|WB_REPEAT|WB_DRAG))
+ ,m_pHelpWindow( VclPtr<InspectorHelpWindow>::Create( this ) )
,m_pLineListener(NULL)
,m_pControlObserver( NULL )
,m_nYOffset(0)
@@ -357,23 +357,27 @@ namespace pcr
,m_bUpdate(true)
,m_pControlContextImpl( new PropertyControlContext_Impl( *this ) )
{
-
- ListBox aListBox(this,WB_DROPDOWN);
- aListBox.SetPosSizePixel(Point(0,0),Size(100,100));
- m_nRowHeight = aListBox.GetSizePixel().Height()+2;
+ ScopedVclPtrInstance< ListBox > aListBox(this,WB_DROPDOWN);
+ aListBox->SetPosSizePixel(Point(0,0),Size(100,100));
+ m_nRowHeight = aListBox->GetSizePixel().Height()+2;
SetBackground( pParent->GetBackground() );
- m_aLinesPlayground.SetBackground( GetBackground() );
+ m_aLinesPlayground->SetBackground( GetBackground() );
- m_aLinesPlayground.SetPosPixel(Point(0,0));
- m_aLinesPlayground.SetPaintTransparent(true);
- m_aLinesPlayground.Show();
- m_aVScroll.Hide();
- m_aVScroll.SetScrollHdl(LINK(this, OBrowserListBox, ScrollHdl));
+ m_aLinesPlayground->SetPosPixel(Point(0,0));
+ m_aLinesPlayground->SetPaintTransparent(true);
+ m_aLinesPlayground->Show();
+ m_aVScroll->Hide();
+ m_aVScroll->SetScrollHdl(LINK(this, OBrowserListBox, ScrollHdl));
}
OBrowserListBox::~OBrowserListBox()
{
+ disposeOnce();
+ }
+
+ void OBrowserListBox::dispose()
+ {
OSL_ENSURE( !IsModified(), "OBrowserListBox::~OBrowserListBox: still modified - should have been committed before!" );
// doing the commit here, while we, as well as our owner, as well as some other components,
// are already "half dead" (means within their dtor) is potentially dangerous.
@@ -384,7 +388,10 @@ namespace pcr
Hide();
Clear();
-
+ m_aLinesPlayground.disposeAndClear();
+ m_aVScroll.disposeAndClear();
+ m_pHelpWindow.disposeAndClear();
+ Control::dispose();
}
@@ -425,7 +432,7 @@ namespace pcr
if (m_bIsActive)
{
// TODO: what's the sense of this?
- m_aVScroll.SetThumbPos(100);
+ m_aVScroll->SetThumbPos(100);
MoveThumbTo(0);
Resize();
}
@@ -452,31 +459,31 @@ namespace pcr
aLinesArea.Bottom() -= nHelpWindowHeight;
aLinesArea.Bottom() -= aHelpWindowDistance.Height();
}
- m_aLinesPlayground.SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() );
+ m_aLinesPlayground->SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() );
UpdateVScroll();
bool bNeedScrollbar = m_aLines.size() > (sal_uInt32)CalcVisibleLines();
if ( !bNeedScrollbar )
{
- if ( m_aVScroll.IsVisible() )
- m_aVScroll.Hide();
+ if ( m_aVScroll->IsVisible() )
+ m_aVScroll->Hide();
// scroll to top
m_nYOffset = 0;
- m_aVScroll.SetThumbPos( 0 );
+ m_aVScroll->SetThumbPos( 0 );
}
else
{
- Size aVScrollSize( m_aVScroll.GetSizePixel() );
+ Size aVScrollSize( m_aVScroll->GetSizePixel() );
// adjust the playground's width
aLinesArea.Right() -= aVScrollSize.Width();
- m_aLinesPlayground.SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() );
+ m_aLinesPlayground->SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() );
// position the scrollbar
aVScrollSize.Height() = aLinesArea.GetHeight();
Point aVScrollPos( aLinesArea.GetWidth(), 0 );
- m_aVScroll.SetPosSizePixel( aVScrollPos, aVScrollSize );
+ m_aVScroll->SetPosSizePixel( aVScrollPos, aVScrollSize );
}
for ( sal_uInt16 i = 0; i < m_aLines.size(); ++i )
@@ -489,7 +496,7 @@ namespace pcr
// show the scrollbar
if ( bNeedScrollbar )
- m_aVScroll.Show();
+ m_aVScroll->Show();
// position the help window
if ( bPositionHelpWindow )
@@ -543,7 +550,7 @@ namespace pcr
sal_uInt16 OBrowserListBox::CalcVisibleLines()
{
- Size aSize(m_aLinesPlayground.GetOutputSizePixel());
+ Size aSize(m_aLinesPlayground->GetOutputSizePixel());
sal_uInt16 nResult = 0;
if (0 != m_nRowHeight)
nResult = (sal_uInt16) aSize.Height()/m_nRowHeight;
@@ -555,18 +562,18 @@ namespace pcr
void OBrowserListBox::UpdateVScroll()
{
sal_uInt16 nLines = CalcVisibleLines();
- m_aVScroll.SetPageSize(nLines-1);
- m_aVScroll.SetVisibleSize(nLines-1);
+ m_aVScroll->SetPageSize(nLines-1);
+ m_aVScroll->SetVisibleSize(nLines-1);
size_t nCount = m_aLines.size();
if (nCount>0)
{
- m_aVScroll.SetRange(Range(0,nCount-1));
- m_nYOffset = -m_aVScroll.GetThumbPos()*m_nRowHeight;
+ m_aVScroll->SetRange(Range(0,nCount-1));
+ m_nYOffset = -m_aVScroll->GetThumbPos()*m_nRowHeight;
}
else
{
- m_aVScroll.SetRange(Range(0,0));
+ m_aVScroll->SetRange(Range(0,0));
m_nYOffset = 0;
}
}
@@ -574,7 +581,7 @@ namespace pcr
void OBrowserListBox::PositionLine( sal_uInt16 _nIndex )
{
- Size aSize(m_aLinesPlayground.GetOutputSizePixel());
+ Size aSize(m_aLinesPlayground->GetOutputSizePixel());
Point aPos(0, m_nYOffset);
aSize.Height() = m_nRowHeight;
@@ -612,7 +619,7 @@ namespace pcr
void OBrowserListBox::UpdatePlayGround()
{
- sal_Int32 nThumbPos = m_aVScroll.GetThumbPos();
+ sal_Int32 nThumbPos = m_aVScroll->GetThumbPos();
sal_Int32 nLines = CalcVisibleLines();
sal_uInt16 nEnd = (sal_uInt16)(nThumbPos + nLines);
@@ -729,7 +736,7 @@ namespace pcr
sal_uInt16 OBrowserListBox::InsertEntry(const OLineDescriptor& _rPropertyData, sal_uInt16 _nPos)
{
// create a new line
- BrowserLinePointer pBrowserLine( new OBrowserLine( _rPropertyData.sName, &m_aLinesPlayground ) );
+ BrowserLinePointer pBrowserLine( new OBrowserLine( _rPropertyData.sName, m_aLinesPlayground.get() ) );
// check that the name is unique
ListBoxLines::iterator it = m_aLines.begin();
@@ -794,7 +801,7 @@ namespace pcr
{
if ( _nPos < m_aLines.size() )
{
- sal_Int32 nThumbPos = m_aVScroll.GetThumbPos();
+ sal_Int32 nThumbPos = m_aVScroll->GetThumbPos();
if (_nPos < nThumbPos)
MoveThumbTo(_nPos);
@@ -812,19 +819,19 @@ namespace pcr
void OBrowserListBox::MoveThumbTo(sal_Int32 _nNewThumbPos)
{
// disable painting to prevent flicker
- m_aLinesPlayground.EnablePaint(false);
+ m_aLinesPlayground->EnablePaint(false);
- sal_Int32 nDelta = _nNewThumbPos - m_aVScroll.GetThumbPos();
+ sal_Int32 nDelta = _nNewThumbPos - m_aVScroll->GetThumbPos();
// adjust the scrollbar
- m_aVScroll.SetThumbPos(_nNewThumbPos);
+ m_aVScroll->SetThumbPos(_nNewThumbPos);
sal_Int32 nThumbPos = _nNewThumbPos;
- m_nYOffset = -m_aVScroll.GetThumbPos() * m_nRowHeight;
+ m_nYOffset = -m_aVScroll->GetThumbPos() * m_nRowHeight;
sal_Int32 nLines = CalcVisibleLines();
sal_uInt16 nEnd = (sal_uInt16)(nThumbPos + nLines);
- m_aLinesPlayground.Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN);
+ m_aLinesPlayground->Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN);
if (1 == nDelta)
{
@@ -841,27 +848,27 @@ namespace pcr
UpdatePlayGround();
}
- m_aLinesPlayground.EnablePaint(true);
- m_aLinesPlayground.Invalidate(INVALIDATE_CHILDREN);
+ m_aLinesPlayground->EnablePaint(true);
+ m_aLinesPlayground->Invalidate(INVALIDATE_CHILDREN);
}
IMPL_LINK(OBrowserListBox, ScrollHdl, ScrollBar*, _pScrollBar )
{
- DBG_ASSERT(_pScrollBar == &m_aVScroll, "OBrowserListBox::ScrollHdl: where does this come from?");
+ DBG_ASSERT(_pScrollBar == m_aVScroll.get(), "OBrowserListBox::ScrollHdl: where does this come from?");
(void)_pScrollBar;
// disable painting to prevent flicker
- m_aLinesPlayground.EnablePaint(false);
+ m_aLinesPlayground->EnablePaint(false);
- sal_Int32 nThumbPos = m_aVScroll.GetThumbPos();
+ sal_Int32 nThumbPos = m_aVScroll->GetThumbPos();
- sal_Int32 nDelta = m_aVScroll.GetDelta();
+ sal_Int32 nDelta = m_aVScroll->GetDelta();
m_nYOffset = -nThumbPos * m_nRowHeight;
sal_uInt16 nEnd = (sal_uInt16)(nThumbPos + CalcVisibleLines());
- m_aLinesPlayground.Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN);
+ m_aLinesPlayground->Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN);
if (1 == nDelta)
{
@@ -872,12 +879,12 @@ namespace pcr
{
PositionLine((sal_uInt16)nThumbPos);
}
- else if (nDelta!=0 || m_aVScroll.GetType() == SCROLL_DONTKNOW)
+ else if (nDelta!=0 || m_aVScroll->GetType() == SCROLL_DONTKNOW)
{
UpdatePlayGround();
}
- m_aLinesPlayground.EnablePaint(true);
+ m_aLinesPlayground->EnablePaint(true);
return 0;
}
@@ -1129,7 +1136,7 @@ namespace pcr
rLine.pLine->SetTitle(_rPropertyData.DisplayName);
rLine.xHandler = _rPropertyData.xPropertyHandler;
- sal_uInt16 nTextWidth = (sal_uInt16)m_aLinesPlayground.GetTextWidth(_rPropertyData.DisplayName);
+ sal_uInt16 nTextWidth = (sal_uInt16)m_aLinesPlayground->GetTextWidth(_rPropertyData.DisplayName);
if (m_nTheNameSize< nTextWidth)
m_nTheNameSize = nTextWidth;
@@ -1216,21 +1223,21 @@ namespace pcr
break;
long nScrollOffset = 0;
- if ( m_aVScroll.IsVisible() )
+ if ( m_aVScroll->IsVisible() )
{
if ( pKeyEvent->GetKeyCode().GetCode() == KEY_PAGEUP )
- nScrollOffset = -m_aVScroll.GetPageSize();
+ nScrollOffset = -m_aVScroll->GetPageSize();
else if ( pKeyEvent->GetKeyCode().GetCode() == KEY_PAGEDOWN )
- nScrollOffset = m_aVScroll.GetPageSize();
+ nScrollOffset = m_aVScroll->GetPageSize();
}
if ( nScrollOffset )
{
- long nNewThumbPos = m_aVScroll.GetThumbPos() + nScrollOffset;
- nNewThumbPos = ::std::max( nNewThumbPos, m_aVScroll.GetRangeMin() );
- nNewThumbPos = ::std::min( nNewThumbPos, m_aVScroll.GetRangeMax() );
- m_aVScroll.DoScroll( nNewThumbPos );
- nNewThumbPos = m_aVScroll.GetThumbPos();
+ long nNewThumbPos = m_aVScroll->GetThumbPos() + nScrollOffset;
+ nNewThumbPos = ::std::max( nNewThumbPos, m_aVScroll->GetRangeMin() );
+ nNewThumbPos = ::std::min( nNewThumbPos, m_aVScroll->GetRangeMax() );
+ m_aVScroll->DoScroll( nNewThumbPos );
+ nNewThumbPos = m_aVScroll->GetThumbPos();
sal_uInt16 nFocusControlPos = 0;
sal_uInt16 nActiveControlPos = impl_getControlPos( m_xActiveControl );
@@ -1271,9 +1278,9 @@ namespace pcr
)
{
// interested in scroll events if we have a scrollbar
- if ( m_aVScroll.IsVisible() )
+ if ( m_aVScroll->IsVisible() )
{
- HandleScrollCommand( *pCommand, NULL, &m_aVScroll );
+ HandleScrollCommand( *pCommand, NULL, m_aVScroll.get() );
}
}
}
diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx
index 3b50d467c943..f8b3c754839f 100644
--- a/extensions/source/propctrlr/browserlistbox.hxx
+++ b/extensions/source/propctrlr/browserlistbox.hxx
@@ -93,10 +93,9 @@ namespace pcr
,public PcrClient
{
protected:
- Window m_aLinesPlayground;
- ScrollBar m_aVScroll;
- ::std::unique_ptr< InspectorHelpWindow >
- m_pHelpWindow;
+ VclPtr<Window> m_aLinesPlayground;
+ VclPtr<ScrollBar> m_aVScroll;
+ VclPtr<InspectorHelpWindow> m_pHelpWindow;
ListBoxLines m_aLines;
IPropertyLineListener* m_pLineListener;
IPropertyControlObserver* m_pControlObserver;
@@ -125,6 +124,7 @@ namespace pcr
OBrowserListBox( vcl::Window* pParent, WinBits nWinStyle = WB_DIALOGCONTROL );
virtual ~OBrowserListBox();
+ virtual void dispose() SAL_OVERRIDE;
void UpdateAll();
diff --git a/extensions/source/propctrlr/browserpage.cxx b/extensions/source/propctrlr/browserpage.cxx
index 2e733a9ed727..dfb0236317fd 100644
--- a/extensions/source/propctrlr/browserpage.cxx
+++ b/extensions/source/propctrlr/browserpage.cxx
@@ -35,25 +35,31 @@ namespace pcr
OBrowserPage::OBrowserPage(vcl::Window* pParent,WinBits nWinStyle)
:TabPage(pParent,nWinStyle)
- ,m_aListBox(this)
+ ,m_aListBox(VclPtr<OBrowserListBox>::Create(this))
{
- m_aListBox.SetBackground(GetBackground());
- m_aListBox.SetPaintTransparent( true );
- m_aListBox.Show();
+ m_aListBox->SetBackground(GetBackground());
+ m_aListBox->SetPaintTransparent( true );
+ m_aListBox->Show();
}
OBrowserPage::~OBrowserPage()
{
+ disposeOnce();
}
+ void OBrowserPage::dispose()
+ {
+ m_aListBox.disposeAndClear();
+ TabPage::dispose();
+ }
void OBrowserPage::Resize()
{
Size aSize( GetOutputSizePixel() );
aSize.Width() -= LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT;
aSize.Height() -= LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM;
- m_aListBox.SetPosSizePixel( Point( LAYOUT_BORDER_LEFT, LAYOUT_BORDER_TOP ), aSize );
+ m_aListBox->SetPosSizePixel( Point( LAYOUT_BORDER_LEFT, LAYOUT_BORDER_TOP ), aSize );
}
@@ -65,19 +71,19 @@ namespace pcr
{
Window::StateChanged( nType);
if (StateChangedType::VISIBLE == nType)
- m_aListBox.ActivateListBox(IsVisible());
+ m_aListBox->ActivateListBox(IsVisible());
}
sal_Int32 OBrowserPage::getMinimumWidth()
{
- return m_aListBox.GetMinimumWidth() + LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT;
+ return m_aListBox->GetMinimumWidth() + LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT;
}
sal_Int32 OBrowserPage::getMinimumHeight()
{
- return m_aListBox.GetMinimumHeight() + LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM;
+ return m_aListBox->GetMinimumHeight() + LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM;
}
diff --git a/extensions/source/propctrlr/browserpage.hxx b/extensions/source/propctrlr/browserpage.hxx
index 6ef6ef80bce9..8ce0b50cd8fe 100644
--- a/extensions/source/propctrlr/browserpage.hxx
+++ b/extensions/source/propctrlr/browserpage.hxx
@@ -34,7 +34,7 @@ namespace pcr
class OBrowserPage : public TabPage
{
private:
- OBrowserListBox m_aListBox;
+ VclPtr<OBrowserListBox> m_aListBox;
protected:
virtual void Resize() SAL_OVERRIDE;
@@ -43,12 +43,13 @@ namespace pcr
public:
OBrowserPage(vcl::Window* pParent, WinBits nWinStyle = 0);
virtual ~OBrowserPage();
+ virtual void dispose() SAL_OVERRIDE;
sal_Int32 getMinimumWidth();
sal_Int32 getMinimumHeight();
- OBrowserListBox& getListBox() { return m_aListBox; }
- const OBrowserListBox& getListBox() const { return m_aListBox; }
+ OBrowserListBox& getListBox() { return *m_aListBox.get(); }
+ const OBrowserListBox& getListBox() const { return *m_aListBox.get(); }
};
diff --git a/extensions/source/propctrlr/browserview.cxx b/extensions/source/propctrlr/browserview.cxx
index 4179cbe8e3ed..ab512b46eccc 100644
--- a/extensions/source/propctrlr/browserview.cxx
+++ b/extensions/source/propctrlr/browserview.cxx
@@ -21,6 +21,7 @@
#include "propertyeditor.hxx"
#include "propctrlr.hrc"
#include <boost/scoped_ptr.hpp>
+#include <vcl/tabpage.hxx>
namespace pcr
{
@@ -34,7 +35,7 @@ namespace pcr
:Window(_pParent, nBits | WB_3DLOOK)
,m_nActivePage(0)
{
- m_pPropBox = new OPropertyEditor( this );
+ m_pPropBox = VclPtr<OPropertyEditor>::Create( this );
m_pPropBox->SetHelpId(HID_FM_PROPDLG_TABCTR);
m_pPropBox->setPageActivationHandler(LINK(this, OPropertyBrowserView, OnPageActivation));
@@ -53,15 +54,19 @@ namespace pcr
OPropertyBrowserView::~OPropertyBrowserView()
{
+ disposeOnce();
+ }
+
+ void OPropertyBrowserView::dispose()
+ {
if(m_pPropBox)
{
sal_uInt16 nTmpPage = m_pPropBox->GetCurPage();
if (nTmpPage)
m_nActivePage = nTmpPage;
- boost::scoped_ptr<vcl::Window> aTemp(m_pPropBox);
- m_pPropBox = NULL;
}
-
+ m_pPropBox.disposeAndClear();
+ vcl::Window::dispose();
}
diff --git a/extensions/source/propctrlr/browserview.hxx b/extensions/source/propctrlr/browserview.hxx
index c87dd55b3c0a..9ae97d364295 100644
--- a/extensions/source/propctrlr/browserview.hxx
+++ b/extensions/source/propctrlr/browserview.hxx
@@ -37,7 +37,7 @@ namespace pcr
class OPropertyBrowserView : public vcl::Window
{
- OPropertyEditor* m_pPropBox;
+ VclPtr<OPropertyEditor> m_pPropBox;
sal_uInt16 m_nActivePage;
Link m_aPageActivationHandler;
@@ -50,6 +50,7 @@ namespace pcr
OPropertyBrowserView( vcl::Window* pParent, WinBits nBits = 0);
virtual ~OPropertyBrowserView();
+ virtual void dispose() SAL_OVERRIDE;
OPropertyEditor& getPropertyBox() { return *m_pPropBox; }
diff --git a/extensions/source/propctrlr/commoncontrol.cxx b/extensions/source/propctrlr/commoncontrol.cxx
index ac33ace00daa..e337ccf7a0dc 100644
--- a/extensions/source/propctrlr/commoncontrol.cxx
+++ b/extensions/source/propctrlr/commoncontrol.cxx
@@ -47,7 +47,7 @@ namespace pcr
,m_pModifyListener( _pModifyListener )
,m_bModified( false )
{
- DBG_ASSERT( m_pControlWindow != NULL, "ControlHelper::ControlHelper: invalid window!" );
+ DBG_ASSERT( m_pControlWindow != nullptr, "ControlHelper::ControlHelper: invalid window!" );
}
@@ -55,11 +55,6 @@ namespace pcr
{
}
-
-
-
-
-
void SAL_CALL ControlHelper::setControlContext( const Reference< XPropertyControlContext >& _controlcontext ) throw (RuntimeException)
{
m_xContext = _controlcontext;
@@ -93,7 +88,7 @@ namespace pcr
void SAL_CALL ControlHelper::dispose()
{
- DELETEZ( m_pControlWindow );
+ m_pControlWindow.disposeAndClear();
}
@@ -103,9 +98,9 @@ namespace pcr
if ( !m_pControlWindow )
return;
- ComboBox aComboBox(m_pControlWindow, WB_DROPDOWN);
- aComboBox.SetPosSizePixel(Point(0,0), Size(100,100));
- m_pControlWindow->SetSizePixel(aComboBox.GetSizePixel());
+ ScopedVclPtrInstance< ComboBox > aComboBox(m_pControlWindow, WB_DROPDOWN);
+ aComboBox->SetPosSizePixel(Point(0,0), Size(100,100));
+ m_pControlWindow->SetSizePixel(aComboBox->GetSizePixel());
// TODO/UNOize: why do the controls this themselves? Shouldn't this be the task
// of the browser listbox/line?
diff --git a/extensions/source/propctrlr/commoncontrol.hxx b/extensions/source/propctrlr/commoncontrol.hxx
index 629660eda8d7..cbe825f32156 100644
--- a/extensions/source/propctrlr/commoncontrol.hxx
+++ b/extensions/source/propctrlr/commoncontrol.hxx
@@ -86,7 +86,7 @@ namespace pcr
class ControlHelper
{
private:
- vcl::Window* m_pControlWindow;
+ VclPtr<vcl::Window> m_pControlWindow;
sal_Int16 m_nControlType;
::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlContext >
m_xContext;
diff --git a/extensions/source/propctrlr/controlfontdialog.cxx b/extensions/source/propctrlr/controlfontdialog.cxx
index 675f2aa74739..54ae2733d633 100644
--- a/extensions/source/propctrlr/controlfontdialog.cxx
+++ b/extensions/source/propctrlr/controlfontdialog.cxx
@@ -141,7 +141,7 @@ namespace pcr
}
- Dialog* OControlFontDialog::createDialog(vcl::Window* _pParent)
+ VclPtr<Dialog> OControlFontDialog::createDialog(vcl::Window* _pParent)
{
ControlCharacterDialog::createItemSet(m_pFontItems, m_pItemPool, m_pItemPoolDefaults);
@@ -152,8 +152,7 @@ namespace pcr
// sets a new introspectee and re-executes us. In this case, the dialog returned here (upon the first
// execute) will be re-used upon the second execute, and thus it won't be initialized correctly.
- ControlCharacterDialog* pDialog = new ControlCharacterDialog(_pParent, *m_pFontItems);
- return pDialog;
+ return VclPtr<ControlCharacterDialog>::Create(_pParent, *m_pFontItems);
}
@@ -169,7 +168,7 @@ namespace pcr
OSL_ENSURE(m_pDialog, "OControlFontDialog::executedDialog: no dialog anymore?!!");
if (m_pDialog && (RET_OK == _nExecutionResult) && m_xControlModel.is())
{
- const SfxItemSet* pOutput = static_cast<ControlCharacterDialog*>(m_pDialog)->GetOutputItemSet();
+ const SfxItemSet* pOutput = static_cast<ControlCharacterDialog*>(m_pDialog.get())->GetOutputItemSet();
if (pOutput)
ControlCharacterDialog::translateItemsToProperties( *pOutput, m_xControlModel );
}
diff --git a/extensions/source/propctrlr/controlfontdialog.hxx b/extensions/source/propctrlr/controlfontdialog.hxx
index 3df0b46fcdc5..e9d30f4c67d0 100644
--- a/extensions/source/propctrlr/controlfontdialog.hxx
+++ b/extensions/source/propctrlr/controlfontdialog.hxx
@@ -82,7 +82,7 @@ namespace pcr
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
virtual void destroyDialog() SAL_OVERRIDE;
virtual void executedDialog(sal_Int16 _nExecutionResult) SAL_OVERRIDE;
};
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index e45398145741..a13fd939a3dc 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2608,9 +2608,9 @@ namespace pcr
OSL_PRECOND( m_pInfoService.get(), "FormComponentPropertyHandler::impl_dialogListSelection_nothrow: no property meta data!" );
OUString sPropertyUIName( m_pInfoService->getPropertyTranslation( m_pInfoService->getPropertyId( _rProperty ) ) );
- ListSelectionDialog aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, _rProperty, sPropertyUIName );
+ ScopedVclPtrInstance< ListSelectionDialog > aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, _rProperty, sPropertyUIName );
_rClearBeforeDialog.clear();
- return ( RET_OK == aDialog.Execute() );
+ return ( RET_OK == aDialog->Execute() );
}
@@ -2685,9 +2685,9 @@ namespace pcr
return false;
- FormLinkDialog aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, xMasterProp, m_xContext );
+ ScopedVclPtrInstance< FormLinkDialog > aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, xMasterProp, m_xContext );
_rClearBeforeDialog.clear();
- return ( RET_OK == aDialog.Execute() );
+ return ( RET_OK == aDialog->Execute() );
}
@@ -2722,9 +2722,8 @@ namespace pcr
aCoreSet.Put( aFormatter );
// a tab dialog with a single page
- boost::scoped_ptr< SfxSingleTabDialog > xDialog(new SfxSingleTabDialog(
- impl_getDefaultDialogParent_nothrow(), aCoreSet,
- "FormatNumberDialog", "cui/ui/formatnumberdialog.ui"));
+ ScopedVclPtrInstance< SfxSingleTabDialog > xDialog( impl_getDefaultDialogParent_nothrow(), aCoreSet,
+ "FormatNumberDialog", "cui/ui/formatnumberdialog.ui");
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT( pFact, "CreateFactory fail!" );
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT );
@@ -2871,11 +2870,11 @@ namespace pcr
{ // do this in an own block. The dialog needs to be destroyed before we call
// destroyItemSet
- ControlCharacterDialog aDlg( impl_getDefaultDialogParent_nothrow(), *pSet );
+ ScopedVclPtrInstance< ControlCharacterDialog > aDlg( impl_getDefaultDialogParent_nothrow(), *pSet );
_rClearBeforeDialog.clear();
- if ( RET_OK == aDlg.Execute() )
+ if ( RET_OK == aDlg->Execute() )
{
- const SfxItemSet* pOut = aDlg.GetOutputItemSet();
+ const SfxItemSet* pOut = aDlg->GetOutputItemSet();
if ( pOut )
{
Sequence< NamedValue > aFontPropertyValues;
@@ -2942,11 +2941,11 @@ namespace pcr
bool FormComponentPropertyHandler::impl_dialogChooseLabelControl_nothrow( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
{
- OSelectLabelDialog dlgSelectLabel( impl_getDefaultDialogParent_nothrow(), m_xComponent );
+ ScopedVclPtrInstance< OSelectLabelDialog > dlgSelectLabel( impl_getDefaultDialogParent_nothrow(), m_xComponent );
_rClearBeforeDialog.clear();
- bool bSuccess = ( RET_OK == dlgSelectLabel.Execute() );
+ bool bSuccess = ( RET_OK == dlgSelectLabel->Execute() );
if ( bSuccess )
- _out_rNewValue <<= dlgSelectLabel.GetSelected();
+ _out_rNewValue <<= dlgSelectLabel->GetSelected();
return bSuccess;
}
@@ -2965,14 +2964,14 @@ namespace pcr
OSL_PRECOND( impl_getContextControlContainer_nothrow().is(), "FormComponentPropertyHandler::impl_dialogChangeTabOrder_nothrow: invalid control context!" );
Reference< XTabControllerModel > xTabControllerModel( impl_getRowSet_nothrow(), UNO_QUERY );
- TabOrderDialog aDialog(
+ ScopedVclPtrInstance<TabOrderDialog> aDialog(
impl_getDefaultDialogParent_nothrow(),
xTabControllerModel,
impl_getContextControlContainer_nothrow(),
m_xContext
);
_rClearBeforeDialog.clear();
- return ( RET_OK == aDialog.Execute() );
+ return ( RET_OK == aDialog->Execute() );
}
diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx
index 3a7d97003c6d..3689a775c961 100644
--- a/extensions/source/propctrlr/formlinkdialog.cxx
+++ b/extensions/source/propctrlr/formlinkdialog.cxx
@@ -65,13 +65,15 @@ namespace pcr
class FieldLinkRow : public TabPage
{
private:
- ComboBox* m_pDetailColumn;
- ComboBox* m_pMasterColumn;
+ VclPtr<ComboBox> m_pDetailColumn;
+ VclPtr<ComboBox> m_pMasterColumn;
Link m_aLinkChangeHandler;
public:
FieldLinkRow( vcl::Window* _pParent );
+ virtual ~FieldLinkRow();
+ virtual void dispose() SAL_OVERRIDE;
inline void SetLinkChangeHandler( const Link& _rHdl ) { m_aLinkChangeHandler = _rHdl; }
@@ -106,6 +108,17 @@ namespace pcr
m_pMasterColumn->SetModifyHdl( LINK( this, FieldLinkRow, OnFieldNameChanged ) );
}
+ FieldLinkRow::~FieldLinkRow()
+ {
+ disposeOnce();
+ }
+
+ void FieldLinkRow::dispose()
+ {
+ m_pDetailColumn.clear();
+ m_pMasterColumn.clear();
+ TabPage::dispose();
+ }
void FieldLinkRow::fillList( LinkParticipant _eWhich, const Sequence< OUString >& _rFieldNames )
{
@@ -156,10 +169,10 @@ namespace pcr
const OUString& _sDetailLabel,
const OUString& _sMasterLabel)
:ModalDialog( _pParent, "FormLinks", "modules/spropctrlr/ui/formlinksdialog.ui" )
- ,m_aRow1 ( new FieldLinkRow( get<VclVBox>("box") ) )
- ,m_aRow2 ( new FieldLinkRow( get<VclVBox>("box") ) )
- ,m_aRow3 ( new FieldLinkRow( get<VclVBox>("box") ) )
- ,m_aRow4 ( new FieldLinkRow( get<VclVBox>("box") ) )
+ ,m_aRow1 ( VclPtr<FieldLinkRow>::Create( get<VclVBox>("box") ) )
+ ,m_aRow2 ( VclPtr<FieldLinkRow>::Create( get<VclVBox>("box") ) )
+ ,m_aRow3 ( VclPtr<FieldLinkRow>::Create( get<VclVBox>("box") ) )
+ ,m_aRow4 ( VclPtr<FieldLinkRow>::Create( get<VclVBox>("box") ) )
,m_xContext ( _rxContext )
,m_xDetailForm( _rxDetailForm )
,m_xMasterForm( _rxMasterForm )
@@ -194,8 +207,24 @@ namespace pcr
FormLinkDialog::~FormLinkDialog( )
{
+ disposeOnce();
}
+ void FormLinkDialog::dispose( )
+ {
+ m_pExplanation.clear();
+ m_pDetailLabel.clear();
+ m_pMasterLabel.clear();
+ m_pOK.clear();
+ m_pSuggest.clear();
+
+ m_aRow1.disposeAndClear();
+ m_aRow2.disposeAndClear();
+ m_aRow3.disposeAndClear();
+ m_aRow4.disposeAndClear();
+
+ ModalDialog::dispose();
+ }
void FormLinkDialog::commitLinkPairs()
{
diff --git a/extensions/source/propctrlr/formlinkdialog.hxx b/extensions/source/propctrlr/formlinkdialog.hxx
index 6dd94e915dd4..9ce65e8377ce 100644
--- a/extensions/source/propctrlr/formlinkdialog.hxx
+++ b/extensions/source/propctrlr/formlinkdialog.hxx
@@ -44,15 +44,15 @@ namespace pcr
class FormLinkDialog : public ModalDialog
{
private:
- FixedText* m_pExplanation;
- FixedText* m_pDetailLabel;
- FixedText* m_pMasterLabel;
- ::std::unique_ptr< FieldLinkRow > m_aRow1;
- ::std::unique_ptr< FieldLinkRow > m_aRow2;
- ::std::unique_ptr< FieldLinkRow > m_aRow3;
- ::std::unique_ptr< FieldLinkRow > m_aRow4;
- OKButton* m_pOK;
- PushButton* m_pSuggest;
+ VclPtr<FixedText> m_pExplanation;
+ VclPtr<FixedText> m_pDetailLabel;
+ VclPtr<FixedText> m_pMasterLabel;
+ VclPtr<FieldLinkRow> m_aRow1;
+ VclPtr<FieldLinkRow> m_aRow2;
+ VclPtr<FieldLinkRow> m_aRow3;
+ VclPtr<FieldLinkRow> m_aRow4;
+ VclPtr<OKButton> m_pOK;
+ VclPtr<PushButton> m_pSuggest;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
m_xContext;
@@ -80,6 +80,7 @@ namespace pcr
const OUString& _sMasterLabel = OUString()
);
virtual ~FormLinkDialog( );
+ virtual void dispose() SAL_OVERRIDE;
// Dialog overridables
virtual short Execute() SAL_OVERRIDE;
diff --git a/extensions/source/propctrlr/inspectorhelpwindow.cxx b/extensions/source/propctrlr/inspectorhelpwindow.cxx
index b62010cf6cd9..b174b69bd6c2 100644
--- a/extensions/source/propctrlr/inspectorhelpwindow.cxx
+++ b/extensions/source/propctrlr/inspectorhelpwindow.cxx
@@ -29,27 +29,38 @@ namespace pcr
InspectorHelpWindow::InspectorHelpWindow( vcl::Window* _pParent )
:Window( _pParent, WB_DIALOGCONTROL )
- ,m_aSeparator( this )
- ,m_aHelpText( this, WB_LEFT | WB_READONLY | WB_AUTOVSCROLL )
+ ,m_aSeparator( VclPtr<FixedLine>::Create(this) )
+ ,m_aHelpText( VclPtr<MultiLineEdit>::Create(this, WB_LEFT | WB_READONLY | WB_AUTOVSCROLL) )
,m_nMinLines( 3 )
,m_nMaxLines( 8 )
{
SetBackground();
SetPaintTransparent(true);
- m_aSeparator.SetText( PcrRes(RID_STR_HELP_SECTION_LABEL).toString() );
- m_aSeparator.SetBackground();
- m_aSeparator.Show();
-
- m_aHelpText.SetControlBackground( /*m_aSeparator.GetBackground().GetColor() */);
- m_aHelpText.SetBackground();
- m_aHelpText.SetPaintTransparent(true);
- m_aHelpText.Show();
+ m_aSeparator->SetText( PcrRes(RID_STR_HELP_SECTION_LABEL).toString() );
+ m_aSeparator->SetBackground();
+ m_aSeparator->Show();
+
+ m_aHelpText->SetControlBackground( /*m_aSeparator->GetBackground().GetColor() */);
+ m_aHelpText->SetBackground();
+ m_aHelpText->SetPaintTransparent(true);
+ m_aHelpText->Show();
}
+ InspectorHelpWindow::~InspectorHelpWindow()
+ {
+ disposeOnce();
+ }
+
+ void InspectorHelpWindow::dispose()
+ {
+ m_aSeparator.disposeAndClear();
+ m_aHelpText.disposeAndClear();
+ vcl::Window::dispose();
+ }
void InspectorHelpWindow::SetText( const OUString& _rStr )
{
- m_aHelpText.SetText( _rStr );
+ m_aHelpText->SetText( _rStr );
}
@@ -63,7 +74,7 @@ namespace pcr
long InspectorHelpWindow::impl_getHelpTextBorderHeight()
{
sal_Int32 nTop(0), nBottom(0), nDummy(0);
- m_aHelpText.GetBorder( nDummy, nTop, nDummy, nBottom );
+ m_aHelpText->GetBorder( nDummy, nTop, nDummy, nBottom );
return nTop + nBottom;
}
@@ -84,13 +95,13 @@ namespace pcr
long InspectorHelpWindow::impl_getMinimalTextWindowHeight()
{
- return impl_getHelpTextBorderHeight() + m_aHelpText.GetTextHeight() * m_nMinLines;
+ return impl_getHelpTextBorderHeight() + m_aHelpText->GetTextHeight() * m_nMinLines;
}
long InspectorHelpWindow::impl_getMaximalTextWindowHeight()
{
- return impl_getHelpTextBorderHeight() + m_aHelpText.GetTextHeight() * m_nMaxLines;
+ return impl_getHelpTextBorderHeight() + m_aHelpText->GetTextHeight() * m_nMaxLines;
}
@@ -100,8 +111,8 @@ namespace pcr
long nMinTextWindowHeight = impl_getMinimalTextWindowHeight();
long nMaxTextWindowHeight = impl_getMaximalTextWindowHeight();
- Rectangle aTextRect( Point( 0, 0 ), m_aHelpText.GetOutputSizePixel() );
- aTextRect = m_aHelpText.GetTextRect( aTextRect, m_aHelpText.GetText(),
+ Rectangle aTextRect( Point( 0, 0 ), m_aHelpText->GetOutputSizePixel() );
+ aTextRect = m_aHelpText->GetTextRect( aTextRect, m_aHelpText->GetText(),
TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
long nActTextWindowHeight = impl_getHelpTextBorderHeight() + aTextRect.GetHeight();
@@ -120,11 +131,11 @@ namespace pcr
Rectangle aSeparatorArea( aPlayground );
aSeparatorArea.Bottom() = aSeparatorArea.Top() + LogicToPixel( Size( 0, 8 ), MAP_APPFONT ).Height();
- m_aSeparator.SetPosSizePixel( aSeparatorArea.TopLeft(), aSeparatorArea.GetSize() );
+ m_aSeparator->SetPosSizePixel( aSeparatorArea.TopLeft(), aSeparatorArea.GetSize() );
Rectangle aTextArea( aPlayground );
aTextArea.Top() = aSeparatorArea.Bottom() + a3AppFont.Height();
- m_aHelpText.SetPosSizePixel( aTextArea.TopLeft(), aTextArea.GetSize() );
+ m_aHelpText->SetPosSizePixel( aTextArea.TopLeft(), aTextArea.GetSize() );
}
diff --git a/extensions/source/propctrlr/inspectorhelpwindow.hxx b/extensions/source/propctrlr/inspectorhelpwindow.hxx
index 9419a72ec7a9..0159cff96ca6 100644
--- a/extensions/source/propctrlr/inspectorhelpwindow.hxx
+++ b/extensions/source/propctrlr/inspectorhelpwindow.hxx
@@ -33,14 +33,16 @@ namespace pcr
class InspectorHelpWindow : public vcl::Window
{
private:
- FixedLine m_aSeparator;
- MultiLineEdit m_aHelpText;
+ VclPtr<FixedLine> m_aSeparator;
+ VclPtr<MultiLineEdit> m_aHelpText;
sal_Int32 m_nMinLines;
sal_Int32 m_nMaxLines;
public:
InspectorHelpWindow( vcl::Window* _pParent );
+ virtual ~InspectorHelpWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetText( const OUString& rStr ) SAL_OVERRIDE;
diff --git a/extensions/source/propctrlr/listselectiondlg.cxx b/extensions/source/propctrlr/listselectiondlg.cxx
index fdb6229dc370..9b2bbedcb368 100644
--- a/extensions/source/propctrlr/listselectiondlg.cxx
+++ b/extensions/source/propctrlr/listselectiondlg.cxx
@@ -48,6 +48,17 @@ namespace pcr
initialize( );
}
+ ListSelectionDialog::~ListSelectionDialog()
+ {
+ disposeOnce();
+ }
+
+ void ListSelectionDialog::dispose()
+ {
+ m_pEntries.clear();
+ ModalDialog::dispose();
+ }
+
short ListSelectionDialog::Execute()
{
short nResult = ModalDialog::Execute();
diff --git a/extensions/source/propctrlr/listselectiondlg.hxx b/extensions/source/propctrlr/listselectiondlg.hxx
index aaccb0754ec2..ca9a118c06f9 100644
--- a/extensions/source/propctrlr/listselectiondlg.hxx
+++ b/extensions/source/propctrlr/listselectiondlg.hxx
@@ -31,7 +31,7 @@ namespace pcr
class ListSelectionDialog : public ModalDialog
{
private:
- ListBox* m_pEntries;
+ VclPtr<ListBox> m_pEntries;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
m_xListBox;
@@ -44,6 +44,8 @@ namespace pcr
const OUString& _rPropertyName,
const OUString& _rPropertyUIName
);
+ virtual ~ListSelectionDialog();
+ virtual void dispose() SAL_OVERRIDE;
// Dialog overridables
virtual short Execute() SAL_OVERRIDE;
diff --git a/extensions/source/propctrlr/newdatatype.cxx b/extensions/source/propctrlr/newdatatype.cxx
index 62cc6da9c247..50f85e22489b 100644
--- a/extensions/source/propctrlr/newdatatype.cxx
+++ b/extensions/source/propctrlr/newdatatype.cxx
@@ -67,6 +67,17 @@ namespace pcr
OnNameModified( NULL );
}
+ NewDataTypeDialog::~NewDataTypeDialog()
+ {
+ disposeOnce();
+ }
+
+ void NewDataTypeDialog::dispose()
+ {
+ m_pName.clear();
+ m_pOK.clear();
+ ModalDialog::dispose();
+ }
IMPL_LINK( NewDataTypeDialog, OnNameModified, void*, /*_pNotInterestedIn*/ )
{
diff --git a/extensions/source/propctrlr/newdatatype.hxx b/extensions/source/propctrlr/newdatatype.hxx
index 135514aaa271..abccb19bd1f9 100644
--- a/extensions/source/propctrlr/newdatatype.hxx
+++ b/extensions/source/propctrlr/newdatatype.hxx
@@ -35,14 +35,16 @@ namespace pcr
class NewDataTypeDialog : public ModalDialog
{
private:
- Edit* m_pName;
- OKButton* m_pOK;
+ VclPtr<Edit> m_pName;
+ VclPtr<OKButton> m_pOK;
::std::set< OUString > m_aProhibitedNames;
public:
NewDataTypeDialog(vcl::Window* _pParent, const OUString& _rNameBase,
const ::std::vector< OUString >& _rProhibitedNames );
+ virtual ~NewDataTypeDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetName() const { return m_pName->GetText(); }
diff --git a/extensions/source/propctrlr/pcrunodialogs.cxx b/extensions/source/propctrlr/pcrunodialogs.cxx
index 2f2d56086fb6..98c4b49ad590 100644
--- a/extensions/source/propctrlr/pcrunodialogs.cxx
+++ b/extensions/source/propctrlr/pcrunodialogs.cxx
@@ -130,9 +130,9 @@ namespace pcr
}
- Dialog* OTabOrderDialog::createDialog( vcl::Window* _pParent )
+ VclPtr<Dialog> OTabOrderDialog::createDialog( vcl::Window* _pParent )
{
- return new TabOrderDialog( _pParent, m_xTabbingModel, m_xControlContext, m_aContext );
+ return VclPtr<TabOrderDialog>::Create( _pParent, m_xTabbingModel, m_xControlContext, m_aContext );
}
void OTabOrderDialog::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException, std::exception)
diff --git a/extensions/source/propctrlr/pcrunodialogs.hxx b/extensions/source/propctrlr/pcrunodialogs.hxx
index e0e6e4325e22..35663f1e6b7b 100644
--- a/extensions/source/propctrlr/pcrunodialogs.hxx
+++ b/extensions/source/propctrlr/pcrunodialogs.hxx
@@ -78,7 +78,7 @@ namespace pcr
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
};
diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx
index 77b518878526..dc85415a63fa 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -44,6 +44,7 @@
#include <comphelper/property.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/tabpage.hxx>
#include <osl/mutex.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/component_context.hxx>
@@ -374,7 +375,7 @@ namespace pcr
// announcement is responsible for calling setComponent, too.
Reference< XWindow > xContainerWindow = m_xFrame->getContainerWindow();
VCLXWindow* pContainerWindow = VCLXWindow::GetImplementation(xContainerWindow);
- vcl::Window* pParentWin = pContainerWindow ? pContainerWindow->GetWindow() : NULL;
+ VclPtr<vcl::Window> pParentWin = pContainerWindow ? pContainerWindow->GetWindow() : VclPtr<vcl::Window>();
if (!pParentWin)
throw RuntimeException("The frame is invalid. Unable to extract the container window.",*this);
@@ -702,7 +703,7 @@ namespace pcr
DBG_ASSERT(!haveView(), "OPropertyBrowserController::Construct: already have a view!");
DBG_ASSERT(_pParentWin, "OPropertyBrowserController::Construct: invalid parent window!");
- m_pView = new OPropertyBrowserView(_pParentWin);
+ m_pView = VclPtr<OPropertyBrowserView>::Create(_pParentWin);
m_pView->setPageActivationHandler(LINK(this, OPropertyBrowserController, OnPageActivation));
// add as dispose listener for our view. The view is disposed by the frame we're plugged into,
diff --git a/extensions/source/propctrlr/propcontroller.hxx b/extensions/source/propctrlr/propcontroller.hxx
index af943de01f13..f204a86c8735 100644
--- a/extensions/source/propctrlr/propcontroller.hxx
+++ b/extensions/source/propctrlr/propcontroller.hxx
@@ -105,7 +105,7 @@ namespace pcr
::cppu::OInterfaceContainerHelper m_aDisposeListeners;
::cppu::OInterfaceContainerHelper m_aControlObservers;
// meta data about the properties
- OPropertyBrowserView* m_pView;
+ VclPtr<OPropertyBrowserView> m_pView;
OUString m_sPageSelection;
OUString m_sLastValidPageSelection;
@@ -242,7 +242,7 @@ namespace pcr
// stop the inspection
void stopInspection( bool _bCommitModified );
- bool haveView() const { return NULL != m_pView; }
+ bool haveView() const { return nullptr != m_pView; }
OPropertyEditor& getPropertyBox() { return m_pView->getPropertyBox(); }
// does the inspection of the objects as indicated by our model
diff --git a/extensions/source/propctrlr/propertyeditor.cxx b/extensions/source/propctrlr/propertyeditor.cxx
index 5fcafaf92c64..daa9e8c965f6 100644
--- a/extensions/source/propctrlr/propertyeditor.cxx
+++ b/extensions/source/propctrlr/propertyeditor.cxx
@@ -43,7 +43,7 @@ namespace pcr
OPropertyEditor::OPropertyEditor( vcl::Window* pParent, WinBits nWinStyle)
:Control(pParent, nWinStyle)
- ,m_aTabControl( this )
+ ,m_aTabControl( VclPtr<TabControl>::Create(this) )
,m_pListener(NULL)
,m_pObserver(NULL)
,m_nNextId(1)
@@ -52,37 +52,44 @@ namespace pcr
,m_nMaxHelpLines( 0 )
{
- m_aTabControl.Show();
- m_aTabControl.SetDeactivatePageHdl(LINK(this, OPropertyEditor, OnPageDeactivate));
- m_aTabControl.SetActivatePageHdl(LINK(this, OPropertyEditor, OnPageActivate));
- m_aTabControl.SetBackground(GetBackground());
- m_aTabControl.SetPaintTransparent(true);
+ m_aTabControl->Show();
+ m_aTabControl->SetDeactivatePageHdl(LINK(this, OPropertyEditor, OnPageDeactivate));
+ m_aTabControl->SetActivatePageHdl(LINK(this, OPropertyEditor, OnPageActivate));
+ m_aTabControl->SetBackground(GetBackground());
+ m_aTabControl->SetPaintTransparent(true);
}
OPropertyEditor::~OPropertyEditor()
{
+ disposeOnce();
+ }
+
+ void OPropertyEditor::dispose()
+ {
Hide();
ClearAll();
+ m_aTabControl.disposeAndClear();
+ Control::dispose();
}
void OPropertyEditor::ClearAll()
{
m_nNextId=1;
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
for(long i = nCount-1; i >= 0; --i)
{
- sal_uInt16 nID = m_aTabControl.GetPageId((sal_uInt16)i);
- OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
+ sal_uInt16 nID = m_aTabControl->GetPageId((sal_uInt16)i);
+ VclPtr<OBrowserPage> pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID));
if (pPage)
{
pPage->EnableInput(false);
- m_aTabControl.RemovePage(nID);
- delete pPage;
+ m_aTabControl->RemovePage(nID);
+ pPage.disposeAndClear();
}
}
- m_aTabControl.Clear();
+ m_aTabControl->Clear();
{
MapStringToPageId aEmpty;
@@ -91,9 +98,10 @@ namespace pcr
while ( !m_aHiddenPages.empty() )
{
- delete m_aHiddenPages.begin()->second.pPage;
+ m_aHiddenPages.begin()->second.pPage.disposeAndClear();
m_aHiddenPages.erase( m_aHiddenPages.begin() );
}
+ m_aHiddenPages.clear();
}
@@ -101,16 +109,16 @@ namespace pcr
{
sal_Int32 nMinHeight( LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM );
- if ( m_aTabControl.GetPageCount() > 0 )
+ if ( m_aTabControl->GetPageCount() > 0 )
{
- sal_uInt16 nFirstID = m_aTabControl.GetPageId( 0 );
+ sal_uInt16 nFirstID = m_aTabControl->GetPageId( 0 );
// reserve space for the tabs themself
- Rectangle aTabArea( m_aTabControl.GetTabBounds( nFirstID ) );
+ Rectangle aTabArea( m_aTabControl->GetTabBounds( nFirstID ) );
nMinHeight += aTabArea.GetHeight();
// ask the page how much it requires
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nFirstID ) );
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( nFirstID ) );
if ( pPage )
nMinHeight += pPage->getMinimumHeight();
}
@@ -123,12 +131,12 @@ namespace pcr
sal_Int32 OPropertyEditor::getMinimumWidth()
{
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
sal_Int32 nPageMinWidth = 0;
for(long i = nCount-1; i >= 0; --i)
{
- sal_uInt16 nID = m_aTabControl.GetPageId((sal_uInt16)i);
- OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
+ sal_uInt16 nID = m_aTabControl->GetPageId((sal_uInt16)i);
+ OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID));
if (pPage)
{
sal_Int32 nCurPageMinWidth = pPage->getMinimumWidth();
@@ -144,11 +152,11 @@ namespace pcr
{
// commit all of my pages, if necessary
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
for ( sal_uInt16 i=0; i<nCount; ++i )
{
- sal_uInt16 nID = m_aTabControl.GetPageId( i );
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nID ) );
+ sal_uInt16 nID = m_aTabControl->GetPageId( i );
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( nID ) );
if ( pPage && pPage->getListBox().IsModified() )
pPage->getListBox().CommitModified();
@@ -158,7 +166,7 @@ namespace pcr
void OPropertyEditor::GetFocus()
{
- m_aTabControl.GrabFocus();
+ m_aTabControl->GrabFocus();
}
@@ -167,7 +175,7 @@ namespace pcr
OBrowserPage* pPage = NULL;
MapStringToPageId::const_iterator aPropertyPageIdPos = m_aPropertyPageIds.find( _rPropertyName );
if ( aPropertyPageIdPos != m_aPropertyPageIds.end() )
- pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( aPropertyPageIdPos->second ) );
+ pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( aPropertyPageIdPos->second ) );
return pPage;
}
@@ -180,7 +188,7 @@ namespace pcr
OBrowserPage* OPropertyEditor::getPage( sal_uInt16& _rPageId )
{
- return static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( _rPageId ) );
+ return static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( _rPageId ) );
}
@@ -201,7 +209,7 @@ namespace pcr
);
Rectangle aTabArea( aPlayground );
- m_aTabControl.SetPosSizePixel( aTabArea.TopLeft(), aTabArea.GetSize() );
+ m_aTabControl->SetPosSizePixel( aTabArea.TopLeft(), aTabArea.GetSize() );
}
@@ -210,13 +218,13 @@ namespace pcr
// obtain a new id
sal_uInt16 nId = m_nNextId++;
// insert the id
- m_aTabControl.InsertPage(nId, _rText);
+ m_aTabControl->InsertPage(nId, _rText);
// create a new page
- OBrowserPage* pPage = new OBrowserPage(&m_aTabControl);
+ VclPtrInstance<OBrowserPage> pPage(m_aTabControl.get());
pPage->SetText( _rText );
// some knittings
- pPage->SetSizePixel(m_aTabControl.GetTabPageSizePixel());
+ pPage->SetSizePixel(m_aTabControl->GetTabPageSizePixel());
pPage->getListBox().SetListener(m_pListener);
pPage->getListBox().SetObserver(m_pObserver);
pPage->getListBox().EnableHelpSection( m_bHasHelpSection );
@@ -224,8 +232,8 @@ namespace pcr
pPage->SetHelpId( _rHelpId );
// immediately activate the page
- m_aTabControl.SetTabPage(nId, pPage);
- m_aTabControl.SetCurPageId(nId);
+ m_aTabControl->SetTabPage(nId, pPage);
+ m_aTabControl->SetCurPageId(nId);
return nId;
}
@@ -234,32 +242,31 @@ namespace pcr
void OPropertyEditor::SetHelpId( const OString& rHelpId )
{
Control::SetHelpId("");
- m_aTabControl.SetHelpId(rHelpId);
+ m_aTabControl->SetHelpId(rHelpId);
}
void OPropertyEditor::RemovePage(sal_uInt16 nID)
{
- OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
+ VclPtr<OBrowserPage> pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID));
if (pPage)
pPage->EnableInput(false);
- m_aTabControl.RemovePage(nID);
- if (pPage)
- delete pPage;
+ m_aTabControl->RemovePage(nID);
+ pPage.disposeAndClear();
}
void OPropertyEditor::SetPage(sal_uInt16 nId)
{
- m_aTabControl.SetCurPageId(nId);
+ m_aTabControl->SetCurPageId(nId);
}
sal_uInt16 OPropertyEditor::GetCurPage()
{
- if(m_aTabControl.GetPageCount()>0)
- return m_aTabControl.GetCurPageId();
+ if(m_aTabControl->GetPageCount()>0)
+ return m_aTabControl->GetCurPageId();
else
return 0;
}
@@ -268,11 +275,11 @@ namespace pcr
void OPropertyEditor::Update(const ::std::mem_fun_t<void,OBrowserListBox>& _aUpdateFunction)
{
// forward this to all our pages
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
for (sal_uInt16 i=0;i<nCount;++i)
{
- sal_uInt16 nID = m_aTabControl.GetPageId(i);
- OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
+ sal_uInt16 nID = m_aTabControl->GetPageId(i);
+ OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID));
if (pPage)
_aUpdateFunction(&pPage->getListBox());
}
@@ -291,11 +298,11 @@ namespace pcr
void OPropertyEditor::forEachPage( PageOperation _pOperation, const void* _pArgument )
{
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
for ( sal_uInt16 i=0; i<nCount; ++i )
{
- sal_uInt16 nID = m_aTabControl.GetPageId(i);
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nID ) );
+ sal_uInt16 nID = m_aTabControl->GetPageId(i);
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( nID ) );
if ( !pPage )
continue;
(this->*_pOperation)( *pPage, _pArgument );
@@ -340,11 +347,11 @@ namespace pcr
void OPropertyEditor::SetHelpText( const OUString& _rHelpText )
{
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
for ( sal_uInt16 i=0; i<nCount; ++i )
{
- sal_uInt16 nID = m_aTabControl.GetPageId(i);
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nID ) );
+ sal_uInt16 nID = m_aTabControl->GetPageId(i);
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( nID ) );
if ( !pPage )
continue;
setHelpSectionText( *pPage, &_rHelpText );
@@ -445,13 +452,13 @@ namespace pcr
{
if ( !_bShow )
{
- sal_uInt16 nPagePos = m_aTabControl.GetPagePos( _nPageId );
+ sal_uInt16 nPagePos = m_aTabControl->GetPagePos( _nPageId );
if ( TAB_PAGE_NOTFOUND == nPagePos )
return;
DBG_ASSERT( m_aHiddenPages.find( _nPageId ) == m_aHiddenPages.end(), "OPropertyEditor::ShowPropertyPage: page already hidden!" );
- m_aHiddenPages[ _nPageId ] = HiddenPage( nPagePos, m_aTabControl.GetTabPage( _nPageId ) );
- m_aTabControl.RemovePage( _nPageId );
+ m_aHiddenPages[ _nPageId ] = HiddenPage( nPagePos, m_aTabControl->GetTabPage( _nPageId ) );
+ m_aTabControl->RemovePage( _nPageId );
}
else
{
@@ -459,9 +466,9 @@ namespace pcr
if ( aPagePos == m_aHiddenPages.end() )
return;
- aPagePos->second.pPage->SetSizePixel( m_aTabControl.GetTabPageSizePixel() );
- m_aTabControl.InsertPage( aPagePos->first, aPagePos->second.pPage->GetText(), aPagePos->second.nPos );
- m_aTabControl.SetTabPage( aPagePos->first, aPagePos->second.pPage );
+ aPagePos->second.pPage->SetSizePixel( m_aTabControl->GetTabPageSizePixel() );
+ m_aTabControl->InsertPage( aPagePos->first, aPagePos->second.pPage->GetText(), aPagePos->second.nPos );
+ m_aTabControl->SetTabPage( aPagePos->first, aPagePos->second.pPage );
m_aHiddenPages.erase( aPagePos );
}
@@ -470,9 +477,9 @@ namespace pcr
void OPropertyEditor::EnablePropertyControls( const OUString& _rEntryName, sal_Int16 _nControls, bool _bEnable )
{
- for ( sal_uInt16 i = 0; i < m_aTabControl.GetPageCount(); ++i )
+ for ( sal_uInt16 i = 0; i < m_aTabControl->GetPageCount(); ++i )
{
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( m_aTabControl.GetPageId( i ) ) );
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( m_aTabControl->GetPageId( i ) ) );
if ( pPage )
pPage->getListBox().EnablePropertyControls( _rEntryName, _nControls, _bEnable );
}
@@ -481,9 +488,9 @@ namespace pcr
void OPropertyEditor::EnablePropertyLine( const OUString& _rEntryName, bool _bEnable )
{
- for ( sal_uInt16 i = 0; i < m_aTabControl.GetPageCount(); ++i )
+ for ( sal_uInt16 i = 0; i < m_aTabControl->GetPageCount(); ++i )
{
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( m_aTabControl.GetPageId( i ) ) );
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( m_aTabControl->GetPageId( i ) ) );
if ( pPage )
pPage->getListBox().EnablePropertyLine( _rEntryName, _bEnable );
}
@@ -494,7 +501,7 @@ namespace pcr
{
Reference< XPropertyControl > xControl;
// let the current page handle this
- OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(m_aTabControl.GetCurPageId()));
+ OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(m_aTabControl->GetCurPageId()));
if (pPage)
xControl = pPage->getListBox().GetPropertyControl(rEntryName);
return xControl;
@@ -513,8 +520,8 @@ namespace pcr
{
// commit the data on the current (to-be-decativated) tab page
// (79404)
- sal_Int32 nCurrentId = m_aTabControl.GetCurPageId();
- OBrowserPage* pCurrentPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage((sal_uInt16)nCurrentId));
+ sal_Int32 nCurrentId = m_aTabControl->GetCurPageId();
+ OBrowserPage* pCurrentPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage((sal_uInt16)nCurrentId));
if ( !pCurrentPage )
return 1L;
diff --git a/extensions/source/propctrlr/propertyeditor.hxx b/extensions/source/propctrlr/propertyeditor.hxx
index 18861826ed7a..3a868386d7b0 100644
--- a/extensions/source/propctrlr/propertyeditor.hxx
+++ b/extensions/source/propctrlr/propertyeditor.hxx
@@ -24,13 +24,13 @@
#include <com/sun/star/inspection/XPropertyControl.hpp>
#include <vcl/tabctrl.hxx>
+#include <vcl/vclptr.hxx>
+#include <boost/mem_fn.hpp>
#include <map>
-
namespace pcr
{
-
class IPropertyLineListener;
class IPropertyControlObserver;
class OBrowserPage;
@@ -47,13 +47,13 @@ namespace pcr
struct HiddenPage
{
sal_uInt16 nPos;
- TabPage* pPage;
+ VclPtr<TabPage> pPage;
HiddenPage() : nPos( 0 ), pPage( NULL ) { }
HiddenPage( sal_uInt16 _nPos, TabPage* _pPage ) : nPos( _nPos ), pPage( _pPage ) { }
};
private:
- TabControl m_aTabControl;
+ VclPtr<TabControl> m_aTabControl;
IPropertyLineListener* m_pListener;
IPropertyControlObserver* m_pObserver;
sal_uInt16 m_nNextId;
@@ -73,6 +73,7 @@ namespace pcr
OPropertyEditor (vcl::Window* pParent, WinBits nWinStyle = WB_DIALOGCONTROL);
virtual ~OPropertyEditor();
+ virtual void dispose() SAL_OVERRIDE;
void EnableUpdate();
void DisableUpdate();
diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx
index 27ed6d5d1799..43f372deecc1 100644
--- a/extensions/source/propctrlr/selectlabeldialog.cxx
+++ b/extensions/source/propctrlr/selectlabeldialog.cxx
@@ -145,6 +145,11 @@ namespace pcr
OSelectLabelDialog::~OSelectLabelDialog()
{
+ disposeOnce();
+ }
+
+ void OSelectLabelDialog::dispose()
+ {
// delete the entry datas of the listbox entries
SvTreeListEntry* pLoop = m_pControlTree->First();
while (pLoop)
@@ -154,7 +159,10 @@ namespace pcr
delete static_cast<Reference< XPropertySet > *>(pData);
pLoop = m_pControlTree->Next(pLoop);
}
-
+ m_pMainDesc.clear();
+ m_pControlTree.clear();
+ m_pNoAssignment.clear();
+ ModalDialog::dispose();
}
sal_Int32 OSelectLabelDialog::InsertEntries(const Reference< XInterface > & _xContainer, SvTreeListEntry* pContainerEntry)
diff --git a/extensions/source/propctrlr/selectlabeldialog.hxx b/extensions/source/propctrlr/selectlabeldialog.hxx
index abb138248f97..45144c646738 100644
--- a/extensions/source/propctrlr/selectlabeldialog.hxx
+++ b/extensions/source/propctrlr/selectlabeldialog.hxx
@@ -40,9 +40,9 @@ namespace pcr
:public ModalDialog
,public PcrClient
{
- FixedText *m_pMainDesc;
- SvTreeListBox *m_pControlTree;
- CheckBox *m_pNoAssignment;
+ VclPtr<FixedText> m_pMainDesc;
+ VclPtr<SvTreeListBox> m_pControlTree;
+ VclPtr<CheckBox> m_pNoAssignment;
ImageList m_aModelImages;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xControlModel;
@@ -58,6 +58,7 @@ namespace pcr
public:
OSelectLabelDialog(vcl::Window* pParent, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _xControlModel);
virtual ~OSelectLabelDialog();
+ virtual void dispose() SAL_OVERRIDE;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetSelected() const { return m_pNoAssignment->IsChecked() ? ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > () : m_xSelectedControl; }
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index af4d001dc784..240b3f51131c 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -959,14 +959,16 @@ namespace pcr
class OMultilineFloatingEdit : public FloatingWindow
{
private:
- MultiLineEdit m_aImplEdit;
+ VclPtr<MultiLineEdit> m_aImplEdit;
protected:
virtual void Resize() SAL_OVERRIDE;
public:
OMultilineFloatingEdit(vcl::Window* _pParen);
- MultiLineEdit& getEdit() { return m_aImplEdit; }
+ virtual ~OMultilineFloatingEdit();
+ virtual void dispose() SAL_OVERRIDE;
+ MultiLineEdit& getEdit() { return *m_aImplEdit.get(); }
protected:
virtual bool PreNotify(NotifyEvent& _rNEvt) SAL_OVERRIDE;
@@ -975,15 +977,25 @@ namespace pcr
OMultilineFloatingEdit::OMultilineFloatingEdit(vcl::Window* _pParent)
:FloatingWindow(_pParent, WB_BORDER)
- ,m_aImplEdit(this, WB_VSCROLL|WB_IGNORETAB|WB_NOBORDER)
+ ,m_aImplEdit(VclPtr<MultiLineEdit>::Create(this, WB_VSCROLL|WB_IGNORETAB|WB_NOBORDER))
{
- m_aImplEdit.Show();
+ m_aImplEdit->Show();
}
+ OMultilineFloatingEdit::~OMultilineFloatingEdit()
+ {
+ disposeOnce();
+ }
+
+ void OMultilineFloatingEdit::dispose()
+ {
+ m_aImplEdit.disposeAndClear();
+ FloatingWindow::dispose();
+ }
void OMultilineFloatingEdit::Resize()
{
- m_aImplEdit.SetSizePixel(GetOutputSizePixel());
+ m_aImplEdit->SetSizePixel(GetOutputSizePixel());
}
@@ -1023,26 +1035,25 @@ namespace pcr
DropDownEditControl::DropDownEditControl( vcl::Window* _pParent, WinBits _nStyle )
:DropDownEditControl_Base( _pParent, _nStyle )
,m_pFloatingEdit( NULL )
- ,m_pImplEdit( NULL )
,m_pDropdownButton( NULL )
,m_nOperationMode( eStringList )
,m_bDropdown( false )
{
SetCompoundControl( true );
- m_pImplEdit = new MultiLineEdit( this, WB_TABSTOP | WB_IGNORETAB | WB_NOBORDER | (_nStyle & WB_READONLY) );
+ m_pImplEdit = VclPtr<MultiLineEdit>::Create( this, WB_TABSTOP | WB_IGNORETAB | WB_NOBORDER | (_nStyle & WB_READONLY) );
SetSubEdit( m_pImplEdit );
m_pImplEdit->Show();
if ( _nStyle & WB_DROPDOWN )
{
- m_pDropdownButton = new PushButton( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP);
+ m_pDropdownButton = VclPtr<PushButton>::Create( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP);
m_pDropdownButton->SetSymbol(SymbolType::SPIN_DOWN);
m_pDropdownButton->SetClickHdl( LINK( this, DropDownEditControl, DropDownHdl ) );
m_pDropdownButton->Show();
}
- m_pFloatingEdit = new OMultilineFloatingEdit(this); //FloatingWindow
+ m_pFloatingEdit = VclPtr<OMultilineFloatingEdit>::Create(this);
m_pFloatingEdit->SetPopupModeEndHdl( LINK( this, DropDownEditControl, ReturnHdl ) );
m_pFloatingEdit->getEdit().SetReadOnly( ( _nStyle & WB_READONLY ) != 0 );
@@ -1061,19 +1072,16 @@ namespace pcr
DropDownEditControl::~DropDownEditControl()
{
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pFloatingEdit);
- m_pFloatingEdit = NULL;
- }
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pImplEdit);
- SetSubEdit( NULL );
- m_pImplEdit = NULL;
- }
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pDropdownButton);
- m_pDropdownButton = NULL;
- }
+ disposeOnce();
+ }
+
+ void DropDownEditControl::dispose()
+ {
+ SetSubEdit(nullptr);
+ m_pImplEdit.disposeAndClear();
+ m_pFloatingEdit.disposeAndClear();
+ m_pDropdownButton.disposeAndClear();
+ DropDownEditControl_Base::dispose();
}
@@ -1081,7 +1089,7 @@ namespace pcr
{
::Size aOutSz = GetOutputSizePixel();
- if (m_pDropdownButton!=NULL)
+ if (m_pDropdownButton!=nullptr)
{
long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
nSBWidth = CalcZoom( nSBWidth );
@@ -1106,7 +1114,7 @@ namespace pcr
{
if ( m_pHelper )
{
- m_pHelper->LoseFocusHdl( m_pImplEdit );
+ m_pHelper->LoseFocusHdl( m_pImplEdit.get() );
m_pHelper->activateNextControl();
}
}
diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx
index 8c80714bc3d5..9eb99354abda 100644
--- a/extensions/source/propctrlr/standardcontrol.hxx
+++ b/extensions/source/propctrlr/standardcontrol.hxx
@@ -374,15 +374,16 @@ namespace pcr
class DropDownEditControl : public DropDownEditControl_Base
{
private:
- OMultilineFloatingEdit* m_pFloatingEdit;
- MultiLineEdit* m_pImplEdit;
- PushButton* m_pDropdownButton;
+ VclPtr<OMultilineFloatingEdit> m_pFloatingEdit;
+ VclPtr<MultiLineEdit> m_pImplEdit;
+ VclPtr<PushButton> m_pDropdownButton;
MultiLineOperationMode m_nOperationMode;
bool m_bDropdown : 1;
public:
DropDownEditControl( vcl::Window* _pParent, WinBits _nStyle );
virtual ~DropDownEditControl();
+ virtual void dispose() SAL_OVERRIDE;
void setOperationMode( MultiLineOperationMode _eMode ) { m_nOperationMode = _eMode; }
MultiLineOperationMode getOperationMode() const { return m_nOperationMode; }
diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx
index 8c64920aad01..8189fca44a92 100644
--- a/extensions/source/propctrlr/taborder.cxx
+++ b/extensions/source/propctrlr/taborder.cxx
@@ -118,10 +118,20 @@ namespace pcr
TabOrderDialog::~TabOrderDialog()
{
+ disposeOnce();
+ }
+
+ void TabOrderDialog::dispose()
+ {
m_pLB_Controls->Hide();
// delete pLB_Controls;
delete pImageList;
-
+ m_pLB_Controls.clear();
+ m_pPB_OK.clear();
+ m_pPB_MoveUp.clear();
+ m_pPB_MoveDown.clear();
+ m_pPB_AutoOrder.clear();
+ ModalDialog::dispose();
}
diff --git a/extensions/source/propctrlr/taborder.hxx b/extensions/source/propctrlr/taborder.hxx
index d70e60cce47f..f56d4b45bc01 100644
--- a/extensions/source/propctrlr/taborder.hxx
+++ b/extensions/source/propctrlr/taborder.hxx
@@ -73,13 +73,13 @@ namespace pcr
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
m_xORB;
- TabOrderListBox* m_pLB_Controls;
+ VclPtr<TabOrderListBox> m_pLB_Controls;
- OKButton* m_pPB_OK;
+ VclPtr<OKButton> m_pPB_OK;
- PushButton* m_pPB_MoveUp;
- PushButton* m_pPB_MoveDown;
- PushButton* m_pPB_AutoOrder;
+ VclPtr<PushButton> m_pPB_MoveUp;
+ VclPtr<PushButton> m_pPB_MoveDown;
+ VclPtr<PushButton> m_pPB_AutoOrder;
ImageList* pImageList;
@@ -102,6 +102,7 @@ namespace pcr
);
virtual ~TabOrderDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetModified();
};
diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
index 99df0140e250..5d01cc891db5 100644
--- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
+++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
@@ -496,11 +496,11 @@ namespace pcr
::std::vector< OUString > aExistentNames;
m_pHelper->getAvailableDataTypeNames( aExistentNames );
- NewDataTypeDialog aDialog( NULL, pType->getName(), aExistentNames ); // TODO/eForms: proper parent
- if ( aDialog.Execute() != RET_OK )
+ ScopedVclPtrInstance<NewDataTypeDialog> aDialog( nullptr, pType->getName(), aExistentNames ); // TODO/eForms: proper parent
+ if ( aDialog->Execute() != RET_OK )
return false;
- _rNewName = aDialog.GetName();
+ _rNewName = aDialog->GetName();
return true;
}
@@ -535,8 +535,8 @@ namespace pcr
// confirmation message
OUString sConfirmation( PcrRes( RID_STR_CONFIRM_DELETE_DATA_TYPE ).toString() );
sConfirmation = sConfirmation.replaceFirst( "#type#", pType->getName() );
- QueryBox aQuery( NULL, WB_YES_NO, sConfirmation ); // TODO/eForms: proper parent
- if ( aQuery.Execute() != RET_YES )
+ ScopedVclPtrInstance<QueryBox> aQuery( nullptr, WB_YES_NO, sConfirmation ); // TODO/eForms: proper parent
+ if ( aQuery->Execute() != RET_YES )
return false;
return true;