[Libreoffice-commits] core.git: 3 commits - canvas/source connectivity/source dbaccess/source include/sfx2 include/svl linguistic/source sfx2/source
Noel Grandin
noel at peralex.com
Fri Oct 3 06:20:39 PDT 2014
canvas/source/cairo/cairo_xlib_cairo.cxx | 11 +-
connectivity/source/commontools/FValue.cxx | 2
connectivity/source/drivers/calc/CCatalog.cxx | 2
connectivity/source/drivers/calc/CColumns.cxx | 2
connectivity/source/drivers/calc/CDatabaseMetaData.cxx | 2
connectivity/source/drivers/dbase/DColumns.cxx | 3
connectivity/source/drivers/file/FDriver.cxx | 2
connectivity/source/drivers/file/FPreparedStatement.cxx | 2
connectivity/source/drivers/file/FStatement.cxx | 2
connectivity/source/drivers/file/fcomp.cxx | 16 ++--
connectivity/source/drivers/firebird/DatabaseMetaData.cxx | 2
connectivity/source/drivers/firebird/Statement.cxx | 2
connectivity/source/drivers/flat/EColumns.cxx | 3
connectivity/source/drivers/flat/ETables.cxx | 2
connectivity/source/drivers/jdbc/Blob.cxx | 2
connectivity/source/drivers/jdbc/CallableStatement.cxx | 2
connectivity/source/drivers/jdbc/Clob.cxx | 4 -
connectivity/source/drivers/jdbc/DatabaseMetaData.cxx | 48 ++++++------
connectivity/source/drivers/jdbc/DriverPropertyInfo.cxx | 8 +-
connectivity/source/drivers/jdbc/JConnection.cxx | 4 -
connectivity/source/drivers/jdbc/JStatement.cxx | 4 -
connectivity/source/drivers/jdbc/Object.cxx | 6 -
connectivity/source/drivers/jdbc/PreparedStatement.cxx | 6 -
connectivity/source/drivers/jdbc/ResultSet.cxx | 12 +--
connectivity/source/drivers/jdbc/SQLException.cxx | 2
connectivity/source/drivers/jdbc/String.cxx | 2
connectivity/source/drivers/jdbc/Timestamp.cxx | 2
connectivity/source/drivers/jdbc/tools.cxx | 4 -
connectivity/source/drivers/mork/MPreparedStatement.cxx | 2
connectivity/source/drivers/mork/MStatement.cxx | 2
connectivity/source/drivers/odbc/OConnection.cxx | 8 +-
connectivity/source/drivers/odbc/OPreparedStatement.cxx | 2
connectivity/source/drivers/odbc/ORealDriver.cxx | 2
connectivity/source/drivers/odbc/OStatement.cxx | 2
connectivity/source/drivers/odbc/OTools.cxx | 4 -
connectivity/source/drivers/postgresql/pq_xcontainer.cxx | 8 +-
connectivity/source/drivers/postgresql/pq_xcontainer.hxx | 2
dbaccess/source/core/api/FilteredContainer.cxx | 2
dbaccess/source/core/api/KeySet.cxx | 8 +-
dbaccess/source/core/api/OptimisticSet.cxx | 2
dbaccess/source/core/api/RowSet.cxx | 2
dbaccess/source/core/api/RowSetBase.cxx | 2
dbaccess/source/core/dataaccess/databasecontext.cxx | 2
dbaccess/source/core/dataaccess/databasedocument.cxx | 2
dbaccess/source/core/dataaccess/definitioncontainer.cxx | 4 -
dbaccess/source/filter/xml/dbloader2.cxx | 2
dbaccess/source/filter/xml/xmlfilter.cxx | 4 -
dbaccess/source/sdbtools/connection/connectiondependent.hxx | 2
dbaccess/source/ui/app/AppController.cxx | 14 +--
dbaccess/source/ui/app/AppDetailPageHelper.cxx | 2
dbaccess/source/ui/browser/brwctrlr.cxx | 4 -
dbaccess/source/ui/browser/dbloader.cxx | 2
dbaccess/source/ui/browser/exsrcbrw.cxx | 2
dbaccess/source/ui/browser/formadapter.cxx | 12 +--
dbaccess/source/ui/browser/genericcontroller.cxx | 2
dbaccess/source/ui/browser/sbagrid.cxx | 22 ++---
dbaccess/source/ui/browser/sbamultiplex.cxx | 2
dbaccess/source/ui/browser/unodatbr.cxx | 28 +++----
dbaccess/source/ui/control/FieldDescControl.cxx | 10 +-
dbaccess/source/ui/dlg/odbcconfig.cxx | 4 -
dbaccess/source/ui/misc/DExport.cxx | 2
dbaccess/source/ui/misc/TokenWriter.cxx | 8 +-
dbaccess/source/ui/misc/WCopyTable.cxx | 4 -
dbaccess/source/ui/misc/WTypeSelect.cxx | 12 +--
dbaccess/source/ui/misc/databaseobjectview.cxx | 28 +++----
dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx | 2
dbaccess/source/ui/misc/linkeddocuments.cxx | 4 -
dbaccess/source/ui/querydesign/QTableConnectionData.cxx | 4 -
dbaccess/source/ui/querydesign/querycontroller.cxx | 22 ++---
dbaccess/source/ui/relationdesign/RelationTableView.cxx | 2
dbaccess/source/ui/tabledesign/TableController.cxx | 2
include/sfx2/childwin.hxx | 12 +--
include/svl/itemset.hxx | 4 -
linguistic/source/convdicxml.cxx | 2
sfx2/source/dialog/dinfdlg.cxx | 42 +++++-----
sfx2/source/dialog/dockwin.cxx | 4 -
sfx2/source/dialog/infobar.cxx | 2
sfx2/source/dialog/mgetempl.cxx | 10 +-
sfx2/source/dialog/navigat.cxx | 2
sfx2/source/dialog/partwnd.cxx | 8 +-
sfx2/source/dialog/recfloat.cxx | 2
sfx2/source/dialog/templdlg.cxx | 4 -
sfx2/source/dialog/tplpitem.cxx | 2
sfx2/source/doc/docfile.cxx | 2
sfx2/source/doc/frmdescr.cxx | 2
sfx2/source/doc/objmisc.cxx | 8 +-
sfx2/source/doc/objserv.cxx | 10 +-
sfx2/source/doc/objstor.cxx | 10 +-
sfx2/source/doc/objxtor.cxx | 2
sfx2/source/doc/printhelper.cxx | 2
sfx2/source/doc/sfxbasemodel.cxx | 12 +--
sfx2/source/doc/templatedlg.cxx | 4 -
sfx2/source/doc/zoomitem.cxx | 2
sfx2/source/inet/inettbc.cxx | 2
sfx2/source/menu/mnuitem.cxx | 14 +--
sfx2/source/menu/mnumgr.cxx | 6 -
sfx2/source/menu/virtmenu.cxx | 10 +-
sfx2/source/toolbox/tbxitem.cxx | 24 +++---
sfx2/source/view/frame.cxx | 4 -
sfx2/source/view/frame2.cxx | 2
sfx2/source/view/sfxbasecontroller.cxx | 2
sfx2/source/view/viewfrm.cxx | 16 ++--
sfx2/source/view/viewprn.cxx | 2
sfx2/source/view/viewsh.cxx | 2
104 files changed, 325 insertions(+), 324 deletions(-)
New commits:
commit a28e7f7aa995f8c2c9e4eda332c30853338c7ae9
Author: Noel Grandin <noel at peralex.com>
Date: Thu Oct 2 13:37:01 2014 +0200
loplugin: cstylecast
Change-Id: Ie478d1fcfd3b64d7a2128887c216b5e0b4501ab9
diff --git a/canvas/source/cairo/cairo_xlib_cairo.cxx b/canvas/source/cairo/cairo_xlib_cairo.cxx
index 8f496a4..a9e2069 100644
--- a/canvas/source/cairo/cairo_xlib_cairo.cxx
+++ b/canvas/source/cairo/cairo_xlib_cairo.cxx
@@ -29,6 +29,7 @@
#include <vcl/sysdata.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/virdev.hxx>
+#include <vcl/window.hxx>
#include <basegfx/vector/b2isize.hxx>
namespace
@@ -187,7 +188,7 @@ namespace cairo
mpPixmap(),
mpSurface(
cairo_xlib_surface_create( (Display*)rSysData.pDisplay,
- (Drawable)rData.aPixmap,
+ reinterpret_cast<Drawable>(rData.aPixmap),
(Visual*) rSysData.pVisual,
rData.mnWidth, rData.mnHeight ),
&cairo_surface_destroy)
@@ -337,10 +338,10 @@ namespace cairo
int x, int y, int width, int height )
{
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
- return SurfaceSharedPtr(new X11Surface(getSysData((const vcl::Window&)rRefDevice),
+ return SurfaceSharedPtr(new X11Surface(getSysData(static_cast<const vcl::Window&>(rRefDevice)),
x,y,width,height));
else if( rRefDevice.GetOutDevType() == OUTDEV_VIRDEV )
- return SurfaceSharedPtr(new X11Surface(getSysData((const VirtualDevice&)rRefDevice),
+ return SurfaceSharedPtr(new X11Surface(getSysData(static_cast<const VirtualDevice&>(rRefDevice)),
x,y,width,height));
else
return SurfaceSharedPtr();
@@ -355,9 +356,9 @@ namespace cairo
if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() )
{
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
- return SurfaceSharedPtr(new X11Surface(getSysData((const vcl::Window&)rRefDevice), rData ));
+ return SurfaceSharedPtr(new X11Surface(getSysData(static_cast<const vcl::Window&>(rRefDevice)), rData ));
else if( rRefDevice.GetOutDevType() == OUTDEV_VIRDEV )
- return SurfaceSharedPtr(new X11Surface(getSysData((const VirtualDevice&)rRefDevice), rData ));
+ return SurfaceSharedPtr(new X11Surface(getSysData(static_cast<const VirtualDevice&>(rRefDevice)), rData ));
}
return SurfaceSharedPtr();
diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx
index e65092f..122182b 100644
--- a/dbaccess/source/core/api/FilteredContainer.cxx
+++ b/dbaccess/source/core/api/FilteredContainer.cxx
@@ -429,7 +429,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, ::std::vecto
// obtain the data source we belong to, and the TableTypeFilterMode setting
Any aFilterModeSetting;
- if ( getDataSourceSetting( getDataSource( (Reference< XInterface >)m_rParent ), "TableTypeFilterMode", aFilterModeSetting ) )
+ if ( getDataSourceSetting( getDataSource( Reference< XInterface >(m_rParent) ), "TableTypeFilterMode", aFilterModeSetting ) )
{
OSL_VERIFY( aFilterModeSetting >>= nFilterMode );
}
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 19b9971..28b7976 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -323,7 +323,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet, const OUStrin
// the first row is empty because it's now easier for us to distinguish when we are beforefirst or first
// without extra variable to be set
- OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,(Reference<XRow>)NULL));
+ OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,Reference<XRow>()));
m_aKeyMap.insert(OKeySetMatrix::value_type(0, keySetValue));
m_aKeyIter = m_aKeyMap.begin();
}
@@ -333,7 +333,7 @@ void OKeySet::reset(const Reference< XResultSet>& _xDriverSet)
OCacheSet::construct(_xDriverSet, m_sRowSetFilter);
m_bRowCountFinal = false;
m_aKeyMap.clear();
- OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,(Reference<XRow>)NULL));
+ OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,Reference<XRow>()));
m_aKeyMap.insert(OKeySetMatrix::value_type(0,keySetValue));
m_aKeyIter = m_aKeyMap.begin();
}
@@ -893,7 +893,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const OUString& i_sSQ
ORowSetRow aKeyRow = new connectivity::ORowVector< ORowSetValue >(m_pKeyColumnNames->size());
copyRowValue(_rInsertRow,aKeyRow,aKeyIter->first + 1);
- m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(aKeyIter->first + 1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(1,(Reference<XRow>)NULL)))).first;
+ m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(aKeyIter->first + 1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(1,Reference<XRow>())))).first;
// now we set the bookmark for this row
(_rInsertRow->get())[0] = makeAny((sal_Int32)m_aKeyIter->first);
tryRefetch(_rInsertRow,bRefetch);
@@ -1448,7 +1448,7 @@ bool OKeySet::fetchRow()
const SelectColumnDescription& rColDesc = aPosIter->second;
aIter->fill(rColDesc.nPosition, rColDesc.nType, m_xRow);
}
- m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(m_aKeyMap.rbegin()->first+1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(0,(Reference<XRow>)NULL)))).first;
+ m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(m_aKeyMap.rbegin()->first+1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(0,Reference<XRow>())))).first;
}
else
m_bRowCountFinal = true;
diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx
index 12b3e98..69cfa7d 100644
--- a/dbaccess/source/core/api/OptimisticSet.cxx
+++ b/dbaccess/source/core/api/OptimisticSet.cxx
@@ -125,7 +125,7 @@ void OptimisticSet::construct(const Reference< XResultSet>& _xDriverSet,const OU
// the first row is empty because it's now easier for us to distinguish when we are beforefirst or first
// without extra variable to be set
- OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,(Reference<XRow>)NULL));
+ OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,Reference<XRow>()));
m_aKeyMap.insert(OKeySetMatrix::value_type(0,keySetValue));
m_aKeyIter = m_aKeyMap.begin();
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 5912aa9..ea2e929 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -1129,7 +1129,7 @@ void ORowSet::notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& _rGuard
void ORowSet::notifyAllListenersRowChanged(::osl::ResettableMutexGuard& _rGuard, const RowsChangeEvent& aEvt)
{
_rGuard.clear();
- m_aRowsetListeners.notifyEach( &XRowSetListener::rowChanged, (EventObject)aEvt );
+ m_aRowsetListeners.notifyEach( &XRowSetListener::rowChanged, static_cast<EventObject>(aEvt) );
m_aRowsChangeListener.notifyEach( &XRowsChangeListener::rowsChanged, aEvt );
_rGuard.reset();
}
diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx
index 4fbbb0b..57a3dc1 100644
--- a/dbaccess/source/core/api/RowSetBase.cxx
+++ b/dbaccess/source/core/api/RowSetBase.cxx
@@ -242,7 +242,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex)
for (; k != m_pCache->getEnd(); ++k)
{
ORowSetValueVector* pTemp = k->get();
- OSL_ENSURE( pTemp != (void*)0xfeeefeee,"HALT!" );
+ OSL_ENSURE( pTemp != reinterpret_cast<void*>(0xfeeefeee),"HALT!" );
}
#endif
OSL_ENSURE(!m_aCurrentRow.isNull() && m_aCurrentRow < m_pCache->getEnd() && aCacheIter != m_pCache->m_aCacheIterators.end(),"Invalid iterator set for currentrow!");
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index 99a647d..fd1dbc3 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -252,7 +252,7 @@ Reference< XInterface > SAL_CALL ODatabaseContext::createInstance( ) throw (Exc
Reference< XInterface > SAL_CALL ODatabaseContext::createInstanceWithArguments( const Sequence< Any >& _rArguments ) throw (Exception, RuntimeException, std::exception)
{
::comphelper::NamedValueCollection aArgs( _rArguments );
- OUString sURL = aArgs.getOrDefault( (OUString)INFO_POOLURL, OUString() );
+ OUString sURL = aArgs.getOrDefault( OUString(INFO_POOLURL), OUString() );
Reference< XInterface > xDataSource;
if ( !sURL.isEmpty() )
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 259d061..29dd1f4 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1619,7 +1619,7 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r
aDelegatorArguments[nArgsLen++] <<= xInfoSet;
Reference< XPropertySet > xProp( _rxTargetStorage, UNO_QUERY_THROW );
- xProp->setPropertyValue( INFO_MEDIATYPE, makeAny( (OUString)MIMETYPE_OASIS_OPENDOCUMENT_DATABASE ) );
+ xProp->setPropertyValue( INFO_MEDIATYPE, makeAny( OUString(MIMETYPE_OASIS_OPENDOCUMENT_DATABASE) ) );
OUString aVersion;
SvtSaveOptions::ODFDefaultVersion const nDefVersion =
diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
index 189612c..9f84573 100644
--- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx
+++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
@@ -602,7 +602,7 @@ void ODefinitionContainer::approveNewObject(const OUString& _sName,const Referen
void SAL_CALL ODefinitionContainer::propertyChange( const PropertyChangeEvent& evt ) throw (RuntimeException, std::exception)
{
ClearableMutexGuard aGuard(m_aMutex);
- if( evt.PropertyName == (OUString) PROPERTY_NAME || evt.PropertyName == "Title" )
+ if( evt.PropertyName == PROPERTY_NAME || evt.PropertyName == "Title" )
{
m_bInPropertyChange = true;
try
@@ -629,7 +629,7 @@ void SAL_CALL ODefinitionContainer::vetoableChange( const PropertyChangeEvent& a
{
MutexGuard aGuard(m_aMutex);
- if( aEvent.PropertyName == (OUString) PROPERTY_NAME || aEvent.PropertyName == "Title" )
+ if( aEvent.PropertyName == PROPERTY_NAME || aEvent.PropertyName == "Title" )
{
OUString sNewName;
aEvent.NewValue >>= sNewName;
diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index 8aaeb3b..c457334 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -434,7 +434,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
else
{
::comphelper::NamedValueCollection aCreationArgs;
- aCreationArgs.put( (OUString)INFO_POOLURL, sSalvagedURL );
+ aCreationArgs.put( OUString(INFO_POOLURL), sSalvagedURL );
xDocumentDataSource.set( xDatabaseContext->createInstanceWithArguments( aCreationArgs.getWrappedNamedValues() ), UNO_QUERY_THROW );
}
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 0c03368..7568034 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -840,9 +840,9 @@ SvXMLImportContext* ODBFilter::CreateStylesContext(sal_uInt16 _nPrefix,const OUS
{
pContext = new OTableStylesContext(*this, _nPrefix, rLocalName, xAttrList, bIsAutoStyle);
if (bIsAutoStyle)
- SetAutoStyles((SvXMLStylesContext*)pContext);
+ SetAutoStyles(static_cast<SvXMLStylesContext*>(pContext));
else
- SetStyles((SvXMLStylesContext*)pContext);
+ SetStyles(static_cast<SvXMLStylesContext*>(pContext));
}
return pContext;
}
diff --git a/dbaccess/source/sdbtools/connection/connectiondependent.hxx b/dbaccess/source/sdbtools/connection/connectiondependent.hxx
index b6cc94f..e9f0639 100644
--- a/dbaccess/source/sdbtools/connection/connectiondependent.hxx
+++ b/dbaccess/source/sdbtools/connection/connectiondependent.hxx
@@ -90,7 +90,7 @@ namespace sdbtools
inline bool acquireConnection( GuardAccess )
{
- m_xConnection = (::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >)m_aConnection;
+ m_xConnection = ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >(m_aConnection);
return m_xConnection.is();
}
inline void releaseConnection( GuardAccess )
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 6eee778..fe3f5a7 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -1225,7 +1225,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
eType = E_QUERY;
break;
case ID_NEW_QUERY_DESIGN:
- aCreationArgs.put( (OUString)PROPERTY_GRAPHICAL_DESIGN, sal_True );
+ aCreationArgs.put( OUString(PROPERTY_GRAPHICAL_DESIGN), sal_True );
// run through
case ID_NEW_QUERY_SQL:
eType = E_QUERY;
@@ -1263,7 +1263,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
QueryDesigner aDesigner( getORB(), this, getFrame(), true );
::comphelper::NamedValueCollection aCreationArgs;
- aCreationArgs.put( (OUString)PROPERTY_GRAPHICAL_DESIGN, ID_NEW_VIEW_DESIGN == _nId );
+ aCreationArgs.put( OUString(PROPERTY_GRAPHICAL_DESIGN), ID_NEW_VIEW_DESIGN == _nId );
const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY );
const Reference< XComponent > xComponent( aDesigner.createNew( xDataSource, aCreationArgs ), UNO_QUERY );
@@ -1868,7 +1868,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
if ( bAddViewTypeArg )
{
const bool bQueryGraphicalMode =( _nInstigatorCommand != SID_DB_APP_EDIT_SQL_VIEW );
- aArguments.put( (OUString)PROPERTY_GRAPHICAL_DESIGN, bQueryGraphicalMode );
+ aArguments.put( OUString(PROPERTY_GRAPHICAL_DESIGN), bQueryGraphicalMode );
}
}
@@ -1876,8 +1876,8 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
{
pDesigner.reset( new ResultSetBrowser( getORB(), this, m_aCurrentFrame.getFrame(), _eType == E_TABLE ) );
- if ( !aArguments.has( (OUString)PROPERTY_SHOWMENU ) )
- aArguments.put( (OUString)PROPERTY_SHOWMENU, makeAny( true ) );
+ if ( !aArguments.has( OUString(PROPERTY_SHOWMENU) ) )
+ aArguments.put( OUString(PROPERTY_SHOWMENU), makeAny( true ) );
aDataSource <<= getDatabaseName();
}
@@ -2711,9 +2711,9 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
{
// to get the 'modified' for the data source
::comphelper::NamedValueCollection aLayoutInfo( m_xDataSource->getPropertyValue( PROPERTY_LAYOUTINFORMATION ) );
- if ( aLayoutInfo.has( (OUString)INFO_PREVIEW ) )
+ if ( aLayoutInfo.has( OUString(INFO_PREVIEW) ) )
{
- const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( (OUString)INFO_PREVIEW, (sal_Int32)0 ) );
+ const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( OUString(INFO_PREVIEW), (sal_Int32)0 ) );
m_ePreviewMode = static_cast< PreviewMode >( nPreviewMode );
if ( getView() )
getContainer()->switchPreview( m_ePreviewMode );
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index af80ee8..eadf7a0 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -1146,7 +1146,7 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName,
aArgs.put( "Preview", sal_True );
aArgs.put( "ReadOnly", sal_True );
aArgs.put( "AsTemplate", sal_False );
- aArgs.put( (OUString)PROPERTY_SHOWMENU, sal_False );
+ aArgs.put( OUString(PROPERTY_SHOWMENU), sal_False );
Reference< XController > xPreview( pDispatcher->openExisting( makeAny( _sDataSourceName ), _sName, aArgs ), UNO_QUERY );
bool bClearPreview = !xPreview.is();
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index dfa6774..9d67df9 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1480,7 +1480,7 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const
CellControllerRef xCurrentController = getBrowserView()->getVclControl()->Controller();
if (xCurrentController.Is() && xCurrentController->ISA(EditCellController))
{
- Edit& rEdit = (Edit&)xCurrentController->GetWindow();
+ Edit& rEdit = static_cast<Edit&>(xCurrentController->GetWindow());
bool bHasLen = (rEdit.GetSelection().Len() != 0);
bool bIsReadOnly = rEdit.IsReadOnly();
switch (nId)
@@ -1964,7 +1964,7 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property
// enabled. This would be really deadly herein if the current cell has no controller ...
return;
- Edit& rEdit = (Edit&)xCurrentController->GetWindow();
+ Edit& rEdit = static_cast<Edit&>(xCurrentController->GetWindow());
switch (nId)
{
case ID_BROWSER_CUT : rEdit.Cut(); break;
diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx
index fb5bae3..74fc745 100644
--- a/dbaccess/source/ui/browser/dbloader.cxx
+++ b/dbaccess/source/ui/browser/dbloader.cxx
@@ -192,7 +192,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
if ( sComponentURL == URL_COMPONENT_DATASOURCEBROWSER )
{
bool bDisableBrowser = ( sal_False == aLoadArgs.getOrDefault( "ShowTreeViewButton", sal_True ) ) // compatibility name
- || ( sal_False == aLoadArgs.getOrDefault( (OUString)PROPERTY_ENABLE_BROWSER, sal_True ) );
+ || ( sal_False == aLoadArgs.getOrDefault( OUString(PROPERTY_ENABLE_BROWSER), sal_True ) );
if ( bDisableBrowser )
{
diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx
index abdaf7c..d6e47e6 100644
--- a/dbaccess/source/ui/browser/exsrcbrw.cxx
+++ b/dbaccess/source/ui/browser/exsrcbrw.cxx
@@ -126,7 +126,7 @@ void SbaExternalSourceBrowser::modified(const ::com::sun::star::lang::EventObjec
::com::sun::star::lang::EventObject aEvt(*this);
::cppu::OInterfaceIteratorHelper aIt(m_aModifyListeners);
while (aIt.hasMoreElements())
- ((::com::sun::star::util::XModifyListener*)aIt.next())->modified(aEvt);
+ static_cast< ::com::sun::star::util::XModifyListener*>(aIt.next())->modified(aEvt);
}
void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::URL& aURL, const Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) throw(::com::sun::star::uno::RuntimeException, std::exception)
diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx
index bac906e..41aa59b 100644
--- a/dbaccess/source/ui/browser/formadapter.cxx
+++ b/dbaccess/source/ui/browser/formadapter.cxx
@@ -171,7 +171,7 @@ void SbaXFormAdapter::AttachForm(const Reference< ::com::sun::star::sdbc::XRowSe
::com::sun::star::lang::EventObject aEvt(*this);
::cppu::OInterfaceIteratorHelper aIt(m_aLoadListeners);
while (aIt.hasMoreElements())
- ((::com::sun::star::form::XLoadListener*)aIt.next())->unloaded(aEvt);
+ static_cast< ::com::sun::star::form::XLoadListener*>(aIt.next())->unloaded(aEvt);
}
}
@@ -188,7 +188,7 @@ void SbaXFormAdapter::AttachForm(const Reference< ::com::sun::star::sdbc::XRowSe
::com::sun::star::lang::EventObject aEvt(*this);
::cppu::OInterfaceIteratorHelper aIt(m_aLoadListeners);
while (aIt.hasMoreElements())
- ((::com::sun::star::form::XLoadListener*)aIt.next())->loaded(aEvt);
+ static_cast< ::com::sun::star::form::XLoadListener*>(aIt.next())->loaded(aEvt);
}
}
@@ -1142,7 +1142,7 @@ void SAL_CALL SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any
::cppu::OInterfaceIteratorHelper aIt(*m_aPropertyChangeListeners.getContainer(PROPERTY_NAME));
while (aIt.hasMoreElements())
- ((::com::sun::star::beans::XPropertyChangeListener*)aIt.next())->propertyChange(aEvt);
+ static_cast< ::com::sun::star::beans::XPropertyChangeListener*>(aIt.next())->propertyChange(aEvt);
return;
}
@@ -1425,7 +1425,7 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const OU
aEvt.Element <<= xElement;
::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners);
while (aIt.hasMoreElements())
- ((::com::sun::star::container::XContainerListener*)aIt.next())->elementInserted(aEvt);
+ static_cast< ::com::sun::star::container::XContainerListener*>(aIt.next())->elementInserted(aEvt);
}
sal_Int32 SbaXFormAdapter::implGetPos(const OUString& rName)
@@ -1531,7 +1531,7 @@ void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex) throw( ::com::su
aEvt.Element <<= xAffected;
::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners);
while (aIt.hasMoreElements())
- ((::com::sun::star::container::XContainerListener*)aIt.next())->elementRemoved(aEvt);
+ static_cast< ::com::sun::star::container::XContainerListener*>(aIt.next())->elementRemoved(aEvt);
}
@@ -1594,7 +1594,7 @@ void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Elem
::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners);
while (aIt.hasMoreElements())
- ((::com::sun::star::container::XContainerListener*)aIt.next())->elementReplaced(aEvt);
+ static_cast< ::com::sun::star::container::XContainerListener*>(aIt.next())->elementReplaced(aEvt);
}
// ::com::sun::star::container::XIndexAccess
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index c852642..afbdc24 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -123,7 +123,7 @@ void UserDefinedFeatures::execute( const URL& _rFeatureURL, const Sequence< Prop
{
try
{
- Reference< XController > xController( (Reference< XController >)m_aController, UNO_SET_THROW );
+ Reference< XController > xController( Reference< XController >(m_aController), UNO_SET_THROW );
Reference< XDispatchProvider > xDispatchProvider( xController->getFrame(), UNO_QUERY_THROW );
Reference< XDispatch > xDispatch( xDispatchProvider->queryDispatch(
_rFeatureURL,
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 125b881..abfe3bd 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -309,7 +309,7 @@ void SAL_CALL SbaXGridPeer::dispose(void) throw( RuntimeException, std::exceptio
void SbaXGridPeer::NotifyStatusChanged(const ::com::sun::star::util::URL& _rUrl, const Reference< ::com::sun::star::frame::XStatusListener > & xControl)
{
- SbaGridControl* pGrid = (SbaGridControl*) GetWindow();
+ SbaGridControl* pGrid = static_cast<SbaGridControl*>(GetWindow());
if (!pGrid)
return;
@@ -334,7 +334,7 @@ void SbaXGridPeer::NotifyStatusChanged(const ::com::sun::star::util::URL& _rUrl,
{
::cppu::OInterfaceIteratorHelper aListIter(*pIter);
while (aListIter.hasMoreElements())
- ((::com::sun::star::frame::XStatusListener*)aListIter.next())->statusChanged(aEvt);
+ static_cast< ::com::sun::star::frame::XStatusListener*>(aListIter.next())->statusChanged(aEvt);
}
}
}
@@ -398,7 +398,7 @@ SbaXGridPeer::DispatchType SbaXGridPeer::classifyDispatchURL( const URL& _rURL )
void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyValue >& aArgs) throw( RuntimeException, std::exception )
{
- SbaGridControl* pGrid = (SbaGridControl*)GetWindow();
+ SbaGridControl* pGrid = static_cast<SbaGridControl*>(GetWindow());
if (!pGrid)
return;
@@ -621,7 +621,7 @@ void SbaGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rM
FmGridHeader::PreExecuteColumnContextMenu(nColId, rMenu);
// some items are valid only if the db isn't readonly
- bool bDBIsReadOnly = ((SbaGridControl*)GetParent())->IsReadOnlyDB();
+ bool bDBIsReadOnly = static_cast<SbaGridControl*>(GetParent())->IsReadOnlyDB();
if (bDBIsReadOnly)
{
@@ -644,8 +644,8 @@ void SbaGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rM
{
PopupMenu aNewItems(ModuleRes(RID_SBA_GRID_COLCTXMENU));
sal_uInt16 nPos = 0;
- sal_uInt16 nModelPos = ((SbaGridControl*)GetParent())->GetModelColumnPos(nColId);
- Reference< XPropertySet > xField = ((SbaGridControl*)GetParent())->getField(nModelPos);
+ sal_uInt16 nModelPos = static_cast<SbaGridControl*>(GetParent())->GetModelColumnPos(nColId);
+ Reference< XPropertySet > xField = static_cast<SbaGridControl*>(GetParent())->getField(nModelPos);
if ( xField.is() )
{
@@ -678,16 +678,16 @@ void SbaGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupM
switch (nExecutionResult)
{
case ID_BROWSER_COLWIDTH:
- ((SbaGridControl*)GetParent())->SetColWidth(nColId);
+ static_cast<SbaGridControl*>(GetParent())->SetColWidth(nColId);
break;
case ID_BROWSER_COLATTRSET:
- ((SbaGridControl*)GetParent())->SetColAttrs(nColId);
+ static_cast<SbaGridControl*>(GetParent())->SetColAttrs(nColId);
break;
case ID_BROWSER_COLUMNINFO:
{
- sal_uInt16 nModelPos = ((SbaGridControl*)GetParent())->GetModelColumnPos(nColId);
- Reference< XPropertySet > xField = ((SbaGridControl*)GetParent())->getField(nModelPos);
+ sal_uInt16 nModelPos = static_cast<SbaGridControl*>(GetParent())->GetModelColumnPos(nColId);
+ Reference< XPropertySet > xField = static_cast<SbaGridControl*>(GetParent())->getField(nModelPos);
if(!xField.is())
break;
@@ -1381,7 +1381,7 @@ sal_Int8 SbaGridControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt )
CellControllerRef xCurrentController = Controller();
if (!xCurrentController.Is() || !xCurrentController->ISA(EditCellController))
return DND_ACTION_NONE;
- Edit& rEdit = (Edit&)xCurrentController->GetWindow();
+ Edit& rEdit = static_cast<Edit&>(xCurrentController->GetWindow());
// get the dropped string
TransferableDataHelper aDropped( rEvt.maDropEvent.Transferable );
diff --git a/dbaccess/source/ui/browser/sbamultiplex.cxx b/dbaccess/source/ui/browser/sbamultiplex.cxx
index 743b12b..815f674 100644
--- a/dbaccess/source/ui/browser/sbamultiplex.cxx
+++ b/dbaccess/source/ui/browser/sbamultiplex.cxx
@@ -91,7 +91,7 @@ void SbaXPropertiesChangeMultiplexer::propertiesChange(const ::com::sun::star::u
::cppu::OInterfaceIteratorHelper aIt(*this);
while (aIt.hasMoreElements())
- ((::com::sun::star::beans::XPropertiesChangeListener*)aIt.next())->propertiesChange(aMulti);
+ static_cast< ::com::sun::star::beans::XPropertiesChangeListener*>(aIt.next())->propertiesChange(aMulti);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index b18678a..bda7e28 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -2295,7 +2295,7 @@ bool SbaTableQueryBrowser::ensureEntryObject( SvTreeListEntry* _pEntry )
SvTreeListEntry* pParent = m_pTreeView->getListBox().GetParent(_pEntry);
if ( pParent != pDataSourceEntry )
{
- SvLBoxString* pString = (SvLBoxString*)_pEntry->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING);
+ SvLBoxString* pString = static_cast<SvLBoxString*>(_pEntry->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING));
OSL_ENSURE(pString,"There must be a string item!");
OUString aName(pString->GetText());
DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pParent->GetUserData());
@@ -2546,7 +2546,7 @@ bool SbaTableQueryBrowser::implSelect( SvTreeListEntry* _pEntry )
Reference<XConnection> xOldConnection(xRowSetProps->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY);
// the name of the table or query
- SvLBoxString* pString = (SvLBoxString*)_pEntry->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING);
+ SvLBoxString* pString = static_cast<SvLBoxString*>(_pEntry->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING));
OSL_ENSURE(pString,"There must be a string item!");
const OUString sSimpleName = pString->GetText();
OUStringBuffer sNameBuffer(sSimpleName);
@@ -2556,7 +2556,7 @@ bool SbaTableQueryBrowser::implSelect( SvTreeListEntry* _pEntry )
while( m_pTreeModel->GetParent(pTemp) != pConnection )
{
sNameBuffer.insert(0,'/');
- pString = (SvLBoxString*)pTemp->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING);
+ pString = static_cast<SvLBoxString*>(pTemp->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING));
OSL_ENSURE(pString,"There must be a string item!");
sNameBuffer.insert(0,pString->GetText());
pTemp = m_pTreeModel->GetParent(pTemp);
@@ -3096,21 +3096,21 @@ void SbaTableQueryBrowser::impl_initialize()
const NamedValueCollection& rArguments( getInitParams() );
- rArguments.get_ensureType( (OUString)PROPERTY_DATASOURCENAME, sInitialDataSourceName );
- rArguments.get_ensureType( (OUString)PROPERTY_COMMAND_TYPE, nInitialDisplayCommandType );
- rArguments.get_ensureType( (OUString)PROPERTY_COMMAND, sInitialCommand );
- rArguments.get_ensureType( (OUString)PROPERTY_ACTIVE_CONNECTION, xForeignConnection );
- rArguments.get_ensureType( (OUString)PROPERTY_UPDATE_CATALOGNAME, aCatalogName );
- rArguments.get_ensureType( (OUString)PROPERTY_UPDATE_SCHEMANAME, aSchemaName );
- rArguments.get_ensureType( (OUString)PROPERTY_UPDATE_TABLENAME, aTableName );
- rArguments.get_ensureType( (OUString)PROPERTY_ESCAPE_PROCESSING, bEsacpeProcessing );
+ rArguments.get_ensureType( OUString(PROPERTY_DATASOURCENAME), sInitialDataSourceName );
+ rArguments.get_ensureType( OUString(PROPERTY_COMMAND_TYPE), nInitialDisplayCommandType );
+ rArguments.get_ensureType( OUString(PROPERTY_COMMAND), sInitialCommand );
+ rArguments.get_ensureType( OUString(PROPERTY_ACTIVE_CONNECTION), xForeignConnection );
+ rArguments.get_ensureType( OUString(PROPERTY_UPDATE_CATALOGNAME), aCatalogName );
+ rArguments.get_ensureType( OUString(PROPERTY_UPDATE_SCHEMANAME), aSchemaName );
+ rArguments.get_ensureType( OUString(PROPERTY_UPDATE_TABLENAME), aTableName );
+ rArguments.get_ensureType( OUString(PROPERTY_ESCAPE_PROCESSING), bEsacpeProcessing );
rArguments.get_ensureType( "Frame", xFrame );
- rArguments.get_ensureType( (OUString)PROPERTY_SHOWMENU, m_bShowMenu );
+ rArguments.get_ensureType( OUString(PROPERTY_SHOWMENU), m_bShowMenu );
// disable the browser if either of ShowTreeViewButton (compatibility name) or EnableBrowser
// is present and set to FALSE
bool bDisableBrowser = ( sal_False == rArguments.getOrDefault( "ShowTreeViewButton", sal_True ) ) // compatibility name
- || ( sal_False == rArguments.getOrDefault( (OUString)PROPERTY_ENABLE_BROWSER, sal_True ) );
+ || ( sal_False == rArguments.getOrDefault( OUString(PROPERTY_ENABLE_BROWSER), sal_True ) );
OSL_ENSURE( !rArguments.has( "ShowTreeViewButton" ),
"SbaTableQueryBrowser::impl_initialize: ShowTreeViewButton is superseded by EnableBrowser!" );
m_bEnableBrowser = !bDisableBrowser;
@@ -3118,7 +3118,7 @@ void SbaTableQueryBrowser::impl_initialize()
// hide the tree view it is disabled in general, or if the settings tell to hide it initially
bool bHideTreeView = ( !m_bEnableBrowser )
|| ( sal_False == rArguments.getOrDefault( "ShowTreeView", sal_True ) ) // compatibility name
- || ( sal_False == rArguments.getOrDefault( (OUString)PROPERTY_SHOW_BROWSER, sal_True ) );
+ || ( sal_False == rArguments.getOrDefault( OUString(PROPERTY_SHOW_BROWSER), sal_True ) );
OSL_ENSURE( !rArguments.has( "ShowTreeView" ),
"SbaTableQueryBrowser::impl_initialize: ShowTreeView is superseded by ShowBrowser!" );
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index d0c35b7..351a070 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -936,7 +936,7 @@ void OFieldDescControl::InitializeControl(Control* _pControl,const OString& _sHe
{
_pControl->SetHelpId(_sHelpId);
if ( _bAddChangeHandler )
- ((OPropListBoxCtrl*)_pControl)->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl));
+ static_cast<OPropListBoxCtrl*>(_pControl)->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl));
_pControl->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot));
_pControl->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost));
@@ -1465,25 +1465,25 @@ IMPL_LINK(OFieldDescControl, OnControlFocusLost, Control*, pControl )
{
if ((pControl == pLength) || (pControl == pTextLen) || (pControl == pScale))
{
- OPropNumericEditCtrl* pConverted = (OPropNumericEditCtrl*)pControl;
+ OPropNumericEditCtrl* pConverted = static_cast<OPropNumericEditCtrl*>(pControl);
if (pConverted->IsModified())
CellModified(-1, pConverted->GetPos());
}
if(pControl == m_pColumnName)
{
- OPropColumnEditCtrl* pConverted = (OPropColumnEditCtrl*)pControl;
+ OPropColumnEditCtrl* pConverted = static_cast<OPropColumnEditCtrl*>(pControl);
if (pConverted->IsModified())
CellModified(-1, pConverted->GetPos());
}
else if ((pControl == pDefault) || (pControl == pFormatSample) || (pControl == m_pAutoIncrementValue) )
{
- OPropEditCtrl* pConverted = (OPropEditCtrl*)pControl;
+ OPropEditCtrl* pConverted = static_cast<OPropEditCtrl*>(pControl);
if (pConverted->IsModified())
CellModified(-1, pConverted->GetPos());
}
else if ((pControl == pRequired) || (pControl == pNumType) || (pControl == pAutoIncrement) || (pControl == pBoolDefault) || (pControl == m_pType))
{
- OPropListBoxCtrl* pConverted = (OPropListBoxCtrl*)pControl;
+ OPropListBoxCtrl* pConverted = static_cast<OPropListBoxCtrl*>(pControl);
if (pConverted->IsModified())
CellModified(-1, pConverted->GetPos());
}
diff --git a/dbaccess/source/ui/dlg/odbcconfig.cxx b/dbaccess/source/ui/dlg/odbcconfig.cxx
index c301918..63d3f33 100644
--- a/dbaccess/source/ui/dlg/odbcconfig.cxx
+++ b/dbaccess/source/ui/dlg/odbcconfig.cxx
@@ -64,7 +64,7 @@ typedef SQLRETURN (SQL_API* TSQLDataSources) (SQLHENV EnvironmentHandle, SQLUSMA
#define NSQLAllocHandle(a,b,c) (*(TSQLAllocHandle)(m_pAllocHandle))(a,b,c)
#define NSQLFreeHandle(a,b) (*(TSQLFreeHandle)(m_pFreeHandle))(a,b)
-#define NSQLSetEnvAttr(a,b,c,d) (*(TSQLSetEnvAttr)(m_pSetEnvAttr))(a,b,c,d)
+#define NSQLSetEnvAttr(a,b,c,d) (*reinterpret_cast<TSQLSetEnvAttr>(m_pSetEnvAttr))(a,b,c,d)
#define NSQLDataSources(a,b,c,d,e,f,g,h) (*(TSQLDataSources)(m_pDataSources))(a,b,c,d,e,f,g,h)
#endif
@@ -179,7 +179,7 @@ bool OOdbcEnumeration::allocEnv()
// can't do anything without environment
return false;
- NSQLSetEnvAttr(m_pImpl->hEnvironment, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, SQL_IS_INTEGER);
+ NSQLSetEnvAttr(m_pImpl->hEnvironment, SQL_ATTR_ODBC_VERSION, reinterpret_cast<SQLPOINTER>(SQL_OV_ODBC3), SQL_IS_INTEGER);
return true;
#else
return sal_False;
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index f3978eb..ee5a791 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -798,7 +798,7 @@ void ODatabaseExport::ensureFormatter()
{
Reference< XNumberFormatsSupplier > xSupplier = m_xFormatter->getNumberFormatsSupplier();
Reference< XUnoTunnel > xTunnel(xSupplier,UNO_QUERY);
- SvNumberFormatsSupplierObj* pSupplierImpl = (SvNumberFormatsSupplierObj*)sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()));
+ SvNumberFormatsSupplierObj* pSupplierImpl = reinterpret_cast<SvNumberFormatsSupplierObj*>(xTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()));
m_pFormatter = pSupplierImpl ? pSupplierImpl->GetNumberFormatter() : NULL;
Reference<XPropertySet> xNumberFormatSettings = xSupplier->getNumberFormatSettings();
xNumberFormatSettings->getPropertyValue("NullDate") >>= m_aNullDate;
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index 1c1b8952..64d7d41 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -607,10 +607,10 @@ bool ORTFImportExport::Read()
if ( m_pStream )
{
m_pReader = new ORTFReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext);
- ((ORTFReader*)m_pReader)->AddFirstRef();
+ static_cast<ORTFReader*>(m_pReader)->AddFirstRef();
if ( isCheckEnabled() )
m_pReader->enableCheckOnly();
- eState = ((ORTFReader*)m_pReader)->CallParser();
+ eState = static_cast<ORTFReader*>(m_pReader)->CallParser();
m_pReader->release();
m_pReader = NULL;
}
@@ -678,11 +678,11 @@ bool OHTMLImportExport::Read()
if ( m_pStream )
{
m_pReader = new OHTMLReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext);
- ((OHTMLReader*)m_pReader)->AddFirstRef();
+ static_cast<OHTMLReader*>(m_pReader)->AddFirstRef();
if ( isCheckEnabled() )
m_pReader->enableCheckOnly();
m_pReader->SetTableName(m_sDefaultTableName);
- eState = ((OHTMLReader*)m_pReader)->CallParser();
+ eState = static_cast<OHTMLReader*>(m_pReader)->CallParser();
m_pReader->release();
m_pReader = NULL;
}
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 505ef77..9fc6725 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -937,7 +937,7 @@ void OCopyTableWizard::setCreatePrimaryKey( bool _bDoCreate, const OUString& _rS
IMPL_LINK_NOARG(OCopyTableWizard, ImplActivateHdl)
{
- OWizardPage* pCurrent = (OWizardPage*)GetPage(GetCurLevel());
+ OWizardPage* pCurrent = static_cast<OWizardPage*>(GetPage(GetCurLevel()));
if(pCurrent)
{
bool bFirstTime = pCurrent->IsFirstTime();
@@ -991,7 +991,7 @@ void OCopyTableWizard::EnableButton(Wizard_Button_Style eStyle, bool bEnable)
long OCopyTableWizard::DeactivatePage()
{
- OWizardPage* pPage = (OWizardPage*)GetPage(GetCurLevel());
+ OWizardPage* pPage = static_cast<OWizardPage*>(GetPage(GetCurLevel()));
return pPage ? pPage->LeavePage() : sal_False;
}
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx
index 3bb89f9..72e97da 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -87,7 +87,7 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId )
OSL_ENSURE(nRow == -1,"nRow muss -1 sein!");
(void)nRow;
- MultiListBox *pListBox = ((OWizTypeSelect*)m_pParentTabPage)->m_pColumnNames;
+ MultiListBox *pListBox = static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pColumnNames;
OFieldDescription* pCurFieldDescr = getCurrentFieldDescData();
@@ -192,22 +192,22 @@ const OTypeInfoMap* OWizTypeSelectControl::getTypeInfo() const
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> OWizTypeSelectControl::getMetaData()
{
- return ((OWizTypeSelect*)m_pParentTabPage)->m_pParent->m_xDestConnection->getMetaData();
+ return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->m_xDestConnection->getMetaData();
}
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> OWizTypeSelectControl::getConnection()
{
- return ((OWizTypeSelect*)m_pParentTabPage)->m_pParent->m_xDestConnection;
+ return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->m_xDestConnection;
}
bool OWizTypeSelectControl::isAutoIncrementValueEnabled() const
{
- return ((OWizTypeSelect*)m_pParentTabPage)->m_bAutoIncrementEnabled;
+ return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_bAutoIncrementEnabled;
}
OUString OWizTypeSelectControl::getAutoIncrementValue() const
{
- return ((OWizTypeSelect*)m_pParentTabPage)->m_sAutoIncrementValue;
+ return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_sAutoIncrementValue;
}
#define IMG_PRIMARY_KEY 1
@@ -364,7 +364,7 @@ void OWizTypeSelectList::setPrimaryKey(OFieldDescription* _pFieldDescr, sal_uInt
RemoveEntry(_nPos);
_pFieldDescr->SetPrimaryKey(_bSet);
if( _bSet )
- InsertEntry(sColumnName,((OWizTypeSelect*)m_pParentTabPage)->m_imgPKey,_nPos);
+ InsertEntry(sColumnName, static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_imgPKey,_nPos);
else if( _pFieldDescr->getTypeInfo()->bNullable )
{
_pFieldDescr->SetControlDefault(Any());
diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx
index bd5de5f..e40734f 100644
--- a/dbaccess/source/ui/misc/databaseobjectview.cxx
+++ b/dbaccess/source/ui/misc/databaseobjectview.cxx
@@ -164,14 +164,14 @@ namespace dbaui
Reference<XDataSource> xDataSource;
if ( _aDataSource >>= sDataSource )
{
- i_rDispatchArgs.put( (OUString)PROPERTY_DATASOURCENAME, sDataSource );
+ i_rDispatchArgs.put( OUString(PROPERTY_DATASOURCENAME), sDataSource );
}
else if ( _aDataSource >>= xDataSource )
{
- i_rDispatchArgs.put( (OUString)PROPERTY_DATASOURCE, xDataSource );
+ i_rDispatchArgs.put( OUString(PROPERTY_DATASOURCE), xDataSource );
}
- i_rDispatchArgs.put( (OUString)PROPERTY_ACTIVE_CONNECTION, getConnection() );
+ i_rDispatchArgs.put( OUString(PROPERTY_ACTIVE_CONNECTION), getConnection() );
}
// QueryDesigner
@@ -188,19 +188,19 @@ namespace dbaui
DatabaseObjectView::fillDispatchArgs( i_rDispatchArgs, _aDataSource, _rObjectName );
const bool bIncludeQueryName = !_rObjectName.isEmpty();
- const bool bGraphicalDesign = i_rDispatchArgs.getOrDefault( (OUString)PROPERTY_GRAPHICAL_DESIGN, sal_True );
+ const bool bGraphicalDesign = i_rDispatchArgs.getOrDefault( OUString(PROPERTY_GRAPHICAL_DESIGN), sal_True );
const bool bEditViewAsSQLCommand = ( m_nCommandType == CommandType::TABLE ) && !bGraphicalDesign;
- i_rDispatchArgs.put( (OUString)PROPERTY_COMMAND_TYPE, m_nCommandType );
+ i_rDispatchArgs.put( OUString(PROPERTY_COMMAND_TYPE), m_nCommandType );
if ( bIncludeQueryName )
{
- i_rDispatchArgs.put( (OUString)PROPERTY_COMMAND, _rObjectName );
+ i_rDispatchArgs.put( OUString(PROPERTY_COMMAND), _rObjectName );
}
if ( bEditViewAsSQLCommand )
{
- i_rDispatchArgs.put( (OUString)PROPERTY_ESCAPE_PROCESSING, sal_False );
+ i_rDispatchArgs.put( OUString(PROPERTY_ESCAPE_PROCESSING), sal_False );
}
}
@@ -217,7 +217,7 @@ namespace dbaui
if ( !_rObjectName.isEmpty() )
{
- i_rDispatchArgs.put( (OUString)PROPERTY_CURRENTTABLE, _rObjectName );
+ i_rDispatchArgs.put( OUString(PROPERTY_CURRENTTABLE), _rObjectName );
}
}
@@ -283,15 +283,15 @@ namespace dbaui
if ( m_bTable )
::dbtools::qualifiedNameComponents( getConnection()->getMetaData(), _rQualifiedName, sCatalog, sSchema, sTable, ::dbtools::eInDataManipulation );
- i_rDispatchArgs.put( (OUString)PROPERTY_COMMAND_TYPE, (m_bTable ? CommandType::TABLE : CommandType::QUERY) );
- i_rDispatchArgs.put( (OUString)PROPERTY_COMMAND, _rQualifiedName );
- i_rDispatchArgs.put( (OUString)PROPERTY_ENABLE_BROWSER, sal_False );
+ i_rDispatchArgs.put( OUString(PROPERTY_COMMAND_TYPE), (m_bTable ? CommandType::TABLE : CommandType::QUERY) );
+ i_rDispatchArgs.put( OUString(PROPERTY_COMMAND), _rQualifiedName );
+ i_rDispatchArgs.put( OUString(PROPERTY_ENABLE_BROWSER), sal_False );
if ( m_bTable )
{
- i_rDispatchArgs.put( (OUString)PROPERTY_UPDATE_CATALOGNAME, sCatalog );
- i_rDispatchArgs.put( (OUString)PROPERTY_UPDATE_SCHEMANAME, sSchema );
- i_rDispatchArgs.put( (OUString)PROPERTY_UPDATE_TABLENAME, sTable );
+ i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_CATALOGNAME), sCatalog );
+ i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_SCHEMANAME), sSchema );
+ i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_TABLENAME), sTable );
}
}
diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
index edd50cf..d9e4416 100644
--- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
+++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
@@ -187,7 +187,7 @@ namespace dbaui
const ::comphelper::NamedValueCollection& rArguments( getInitParams() );
Reference< XConnection > xConnection;
- xConnection = rArguments.getOrDefault( (OUString)PROPERTY_ACTIVE_CONNECTION, xConnection );
+ xConnection = rArguments.getOrDefault( OUString(PROPERTY_ACTIVE_CONNECTION), xConnection );
if ( !xConnection.is() )
::dbtools::isEmbeddedInDatabase( getModel(), xConnection );
diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx
index 04d417a..f203c41 100644
--- a/dbaccess/source/ui/misc/linkeddocuments.cxx
+++ b/dbaccess/source/ui/misc/linkeddocuments.cxx
@@ -151,7 +151,7 @@ namespace dbaui
}
aArguments.put( "OpenMode", sOpenMode );
- aArguments.put( (OUString)PROPERTY_ACTIVE_CONNECTION, m_xConnection );
+ aArguments.put( OUString(PROPERTY_ACTIVE_CONNECTION), m_xConnection );
try
{
Reference<XHierarchicalNameContainer> xHier(m_xDocumentContainer,UNO_QUERY);
@@ -273,7 +273,7 @@ namespace dbaui
::comphelper::NamedValueCollection aCreationArgs( i_rCreationArgs );
if ( aClassId.getLength() )
aCreationArgs.put( "ClassID", aClassId );
- aCreationArgs.put( (OUString)PROPERTY_ACTIVE_CONNECTION, m_xConnection );
+ aCreationArgs.put( OUString(PROPERTY_ACTIVE_CONNECTION), m_xConnection );
// separate values which are real creation args from args relevant for opening the doc
::comphelper::NamedValueCollection aCommandArgs;
diff --git a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx
index b109523..ba4de09 100644
--- a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx
+++ b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx
@@ -78,7 +78,7 @@ OConnectionLineDataRef OQueryTableConnectionData::CreateLineDataObj( const OConn
void OQueryTableConnectionData::CopyFrom(const OTableConnectionData& rSource)
{
// same as in base class, use of (non-virtual) operator=
- *this = (const OQueryTableConnectionData&)rSource;
+ *this = static_cast<const OQueryTableConnectionData&>(rSource);
}
OQueryTableConnectionData& OQueryTableConnectionData::operator=(const OQueryTableConnectionData& rConnData)
@@ -121,7 +121,7 @@ void OQueryTableConnectionData::InitFromDrag(const OTableFieldDescRef& rDragLeft
SetFieldType(JTCS_FROM, rDragLeft->GetFieldType());
SetFieldType(JTCS_TO, rDragRight->GetFieldType());
- AppendConnLine((OUString)rDragLeft->GetField(),(OUString)rDragRight->GetField());
+ AppendConnLine(rDragLeft->GetField(), rDragRight->GetField());
}
OTableConnectionData* OQueryTableConnectionData::NewInstance() const
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 20654da..1149d5f 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -388,7 +388,7 @@ void SAL_CALL OQueryController::getFastPropertyValue( Any& o_rValue, sal_Int32 i
{
::comphelper::NamedValueCollection aCurrentDesign;
aCurrentDesign.put( "GraphicalDesign", isGraphicalDesign() );
- aCurrentDesign.put( (OUString)PROPERTY_ESCAPE_PROCESSING, m_bEscapeProcessing );
+ aCurrentDesign.put( OUString(PROPERTY_ESCAPE_PROCESSING), m_bEscapeProcessing );
if ( isGraphicalDesign() )
{
@@ -888,8 +888,8 @@ void OQueryController::impl_initialize()
}
// non-legacy parameters which overwrite the legacy parameters
- rArguments.get_ensureType( (OUString)PROPERTY_COMMAND, sCommand );
- rArguments.get_ensureType( (OUString)PROPERTY_COMMAND_TYPE, m_nCommandType );
+ rArguments.get_ensureType( OUString(PROPERTY_COMMAND), sCommand );
+ rArguments.get_ensureType( OUString(PROPERTY_COMMAND_TYPE), m_nCommandType );
// translate Command/Type into proper members
// TODO/Later: all this (including those members) should be hidden behind some abstact interface,
@@ -913,17 +913,17 @@ void OQueryController::impl_initialize()
// more legacy parameters
bool bGraphicalDesign( true );
- if ( rArguments.get_ensureType( (OUString)PROPERTY_QUERYDESIGNVIEW, bGraphicalDesign ) )
+ if ( rArguments.get_ensureType( OUString(PROPERTY_QUERYDESIGNVIEW), bGraphicalDesign ) )
{
OSL_FAIL( "OQueryController::impl_initialize: QueryDesignView is regognized for compatibility only!" );
m_bGraphicalDesign = bGraphicalDesign;
}
// more non-legacy
- rArguments.get_ensureType( (OUString)PROPERTY_GRAPHICAL_DESIGN, m_bGraphicalDesign );
+ rArguments.get_ensureType( OUString(PROPERTY_GRAPHICAL_DESIGN), m_bGraphicalDesign );
bool bEscapeProcessing( true );
- if ( rArguments.get_ensureType( (OUString)PROPERTY_ESCAPE_PROCESSING, bEscapeProcessing ) )
+ if ( rArguments.get_ensureType( OUString(PROPERTY_ESCAPE_PROCESSING), bEscapeProcessing ) )
{
setEscapeProcessing_fireEvent( bEscapeProcessing );
@@ -940,13 +940,13 @@ void OQueryController::impl_initialize()
if ( aCurrentQueryDesignProps.getLength() )
{
::comphelper::NamedValueCollection aCurrentQueryDesign( aCurrentQueryDesignProps );
- if ( aCurrentQueryDesign.has( (OUString)PROPERTY_GRAPHICAL_DESIGN ) )
+ if ( aCurrentQueryDesign.has( OUString(PROPERTY_GRAPHICAL_DESIGN) ) )
{
- aCurrentQueryDesign.get_ensureType( (OUString)PROPERTY_GRAPHICAL_DESIGN, m_bGraphicalDesign );
+ aCurrentQueryDesign.get_ensureType( OUString(PROPERTY_GRAPHICAL_DESIGN), m_bGraphicalDesign );
}
- if ( aCurrentQueryDesign.has( (OUString)PROPERTY_ESCAPE_PROCESSING ) )
+ if ( aCurrentQueryDesign.has( OUString(PROPERTY_ESCAPE_PROCESSING) ) )
{
- aCurrentQueryDesign.get_ensureType( (OUString)PROPERTY_ESCAPE_PROCESSING, m_bEscapeProcessing );
+ aCurrentQueryDesign.get_ensureType( OUString(PROPERTY_ESCAPE_PROCESSING), m_bEscapeProcessing );
}
if ( aCurrentQueryDesign.has( "Statement" ) )
{
@@ -1987,7 +1987,7 @@ bool OQueryController::allowQueries() const
return false;
const NamedValueCollection& rArguments( getInitParams() );
- sal_Int32 nCommandType = rArguments.getOrDefault( (OUString)PROPERTY_COMMAND_TYPE, (sal_Int32)CommandType::QUERY );
+ sal_Int32 nCommandType = rArguments.getOrDefault( OUString(PROPERTY_COMMAND_TYPE), (sal_Int32)CommandType::QUERY );
bool bCreatingView = ( nCommandType == CommandType::TABLE );
return !bCreatingView;
}
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index a5ce0cf..ccee138 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -257,7 +257,7 @@ void ORelationTableView::AddNewRelation()
bool ORelationTableView::RemoveConnection( OTableConnection* pConn ,bool /*_bDelete*/)
{
- ORelationTableConnectionData* pTabConnData = (ORelationTableConnectionData*)pConn->GetData().get();
+ ORelationTableConnectionData* pTabConnData = static_cast<ORelationTableConnectionData*>(pConn->GetData().get());
try
{
if ( m_bInRemove || pTabConnData->DropRelation())
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 8dbaf56..1536dfe 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -504,7 +504,7 @@ void OTableController::impl_initialize()
const NamedValueCollection& rArguments( getInitParams() );
- rArguments.get_ensureType( (OUString)PROPERTY_CURRENTTABLE, m_sName );
+ rArguments.get_ensureType( OUString(PROPERTY_CURRENTTABLE), m_sName );
// read autoincrement value set in the datasource
::dbaui::fillAutoIncrementValue(getDataSource(),m_bAllowAutoIncrementValue,m_sAutoIncrementValue);
commit 0abf268f3893ecc716088aa399e81a1ef31e13d2
Author: Noel Grandin <noel at peralex.com>
Date: Thu Oct 2 10:33:43 2014 +0200
loplugin: cstylecast
Change-Id: I011a0eae37d01606d28c00f8ab3839f20bf309ce
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 74818e2..4fe4c00 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -320,7 +320,7 @@ public:
SfxChildWinInfo Class::GetInfo() const \
{ \
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
- ((SfxFloatingWindow*)GetWindow())->FillInfo( aInfo ); \
+ static_cast<SfxFloatingWindow*>(GetWindow())->FillInfo( aInfo ); \
return aInfo; }
#define SFX_IMPL_FLOATINGWINDOW_WITHID(Class, MyID) \
@@ -328,7 +328,7 @@ public:
SfxChildWinInfo Class::GetInfo() const \
{ \
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
- ((SfxFloatingWindow*)GetWindow())->FillInfo( aInfo ); \
+ static_cast<SfxFloatingWindow*>(GetWindow())->FillInfo( aInfo ); \
return aInfo; }
#define SFX_IMPL_MODELESSDIALOG_WITHID(Class, MyID) \
@@ -336,7 +336,7 @@ public:
SfxChildWinInfo Class::GetInfo() const \
{ \
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
- ((SfxModelessDialog*)GetWindow())->FillInfo( aInfo ); \
+ static_cast<SfxModelessDialog*>(GetWindow())->FillInfo( aInfo ); \
return aInfo; }
@@ -345,7 +345,7 @@ public:
SfxChildWinInfo Class::GetInfo() const \
{ \
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
- ((SfxDockingWindow*)GetWindow())->FillInfo( aInfo ); \
+ static_cast<SfxDockingWindow*>(GetWindow())->FillInfo( aInfo ); \
return aInfo; }
#define SFX_IMPL_DOCKINGWINDOW_WITHID(Class, MyID) \
@@ -353,7 +353,7 @@ public:
SfxChildWinInfo Class::GetInfo() const \
{ \
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
- ((SfxDockingWindow*)GetWindow())->FillInfo( aInfo ); \
+ static_cast<SfxDockingWindow*>(GetWindow())->FillInfo( aInfo ); \
return aInfo; }
#define SFX_IMPL_TOOLBOX(Class, MyID) \
@@ -361,7 +361,7 @@ public:
SfxChildWinInfo Class::GetInfo() const \
{ \
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
- ((SfxToolbox*)GetWindow())->FillInfo( aInfo ); \
+ static_cast<SfxToolbox*>(GetWindow())->FillInfo( aInfo ); \
return aInfo; }
bool GetPosSizeFromString( const OUString& rStr, Point& rPos, Size& rSize );
diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx
index f2598ef..aab9fb7 100644
--- a/include/svl/itemset.hxx
+++ b/include/svl/itemset.hxx
@@ -34,8 +34,8 @@ typedef SfxPoolItem const** SfxItemArray;
#define USHORT_ARG int
#define SFX_ITEMSET_GET( rSet, pItem, ItemType, nSlotId, bDeep ) \
- const ItemType *pItem = (const ItemType*) \
- (rSet).GetItem( nSlotId, bDeep, TYPE(ItemType) )
+ const ItemType *pItem = static_cast<const ItemType*>( \
+ (rSet).GetItem( nSlotId, bDeep, TYPE(ItemType) ) )
class SVL_DLLPUBLIC SfxItemSet
{
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index cf9aab2..f8d60b1 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -987,12 +987,12 @@ bool SfxDocumentPage::FillItemSet( SfxItemSet* rSet )
void SfxDocumentPage::Reset( const SfxItemSet* rSet )
{
// Determine the document information
- const SfxDocumentInfoItem *m_pInfoItem =
- &(const SfxDocumentInfoItem &)rSet->Get(SID_DOCINFO);
+ const SfxDocumentInfoItem& rInfoItem =
+ static_cast<const SfxDocumentInfoItem &>(rSet->Get(SID_DOCINFO));
// template data
- if ( m_pInfoItem->HasTemplate() )
- m_pTemplValFt->SetText( m_pInfoItem->getTemplateName() );
+ if ( rInfoItem.HasTemplate() )
+ m_pTemplValFt->SetText( rInfoItem.getTemplateName() );
else
{
m_pTemplFt->Hide();
@@ -1000,7 +1000,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
}
// determine file name
- OUString aFile( m_pInfoItem->GetValue() );
+ OUString aFile( rInfoItem.GetValue() );
OUString aFactory( aFile );
if ( aFile.getLength() > 2 && aFile[0] == '[' )
{
@@ -1023,7 +1023,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
else
{
DBG_ASSERT( pItem->IsA( TYPE( SfxStringItem ) ), "SfxDocumentPage:<SfxStringItem> expected" );
- aName = ( ( SfxStringItem* ) pItem )->GetValue();
+ aName = static_cast<const SfxStringItem*>( pItem )->GetValue();
}
m_pNameED->SetText( aName );
m_pNameED->ClearModifyFlag();
@@ -1078,31 +1078,31 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
m_pFileValFt->SetText( aURL.GetPartBeforeLastName() );
// handle access data
- bool m_bUseUserData = m_pInfoItem->IsUseUserData();
+ bool m_bUseUserData = rInfoItem.IsUseUserData();
const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
- m_pCreateValFt->SetText( ConvertDateTime_Impl( m_pInfoItem->getAuthor(),
- m_pInfoItem->getCreationDate(), rLocaleWrapper ) );
- util::DateTime aTime( m_pInfoItem->getModificationDate() );
+ m_pCreateValFt->SetText( ConvertDateTime_Impl( rInfoItem.getAuthor(),
+ rInfoItem.getCreationDate(), rLocaleWrapper ) );
+ util::DateTime aTime( rInfoItem.getModificationDate() );
if ( aTime.Month > 0 )
m_pChangeValFt->SetText( ConvertDateTime_Impl(
- m_pInfoItem->getModifiedBy(), aTime, rLocaleWrapper ) );
- aTime = m_pInfoItem->getPrintDate();
+ rInfoItem.getModifiedBy(), aTime, rLocaleWrapper ) );
+ aTime = rInfoItem.getPrintDate();
if ( aTime.Month > 0 )
- m_pPrintValFt->SetText( ConvertDateTime_Impl( m_pInfoItem->getPrintedBy(),
+ m_pPrintValFt->SetText( ConvertDateTime_Impl( rInfoItem.getPrintedBy(),
aTime, rLocaleWrapper ) );
- const long nTime = m_pInfoItem->getEditingDuration();
+ const long nTime = rInfoItem.getEditingDuration();
if ( m_bUseUserData )
{
const tools::Time aT( nTime/3600, (nTime%3600)/60, nTime%60 );
m_pTimeLogValFt->SetText( rLocaleWrapper.getDuration( aT ) );
m_pDocNoValFt->SetText( OUString::number(
- m_pInfoItem->getEditingCycles() ) );
+ rInfoItem.getEditingCycles() ) );
}
// Check for cmis properties where otherwise unavailable
- if ( m_pInfoItem->isCmisDocument( ) )
+ if ( rInfoItem.isCmisDocument( ) )
{
- uno::Sequence< document::CmisProperty > aCmisProps = m_pInfoItem->GetCmisProperties();
+ uno::Sequence< document::CmisProperty > aCmisProps = rInfoItem.GetCmisProperties();
for ( sal_Int32 i = 0; i < aCmisProps.getLength(); i++ )
{
if ( aCmisProps[i].Id == "cmis:contentStreamLength" &&
@@ -1162,8 +1162,8 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( vcl::Window* pParent,
"sfx/ui/documentpropertiesdialog.ui", &rItemSet)
, m_nDocInfoId(0)
{
- const SfxDocumentInfoItem* m_pInfoItem =
- &(const SfxDocumentInfoItem &)rItemSet.Get( SID_DOCINFO );
+ const SfxDocumentInfoItem& rInfoItem =
+ static_cast<const SfxDocumentInfoItem &>(rItemSet.Get( SID_DOCINFO ));
#ifdef DBG_UTIL
SFX_ITEMSET_ARG( &rItemSet, pURLItem, SfxStringItem, SID_BASEURL, false );
@@ -1177,7 +1177,7 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( vcl::Window* pParent,
rItemSet.GetItemState( SID_EXPLORER_PROPS_START, false, &pItem ) )
{
// File name
- OUString aFile( m_pInfoItem->GetValue() );
+ OUString aFile( rInfoItem.GetValue() );
INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
@@ -1214,7 +1214,7 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( vcl::Window* pParent,
void SfxDocumentInfoDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
if ( m_nDocInfoId == nId )
- ( (SfxDocumentPage&)rPage ).EnableUseUserData();
+ static_cast<SfxDocumentPage&>(rPage).EnableUseUserData();
}
void SfxDocumentInfoDialog::AddFontTabPage()
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index f4a1293..5124b47 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -206,7 +206,7 @@ SfxDockingWrapper::SfxDockingWrapper( vcl::Window* pParentWnd ,
pWindow->SetOutputSizePixel( Size( 270, 240 ) );
- ( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo );
+ static_cast<SfxDockingWindow*>( pWindow )->Initialize( pInfo );
SetHideNotDelete( true );
}
@@ -233,7 +233,7 @@ void SfxDockingWrapper::RegisterChildWindow (bool bVis, SfxModule *pMod, sal_uIn
SfxChildWinInfo SfxDockingWrapper::GetInfo() const
{
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo();
- ((SfxDockingWindow*)GetWindow())->FillInfo( aInfo );
+ static_cast<SfxDockingWindow*>(GetWindow())->FillInfo( aInfo );
return aInfo;
};
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index b6baf00..f7b9151 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -224,7 +224,7 @@ void SfxInfoBarWindow::Resize( )
IMPL_LINK_NOARG( SfxInfoBarWindow, CloseHandler )
{
- ((SfxInfoBarContainerWindow*)GetParent())->removeInfoBar( this );
+ static_cast<SfxInfoBarContainerWindow*>(GetParent())->removeInfoBar( this );
return 0;
}
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index d09b7cd..10bec55 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -45,7 +45,7 @@
*/
SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const SfxItemSet& rAttrSet)
: SfxTabPage(pParent, "ManageStylePage", "sfx/ui/managestylepage.ui", &rAttrSet)
- , pStyle(&((SfxStyleDialog*)GetParentDialog())->GetStyleSheet())
+ , pStyle(&static_cast<SfxStyleDialog*>(GetParentDialog())->GetStyleSheet())
, pItem(0)
, bModified(false)
, aName(pStyle->GetName())
@@ -191,7 +191,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
pTupel->nFlags != SFXSTYLEBIT_ALL )
{
m_pFilterLb->InsertEntry( pTupel->aName, nIdx );
- m_pFilterLb->SetEntryData(nIdx, (void*)(sal_IntPtr)i);
+ m_pFilterLb->SetEntryData(nIdx, reinterpret_cast<void*>(i));
if ( ( pTupel->nFlags & nMask ) == nMask )
nStyleFilterIdx = nIdx;
@@ -288,7 +288,7 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl()
{
const SfxPoolItem* pPoolItem = pModule->GetItem( SID_ATTR_METRIC );
if ( pPoolItem )
- eFieldUnit = (FieldUnit)( (SfxUInt16Item*)pPoolItem )->GetValue();
+ eFieldUnit = (FieldUnit) static_cast<const SfxUInt16Item*>( pPoolItem )->GetValue();
}
switch ( eFieldUnit )
@@ -380,7 +380,7 @@ bool SfxManageStyleSheetPage::FillItemSet( SfxItemSet* rSet )
bModified = true;
OSL_ENSURE( pItem, "No Item" );
// is only possibly for user templates
- sal_uInt16 nMask = pItem->GetFilterList()[ (size_t)m_pFilterLb->GetEntryData( nFilterIdx ) ]->nFlags | SFXSTYLEBIT_USERDEF;
+ sal_uInt16 nMask = pItem->GetFilterList()[ reinterpret_cast<size_t>(m_pFilterLb->GetEntryData( nFilterIdx )) ]->nFlags | SFXSTYLEBIT_USERDEF;
pStyle->SetMask( nMask );
}
if(m_pAutoCB->IsVisible() &&
@@ -506,7 +506,7 @@ void SfxManageStyleSheetPage::ActivatePage( const SfxItemSet& rSet)
if ( SfxItemState::SET ==
rSet.GetItemState( SID_ATTR_AUTO_STYLE_UPDATE, false, &pPoolItem ) )
- m_pAutoCB->Check( ( (const SfxBoolItem*)pPoolItem )->GetValue() );
+ m_pAutoCB->Check( static_cast<const SfxBoolItem*>(pPoolItem)->GetValue() );
m_pAutoCB->SaveValue();
}
diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx
index 334e777..eb3c76e 100644
--- a/sfx2/source/dialog/navigat.cxx
+++ b/sfx2/source/dialog/navigat.cxx
@@ -41,7 +41,7 @@ SfxNavigatorWrapper::SfxNavigatorWrapper( vcl::Window* pParentWnd ,
pWindow->SetHelpId ( HID_NAVIGATOR_WINDOW );
pWindow->SetOutputSizePixel( Size( 270, 240 ) );
- ( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo );
+ static_cast<SfxDockingWindow*>( pWindow )->Initialize( pInfo );
SetHideNotDelete( true );
}
diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx
index 8e34b5c..245dd61 100644
--- a/sfx2/source/dialog/partwnd.cxx
+++ b/sfx2/source/dialog/partwnd.cxx
@@ -65,10 +65,10 @@ SfxPartChildWnd_Impl::SfxPartChildWnd_Impl
assert(pInfo);
pInfo->nFlags |= SFX_CHILDWIN_FORCEDOCK;
- ((SfxDockingWindow*)pWindow)->SetFloatingSize( Size( 175, 175 ) );
+ static_cast<SfxDockingWindow*>(pWindow)->SetFloatingSize( Size( 175, 175 ) );
pWindow->SetSizePixel( Size( 175, 175 ) );
- ( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo );
+ static_cast<SfxDockingWindow*>(pWindow)->Initialize( pInfo );
SetHideNotDelete( true );
}
@@ -82,7 +82,7 @@ SfxPartChildWnd_Impl::~SfxPartChildWnd_Impl()
// But don't do it, if xFrame already exist. Then dispose() must come from inside ...
// and we need a valid pMgr for further operations ...
- SfxPartDockWnd_Impl* pWin = (SfxPartDockWnd_Impl*) pWindow;
+ SfxPartDockWnd_Impl* pWin = static_cast<SfxPartDockWnd_Impl*>(pWindow);
if ( pWin && xFrame == pWin->GetBindings().GetActiveFrame() )
pWin->GetBindings().SetActiveFrame( NULL );
@@ -90,7 +90,7 @@ SfxPartChildWnd_Impl::~SfxPartChildWnd_Impl()
bool SfxPartChildWnd_Impl::QueryClose()
{
- return ( (SfxPartDockWnd_Impl*)pWindow )->QueryClose();
+ return static_cast<SfxPartDockWnd_Impl*>(pWindow)->QueryClose();
}
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx
index 12f3540..981cd9c 100644
--- a/sfx2/source/dialog/recfloat.cxx
+++ b/sfx2/source/dialog/recfloat.cxx
@@ -134,7 +134,7 @@ SfxRecordingFloatWrapper_Impl::SfxRecordingFloatWrapper_Impl( vcl::Window* pPare
pWindow = new SfxRecordingFloat_Impl( pBindings, this, pParentWnd );
SetWantsFocus( false );
eChildAlignment = SFX_ALIGN_NOALIGNMENT;
- ( ( SfxFloatingWindow* ) pWindow )->Initialize( pInfo );
+ static_cast<SfxFloatingWindow*>(pWindow)->Initialize( pInfo );
}
SfxRecordingFloatWrapper_Impl::~SfxRecordingFloatWrapper_Impl()
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 45db4a6..855e9b7 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1258,13 +1258,13 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
aFilterLb.Clear();
//insert hierarchical at the beginning
sal_uInt16 nPos = aFilterLb.InsertEntry(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString(), 0);
- aFilterLb.SetEntryData( nPos, (void*)(sal_uIntPtr)SFXSTYLEBIT_ALL );
+ aFilterLb.SetEntryData( nPos, reinterpret_cast<void*>(SFXSTYLEBIT_ALL) );
const SfxStyleFilter& rFilter = pItem->GetFilterList();
for( size_t i = 0; i < rFilter.size(); ++i)
{
sal_uIntPtr nFilterFlags = rFilter[ i ]->nFlags;
nPos = aFilterLb.InsertEntry( rFilter[ i ]->aName );
- aFilterLb.SetEntryData( nPos, (void*)nFilterFlags );
+ aFilterLb.SetEntryData( nPos, reinterpret_cast<void*>(nFilterFlags) );
}
if(nActFilter < aFilterLb.GetEntryCount() - 1)
aFilterLb.SelectEntryPos(nActFilter + 1);
diff --git a/sfx2/source/dialog/tplpitem.cxx b/sfx2/source/dialog/tplpitem.cxx
index 19836f2..c31ac82 100644
--- a/sfx2/source/dialog/tplpitem.cxx
+++ b/sfx2/source/dialog/tplpitem.cxx
@@ -60,7 +60,7 @@ SfxTemplateItem::SfxTemplateItem( const SfxTemplateItem& rCopy ) :
bool SfxTemplateItem::operator==( const SfxPoolItem& rCmp ) const
{
return ( SfxFlagItem::operator==( rCmp ) &&
- aStyle == ( (const SfxTemplateItem&)rCmp ).aStyle );
+ aStyle == static_cast<const SfxTemplateItem&>(rCmp).aStyle );
}
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index e48a5cf..8858245 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2348,7 +2348,7 @@ void SfxMedium::GetMedium_Impl()
pImp->bDownloadDone = true;
pImp->aDoneLink.ClearPendingCall();
sal_uIntPtr nError = GetError();
- pImp->aDoneLink.Call( (void*)nError );
+ pImp->aDoneLink.Call( reinterpret_cast<void*>(nError) );
}
}
diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx
index 66c0329..7066374 100644
--- a/sfx2/source/doc/frmdescr.cxx
+++ b/sfx2/source/doc/frmdescr.cxx
@@ -186,7 +186,7 @@ bool SfxFrameDescriptorItem::operator==( const SfxPoolItem& rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
- return aProperties == ((SfxFrameDescriptorItem&)rAttr).aProperties;
+ return aProperties == static_cast<const SfxFrameDescriptorItem&>(rAttr).aProperties;
}
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index f96ae3d..de61da8 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1202,7 +1202,7 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
&& !(pImp->nFlagsInProgress & SFX_LOADED_MAINDOCUMENT ))
{
pImp->nFlagsInProgress |= SFX_LOADED_MAINDOCUMENT;
- ((SfxHeaderAttributes_Impl*)GetHeaderAttributes())->SetAttributes();
+ static_cast<SfxHeaderAttributes_Impl*>(GetHeaderAttributes())->SetAttributes();
pImp->bImportDone = true;
if( !IsAbortingImport() )
PositionView_Impl();
@@ -1669,19 +1669,19 @@ SvKeyValueIterator* SfxObjectShell::GetHeaderAttributes()
DBG_ASSERT( pMedium, "No Medium" );
pImp->xHeaderAttributes = new SfxHeaderAttributes_Impl( this );
}
- return ( SvKeyValueIterator*) &pImp->xHeaderAttributes;
+ return static_cast<SvKeyValueIterator*>( &pImp->xHeaderAttributes );
}
void SfxObjectShell::ClearHeaderAttributesForSourceViewHack()
{
- ((SfxHeaderAttributes_Impl*)GetHeaderAttributes())
+ static_cast<SfxHeaderAttributes_Impl*>(GetHeaderAttributes())
->ClearForSourceView();
}
void SfxObjectShell::SetHeaderAttributesForSourceViewHack()
{
- ((SfxHeaderAttributes_Impl*)GetHeaderAttributes())
+ static_cast<SfxHeaderAttributes_Impl*>(GetHeaderAttributes())
->SetAttributes();
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 22779e4..e5d5477 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1125,33 +1125,33 @@ void SfxObjectShell::ExecProps_Impl(SfxRequest &rReq)
{
case SID_MODIFIED:
{
- SetModified( ( (SfxBoolItem&) rReq.GetArgs()->Get(SID_MODIFIED)).GetValue() );
+ SetModified( static_cast<const SfxBoolItem&>(rReq.GetArgs()->Get(SID_MODIFIED)).GetValue() );
rReq.Done();
break;
}
case SID_DOCTITLE:
- SetTitle( ( (SfxStringItem&) rReq.GetArgs()->Get(SID_DOCTITLE)).GetValue() );
+ SetTitle( static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(SID_DOCTITLE)).GetValue() );
rReq.Done();
break;
case SID_DOCINFO_AUTHOR :
{
- OUString aStr = ( (SfxStringItem&)rReq.GetArgs()->Get(rReq.GetSlot())).GetValue();
+ OUString aStr = static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(rReq.GetSlot())).GetValue();
getDocProperties()->setAuthor( aStr );
break;
}
case SID_DOCINFO_COMMENTS :
{
- OUString aStr = ( (SfxStringItem&)rReq.GetArgs()->Get(rReq.GetSlot())).GetValue();
+ OUString aStr = static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(rReq.GetSlot())).GetValue();
getDocProperties()->setDescription( aStr );
break;
}
case SID_DOCINFO_KEYWORDS :
{
- OUString aStr = ( (SfxStringItem&)rReq.GetArgs()->Get(rReq.GetSlot())).GetValue();
+ OUString aStr = static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(rReq.GetSlot())).GetValue();
getDocProperties()->setKeywords(
::comphelper::string::convertCommaSeparated(aStr) );
break;
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index a5cef0d..f5b7f11 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1420,8 +1420,9 @@ bool SfxObjectShell::SaveTo_Impl
pFilter = rMedium.GetFilter();
- const SfxStringItem *pVersionItem = ( !rMedium.IsInCheckIn( ) && pSet ) ? (const SfxStringItem*)
- SfxRequest::GetItem( pSet, SID_DOCINFO_COMMENTS, false, TYPE(SfxStringItem) ) : NULL;
+ const SfxStringItem *pVersionItem = ( !rMedium.IsInCheckIn( ) && pSet )
+ ? static_cast<const SfxStringItem*>( SfxRequest::GetItem( pSet, SID_DOCINFO_COMMENTS, false, TYPE(SfxStringItem) ) )
+ : NULL;
OUString aTmpVersionURL;
if ( bOk )
@@ -1509,8 +1510,9 @@ bool SfxObjectShell::SaveTo_Impl
if ( bOk && pVersionItem && !rMedium.IsInCheckIn() )
{
// store a version also
- const SfxStringItem *pAuthorItem = pSet ? (const SfxStringItem*)
- SfxRequest::GetItem( pSet, SID_DOCINFO_AUTHOR, false, TYPE(SfxStringItem) ) : NULL;
+ const SfxStringItem *pAuthorItem = pSet
+ ? static_cast<const SfxStringItem*>( SfxRequest::GetItem( pSet, SID_DOCINFO_AUTHOR, false, TYPE(SfxStringItem) ) )
+ : NULL;
// version comment
util::RevisionTag aInfo;
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 2b4112b..92c5a1d 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -664,7 +664,7 @@ bool SfxObjectShell::PrepareClose
pPoolItem = pFrame->GetBindings().ExecuteSynchron( IsReadOnlyMedium() ? SID_SAVEASDOC : SID_SAVEDOC, ppArgs );
}
- if ( !pPoolItem || pPoolItem->ISA(SfxVoidItem) || ( pPoolItem->ISA(SfxBoolItem) && !( (const SfxBoolItem*) pPoolItem )->GetValue() ) )
+ if ( !pPoolItem || pPoolItem->ISA(SfxVoidItem) || ( pPoolItem->ISA(SfxBoolItem) && !static_cast<const SfxBoolItem*>( pPoolItem )->GetValue() ) )
return false;
}
else if ( RET_CANCEL == nRet )
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index ab3c404..56a64a5 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -819,7 +819,7 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin
::cppu::OInterfaceIteratorHelper pIterator(*pContainer);
while (pIterator.hasMoreElements())
- ((view::XPrintJobListener*)pIterator.next())->printJobEvent( aEvent );
+ static_cast<view::XPrintJobListener*>(pIterator.next())->printJobEvent( aEvent );
}
void SAL_CALL SfxPrintHelper::addPrintJobListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XPrintJobListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception)
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index e6fcb91..743f427 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -338,7 +338,7 @@ void SAL_CALL SfxPrintHelperListener_Impl::printJobEvent( const view::PrintJobEv
{
::cppu::OInterfaceIteratorHelper pIterator(*pContainer);
while (pIterator.hasMoreElements())
- ((view::XPrintJobListener*)pIterator.next())->printJobEvent( rEvent );
+ static_cast<view::XPrintJobListener*>(pIterator.next())->printJobEvent( rEvent );
}
}
@@ -1374,7 +1374,7 @@ void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::Clo
{
try
{
- ((util::XCloseListener*)pIterator.next())->queryClosing( aSource, bDeliverOwnership );
+ static_cast<util::XCloseListener*>(pIterator.next())->queryClosing( aSource, bDeliverOwnership );
}
catch( RuntimeException& )
{
@@ -1402,7 +1402,7 @@ void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::Clo
{
try
{
- ((util::XCloseListener*)pCloseIterator.next())->notifyClosing( aSource );
+ static_cast<util::XCloseListener*>(pCloseIterator.next())->notifyClosing( aSource );
}
catch( RuntimeException& )
{
@@ -3270,7 +3270,7 @@ void SfxBaseModel::notifyEvent( const document::EventObject& aEvent ) const
{
try
{
- ((document::XEventListener *)aIt.next())->notifyEvent( aEvent );
+ static_cast<document::XEventListener *>(aIt.next())->notifyEvent( aEvent );
}
catch( RuntimeException& )
{
@@ -3326,9 +3326,9 @@ sal_Int64 SAL_CALL SfxBaseModel::getSomething( const Sequence< sal_Int8 >& aIden
{
// SO3_GLOBAL_CLASSID is apparently used by binfilter :(
if ( aName == SvGlobalName( SO3_GLOBAL_CLASSID ) )
- return (sal_Int64)(sal_IntPtr)(SvObject*) pObjectShell;
+ return reinterpret_cast<sal_Int64>((SvObject*) pObjectShell);
else if ( aName == SvGlobalName( SFX_GLOBAL_CLASSID ) )
- return (sal_Int64)(sal_IntPtr)(SfxObjectShell*) pObjectShell;
+ return reinterpret_cast<sal_Int64>((SfxObjectShell*) pObjectShell);
}
}
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index ba10d49..fd3fa77 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -916,7 +916,7 @@ void SfxTemplateManagerDlg::OnTemplateImport ()
for (pIter = maSelFolders.begin(); pIter != maSelFolders.end(); ++pIter)
{
OUString aTemplateList;
- TemplateContainerItem *pFolder = (TemplateContainerItem*)(*pIter);
+ TemplateContainerItem *pFolder = const_cast<TemplateContainerItem*>(static_cast<const TemplateContainerItem*>(*pIter));
for (size_t i = 0, n = aFiles.getLength(); i < n; ++i)
{
@@ -1329,7 +1329,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
std::set<const ThumbnailViewItem*,selection_cmp_fn>::const_iterator pIter;
for (pIter = maSelFolders.begin(); pIter != maSelFolders.end(); ++pIter)
{
- TemplateContainerItem *pItem = (TemplateContainerItem*)(*pIter);
+ TemplateContainerItem *pItem = const_cast<TemplateContainerItem*>(static_cast<const TemplateContainerItem*>(*pIter));
if (!mpLocalView->isTemplateNameUnique(pItem->mnId,aName))
{
diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx
index 96bba6f..c776698 100644
--- a/sfx2/source/doc/zoomitem.cxx
+++ b/sfx2/source/doc/zoomitem.cxx
@@ -98,7 +98,7 @@ bool SvxZoomItem::operator==( const SfxPoolItem& rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
- SvxZoomItem& rItem = (SvxZoomItem&)rAttr;
+ const SvxZoomItem& rItem = static_cast<const SvxZoomItem&>(rAttr);
return ( GetValue() == rItem.GetValue() &&
nValueSet == rItem.GetValueSet() &&
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
index 9c22a05..92249fa 100644
--- a/sfx2/source/inet/inettbc.cxx
+++ b/sfx2/source/inet/inettbc.cxx
@@ -73,7 +73,7 @@ SfxURLToolBoxControl_Impl::~SfxURLToolBoxControl_Impl()
SvtURLBox* SfxURLToolBoxControl_Impl::GetURLBox() const
{
- return (SvtURLBox*)GetToolBox().GetItemWindow( GetId() );
+ return static_cast<SvtURLBox*>(GetToolBox().GetItemWindow( GetId() ));
}
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 69799c9..838d129 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -199,24 +199,24 @@ void SfxMenuControl::StateChanged
// BoolItem for check
DBG_ASSERT( GetId() < SID_OBJECTMENU0 || GetId() > SID_OBJECTMENU_LAST,
"SfxBoolItem not allowed for SID_OBJECTMENUx" );
- bCheck = ((const SfxBoolItem*)pState)->GetValue();
+ bCheck = static_cast<const SfxBoolItem*>(pState)->GetValue();
Menu* pMenu = pOwnMenu->GetSVMenu();
pMenu->SetItemBits( GetId() , pMenu->GetItemBits( GetId() ) | MIB_CHECKABLE);
}
else if ( pState->ISA(SfxEnumItemInterface) &&
- ((SfxEnumItemInterface *)pState)->HasBoolValue() )
+ static_cast<const SfxEnumItemInterface *>(pState)->HasBoolValue() )
{
// Treat EnumItem as Bool
DBG_ASSERT( GetId() < SID_OBJECTMENU0 || GetId() > SID_OBJECTMENU_LAST,
"SfxEnumItem not allowed for SID_OBJECTMENUx" );
- bCheck = ((SfxEnumItemInterface *)pState)->GetBoolValue();
+ bCheck = static_cast<const SfxEnumItemInterface *>(pState)->GetBoolValue();
Menu* pMenu = pOwnMenu->GetSVMenu();
pMenu->SetItemBits( GetId() , pMenu->GetItemBits( GetId() ) | MIB_CHECKABLE);
}
else if ( ( b_ShowStrings || bIsObjMenu ) && pState->ISA(SfxStringItem) )
{
// Get MenuText from SfxStringItem
- OUString aStr( ((const SfxStringItem*)pState)->GetValue() );
+ OUString aStr( static_cast<const SfxStringItem*>(pState)->GetValue() );
if ( aStr.startsWith("($1)") )
{
OUString aEntry(SfxResId(STR_UPDATEDOC).toString());
@@ -294,7 +294,7 @@ SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxB
PopupMenu* SfxMenuControl::GetPopup () const
{
if (GetPopupMenu())
- return (PopupMenu*)GetPopupMenu()->GetSVMenu();
+ return static_cast<PopupMenu*>(GetPopupMenu()->GetSVMenu());
else
return 0;
}
@@ -353,7 +353,7 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu )
bool bImageSet = false;
OUString aImageId;
::framework::MenuConfiguration::Attributes* pMenuAttributes =
- (::framework::MenuConfiguration::Attributes*)pMenu->GetUserValue( nItemId );
+ reinterpret_cast< ::framework::MenuConfiguration::Attributes*>(pMenu->GetUserValue( nItemId ));
if ( pMenuAttributes )
aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
@@ -439,7 +439,7 @@ long Select_Impl( void* /*pHdl*/, void* pVoid )
{
OUString aTargetFrame( "_blank" );
::framework::MenuConfiguration::Attributes* pMenuAttributes =
- (::framework::MenuConfiguration::Attributes*)pMenu->GetUserValue( pMenu->GetCurItemId() );
+ reinterpret_cast< ::framework::MenuConfiguration::Attributes*>(pMenu->GetUserValue( pMenu->GetCurItemId() ));
if ( pMenuAttributes )
aTargetFrame = pMenuAttributes->aTargetFrame;
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index 55eb988..6ff82a8 100644
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -254,7 +254,7 @@ void SfxPopupMenuManager::RemoveDisabledEntries()
sal_uInt16 SfxPopupMenuManager::Execute( const Point& rPos, vcl::Window* pWindow )
{
- sal_uInt16 nVal = ( (PopupMenu*) GetMenu()->GetSVMenu() )->Execute( pWindow, rPos );
+ sal_uInt16 nVal = static_cast<PopupMenu*>( GetMenu()->GetSVMenu() )->Execute( pWindow, rPos );
delete pStaticThesSubMenu; pStaticThesSubMenu = NULL;
return nVal;
}
@@ -319,7 +319,7 @@ SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFra
if ( pMenu )
{
delete pSVMenu;
- pSVMenu = (PopupMenu*) pMenu;
+ pSVMenu = static_cast<PopupMenu*>( pMenu );
}
SfxPopupMenuManager* aMgr = new SfxPopupMenuManager( pSVMenu, pFrame->GetBindings());
@@ -369,7 +369,7 @@ void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFram
if ( pMenu )
{
delete pSVMenu;
- pSVMenu = (PopupMenu*) pMenu;
+ pSVMenu = static_cast<PopupMenu*>( pMenu );
}
SfxPopupMenuManager aPop( pSVMenu, pFrame->GetBindings() );
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index 4c46417..bd81d69 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -295,12 +295,12 @@ void SfxVirtualMenu::CreateFromSVMenu()
if ( nPos != MENU_ITEM_NOTFOUND && xFrame.is() )
{
// Retrieve addon popup menus and add them to our menu bar
- framework::AddonMenuManager::MergeAddonPopupMenus( xFrame, nPos, (MenuBar *)pSVMenu, xContext );
+ framework::AddonMenuManager::MergeAddonPopupMenus( xFrame, nPos, static_cast<MenuBar *>(pSVMenu), xContext );
}
// Merge the Add-Ons help menu items into the Office help menu
if ( xFrame.is() )
- framework::AddonMenuManager::MergeAddonHelpMenu( xFrame, (MenuBar *)pSVMenu, xContext );
+ framework::AddonMenuManager::MergeAddonHelpMenu( xFrame, static_cast<MenuBar *>(pSVMenu), xContext );
// Set addon menu pointer here to avoid problems. When accessibility is enabled, the whole menu
// is created immediately!
@@ -440,7 +440,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
OUString aImageId;
::framework::MenuConfiguration::Attributes* pMenuAttributes =
- (::framework::MenuConfiguration::Attributes*)pSVMenu->GetUserValue( nSlotId );
+ reinterpret_cast< ::framework::MenuConfiguration::Attributes*>(pSVMenu->GetUserValue( nSlotId ));
if ( pMenuAttributes )
aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
@@ -512,7 +512,7 @@ IMPL_LINK_NOARG(SfxVirtualMenu, SettingsChanged)
OUString aImageId;
::framework::MenuConfiguration::Attributes* pMenuAttributes =
- (::framework::MenuConfiguration::Attributes*)pSVMenu->GetUserValue( nSlotId );
+ reinterpret_cast< ::framework::MenuConfiguration::Attributes*>(pSVMenu->GetUserValue( nSlotId ));
if ( pMenuAttributes )
aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
@@ -580,7 +580,7 @@ void SfxVirtualMenu::UpdateImages( Menu* pMenu )
OUString aImageId;
::framework::MenuConfiguration::Attributes* pMenuAttributes =
- (::framework::MenuConfiguration::Attributes*)pMenu->GetUserValue( nSlotId );
+ reinterpret_cast< ::framework::MenuConfiguration::Attributes*>(pMenu->GetUserValue( nSlotId ));
if ( pMenuAttributes )
aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index d0486db..9544b38 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -119,7 +119,7 @@ static vcl::Window* GetTopMostParentSystemWindow( vcl::Window* pWindow )
while ( pWindow )
{
if ( pWindow->IsSystemWindow() )
- pTopMostSysWin = (SystemWindow*)pWindow;
+ pTopMostSysWin = static_cast<SystemWindow*>(pWindow);
pWindow = pWindow->GetParent();
}
pWindow = pTopMostSysWin;
@@ -204,7 +204,7 @@ IMPL_LINK( SfxToolBoxControl_Impl, WindowEventListener, VclSimpleEvent*, pEvent
(( pEvent->GetId() == VCLEVENT_WINDOW_MOVE ) ||
( pEvent->GetId() == VCLEVENT_WINDOW_ACTIVATE )))
{
- vcl::Window* pWindow( ((VclWindowEvent*)pEvent)->GetWindow() );
+ vcl::Window* pWindow( static_cast<VclWindowEvent*>(pEvent)->GetWindow() );
if (( pWindow == mpFloatingWindow ) &&
( mpPopupWindow != 0 ))
{
@@ -826,7 +826,7 @@ void SfxToolBoxControl::createAndPositionSubToolBar( const OUString& rSubToolBar
vcl::Window* pTbxWindow = VCLUnoHelper::GetWindow( xSubToolBar );
ToolBox* pToolBar( 0 );
if ( pTbxWindow && pTbxWindow->GetType() == WINDOW_TOOLBOX )
- pToolBar = (ToolBox *)pTbxWindow;
+ pToolBar = static_cast<ToolBox *>(pTbxWindow);
if ( pToolBar )
{
@@ -921,20 +921,20 @@ void SfxToolBoxControl::StateChanged
if ( pState->ISA(SfxBoolItem) )
{
// BoolItem for checking
- if ( ((const SfxBoolItem*)pState)->GetValue() )
+ if ( static_cast<const SfxBoolItem*>(pState)->GetValue() )
eTri = TRISTATE_TRUE;
nItemBits |= TIB_CHECKABLE;
}
else if ( pState->ISA(SfxEnumItemInterface) &&
- ((SfxEnumItemInterface *)pState)->HasBoolValue())
+ static_cast<const SfxEnumItemInterface *>(pState)->HasBoolValue())
{
// EnumItem is handled as Bool
- if ( ((const SfxEnumItemInterface *)pState)->GetBoolValue() )
+ if ( static_cast<const SfxEnumItemInterface *>(pState)->GetBoolValue() )
eTri = TRISTATE_TRUE;
nItemBits |= TIB_CHECKABLE;
}
else if ( pImpl->bShowString && pState->ISA(SfxStringItem) )
- pImpl->pBox->SetItemText(nId, ((const SfxStringItem*)pState)->GetValue() );
+ pImpl->pBox->SetItemText(nId, static_cast<const SfxStringItem*>(pState)->GetValue() );
}
break;
@@ -1150,7 +1150,7 @@ SfxPopupWindow::SfxPopupWindow(
{
vcl::Window* pWindow = GetTopMostParentSystemWindow( this );
if ( pWindow )
- ((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
+ static_cast<SystemWindow *>(pWindow)->GetTaskPaneList()->AddWindow( this );
}
SfxPopupWindow::SfxPopupWindow(sal_uInt16 nId, const OString& rID, const OUString& rUIXMLDescription,
@@ -1164,7 +1164,7 @@ SfxPopupWindow::SfxPopupWindow(sal_uInt16 nId, const OString& rID, const OUStrin
{
vcl::Window* pWindow = GetTopMostParentSystemWindow( this );
if ( pWindow )
- ((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
+ static_cast<SystemWindow *>(pWindow)->GetTaskPaneList()->AddWindow( this );
}
SfxPopupWindow::SfxPopupWindow(
@@ -1181,7 +1181,7 @@ SfxPopupWindow::SfxPopupWindow(
{
vcl::Window* pWindow = GetTopMostParentSystemWindow( this );
if ( pWindow )
- ((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
+ static_cast<SystemWindow *>(pWindow)->GetTaskPaneList()->AddWindow( this );
}
SfxPopupWindow::SfxPopupWindow(
@@ -1198,7 +1198,7 @@ SfxPopupWindow::SfxPopupWindow(
{
vcl::Window* pWindow = GetTopMostParentSystemWindow( this );
if ( pWindow )
- ((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
+ static_cast<SystemWindow *>(pWindow)->GetTaskPaneList()->AddWindow( this );
}
SfxPopupWindow::~SfxPopupWindow()
@@ -1211,7 +1211,7 @@ SfxPopupWindow::~SfxPopupWindow()
vcl::Window* pWindow = GetTopMostParentSystemWindow( this );
if ( pWindow )
- ((SystemWindow *)pWindow)->GetTaskPaneList()->RemoveWindow( this );
+ static_cast<SystemWindow *>(pWindow)->GetTaskPaneList()->RemoveWindow( this );
}
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 2fd824c..054abf8 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -544,8 +544,8 @@ SfxFrameItem::SfxFrameItem( SfxFrame *p ):
bool SfxFrameItem::operator==( const SfxPoolItem &rItem ) const
{
- return ((SfxFrameItem&)rItem).pFrame == pFrame &&
- ((SfxFrameItem&)rItem).wFrame == wFrame;
+ return static_cast<const SfxFrameItem&>(rItem).pFrame == pFrame &&
+ static_cast<const SfxFrameItem&>(rItem).wFrame == wFrame;
}
diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx
index 4a9cb22..5701c33 100644
--- a/sfx2/source/view/frame2.cxx
+++ b/sfx2/source/view/frame2.cxx
@@ -349,7 +349,7 @@ SystemWindow* SfxFrame::GetSystemWindow() const
SystemWindow* SfxFrame::GetTopWindow_Impl() const
{
if ( pImp->pExternalContainerWindow->IsSystemWindow() )
- return (SystemWindow*) pImp->pExternalContainerWindow;
+ return static_cast<SystemWindow*>( pImp->pExternalContainerWindow );
else
return NULL;
}
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index f62610a..0d08a0d 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -951,7 +951,7 @@ void SfxBaseController::BorderWidthsChanged_Impl()
{
try
{
- ((frame::XBorderResizeListener*)pIterator.next())->borderWidthsChanged( xThis, aBWidths );
+ static_cast<frame::XBorderResizeListener*>(pIterator.next())->borderWidthsChanged( xThis, aBWidths );
}
catch (const RuntimeException&)
{
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index e4e44d1..0dac4a7 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -251,7 +251,7 @@ void SfxViewNotificatedFrameList_Impl::Notify( SfxBroadcaster& rBC, const SfxHin
switch( pSimpleHint->GetId() )
{
case SFX_HINT_DYING:
- SfxViewFrame* pFrame = (SfxViewFrame*) &rBC;
+ SfxViewFrame* pFrame = dynamic_cast<SfxViewFrame*>(&rBC);
if( pFrame )
{
iterator it = std::find( begin(), end(), pFrame );
@@ -964,7 +964,7 @@ void SfxViewFrame::ExecHistory_Impl( SfxRequest &rReq )
// The SW has its own undo in the View
const SfxPoolItem *pRet = GetViewShell()->ExecuteSlot( rReq );
if ( pRet )
- bOK = ((SfxBoolItem*)pRet)->GetValue();
+ bOK = static_cast<const SfxBoolItem*>(pRet)->GetValue();
}
rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), bOK ) );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list