diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-14 23:48:14 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 11:04:23 +0100 |
commit | 3b416a7f845e7fda384951c1ac37ac9d47fe9354 (patch) | |
tree | 1846950c88f424f5bdca03bfa2c8f62ae8988607 /svtools | |
parent | 60fcbc1af412b56f95561e26aff2cc63dd81b2aa (diff) |
svtools: switch UNO pieces to use VclPtr enabled toolkit.
Change-Id: Ib243b14e3476d3a65ad1414e3843511420201c7c
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/vclxaccessibleheaderbar.cxx | 3 | ||||
-rw-r--r-- | svtools/source/inc/unoiface.hxx | 9 | ||||
-rw-r--r-- | svtools/source/toolpanel/toolpaneldrawerpeer.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/popupwindowcontroller.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/statusbarcontroller.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/svtxgridcontrol.cxx | 58 | ||||
-rw-r--r-- | svtools/source/uno/svtxgridcontrol.hxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/toolboxcontroller.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/treecontrolpeer.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/treecontrolpeer.hxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/unoiface.cxx | 205 |
11 files changed, 139 insertions, 150 deletions
diff --git a/svtools/source/control/vclxaccessibleheaderbar.cxx b/svtools/source/control/vclxaccessibleheaderbar.cxx index 19a1e55540a8..7c928370ff4a 100644 --- a/svtools/source/control/vclxaccessibleheaderbar.cxx +++ b/svtools/source/control/vclxaccessibleheaderbar.cxx @@ -56,11 +56,10 @@ VCLXAccessibleHeaderBar::VCLXAccessibleHeaderBar( VCLXWindow* pVCLWindow ) :VCLXAccessibleComponent( pVCLWindow ) ,m_pHeadBar(NULL) { - m_pHeadBar = static_cast< HeaderBar* >( GetWindow() ); + m_pHeadBar = GetAs< HeaderBar >(); } - VCLXAccessibleHeaderBar::~VCLXAccessibleHeaderBar() { } diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx index 187956adf699..a6e065a08a70 100644 --- a/svtools/source/inc/unoiface.hxx +++ b/svtools/source/inc/unoiface.hxx @@ -124,7 +124,7 @@ public: VCLXFileControl(); virtual ~VCLXFileControl(); - void SetWindow( vcl::Window* pWindow ) SAL_OVERRIDE; + virtual void SetWindow( const VclPtr< vcl::Window > &pWindow ) SAL_OVERRIDE; // ::com::sun::star::uno::XInterface ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; @@ -176,8 +176,6 @@ protected: sal_Int32 nKeyToSetDelayed; - FormattedField* GetFormattedField() const { return static_cast<FormattedField*>(GetWindow()); } - public: SVTXFormattedField(); virtual ~SVTXFormattedField(); @@ -210,7 +208,7 @@ protected: void NotifyTextListeners(); ::com::sun::star::uno::Any convertEffectiveValue(const ::com::sun::star::uno::Any& rValue); - virtual void SetWindow(vcl::Window* _pWindow) SAL_OVERRIDE; + virtual void SetWindow( const VclPtr< vcl::Window > &_pWindow) SAL_OVERRIDE; static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) SAL_OVERRIDE { return ImplGetPropertyIds( aIds ); } @@ -250,8 +248,7 @@ private: static RMItemData GetRMItemData( const ::com::sun::star::container::ContainerEvent& _rEvent ); protected: - ::svt::ORoadmap* GetRoadmap() const; - void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) SAL_OVERRIDE; + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) SAL_OVERRIDE; virtual ~SVTXRoadmap(); diff --git a/svtools/source/toolpanel/toolpaneldrawerpeer.cxx b/svtools/source/toolpanel/toolpaneldrawerpeer.cxx index 5f7af7987e0f..8e83866a6b9a 100644 --- a/svtools/source/toolpanel/toolpaneldrawerpeer.cxx +++ b/svtools/source/toolpanel/toolpaneldrawerpeer.cxx @@ -97,7 +97,7 @@ namespace svt i_rStateSet.AddState( AccessibleStateType::EXPANDABLE ); i_rStateSet.AddState( AccessibleStateType::FOCUSABLE ); - const ToolPanelDrawer* pDrawer( dynamic_cast< const ToolPanelDrawer* > ( GetWindow() ) ); + VclPtr< ToolPanelDrawer > pDrawer = GetAsDynamic< ToolPanelDrawer > (); ENSURE_OR_RETURN_VOID( pDrawer, "ToolPanelDrawerContext::FillAccessibleStateSet: illegal window!" ); if ( pDrawer->IsExpanded() ) i_rStateSet.AddState( AccessibleStateType::EXPANDED ); diff --git a/svtools/source/uno/popupwindowcontroller.cxx b/svtools/source/uno/popupwindowcontroller.cxx index 1f4bfced3026..d308d53d693a 100644 --- a/svtools/source/uno/popupwindowcontroller.cxx +++ b/svtools/source/uno/popupwindowcontroller.cxx @@ -216,7 +216,7 @@ void SAL_CALL PopupWindowController::doubleClick() throw (RuntimeException, std: Reference< awt::XWindow > SAL_CALL PopupWindowController::createPopupWindow() throw (RuntimeException, std::exception) { - ToolBox* pToolBox = dynamic_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ) ); + VclPtr< ToolBox > pToolBox = dynamic_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ).get() ); if( pToolBox ) { vcl::Window* pItemWindow = pToolBox->GetItemWindow( pToolBox->GetDownItemId() ); diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx index 766b02128e9f..88f10265e99e 100644 --- a/svtools/source/uno/statusbarcontroller.cxx +++ b/svtools/source/uno/statusbarcontroller.cxx @@ -517,7 +517,7 @@ void StatusbarController::bindListener() if ( m_xParentWindow.is() ) { - StatusBar* pStatusBar = dynamic_cast< StatusBar* >( VCLUnoHelper::GetWindow( m_xParentWindow )); + VclPtr< StatusBar > pStatusBar = dynamic_cast< StatusBar* >( VCLUnoHelper::GetWindow( m_xParentWindow ).get() ); if ( pStatusBar && pStatusBar->GetType() == WINDOW_STATUSBAR ) aRect = pStatusBar->GetItemRect( m_nID ); } diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 6fec3022a7fb..b1fb0a2e0cbd 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -89,7 +89,7 @@ SVTXGridControl::~SVTXGridControl() } -void SVTXGridControl::SetWindow( vcl::Window* pWindow ) +void SVTXGridControl::SetWindow( const VclPtr< vcl::Window > &pWindow ) { SVTXGridControl_Base::SetWindow( pWindow ); impl_checkTableModelInit(); @@ -114,8 +114,8 @@ sal_Int32 SAL_CALL SVTXGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getRowAtPoint: no control (anymore)!", -1 ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); + ENSURE_OR_RETURN( pTable, "SVTXGridControl::getRowAtPoint: no control (anymore)!", -1 ); TableCell const tableCell = pTable->getTableControlInterface().hitTest( Point( x, y ) ); return ( tableCell.nRow >= 0 ) ? tableCell.nRow : -1; @@ -126,8 +126,8 @@ sal_Int32 SAL_CALL SVTXGridControl::getColumnAtPoint(::sal_Int32 x, ::sal_Int32 { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getColumnAtPoint: no control (anymore)!", -1 ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); + ENSURE_OR_RETURN( pTable, "SVTXGridControl::getColumnAtPoint: no control (anymore)!", -1 ); TableCell const tableCell = pTable->getTableControlInterface().hitTest( Point( x, y ) ); return ( tableCell.nColumn >= 0 ) ? tableCell.nColumn : -1; @@ -138,8 +138,8 @@ sal_Int32 SAL_CALL SVTXGridControl::getCurrentColumn( ) throw (RuntimeException { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getCurrentColumn: no control (anymore)!", -1 ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); + ENSURE_OR_RETURN( pTable, "SVTXGridControl::getCurrentColumn: no control (anymore)!", -1 ); sal_Int32 const nColumn = pTable->GetCurrentColumn(); return ( nColumn >= 0 ) ? nColumn : -1; @@ -150,8 +150,8 @@ sal_Int32 SAL_CALL SVTXGridControl::getCurrentRow( ) throw (RuntimeException, s { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getCurrentRow: no control (anymore)!", -1 ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); + ENSURE_OR_RETURN( pTable, "SVTXGridControl::getCurrentRow: no control (anymore)!", -1 ); sal_Int32 const nRow = pTable->GetCurrentRow(); return ( nRow >= 0 ) ? nRow : -1; @@ -162,8 +162,8 @@ void SAL_CALL SVTXGridControl::goToCell( ::sal_Int32 i_columnIndex, ::sal_Int32 { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_RETURN_VOID( pTable != NULL, "SVTXGridControl::getCurrentRow: no control (anymore)!" ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); + ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::getCurrentRow: no control (anymore)!" ); impl_checkColumnIndex_throw( *pTable, i_columnIndex ); impl_checkRowIndex_throw( *pTable, i_rowIndex ); @@ -188,8 +188,8 @@ void SVTXGridControl::setProperty( const OUString& PropertyName, const Any& aVal { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_RETURN_VOID( pTable != NULL, "SVTXGridControl::setProperty: no control (anymore)!" ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); + ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::setProperty: no control (anymore)!" ); switch( GetPropertyId( PropertyName ) ) { @@ -438,7 +438,7 @@ void SVTXGridControl::impl_checkTableModelInit() { if ( !m_bTableModelInitCompleted && m_xTableModel->hasColumnModel() && m_xTableModel->hasDataModel() ) { - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); if ( pTable ) { pTable->SetModel( PTableModel( m_xTableModel ) ); @@ -472,8 +472,8 @@ Any SVTXGridControl::getProperty( const OUString& PropertyName ) throw(RuntimeEx { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getProperty: no control (anymore)!", Any() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); + ENSURE_OR_RETURN( pTable, "SVTXGridControl::getProperty: no control (anymore)!", Any() ); Any aPropertyValue; @@ -625,7 +625,7 @@ void SAL_CALL SVTXGridControl::dataChanged( const GridDataEvent& i_event ) throw // if the data model is sortable, a dataChanged event is also fired in case the sort order changed. // So, just in case, invalidate the column header area, too. - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::dataChanged: no control (anymore)!" ); pTable->getTableControlInterface().invalidate( TableAreaColumnHeaders ); } @@ -636,7 +636,7 @@ void SAL_CALL SVTXGridControl::rowHeadingChanged( const GridDataEvent& i_event ) SolarMutexGuard aGuard; OSL_UNUSED( i_event ); - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::rowHeadingChanged: no control (anymore)!" ); // TODO: we could do better than this - invalidate the header area only @@ -686,7 +686,7 @@ void SAL_CALL SVTXGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (Runtim { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectRow: no control (anymore)!" ); impl_checkRowIndex_throw( *pTable, i_rowIndex ); @@ -699,7 +699,7 @@ void SAL_CALL SVTXGridControl::selectAllRows() throw (RuntimeException, std::exc { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectAllRows: no control (anymore)!" ); pTable->SelectAllRows( true ); @@ -710,7 +710,7 @@ void SAL_CALL SVTXGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (Runt { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectRow: no control (anymore)!" ); impl_checkRowIndex_throw( *pTable, i_rowIndex ); @@ -723,7 +723,7 @@ void SAL_CALL SVTXGridControl::deselectAllRows() throw (RuntimeException, std::e { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectAllRows: no control (anymore)!" ); pTable->SelectAllRows( false ); @@ -734,7 +734,7 @@ Sequence< ::sal_Int32 > SAL_CALL SVTXGridControl::getSelectedRows() throw (Runti { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelectedRows: no control (anymore)!", Sequence< sal_Int32 >() ); sal_Int32 selectionCount = pTable->GetSelectedRowCount(); @@ -749,7 +749,7 @@ sal_Bool SAL_CALL SVTXGridControl::hasSelectedRows() throw (RuntimeException, st { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN( pTable, "SVTXGridControl::hasSelectedRows: no control (anymore)!", sal_True ); return pTable->GetSelectedRowCount() > 0; @@ -760,7 +760,7 @@ sal_Bool SAL_CALL SVTXGridControl::isRowSelected( ::sal_Int32 index ) throw (Run { SolarMutexGuard aGuard; - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN( pTable, "SVTXGridControl::isRowSelected: no control (anymore)!", sal_False ); return pTable->IsRowSelected( index ); @@ -782,7 +782,7 @@ void SVTXGridControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent Reference< XWindow > xKeepAlive( this ); - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::ProcessWindowEvent: no control (anymore)!" ); bool handled = false; @@ -870,7 +870,7 @@ void SVTXGridControl::setEnable( sal_Bool bEnable ) throw(::com::sun::star::uno: void SVTXGridControl::ImplCallItemListeners() { - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::ImplCallItemListeners: no control (anymore)!" ); if ( m_aSelectionListeners.getLength() ) @@ -891,8 +891,8 @@ void SVTXGridControl::impl_updateColumnsFromModel_nothrow() { Reference< XGridColumnModel > const xColumnModel( m_xTableModel->getColumnModel() ); ENSURE_OR_RETURN_VOID( xColumnModel.is(), "no model!" ); - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_RETURN_VOID( pTable != NULL, "no table!" ); + VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); + ENSURE_OR_RETURN_VOID( pTable, "no table!" ); try { diff --git a/svtools/source/uno/svtxgridcontrol.hxx b/svtools/source/uno/svtxgridcontrol.hxx index f533a19eaead..eae8f131b22c 100644 --- a/svtools/source/uno/svtxgridcontrol.hxx +++ b/svtools/source/uno/svtxgridcontrol.hxx @@ -106,7 +106,7 @@ public: protected: // VCLXWindow - virtual void SetWindow( vcl::Window* pWindow ) SAL_OVERRIDE; + virtual void SetWindow( const VclPtr< vcl::Window > &pWindow ) SAL_OVERRIDE; private: void impl_updateColumnsFromModel_nothrow(); diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 5b21c44bb48d..c56a378e96e7 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -785,7 +785,7 @@ bool ToolboxController::getToolboxId( sal_uInt16& rItemId, ToolBox** ppToolBox ) if( (m_nToolBoxId != SAL_MAX_UINT16) && (ppToolBox == 0) ) return m_nToolBoxId; - ToolBox* pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ) ); + ToolBox* pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ).get() ); if( (m_nToolBoxId == SAL_MAX_UINT16) && pToolBox ) { diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 8feb8d357329..54538634ed01 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -223,7 +223,7 @@ void TreeControlPeer::disposeControl() -void TreeControlPeer::SetWindow( vcl::Window* pWindow ) +void TreeControlPeer::SetWindow( const VclPtr< vcl::Window > &pWindow ) { VCLXWindow::SetWindow( pWindow ); } diff --git a/svtools/source/uno/treecontrolpeer.hxx b/svtools/source/uno/treecontrolpeer.hxx index fb6a7870f2a6..d1cb56441348 100644 --- a/svtools/source/uno/treecontrolpeer.hxx +++ b/svtools/source/uno/treecontrolpeer.hxx @@ -58,7 +58,7 @@ public: vcl::Window* createVclControl( vcl::Window* pParent, sal_Int64 nWinStyle ); // VCLXWindow - virtual void SetWindow( vcl::Window* pWindow ) SAL_OVERRIDE; + virtual void SetWindow( const VclPtr< vcl::Window > &pWindow ) SAL_OVERRIDE; // ::com::sun::star::view::XSelectionSupplier virtual sal_Bool SAL_CALL select( const ::com::sun::star::uno::Any& xSelection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index e9bf072fe318..3673f2f65859 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -216,7 +216,7 @@ void VCLXMultiLineEdit::setText( const OUString& aText ) throw(::com::sun::star: { SolarMutexGuard aGuard; - MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) { pEdit->SetText( aText ); @@ -233,7 +233,7 @@ void VCLXMultiLineEdit::insertText( const ::com::sun::star::awt::Selection& rSel { SolarMutexGuard aGuard; - MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) { setSelection( rSel ); @@ -246,7 +246,7 @@ OUString VCLXMultiLineEdit::getText() throw(::com::sun::star::uno::RuntimeExcept SolarMutexGuard aGuard; OUString aText; - MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) aText = pEdit->GetText( meLineEndType ); return aText; @@ -257,7 +257,7 @@ OUString VCLXMultiLineEdit::getSelectedText() throw(::com::sun::star::uno::Runti SolarMutexGuard aGuard; OUString aText; - MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >(); if ( pMultiLineEdit) aText = pMultiLineEdit->GetSelected( meLineEndType ); return aText; @@ -268,7 +268,7 @@ void VCLXMultiLineEdit::setSelection( const ::com::sun::star::awt::Selection& aS { SolarMutexGuard aGuard; - MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >(); if ( pMultiLineEdit ) { pMultiLineEdit->SetSelection( Selection( aSelection.Min, aSelection.Max ) ); @@ -280,7 +280,7 @@ void VCLXMultiLineEdit::setSelection( const ::com::sun::star::awt::Selection& aS SolarMutexGuard aGuard; ::com::sun::star::awt::Selection aSel; - MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >(); if ( pMultiLineEdit ) { aSel.Min = pMultiLineEdit->GetSelection().Min(); @@ -293,7 +293,7 @@ sal_Bool VCLXMultiLineEdit::isEditable() throw(::com::sun::star::uno::RuntimeExc { SolarMutexGuard aGuard; - MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >(); return ( pMultiLineEdit && !pMultiLineEdit->IsReadOnly() && pMultiLineEdit->IsEnabled() ) ? sal_True : sal_False; } @@ -301,7 +301,7 @@ void VCLXMultiLineEdit::setEditable( sal_Bool bEditable ) throw(::com::sun::star { SolarMutexGuard aGuard; - MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >(); if ( pMultiLineEdit ) pMultiLineEdit->SetReadOnly( !bEditable ); } @@ -310,7 +310,7 @@ void VCLXMultiLineEdit::setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star:: { SolarMutexGuard aGuard; - MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >(); if ( pMultiLineEdit ) pMultiLineEdit->SetMaxTextLen( nLen ); } @@ -319,7 +319,7 @@ sal_Int16 VCLXMultiLineEdit::getMaxTextLen() throw(::com::sun::star::uno::Runtim { SolarMutexGuard aGuard; - MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >(); return pMultiLineEdit ? (sal_Int16)pMultiLineEdit->GetMaxTextLen() : (sal_Int16)0; } @@ -328,7 +328,7 @@ OUString VCLXMultiLineEdit::getTextLines() throw(::com::sun::star::uno::RuntimeE SolarMutexGuard aGuard; OUString aText; - MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) aText = pEdit->GetTextLines( meLineEndType ); return aText; @@ -339,7 +339,7 @@ OUString VCLXMultiLineEdit::getTextLines() throw(::com::sun::star::uno::RuntimeE SolarMutexGuard aGuard; ::com::sun::star::awt::Size aSz; - MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) aSz = AWTSize(pEdit->CalcMinimumSize()); return aSz; @@ -355,7 +355,7 @@ OUString VCLXMultiLineEdit::getTextLines() throw(::com::sun::star::uno::RuntimeE SolarMutexGuard aGuard; ::com::sun::star::awt::Size aSz = rNewSize; - MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) aSz = AWTSize(pEdit->CalcAdjustedSize( VCLSize(rNewSize ))); return aSz; @@ -366,7 +366,7 @@ OUString VCLXMultiLineEdit::getTextLines() throw(::com::sun::star::uno::RuntimeE SolarMutexGuard aGuard; ::com::sun::star::awt::Size aSz; - MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) aSz = AWTSize(pEdit->CalcBlockSize( nCols, nLines )); return aSz; @@ -377,7 +377,7 @@ void VCLXMultiLineEdit::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines SolarMutexGuard aGuard; nCols = nLines = 0; - MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) { sal_uInt16 nC, nL; @@ -413,7 +413,7 @@ void VCLXMultiLineEdit::setProperty( const OUString& PropertyName, const ::com:: { SolarMutexGuard aGuard; - MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >(); if ( pMultiLineEdit ) { sal_uInt16 nPropType = GetPropertyId( PropertyName ); @@ -470,7 +470,7 @@ void VCLXMultiLineEdit::setProperty( const OUString& PropertyName, const ::com:: SolarMutexGuard aGuard; ::com::sun::star::uno::Any aProp; - MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow()); + VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >(); if ( pMultiLineEdit ) { sal_uInt16 nPropType = GetPropertyId( PropertyName ); @@ -543,7 +543,7 @@ VCLXFileControl::VCLXFileControl() : maTextListeners( *this ) VCLXFileControl::~VCLXFileControl() { - FileControl* pControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pControl = GetAs< FileControl >(); if ( pControl ) pControl->GetEdit().SetModifyHdl( Link() ); } @@ -568,7 +568,7 @@ void SAL_CALL VCLXFileControl::setProperty( const OUString& PropertyName, const { SolarMutexGuard aGuard; - FileControl* pControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pControl = GetAs< FileControl >(); if ( pControl ) { sal_uInt16 nPropType = GetPropertyId( PropertyName ); @@ -591,13 +591,13 @@ void SAL_CALL VCLXFileControl::setProperty( const OUString& PropertyName, const } } -void VCLXFileControl::SetWindow( vcl::Window* pWindow ) +void VCLXFileControl::SetWindow( const VclPtr< vcl::Window > &pWindow ) { - FileControl* pPrevFileControl = dynamic_cast<FileControl*>( GetWindow() ); + VclPtr< FileControl > pPrevFileControl = GetAsDynamic< FileControl >(); if ( pPrevFileControl ) pPrevFileControl->GetEdit().SetModifyHdl( Link() ); - FileControl* pNewFileControl = dynamic_cast<FileControl*>( pWindow ); + FileControl* pNewFileControl = dynamic_cast<FileControl*>( pWindow.get() ); if ( pNewFileControl ) pNewFileControl->GetEdit().SetModifyHdl( LINK( this, VCLXFileControl, ModifyHdl ) ); @@ -633,7 +633,7 @@ void VCLXFileControl::insertText( const ::com::sun::star::awt::Selection& rSel, { SolarMutexGuard aGuard; - FileControl* pFileControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pFileControl = GetAs< FileControl >(); if ( pFileControl ) { pFileControl->GetEdit().SetSelection( Selection( rSel.Min, rSel.Max ) ); @@ -657,7 +657,7 @@ OUString VCLXFileControl::getSelectedText() throw(::com::sun::star::uno::Runtime SolarMutexGuard aGuard; OUString aText; - FileControl* pFileControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pFileControl = GetAs< FileControl >(); if ( pFileControl) aText = pFileControl->GetEdit().GetSelected(); return aText; @@ -668,7 +668,7 @@ void VCLXFileControl::setSelection( const ::com::sun::star::awt::Selection& aSel { SolarMutexGuard aGuard; - FileControl* pFileControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pFileControl = GetAs< FileControl >(); if ( pFileControl ) pFileControl->GetEdit().SetSelection( Selection( aSelection.Min, aSelection.Max ) ); } @@ -678,7 +678,7 @@ void VCLXFileControl::setSelection( const ::com::sun::star::awt::Selection& aSel SolarMutexGuard aGuard; ::com::sun::star::awt::Selection aSel; - FileControl* pFileControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pFileControl = GetAs< FileControl >(); if ( pFileControl ) { aSel.Min = pFileControl->GetEdit().GetSelection().Min(); @@ -691,7 +691,7 @@ sal_Bool VCLXFileControl::isEditable() throw(::com::sun::star::uno::RuntimeExcep { SolarMutexGuard aGuard; - FileControl* pFileControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pFileControl = GetAs< FileControl >(); return ( pFileControl && !pFileControl->GetEdit().IsReadOnly() && pFileControl->GetEdit().IsEnabled() ) ? sal_True : sal_False; } @@ -699,7 +699,7 @@ void VCLXFileControl::setEditable( sal_Bool bEditable ) throw(::com::sun::star:: { SolarMutexGuard aGuard; - FileControl* pFileControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pFileControl = GetAs< FileControl >(); if ( pFileControl ) pFileControl->GetEdit().SetReadOnly( !bEditable ); } @@ -708,7 +708,7 @@ void VCLXFileControl::setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::un { SolarMutexGuard aGuard; - FileControl* pFileControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pFileControl = GetAs< FileControl >(); if ( pFileControl ) pFileControl->GetEdit().SetMaxTextLen( nLen ); } @@ -717,7 +717,7 @@ sal_Int16 VCLXFileControl::getMaxTextLen() throw(::com::sun::star::uno::RuntimeE { SolarMutexGuard aGuard; - FileControl* pFileControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pFileControl = GetAs< FileControl >(); return pFileControl ? pFileControl->GetEdit().GetMaxTextLen() : 0; } @@ -736,7 +736,7 @@ IMPL_LINK_NOARG(VCLXFileControl, ModifyHdl) SolarMutexGuard aGuard; ::com::sun::star::awt::Size aSz; - FileControl* pControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pControl = GetAs< FileControl >(); if ( pControl ) { Size aTmpSize = pControl->GetEdit().CalcMinimumSize(); @@ -758,7 +758,7 @@ IMPL_LINK_NOARG(VCLXFileControl, ModifyHdl) SolarMutexGuard aGuard; ::com::sun::star::awt::Size aSz =rNewSize; - FileControl* pControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pControl = GetAs< FileControl >(); if ( pControl ) { ::com::sun::star::awt::Size aMinSz = getMinimumSize(); @@ -773,7 +773,7 @@ IMPL_LINK_NOARG(VCLXFileControl, ModifyHdl) SolarMutexGuard aGuard; ::com::sun::star::awt::Size aSz; - FileControl* pControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pControl = GetAs< FileControl >(); if ( pControl ) { aSz = AWTSize(pControl->GetEdit().CalcSize( nCols )); @@ -788,7 +788,7 @@ void VCLXFileControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) nCols = 0; nLines = 1; - FileControl* pControl = static_cast<FileControl*>(GetWindow()); + VclPtr< FileControl > pControl = GetAs< FileControl >(); if ( pControl ) nCols = pControl->GetEdit().GetMaxVisChars(); } @@ -825,11 +825,11 @@ SVTXFormattedField::~SVTXFormattedField() } -void SVTXFormattedField::SetWindow( vcl::Window* _pWindow ) +void SVTXFormattedField::SetWindow( const VclPtr< vcl::Window > &_pWindow ) { VCLXSpinField::SetWindow(_pWindow); - if (GetFormattedField()) - GetFormattedField()->SetAutoColor(true); + if (GetAs< FormattedField >()) + GetAs< FormattedField >()->SetAutoColor(true); } @@ -837,7 +837,7 @@ void SVTXFormattedField::setProperty( const OUString& PropertyName, const ::com: { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) { sal_uInt16 nPropType = GetPropertyId( PropertyName ); @@ -964,7 +964,7 @@ void SVTXFormattedField::setProperty( const OUString& PropertyName, const ::com: ::com::sun::star::uno::Any aReturn; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) { sal_uInt16 nPropType = GetPropertyId( PropertyName ); @@ -1034,7 +1034,7 @@ void SVTXFormattedField::setProperty( const OUString& PropertyName, const ::com: { ::com::sun::star::uno::Any aReturn; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (!pField) return aReturn; @@ -1092,7 +1092,7 @@ void SVTXFormattedField::setProperty( const OUString& PropertyName, const ::com: void SVTXFormattedField::SetMinValue(const ::com::sun::star::uno::Any& rValue) { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (!pField) return; @@ -1121,7 +1121,7 @@ void SVTXFormattedField::SetMinValue(const ::com::sun::star::uno::Any& rValue) ::com::sun::star::uno::Any SVTXFormattedField::GetMinValue() { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (!pField || !pField->HasMinValue()) return ::com::sun::star::uno::Any(); @@ -1133,7 +1133,7 @@ void SVTXFormattedField::SetMinValue(const ::com::sun::star::uno::Any& rValue) void SVTXFormattedField::SetMaxValue(const ::com::sun::star::uno::Any& rValue) { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (!pField) return; @@ -1161,7 +1161,7 @@ void SVTXFormattedField::SetMaxValue(const ::com::sun::star::uno::Any& rValue) ::com::sun::star::uno::Any SVTXFormattedField::GetMaxValue() { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (!pField || !pField->HasMaxValue()) return ::com::sun::star::uno::Any(); @@ -1173,7 +1173,7 @@ void SVTXFormattedField::SetMaxValue(const ::com::sun::star::uno::Any& rValue) void SVTXFormattedField::SetDefaultValue(const ::com::sun::star::uno::Any& rValue) { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (!pField) return; @@ -1206,7 +1206,7 @@ void SVTXFormattedField::SetDefaultValue(const ::com::sun::star::uno::Any& rValu ::com::sun::star::uno::Any SVTXFormattedField::GetDefaultValue() { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (!pField || pField->IsEmptyFieldEnabled()) return ::com::sun::star::uno::Any(); @@ -1221,7 +1221,7 @@ void SVTXFormattedField::SetDefaultValue(const ::com::sun::star::uno::Any& rValu bool SVTXFormattedField::GetTreatAsNumber() { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (pField) return pField->TreatingAsNumber(); @@ -1231,7 +1231,7 @@ bool SVTXFormattedField::GetTreatAsNumber() void SVTXFormattedField::SetTreatAsNumber(bool bSet) { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (pField) pField->TreatAsNumber(bSet); } @@ -1239,7 +1239,7 @@ void SVTXFormattedField::SetTreatAsNumber(bool bSet) ::com::sun::star::uno::Any SVTXFormattedField::GetValue() { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (!pField) return ::com::sun::star::uno::Any(); @@ -1261,7 +1261,7 @@ void SVTXFormattedField::SetTreatAsNumber(bool bSet) void SVTXFormattedField::SetValue(const ::com::sun::star::uno::Any& rValue) { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (!pField) return; @@ -1297,7 +1297,7 @@ void SVTXFormattedField::SetValue(const ::com::sun::star::uno::Any& rValue) void SVTXFormattedField::setFormatsSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & xSupplier) { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); SvNumberFormatsSupplierObj* pNew = NULL; if (!xSupplier.is()) @@ -1339,14 +1339,14 @@ void SVTXFormattedField::setFormatsSupplier(const ::com::sun::star::uno::Referen sal_Int32 SVTXFormattedField::getFormatKey(void) const { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetFormatKey() : 0; } void SVTXFormattedField::setFormatKey(sal_Int32 nKey) { - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if (pField) { if (pField->GetFormatter()) @@ -1401,19 +1401,12 @@ void SVTXFormattedField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) // class SVTXRoadmap - using namespace svt; -::svt::ORoadmap* SVTXRoadmap::GetRoadmap() const -{ - return static_cast<svt::ORoadmap*>(GetWindow()); -} - SVTXRoadmap::SVTXRoadmap() : maItemListeners( *this ) { } - SVTXRoadmap::~SVTXRoadmap() { } @@ -1425,7 +1418,7 @@ void SVTXRoadmap::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) case VCLEVENT_ROADMAP_ITEMSELECTED: { SolarMutexGuard aGuard; - ::svt::ORoadmap* pField = GetRoadmap(); + ::svt::ORoadmap* pField = GetAs< svt::ORoadmap >(); if ( pField ) { sal_Int16 CurItemID = pField->GetCurrentRoadmapItemID(); @@ -1447,7 +1440,7 @@ void SVTXRoadmap::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) void SVTXRoadmap::propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - ::svt::ORoadmap* pField = GetRoadmap(); + ::svt::ORoadmap* pField = GetAs< svt::ORoadmap >(); if ( pField ) { ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRoadmapItem; @@ -1521,7 +1514,7 @@ RMItemData SVTXRoadmap::GetRMItemData( const ::com::sun::star::container::Contai void SVTXRoadmap::elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent )throw(::com::sun::star::uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - ::svt::ORoadmap* pField = GetRoadmap(); + ::svt::ORoadmap* pField = GetAs< svt::ORoadmap >(); if ( pField ) { RMItemData CurItemData = GetRMItemData( _rEvent ); @@ -1534,7 +1527,7 @@ void SVTXRoadmap::elementInserted( const ::com::sun::star::container::ContainerE void SVTXRoadmap::elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent )throw(::com::sun::star::uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - ::svt::ORoadmap* pField = GetRoadmap(); + ::svt::ORoadmap* pField = GetAs< svt::ORoadmap >(); if ( pField ) { sal_Int32 DelIndex = 0; @@ -1546,7 +1539,7 @@ void SVTXRoadmap::elementRemoved( const ::com::sun::star::container::ContainerEv void SVTXRoadmap::elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent )throw(::com::sun::star::uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - ::svt::ORoadmap* pField = GetRoadmap(); + ::svt::ORoadmap* pField = GetAs< svt::ORoadmap >(); if ( pField ) { RMItemData CurItemData = GetRMItemData( _rEvent ); @@ -1563,7 +1556,7 @@ void SVTXRoadmap::setProperty( const OUString& PropertyName, const ::com::sun::s { SolarMutexGuard aGuard; - ::svt::ORoadmap* pField = GetRoadmap(); + ::svt::ORoadmap* pField = GetAs< svt::ORoadmap >(); if ( pField ) { sal_uInt16 nPropType = GetPropertyId( PropertyName ); @@ -1620,7 +1613,7 @@ void SVTXRoadmap::setProperty( const OUString& PropertyName, const ::com::sun::s ::com::sun::star::uno::Any aReturn; - ::svt::ORoadmap* pField = GetRoadmap(); + ::svt::ORoadmap* pField = GetAs< svt::ORoadmap >(); if ( pField ) { sal_uInt16 nPropType = GetPropertyId( PropertyName ); @@ -1646,7 +1639,7 @@ void SVTXRoadmap::setProperty( const OUString& PropertyName, const ::com::sun::s void SVTXRoadmap::ImplSetNewImage() { OSL_PRECOND( GetWindow(), "SVTXRoadmap::ImplSetNewImage: window is required to be not-NULL!" ); - ::svt::ORoadmap* pButton = static_cast< ::svt::ORoadmap* >( GetWindow() ); + VclPtr< ::svt::ORoadmap > pButton = GetAs< ::svt::ORoadmap >(); pButton->SetRoadmapBitmap( GetImage().GetBitmapEx() ); } @@ -1692,7 +1685,7 @@ void SVTXNumericField::setValue( double Value ) throw(::com::sun::star::uno::Run { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetValue( Value ); } @@ -1701,7 +1694,7 @@ double SVTXNumericField::getValue() throw(::com::sun::star::uno::RuntimeExceptio { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetValue() : 0; } @@ -1709,7 +1702,7 @@ void SVTXNumericField::setMin( double Value ) throw(::com::sun::star::uno::Runti { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetMinValue( Value ); } @@ -1718,7 +1711,7 @@ double SVTXNumericField::getMin() throw(::com::sun::star::uno::RuntimeException, { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetMinValue() : 0; } @@ -1726,7 +1719,7 @@ void SVTXNumericField::setMax( double Value ) throw(::com::sun::star::uno::Runti { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetMaxValue( Value ); } @@ -1735,7 +1728,7 @@ double SVTXNumericField::getMax() throw(::com::sun::star::uno::RuntimeException, { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetMaxValue() : 0; } @@ -1743,7 +1736,7 @@ void SVTXNumericField::setFirst( double Value ) throw(::com::sun::star::uno::Run { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetSpinFirst( Value ); } @@ -1752,7 +1745,7 @@ double SVTXNumericField::getFirst() throw(::com::sun::star::uno::RuntimeExceptio { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetSpinFirst() : 0; } @@ -1760,7 +1753,7 @@ void SVTXNumericField::setLast( double Value ) throw(::com::sun::star::uno::Runt { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetSpinLast( Value ); } @@ -1769,7 +1762,7 @@ double SVTXNumericField::getLast() throw(::com::sun::star::uno::RuntimeException { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetSpinLast() : 0; } @@ -1777,7 +1770,7 @@ void SVTXNumericField::setSpinSize( double Value ) throw(::com::sun::star::uno:: { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetSpinSize( Value ); } @@ -1786,7 +1779,7 @@ double SVTXNumericField::getSpinSize() throw(::com::sun::star::uno::RuntimeExcep { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetSpinSize() : 0; } @@ -1794,7 +1787,7 @@ void SVTXNumericField::setDecimalDigits( sal_Int16 Value ) throw(::com::sun::sta { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetDecimalDigits( Value ); } @@ -1803,7 +1796,7 @@ sal_Int16 SVTXNumericField::getDecimalDigits() throw(::com::sun::star::uno::Runt { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetDecimalDigits() : 0; } @@ -1811,7 +1804,7 @@ void SVTXNumericField::setStrictFormat( sal_Bool bStrict ) throw(::com::sun::sta { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetStrictFormat( bStrict ); } @@ -1820,7 +1813,7 @@ sal_Bool SVTXNumericField::isStrictFormat() throw(::com::sun::star::uno::Runtime { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->IsStrictFormat() : sal_False; } @@ -1858,7 +1851,7 @@ void SVTXCurrencyField::setValue( double Value ) throw(::com::sun::star::uno::Ru { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetValue( Value ); } @@ -1867,7 +1860,7 @@ double SVTXCurrencyField::getValue() throw(::com::sun::star::uno::RuntimeExcepti { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetValue() : 0; } @@ -1875,7 +1868,7 @@ void SVTXCurrencyField::setMin( double Value ) throw(::com::sun::star::uno::Runt { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetMinValue( Value ); } @@ -1884,7 +1877,7 @@ double SVTXCurrencyField::getMin() throw(::com::sun::star::uno::RuntimeException { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetMinValue() : 0; } @@ -1892,7 +1885,7 @@ void SVTXCurrencyField::setMax( double Value ) throw(::com::sun::star::uno::Runt { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetMaxValue( Value ); } @@ -1901,7 +1894,7 @@ double SVTXCurrencyField::getMax() throw(::com::sun::star::uno::RuntimeException { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetMaxValue() : 0; } @@ -1909,7 +1902,7 @@ void SVTXCurrencyField::setFirst( double Value ) throw(::com::sun::star::uno::Ru { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetSpinFirst( Value ); } @@ -1918,7 +1911,7 @@ double SVTXCurrencyField::getFirst() throw(::com::sun::star::uno::RuntimeExcepti { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetSpinFirst() : 0; } @@ -1926,7 +1919,7 @@ void SVTXCurrencyField::setLast( double Value ) throw(::com::sun::star::uno::Run { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetSpinLast( Value ); } @@ -1935,7 +1928,7 @@ double SVTXCurrencyField::getLast() throw(::com::sun::star::uno::RuntimeExceptio { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetSpinLast() : 0; } @@ -1943,7 +1936,7 @@ void SVTXCurrencyField::setSpinSize( double Value ) throw(::com::sun::star::uno: { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetSpinSize( Value ); } @@ -1952,7 +1945,7 @@ double SVTXCurrencyField::getSpinSize() throw(::com::sun::star::uno::RuntimeExce { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetSpinSize() : 0; } @@ -1960,7 +1953,7 @@ void SVTXCurrencyField::setDecimalDigits( sal_Int16 Value ) throw(::com::sun::st { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetDecimalDigits( Value ); } @@ -1969,7 +1962,7 @@ sal_Int16 SVTXCurrencyField::getDecimalDigits() throw(::com::sun::star::uno::Run { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->GetDecimalDigits() : 0; } @@ -1977,7 +1970,7 @@ void SVTXCurrencyField::setStrictFormat( sal_Bool bStrict ) throw(::com::sun::st { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); if ( pField ) pField->SetStrictFormat( bStrict ); } @@ -1986,7 +1979,7 @@ sal_Bool SVTXCurrencyField::isStrictFormat() throw(::com::sun::star::uno::Runtim { SolarMutexGuard aGuard; - FormattedField* pField = GetFormattedField(); + FormattedField* pField = GetAs< FormattedField >(); return pField ? pField->IsStrictFormat() : sal_False; } @@ -1994,7 +1987,7 @@ void SVTXCurrencyField::setProperty( const OUString& PropertyName, const ::com:: { SolarMutexGuard aGuard; - DoubleCurrencyField* pField = static_cast<DoubleCurrencyField*>(GetFormattedField()); + VclPtr< DoubleCurrencyField > pField = GetAs< DoubleCurrencyField >(); if ( pField ) { sal_uInt16 nPropType = GetPropertyId( PropertyName ); @@ -2029,7 +2022,7 @@ void SVTXCurrencyField::setProperty( const OUString& PropertyName, const ::com:: ::com::sun::star::uno::Any aReturn; - DoubleCurrencyField* pField = static_cast<DoubleCurrencyField*>(GetFormattedField()); + VclPtr< DoubleCurrencyField > pField = GetAs< DoubleCurrencyField >(); if ( pField ) { sal_uInt16 nPropType = GetPropertyId( PropertyName ); @@ -2079,7 +2072,7 @@ VCLXProgressBar::~VCLXProgressBar() void VCLXProgressBar::ImplUpdateValue() { - ProgressBar* pProgressBar = static_cast<ProgressBar*>(GetWindow()); + VclPtr< ProgressBar > pProgressBar = GetAs< ProgressBar >(); if ( pProgressBar ) { sal_Int32 nVal; @@ -2210,7 +2203,7 @@ void VCLXProgressBar::setProperty( const OUString& PropertyName, const ::com::su { SolarMutexGuard aGuard; - ProgressBar* pProgressBar = static_cast<ProgressBar*>(GetWindow()); + VclPtr< ProgressBar > pProgressBar = GetAs< ProgressBar >(); if ( pProgressBar ) { sal_uInt16 nPropType = GetPropertyId( PropertyName ); @@ -2269,7 +2262,7 @@ void VCLXProgressBar::setProperty( const OUString& PropertyName, const ::com::su SolarMutexGuard aGuard; ::com::sun::star::uno::Any aProp; - ProgressBar* pProgressBar = static_cast<ProgressBar*>(GetWindow()); + VclPtr< ProgressBar > pProgressBar = GetAs< ProgressBar >(); if ( pProgressBar ) { sal_uInt16 nPropType = GetPropertyId( PropertyName ); @@ -2327,7 +2320,7 @@ void SAL_CALL SVTXDateField::setProperty( const OUString& PropertyName, const :: VCLXDateField::setProperty( PropertyName, Value ); // some properties need to be forwarded to the sub edit, too - Edit* pSubEdit = GetWindow() ? static_cast< Edit* >( GetWindow() )->GetSubEdit() : NULL; + VclPtr< Edit > pSubEdit = GetWindow() ? static_cast< Edit* >( GetWindow().get() )->GetSubEdit() : NULL; if ( !pSubEdit ) return; |