diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-08 16:29:41 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-08 16:29:41 +0200 |
commit | f6ec07a3963a401dc736baa9bdd2ed3c7325bb66 (patch) | |
tree | 9cad620eb2cd5846464cf151b10949a8e36e5200 /vcl | |
parent | 9f356d3e66127bf14fe957962e8451dbd27c8ac8 (diff) |
loplugin:cstylecast: deal with remaining pointer casts
Change-Id: I07bf1403e6b992807541a499b786d47f835b2f81
Diffstat (limited to 'vcl')
70 files changed, 270 insertions, 270 deletions
diff --git a/vcl/generic/fontmanager/parseAFM.cxx b/vcl/generic/fontmanager/parseAFM.cxx index e6427389f191..82cb46f3f6a3 100644 --- a/vcl/generic/fontmanager/parseAFM.cxx +++ b/vcl/generic/fontmanager/parseAFM.cxx @@ -267,7 +267,7 @@ static char *token( FileInputStream* stream, int& rLen ) ch = stream->getChar(); } - if (ch == -1 && idx < 1) return ((char *)NULL); + if (ch == -1 && idx < 1) return (nullptr); if (idx >= 1 && ch != ':' && ch != -1) stream->ungetChar(); if (idx < 1 ) ident[idx++] = ch; /* single-character token */ ident[idx] = 0; diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index d6a2116321f8..5688aac71867 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -1581,7 +1581,7 @@ bool ServerFont::GetGlyphOutline( sal_GlyphId aGlyphId, aFuncs.cubic_to = &FT_cubic_to; aFuncs.shift = 0; aFuncs.delta = 0; - rc = FT_Outline_Decompose( &rOutline, &aFuncs, (void*)&aPolyArg ); + rc = FT_Outline_Decompose( &rOutline, &aFuncs, static_cast<void*>(&aPolyArg) ); aPolyArg.ClosePolygon(); // close last polygon FT_Done_Glyph( pGlyphFT ); diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx index 8d1c6f543d01..43550f2d4b15 100644 --- a/vcl/generic/glyphs/gcach_layout.cxx +++ b/vcl/generic/glyphs/gcach_layout.cxx @@ -135,7 +135,7 @@ static hb_blob_t *getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pU hb_blob_t* pBlob = NULL; if (pBuffer != NULL) - pBlob = hb_blob_create(reinterpret_cast<const char*>(pBuffer), nLength, HB_MEMORY_MODE_READONLY, (void*) pBuffer, NULL); + pBlob = hb_blob_create(reinterpret_cast<const char*>(pBuffer), nLength, HB_MEMORY_MODE_READONLY, const_cast<unsigned char *>(pBuffer), NULL); return pBlob; } diff --git a/vcl/generic/glyphs/scrptrun.h b/vcl/generic/glyphs/scrptrun.h index 625ca7b63215..4b44b6ba6b71 100644 --- a/vcl/generic/glyphs/scrptrun.h +++ b/vcl/generic/glyphs/scrptrun.h @@ -88,7 +88,7 @@ public: UBool next(); /** - * ICU "poor man's RTTI", returns a UClassID for the actual class. +s * ICU "poor man's RTTI", returns a UClassID for the actual class. * * @stable ICU 2.2 */ @@ -99,7 +99,7 @@ public: * * @stable ICU 2.2 */ - static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; } + static inline UClassID getStaticClassID() { return static_cast<UClassID>(const_cast<char *>(&fgClassID)); } private: diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx index 9d74f048ae3a..e024f08fd13e 100644 --- a/vcl/generic/print/prtsetup.cxx +++ b/vcl/generic/print/prtsetup.cxx @@ -45,22 +45,22 @@ void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDParser* pParser, con if( m_aJobData.m_aContext.checkConstraints( pKey, pValue ) ) { - if( rBox.GetEntryPos( (void*)pValue ) == LISTBOX_ENTRY_NOTFOUND ) + if( rBox.GetEntryPos( static_cast<void const *>(pValue) ) == LISTBOX_ENTRY_NOTFOUND ) { nPos = rBox.InsertEntry( aOptionText, LISTBOX_APPEND ); - rBox.SetEntryData( nPos, (void*)pValue ); + rBox.SetEntryData( nPos, const_cast<PPDValue *>(pValue) ); } } else { - if( ( nPos = rBox.GetEntryPos( (void*)pValue ) ) != LISTBOX_ENTRY_NOTFOUND ) + if( ( nPos = rBox.GetEntryPos( static_cast<void const *>(pValue) ) ) != LISTBOX_ENTRY_NOTFOUND ) rBox.RemoveEntry( nPos ); } } pValue = m_aJobData.m_aContext.getValue( pKey ); if (pValue && !pValue->m_bCustomOption) { - if( ( nPos = rBox.GetEntryPos( (void*)pValue ) ) != LISTBOX_ENTRY_NOTFOUND ) + if( ( nPos = rBox.GetEntryPos( static_cast<void const *>(pValue) ) ) != LISTBOX_ENTRY_NOTFOUND ) rBox.SelectEntryPos( nPos ); } else @@ -370,7 +370,7 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) { OUString aEntry( m_pParent->m_aJobData.m_pParser->translateKey( pKey->getKey() ) ); sal_uInt16 nPos = m_pPPDKeyBox->InsertEntry( aEntry ); - m_pPPDKeyBox->SetEntryData( nPos, (void*)pKey ); + m_pPPDKeyBox->SetEntryData( nPos, const_cast<PPDKey *>(pKey) ); } } } @@ -485,11 +485,11 @@ void RTSDevicePage::FillValueBox( const PPDKey* pKey ) else aEntry = OUString(m_pParent->m_aJobData.m_pParser->translateOption( pKey->getKey(), pValue->m_aOption)); sal_uInt16 nPos = m_pPPDValueBox->InsertEntry( aEntry ); - m_pPPDValueBox->SetEntryData( nPos, (void*)pValue ); + m_pPPDValueBox->SetEntryData( nPos, const_cast<PPDValue *>(pValue) ); } } pValue = m_pParent->m_aJobData.m_aContext.getValue( pKey ); - m_pPPDValueBox->SelectEntryPos( m_pPPDValueBox->GetEntryPos( (void*)pValue ) ); + m_pPPDValueBox->SelectEntryPos( m_pPPDValueBox->GetEntryPos( static_cast<void const *>(pValue) ) ); if (pValue->m_bCustomOption) { m_pCustomValue = pValue; diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx index a30a2b3d621a..6b4e10f6d88f 100644 --- a/vcl/generic/print/text_gfx.cxx +++ b/vcl/generic/print/text_gfx.cxx @@ -701,7 +701,7 @@ PrinterGfx::writeResources( osl::File* pFile, std::list< OString >& rSuppliedFon if (pFile->setPos(osl_Pos_Current, -1) == osl::FileBase::E_None) { sal_uInt64 uBytes(1); - pFile->read((void *)(&lastchar), uBytes, uBytes); + pFile->read(static_cast<void *>(&lastchar), uBytes, uBytes); } if (lastchar != '\n') diff --git a/vcl/headless/svpdummies.cxx b/vcl/headless/svpdummies.cxx index b5e033a127ea..ab151d725497 100644 --- a/vcl/headless/svpdummies.cxx +++ b/vcl/headless/svpdummies.cxx @@ -26,7 +26,7 @@ SvpSalObject::SvpSalObject() { // fast and easy cross-platform wiping of the data - memset( (void *)&m_aSystemChildData, 0, sizeof( SystemEnvData ) ); + memset( static_cast<void *>(&m_aSystemChildData), 0, sizeof( SystemEnvData ) ); m_aSystemChildData.nSize = sizeof( SystemEnvData ); } diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 362a91cbb8f6..459a71070bb3 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -88,7 +88,7 @@ SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance, { // SAL_DEBUG("SvpSalFrame::SvpSalFrame: " << this); // fast and easy cross-platform wiping of the data - memset( (void *)&m_aSystemChildData, 0, sizeof( SystemEnvData ) ); + memset( static_cast<void *>(&m_aSystemChildData), 0, sizeof( SystemEnvData ) ); m_aSystemChildData.nSize = sizeof( SystemEnvData ); #ifdef IOS // Nothing diff --git a/vcl/osx/PictToBmpFlt.cxx b/vcl/osx/PictToBmpFlt.cxx index 77c67a654107..5300c9905569 100644 --- a/vcl/osx/PictToBmpFlt.cxx +++ b/vcl/osx/PictToBmpFlt.cxx @@ -32,7 +32,7 @@ bool ImageToPNG( com::sun::star::uno::Sequence<sal_Int8>& rImgData, { (void) eInFormat; // Really not needed? Weird. - NSData* pData = [NSData dataWithBytesNoCopy: (void*)rImgData.getConstArray() length: rImgData.getLength() freeWhenDone: 0]; + NSData* pData = [NSData dataWithBytesNoCopy: const_cast<sal_Int8 *>(rImgData.getConstArray()) length: rImgData.getLength() freeWhenDone: 0]; if( !pData) return false; diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm index c50f4c1dd5cb..a90f917f3813 100644 --- a/vcl/osx/a11ywrapper.mm +++ b/vcl/osx/a11ywrapper.mm @@ -149,7 +149,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { // (getter with parameter) attributeNameHereAttributeForParameter: // (setter) setAttributeNameHereAttributeForElement:to: -(SEL)selectorForAttribute:(NSString *)attribute asGetter:(BOOL)asGetter withGetterParameter:(BOOL)withGetterParameter { - SEL selector = (SEL)nil; + SEL selector = static_cast<SEL>(nil); NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ]; @try { // step 1: create method name from attribute name @@ -175,7 +175,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { // step 2: create selector selector = NSSelectorFromString ( methodName ); } @catch ( id exception ) { - selector = (SEL)nil; + selector = static_cast<SEL>(nil); } [ pool release ]; return selector; diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 8036a0f11f9e..1e15ee2bf87c 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -1639,13 +1639,13 @@ private: aInputEvent.maText = aInsertString; aInputEvent.mnCursorPos = selRange.location; aInputEvent.mpTextAttr = &aInputFlags[0]; - mpFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void *)&aInputEvent ); + mpFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void *>(&aInputEvent) ); } else { aInputEvent.maText.clear(); aInputEvent.mnCursorPos = 0; aInputEvent.mnCursorFlags = 0; aInputEvent.mpTextAttr = 0; - mpFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void *)&aInputEvent ); + mpFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void *>(&aInputEvent) ); mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, 0 ); } mbKeyHandled= true; @@ -1712,7 +1712,7 @@ private: YIELD_GUARD; SalExtTextInputPosEvent aPosEvent; - mpFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void *)&aPosEvent ); + mpFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, static_cast<void *>(&aPosEvent) ); NSRect rect; diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 2d8f5c53f59a..0d6c710f46ca 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -884,7 +884,7 @@ void* AquaSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rRetur { rReturnedBytes = 1; rReturnedType = AsciiCString; - return (void*)""; + return const_cast<char *>(""); } // We need to re-encode file urls because osl_getFileURLFromSystemPath converts diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx index e200ad2903ec..ae778fee40d5 100644 --- a/vcl/qa/cppunit/complextext.cxx +++ b/vcl/qa/cppunit/complextext.cxx @@ -43,7 +43,7 @@ void VclComplexTextTest::testArabic() OUString aOneTwoThree( reinterpret_cast<char const *>(pOneTwoThreeUTF8), SAL_N_ELEMENTS( pOneTwoThreeUTF8 ) - 1, RTL_TEXTENCODING_UTF8 ); - VclPtr<vcl::Window> pWin = VclPtr<WorkWindow>::Create( (vcl::Window *)nullptr ); + VclPtr<vcl::Window> pWin = VclPtr<WorkWindow>::Create( static_cast<vcl::Window *>(nullptr) ); CPPUNIT_ASSERT( pWin ); OutputDevice *pOutDev = static_cast< OutputDevice * >( pWin.get() ); diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 607fbd9f62c8..274da6bfdc2e 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -208,7 +208,7 @@ bool CoreTextStyle::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolyg GgoData aGgoData; aGgoData.mpPolyPoly = &rResult; - CGPathApply( xPath, (void*)&aGgoData, MyCGPathApplierFunc ); + CGPathApply( xPath, static_cast<void*>(&aGgoData), MyCGPathApplierFunc ); #if 0 // TODO: does OSX ensure that the last polygon is always closed? const CGPathElement aClosingElement = { kCGPathElementCloseSubpath, NULL }; MyCGPathApplierFunc( (void*)&aGgoData, &aClosingElement ); diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index 4ee39d3ff630..a2d43649f2f1 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -960,7 +960,7 @@ bool QuartzSalBitmap::GetSystemData( BitmapSystemData& rData ) mxGraphicContext = mxGraphicContextNew; } - rData.rImageContext = (void *) mxGraphicContext; + rData.rImageContext = static_cast<void *>(mxGraphicContext); rData.mnWidth = mnWidth; rData.mnHeight = mnHeight; } diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 52cf48acf816..6a1b18af04c6 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -676,7 +676,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV // use the font subsetter to get the widths TrueTypeFont* pSftFont = NULL; - int nRC = ::OpenTTFontBuffer( (void*)&aBuffer[0], aBuffer.size(), 0, &pSftFont); + int nRC = ::OpenTTFontBuffer( static_cast<void*>(&aBuffer[0]), aBuffer.size(), 0, &pSftFont); if( nRC != SF_OK ) return; @@ -694,7 +694,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV { for( int i = 0; i < nGlyphCount; ++i ) rGlyphWidths[i] = pGlyphMetrics[i].adv; - free( (void*)pGlyphMetrics ); + free( const_cast<TTSimpleGlyphMetrics *>(pGlyphMetrics) ); } FontCharMapPtr pMap = mpFontData->GetFontCharMap(); diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 1464f18ce323..30f8086da031 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -226,7 +226,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, // prepare data for psprint's font subsetter TrueTypeFont* pSftFont = NULL; - int nRC = ::OpenTTFontBuffer( (void*)&aBuffer[0], aBuffer.size(), 0, &pSftFont); + int nRC = ::OpenTTFontBuffer( static_cast<void*>(&aBuffer[0]), aBuffer.size(), 0, &pSftFont); if( nRC != SF_OK ) return false; diff --git a/vcl/source/app/dndhelp.cxx b/vcl/source/app/dndhelp.cxx index bba7452ca2ee..82961c2d154b 100644 --- a/vcl/source/app/dndhelp.cxx +++ b/vcl/source/app/dndhelp.cxx @@ -74,7 +74,7 @@ vcl::unohelper::DragAndDropWrapper::~DragAndDropWrapper() uno::Any vcl::unohelper::DragAndDropWrapper::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException, std::exception) { uno::Any aRet = ::cppu::queryInterface( rType, - (static_cast< ::com::sun::star::lang::XEventListener* >( (::com::sun::star::datatransfer::dnd::XDragGestureListener*)this) ), + (static_cast< ::com::sun::star::lang::XEventListener* >( static_cast<com::sun::star::datatransfer::dnd::XDragGestureListener*>(this)) ), (static_cast< ::com::sun::star::datatransfer::dnd::XDragGestureListener* >(this)), (static_cast< ::com::sun::star::datatransfer::dnd::XDragSourceListener* >(this)), (static_cast< ::com::sun::star::datatransfer::dnd::XDropTargetListener* >(this)) ); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 97621a5b1c87..536e81b7d229 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -675,7 +675,7 @@ void Application::RemoveKeyListener( const Link<>& rKeyListener ) bool Application::HandleKey( sal_uLong nEvent, vcl::Window *pWin, KeyEvent* pKeyEvent ) { // let listeners process the key event - VclWindowEvent aEvent( pWin, nEvent, (void *) pKeyEvent ); + VclWindowEvent aEvent( pWin, nEvent, static_cast<void *>(pKeyEvent) ); ImplSVData* pSVData = ImplGetSVData(); bool bProcessed = false; diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx index f2d221d743d3..53c90cab4c77 100644 --- a/vcl/source/components/dtranscomp.cxx +++ b/vcl/source/components/dtranscomp.cxx @@ -514,17 +514,17 @@ Reference< XInterface > SAL_CALL DropTarget_createInstance( const Reference< XMu */ Reference< XInterface > SalInstance::CreateClipboard( const Sequence< Any >& ) { - return Reference< XInterface >( ( cppu::OWeakObject * )new vcl::GenericClipboard() ); + return Reference< XInterface >( static_cast<cppu::OWeakObject *>(new vcl::GenericClipboard()) ); } Reference< XInterface > SalInstance::CreateDragSource() { - return Reference< XInterface >( ( cppu::OWeakObject * )new vcl::GenericDragSource() ); + return Reference< XInterface >( static_cast<cppu::OWeakObject *>(new vcl::GenericDragSource()) ); } Reference< XInterface > SalInstance::CreateDropTarget() { - return Reference< XInterface >( ( cppu::OWeakObject * )new vcl::GenericDropTarget() ); + return Reference< XInterface >( static_cast<cppu::OWeakObject *>(new vcl::GenericDropTarget()) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 4ba8095ace4b..096452a21baf 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1051,7 +1051,7 @@ Size ComboBox::CalcAdjustedSize( const Size& rPrefSize ) const { Size aSz = rPrefSize; sal_Int32 nLeft, nTop, nRight, nBottom; - ((vcl::Window*)this)->GetBorder( nLeft, nTop, nRight, nBottom ); + static_cast<vcl::Window*>(const_cast<ComboBox *>(this))->GetBorder( nLeft, nTop, nRight, nBottom ); aSz.Height() -= nTop+nBottom; if ( !IsDropDownBox() ) { @@ -1367,7 +1367,7 @@ void ComboBox::SetNoSelection() Rectangle ComboBox::GetBoundingRectangle( sal_Int32 nItem ) const { Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem ); - Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (vcl::Window*)this ); + Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( static_cast<vcl::Window*>(const_cast<ComboBox *>(this)) ); aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() ); return aRect; } diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 2cf7dfb9407a..57360822dbb3 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -3008,8 +3008,8 @@ void ImplListBoxFloatingWindow::setPosSizePixel( long nX, long nY, long nWidth, // The number also cannot be calculated by List/Combobox, as for // this the presence of the vertical Scrollbar has to be known. mpImplLB->SetSizePixel( GetOutputSizePixel() ); - ((vcl::Window*)mpImplLB)->Resize(); - ((vcl::Window*)mpImplLB->GetMainWindow())->Resize(); + static_cast<vcl::Window*>(mpImplLB)->Resize(); + static_cast<vcl::Window*>(mpImplLB->GetMainWindow())->Resize(); } } diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 6944518cef79..b476d8647ada 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -1170,7 +1170,7 @@ bool ListBox::IsInDropDown() const Rectangle ListBox::GetBoundingRectangle( sal_Int32 nItem ) const { Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem ); - Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (vcl::Window*)this ); + Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( static_cast<vcl::Window*>(const_cast<ListBox *>(this)) ); aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() ); return aRect; } @@ -1295,7 +1295,7 @@ Size ListBox::CalcAdjustedSize( const Size& rPrefSize ) const { Size aSz = rPrefSize; sal_Int32 nLeft, nTop, nRight, nBottom; - ((vcl::Window*)this)->GetBorder( nLeft, nTop, nRight, nBottom ); + static_cast<vcl::Window*>(const_cast<ListBox *>(this))->GetBorder( nLeft, nTop, nRight, nBottom ); aSz.Height() -= nTop+nBottom; if ( !IsDropDownBox() ) { diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index 11471c8c7f3d..f4b87780f1f8 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -1251,7 +1251,7 @@ Size VclMultiLineEdit::CalcMinimumSize() const Size aSz = pImpVclMEdit->CalcMinimumSize(); sal_Int32 nLeft, nTop, nRight, nBottom; - ((vcl::Window*)this)->GetBorder( nLeft, nTop, nRight, nBottom ); + static_cast<vcl::Window*>(const_cast<VclMultiLineEdit *>(this))->GetBorder( nLeft, nTop, nRight, nBottom ); aSz.Width() += nLeft+nRight; aSz.Height() += nTop+nBottom; @@ -1262,7 +1262,7 @@ Size VclMultiLineEdit::CalcAdjustedSize( const Size& rPrefSize ) const { Size aSz = rPrefSize; sal_Int32 nLeft, nTop, nRight, nBottom; - ((vcl::Window*)this)->GetBorder( nLeft, nTop, nRight, nBottom ); + static_cast<vcl::Window*>(const_cast<VclMultiLineEdit *>(this))->GetBorder( nLeft, nTop, nRight, nBottom ); // center vertically for whole lines @@ -1283,7 +1283,7 @@ Size VclMultiLineEdit::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) c Size aSz = pImpVclMEdit->CalcBlockSize( nColumns, nLines ); sal_Int32 nLeft, nTop, nRight, nBottom; - ((vcl::Window*)this)->GetBorder( nLeft, nTop, nRight, nBottom ); + static_cast<vcl::Window*>(const_cast<VclMultiLineEdit *>(this))->GetBorder( nLeft, nTop, nRight, nBottom ); aSz.Width() += nLeft+nRight; aSz.Height() += nTop+nBottom; return aSz; diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx index 77706e065583..a716ad719626 100644 --- a/vcl/source/fontsubset/gsub.cxx +++ b/vcl/source/fontsubset/gsub.cxx @@ -307,7 +307,7 @@ bool ReadGSUB( struct _TrueTypeFont* pTTFile, if( !aSubstVector.empty() ) { GlyphSubstitution* pGSubstitution = new GlyphSubstitution; - pTTFile->pGSubstitution = (void*)pGSubstitution; + pTTFile->pGSubstitution = static_cast<void*>(pGSubstitution); for( subst_it = aSubstVector.begin(); subst_it != aSubstVector.end(); ++subst_it ) (*pGSubstitution)[ (*subst_it).first ] = (*subst_it).second; } diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx index 6f467b0a0d6e..db3367d6a905 100644 --- a/vcl/source/fontsubset/ttcr.cxx +++ b/vcl/source/fontsubset/ttcr.cxx @@ -925,7 +925,7 @@ TrueTypeTable *TrueTypeTableNew_head(sal_uInt32 fontRevision, PutUInt16(fontDirectionHint, ptr, 48, 1); PutUInt16(0, ptr, 52, 1); /* glyph data format: 0 */ - table->data = (void *) ptr; + table->data = static_cast<void *>(ptr); table->tag = T_head; table->rawdata = 0; @@ -954,7 +954,7 @@ TrueTypeTable *TrueTypeTableNew_hhea(sal_Int16 ascender, PutUInt16(0, ptr, 30, 1); /* reserved 5 */ PutUInt16(0, ptr, 32, 1); /* metricDataFormat */ - table->data = (void *) ptr; + table->data = static_cast<void *>(ptr); table->tag = T_hhea; table->rawdata = 0; @@ -997,7 +997,7 @@ TrueTypeTable *TrueTypeTableNew_glyf() assert(l != 0); - listSetElementDtor(l, (list_destructor)FreeGlyphData); + listSetElementDtor(l, FreeGlyphData); table->data = l; table->rawdata = 0; @@ -1054,7 +1054,7 @@ TrueTypeTable *TrueTypeTableNew_name(int n, NameRecord *nr) assert(l != 0); - listSetElementDtor(l, (list_destructor)DisposeNameRecord); + listSetElementDtor(l, DisposeNameRecord); if (n != 0) { int i; diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx index ad1b5cc744e1..0e93985a87b2 100644 --- a/vcl/source/gdi/alpha.cxx +++ b/vcl/source/gdi/alpha.cxx @@ -51,7 +51,7 @@ AlphaMask::~AlphaMask() AlphaMask& AlphaMask::operator=( const Bitmap& rBitmap ) { - *(Bitmap*) this = rBitmap; + *static_cast<Bitmap*>(this) = rBitmap; if( !!rBitmap ) Bitmap::Convert( BMP_CONVERSION_8BIT_GREYS ); @@ -68,7 +68,7 @@ void AlphaMask::ImplSetBitmap( const Bitmap& rBitmap ) { SAL_WARN_IF( 8 != rBitmap.GetBitCount(), "vcl.gdi", "Bitmap should be 8bpp, not " << rBitmap.GetBitCount() << "bpp" ); SAL_WARN_IF( !rBitmap.HasGreyPalette(), "vcl.gdi", "Bitmap isn't greyscale" ); - *(Bitmap*) this = rBitmap; + *static_cast<Bitmap*>(this) = rBitmap; } Bitmap AlphaMask::GetBitmap() const diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx index fc8b6e91fe73..b0d99c54405a 100644 --- a/vcl/source/gdi/gdimetafiletools.cxx +++ b/vcl/source/gdi/gdimetafiletools.cxx @@ -875,7 +875,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) tools::PolyPolygon aPath; { // read SvtGraphicFill - SvMemoryStream aMemStm((void*)pA->GetData(), pA->GetDataSize(),StreamMode::READ); + SvMemoryStream aMemStm(const_cast<sal_uInt8 *>(pA->GetData()), pA->GetDataSize(),StreamMode::READ); ReadSvtGraphicFill( aMemStm, aFilling ); } @@ -916,7 +916,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) Polygon aPath; { // read SvtGraphicFill - SvMemoryStream aMemStm((void*)pA->GetData(), pA->GetDataSize(),StreamMode::READ); + SvMemoryStream aMemStm(const_cast<sal_uInt8 *>(pA->GetData()), pA->GetDataSize(),StreamMode::READ); ReadSvtGraphicStroke( aMemStm, aStroke ); } diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 94be557415aa..fcb661159c2e 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -1196,7 +1196,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) { if ( pCommentAct->GetDataSize() ) { - SvMemoryStream aMemStm( (void*)pCommentAct->GetData(), pCommentAct->GetDataSize(), StreamMode::READ ); + SvMemoryStream aMemStm( const_cast<sal_uInt8 *>(pCommentAct->GetData()), pCommentAct->GetDataSize(), StreamMode::READ ); SvMemoryStream aDest; if ( bPathStroke ) { diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx index 9d7cea0b529a..2176ee562ab3 100644 --- a/vcl/source/gdi/impanmvw.cxx +++ b/vcl/source/gdi/impanmvw.cxx @@ -308,7 +308,7 @@ AInfo* ImplAnimView::createAInfo() const pAInfo->aStartOrg = maPt; pAInfo->aStartSize = maSz; pAInfo->pOutDev = mpOut; - pAInfo->pViewData = (void*) this; + pAInfo->pViewData = const_cast<ImplAnimView *>(this); pAInfo->nExtraData = mnExtraData; pAInfo->bPause = mbPause; diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 887bf7f621db..10b0e7f469ed 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -293,7 +293,7 @@ void MetaPixelAction::Execute( OutputDevice* pOut ) MetaAction* MetaPixelAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaPixelAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaPixelAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -348,7 +348,7 @@ void MetaPointAction::Execute( OutputDevice* pOut ) MetaAction* MetaPointAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaPointAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaPointAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -412,7 +412,7 @@ void MetaLineAction::Execute( OutputDevice* pOut ) MetaAction* MetaLineAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaLineAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaLineAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -481,7 +481,7 @@ void MetaRectAction::Execute( OutputDevice* pOut ) MetaAction* MetaRectAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaRectAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaRectAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -538,7 +538,7 @@ void MetaRoundRectAction::Execute( OutputDevice* pOut ) MetaAction* MetaRoundRectAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaRoundRectAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaRoundRectAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -595,7 +595,7 @@ void MetaEllipseAction::Execute( OutputDevice* pOut ) MetaAction* MetaEllipseAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaEllipseAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaEllipseAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -650,7 +650,7 @@ void MetaArcAction::Execute( OutputDevice* pOut ) MetaAction* MetaArcAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaArcAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaArcAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -715,7 +715,7 @@ void MetaPieAction::Execute( OutputDevice* pOut ) MetaAction* MetaPieAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaPieAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaPieAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -780,7 +780,7 @@ void MetaChordAction::Execute( OutputDevice* pOut ) MetaAction* MetaChordAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaChordAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaChordAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -851,7 +851,7 @@ void MetaPolyLineAction::Execute( OutputDevice* pOut ) MetaAction* MetaPolyLineAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaPolyLineAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaPolyLineAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -933,7 +933,7 @@ void MetaPolygonAction::Execute( OutputDevice* pOut ) MetaAction* MetaPolygonAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaPolygonAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaPolygonAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -1002,7 +1002,7 @@ void MetaPolyPolygonAction::Execute( OutputDevice* pOut ) MetaAction* MetaPolyPolygonAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaPolyPolygonAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaPolyPolygonAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -1115,7 +1115,7 @@ void MetaTextAction::Execute( OutputDevice* pOut ) MetaAction* MetaTextAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaTextAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaTextAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -1225,7 +1225,7 @@ void MetaTextArrayAction::Execute( OutputDevice* pOut ) MetaAction* MetaTextArrayAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaTextArrayAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaTextArrayAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -1365,7 +1365,7 @@ void MetaStretchTextAction::Execute( OutputDevice* pOut ) MetaAction* MetaStretchTextAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaStretchTextAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaStretchTextAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -1443,7 +1443,7 @@ void MetaTextRectAction::Execute( OutputDevice* pOut ) MetaAction* MetaTextRectAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaTextRectAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaTextRectAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -1519,7 +1519,7 @@ void MetaTextLineAction::Execute( OutputDevice* pOut ) MetaAction* MetaTextLineAction::Clone() { - MetaAction* pClone = (MetaAction*)new MetaTextLineAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaTextLineAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -1598,7 +1598,7 @@ void MetaBmpAction::Execute( OutputDevice* pOut ) MetaAction* MetaBmpAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaBmpAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaBmpAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -1659,7 +1659,7 @@ void MetaBmpScaleAction::Execute( OutputDevice* pOut ) MetaAction* MetaBmpScaleAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaBmpScaleAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaBmpScaleAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -1729,7 +1729,7 @@ void MetaBmpScalePartAction::Execute( OutputDevice* pOut ) MetaAction* MetaBmpScalePartAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaBmpScalePartAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaBmpScalePartAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -1861,7 +1861,7 @@ void MetaBmpExScaleAction::Execute( OutputDevice* pOut ) MetaAction* MetaBmpExScaleAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaBmpExScaleAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaBmpExScaleAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -1931,7 +1931,7 @@ void MetaBmpExScalePartAction::Execute( OutputDevice* pOut ) MetaAction* MetaBmpExScalePartAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaBmpExScalePartAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaBmpExScalePartAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2005,7 +2005,7 @@ void MetaMaskAction::Execute( OutputDevice* pOut ) MetaAction* MetaMaskAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaMaskAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaMaskAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2069,7 +2069,7 @@ void MetaMaskScaleAction::Execute( OutputDevice* pOut ) MetaAction* MetaMaskScaleAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaMaskScaleAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaMaskScaleAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2142,7 +2142,7 @@ void MetaMaskScalePartAction::Execute( OutputDevice* pOut ) MetaAction* MetaMaskScalePartAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaMaskScalePartAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaMaskScalePartAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2216,7 +2216,7 @@ void MetaGradientAction::Execute( OutputDevice* pOut ) MetaAction* MetaGradientAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaGradientAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaGradientAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2276,7 +2276,7 @@ void MetaGradientExAction::Execute( OutputDevice* pOut ) MetaAction* MetaGradientExAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaGradientExAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaGradientExAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2338,7 +2338,7 @@ void MetaHatchAction::Execute( OutputDevice* pOut ) MetaAction* MetaHatchAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaHatchAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaHatchAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2401,7 +2401,7 @@ void MetaWallpaperAction::Execute( OutputDevice* pOut ) MetaAction* MetaWallpaperAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaWallpaperAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaWallpaperAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2460,7 +2460,7 @@ void MetaClipRegionAction::Execute( OutputDevice* pOut ) MetaAction* MetaClipRegionAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaClipRegionAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaClipRegionAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2516,7 +2516,7 @@ void MetaISectRectClipRegionAction::Execute( OutputDevice* pOut ) MetaAction* MetaISectRectClipRegionAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaISectRectClipRegionAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaISectRectClipRegionAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2569,7 +2569,7 @@ void MetaISectRegionClipRegionAction::Execute( OutputDevice* pOut ) MetaAction* MetaISectRegionClipRegionAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaISectRegionClipRegionAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaISectRegionClipRegionAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2624,7 +2624,7 @@ void MetaMoveClipRegionAction::Execute( OutputDevice* pOut ) MetaAction* MetaMoveClipRegionAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaMoveClipRegionAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaMoveClipRegionAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2681,7 +2681,7 @@ void MetaLineColorAction::Execute( OutputDevice* pOut ) MetaAction* MetaLineColorAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaLineColorAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaLineColorAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2731,7 +2731,7 @@ void MetaFillColorAction::Execute( OutputDevice* pOut ) MetaAction* MetaFillColorAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaFillColorAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaFillColorAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2776,7 +2776,7 @@ void MetaTextColorAction::Execute( OutputDevice* pOut ) MetaAction* MetaTextColorAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaTextColorAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaTextColorAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2823,7 +2823,7 @@ void MetaTextFillColorAction::Execute( OutputDevice* pOut ) MetaAction* MetaTextFillColorAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaTextFillColorAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaTextFillColorAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2873,7 +2873,7 @@ void MetaTextLineColorAction::Execute( OutputDevice* pOut ) MetaAction* MetaTextLineColorAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaTextLineColorAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaTextLineColorAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2923,7 +2923,7 @@ void MetaOverlineColorAction::Execute( OutputDevice* pOut ) MetaAction* MetaOverlineColorAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaOverlineColorAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaOverlineColorAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -2969,7 +2969,7 @@ void MetaTextAlignAction::Execute( OutputDevice* pOut ) MetaAction* MetaTextAlignAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaTextAlignAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaTextAlignAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3013,7 +3013,7 @@ void MetaMapModeAction::Execute( OutputDevice* pOut ) MetaAction* MetaMapModeAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaMapModeAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaMapModeAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3073,7 +3073,7 @@ void MetaFontAction::Execute( OutputDevice* pOut ) MetaAction* MetaFontAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaFontAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaFontAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3130,7 +3130,7 @@ void MetaPushAction::Execute( OutputDevice* pOut ) MetaAction* MetaPushAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaPushAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaPushAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3169,7 +3169,7 @@ void MetaPopAction::Execute( OutputDevice* pOut ) MetaAction* MetaPopAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaPopAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaPopAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3206,7 +3206,7 @@ void MetaRasterOpAction::Execute( OutputDevice* pOut ) MetaAction* MetaRasterOpAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaRasterOpAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaRasterOpAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3252,7 +3252,7 @@ void MetaTransparentAction::Execute( OutputDevice* pOut ) MetaAction* MetaTransparentAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaTransparentAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaTransparentAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3325,7 +3325,7 @@ void MetaFloatTransparentAction::Execute( OutputDevice* pOut ) MetaAction* MetaFloatTransparentAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaFloatTransparentAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaFloatTransparentAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3394,7 +3394,7 @@ void MetaEPSAction::Execute( OutputDevice* pOut ) MetaAction* MetaEPSAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaEPSAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaEPSAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3464,7 +3464,7 @@ void MetaRefPointAction::Execute( OutputDevice* pOut ) MetaAction* MetaRefPointAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaRefPointAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaRefPointAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3544,7 +3544,7 @@ void MetaCommentAction::Execute( OutputDevice* pOut ) MetaAction* MetaCommentAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaCommentAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaCommentAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3558,7 +3558,7 @@ void MetaCommentAction::Move( long nXMove, long nYMove ) bool bPathStroke = (maComment == "XPATHSTROKE_SEQ_BEGIN"); if ( bPathStroke || maComment == "XPATHFILL_SEQ_BEGIN" ) { - SvMemoryStream aMemStm( (void*)mpData, mnDataSize, StreamMode::READ ); + SvMemoryStream aMemStm( static_cast<void*>(mpData), mnDataSize, StreamMode::READ ); SvMemoryStream aDest; if ( bPathStroke ) { @@ -3614,7 +3614,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale ) bool bPathStroke = (maComment == "XPATHSTROKE_SEQ_BEGIN"); if ( bPathStroke || maComment == "XPATHFILL_SEQ_BEGIN" ) { - SvMemoryStream aMemStm( (void*)mpData, mnDataSize, StreamMode::READ ); + SvMemoryStream aMemStm( static_cast<void*>(mpData), mnDataSize, StreamMode::READ ); SvMemoryStream aDest; if ( bPathStroke ) { @@ -3636,7 +3636,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale ) delete[] mpData; ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() ); } else if( maComment == "EMF_PLUS_HEADER_INFO" ){ - SvMemoryStream aMemStm( (void*)mpData, mnDataSize, StreamMode::READ ); + SvMemoryStream aMemStm( static_cast<void*>(mpData), mnDataSize, StreamMode::READ ); SvMemoryStream aDest; sal_Int32 nLeft(0), nRight(0), nTop(0), nBottom(0); @@ -3724,7 +3724,7 @@ void MetaLayoutModeAction::Execute( OutputDevice* pOut ) MetaAction* MetaLayoutModeAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaLayoutModeAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaLayoutModeAction( *this )); pClone->ResetRefCount(); return pClone; } @@ -3769,7 +3769,7 @@ void MetaTextLanguageAction::Execute( OutputDevice* pOut ) MetaAction* MetaTextLanguageAction::Clone() { - MetaAction* pClone = (MetaAction*) new MetaTextLanguageAction( *this ); + MetaAction* pClone = static_cast<MetaAction*>(new MetaTextLanguageAction( *this )); pClone->ResetRefCount(); return pClone; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 5bd32277186f..fc13cbb5d765 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1757,7 +1757,7 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal m_pCodec( NULL ), m_pMemStream(NULL), m_aDocDigest( rtl_digest_createMD5() ), - m_aCipher( (rtlCipher)NULL ), + m_aCipher( nullptr ), m_aDigest( NULL ), m_nKeyLength(0), m_nRC4KeyLength(0), @@ -6631,7 +6631,7 @@ my_NSS_CMSAttributeArray_AddAttr(PLArenaPool *poolp, NSSCMSAttribute ***attrs, N goto loser; /* XXX or would it be better to replace it? */ /* no, shove it in */ - if (my_NSS_CMSArray_Add(poolp, reinterpret_cast<void ***>(attrs), (void *)attr) != SECSuccess) + if (my_NSS_CMSArray_Add(poolp, reinterpret_cast<void ***>(attrs), static_cast<void *>(attr)) != SECSuccess) goto loser; PORT_ArenaUnmark(poolp, mark); diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 1bea52978961..9c4150f8f57a 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -550,7 +550,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa const sal_uInt8* pData = pA->GetData(); if ( pData ) { - SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), StreamMode::READ ); + SvMemoryStream aMemStm( const_cast<sal_uInt8 *>(pData), pA->GetDataSize(), StreamMode::READ ); bool bSkipSequence = false; OString sSeqEnd; diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index ef6e1ac4d311..0c713bdfa83b 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -1315,7 +1315,7 @@ SystemWindowData OpenGLContext::generateWinData(vcl::Window* pParent, bool) if( vi ) { SAL_INFO("vcl.opengl", "using VisualID " << vi->visualid); - aWinData.pVisual = (void*)(vi->visual); + aWinData.pVisual = static_cast<void*>(vi->visual); } #endif diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 718cef96f455..48ac3730956a 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -430,7 +430,7 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const if ( aVDev->SetOutputSizePixel( aRect.GetSize() ) ) { - if ( ((OutputDevice*)aVDev.get())->mpGraphics || ((OutputDevice*)aVDev.get())->AcquireGraphics() ) + if ( static_cast<OutputDevice*>(aVDev.get())->mpGraphics || static_cast<OutputDevice*>(aVDev.get())->AcquireGraphics() ) { if ( (nWidth > 0) && (nHeight > 0) ) { @@ -438,7 +438,7 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const (aRect.Left() < mnOutOffX) ? (mnOutOffX - aRect.Left()) : 0L, (aRect.Top() < mnOutOffY) ? (mnOutOffY - aRect.Top()) : 0L, nWidth, nHeight); - (((OutputDevice*)aVDev.get())->mpGraphics)->CopyBits( aPosAry, mpGraphics, this, this ); + (static_cast<OutputDevice*>(aVDev.get())->mpGraphics)->CopyBits( aPosAry, mpGraphics, this, this ); } else { diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 216c8a6f8fcd..eb43913f3deb 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -610,7 +610,7 @@ void OutputDevice::ImplClearAllFontData(bool bNewFontLists) if ( pFrame->AcquireGraphics() ) { // Stupid typecast here and somewhere ((OutputDevice*)&aVDev)->, because bug in .NET2002 compiler - OutputDevice *pDevice = (OutputDevice*)pFrame; + OutputDevice *pDevice = static_cast<OutputDevice*>(pFrame); pDevice->mpGraphics->ClearDevFontCache(); pDevice->mpGraphics->GetDevFontList(pFrame->mpWindowImpl->mpFrameData->mpFontCollection); } diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 639151d50a76..9c4f07131bb3 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -255,7 +255,7 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout ) // draw text into upper left corner rSalLayout.DrawBase() -= aBoundRect.TopLeft(); - rSalLayout.DrawText( *((OutputDevice*)pVDev)->mpGraphics ); + rSalLayout.DrawText( *static_cast<OutputDevice*>(pVDev)->mpGraphics ); Bitmap aBmp = pVDev->GetBitmap( Point(), aBoundRect.GetSize() ); if ( !aBmp || !aBmp.Rotate( mpFontEntry->mnOwnOrientation, COL_WHITE ) ) @@ -2817,8 +2817,8 @@ bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector, { Point& rPt = rPoly[k]; rPt -= aOffset; - int nPixelX = rPt.X() - ((OutputDevice*)aVDev.get())->mnTextOffX + nXOffset; - int nPixelY = rPt.Y() - ((OutputDevice*)aVDev.get())->mnTextOffY; + int nPixelX = rPt.X() - static_cast<OutputDevice*>(aVDev.get())->mnTextOffX + nXOffset; + int nPixelY = rPt.Y() - static_cast<OutputDevice*>(aVDev.get())->mnTextOffY; rPt.X() = ImplDevicePixelToLogicWidth( nPixelX ); rPt.Y() = ImplDevicePixelToLogicHeight( nPixelY ); } diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 2275169eb4f0..34f01a305b42 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -695,8 +695,8 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, { ScopedVclPtrInstance< VirtualDevice > xVDev; - ((OutputDevice*)xVDev.get())->mnDPIX = mnDPIX; - ((OutputDevice*)xVDev.get())->mnDPIY = mnDPIY; + static_cast<OutputDevice*>(xVDev.get())->mnDPIX = mnDPIX; + static_cast<OutputDevice*>(xVDev.get())->mnDPIY = mnDPIY; if( xVDev->SetOutputSizePixel( aDstRect.GetSize() ) ) { diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index f4250be4de59..7d01ba35778a 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1089,7 +1089,7 @@ void Dialog::GrabFocusToFirstControl() void Dialog::GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder, sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const { - ScopedVclPtrInstance<ImplBorderWindow> aImplWin( (vcl::Window*)this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP ); + ScopedVclPtrInstance<ImplBorderWindow> aImplWin( static_cast<vcl::Window*>(const_cast<Dialog *>(this)), WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP ); aImplWin->GetBorder( rLeftBorder, rTopBorder, rRightBorder, rBottomBorder ); } diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index eda79c040bbd..ec6a9b6e6153 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -360,7 +360,7 @@ void Window::ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt ) if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) ) { if ( rNEvt.GetWindow() == this ) - CallEventListeners( VCLEVENT_WINDOW_MOUSEMOVE, (void*)rNEvt.GetMouseEvent() ); + CallEventListeners( VCLEVENT_WINDOW_MOUSEMOVE, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) ); else { MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ); @@ -373,7 +373,7 @@ void Window::ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt ) if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) ) { if ( rNEvt.GetWindow() == this ) - CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, (void*)rNEvt.GetMouseEvent() ); + CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) ); else { MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ); @@ -386,7 +386,7 @@ void Window::ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt ) if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) ) { if ( rNEvt.GetWindow() == this ) - CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, (void*)rNEvt.GetMouseEvent() ); + CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) ); else { MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ); @@ -397,12 +397,12 @@ void Window::ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt ) else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) { if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) ) - CallEventListeners( VCLEVENT_WINDOW_KEYINPUT, (void*)rNEvt.GetKeyEvent() ); + CallEventListeners( VCLEVENT_WINDOW_KEYINPUT, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) ); } else if( rNEvt.GetType() == MouseNotifyEvent::KEYUP ) { if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) ) - CallEventListeners( VCLEVENT_WINDOW_KEYUP, (void*)rNEvt.GetKeyEvent() ); + CallEventListeners( VCLEVENT_WINDOW_KEYUP, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) ); } if ( aDelData.IsDead() ) diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index ad7fb721728b..1dcf72a1a3b9 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -961,7 +961,7 @@ void Window::PostPaint(vcl::RenderContext& /*rRenderContext*/) void Window::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect) { - CallEventListeners(VCLEVENT_WINDOW_PAINT, (void*)&rRect); + CallEventListeners(VCLEVENT_WINDOW_PAINT, const_cast<Rectangle *>(&rRect)); } void Window::SetPaintTransparent( bool bTransparent ) diff --git a/vcl/source/window/resource.cxx b/vcl/source/window/resource.cxx index 9c8ce32f15e9..6c3aeb3f90d6 100644 --- a/vcl/source/window/resource.cxx +++ b/vcl/source/window/resource.cxx @@ -42,7 +42,7 @@ WinBits Window::ImplInitRes( const ResId& rResId ) char* pRes = static_cast<char*>(GetClassRes()); pRes += 8; - sal_uInt32 nStyle = (sal_uInt32)GetLongRes( (void*)pRes ); + sal_uInt32 nStyle = (sal_uInt32)GetLongRes( static_cast<void*>(pRes) ); rResId.SetWinBits( nStyle ); return nStyle; } diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 4e46c8acb74c..c08a60168a93 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -910,14 +910,14 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar, const css::uno::Reference<css:: pOldWindow = NULL; if ( pOldWindow ) { - CallEventListeners( VCLEVENT_WINDOW_MENUBARREMOVED, (void*) pOldMenuBar ); + CallEventListeners( VCLEVENT_WINDOW_MENUBARREMOVED, static_cast<void*>(pOldMenuBar) ); pOldWindow->SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >() ); } if ( pMenuBar ) { DBG_ASSERT( !pMenuBar->pWindow, "SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" ); static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow( pNewWindow = MenuBar::ImplCreate( mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar, rFrame)); - CallEventListeners( VCLEVENT_WINDOW_MENUBARADDED, (void*) pMenuBar ); + CallEventListeners( VCLEVENT_WINDOW_MENUBARADDED, static_cast<void*>(pMenuBar) ); } else static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow( NULL ); diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 77087aa27f89..497fc42de8bf 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -904,7 +904,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p nStyle |= WB_BORDER; } VclPtrInstance<ImplBorderWindow> pBorderWin( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_NEEDSFOCUS), nBorderTypeStyle ); - ((vcl::Window*)pBorderWin)->mpWindowImpl->mpClientWindow = this; + static_cast<vcl::Window*>(pBorderWin)->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); mpWindowImpl->mpBorderWindow = pBorderWin; pParent = mpWindowImpl->mpBorderWindow; @@ -2001,7 +2001,7 @@ void Window::RequestHelp( const HelpEvent& rHEvt ) void Window::Command( const CommandEvent& rCEvt ) { - CallEventListeners( VCLEVENT_WINDOW_COMMAND, (void*)&rCEvt ); + CallEventListeners( VCLEVENT_WINDOW_COMMAND, const_cast<CommandEvent *>(&rCEvt) ); NotifyEvent aNEvt( MouseNotifyEvent::COMMAND, this, &rCEvt ); if ( !CompatNotify( aNEvt ) ) diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx index 4f3b910ee6af..8de3dc88bc52 100644 --- a/vcl/unx/generic/app/i18n_cb.cxx +++ b/vcl/unx/generic/app/i18n_cb.cxx @@ -62,7 +62,7 @@ PreeditDoneCallback ( XIC, XPointer client_data, XPointer ) if (pPreeditData->eState == ePreeditStatusActive ) { if( pPreeditData->pFrame ) - pPreeditData->pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, (void*)NULL ); + pPreeditData->pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr ); } pPreeditData->eState = ePreeditStatusStartPending; } @@ -94,11 +94,11 @@ Preedit_DeleteText(preedit_text_t *ptext, int from, int howmuch) if (to < (int)ptext->nLength) { // cut out of the middle of the text - memmove( (void*)(ptext->pUnicodeBuffer + from), - (void*)(ptext->pUnicodeBuffer + to), + memmove( static_cast<void*>(ptext->pUnicodeBuffer + from), + static_cast<void*>(ptext->pUnicodeBuffer + to), (ptext->nLength - to) * sizeof(sal_Unicode)); - memmove( (void*)(ptext->pCharStyle + from), - (void*)(ptext->pCharStyle + to), + memmove( static_cast<void*>(ptext->pCharStyle + from), + static_cast<void*>(ptext->pCharStyle + to), (ptext->nLength - to) * sizeof(XIMFeedback)); ptext->nLength -= howmuch; } @@ -127,9 +127,9 @@ enlarge_buffer ( preedit_text_t *ptext, int nnewlimit ) nnewsize *= 2; ptext->nSize = nnewsize; - ptext->pUnicodeBuffer = static_cast<sal_Unicode*>(realloc((void*)ptext->pUnicodeBuffer, + ptext->pUnicodeBuffer = static_cast<sal_Unicode*>(realloc(static_cast<void*>(ptext->pUnicodeBuffer), nnewsize * sizeof(sal_Unicode))); - ptext->pCharStyle = static_cast<XIMFeedback*>(realloc((void*)ptext->pCharStyle, + ptext->pCharStyle = static_cast<XIMFeedback*>(realloc(static_cast<void*>(ptext->pCharStyle), nnewsize * sizeof(XIMFeedback))); } @@ -203,19 +203,19 @@ Preedit_InsertText(preedit_text_t *pText, XIMText *pInsertText, int where) int to = where + nInsertTextLength; int howmany = pText->nLength - where; - memmove((void*)(pText->pUnicodeBuffer + to), - (void*)(pText->pUnicodeBuffer + from), + memmove(static_cast<void*>(pText->pUnicodeBuffer + to), + static_cast<void*>(pText->pUnicodeBuffer + from), howmany * sizeof(sal_Unicode)); - memmove((void*)(pText->pCharStyle + to), - (void*)(pText->pCharStyle + from), + memmove(static_cast<void*>(pText->pCharStyle + to), + static_cast<void*>(pText->pCharStyle + from), howmany * sizeof(XIMFeedback)); to = from; howmany = nInsertTextLength; - memcpy((void*)(pText->pUnicodeBuffer + to), (void*)pInsertTextString, + memcpy(static_cast<void*>(pText->pUnicodeBuffer + to), static_cast<void*>(pInsertTextString), howmany * sizeof(sal_Unicode)); - memcpy((void*)(pText->pCharStyle + to), (void*)pInsertTextCharStyle, + memcpy(static_cast<void*>(pText->pCharStyle + to), static_cast<void*>(pInsertTextCharStyle), howmany * sizeof(XIMFeedback)); pText->nLength += howmany; @@ -262,7 +262,7 @@ Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<sal_uIn psalattr = &rSalAttr[0]; } else - return (sal_uInt16*)NULL; + return nullptr; for (int npos = 0; npos < nlength; npos++) { @@ -370,9 +370,9 @@ PreeditDrawCallback(XIC ic, XPointer client_data, pPreeditData->aInputEv.mbOnlyCursor = False; if ( pPreeditData->eState == ePreeditStatusActive && pPreeditData->pFrame ) - pPreeditData->pFrame->CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&pPreeditData->aInputEv); + pPreeditData->pFrame->CallCallback(SALEVENT_EXTTEXTINPUT, static_cast<void*>(&pPreeditData->aInputEv)); if (pPreeditData->aText.nLength == 0 && pPreeditData->pFrame ) - pPreeditData->pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, (void*)NULL ); + pPreeditData->pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr ); if (pPreeditData->aText.nLength == 0) pPreeditData->eState = ePreeditStatusStartPending; @@ -390,7 +390,7 @@ GetPreeditSpotLocation(XIC ic, XPointer client_data) preedit_data_t* pPreeditData = reinterpret_cast<preedit_data_t*>(client_data); if( pPreeditData->pFrame ) - pPreeditData->pFrame->CallCallback(SALEVENT_EXTTEXTINPUTPOS, (void*)&mPosEvent); + pPreeditData->pFrame->CallCallback(SALEVENT_EXTTEXTINPUTPOS, static_cast<void*>(&mPosEvent)); XPoint point; point.x = mPosEvent.mnX + mPosEvent.mnWidth; diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx index 2bd02caa5b84..c96b5adfdf5f 100644 --- a/vcl/unx/generic/app/i18n_ic.cxx +++ b/vcl/unx/generic/app/i18n_ic.cxx @@ -50,7 +50,7 @@ static void sendEmptyCommit( SalFrame* pFrame ) aEmptyEv.mnCursorPos = 0; aEmptyEv.mnCursorFlags = 0; aEmptyEv.mbOnlyCursor = False; - pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEmptyEv ); + pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aEmptyEv) ); if( ! aDel.isDeleted() ) pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL ); } @@ -128,7 +128,7 @@ get_font_set( Display *p_display ) SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : mbUseable( True ), - maContext( (XIC)NULL ), + maContext( nullptr ), mnSupportedStatusStyle( XIMStatusCallbacks | XIMStatusNothing | @@ -262,7 +262,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : { // spot location SalExtTextInputPosEvent aPosEvent; - pFrame->CallCallback(SALEVENT_EXTTEXTINPUTPOS, (void*)&aPosEvent); + pFrame->CallCallback(SALEVENT_EXTTEXTINPUTPOS, static_cast<void*>(&aPosEvent)); static XPoint aSpot; aSpot.x = aPosEvent.mnX + aPosEvent.mnWidth; @@ -356,7 +356,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : if ( maContext != NULL) { - maDestroyCallback.callback = (XIMProc)IC_IMDestroyCallback; + maDestroyCallback.callback = static_cast<XIMProc>(IC_IMDestroyCallback); maDestroyCallback.client_data = reinterpret_cast<XPointer>(this); XSetICValues( maContext, XNDestroyCallback, &maDestroyCallback, @@ -541,8 +541,8 @@ SalI18N_InputContext::CommitKeyEvent(sal_Unicode* pText, sal_Size nLength) aTextEvent.mnCursorFlags = 0; aTextEvent.mbOnlyCursor = False; - maClientData.pFrame->CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aTextEvent); - maClientData.pFrame->CallCallback(SALEVENT_ENDEXTTEXTINPUT, (void*)NULL); + maClientData.pFrame->CallCallback(SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aTextEvent)); + maClientData.pFrame->CallCallback(SALEVENT_ENDEXTTEXTINPUT, nullptr); } #if OSL_DEBUG_LEVEL > 1 else @@ -559,7 +559,7 @@ SalI18N_InputContext::UpdateSpotLocation() return -1; SalExtTextInputPosEvent aPosEvent; - maClientData.pFrame->CallCallback(SALEVENT_EXTTEXTINPUTPOS, (void*)&aPosEvent); + maClientData.pFrame->CallCallback(SALEVENT_EXTTEXTINPUTPOS, static_cast<void*>(&aPosEvent)); XPoint aSpot; aSpot.x = aPosEvent.mnX + aPosEvent.mnWidth; diff --git a/vcl/unx/generic/app/i18n_im.cxx b/vcl/unx/generic/app/i18n_im.cxx index ce8dee888aae..d9dfc831e6bb 100644 --- a/vcl/unx/generic/app/i18n_im.cxx +++ b/vcl/unx/generic/app/i18n_im.cxx @@ -245,11 +245,11 @@ SalI18N_InputMethod::PosixLocale() SalI18N_InputMethod::SalI18N_InputMethod( ) : mbUseable( bUseInputMethodDefault ) - , maMethod( (XIM)NULL ) - , mpStyles( (XIMStyles*)NULL ) + , maMethod( nullptr ) + , mpStyles( nullptr ) { - maDestroyCallback.callback = (XIMProc)NULL; - maDestroyCallback.client_data = (XPointer)NULL; + maDestroyCallback.callback = nullptr; + maDestroyCallback.client_data = nullptr; const char *pUseInputMethod = getenv( "SAL_USEINPUTMETHOD" ); if ( pUseInputMethod != NULL ) mbUseable = pUseInputMethod[0] != '\0' ; @@ -338,7 +338,7 @@ SalI18N_InputMethod::CreateMethod ( Display *pDisplay ) { maMethod = XOpenIM(pDisplay, NULL, NULL, NULL); - if ((maMethod == (XIM)NULL) && (getenv("XMODIFIERS") != NULL)) + if ((maMethod == nullptr) && (getenv("XMODIFIERS") != NULL)) { OUString envVar("XMODIFIERS"); osl_clearEnvironment(envVar.pData); @@ -346,7 +346,7 @@ SalI18N_InputMethod::CreateMethod ( Display *pDisplay ) maMethod = XOpenIM(pDisplay, NULL, NULL, NULL); } - if ( maMethod != (XIM)NULL ) + if ( maMethod != nullptr ) { if ( XGetIMValues(maMethod, XNQueryInputStyle, &mpStyles, NULL) != NULL) @@ -367,7 +367,7 @@ SalI18N_InputMethod::CreateMethod ( Display *pDisplay ) fprintf(stderr, "input method creation failed\n"); #endif - maDestroyCallback.callback = (XIMProc)IM_IMDestroyCallback; + maDestroyCallback.callback = static_cast<XIMProc>(IM_IMDestroyCallback); maDestroyCallback.client_data = reinterpret_cast<XPointer>(this); if (mbUseable && maMethod != NULL) XSetIMValues(maMethod, XNDestroyCallback, &maDestroyCallback, NULL); diff --git a/vcl/unx/generic/app/i18n_keysym.cxx b/vcl/unx/generic/app/i18n_keysym.cxx index 2ce0e08ef439..f464c498e689 100644 --- a/vcl/unx/generic/app/i18n_keysym.cxx +++ b/vcl/unx/generic/app/i18n_keysym.cxx @@ -307,11 +307,11 @@ const keymap_t* p_keymap[INITIAL_KEYMAPS] = { &keymap00, &keymap01, &keymap02, &keymap03, /* 00 -- 03 */ &keymap04, &keymap05, &keymap06, &keymap07, /* 04 -- 07 */ &keymap08, &keymap09, &keymap10, &keymap11, /* 08 -- 11 */ - &keymap12, &keymap13, &keymap14, (keymap_t*)NULL, /* 12 -- 15 */ - (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, &keymap19, /* 16 -- 19 */ - (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, /* 20 -- 23 */ - (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, /* 24 -- 27 */ - (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, /* 28 -- 31 */ + &keymap12, &keymap13, &keymap14, nullptr, /* 12 -- 15 */ + nullptr, nullptr, nullptr, &keymap19, /* 16 -- 19 */ + nullptr, nullptr, nullptr, nullptr, /* 20 -- 23 */ + nullptr, nullptr, nullptr, nullptr, /* 24 -- 27 */ + nullptr, nullptr, nullptr, nullptr, /* 28 -- 31 */ &keymap32 /* 32 */ }; diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx index 36f0ebcf6254..bb77762ad2d1 100644 --- a/vcl/unx/generic/app/i18n_status.cxx +++ b/vcl/unx/generic/app/i18n_status.cxx @@ -198,7 +198,7 @@ Point XIMStatusWindow::updatePosition() const SystemEnvData* pParentEnvData = m_pLastParent->GetSystemData(); SalExtTextInputPosEvent aPosEvent; - m_pLastParent->CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void*)&aPosEvent ); + m_pLastParent->CallCallback( SALEVENT_EXTTEXTINPUTPOS, static_cast<void*>(&aPosEvent) ); int x, y; ::Window aChild; XTranslateCoordinates( static_cast<Display*>(pParentEnvData->pDisplay), diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index d95e30bca6d7..b8e266cb9ef3 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -559,7 +559,7 @@ void SalDisplay::Init() for( Cursor & aCsr : aPointerCache_ ) aCsr = None; - mpFactory = (AttributeProvider*)NULL; + mpFactory = nullptr; m_bXinerama = false; int nDisplayScreens = ScreenCount( pDisp_ ); @@ -2354,7 +2354,7 @@ SalVisual::SalVisual() SalVisual::SalVisual( const XVisualInfo* pXVI ) { - *(XVisualInfo*)this = *pXVI; + *static_cast<XVisualInfo*>(this) = *pXVI; if( GetClass() == TrueColor ) { nRedShift_ = sal_Shift( red_mask ); diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index 9c00f6d5a468..47b64290e40e 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -162,7 +162,7 @@ void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturn static const char* pDisplay = getenv( "DISPLAY" ); rReturnedType = AsciiCString; rReturnedBytes = pDisplay ? strlen( pDisplay )+1 : 1; - return pDisplay ? (void*)pDisplay : (void*)""; + return pDisplay ? const_cast<char *>(pDisplay) : const_cast<char *>(""); } SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, sal_uLong nSalFrameStyle ) diff --git a/vcl/unx/generic/dtrans/X11_service.cxx b/vcl/unx/generic/dtrans/X11_service.cxx index 360b29d087ad..3b8f45bb6991 100644 --- a/vcl/unx/generic/dtrans/X11_service.cxx +++ b/vcl/unx/generic/dtrans/X11_service.cxx @@ -85,12 +85,12 @@ css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const Sequenc css::uno::Reference< XInterface > X11SalInstance::CreateDragSource() { - return css::uno::Reference < XInterface >( ( OWeakObject * ) new SelectionManagerHolder() ); + return css::uno::Reference < XInterface >( static_cast<OWeakObject *>(new SelectionManagerHolder()) ); } css::uno::Reference< XInterface > X11SalInstance::CreateDropTarget() { - return css::uno::Reference < XInterface >( ( OWeakObject * ) new DropTarget() ); + return css::uno::Reference < XInterface >( static_cast<OWeakObject *>(new DropTarget()) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 1591ffe520ef..d2511917ee85 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -3041,7 +3041,7 @@ void X11SalFrame::beginUnicodeSequence() aEv.mnCursorFlags = 0; aEv.mbOnlyCursor = false; - CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + CallCallback(SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aEv)); } } @@ -3070,7 +3070,7 @@ bool X11SalFrame::appendUnicodeSequence( sal_Unicode c ) aEv.mnCursorFlags = 0; aEv.mbOnlyCursor = false; - CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + CallCallback(SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aEv)); bRet = true; } else @@ -3101,7 +3101,7 @@ bool X11SalFrame::endUnicodeSequence() aEv.mnCursorPos = 0; aEv.mnCursorFlags = 0; aEv.mbOnlyCursor = false; - CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + CallCallback(SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aEv)); } } bool bWasInput = !rSeq.isEmpty(); diff --git a/vcl/unx/gtk/a11y/atkcomponent.cxx b/vcl/unx/gtk/a11y/atkcomponent.cxx index f40cfe004733..08fd93afa6a7 100644 --- a/vcl/unx/gtk/a11y/atkcomponent.cxx +++ b/vcl/unx/gtk/a11y/atkcomponent.cxx @@ -321,14 +321,14 @@ component_wrapper_add_focus_handler (AtkComponent *component, signal_id = g_signal_lookup( "focus-event", ATK_TYPE_OBJECT ); ret = g_signal_handler_find( component, match_type, signal_id, 0, NULL, - (gpointer) &handler, NULL); + static_cast<gpointer>(&handler), NULL); if (!ret) { return g_signal_connect_closure_by_id (component, signal_id, 0, g_cclosure_new ( G_CALLBACK (handler), NULL, - (GClosureNotify) NULL), + nullptr), FALSE); } else diff --git a/vcl/unx/gtk/a11y/atkfactory.cxx b/vcl/unx/gtk/a11y/atkfactory.cxx index fb0cc7741799..581f4d0091ac 100644 --- a/vcl/unx/gtk/a11y/atkfactory.cxx +++ b/vcl/unx/gtk/a11y/atkfactory.cxx @@ -58,14 +58,14 @@ atk_noop_object_wrapper_get_type() static const GTypeInfo typeInfo = { sizeof (AtkNoOpObjectClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, + nullptr, + nullptr, reinterpret_cast<GClassInitFunc>(atk_noop_object_wrapper_class_init), - (GClassFinalizeFunc) NULL, + nullptr, NULL, sizeof (AtkObjectWrapper), 0, - (GInstanceInitFunc) NULL, + nullptr, NULL } ; diff --git a/vcl/unx/gtk/a11y/atkhypertext.cxx b/vcl/unx/gtk/a11y/atkhypertext.cxx index e11f4987b6e5..47872486a55a 100644 --- a/vcl/unx/gtk/a11y/atkhypertext.cxx +++ b/vcl/unx/gtk/a11y/atkhypertext.cxx @@ -173,7 +173,7 @@ hyper_link_get_type() static const GInterfaceInfo atk_action_info = { reinterpret_cast<GInterfaceInitFunc>(actionIfaceInit), - (GInterfaceFinalizeFunc) NULL, + nullptr, NULL }; diff --git a/vcl/unx/gtk/a11y/atkregistry.cxx b/vcl/unx/gtk/a11y/atkregistry.cxx index 10b76c3bffba..ee34ee1209c5 100644 --- a/vcl/unx/gtk/a11y/atkregistry.cxx +++ b/vcl/unx/gtk/a11y/atkregistry.cxx @@ -32,7 +32,7 @@ ooo_wrapper_registry_get(const Reference< XAccessible >& rxAccessible) if( uno_to_gobject ) { gpointer cached = - g_hash_table_lookup(uno_to_gobject, (gpointer) rxAccessible.get()); + g_hash_table_lookup(uno_to_gobject, static_cast<gpointer>(rxAccessible.get())); if( cached ) return ATK_OBJECT( cached ); @@ -49,7 +49,7 @@ ooo_wrapper_registry_add(const Reference< XAccessible >& rxAccessible, AtkObject if( !uno_to_gobject ) uno_to_gobject = g_hash_table_new (NULL, NULL); - g_hash_table_insert( uno_to_gobject, (gpointer) rxAccessible.get(), obj ); + g_hash_table_insert( uno_to_gobject, static_cast<gpointer>(rxAccessible.get()), obj ); } /*****************************************************************************/ @@ -58,7 +58,7 @@ void ooo_wrapper_registry_remove(XAccessible *pAccessible) { if( uno_to_gobject ) - g_hash_table_remove( uno_to_gobject, (gpointer) pAccessible ); + g_hash_table_remove( uno_to_gobject, static_cast<gpointer>(pAccessible) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx index 283ff59db9e8..484336773906 100644 --- a/vcl/unx/gtk/a11y/atktextattributes.cxx +++ b/vcl/unx/gtk/a11y/atktextattributes.cxx @@ -988,7 +988,7 @@ TabStopList2String( const uno::Any& rAny, bool default_tabs ) if( ret ) { gchar * old_tab_str = ret; - ret = g_strconcat(old_tab_str, " ", tab_str, (const char*)NULL); + ret = g_strconcat(old_tab_str, " ", tab_str, nullptr); g_free( old_tab_str ); } else diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 03f08e4f30c6..cc2fe84c39bd 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -742,14 +742,14 @@ ooo_atk_util_get_type() static const GTypeInfo typeInfo = { static_cast<guint16>(type_query.class_size), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, + nullptr, + nullptr, reinterpret_cast<GClassInitFunc>(ooo_atk_util_class_init), - (GClassFinalizeFunc) NULL, + nullptr, NULL, static_cast<guint16>(type_query.instance_size), 0, - (GInstanceInitFunc) NULL, + nullptr, NULL } ; diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx index b845389c6437..635645f234e3 100644 --- a/vcl/unx/gtk/a11y/atkwindow.cxx +++ b/vcl/unx/gtk/a11y/atkwindow.cxx @@ -293,14 +293,14 @@ ooo_window_wrapper_get_type() static const GTypeInfo typeInfo = { static_cast<guint16>(type_query.class_size), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, + nullptr, + nullptr, reinterpret_cast<GClassInitFunc>(ooo_window_wrapper_class_init), - (GClassFinalizeFunc) NULL, + nullptr, NULL, static_cast<guint16>(type_query.instance_size), 0, - (GInstanceInitFunc) NULL, + nullptr, NULL } ; diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx index 30cfa9c05074..ad27b6a3c6ff 100644 --- a/vcl/unx/gtk/a11y/atkwrapper.cxx +++ b/vcl/unx/gtk/a11y/atkwrapper.cxx @@ -665,10 +665,10 @@ atk_object_wrapper_get_type() static const GTypeInfo typeInfo = { sizeof (AtkObjectWrapperClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, + nullptr, + nullptr, reinterpret_cast<GClassInitFunc>(atk_object_wrapper_class_init), - (GClassFinalizeFunc) NULL, + nullptr, NULL, sizeof (AtkObjectWrapper), 0, diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index df1546ac9e43..df4470ba09ba 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -964,7 +964,7 @@ void GtkData::PostUserEvent() g_source_set_priority (m_pUserEvent, G_PRIORITY_HIGH); g_source_set_can_recurse (m_pUserEvent, TRUE); g_source_set_callback (m_pUserEvent, call_userEventFn, - (gpointer) this, NULL); + static_cast<gpointer>(this), NULL); g_source_attach (m_pUserEvent, g_main_context_default ()); } } diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 6c98ca6f72bf..d6e082fd4eb4 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -122,7 +122,7 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference< uno::XComponentContext GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - (char *)NULL ); + nullptr ); gtk_dialog_set_default_response( GTK_DIALOG (m_pDialog), GTK_RESPONSE_ACCEPT ); @@ -240,7 +240,7 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference< uno::XComponentContext cell = gtk_cell_renderer_text_new (); gtk_tree_view_column_set_expand (column, true); gtk_tree_view_column_pack_start (column, cell, false); - gtk_tree_view_column_set_attributes (column, cell, "text", i, (char *)NULL); + gtk_tree_view_column_set_attributes (column, cell, "text", i, nullptr); gtk_tree_view_append_column (GTK_TREE_VIEW(m_pFilterView), column); } @@ -272,7 +272,7 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference< uno::XComponentContext pango_layout_get_pixel_extents (layout, NULL, &row_height); g_object_unref (layout); - g_object_get (cell, "ypad", &ypad, (char *)NULL); + g_object_get (cell, "ypad", &ypad, nullptr); guint height = (row_height.height + 2*ypad) * 5; gtk_widget_set_size_request (m_pFilterView, -1, height); gtk_widget_set_size_request (m_pPreview, 1, height); @@ -896,11 +896,11 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException, std mnHID_FolderChange = g_signal_connect( GTK_FILE_CHOOSER( m_pDialog ), "current-folder-changed", - G_CALLBACK( folder_changed_cb ), ( gpointer )this ); + G_CALLBACK( folder_changed_cb ), static_cast<gpointer>(this) ); mnHID_SelectionChange = g_signal_connect( GTK_FILE_CHOOSER( m_pDialog ), "selection-changed", - G_CALLBACK( selection_changed_cb ), ( gpointer )this ); + G_CALLBACK( selection_changed_cb ), static_cast<gpointer>(this) ); int btn = GTK_RESPONSE_NO; @@ -1352,7 +1352,7 @@ void SAL_CALL SalGtkFilePicker::setLabel( sal_Int16 nControlId, const OUString& } else if( tType == GTK_TYPE_TOGGLE_BUTTON || tType == GTK_TYPE_BUTTON || tType == GTK_TYPE_LABEL ) g_object_set( pWidget, "label", aTxt.getStr(), - "use_underline", true, (char *)NULL ); + "use_underline", true, nullptr ); else OSL_TRACE("Can't set label on list"); } @@ -1535,7 +1535,7 @@ sal_Bool SAL_CALL SalGtkFilePicker::setShowState( sal_Bool bShowState ) throw( u { mHID_Preview = g_signal_connect( GTK_FILE_CHOOSER( m_pDialog ), "update-preview", - G_CALLBACK( update_preview_cb ), ( gpointer )this ); + G_CALLBACK( update_preview_cb ), static_cast<gpointer>(this) ); } gtk_widget_show( m_pPreview ); } @@ -1823,7 +1823,7 @@ GtkFileFilter* SalGtkFilePicker::implAddFilter( const OUString& rFilter, const O gtk_file_filter_add_custom (filter, GTK_FILE_FILTER_URI, case_insensitive_filter, g_strdup( OUStringToOString(aToken, RTL_TEXTENCODING_UTF8).getStr() ), - (GDestroyNotify) g_free ); + g_free ); OSL_TRACE( "fustering with %s", OUStringToOString( aToken, RTL_TEXTENCODING_UTF8 ).getStr()); } diff --git a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx index 0754101b3631..3a2fc6caf93f 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx @@ -54,7 +54,7 @@ SalGtkFolderPicker::SalGtkFolderPicker( const uno::Reference< uno::XComponentCon m_pDialog = gtk_file_chooser_dialog_new( OUStringToOString( getResString( FOLDERPICKER_TITLE ), RTL_TEXTENCODING_UTF8 ).getStr(), NULL, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, (char *)NULL ); + GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, nullptr ); gtk_dialog_set_default_response( GTK_DIALOG (m_pDialog), GTK_RESPONSE_ACCEPT ); #if ENABLE_GNOME_VFS || ENABLE_GIO diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index a34c143b99f9..463d9fe00ced 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -529,10 +529,10 @@ void GtkData::initNWF() gint vertical_padding = 1; gtk_widget_style_get( gWidgetData[0].gMenuWidget, "horizontal-padding", &horizontal_padding, - (char *)NULL); + nullptr); gtk_widget_style_get( gWidgetData[0].gMenuWidget, "vertical-padding", &vertical_padding, - (char *)NULL); + nullptr); gint xthickness = gWidgetData[0].gMenuWidget->style->xthickness; gint ythickness = gWidgetData[0].gMenuWidget->style->ythickness; pSVData->maNWFData.mnMenuFormatBorderX = xthickness + horizontal_padding; @@ -774,7 +774,7 @@ bool GtkSalGraphics::hitTestNativeControl( ControlType nType, "has-secondary-forward-stepper", &has_forward2, "has-backward-stepper", &has_backward, "has-secondary-backward-stepper", &has_backward2, - (char *)NULL ); + nullptr ); Rectangle aForward; Rectangle aBackward; @@ -1199,7 +1199,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, gWidgetData[m_nXScreen].gMenuItemCheckMenuWidget : gWidgetData[m_nXScreen].gMenuItemRadioMenuWidget; gtk_widget_style_get( pWidget, "indicator_size", &indicator_size, - (char *)NULL ); + nullptr ); rNativeBoundingRegion = rControlRegion; Rectangle aIndicatorRect( Point( 0, (rControlRegion.GetHeight()-indicator_size)/2), @@ -1263,7 +1263,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, "indicator_spacing", &indicator_spacing, "focus-line-width", &focusWidth, "focus-padding", &focusPad, - (char *)NULL); + nullptr); indicator_size += 2*indicator_spacing + 2*(focusWidth + focusWidth); rNativeBoundingRegion = rControlRegion; Rectangle aIndicatorRect( Point( 0, @@ -1295,7 +1295,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, gtk_widget_style_get( widget, "slider-width", &slider_width, "slider-length", &slider_length, - (char *)NULL); + nullptr); Rectangle aRect( rControlRegion ); if( nPart == PART_THUMB_HORZ ) { @@ -1642,10 +1642,10 @@ bool GtkSalGraphics::NWPaintGTKButtonReal( gtk_widget_style_get( gWidgetData[m_nXScreen].gBtnWidget, "focus-line-width", &focusWidth, "focus-padding", &focusPad, "interior_focus", &interiorFocus, - (char *)NULL ); + nullptr ); gtk_widget_style_get( gWidgetData[m_nXScreen].gBtnWidget, "default_border", &pBorder, - (char *)NULL ); + nullptr ); // Make sure the border values exist, otherwise use some defaults if ( pBorder ) @@ -1748,7 +1748,7 @@ static Rectangle NWGetButtonArea( SalX11Screen nScreen, "focus-padding", &focusPad, "interior_focus", &interiorFocus, "default_border", &pBorder, - (char *)NULL ); + nullptr ); // Make sure the border values exist, otherwise use some defaults if ( pBorder ) @@ -1821,7 +1821,7 @@ bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable, NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); gint indicator_size; - gtk_widget_style_get( gWidgetData[m_nXScreen].gRadioWidget, "indicator_size", &indicator_size, (char *)NULL); + gtk_widget_style_get( gWidgetData[m_nXScreen].gRadioWidget, "indicator_size", &indicator_size, nullptr); x = rControlRectangle.Left() + (rControlRectangle.GetWidth()-indicator_size)/2; y = rControlRectangle.Top() + (rControlRectangle.GetHeight()-indicator_size)/2; @@ -1878,7 +1878,7 @@ bool GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable, NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); gint indicator_size; - gtk_widget_style_get( gWidgetData[m_nXScreen].gCheckWidget, "indicator_size", &indicator_size, (char *)NULL); + gtk_widget_style_get( gWidgetData[m_nXScreen].gCheckWidget, "indicator_size", &indicator_size, nullptr); x = rControlRectangle.Left() + (rControlRectangle.GetWidth()-indicator_size)/2; y = rControlRectangle.Top() + (rControlRectangle.GetHeight()-indicator_size)/2; @@ -1976,7 +1976,7 @@ bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, "stepper_size", &stepper_size, "trough_border", &trough_border, "stepper_spacing", &stepper_spacing, - "min_slider_length", &min_slider_length, (char *)NULL ); + "min_slider_length", &min_slider_length, nullptr ); gboolean has_forward; gboolean has_forward2; gboolean has_backward; @@ -1985,7 +1985,7 @@ bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, gtk_widget_style_get( gWidgetData[m_nXScreen].gScrollHorizWidget, "has-forward-stepper", &has_forward, "has-secondary-forward-stepper", &has_forward2, "has-backward-stepper", &has_backward, - "has-secondary-backward-stepper", &has_backward2, (char *)NULL ); + "has-secondary-backward-stepper", &has_backward2, nullptr ); gint magic = trough_border ? 1 : 0; gint nFirst = 0; @@ -2253,7 +2253,7 @@ static Rectangle NWGetScrollButtonRect( SalX11Screen nScreen, ControlPart nPa "slider-width", &slider_width, "stepper-size", &stepper_size, "trough-border", &trough_border, - "stepper-spacing", &stepper_spacing, (char *)NULL ); + "stepper-spacing", &stepper_spacing, nullptr ); gboolean has_forward; gboolean has_forward2; @@ -2264,7 +2264,7 @@ static Rectangle NWGetScrollButtonRect( SalX11Screen nScreen, ControlPart nPa "has-forward-stepper", &has_forward, "has-secondary-forward-stepper", &has_forward2, "has-backward-stepper", &has_backward, - "has-secondary-backward-stepper", &has_backward2, (char *)NULL ); + "has-secondary-backward-stepper", &has_backward2, nullptr ); gint buttonWidth; gint buttonHeight; Rectangle buttonRect; @@ -2369,7 +2369,7 @@ static Rectangle NWGetEditBoxPixmapRect(SalX11Screen nScreen, // Grab some entry style attributes gtk_widget_style_get( gWidgetData[nScreen].gEditBoxWidget, "focus-line-width", &focusWidth, - "interior-focus", &interiorFocus, (char *)NULL ); + "interior-focus", &interiorFocus, nullptr ); if ( !interiorFocus ) { @@ -2435,7 +2435,7 @@ static void NWPaintOneEditBox( SalX11Screen nScreen, gtk_widget_style_get( widget, "interior-focus", &bInteriorFocus, "focus-line-width", &nFocusLineWidth, - (char *)NULL); + nullptr); if ( !bInteriorFocus ) { xborder += nFocusLineWidth; @@ -2527,7 +2527,7 @@ bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, } NWSetWidgetState( gWidgetData[m_nXScreen].gSpinButtonWidget, nState, stateType ); - gtk_widget_style_get( gWidgetData[m_nXScreen].gSpinButtonWidget, "shadow_type", &shadowType, (char *)NULL ); + gtk_widget_style_get( gWidgetData[m_nXScreen].gSpinButtonWidget, "shadow_type", &shadowType, nullptr ); if ( shadowType != GTK_SHADOW_NONE ) { @@ -2734,7 +2734,7 @@ static Rectangle NWGetComboBoxButtonRect( SalX11Screen nScreen, // Grab some button style attributes gtk_widget_style_get( gWidgetData[nScreen].gDropdownWidget, "focus-line-width", &nFocusWidth, - "focus-padding", &nFocusPad, (char *)NULL ); + "focus-padding", &nFocusPad, nullptr ); nArrowWidth = MIN_ARROW_SIZE + (GTK_MISC(gWidgetData[nScreen].gArrowWidget)->xpad * 2); nButtonWidth = nArrowWidth + @@ -2961,7 +2961,7 @@ bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, "interior_focus", &bInteriorFocus, "focus_line_width", &nFocusLineWidth, "focus_padding", &nFocusPadding, - (char *)NULL); + nullptr); } for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) @@ -3200,7 +3200,7 @@ bool GtkSalGraphics::NWPaintGTKMenubar( { gtk_widget_style_get( gWidgetData[m_nXScreen].gMenuItemMenubarWidget, "selected_shadow_type", &selected_shadow_type, - (char *)NULL); + nullptr); } } @@ -3291,7 +3291,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu( { gtk_widget_style_get( gWidgetData[m_nXScreen].gMenuItemMenuWidget, "selected_shadow_type", &selected_shadow_type, - (char *)NULL); + nullptr); } NWSetWidgetState( gWidgetData[m_nXScreen].gMenuWidget, nState, stateType ); @@ -3685,7 +3685,7 @@ static Rectangle NWGetListBoxButtonRect( SalX11Screen nScreen, gtk_widget_style_get( gWidgetData[nScreen].gOptionMenuWidget, "indicator_size", &pIndicatorSize, - "indicator_spacing",&pIndicatorSpacing, (char *)NULL); + "indicator_spacing",&pIndicatorSpacing, nullptr); if ( pIndicatorSize ) width = pIndicatorSize->width; @@ -3748,7 +3748,7 @@ static Rectangle NWGetListBoxIndicatorRect( SalX11Screen nScreen, gtk_widget_style_get( gWidgetData[nScreen].gOptionMenuWidget, "indicator_size", &pIndicatorSize, - "indicator_spacing",&pIndicatorSpacing, (char *)NULL); + "indicator_spacing",&pIndicatorSpacing, nullptr); if ( pIndicatorSize ) { @@ -3868,7 +3868,7 @@ void GtkSalGraphics::refreshFontconfig( GtkSettings *pSettings ) { guint latest_fontconfig_timestamp = 0; static guint our_fontconfig_timestamp = 0; - g_object_get( pSettings, "gtk-fontconfig-timestamp", &latest_fontconfig_timestamp, (char *)NULL ); + g_object_get( pSettings, "gtk-fontconfig-timestamp", &latest_fontconfig_timestamp, nullptr ); if (latest_fontconfig_timestamp != our_fontconfig_timestamp) { bool bFirstTime = our_fontconfig_timestamp == 0; @@ -4147,11 +4147,11 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) // get cursor blink time gboolean blink = false; - g_object_get( pSettings, "gtk-cursor-blink", &blink, (char *)NULL ); + g_object_get( pSettings, "gtk-cursor-blink", &blink, nullptr ); if( blink ) { gint blink_time = static_cast<gint>(STYLE_CURSOR_NOBLINKTIME); - g_object_get( pSettings, "gtk-cursor-blink-time", &blink_time, (char *)NULL ); + g_object_get( pSettings, "gtk-cursor-blink-time", &blink_time, nullptr ); // set the blink_time if there is a setting and it is reasonable // else leave the default value if( blink_time > 100 && blink_time != gint(STYLE_CURSOR_NOBLINKTIME) ) @@ -4167,7 +4167,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) "gtk-double-click-distance", &iDoubleClickDistance, "gtk-dnd-drag-threshold", &iDragThreshold, "gtk-menu-popup-delay", &iMenuPopupDelay, - (char *)NULL ); + nullptr ); aMouseSettings.SetDoubleClickTime( iDoubleClickTime ); aMouseSettings.SetDoubleClickWidth( iDoubleClickDistance ); aMouseSettings.SetDoubleClickHeight( iDoubleClickDistance ); @@ -4179,13 +4179,13 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) gboolean showmenuicons = true, primarybuttonwarps = false; g_object_get( pSettings, "gtk-menu-images", &showmenuicons, - (char *)NULL ); + nullptr ); if( g_object_class_find_property( G_OBJECT_GET_CLASS(pSettings), "gtk-primary-button-warps-slider") ) { g_object_get( pSettings, "gtk-primary-button-warps-slider", &primarybuttonwarps, - (char *)NULL ); + nullptr ); } aStyleSet.SetPreferredUseImagesInMenus(showmenuicons); aStyleSet.SetPrimaryButtonWarpsSlider(primarybuttonwarps); @@ -4200,14 +4200,14 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) "slider-width", &slider_width, "trough-border", &trough_border, "min-slider-length", &min_slider_length, - (char *)NULL ); + nullptr ); gint magic = trough_border ? 1 : 0; aStyleSet.SetScrollBarSize( slider_width + 2*trough_border ); aStyleSet.SetMinThumbSize( min_slider_length - magic ); // preferred icon style gchar* pIconThemeName = NULL; - g_object_get( pSettings, "gtk-icon-theme-name", &pIconThemeName, (char *)NULL ); + g_object_get( pSettings, "gtk-icon-theme-name", &pIconThemeName, nullptr ); aStyleSet.SetPreferredIconTheme( OUString::createFromAscii( pIconThemeName ) ); g_free( pIconThemeName ); @@ -4322,7 +4322,7 @@ static void NWAddWidgetToCacheWindow( GtkWidget* widget, SalX11Screen nScreen ) { rData.gCacheWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL ); g_object_set_data( G_OBJECT( rData.gCacheWindow ), "libo-version", - (gpointer)LIBO_VERSION_DOTTED ); + const_cast<char *>(LIBO_VERSION_DOTTED) ); GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), nScreen.getXScreen() ); @@ -4487,7 +4487,7 @@ static void NWEnsureGTKToolbar( SalX11Screen nScreen ) gtk_widget_ensure_style( gWidgetData[nScreen].gToolbarWidget ); gtk_widget_style_get( gWidgetData[nScreen].gToolbarWidget, "button_relief", &aRelief, - (char *)NULL); + nullptr); gtk_button_set_relief( GTK_BUTTON(gWidgetData[nScreen].gToolbarButtonWidget), aRelief ); GTK_WIDGET_UNSET_FLAGS( gWidgetData[nScreen].gToolbarButtonWidget, GTK_CAN_FOCUS ); diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 874f250b0b16..e590a8ab1bcd 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -956,14 +956,14 @@ ooo_fixed_get_type() static const GTypeInfo tinfo = { sizeof (GtkFixedClass), - (GBaseInitFunc) NULL, /* base init */ - (GBaseFinalizeFunc) NULL, /* base finalize */ - (GClassInitFunc) NULL, /* class init */ - (GClassFinalizeFunc) NULL, /* class finalize */ + nullptr, /* base init */ + nullptr, /* base finalize */ + nullptr, /* class init */ + nullptr, /* class finalize */ NULL, /* class data */ sizeof (GtkFixed), /* instance size */ 0, /* nb preallocs */ - (GInstanceInitFunc) NULL, /* instance init */ + nullptr, /* instance init */ NULL /* value table */ }; @@ -1296,7 +1296,7 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) m_pWindow = gtk_widget_new( GTK_TYPE_WINDOW, "type", eWinType, "visible", FALSE, NULL ); g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", this ); - g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", (gpointer)LIBO_VERSION_DOTTED); + g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", const_cast<char *>(LIBO_VERSION_DOTTED)); // force wm class hint m_nExtStyle = ~0; @@ -4048,7 +4048,7 @@ void GtkSalFrame::IMHandler::doCallEndExtTextInput() void GtkSalFrame::IMHandler::updateIMSpotLocation() { SalExtTextInputPosEvent aPosEvent; - m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void*)&aPosEvent ); + m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, static_cast<void*>(&aPosEvent) ); GdkRectangle aArea; aArea.x = aPosEvent.mnX; aArea.y = aPosEvent.mnY; @@ -4070,7 +4070,7 @@ void GtkSalFrame::IMHandler::sendEmptyCommit() aEmptyEv.mnCursorPos = 0; aEmptyEv.mnCursorFlags = 0; aEmptyEv.mbOnlyCursor = False; - m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEmptyEv ); + m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aEmptyEv) ); if( ! aDel.isDeleted() ) m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL ); } @@ -4289,7 +4289,7 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* pContext, gchar* pTex } if( ! bSingleCommit ) { - pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&pThis->m_aInputEvent); + pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void*>(&pThis->m_aInputEvent)); if( ! aDel.isDeleted() ) pThis->doCallEndExtTextInput(); } @@ -4413,7 +4413,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_ SolarMutexGuard aGuard; vcl::DeletionListener aDel( pThis->m_pFrame ); - pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&pThis->m_aInputEvent); + pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void*>(&pThis->m_aInputEvent)); if( bEndPreedit && ! aDel.isDeleted() ) pThis->doCallEndExtTextInput(); if( ! aDel.isDeleted() ) diff --git a/vcl/unx/gtk/window/hudawareness.cxx b/vcl/unx/gtk/window/hudawareness.cxx index 947f404f9d52..760103314d7c 100644 --- a/vcl/unx/gtk/window/hudawareness.cxx +++ b/vcl/unx/gtk/window/hudawareness.cxx @@ -61,7 +61,7 @@ hud_awareness_register (GDBusConnection *connection, HudAwarenessHandle *handle; guint object_id; - memset ((void *)&vtable, 0, sizeof (vtable)); + memset (static_cast<void *>(&vtable), 0, sizeof (vtable)); vtable.method_call = hud_awareness_method_call; if G_UNLIKELY (iface == NULL) diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 3b0662692d73..09bfac55a89e 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -167,7 +167,7 @@ Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, Rectangle aA "slider-width", &slider_width, "stepper-size", &stepper_size, "trough-border", &trough_border, - "stepper-spacing", &stepper_spacing, (char *)NULL ); + "stepper-spacing", &stepper_spacing, nullptr ); gboolean has_forward; gboolean has_forward2; @@ -178,7 +178,7 @@ Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, Rectangle aA "has-forward-stepper", &has_forward, "has-secondary-forward-stepper", &has_forward2, "has-backward-stepper", &has_backward, - "has-secondary-backward-stepper", &has_backward2, (char *)NULL ); + "has-secondary-backward-stepper", &has_backward2, nullptr ); gint buttonWidth; gint buttonHeight; Rectangle buttonRect; @@ -285,7 +285,7 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, "stepper_size", &stepper_size, "trough_border", &trough_border, "stepper_spacing", &stepper_spacing, - "min_slider_length", &min_slider_length, (char *)NULL ); + "min_slider_length", &min_slider_length, nullptr ); gboolean has_forward; gboolean has_forward2; gboolean has_backward; @@ -295,7 +295,7 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, "has-forward-stepper", &has_forward, "has-secondary-forward-stepper", &has_forward2, "has-backward-stepper", &has_backward, - "has-secondary-backward-stepper", &has_backward2, (char *)NULL ); + "has-secondary-backward-stepper", &has_backward2, nullptr ); gint magic = trough_border ? 1 : 0; gint nFirst = 0; gint slider_side = slider_width + (trough_border * 2); @@ -1229,7 +1229,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar gtk_style_context_get_style( mpCheckButtonStyle, "indicator-size", &indicator_size, "indicator-spacing", &indicator_spacing, - (char *)NULL ); + nullptr ); GtkBorder border; gtk_style_context_get_border(mpCheckButtonStyle, GTK_STATE_FLAG_NORMAL, &border); @@ -1255,7 +1255,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar gtk_style_context_get_style( mpMenuItemStyle, "indicator-size", &indicator_size, - (char *)NULL ); + nullptr ); point = MAX(0, rControlRegion.GetHeight() - indicator_size); aEditRect = Rectangle( Point( 0, point / 2), @@ -1697,11 +1697,11 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) // get cursor blink time gboolean blink = false; - g_object_get( pSettings, "gtk-cursor-blink", &blink, (char *)NULL ); + g_object_get( pSettings, "gtk-cursor-blink", &blink, nullptr ); if( blink ) { gint blink_time = static_cast<gint>(STYLE_CURSOR_NOBLINKTIME); - g_object_get( pSettings, "gtk-cursor-blink-time", &blink_time, (char *)NULL ); + g_object_get( pSettings, "gtk-cursor-blink-time", &blink_time, nullptr ); // set the blink_time if there is a setting and it is reasonable // else leave the default value if( blink_time > 100 && blink_time != gint(STYLE_CURSOR_NOBLINKTIME) ) @@ -1717,7 +1717,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) "gtk-double-click-distance", &iDoubleClickDistance, "gtk-dnd-drag-threshold", &iDragThreshold, "gtk-menu-popup-delay", &iMenuPopupDelay, - (char *)NULL ); + nullptr ); aMouseSettings.SetDoubleClickTime( iDoubleClickTime ); aMouseSettings.SetDoubleClickWidth( iDoubleClickDistance ); aMouseSettings.SetDoubleClickHeight( iDoubleClickDistance ); @@ -1730,7 +1730,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) g_object_get( pSettings, "gtk-menu-images", &showmenuicons, "gtk-primary-button-warps-slider", &primarybuttonwarps, - (char *)NULL ); + nullptr ); aStyleSet.SetPreferredUseImagesInMenus(showmenuicons); aStyleSet.SetPrimaryButtonWarpsSlider(primarybuttonwarps); @@ -1744,14 +1744,14 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) "slider-width", &slider_width, "trough-border", &trough_border, "min-slider-length", &min_slider_length, - (char *)NULL ); + nullptr ); gint magic = trough_border ? 1 : 0; aStyleSet.SetScrollBarSize( slider_width + 2*trough_border ); aStyleSet.SetMinThumbSize( min_slider_length - magic ); // preferred icon style gchar* pIconThemeName = NULL; - g_object_get( pSettings, "gtk-icon-theme-name", &pIconThemeName, (char *)NULL ); + g_object_get( pSettings, "gtk-icon-theme-name", &pIconThemeName, nullptr ); aStyleSet.SetPreferredIconTheme( OUString::createFromAscii( pIconThemeName ) ); g_free( pIconThemeName ); @@ -1762,7 +1762,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) // finally update the collected settings rSettings.SetStyleSettings( aStyleSet ); gchar* pThemeName = NULL; - g_object_get( pSettings, "gtk-theme-name", &pThemeName, (char *)NULL ); + g_object_get( pSettings, "gtk-theme-name", &pThemeName, nullptr ); #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "Theme name is \"%s\"\n", pThemeName ); #endif diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx index 540773dde5f0..6c464ac810a5 100644 --- a/vcl/unx/kde4/KDESalFrame.cxx +++ b/vcl/unx/kde4/KDESalFrame.cxx @@ -72,7 +72,7 @@ static Color toColor( const QColor &rColor ) */ static OUString readEntryUntranslated( KConfigGroup *pGroup, const char *pKey ) { - return OUString::createFromAscii( (const char *) pGroup->readEntryUntranslated( pKey ).toAscii() ); + return OUString::createFromAscii( static_cast<const char *>(pGroup->readEntryUntranslated( pKey ).toAscii()) ); } /** Helper function to add information to Font from QFont. @@ -85,7 +85,7 @@ static vcl::Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Loca QFontInfo qFontInfo( rQFont ); // set family name - aInfo.m_aFamilyName = OUString( (const char *) rQFont.family().toUtf8(), strlen( (const char *) rQFont.family().toUtf8() ), RTL_TEXTENCODING_UTF8 ); + aInfo.m_aFamilyName = OUString( static_cast<const char *>(rQFont.family().toUtf8()), strlen( static_cast<const char *>(rQFont.family().toUtf8()) ), RTL_TEXTENCODING_UTF8 ); // set italic aInfo.m_eItalic = ( qFontInfo.italic()? ITALIC_NORMAL: ITALIC_NONE ); diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx index 7407c51a5fe5..aad7dec896db 100644 --- a/vcl/workben/outdevgrind.cxx +++ b/vcl/workben/outdevgrind.cxx @@ -64,7 +64,7 @@ public: class TestWindow : public Dialog { public: - TestWindow() : Dialog( (vcl::Window *) NULL ) + TestWindow() : Dialog( nullptr ) { SetText( OUString("OutDev grinding") ); SetSizePixel( Size( 1024, 1024 ) ); |