summaryrefslogtreecommitdiff
path: root/svx/source/fmcomp
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-17 15:43:45 +0200
committerNoel Grandin <noel@peralex.com>2014-10-20 13:33:57 +0200
commitefa7f1a549ebf2580d50f6f0bb96e294a5fce670 (patch)
tree7e8cccc2a6e0a5585c4c2eabc36400337f0bcc52 /svx/source/fmcomp
parentb0509439d9fa664be8f94b557d83ea3a2891c31f (diff)
loplugin: cstylecast
Change-Id: Idb6337bed1c32444f9644d54eba5240f09c13ef6
Diffstat (limited to 'svx/source/fmcomp')
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx16
-rw-r--r--svx/source/fmcomp/fmgridif.cxx60
-rw-r--r--svx/source/fmcomp/gridcell.cxx114
-rw-r--r--svx/source/fmcomp/gridctrl.cxx44
4 files changed, 117 insertions, 117 deletions
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index 68bebd6f563e..13860381ab04 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -145,7 +145,7 @@ sal_uInt16 FmGridHeader::GetModelColumnPos(sal_uInt16 nId) const
void FmGridHeader::notifyColumnSelect(sal_uInt16 nColumnId)
{
sal_uInt16 nPos = GetModelColumnPos(nColumnId);
- Reference< XIndexAccess > xColumns(((FmGridControl*)GetParent())->GetPeer()->getColumns(), UNO_QUERY);
+ Reference< XIndexAccess > xColumns(static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns(), UNO_QUERY);
if ( nPos < xColumns->getCount() )
{
Reference< XSelectionSupplier > xSelSupplier(xColumns, UNO_QUERY);
@@ -761,7 +761,7 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe
if (eState >= SfxItemState::DEFAULT && pItem )
{
- bChecked = pItem->ISA(SfxBoolItem) && ((SfxBoolItem*)pItem)->GetValue();
+ bChecked = pItem->ISA(SfxBoolItem) && static_cast<SfxBoolItem*>(pItem)->GetValue();
rMenu.CheckItem(SID_FM_SHOW_PROPERTY_BROWSER,bChecked);
}
delete pItem;
@@ -1138,7 +1138,7 @@ void FmGridControl::DeleteSelectedRows()
if (xConfirm.is())
{
::com::sun::star::sdb::RowChangeEvent aEvent;
- aEvent.Source = (Reference< XInterface > )(*getDataSource());
+ aEvent.Source = Reference< XInterface >(*getDataSource());
aEvent.Rows = nSelectedRows;
aEvent.Action = ::com::sun::star::sdb::RowChangeAction::DELETE;
if (!xConfirm->confirmDelete(aEvent))
@@ -1151,7 +1151,7 @@ void FmGridControl::DeleteSelectedRows()
{
BeginCursorAction();
CursorWrapper* pCursor = getDataSource();
- Reference< XResultSetUpdate > xUpdateCursor((Reference< XInterface >)*pCursor, UNO_QUERY);
+ Reference< XResultSetUpdate > xUpdateCursor(Reference< XInterface >(*pCursor), UNO_QUERY);
try
{
pCursor->beforeFirst();
@@ -1174,7 +1174,7 @@ void FmGridControl::DeleteSelectedRows()
}
else
{
- Reference< ::com::sun::star::sdbcx::XDeleteRows > xDeleteThem((Reference< XInterface >)*getDataSource(), UNO_QUERY);
+ Reference< ::com::sun::star::sdbcx::XDeleteRows > xDeleteThem(Reference< XInterface >(*getDataSource()), UNO_QUERY);
// collect the bookmarks of the selected rows
Sequence < Any> aBookmarks = getSelectionBookmarks();
@@ -1267,13 +1267,13 @@ void FmGridControl::DeleteSelectedRows()
// no valid bookmark so move to the insert row
else
{
- Reference< XResultSetUpdate > xUpdateCursor((Reference< XInterface >)*m_pDataCursor, UNO_QUERY);
+ Reference< XResultSetUpdate > xUpdateCursor(Reference< XInterface >(*m_pDataCursor), UNO_QUERY);
xUpdateCursor->moveToInsertRow();
}
}
else
{
- Reference< ::com::sun::star::beans::XPropertySet > xSet((Reference< XInterface >)*m_pDataCursor, UNO_QUERY);
+ Reference< ::com::sun::star::beans::XPropertySet > xSet(Reference< XInterface >(*m_pDataCursor), UNO_QUERY);
sal_Int32 nRecordCount(0);
xSet->getPropertyValue(FM_PROP_ROWCOUNT) >>= nRecordCount;
@@ -1283,7 +1283,7 @@ void FmGridControl::DeleteSelectedRows()
// there are no rows left and we have an insert row
if (!nRecordCount && GetEmptyRow().Is())
{
- Reference< XResultSetUpdate > xUpdateCursor((Reference< XInterface >)*m_pDataCursor, UNO_QUERY);
+ Reference< XResultSetUpdate > xUpdateCursor(Reference< XInterface >(*m_pDataCursor), UNO_QUERY);
xUpdateCursor->moveToInsertRow();
}
else if (nRecordCount)
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 24a3312bf0cc..c6c1c504bb50 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -1250,7 +1250,7 @@ Sequence< sal_Bool > SAL_CALL FmXGridPeer::queryFieldDataType( const Type& xType
Reference< XIndexContainer > xColumns = getColumns();
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
sal_Int32 nColumns = pGrid->GetViewColCount();
DbGridColumns aColumns = pGrid->GetColumns();
@@ -1304,7 +1304,7 @@ Sequence< sal_Bool > SAL_CALL FmXGridPeer::queryFieldDataType( const Type& xType
Sequence< Any > SAL_CALL FmXGridPeer::queryFieldData( sal_Int32 nRow, const Type& xType ) throw(RuntimeException, std::exception)
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
DBG_ASSERT(pGrid && pGrid->IsOpen(), "FmXGridPeer::queryFieldData : have no valid grid window !");
if (!pGrid || !pGrid->IsOpen())
return Sequence< Any>();
@@ -1398,7 +1398,7 @@ void FmXGridPeer::propertyChange(const PropertyChangeEvent& evt) throw( RuntimeE
// this should not be (deadlock) critical, as by definition, every component should release
// any own mutexes before notifying
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
if (!pGrid)
return;
@@ -1518,7 +1518,7 @@ void FmXGridPeer::removeUpdateListener(const Reference< XUpdateListener >& l) th
sal_Bool FmXGridPeer::commit() throw( RuntimeException, std::exception )
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
if (!m_xCursor.is() || !pGrid)
return sal_True;
@@ -1541,7 +1541,7 @@ sal_Bool FmXGridPeer::commit() throw( RuntimeException, std::exception )
void FmXGridPeer::cursorMoved(const EventObject& _rEvent) throw( RuntimeException, std::exception )
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
// we are not interested in move to insert row only in the resetted event
// which is fired after positioning an the insert row
if (pGrid && pGrid->IsOpen() && !::comphelper::getBOOL(Reference< XPropertySet > (_rEvent.Source, UNO_QUERY)->getPropertyValue(FM_PROP_ISNEW)))
@@ -1551,7 +1551,7 @@ void FmXGridPeer::cursorMoved(const EventObject& _rEvent) throw( RuntimeExceptio
void FmXGridPeer::rowChanged(const EventObject& _rEvent) throw( RuntimeException, std::exception )
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
if (pGrid && pGrid->IsOpen())
{
if (m_xCursor->rowUpdated() && !pGrid->IsCurrentAppending())
@@ -1713,7 +1713,7 @@ void FmXGridPeer::setDesignMode(sal_Bool bOn) throw( RuntimeException, std::exce
{
vcl::Window* pWin = GetWindow();
if (pWin)
- ((FmGridControl*) pWin)->SetDesignMode(bOn);
+ static_cast<FmGridControl*>(pWin)->SetDesignMode(bOn);
}
if (bOn)
@@ -1727,7 +1727,7 @@ sal_Bool FmXGridPeer::isDesignMode() throw( RuntimeException, std::exception )
{
vcl::Window* pWin = GetWindow();
if (pWin)
- return ((FmGridControl*) pWin)->IsDesignMode();
+ return static_cast<FmGridControl*>(pWin)->IsDesignMode();
else
return sal_False;
}
@@ -1737,7 +1737,7 @@ void FmXGridPeer::elementInserted(const ContainerEvent& evt) throw( RuntimeExcep
{
SolarMutexGuard aGuard;
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
// Handle Column beruecksichtigen
if (!pGrid || !m_xColumns.is() || pGrid->IsInColumnMove() || m_xColumns->getCount() == ((sal_Int32)pGrid->GetModelColCount()))
return;
@@ -1770,7 +1770,7 @@ void FmXGridPeer::elementReplaced(const ContainerEvent& evt) throw( RuntimeExcep
{
SolarMutexGuard aGuard;
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
// Handle Column beruecksichtigen
if (!pGrid || !m_xColumns.is() || pGrid->IsInColumnMove())
@@ -1804,7 +1804,7 @@ void FmXGridPeer::elementReplaced(const ContainerEvent& evt) throw( RuntimeExcep
Reference< XColumnsSupplier > xSuppColumns;
CursorWrapper* pGridDataSource = pGrid->getDataSource();
if ( pGridDataSource )
- xSuppColumns.set((Reference< XInterface >)( *pGridDataSource ), css::uno::UNO_QUERY);
+ xSuppColumns.set(Reference< XInterface >( *pGridDataSource ), css::uno::UNO_QUERY);
Reference< XNameAccess > xColumnsByName;
if ( xSuppColumns.is() )
xColumnsByName = xSuppColumns->getColumns();
@@ -1825,7 +1825,7 @@ void FmXGridPeer::elementRemoved(const ContainerEvent& evt) throw( RuntimeExcept
{
SolarMutexGuard aGuard;
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
// Handle Column beruecksichtigen
if (!pGrid || !m_xColumns.is() || pGrid->IsInColumnMove() || m_xColumns->getCount() == ((sal_Int32)pGrid->GetModelColCount()))
@@ -1842,7 +1842,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t
{
SolarMutexGuard aGuard;
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
bool bVoid = !Value.hasValue();
@@ -2056,7 +2056,7 @@ Any FmXGridPeer::getProperty( const OUString& _rPropertyName ) throw( RuntimeExc
Any aProp;
if (GetWindow())
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
vcl::Window* pDataWindow = &pGrid->GetDataWindow();
if ( _rPropertyName == FM_PROP_NAME )
@@ -2192,7 +2192,7 @@ void FmXGridPeer::stopCursorListening()
void FmXGridPeer::updateGrid(const Reference< XRowSet >& _rxCursor)
{
- FmGridControl* pGrid = (FmGridControl*)GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
if (pGrid)
pGrid->setDataSource(_rxCursor);
}
@@ -2206,7 +2206,7 @@ Reference< XRowSet > FmXGridPeer::getRowSet() throw( RuntimeException, std::exc
void FmXGridPeer::setRowSet(const Reference< XRowSet >& _rDatabaseCursor) throw( RuntimeException, std::exception )
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
if (!pGrid || !m_xColumns.is() || !m_xColumns->getCount())
return;
// unregister all listeners
@@ -2255,14 +2255,14 @@ void SAL_CALL FmXGridPeer::removeGridControlListener( const Reference< XGridCont
sal_Int16 FmXGridPeer::getCurrentColumnPosition() throw( RuntimeException, std::exception )
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
return pGrid ? pGrid->GetViewColumnPos(pGrid->GetCurColumnId()) : -1;
}
void FmXGridPeer::setCurrentColumnPosition(sal_Int16 nPos) throw( RuntimeException, std::exception )
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
if (pGrid)
pGrid->GoToColumnId(pGrid->GetColumnIdFromViewPos(nPos));
}
@@ -2272,7 +2272,7 @@ void FmXGridPeer::selectionChanged(const EventObject& evt) throw( RuntimeExcepti
{
SolarMutexGuard aGuard;
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
if (pGrid)
{
Reference< ::com::sun::star::view::XSelectionSupplier > xSelSupplier(evt.Source, UNO_QUERY);
@@ -2340,7 +2340,7 @@ Reference< XEnumeration > FmXGridPeer::createEnumeration() throw( RuntimeExcept
sal_Int32 FmXGridPeer::getCount() throw( RuntimeException, std::exception )
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
if (pGrid)
return pGrid->GetViewColCount();
else
@@ -2350,7 +2350,7 @@ sal_Int32 FmXGridPeer::getCount() throw( RuntimeException, std::exception )
Any FmXGridPeer::getByIndex(sal_Int32 _nIndex) throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
if (_nIndex < 0 ||
_nIndex >= getCount() || !pGrid)
throw IndexOutOfBoundsException();
@@ -2383,7 +2383,7 @@ void FmXGridPeer::setMode(const OUString& Mode) throw( NoSupportException, Runti
m_aMode = Mode;
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
if ( Mode == "FilterMode" )
pGrid->SetFilterMode(true);
else
@@ -2429,7 +2429,7 @@ sal_Bool FmXGridPeer::supportsMode(const OUString& Mode) throw( RuntimeException
void FmXGridPeer::columnVisible(DbGridColumn* pColumn)
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
sal_Int32 _nIndex = pGrid->GetModelColumnPos(pColumn->GetId());
Reference< ::com::sun::star::awt::XControl > xControl(pColumn->GetCell());
@@ -2444,7 +2444,7 @@ void FmXGridPeer::columnVisible(DbGridColumn* pColumn)
void FmXGridPeer::columnHidden(DbGridColumn* pColumn)
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
sal_Int32 _nIndex = pGrid->GetModelColumnPos(pColumn->GetId());
Reference< ::com::sun::star::awt::XControl > xControl(pColumn->GetCell());
@@ -2459,7 +2459,7 @@ void FmXGridPeer::columnHidden(DbGridColumn* pColumn)
void FmXGridPeer::draw( sal_Int32 x, sal_Int32 y ) throw( RuntimeException, std::exception )
{
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
sal_Int32 nOldFlags = pGrid->GetBrowserFlags();
pGrid->SetBrowserFlags(nOldFlags | EBBF_NOROWPICTURE);
@@ -2599,7 +2599,7 @@ void FmXGridPeer::statusChanged(const ::com::sun::star::frame::FeatureStateEvent
{
DBG_ASSERT(m_pDispatchers[i] == Event.Source, "FmXGridPeer::statusChanged : the event source is a little bit suspect !");
m_pStateCache[i] = Event.IsEnabled;
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
if (*pSlots != SID_FM_RECORD_UNDO)
pGrid->GetNavigationBar().InvalidateState(*pSlots);
break;
@@ -2657,7 +2657,7 @@ void FmXGridPeer::resetted(const EventObject& rEvent) throw( RuntimeException, s
{
if (m_xColumns == rEvent.Source)
{ // my model was reset -> refresh the grid content
- FmGridControl* pGrid = (FmGridControl*)GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
if (!pGrid)
return;
SolarMutexGuard aGuard;
@@ -2667,7 +2667,7 @@ void FmXGridPeer::resetted(const EventObject& rEvent) throw( RuntimeException, s
else if (m_xCursor == rEvent.Source)
{
SolarMutexGuard aGuard;
- FmGridControl* pGrid = (FmGridControl*) GetWindow();
+ FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
if (pGrid && pGrid->IsOpen())
pGrid->positioned(rEvent);
}
@@ -2829,7 +2829,7 @@ IMPL_LINK(FmXGridPeer, OnQueryGridSlotState, void*, pSlot)
if (!m_pStateCache)
return -1; // unspecified
- sal_uInt16 nSlot = (sal_uInt16)(sal_uIntPtr)pSlot;
+ sal_uInt16 nSlot = (sal_uInt16)reinterpret_cast<sal_uIntPtr>(pSlot);
// search the given slot with our supported sequence
Sequence<sal_uInt16>& aSupported = getSupportedGridSlots();
@@ -2862,7 +2862,7 @@ IMPL_LINK(FmXGridPeer, OnExecuteGridSlot, void*, pSlot)
DBG_ASSERT(aSlots.getLength() == aUrls.getLength(), "FmXGridPeer::OnExecuteGridSlot : inconstent data returned by getSupportedURLs/getSupportedGridSlots !");
- sal_uInt16 nSlot = (sal_uInt16)(sal_uIntPtr)pSlot;
+ sal_uInt16 nSlot = (sal_uInt16)reinterpret_cast<sal_uIntPtr>(pSlot);
for (sal_uInt16 i=0; i<aSlots.getLength(); ++i, ++pUrls, ++pSlots)
{
if (*pSlots == nSlot)
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 83c39b82a2b7..5dff48fe71b2 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -208,7 +208,7 @@ void DbGridColumn::CreateControl(sal_Int32 _nFieldPos, const Reference< ::com::s
}
Reference< XRowSet > xCur;
if (m_rParent.getDataSource())
- xCur = Reference< XRowSet > ((Reference< XInterface >)*m_rParent.getDataSource(), UNO_QUERY);
+ xCur = Reference< XRowSet > (Reference< XInterface >(*m_rParent.getDataSource()), UNO_QUERY);
// TODO : the cursor wrapper should use an XRowSet interface, too
pCellControl->Init( m_rParent.GetDataWindow(), xCur );
@@ -1348,7 +1348,7 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
// einen Standard-Formatter ...
if (pFormatterUsed == NULL)
{
- pFormatterUsed = ((FormattedField*)m_pWindow)->StandardFormatter();
+ pFormatterUsed = static_cast<FormattedField*>(m_pWindow)->StandardFormatter();
DBG_ASSERT(pFormatterUsed != NULL, "DbFormattedField::Init : no standard formatter given by the numeric field !");
}
// ... und einen Standard-Key
@@ -1357,14 +1357,14 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
m_nKeyType = comphelper::getNumberFormatType(m_xSupplier->getNumberFormats(), nFormatKey);
- ((FormattedField*)m_pWindow)->SetFormatter(pFormatterUsed);
- ((FormattedField*)m_pPainter)->SetFormatter(pFormatterUsed);
+ static_cast<FormattedField*>(m_pWindow)->SetFormatter(pFormatterUsed);
+ static_cast<FormattedField*>(m_pPainter)->SetFormatter(pFormatterUsed);
- ((FormattedField*)m_pWindow)->SetFormatKey(nFormatKey);
- ((FormattedField*)m_pPainter)->SetFormatKey(nFormatKey);
+ static_cast<FormattedField*>(m_pWindow)->SetFormatKey(nFormatKey);
+ static_cast<FormattedField*>(m_pPainter)->SetFormatKey(nFormatKey);
- ((FormattedField*)m_pWindow)->TreatAsNumber(m_rColumn.IsNumeric());
- ((FormattedField*)m_pPainter)->TreatAsNumber(m_rColumn.IsNumeric());
+ static_cast<FormattedField*>(m_pWindow)->TreatAsNumber(m_rColumn.IsNumeric());
+ static_cast<FormattedField*>(m_pPainter)->TreatAsNumber(m_rColumn.IsNumeric());
// Min- und Max-Werte
if (m_rColumn.IsNumeric())
@@ -1377,15 +1377,15 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
{
DBG_ASSERT(aMin.getValueType().getTypeClass() == TypeClass_DOUBLE, "DbFormattedField::Init : the model has an invalid min value !");
double dMin = ::comphelper::getDouble(aMin);
- ((FormattedField*)m_pWindow)->SetMinValue(dMin);
- ((FormattedField*)m_pPainter)->SetMinValue(dMin);
+ static_cast<FormattedField*>(m_pWindow)->SetMinValue(dMin);
+ static_cast<FormattedField*>(m_pPainter)->SetMinValue(dMin);
bClearMin = false;
}
}
if (bClearMin)
{
- ((FormattedField*)m_pWindow)->ClearMinValue();
- ((FormattedField*)m_pPainter)->ClearMinValue();
+ static_cast<FormattedField*>(m_pWindow)->ClearMinValue();
+ static_cast<FormattedField*>(m_pPainter)->ClearMinValue();
}
bool bClearMax = true;
if (::comphelper::hasProperty(FM_PROP_EFFECTIVE_MAX, xUnoModel))
@@ -1395,15 +1395,15 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
{
DBG_ASSERT(aMin.getValueType().getTypeClass() == TypeClass_DOUBLE, "DbFormattedField::Init : the model has an invalid max value !");
double dMin = ::comphelper::getDouble(aMin);
- ((FormattedField*)m_pWindow)->SetMaxValue(dMin);
- ((FormattedField*)m_pPainter)->SetMaxValue(dMin);
+ static_cast<FormattedField*>(m_pWindow)->SetMaxValue(dMin);
+ static_cast<FormattedField*>(m_pPainter)->SetMaxValue(dMin);
bClearMax = false;
}
}
if (bClearMax)
{
- ((FormattedField*)m_pWindow)->ClearMaxValue();
- ((FormattedField*)m_pPainter)->ClearMaxValue();
+ static_cast<FormattedField*>(m_pWindow)->ClearMaxValue();
+ static_cast<FormattedField*>(m_pPainter)->ClearMaxValue();
}
}
@@ -1416,16 +1416,16 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
case TypeClass_DOUBLE:
if (m_rColumn.IsNumeric())
{
- ((FormattedField*)m_pWindow)->SetDefaultValue(::comphelper::getDouble(aDefault));
- ((FormattedField*)m_pPainter)->SetDefaultValue(::comphelper::getDouble(aDefault));
+ static_cast<FormattedField*>(m_pWindow)->SetDefaultValue(::comphelper::getDouble(aDefault));
+ static_cast<FormattedField*>(m_pPainter)->SetDefaultValue(::comphelper::getDouble(aDefault));
}
else
{
OUString sConverted;
Color* pDummy;
pFormatterUsed->GetOutputString(::comphelper::getDouble(aDefault), 0, sConverted, &pDummy);
- ((FormattedField*)m_pWindow)->SetDefaultText(sConverted);
- ((FormattedField*)m_pPainter)->SetDefaultText(sConverted);
+ static_cast<FormattedField*>(m_pWindow)->SetDefaultText(sConverted);
+ static_cast<FormattedField*>(m_pPainter)->SetDefaultText(sConverted);
}
break;
case TypeClass_STRING:
@@ -1437,14 +1437,14 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
sal_uInt32 nTestFormat(0);
if (pFormatterUsed->IsNumberFormat(sDefault, nTestFormat, dVal))
{
- ((FormattedField*)m_pWindow)->SetDefaultValue(dVal);
- ((FormattedField*)m_pPainter)->SetDefaultValue(dVal);
+ static_cast<FormattedField*>(m_pWindow)->SetDefaultValue(dVal);
+ static_cast<FormattedField*>(m_pPainter)->SetDefaultValue(dVal);
}
}
else
{
- ((FormattedField*)m_pWindow)->SetDefaultText(sDefault);
- ((FormattedField*)m_pPainter)->SetDefaultText(sDefault);
+ static_cast<FormattedField*>(m_pWindow)->SetDefaultText(sDefault);
+ static_cast<FormattedField*>(m_pPainter)->SetDefaultText(sDefault);
}
}
break;
@@ -1506,7 +1506,7 @@ OUString DbFormattedField::GetFormatText(const Reference< ::com::sun::star::sdb:
double dValue = getValue( _rxField, m_rColumn.GetParent().getNullDate() );
if (_rxField->wasNull())
return aText;
- ((FormattedField*)m_pPainter)->SetValue(dValue);
+ static_cast<FormattedField*>(m_pPainter)->SetValue(dValue);
}
else
{
@@ -1515,7 +1515,7 @@ OUString DbFormattedField::GetFormatText(const Reference< ::com::sun::star::sdb:
aText = _rxField->getString();
if (_rxField->wasNull())
return aText;
- ((FormattedField*)m_pPainter)->SetTextFormatted(aText);
+ static_cast<FormattedField*>(m_pPainter)->SetTextFormatted(aText);
}
}
catch( const Exception& )
@@ -1525,7 +1525,7 @@ OUString DbFormattedField::GetFormatText(const Reference< ::com::sun::star::sdb:
aText = m_pPainter->GetText();
if (ppColor != NULL)
- *ppColor = ((FormattedField*)m_pPainter)->GetLastOutputColor();
+ *ppColor = static_cast<FormattedField*>(m_pPainter)->GetLastOutputColor();
return aText;
}
@@ -1595,7 +1595,7 @@ void DbFormattedField::updateFromModel( Reference< XPropertySet > _rxModel )
bool DbFormattedField::commitControl()
{
Any aNewVal;
- FormattedField& rField = *(FormattedField*)m_pWindow;
+ FormattedField& rField = *static_cast<FormattedField*>(m_pWindow);
DBG_ASSERT(&rField == m_pWindow, "DbFormattedField::commitControl : can't work with a window other than my own !");
if (m_rColumn.IsNumeric())
{
@@ -1670,7 +1670,7 @@ void DbCheckBox::Init( vcl::Window& rParent, const Reference< XRowSet >& xCursor
CellControllerRef DbCheckBox::CreateController() const
{
- return new CheckBoxCellController((CheckBoxControl*)m_pWindow);
+ return new CheckBoxCellController(static_cast<CheckBoxControl*>(m_pWindow));
}
static void lcl_setCheckBoxState( const Reference< ::com::sun::star::sdb::XColumn >& _rxField,
@@ -1918,7 +1918,7 @@ void DbNumericField::implAdjustGenericFieldSetting( const Reference< XPropertySe
Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier;
Reference< XRowSet > xForm;
if ( m_rColumn.GetParent().getDataSource() )
- xForm = Reference< XRowSet >( ( Reference< XInterface > )*m_rColumn.GetParent().getDataSource(), UNO_QUERY );
+ xForm = Reference< XRowSet >( Reference< XInterface >(*m_rColumn.GetParent().getDataSource()), UNO_QUERY );
if ( xForm.is() )
xSupplier = getNumberFormats( getConnection( xForm ), true );
SvNumberFormatter* pFormatterUsed = NULL;
@@ -2009,7 +2009,7 @@ bool DbNumericField::commitControl()
if (!aText.isEmpty()) // not empty
{
- double fValue = ((DoubleNumericField*)m_pWindow)->GetValue();
+ double fValue = static_cast<DoubleNumericField*>(m_pWindow)->GetValue();
aVal <<= (double)fValue;
}
m_rColumn.getModel()->setPropertyValue(FM_PROP_VALUE, aVal);
@@ -2157,7 +2157,7 @@ bool DbCurrencyField::commitControl()
Any aVal;
if (!aText.isEmpty()) // not empty
{
- double fValue = ((LongCurrencyField*)m_pWindow)->GetValue();
+ double fValue = static_cast<LongCurrencyField*>(m_pWindow)->GetValue();
if (m_nScale)
{
fValue /= ::rtl::math::pow10Exp(1.0, m_nScale);
@@ -2431,7 +2431,7 @@ void DbComboBox::_propertyChanged( const PropertyChangeEvent& _rEvent ) throw( R
void DbComboBox::SetList(const Any& rItems)
{
- ComboBoxControl* pField = (ComboBoxControl*)m_pWindow;
+ ComboBoxControl* pField = static_cast<ComboBoxControl*>(m_pWindow);
pField->Clear();
::comphelper::StringSequence aTest;
@@ -2488,7 +2488,7 @@ void DbComboBox::Init( vcl::Window& rParent, const Reference< XRowSet >& xCursor
CellControllerRef DbComboBox::CreateController() const
{
- return new ComboBoxCellController((ComboBoxControl*)m_pWindow);
+ return new ComboBoxCellController(static_cast<ComboBoxControl*>(m_pWindow));
}
@@ -2560,7 +2560,7 @@ void DbListBox::_propertyChanged( const ::com::sun::star::beans::PropertyChangeE
void DbListBox::SetList(const Any& rItems)
{
- ListBoxControl* pField = (ListBoxControl*)m_pWindow;
+ ListBoxControl* pField = static_cast<ListBoxControl*>(m_pWindow);
pField->Clear();
m_bBound = false;
@@ -2614,7 +2614,7 @@ void DbListBox::implAdjustGenericFieldSetting( const Reference< XPropertySet >&
CellControllerRef DbListBox::CreateController() const
{
- return new ListBoxCellController((ListBoxControl*)m_pWindow);
+ return new ListBoxCellController(static_cast<ListBoxControl*>(m_pWindow));
}
@@ -2704,7 +2704,7 @@ DbFilterField::DbFilterField(const Reference< XComponentContext >& rxContext,DbG
DbFilterField::~DbFilterField()
{
if (m_nControlClass == ::com::sun::star::form::FormComponentType::CHECKBOX)
- ((CheckBoxControl*)m_pWindow)->SetClickHdl( Link() );
+ static_cast<CheckBoxControl*>(m_pWindow)->SetClickHdl( Link() );
}
@@ -2736,13 +2736,13 @@ void DbFilterField::SetList(const Any& rItems, bool bComboBox)
{
if (bComboBox)
{
- ComboBox* pField = (ComboBox*)m_pWindow;
+ ComboBox* pField = static_cast<ComboBox*>(m_pWindow);
for (sal_Int32 i = 0; i < nItems; ++i, ++pStrings )
pField->InsertEntry(*pStrings, LISTBOX_APPEND);
}
else
{
- ListBox* pField = (ListBox*)m_pWindow;
+ ListBox* pField = static_cast<ListBox*>(m_pWindow);
for (sal_Int32 i = 0; i < nItems; ++i, ++pStrings )
pField->InsertEntry(*pStrings, LISTBOX_APPEND);
@@ -2760,7 +2760,7 @@ void DbFilterField::CreateControl(vcl::Window* pParent, const Reference< ::com::
case ::com::sun::star::form::FormComponentType::CHECKBOX:
m_pWindow = new CheckBoxControl(pParent);
m_pWindow->SetPaintTransparent( true );
- ((CheckBoxControl*)m_pWindow)->SetClickHdl( LINK( this, DbFilterField, OnClick ) );
+ static_cast<CheckBoxControl*>(m_pWindow)->SetClickHdl( LINK( this, DbFilterField, OnClick ) );
m_pPainter = new CheckBoxControl(pParent);
m_pPainter->SetPaintTransparent( true );
@@ -2790,10 +2790,10 @@ void DbFilterField::CreateControl(vcl::Window* pParent, const Reference< ::com::
sal_Int16 nLines = ::comphelper::getINT16(xModel->getPropertyValue(FM_PROP_LINECOUNT));
Any aItems = xModel->getPropertyValue(FM_PROP_STRINGITEMLIST);
SetList(aItems, m_nControlClass == ::com::sun::star::form::FormComponentType::COMBOBOX);
- ((ComboBox*)m_pWindow)->SetDropDownLineCount(nLines);
+ static_cast<ComboBox*>(m_pWindow)->SetDropDownLineCount(nLines);
}
else
- ((ComboBox*)m_pWindow)->SetDropDownLineCount(5);
+ static_cast<ComboBox*>(m_pWindow)->SetDropDownLineCount(5);
} break;
default:
@@ -2855,19 +2855,19 @@ CellControllerRef DbFilterField::CreateController() const
switch (m_nControlClass)
{
case ::com::sun::star::form::FormComponentType::CHECKBOX:
- xController = new CheckBoxCellController((CheckBoxControl*)m_pWindow);
+ xController = new CheckBoxCellController(static_cast<CheckBoxControl*>(m_pWindow));
break;
case ::com::sun::star::form::FormComponentType::LISTBOX:
- xController = new ListBoxCellController((ListBoxControl*)m_pWindow);
+ xController = new ListBoxCellController(static_cast<ListBoxControl*>(m_pWindow));
break;
case ::com::sun::star::form::FormComponentType::COMBOBOX:
- xController = new ComboBoxCellController((ComboBoxControl*)m_pWindow);
+ xController = new ComboBoxCellController(static_cast<ComboBoxControl*>(m_pWindow));
break;
default:
if (m_bFilterList)
- xController = new ComboBoxCellController((ComboBoxControl*)m_pWindow);
+ xController = new ComboBoxCellController(static_cast<ComboBoxControl*>(m_pWindow));
else
- xController = new EditCellController((Edit*)m_pWindow);
+ xController = new EditCellController(static_cast<Edit*>(m_pWindow));
}
return xController;
}
@@ -2927,7 +2927,7 @@ bool DbFilterField::commitControl()
::com::sun::star::lang::Locale aAppLocale = Application::GetSettings().GetUILanguageTag().getLocale();
Reference< XRowSet > xDataSourceRowSet(
- (Reference< XInterface >)*m_rColumn.GetParent().getDataSource(), UNO_QUERY);
+ Reference< XInterface >(*m_rColumn.GetParent().getDataSource()), UNO_QUERY);
Reference< XConnection > xConnection(getConnection(xDataSourceRowSet));
xParseNode->parseNodeToPredicateStr(aPreparedText,
@@ -2976,8 +2976,8 @@ void DbFilterField::SetText(const OUString& rText)
else
eState = TRISTATE_INDET;
- ((CheckBoxControl*)m_pWindow)->GetBox().SetState(eState);
- ((CheckBoxControl*)m_pPainter)->GetBox().SetState(eState);
+ static_cast<CheckBoxControl*>(m_pWindow)->GetBox().SetState(eState);
+ static_cast<CheckBoxControl*>(m_pPainter)->GetBox().SetState(eState);
} break;
case ::com::sun::star::form::FormComponentType::LISTBOX:
{
@@ -3108,7 +3108,7 @@ void DbFilterField::Update()
// filling the entries for the combobox
for (::std::vector< OUString >::const_iterator iter = aStringList.begin();
iter != aStringList.end(); ++iter)
- ((ComboBox*)m_pWindow)->InsertEntry(*iter, LISTBOX_APPEND);
+ static_cast<ComboBox*>(m_pWindow)->InsertEntry(*iter, LISTBOX_APPEND);
}
}
}
@@ -3128,7 +3128,7 @@ void DbFilterField::UpdateFromField(const Reference< XColumn >& /*_rxField*/, co
IMPL_LINK_NOARG(DbFilterField, OnClick)
{
- TriState eState = ((CheckBoxControl*)m_pWindow)->GetBox().GetState();
+ TriState eState = static_cast<CheckBoxControl*>(m_pWindow)->GetBox().GetState();
OUString aText;
switch (eState)
@@ -4348,7 +4348,7 @@ IMPL_LINK_NOARG(FmXListBoxCell, OnDoubleClick)
aEvent.ActionCommand = m_pBox->GetSelectEntry();
while( aIt.hasMoreElements() )
- ((::com::sun::star::awt::XActionListener *)aIt.next())->actionPerformed( aEvent );
+ static_cast< ::com::sun::star::awt::XActionListener *>(aIt.next())->actionPerformed( aEvent );
}
return 1;
}
@@ -4601,7 +4601,7 @@ void FmXFilterCell::disposing()
::com::sun::star::lang::EventObject aEvt(*this);
m_aTextListeners.disposeAndClear(aEvt);
- ((DbFilterField*)m_pCellControl)->SetCommitHdl(Link());
+ static_cast<DbFilterField*>(m_pCellControl)->SetCommitHdl(Link());
FmXGridCell::disposing();
}
@@ -4646,7 +4646,7 @@ void SAL_CALL FmXFilterCell::removeTextListener(const Reference< ::com::sun::sta
void SAL_CALL FmXFilterCell::setText( const OUString& aText ) throw( RuntimeException, std::exception )
{
::osl::MutexGuard aGuard( m_aMutex );
- ((DbFilterField*)m_pCellControl)->SetText(aText);
+ static_cast<DbFilterField*>(m_pCellControl)->SetText(aText);
}
@@ -4658,7 +4658,7 @@ void SAL_CALL FmXFilterCell::insertText( const ::com::sun::star::awt::Selection&
OUString SAL_CALL FmXFilterCell::getText() throw( RuntimeException, std::exception )
{
::osl::MutexGuard aGuard( m_aMutex );
- return ((DbFilterField*)m_pCellControl)->GetText();
+ return static_cast<DbFilterField*>(m_pCellControl)->GetText();
}
@@ -4707,7 +4707,7 @@ IMPL_LINK_NOARG(FmXFilterCell, OnCommit)
::com::sun::star::awt::TextEvent aEvt;
aEvt.Source = *this;
while( aIt.hasMoreElements() )
- ((::com::sun::star::awt::XTextListener *)aIt.next())->textChanged( aEvt );
+ static_cast< ::com::sun::star::awt::XTextListener *>(aIt.next())->textChanged( aEvt );
return 1;
}
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 357206e9a1ad..9d80bd2cd5b6 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -298,7 +298,7 @@ void DbGridControl::NavigationBar::AbsolutePos::KeyInput(const KeyEvent& rEvt)
if (nRecord < GetMin() || nRecord > GetMax())
return;
else
- ((NavigationBar*)GetParent())->PositionDataSource(static_cast<sal_Int32>(nRecord));
+ static_cast<NavigationBar*>(GetParent())->PositionDataSource(static_cast<sal_Int32>(nRecord));
}
else if (rEvt.GetKeyCode() == KEY_TAB)
GetParent()->GetParent()->GrabFocus();
@@ -314,8 +314,8 @@ void DbGridControl::NavigationBar::AbsolutePos::LoseFocus()
return;
else
{
- ((NavigationBar*)GetParent())->PositionDataSource(static_cast<sal_Int32>(nRecord));
- ((NavigationBar*)GetParent())->InvalidateState(NavigationBar::RECORD_ABSOLUTE);
+ static_cast<NavigationBar*>(GetParent())->PositionDataSource(static_cast<sal_Int32>(nRecord));
+ static_cast<NavigationBar*>(GetParent())->InvalidateState(NavigationBar::RECORD_ABSOLUTE);
}
}
@@ -326,7 +326,7 @@ void DbGridControl::NavigationBar::PositionDataSource(sal_Int32 nRecord)
// the MoveToPosition may cause a LoseFocus which would lead to a second MoveToPosition,
// so protect against this recursion
m_bPositioning = true;
- ((DbGridControl*)GetParent())->MoveToPosition(nRecord - 1);
+ static_cast<DbGridControl*>(GetParent())->MoveToPosition(nRecord - 1);
m_bPositioning = false;
}
@@ -349,7 +349,7 @@ DbGridControl::NavigationBar::NavigationBar(vcl::Window* pParent, WinBits nStyle
m_aPrevBtn.SetSymbol(SymbolType::PREV);
m_aNextBtn.SetSymbol(SymbolType::NEXT);
m_aLastBtn.SetSymbol(SymbolType::LAST);
- m_aNewBtn.SetModeImage(((DbGridControl*)pParent)->GetImage(DbGridControl_Base::NEW));
+ m_aNewBtn.SetModeImage(static_cast<DbGridControl*>(pParent)->GetImage(DbGridControl_Base::NEW));
m_aFirstBtn.SetHelpId(HID_GRID_TRAVEL_FIRST);
m_aPrevBtn.SetHelpId(HID_GRID_TRAVEL_PREV);
@@ -414,7 +414,7 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls()
{
// positioning of the controls
// calculate base size
- Rectangle aRect(((DbGridControl*)GetParent())->GetControlArea());
+ Rectangle aRect(static_cast<DbGridControl*>(GetParent())->GetControlArea());
const long nH = aRect.GetSize().Height();
Size aBorder = LogicToPixel(Size(2, 2),MAP_APPFONT);
aBorder = Size(CalcZoom(aBorder.Width()), CalcZoom(aBorder.Height()));
@@ -480,21 +480,21 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls()
IMPL_LINK(DbGridControl::NavigationBar, OnClick, Button *, pButton )
{
- DbGridControl* pParent = (DbGridControl*)GetParent();
+ DbGridControl* pParent = static_cast<DbGridControl*>(GetParent());
if (pParent->m_aMasterSlotExecutor.IsSet())
{
long lResult = 0;
if (pButton == &m_aFirstBtn)
- lResult = pParent->m_aMasterSlotExecutor.Call((void*)RECORD_FIRST);
+ lResult = pParent->m_aMasterSlotExecutor.Call(reinterpret_cast<void*>(RECORD_FIRST));
else if( pButton == &m_aPrevBtn )
- lResult = pParent->m_aMasterSlotExecutor.Call((void*)RECORD_PREV);
+ lResult = pParent->m_aMasterSlotExecutor.Call(reinterpret_cast<void*>(RECORD_PREV));
else if( pButton == &m_aNextBtn )
- lResult = pParent->m_aMasterSlotExecutor.Call((void*)RECORD_NEXT);
+ lResult = pParent->m_aMasterSlotExecutor.Call(reinterpret_cast<void*>(RECORD_NEXT));
else if( pButton == &m_aLastBtn )
- lResult = pParent->m_aMasterSlotExecutor.Call((void*)RECORD_LAST);
+ lResult = pParent->m_aMasterSlotExecutor.Call(reinterpret_cast<void*>(RECORD_LAST));
else if( pButton == &m_aNewBtn )
- lResult = pParent->m_aMasterSlotExecutor.Call((void*)RECORD_NEW);
+ lResult = pParent->m_aMasterSlotExecutor.Call(reinterpret_cast<void*>(RECORD_NEW));
if (lResult)
// the link already handled it
@@ -518,7 +518,7 @@ void DbGridControl::NavigationBar::InvalidateAll(sal_Int32 nCurrentPos, bool bAl
{
if (m_nCurrentPos != nCurrentPos || nCurrentPos < 0 || bAll)
{
- DbGridControl* pParent = (DbGridControl*)GetParent();
+ DbGridControl* pParent = static_cast<DbGridControl*>(GetParent());
sal_Int32 nAdjustedRowCount = pParent->GetRowCount() - ((pParent->GetOptions() & DbGridControl::OPT_INSERT) ? 2 : 1);
@@ -546,7 +546,7 @@ void DbGridControl::NavigationBar::InvalidateAll(sal_Int32 nCurrentPos, bool bAl
bool DbGridControl::NavigationBar::GetState(sal_uInt16 nWhich) const
{
- DbGridControl* pParent = (DbGridControl*)GetParent();
+ DbGridControl* pParent = static_cast<DbGridControl*>(GetParent());
if (!pParent->IsOpen() || pParent->IsDesignMode() || !pParent->IsEnabled()
|| pParent->IsFilterMode() )
@@ -601,7 +601,7 @@ bool DbGridControl::NavigationBar::GetState(sal_uInt16 nWhich) const
void DbGridControl::NavigationBar::SetState(sal_uInt16 nWhich)
{
bool bAvailable = GetState(nWhich);
- DbGridControl* pParent = (DbGridControl*)GetParent();
+ DbGridControl* pParent = static_cast<DbGridControl*>(GetParent());
vcl::Window* pWnd = NULL;
switch (nWhich)
{
@@ -1565,7 +1565,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
// start listening on the seek cursor
if (m_pSeekCursor)
- m_pCursorDisposeListener = new DisposeListenerGridBridge(*this, Reference< XComponent > ((Reference< XInterface >)*m_pSeekCursor, UNO_QUERY), 0);
+ m_pCursorDisposeListener = new DisposeListenerGridBridge(*this, Reference< XComponent > (Reference< XInterface >(*m_pSeekCursor), UNO_QUERY), 0);
}
void DbGridControl::RemoveColumns()
@@ -2028,7 +2028,7 @@ bool DbGridControl::SetCurrent(long nNewRow)
Reference< XPropertySet > xCursorProps = m_pDataCursor->getPropertySet();
if ( !::comphelper::getBOOL(xCursorProps->getPropertyValue(FM_PROP_ISNEW)) )
{
- Reference< XResultSetUpdate > xUpdateCursor((Reference< XInterface >)*m_pDataCursor, UNO_QUERY);
+ Reference< XResultSetUpdate > xUpdateCursor(Reference< XInterface >(*m_pDataCursor), UNO_QUERY);
xUpdateCursor->moveToInsertRow();
}
bNewRowInserted = true;
@@ -2633,7 +2633,7 @@ void DbGridControl::PreExecuteRowContextMenu(sal_uInt16 /*nRow*/, PopupMenu& rMe
bool bCanUndo = IsModified();
long nState = -1;
if (m_aMasterStateProvider.IsSet())
- nState = m_aMasterStateProvider.Call((void*)SID_FM_RECORD_UNDO);
+ nState = m_aMasterStateProvider.Call(reinterpret_cast<void*>(SID_FM_RECORD_UNDO));
bCanUndo &= ( 0 != nState );
rMenu.EnableItem(SID_FM_RECORD_UNDO, bCanUndo);
@@ -2949,11 +2949,11 @@ void DbGridControl::Undo()
// check if we have somebody doin' the UNDO for us
long nState = -1;
if (m_aMasterStateProvider.IsSet())
- nState = m_aMasterStateProvider.Call((void*)SID_FM_RECORD_UNDO);
+ nState = m_aMasterStateProvider.Call(reinterpret_cast<void*>(SID_FM_RECORD_UNDO));
if (nState>0)
{ // yes, we have, and the slot is enabled
DBG_ASSERT(m_aMasterSlotExecutor.IsSet(), "DbGridControl::Undo : a state, but no execute link ?");
- long lResult = m_aMasterSlotExecutor.Call((void*)SID_FM_RECORD_UNDO);
+ long lResult = m_aMasterSlotExecutor.Call(reinterpret_cast<void*>(SID_FM_RECORD_UNDO));
if (lResult)
// handled
return;
@@ -2970,7 +2970,7 @@ void DbGridControl::Undo()
try
{
// cancel editing
- Reference< XResultSetUpdate > xUpdateCursor((Reference< XInterface >)*m_pDataCursor, UNO_QUERY);
+ Reference< XResultSetUpdate > xUpdateCursor(Reference< XInterface >(*m_pDataCursor), UNO_QUERY);
// no effects if we're not updating currently
if (bAppending)
// just refresh the row
@@ -3135,7 +3135,7 @@ bool DbGridControl::SaveRow()
bool bSuccess = false;
try
{
- Reference< XResultSetUpdate > xUpdateCursor((Reference< XInterface >)*m_pDataCursor, UNO_QUERY);
+ Reference< XResultSetUpdate > xUpdateCursor(Reference< XInterface >(*m_pDataCursor), UNO_QUERY);
if (bAppending)
xUpdateCursor->insertRow();
else