diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 16:20:12 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 16:20:39 +0100 |
commit | d1775349e4ea619aa7b634bcd7161374107038a1 (patch) | |
tree | 300c60723c49ec7601f6ac886f37805b5afa0a6a | |
parent | aa4d195143fec01fba5c0a0f41950f1cbddbc9bd (diff) |
loplugin:nullptr (automatic rewrite; Mac-specific code)
Change-Id: I90a955eb3e485723bb81e7164edcf60f7b0e94c7
32 files changed, 303 insertions, 303 deletions
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index ab59cf4d6f86..f065e7b6ebc4 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -218,7 +218,7 @@ public: SAL_DLLPRIVATE vcl::Window* ImplGetWindow() const { return pWindow; } #if defined(MACOSX) - void ImplSelectWithStart( Menu* pStartMenu = NULL ); + void ImplSelectWithStart( Menu* pStartMenu = nullptr ); #endif protected: diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx index 226db49b6169..2c50797c7b68 100644 --- a/include/vcl/sysdata.hxx +++ b/include/vcl/sysdata.hxx @@ -79,7 +79,7 @@ struct SystemEnvData #if defined( WNT ) , hWnd(0) #elif defined( MACOSX ) - , mpNSView(NULL) + , mpNSView(nullptr) , mbOpenGL(false) #elif defined( ANDROID ) #elif defined( IOS ) @@ -161,7 +161,7 @@ struct SystemGraphicsData , hDC( 0 ) , hWnd( 0 ) #elif defined( MACOSX ) - , rCGContext( NULL ) + , rCGContext( nullptr ) #elif defined( ANDROID ) // Nothing #elif defined( IOS ) diff --git a/vcl/inc/quartz/salgdicommon.hxx b/vcl/inc/quartz/salgdicommon.hxx index b0d9a2fdea7c..47cbd9cb7c75 100644 --- a/vcl/inc/quartz/salgdicommon.hxx +++ b/vcl/inc/quartz/salgdicommon.hxx @@ -92,7 +92,7 @@ public: void Disable() { m_bIsEnabled = false; } bool IsEnabled() const { return m_bIsEnabled; } CGContextRef GetTargetContext() const { return m_xTargetContext; } - CGContextRef GetMaskContext() const { return (m_bIsEnabled ? m_xMaskContext : NULL); } + CGContextRef GetMaskContext() const { return (m_bIsEnabled ? m_xMaskContext : nullptr); } private: CGLayerRef m_xTargetLayer; diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx index 1d33aeaf4946..081f6e5f53dc 100644 --- a/vcl/osx/DataFlavorMapping.cxx +++ b/vcl/osx/DataFlavorMapping.cxx @@ -364,7 +364,7 @@ NSData* PNGDataProvider::getSystemData() mData >>= pngData; Sequence<sal_Int8> imgData; - NSData* sysData = NULL; + NSData* sysData = nullptr; if( PNGToImage( pngData, imgData, meImageType)) sysData = [NSData dataWithBytes: imgData.getArray() length: imgData.getLength()]; @@ -505,7 +505,7 @@ DataFlavor DataFlavorMapper::systemToOpenOfficeFlavor( const NSString* systemDat const NSString* DataFlavorMapper::openOfficeToSystemFlavor( const DataFlavor& oOOFlavor, bool& rbInternal) const { - const NSString* sysFlavor = NULL; + const NSString* sysFlavor = nullptr; rbInternal = false; for( size_t i = 0; i < SIZE_FLAVOR_MAP; ++i ) @@ -657,7 +657,7 @@ NSArray* DataFlavorMapper::flavorSequenceToTypesArray(const com::sun::star::uno: { const NSString* str = openOfficeToSystemFlavor(flavors[i], bNeedDummyInternalFlavor); - if (str != NULL) + if (str != nullptr) { [str retain]; [array addObject: str]; diff --git a/vcl/osx/DragSource.cxx b/vcl/osx/DragSource.cxx index bc3ee9700284..c72b4bcaa2d0 100644 --- a/vcl/osx/DragSource.cxx +++ b/vcl/osx/DragSource.cxx @@ -143,8 +143,8 @@ Sequence<OUString> dragSource_getSupportedServiceNames() DragSource::DragSource(): WeakComponentImplHelper<XDragSource, XInitialization, XServiceInfo>(m_aMutex), - mView(NULL), - mpFrame(NULL), + mView(nullptr), + mpFrame(nullptr), mLastMouseEventBeforeStartDrag(nil), m_MouseButton(0) { @@ -231,7 +231,7 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger, m_MouseButton= mMouseEvent.Buttons; mXDragSrcListener = listener; mXCurrentContext = static_cast<XDragSourceContext*>(new DragSourceContext); - rtl::Reference<AquaClipboard> clipb(new AquaClipboard(NULL, false)); + rtl::Reference<AquaClipboard> clipb(new AquaClipboard(nullptr, false)); g_XTransferable = transferable; clipb->setContents(g_XTransferable, uno::Reference<XClipboardOwner>()); mDragSourceActions = sourceActions; diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx index bd7467db64cf..9253598ca9c7 100644 --- a/vcl/osx/DropTarget.cxx +++ b/vcl/osx/DropTarget.cxx @@ -117,7 +117,7 @@ namespace /* private */ DropTarget::DropTarget() : WeakComponentImplHelper<XInitialization, XDropTarget, XDropTargetDragContext, XDropTargetDropContext, XServiceInfo>(m_aMutex), mView(nil), - mpFrame(NULL), + mpFrame(nullptr), mDropTargetHelper(nil), mbActive(false), mDragSourceSupportedActions(DNDConstants::ACTION_NONE), diff --git a/vcl/osx/HtmlFmtFlt.cxx b/vcl/osx/HtmlFmtFlt.cxx index 239476dd7eea..301d9d1b6148 100644 --- a/vcl/osx/HtmlFmtFlt.cxx +++ b/vcl/osx/HtmlFmtFlt.cxx @@ -130,7 +130,7 @@ Sequence<sal_Int8> HTMLFormatToTextHtml(const Sequence<sal_Int8>& aHTMLFormat) // It doesn't seem to be HTML? Well then simply return what has been // provided in non-debug builds - if (htmlStartTag == NULL) + if (htmlStartTag == nullptr) { return aHTMLFormat; } diff --git a/vcl/osx/OSXTransferable.cxx b/vcl/osx/OSXTransferable.cxx index 120f6b169220..4c75bbcecc30 100644 --- a/vcl/osx/OSXTransferable.cxx +++ b/vcl/osx/OSXTransferable.cxx @@ -122,7 +122,7 @@ Any SAL_CALL OSXTransferable::getTransferData( const DataFlavor& aFlavor ) dp = DataFlavorMapper::getDataProvider(sysFormat, sysData); } - if (dp.get() == NULL) + if (dp.get() == nullptr) { throw UnsupportedFlavorException("AquaClipboard: Unsupported data flavor", static_cast<XTransferable*>(this)); @@ -151,7 +151,7 @@ void OSXTransferable::initClipboardItemList() { NSArray* pboardFormats = [mPasteboard types]; - if (pboardFormats == NULL) + if (pboardFormats == nullptr) { throw RuntimeException("AquaClipboard: Cannot get clipboard data", static_cast<XTransferable*>(this)); diff --git a/vcl/osx/a11yfocustracker.cxx b/vcl/osx/a11yfocustracker.cxx index 8823ba8df2fe..03eabfa7cfdc 100644 --- a/vcl/osx/a11yfocustracker.cxx +++ b/vcl/osx/a11yfocustracker.cxx @@ -128,8 +128,8 @@ void AquaA11yFocusTracker::toolbox_open_floater(vcl::Window *pWindow) { bool bToolboxFound = false; bool bFloatingWindowFound = false; - vcl::Window * pFloatingWindow = NULL; - while ( pWindow != NULL ) { + vcl::Window * pFloatingWindow = nullptr; + while ( pWindow != nullptr ) { if ( pWindow->GetType() == WINDOW_TOOLBOX ) { bToolboxFound = true; } else if ( pWindow->GetType() == WINDOW_FLOATINGWINDOW ) { diff --git a/vcl/osx/a11yrolehelper.mm b/vcl/osx/a11yrolehelper.mm index 8d14fc77ab76..f3cb57dd1416 100644 --- a/vcl/osx/a11yrolehelper.mm +++ b/vcl/osx/a11yrolehelper.mm @@ -33,7 +33,7 @@ using namespace ::com::sun::star::uno; +(id)simpleMapNativeRoleFrom: (XAccessibleContext *) accessibleContext { id nativeRole = nil; - if (accessibleContext == NULL) + if (accessibleContext == nullptr) return nativeRole; switch( accessibleContext -> getAccessibleRole() ) { diff --git a/vcl/osx/clipboard.cxx b/vcl/osx/clipboard.cxx index e674b74e95a9..d57e4bcf01cb 100644 --- a/vcl/osx/clipboard.cxx +++ b/vcl/osx/clipboard.cxx @@ -61,7 +61,7 @@ using namespace comphelper; -(void)disposing { - pAquaClipboard = NULL; + pAquaClipboard = nullptr; } @end @@ -86,7 +86,7 @@ AquaClipboard::AquaClipboard(NSPasteboard* pasteboard, bool bUseSystemPasteboard mpDataFlavorMapper = DataFlavorMapperPtr_t(new DataFlavorMapper()); - if (pasteboard != NULL) + if (pasteboard != nullptr) { mPasteboard = pasteboard; mIsSystemPasteboard = false; @@ -289,9 +289,9 @@ void AquaClipboard::provideDataForType(NSPasteboard* sender, const NSString* typ if( mXClipboardContent.is() ) { DataProviderPtr_t dp = mpDataFlavorMapper->getDataProvider(type, mXClipboardContent); - NSData* pBoardData = NULL; + NSData* pBoardData = nullptr; - if (dp.get() != NULL) + if (dp.get() != nullptr) { pBoardData = (NSData*)dp->getSystemData(); [sender setData: pBoardData forType:const_cast<NSString*>(type)]; @@ -312,7 +312,7 @@ void SAL_CALL AquaClipboard::flushClipboard() { const NSString* sysType = mpDataFlavorMapper->openOfficeToSystemFlavor(flavorList[i], bInternal); - if (sysType != NULL) + if (sysType != nullptr) { provideDataForType(mPasteboard, sysType); } diff --git a/vcl/osx/clipboard.hxx b/vcl/osx/clipboard.hxx index ee769ad5b8dc..5e0edecbe8a3 100644 --- a/vcl/osx/clipboard.hxx +++ b/vcl/osx/clipboard.hxx @@ -80,7 +80,7 @@ public: system clipboard will be created (bUseSystemClipboard == true) or if the DragPasteboard if bUseSystemClipboard == false */ - AquaClipboard(NSPasteboard* pasteboard = NULL, + AquaClipboard(NSPasteboard* pasteboard = nullptr, bool bUseSystemClipboard = true); virtual ~AquaClipboard(); diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm index 4579b70b8732..075a396cb1c7 100644 --- a/vcl/osx/printaccessoryview.mm +++ b/vcl/osx/printaccessoryview.mm @@ -984,7 +984,7 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO [pAccessoryController withPrinterController: pController]; [pAccessoryController withViewState: pState]; - NSView* pCurParent = 0; + NSView* pCurParent = nullptr; long nCurY = 0; long nCurX = 0; NSSize aMaxTabSize = NSZeroSize; diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx index ea89aa5502ba..549e1cf882b8 100644 --- a/vcl/osx/saldata.cxx +++ b/vcl/osx/saldata.cxx @@ -26,7 +26,7 @@ #import "apple_remote/RemoteMainController.h" -oslThreadKey SalData::s_aAutoReleaseKey = 0; +oslThreadKey SalData::s_aAutoReleaseKey = nullptr; static void SAL_CALL releasePool( void* pPool ) { @@ -36,26 +36,26 @@ static void SAL_CALL releasePool( void* pPool ) SalData::SalData() : - mpTimerProc( NULL ), - mpFirstInstance( NULL ), - mpFirstObject( NULL ), - mpFirstVD( NULL ), - mpFirstPrinter( NULL ), - mpFontList( NULL ), + mpTimerProc( nullptr ), + mpFirstInstance( nullptr ), + mpFirstObject( nullptr ), + mpFirstVD( nullptr ), + mpFirstPrinter( nullptr ), + mpFontList( nullptr ), mpStatusItem( nil ), mxRGBSpace( CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB) ), mxGraySpace( CGColorSpaceCreateWithName(kCGColorSpaceGenericGray) ), maCursors(), mbIsScrollbarDoubleMax( false ), #if !HAVE_FEATURE_MACOSX_SANDBOX - mpAppleRemoteMainController( NULL ), + mpAppleRemoteMainController( nullptr ), #endif mpDockIconClickHandler( nil ), mnDPIX( 0 ), mnDPIY( 0 ) { maCursors.fill( INVALID_CURSOR_PTR ); - if( s_aAutoReleaseKey == 0 ) + if( s_aAutoReleaseKey == nullptr ) s_aAutoReleaseKey = osl_createThreadKey( releasePool ); } @@ -74,12 +74,12 @@ SalData::~SalData() NSAutoreleasePool* pPool = reinterpret_cast<NSAutoreleasePool*>( osl_getThreadKeyData( s_aAutoReleaseKey ) ); if( pPool ) { - osl_setThreadKeyData( s_aAutoReleaseKey, NULL ); + osl_setThreadKeyData( s_aAutoReleaseKey, nullptr ); [pPool release]; } osl_destroyThreadKey( s_aAutoReleaseKey ); - s_aAutoReleaseKey = 0; + s_aAutoReleaseKey = nullptr; } #if !HAVE_FEATURE_MACOSX_SANDBOX if ( mpAppleRemoteMainController ) @@ -113,35 +113,35 @@ typedef struct const o3tl::enumarray<PointerStyle, curs_ent> aCursorTab = { -curs_ent{ NULL, { 0, 0 } }, //PointerStyle::Arrow +curs_ent{ nullptr, { 0, 0 } }, //PointerStyle::Arrow { "nullptr", { 16, 16 } }, //PointerStyle::Null { "hourglass", { 15, 15 } }, //PointerStyle::Wait -{ NULL, { 0, 0 } }, //PointerStyle::Text +{ nullptr, { 0, 0 } }, //PointerStyle::Text { "help", { 0, 0 } }, //PointerStyle::Help -{ NULL, { 0, 0 } }, //PointerStyle::Cross -{ NULL, { 0, 0 } }, //PointerStyle::Move -{ NULL, { 0, 0 } }, //PointerStyle::NSize -{ NULL, { 0, 0 } }, //PointerStyle::SSize -{ NULL, { 0, 0 } }, //PointerStyle::WSize -{ NULL, { 0, 0 } }, //PointerStyle::ESize +{ nullptr, { 0, 0 } }, //PointerStyle::Cross +{ nullptr, { 0, 0 } }, //PointerStyle::Move +{ nullptr, { 0, 0 } }, //PointerStyle::NSize +{ nullptr, { 0, 0 } }, //PointerStyle::SSize +{ nullptr, { 0, 0 } }, //PointerStyle::WSize +{ nullptr, { 0, 0 } }, //PointerStyle::ESize { "nwsesize", { 15, 15 } }, //PointerStyle::NWSize { "neswsize", { 15, 15 } }, //PointerStyle::NESize { "neswsize", { 15, 15 } }, //PointerStyle::SWSize { "nwsesize", { 15, 15 } }, //PointerStyle::SESize -{ NULL, { 0, 0 } }, //PointerStyle::WindowNSize -{ NULL, { 0, 0 } }, //PointerStyle::WindowSSize -{ NULL, { 0, 0 } }, //PointerStyle::WindowWSize -{ NULL, { 0, 0 } }, //PointerStyle::WindowESize +{ nullptr, { 0, 0 } }, //PointerStyle::WindowNSize +{ nullptr, { 0, 0 } }, //PointerStyle::WindowSSize +{ nullptr, { 0, 0 } }, //PointerStyle::WindowWSize +{ nullptr, { 0, 0 } }, //PointerStyle::WindowESize { "nwsesize", { 15, 15 } }, //PointerStyle::WindowNWSize { "neswsize", { 15, 15 } }, //PointerStyle::WindowNESize { "neswsize", { 15, 15 } }, //PointerStyle::WindowSWSize { "nwsesize", { 15, 15 } }, //PointerStyle::WindowSESize -{ NULL, { 0, 0 } }, //PointerStyle::HSplit -{ NULL, { 0, 0 } }, //PointerStyle::VSplit -{ NULL, { 0, 0 } }, //PointerStyle::HSizeBar -{ NULL, { 0, 0 } }, //PointerStyle::VSizeBar -{ NULL, { 0, 0 } }, //PointerStyle::Hand -{ NULL, { 0, 0 } }, //PointerStyle::RefHand +{ nullptr, { 0, 0 } }, //PointerStyle::HSplit +{ nullptr, { 0, 0 } }, //PointerStyle::VSplit +{ nullptr, { 0, 0 } }, //PointerStyle::HSizeBar +{ nullptr, { 0, 0 } }, //PointerStyle::VSizeBar +{ nullptr, { 0, 0 } }, //PointerStyle::Hand +{ nullptr, { 0, 0 } }, //PointerStyle::RefHand { "pen", { 3, 27 } }, //PointerStyle::Pen { "magnify", { 12, 13 } }, //PointerStyle::Magnify { "fill", { 10, 22 } }, //PointerStyle::Fill diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index c4614a821c1d..5aed7bbf24b2 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -49,14 +49,14 @@ using namespace std; -AquaSalFrame* AquaSalFrame::s_pCaptureFrame = NULL; +AquaSalFrame* AquaSalFrame::s_pCaptureFrame = nullptr; AquaSalFrame::AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags salFrameStyle ) : mpNSWindow(nil), mpNSView(nil), mpDockMenuEntry(nil), - mpGraphics(NULL), - mpParent(NULL), + mpGraphics(nullptr), + mpParent(nullptr), mnMinWidth(0), mnMinHeight(0), mnMaxWidth(0), @@ -72,11 +72,11 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags salFrameStyle mnStyleMask( 0 ), mnLastEventTime( 0 ), mnLastModifierFlags( 0 ), - mpMenu( NULL ), + mpMenu( nullptr ), mnExtStyle( 0 ), mePointerStyle( PointerStyle::Arrow ), mnTrackingRectTag( 0 ), - mrClippingPath( 0 ), + mrClippingPath( nullptr ), mnICOptions( InputContextFlags::NONE ) { maSysData.nSize = sizeof( SystemEnvData ); @@ -109,7 +109,7 @@ AquaSalFrame::~AquaSalFrame() DBG_ASSERT( this != s_pCaptureFrame, "capture frame destroyed" ); if( this == s_pCaptureFrame ) - s_pCaptureFrame = NULL; + s_pCaptureFrame = nullptr; delete mpGraphics; @@ -172,7 +172,7 @@ void AquaSalFrame::initWindowAndView() if( (mnStyle & SalFrameStyleFlags::MOVEABLE) ) { mnStyleMask |= NSTitledWindowMask; - if( mpParent == NULL ) + if( mpParent == nullptr ) mnStyleMask |= NSMiniaturizableWindowMask; } if( (mnStyle & SalFrameStyleFlags::SIZEABLE) ) @@ -256,13 +256,13 @@ void AquaSalFrame::screenParametersChanged() if( mpGraphics ) mpGraphics->updateResolution(); - CallCallback( SALEVENT_DISPLAYCHANGED, 0 ); + CallCallback( SALEVENT_DISPLAYCHANGED, nullptr ); } SalGraphics* AquaSalFrame::AcquireGraphics() { if ( mbGraphics ) - return NULL; + return nullptr; if ( !mpGraphics ) { @@ -300,10 +300,10 @@ void AquaSalFrame::SetTitle(const OUString& rTitle) // create an entry in the dock menu const SalFrameStyleFlags nAppWindowStyle = (SalFrameStyleFlags::CLOSEABLE | SalFrameStyleFlags::MOVEABLE); - if( mpParent == NULL && + if( mpParent == nullptr && (mnStyle & nAppWindowStyle) == nAppWindowStyle ) { - if( mpDockMenuEntry == NULL ) + if( mpDockMenuEntry == nullptr ) { NSMenu* pDock = AquaSalInstance::GetDynamicDockMenu(); @@ -417,7 +417,7 @@ void AquaSalFrame::Show(bool bVisible, bool bNoActivate) if( mbInitShow ) initShow(); - CallCallback(SALEVENT_RESIZE, 0); + CallCallback(SALEVENT_RESIZE, nullptr); // trigger filling our backbuffer SendPaintEvent(); @@ -589,7 +589,7 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState ) } // send event that we were moved/sized if( nEvent ) - CallCallback( nEvent, NULL ); + CallCallback( nEvent, nullptr ); if( mbShown && mpNSWindow ) { @@ -746,7 +746,7 @@ void AquaSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) UpdateFrameGeometry(); if( mbShown ) - CallCallback( SALEVENT_MOVERESIZE, NULL ); + CallCallback( SALEVENT_MOVERESIZE, nullptr ); } else { @@ -756,7 +756,7 @@ void AquaSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) UpdateFrameGeometry(); if( mbShown ) - CallCallback( SALEVENT_MOVERESIZE, NULL ); + CallCallback( SALEVENT_MOVERESIZE, nullptr ); // show the dock and the menubar [NSMenu setMenuBarVisible:YES]; @@ -1315,7 +1315,7 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_u UpdateFrameGeometry(); if (nEvent) - CallCallback(nEvent, NULL); + CallCallback(nEvent, nullptr); if( mbShown && bPaint ) { @@ -1577,7 +1577,7 @@ void AquaSalFrame::CaptureMouse( bool bCapture ) if( bCapture ) s_pCaptureFrame = this; else if( ! bCapture && s_pCaptureFrame == this ) - s_pCaptureFrame = NULL; + s_pCaptureFrame = nullptr; } void AquaSalFrame::ResetClipRegion() @@ -1592,7 +1592,7 @@ void AquaSalFrame::ResetClipRegion() // release old path and indicate no clipping CGPathRelease( mrClippingPath ); - mrClippingPath = NULL; + mrClippingPath = nullptr; if( mpNSView && mbShown ) [mpNSView setNeedsDisplay: YES]; @@ -1617,7 +1617,7 @@ void AquaSalFrame::BeginSetClipRegion( sal_uLong nRects ) if( mrClippingPath ) { CGPathRelease( mrClippingPath ); - mrClippingPath = NULL; + mrClippingPath = nullptr; } if( maClippingRects.size() > SAL_CLIPRECT_COUNT && nRects < maClippingRects.size() ) @@ -1655,13 +1655,13 @@ void AquaSalFrame::EndSetClipRegion() if( ! maClippingRects.empty() ) { mrClippingPath = CGPathCreateMutable(); - CGPathAddRects( mrClippingPath, NULL, &maClippingRects[0], maClippingRects.size() ); + CGPathAddRects( mrClippingPath, nullptr, &maClippingRects[0], maClippingRects.size() ); } if( mpNSView && mbShown ) [mpNSView setNeedsDisplay: YES]; if( mpNSWindow ) { - [mpNSWindow setOpaque: (mrClippingPath != NULL) ? NO : YES]; + [mpNSWindow setOpaque: (mrClippingPath != nullptr) ? NO : YES]; [mpNSWindow setBackgroundColor: [NSColor clearColor]]; // shadow is invalidated when view gets drawn again } diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 4016090daf4c..c67d55218281 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -140,7 +140,7 @@ static sal_uInt16 ImplMapKeyCode(sal_uInt16 nKeyCode) } // store the frame the mouse last entered -static AquaSalFrame* s_pMouseFrame = NULL; +static AquaSalFrame* s_pMouseFrame = nullptr; // store the last pressed button for enter/exit events // which lack that information static sal_uInt16 s_nLastButton = 0; @@ -158,7 +158,7 @@ static const struct ExceptionalKey static AquaSalFrame* getMouseContainerFrame() { - AquaSalFrame* pDispatchFrame = NULL; + AquaSalFrame* pDispatchFrame = nullptr; NSArray* aWindows = [NSWindow windowNumbersWithOptions:0]; for(NSUInteger i = 0; i < [aWindows count] && ! pDispatchFrame; i++ ) { @@ -185,7 +185,7 @@ static AquaSalFrame* getMouseContainerFrame() // enable OSX>=10.7 fullscreen options if available and useful bool bAllowFullScreen = (SalFrameStyleFlags::NONE == (mpFrame->mnStyle & (SalFrameStyleFlags::DIALOG | SalFrameStyleFlags::TOOLTIP | SalFrameStyleFlags::SYSTEMCHILD | SalFrameStyleFlags::FLOAT | SalFrameStyleFlags::TOOLWINDOW | SalFrameStyleFlags::INTRO))); bAllowFullScreen &= (SalFrameStyleFlags::NONE == (~mpFrame->mnStyle & (SalFrameStyleFlags::SIZEABLE))); - bAllowFullScreen &= (mpFrame->mpParent == NULL); + bAllowFullScreen &= (mpFrame->mpParent == nullptr); const SEL setCollectionBehavior = @selector(setCollectionBehavior:); if( bAllowFullScreen && [pNSWindow respondsToSelector: setCollectionBehavior]) { @@ -273,7 +273,7 @@ static AquaSalFrame* getMouseContainerFrame() if( (mpFrame->mpParent && mpFrame->mpParent->GetWindow()->IsInModalMode()) ) AquaSalMenu::enableMainMenu( false ); #endif - mpFrame->CallCallback( SALEVENT_GETFOCUS, 0 ); + mpFrame->CallCallback( SALEVENT_GETFOCUS, nullptr ); mpFrame->SendPaintEvent(); // repaint controls as active } } @@ -285,7 +285,7 @@ static AquaSalFrame* getMouseContainerFrame() if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) { - mpFrame->CallCallback(SALEVENT_LOSEFOCUS, 0); + mpFrame->CallCallback(SALEVENT_LOSEFOCUS, nullptr); mpFrame->SendPaintEvent(); // repaint controls as inactive } } @@ -307,7 +307,7 @@ static AquaSalFrame* getMouseContainerFrame() if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) { mpFrame->UpdateFrameGeometry(); - mpFrame->CallCallback( SALEVENT_MOVE, 0 ); + mpFrame->CallCallback( SALEVENT_MOVE, nullptr ); } } @@ -319,7 +319,7 @@ static AquaSalFrame* getMouseContainerFrame() if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) { mpFrame->UpdateFrameGeometry(); - mpFrame->CallCallback( SALEVENT_RESIZE, 0 ); + mpFrame->CallCallback( SALEVENT_RESIZE, nullptr ); mpFrame->SendPaintEvent(); } } @@ -333,7 +333,7 @@ static AquaSalFrame* getMouseContainerFrame() { mpFrame->mbShown = false; mpFrame->UpdateFrameGeometry(); - mpFrame->CallCallback( SALEVENT_RESIZE, 0 ); + mpFrame->CallCallback( SALEVENT_RESIZE, nullptr ); } } @@ -346,7 +346,7 @@ static AquaSalFrame* getMouseContainerFrame() { mpFrame->mbShown = true; mpFrame->UpdateFrameGeometry(); - mpFrame->CallCallback( SALEVENT_RESIZE, 0 ); + mpFrame->CallCallback( SALEVENT_RESIZE, nullptr ); } } @@ -359,10 +359,10 @@ static AquaSalFrame* getMouseContainerFrame() if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) { // #i84461# end possible input - mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, 0 ); + mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr ); if( AquaSalFrame::isAlive( mpFrame ) ) { - mpFrame->CallCallback( SALEVENT_CLOSE, 0 ); + mpFrame->CallCallback( SALEVENT_CLOSE, nullptr ); bRet = NO; // application will close the window or not, AppKit shouldn't } } @@ -451,7 +451,7 @@ static AquaSalFrame* getMouseContainerFrame() +(void)unsetMouseFrame: (AquaSalFrame*)pFrame { if( pFrame == s_pMouseFrame ) - s_pMouseFrame = NULL; + s_pMouseFrame = nullptr; } -(id)initWithSalFrame: (AquaSalFrame*)pFrame @@ -529,7 +529,7 @@ private: { // NOTE: the mpFrame access below is not guarded yet! // TODO: mpFrame et al need to be guarded by an independent mutex - AquaSalGraphics* pGraphics = (mpFrame && AquaSalFrame::isAlive(mpFrame)) ? mpFrame->mpGraphics : NULL; + AquaSalGraphics* pGraphics = (mpFrame && AquaSalFrame::isAlive(mpFrame)) ? mpFrame->mpGraphics : nullptr; if( pGraphics ) { // we did not get the mutex so we cannot draw now => request to redraw later @@ -641,7 +641,7 @@ private: if ( mpMouseEventListener != nil && [mpMouseEventListener respondsToSelector: @selector(mouseDown:)]) { - [mpMouseEventListener mouseDown: [pEvent copyWithZone: NULL]]; + [mpMouseEventListener mouseDown: [pEvent copyWithZone: nullptr]]; } s_nLastButton = MOUSE_LEFT; @@ -653,7 +653,7 @@ private: if ( mpMouseEventListener != nil && [mpMouseEventListener respondsToSelector: @selector(mouseDragged:)]) { - [mpMouseEventListener mouseDragged: [pEvent copyWithZone: NULL]]; + [mpMouseEventListener mouseDragged: [pEvent copyWithZone: nullptr]]; } s_nLastButton = MOUSE_LEFT; [self sendMouseEventToFrame:pEvent button:MOUSE_LEFT eventtype:SALEVENT_MOUSEMOVE]; @@ -684,7 +684,7 @@ private: -(void)mouseExited: (NSEvent*)pEvent { if( s_pMouseFrame == mpFrame ) - s_pMouseFrame = NULL; + s_pMouseFrame = nullptr; // #i107215# the only mouse events we get when inactive are enter/exit // actually we would like to have all of them, but better none than some @@ -1076,13 +1076,13 @@ private: SalExtTextInputEvent aEvent; aEvent.mnTime = mpFrame->mnLastEventTime; aEvent.maText = aInsertString; - aEvent.mpTextAttr = NULL; + aEvent.mpTextAttr = nullptr; aEvent.mnCursorPos = aInsertString.getLength(); aEvent.mnCursorFlags = 0; aEvent.mbOnlyCursor = FALSE; mpFrame->CallCallback( SALEVENT_EXTTEXTINPUT, &aEvent ); if( AquaSalFrame::isAlive( mpFrame ) ) - mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, 0 ); + mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr ); } } else @@ -1090,13 +1090,13 @@ private: SalExtTextInputEvent aEvent; aEvent.mnTime = mpFrame->mnLastEventTime; aEvent.maText.clear(); - aEvent.mpTextAttr = NULL; + aEvent.mpTextAttr = nullptr; aEvent.mnCursorPos = 0; aEvent.mnCursorFlags = 0; aEvent.mbOnlyCursor = FALSE; mpFrame->CallCallback( SALEVENT_EXTTEXTINPUT, &aEvent ); if( AquaSalFrame::isAlive( mpFrame ) ) - mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, 0 ); + mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr ); } mbKeyHandled = true; @@ -1645,9 +1645,9 @@ private: aInputEvent.maText.clear(); aInputEvent.mnCursorPos = 0; aInputEvent.mnCursorFlags = 0; - aInputEvent.mpTextAttr = 0; + aInputEvent.mpTextAttr = nullptr; mpFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void *>(&aInputEvent) ); - mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, 0 ); + mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr ); } mbKeyHandled= true; } @@ -1686,7 +1686,7 @@ private: // fprintf( stderr, "SalFrameView: doCommandBySelector %s\n", (char*)aSelector ); #endif if( (mpFrame->mnICOptions & InputContextFlags::Text) && - aSelector != NULL && [self respondsToSelector: aSelector] ) + aSelector != nullptr && [self respondsToSelector: aSelector] ) { [self performSelector: aSelector]; } diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 0ae4ff62946a..b4c4eec621f6 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -67,7 +67,7 @@ using namespace std; using namespace ::com::sun::star; -static int* gpnInit = 0; +static int* gpnInit = nullptr; static NSMenu* pDockMenu = nil; static bool bNoSVMain = true; static bool bLeftMain = false; @@ -85,7 +85,7 @@ class AquaDelayedSettingsChanged : public Idle { SalData* pSalData = GetSalData(); if( ! pSalData->maFrames.empty() ) - pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, NULL ); + pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, nullptr ); if( mbInvalidate ) { @@ -205,7 +205,7 @@ bool ImplSVMainHook( int * pnInit ) const char* pArgv[] = { aByteExe.getStr(), NULL }; NSApplicationMain( 3, pArgv ); #else - const char* pArgv[] = { aByteExe.getStr(), NULL }; + const char* pArgv[] = { aByteExe.getStr(), nullptr }; NSApplicationMain( 1, pArgv ); #endif @@ -246,7 +246,7 @@ void DeInitSalData() pSalData->mpStatusItem = nil; } delete pSalData; - SetSalData( NULL ); + SetSalData( nullptr ); } extern "C" { @@ -322,7 +322,7 @@ SalInstance* CreateSalInstance() initNSApp(); SalData* pSalData = GetSalData(); - DBG_ASSERT( pSalData->mpFirstInstance == NULL, "more than one instance created" ); + DBG_ASSERT( pSalData->mpFirstInstance == nullptr, "more than one instance created" ); AquaSalInstance* pInst = new AquaSalInstance; // init instance (only one instance in this version !!!) @@ -360,7 +360,7 @@ AquaSalInstance::AquaSalInstance() AquaSalInstance::~AquaSalInstance() { - ::comphelper::SolarMutex::setSolarMutex( 0 ); + ::comphelper::SolarMutex::setSolarMutex( nullptr ); mpSalYieldMutex->release(); delete mpSalYieldMutex; osl_destroyMutex( maUserEventListMutex ); @@ -524,7 +524,7 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent ) break; } AquaSalFrame* pFrame = pSalData->maFrames.front(); - vcl::Window* pWindow = pFrame ? pFrame->GetWindow() : NULL; + vcl::Window* pWindow = pFrame ? pFrame->GetWindow() : nullptr; if( pWindow ) { @@ -580,7 +580,7 @@ void AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLon // get one user event osl_acquireMutex( maUserEventListMutex ); - SalUserEvent aEvent( NULL, NULL, 0 ); + SalUserEvent aEvent( nullptr, nullptr, 0 ); if( ! maUserEvents.empty() ) { aEvent = maUserEvents.front(); @@ -752,12 +752,12 @@ bool AquaSalInstance::AnyInput( VclInputFlags nType ) NSEvent* pEvent = [NSApp nextEventMatchingMask: nEventMask untilDate: nil inMode: NSDefaultRunLoopMode dequeue: NO]; - return (pEvent != NULL); + return (pEvent != nullptr); } SalFrame* AquaSalInstance::CreateChildFrame( SystemParentData*, SalFrameStyleFlags /*nSalFrameStyle*/ ) { - return NULL; + return nullptr; } SalFrame* AquaSalInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nSalFrameStyle ) @@ -775,7 +775,7 @@ void AquaSalInstance::DestroyFrame( SalFrame* pFrame ) SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, bool /* bShow */ ) { - AquaSalObject *pObject = NULL; + AquaSalObject *pObject = nullptr; if ( pParent ) pObject = new AquaSalObject( static_cast<AquaSalFrame*>(pParent), pWindowData ); @@ -817,7 +817,7 @@ void AquaSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) pInfo->maDriver = GetOUString( pType ); pInfo->mnStatus = PrintQueueFlags::NONE; pInfo->mnJobs = 0; - pInfo->mpSysData = NULL; + pInfo->mpSysData = nullptr; pList->Add( pInfo ); } @@ -863,7 +863,7 @@ SalInfoPrinter* AquaSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueI // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); - SalInfoPrinter* pNewInfoPrinter = NULL; + SalInfoPrinter* pNewInfoPrinter = nullptr; if( pQueueInfo ) { pNewInfoPrinter = new AquaSalInfoPrinter( *pQueueInfo ); @@ -968,7 +968,7 @@ SalBitmap* AquaSalInstance::CreateSalBitmap() SalSession* AquaSalInstance::CreateSalSession() { - return NULL; + return nullptr; } class MacImeStatus : public SalI18NImeStatus @@ -1011,15 +1011,15 @@ CGImageRef CreateCGImage( const Image& rImage ) Bitmap aBmp( aBmpEx.GetBitmap() ); if( ! aBmp || ! aBmp.ImplGetImpBitmap() ) - return NULL; + return nullptr; // simple case, no transparency QuartzSalBitmap* pSalBmp = static_cast<QuartzSalBitmap*>(aBmp.ImplGetImpBitmap()->ImplGetSalBitmap()); if( ! pSalBmp ) - return NULL; + return nullptr; - CGImageRef xImage = NULL; + CGImageRef xImage = nullptr; if( ! (aBmpEx.IsAlpha() || aBmpEx.IsTransparent() ) ) xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight ); else if( aBmpEx.IsAlpha() ) diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx index b0144a829278..5119d6cf8f13 100644 --- a/vcl/osx/salmenu.cxx +++ b/vcl/osx/salmenu.cxx @@ -57,7 +57,7 @@ void releaseButtonEntry( AquaSalMenu::MenuBarButtonEntry& i_rEntry ) } -const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL; +const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = nullptr; @interface MainMenuSelector : NSObject { @@ -238,7 +238,7 @@ void AquaSalInstance::DestroyMenu( SalMenu* pSalMenu ) SalMenuItem* AquaSalInstance::CreateMenuItem( const SalItemParams* pItemData ) { if( !pItemData ) - return NULL; + return nullptr; AquaSalMenuItem *pSalMenuItem = new AquaSalMenuItem( pItemData ); @@ -257,9 +257,9 @@ void AquaSalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem ) AquaSalMenu::AquaSalMenu( bool bMenuBar ) : mbMenuBar( bMenuBar ), mpMenu( nil ), - mpVCLMenu( NULL ), - mpFrame( NULL ), - mpParentSalMenu( NULL ) + mpVCLMenu( nullptr ), + mpFrame( nullptr ), + mpParentSalMenu( nullptr ) { if( ! mbMenuBar ) { @@ -278,7 +278,7 @@ AquaSalMenu::~AquaSalMenu() // actually someone should have done AquaSalFrame::SetMenu( NULL ) // on our frame, alas it is not so if( mpFrame && AquaSalFrame::isAlive( mpFrame ) && mpFrame->mpMenu == this ) - const_cast<AquaSalFrame*>(mpFrame)->mpMenu = NULL; + const_cast<AquaSalFrame*>(mpFrame)->mpMenu = nullptr; // this should normally be empty already, but be careful... for( size_t i = 0; i < maButtons.size(); i++ ) @@ -305,7 +305,7 @@ AquaSalMenu::~AquaSalMenu() // in ! mbMenuBar case our mpMenu is actually a SalNSMenu* // so we can safely cast here - [static_cast<SalNSMenu*>(mpMenu) setSalMenu: NULL]; + [static_cast<SalNSMenu*>(mpMenu) setSalMenu: nullptr]; /* #i89860# FIXME: using [autorelease] here (and in AquaSalMenuItem::~AquaSalMenuItem) instead of [release] fixes an occasional crash. That should @@ -417,12 +417,12 @@ const AquaSalFrame* AquaSalMenu::getFrame() const const AquaSalMenu* pMenu = this; while( pMenu && ! pMenu->mpFrame ) pMenu = pMenu->mpParentSalMenu; - return pMenu ? pMenu->mpFrame : NULL; + return pMenu ? pMenu->mpFrame : nullptr; } void AquaSalMenu::unsetMainMenu() { - pCurrentMenuBar = NULL; + pCurrentMenuBar = nullptr; // remove items from main menu NSMenu* pMenu = [NSApp mainMenu]; @@ -502,7 +502,7 @@ void AquaSalMenu::addFallbackMenuItem( NSMenuItem* pNewItem ) [pNewItem retain]; rFallbackMenu.push_back( pNewItem ); - if( pCurrentMenuBar == NULL ) + if( pCurrentMenuBar == nullptr ) setDefaultMenu(); } @@ -520,7 +520,7 @@ void AquaSalMenu::removeFallbackMenuItem( NSMenuItem* pOldItem ) rFallbackMenu.erase( rFallbackMenu.begin() + i ); [pOldItem release]; - if( pCurrentMenuBar == NULL ) + if( pCurrentMenuBar == nullptr ) setDefaultMenu(); return; @@ -554,9 +554,9 @@ void AquaSalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) AquaSalMenuItem *pAquaSalMenuItem = static_cast<AquaSalMenuItem*>(pSalMenuItem); pAquaSalMenuItem->mpParentMenu = this; - DBG_ASSERT( pAquaSalMenuItem->mpVCLMenu == NULL || + DBG_ASSERT( pAquaSalMenuItem->mpVCLMenu == nullptr || pAquaSalMenuItem->mpVCLMenu == mpVCLMenu || - mpVCLMenu == NULL, + mpVCLMenu == nullptr, "resetting menu ?" ); if( pAquaSalMenuItem->mpVCLMenu ) mpVCLMenu = pAquaSalMenuItem->mpVCLMenu; @@ -577,7 +577,7 @@ void AquaSalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) void AquaSalMenu::RemoveItem( unsigned nPos ) { - AquaSalMenuItem* pRemoveItem = NULL; + AquaSalMenuItem* pRemoveItem = nullptr; if( nPos == MENU_APPEND || nPos == (maItems.size()-1) ) { pRemoveItem = maItems.back(); @@ -594,7 +594,7 @@ void AquaSalMenu::RemoveItem( unsigned nPos ) return; } - pRemoveItem->mpParentMenu = NULL; + pRemoveItem->mpParentMenu = nullptr; if( ! mbMenuBar || pCurrentMenuBar == this ) [mpMenu removeItemAtIndex: getItemIndexByPos(nPos)]; @@ -608,7 +608,7 @@ void AquaSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsi if (subAquaSalMenu) { pAquaSalMenuItem->mpSubMenu = subAquaSalMenu; - if( subAquaSalMenu->mpParentSalMenu == NULL ) + if( subAquaSalMenu->mpParentSalMenu == nullptr ) { subAquaSalMenu->mpParentSalMenu = this; [pAquaSalMenuItem->mpMenuItem setSubmenu: subAquaSalMenu->mpMenu]; @@ -633,9 +633,9 @@ void AquaSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsi if( pAquaSalMenuItem->mpSubMenu ) { if( pAquaSalMenuItem->mpSubMenu->mpParentSalMenu == this ) - pAquaSalMenuItem->mpSubMenu->mpParentSalMenu = NULL; + pAquaSalMenuItem->mpSubMenu->mpParentSalMenu = nullptr; } - pAquaSalMenuItem->mpSubMenu = NULL; + pAquaSalMenuItem->mpSubMenu = nullptr; [pAquaSalMenuItem->mpMenuItem setSubmenu: nil]; } } @@ -800,7 +800,7 @@ AquaSalMenu::MenuBarButtonEntry* AquaSalMenu::findButtonItem( sal_uInt16 i_nItem if( maButtons[i].maButton.mnId == i_nItemId ) return &maButtons[i]; } - return NULL; + return nullptr; } void AquaSalMenu::statusLayout() @@ -903,8 +903,8 @@ Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame AquaSalMenuItem::AquaSalMenuItem( const SalItemParams* pItemData ) : mnId( pItemData->nId ), mpVCLMenu( pItemData->pMenu ), - mpParentMenu( NULL ), - mpSubMenu( NULL ), + mpParentMenu( nullptr ), + mpSubMenu( nullptr ), mpMenuItem( nil ) { // Delete mnemonics diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx index 278aa248d672..16ab4f67aca0 100644 --- a/vcl/osx/salnativewidgets.cxx +++ b/vcl/osx/salnativewidgets.cxx @@ -430,7 +430,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aMenuItemDrawInfo.version = 0; aMenuItemDrawInfo.state = kThemeMenuActive; aMenuItemDrawInfo.itemType = kThemeMenuItemHierBackground; - HIThemeDrawMenuItem(&rc, &rc, &aMenuItemDrawInfo, mrContext, kHIThemeOrientationNormal, NULL); + HIThemeDrawMenuItem(&rc, &rc, &aMenuItemDrawInfo, mrContext, kHIThemeOrientationNormal, nullptr); } #endif bOK = true; @@ -526,7 +526,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, // no animation aPushInfo.animation.time.start = 0; aPushInfo.animation.time.current = 0; - PushButtonValue const * pPBVal = aValue.getType() == CTRL_PUSHBUTTON ? static_cast<PushButtonValue const *>(&aValue) : NULL; + PushButtonValue const * pPBVal = aValue.getType() == CTRL_PUSHBUTTON ? static_cast<PushButtonValue const *>(&aValue) : nullptr; int nPaintHeight = static_cast<int>(rc.size.height); if( pPBVal && pPBVal->mbBevelButton ) @@ -571,7 +571,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, if( nState & ControlState::FOCUSED ) aPushInfo.adornment |= kThemeAdornmentFocus; - HIThemeDrawButton( &rc, &aPushInfo, mrContext, kHIThemeOrientationNormal, NULL ); + HIThemeDrawButton( &rc, &aPushInfo, mrContext, kHIThemeOrientationNormal, nullptr ); bOK = true; } break; @@ -601,7 +601,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, kThemeAdornmentNone; if( nState & ControlState::FOCUSED ) aInfo.adornment |= kThemeAdornmentFocus; - HIThemeDrawButton( &rc, &aInfo, mrContext, kHIThemeOrientationNormal, NULL ); + HIThemeDrawButton( &rc, &aInfo, mrContext, kHIThemeOrientationNormal, nullptr ); bOK = true; } break; @@ -658,7 +658,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, break; } - HIThemeDrawButton( &rc, &aInfo, mrContext, kHIThemeOrientationNormal, NULL ); + HIThemeDrawButton( &rc, &aInfo, mrContext, kHIThemeOrientationNormal, nullptr ); } bOK = true; } @@ -688,7 +688,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aTrackInfo.filler1 = 0; aTrackInfo.trackInfo.progress.phase = static_cast<UInt8>(CFAbsoluteTimeGetCurrent()*10.0); - HIThemeDrawTrack( &aTrackInfo, NULL, mrContext, kHIThemeOrientationNormal ); + HIThemeDrawTrack( &aTrackInfo, nullptr, mrContext, kHIThemeOrientationNormal ); bOK = true; } break; @@ -717,7 +717,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aSlideInfo.pressState = 0; aTrackDraw.trackInfo.slider = aSlideInfo; - HIThemeDrawTrack( &aTrackDraw, NULL, mrContext, kHIThemeOrientationNormal ); + HIThemeDrawTrack( &aTrackDraw, nullptr, mrContext, kHIThemeOrientationNormal ); bOK = true; } } @@ -725,7 +725,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, case CTRL_SCROLLBAR: { - const ScrollbarValue* pScrollbarVal = (aValue.getType() == CTRL_SCROLLBAR) ? static_cast<const ScrollbarValue*>(&aValue) : NULL; + const ScrollbarValue* pScrollbarVal = (aValue.getType() == CTRL_SCROLLBAR) ? static_cast<const ScrollbarValue*>(&aValue) : nullptr; if( nPart == PART_DRAW_BACKGROUND_VERT || nPart == PART_DRAW_BACKGROUND_HORZ ) @@ -772,7 +772,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aTrackDraw.trackInfo.scrollbar = aScrollInfo; - HIThemeDrawTrack( &aTrackDraw, NULL, mrContext, kHIThemeOrientationNormal ); + HIThemeDrawTrack( &aTrackDraw, nullptr, mrContext, kHIThemeOrientationNormal ); bOK = true; } } @@ -945,7 +945,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, if(nState & ControlState::FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal); //buttons: - const SpinbuttonValue* pSpinButtonVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue*>(&aValue) : NULL; + const SpinbuttonValue* pSpinButtonVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue*>(&aValue) : nullptr; ControlState nUpperState = ControlState::ENABLED;//state of the upper button ControlState nLowerState = ControlState::ENABLED;//and of the lower button if(pSpinButtonVal) {//pSpinButtonVal is sometimes null @@ -993,7 +993,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, if( (nUpperState & ControlState::FOCUSED) || (nLowerState & ControlState::FOCUSED)) aSpinInfo.adornment |= kThemeAdornmentFocus; - HIThemeDrawButton( &buttonRc, &aSpinInfo, mrContext, kHIThemeOrientationNormal, NULL ); + HIThemeDrawButton( &buttonRc, &aSpinInfo, mrContext, kHIThemeOrientationNormal, nullptr ); } bOK=true; @@ -1014,7 +1014,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, if( rc.origin.y + rc.size.height >= mpFrame->maGeometry.nHeight-3 ) { CGMutablePathRef rPath = CGPathCreateMutable(); - CGPathAddRect( rPath, NULL, CGRectMake( 0, 0, mpFrame->maGeometry.nWidth-1, mpFrame->maGeometry.nHeight-1 ) ); + CGPathAddRect( rPath, nullptr, CGRectMake( 0, 0, mpFrame->maGeometry.nWidth-1, mpFrame->maGeometry.nHeight-1 ) ); CGContextBeginPath( mrContext ); CGContextAddPath( mrContext, rPath ); diff --git a/vcl/osx/salnsmenu.mm b/vcl/osx/salnsmenu.mm index 23aac611dd7f..6bbc683fc5ec 100644 --- a/vcl/osx/salnsmenu.mm +++ b/vcl/osx/salnsmenu.mm @@ -79,7 +79,7 @@ (void)aSender; SolarMutexGuard aGuard; - const AquaSalFrame* pFrame = mpMenuItem->mpParentMenu ? mpMenuItem->mpParentMenu->getFrame() : NULL; + const AquaSalFrame* pFrame = mpMenuItem->mpParentMenu ? mpMenuItem->mpParentMenu->getFrame() : nullptr; if( pFrame && AquaSalFrame::isAlive( pFrame ) && ! pFrame->GetWindow()->IsInModalMode() ) { SalMenuEvent aMenuEvt( mpMenuItem->mnId, mpMenuItem->mpVCLMenu ); @@ -193,7 +193,7 @@ { static_cast<CGFloat>(rButtons[i].maButton.maImage.GetSizePixel().Width()), static_cast<CGFloat>(rButtons[i].maButton.maImage.GetSizePixel().Height()) } }; if( rButtons[i].mpToolTipString ) - [self addToolTipRect: aImgRect owner: rButtons[i].mpToolTipString userData: NULL]; + [self addToolTipRect: aImgRect owner: rButtons[i].mpToolTipString userData: nullptr]; aSize.width += 2 + aImgRect.size.width; } } diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx index ca09d6c20ec6..a747ae323d6c 100644 --- a/vcl/osx/salobj.cxx +++ b/vcl/osx/salobj.cxx @@ -37,7 +37,7 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWindowDat mnHeight( 20 ) { maSysData.nSize = sizeof( maSysData ); - maSysData.mpNSView = NULL; + maSysData.mpNSView = nullptr; maSysData.mbOpenGL = false; NSRect aInitFrame = { NSZeroPoint, { 20, 20 } }; @@ -50,7 +50,7 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWindowDat if (pWindowData && pWindowData->bOpenGL) { maSysData.mbOpenGL = true; - NSOpenGLPixelFormat* pixFormat = NULL; + NSOpenGLPixelFormat* pixFormat = nullptr; if (pWindowData->bLegacy) { diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx index 9ef6d8ed216b..bd785491fbcc 100644 --- a/vcl/osx/salprn.cxx +++ b/vcl/osx/salprn.cxx @@ -46,7 +46,7 @@ using namespace com::sun::star; using namespace com::sun::star::beans; AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) : - mpGraphics( 0 ), + mpGraphics( nullptr ), mbGraphics( false ), mbJob( false ), mpPrinter( nil ), @@ -143,7 +143,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef i_rContext ) const SalGraphics* AquaSalInfoPrinter::AcquireGraphics() { - SalGraphics* pGraphics = mbGraphics ? NULL : mpGraphics; + SalGraphics* pGraphics = mbGraphics ? nullptr : mpGraphics; mbGraphics = true; return pGraphics; } @@ -666,9 +666,9 @@ void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup* ) const PaperInfo* AquaSalInfoPrinter::matchPaper( long i_nWidth, long i_nHeight, Orientation& o_rOrientation ) const { if( ! m_bPapersInit ) - const_cast<AquaSalInfoPrinter*>(this)->InitPaperFormats( NULL ); + const_cast<AquaSalInfoPrinter*>(this)->InitPaperFormats( nullptr ); - const PaperInfo* pMatch = NULL; + const PaperInfo* pMatch = nullptr; o_rOrientation = ORIENTATION_PORTRAIT; for( int n = 0; n < 2 ; n++ ) { diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm index fd0d58333b57..3f5455a534a2 100644 --- a/vcl/osx/vclnsapp.mm +++ b/vcl/osx/vclnsapp.mm @@ -161,7 +161,7 @@ // the main menu just beeps for an unknown or disabled key equivalent // and swallows the event wholesale NSMenu* pMainMenu = [NSApp mainMenu]; - if( ! bHandled && (pMainMenu == 0 || ! [pMainMenu performKeyEquivalent: pEvent]) ) + if( ! bHandled && (pMainMenu == nullptr || ! [pMainMenu performKeyEquivalent: pEvent]) ) { [[pKeyWin contentView] keyDown: pEvent]; bHandled = GetSalData()->maKeyEventAnswer[ pEvent ]; @@ -247,7 +247,7 @@ ++it; if( it != rFrames.end() ) { - if( (*it)->mpDockMenuEntry != NULL && + if( (*it)->mpDockMenuEntry != nullptr && (*it)->mbShown ) { [(*it)->getNSWindow() makeKeyAndOrderFront: NSApp]; @@ -259,7 +259,7 @@ it = rFrames.begin(); while( *it != pCurFrame ) { - if( (*it)->mpDockMenuEntry != NULL && + if( (*it)->mpDockMenuEntry != nullptr && (*it)->mbShown ) { [(*it)->getNSWindow() makeKeyAndOrderFront: NSApp]; @@ -287,7 +287,7 @@ ++it; if( it != rFrames.rend() ) { - if( (*it)->mpDockMenuEntry != NULL && + if( (*it)->mpDockMenuEntry != nullptr && (*it)->mbShown ) { [(*it)->getNSWindow() makeKeyAndOrderFront: NSApp]; @@ -299,7 +299,7 @@ it = rFrames.rbegin(); while( *it != pCurFrame ) { - if( (*it)->mpDockMenuEntry != NULL && + if( (*it)->mpDockMenuEntry != nullptr && (*it)->mbShown ) { [(*it)->getNSWindow() makeKeyAndOrderFront: NSApp]; @@ -405,7 +405,7 @@ { // the following QueryExit will likely present a message box, activate application [NSApp activateIgnoringOtherApps: YES]; - aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow; + aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, nullptr ) ? NSTerminateCancel : NSTerminateNow; } if( aReply == NSTerminateNow ) @@ -428,7 +428,7 @@ const SalData* pSalData = GetSalData(); if( !pSalData->maFrames.empty() ) - pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, NULL ); + pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, nullptr ); } -(void)screenParametersChanged: (NSNotification*) pNotification diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index e5faad95a9da..8f352b885551 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -47,7 +47,7 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern& rFSD ) : mpFontData( static_cast<CoreTextFontData const *>(rFSD.mpFontData) ) , mfFontStretch( 1.0 ) , mfFontRotation( 0.0 ) - , mpStyleDict( NULL ) + , mpStyleDict( nullptr ) { const FontSelectPattern* const pReqFont = &rFSD; @@ -68,7 +68,7 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern& rFSD ) // create the style object for CoreText font attributes static const CFIndex nMaxDictSize = 16; // TODO: does this really suffice? - mpStyleDict = CFDictionaryCreateMutable( NULL, nMaxDictSize, + mpStyleDict = CFDictionaryCreateMutable( nullptr, nMaxDictSize, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks ); @@ -81,7 +81,7 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern& rFSD ) (mpFontData->GetWeight() != WEIGHT_DONTKNOW)) ) { int nStroke = -lrint((3.5F * pReqFont->GetWeight()) / mpFontData->GetWeight()); - CFNumberRef rStroke = CFNumberCreate(NULL, kCFNumberSInt32Type, &nStroke); + CFNumberRef rStroke = CFNumberCreate(nullptr, kCFNumberSInt32Type, &nStroke); CFDictionarySetValue(mpStyleDict, kCTStrokeWidthAttributeName, rStroke); } @@ -148,7 +148,7 @@ bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.11 kCTFontDefaultOrientation const CTFontOrientation aFontOrientation = kCTFontDefaultOrientation; // TODO: horz/vert SAL_WNODEPRECATED_DECLARATIONS_POP - const CGRect aCGRect = CTFontGetBoundingRectsForGlyphs( aCTFontRef, aFontOrientation, &nCGGlyph, NULL, 1 ); + const CGRect aCGRect = CTFontGetBoundingRectsForGlyphs( aCTFontRef, aFontOrientation, &nCGGlyph, nullptr, 1 ); rRect.Left() = lrint( aCGRect.origin.x ); rRect.Top() = lrint( aCGRect.origin.y ); @@ -215,7 +215,7 @@ bool CoreTextStyle::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolyg CGGlyph nCGGlyph = aGlyphId & GF_IDXMASK; // XXX: this is broken if the glyph came from fallback font CTFontRef pCTFont = static_cast<CTFontRef>(CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName )); - CGPathRef xPath = CTFontCreatePathForGlyph( pCTFont, nCGGlyph, NULL ); + CGPathRef xPath = CTFontCreatePathForGlyph( pCTFont, nCGGlyph, nullptr ); if (!xPath) { return false; @@ -251,7 +251,7 @@ int CoreTextFontData::GetFontTable( const char pTagName[5], unsigned char* pResu // get the raw table length CTFontDescriptorRef pFontDesc = reinterpret_cast<CTFontDescriptorRef>( GetFontId()); - CTFontRef rCTFont = CTFontCreateWithFontDescriptor( pFontDesc, 0.0, NULL); + CTFontRef rCTFont = CTFontCreateWithFontDescriptor( pFontDesc, 0.0, nullptr); const uint32_t opts( kCTFontTableOptionNoOptions ); CFDataRef pDataRef = CTFontCopyTable( rCTFont, nTagCode, opts); CFRelease( rCTFont); @@ -297,7 +297,7 @@ ImplDevFontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool const OUString aUILang = Application::GetSettings().GetUILanguageTag().getLanguage(); CFStringRef pUILang = CFStringCreateWithCharacters( kCFAllocatorDefault, aUILang.getStr(), aUILang.getLength() ); - CFStringRef pLang = NULL; + CFStringRef pLang = nullptr; CFStringRef pFamilyName = static_cast<CFStringRef>( CTFontDescriptorCopyLocalizedAttribute( pFD, kCTFontFamilyNameAttribute, &pLang )); @@ -337,7 +337,7 @@ ImplDevFontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool // get symbolic trait // TODO: use other traits such as MonoSpace/Condensed/Expanded or Vertical too SInt64 nSymbolTrait = 0; - CFNumberRef pSymbolNum = NULL; + CFNumberRef pSymbolNum = nullptr; if( CFDictionaryGetValueIfPresent( pAttrDict, kCTFontSymbolicTrait, reinterpret_cast<const void**>(&pSymbolNum) ) ) { CFNumberGetValue( pSymbolNum, kCFNumberSInt64Type, &nSymbolTrait ); @@ -425,8 +425,8 @@ static void CTFontEnumCallBack( const void* pValue, void* pContext ) } SystemFontList::SystemFontList() - : mpCTFontCollection( NULL ) - , mpCTFontArray( NULL ) + : mpCTFontCollection( nullptr ) + , mpCTFontArray( nullptr ) {} SystemFontList::~SystemFontList() @@ -468,7 +468,7 @@ CoreTextFontData* SystemFontList::GetFontDataFromId( sal_IntPtr nFontId ) const CTFontContainer::const_iterator it = maFontContainer.find( nFontId ); if( it == maFontContainer.end() ) { - return NULL; + return nullptr; } return (*it).second; } @@ -477,7 +477,7 @@ bool SystemFontList::Init() { // enumerate available system fonts static const int nMaxDictEntries = 8; - CFMutableDictionaryRef pCFDict = CFDictionaryCreateMutable( NULL, + CFMutableDictionaryRef pCFDict = CFDictionaryCreateMutable( nullptr, nMaxDictEntries, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks ); @@ -500,7 +500,7 @@ SystemFontList* GetCoretextFontList() if( !pList->Init() ) { delete pList; - return NULL; + return nullptr; } return pList; diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx index 5d03b7a3abd2..61ddecc82a80 100644 --- a/vcl/quartz/ctlayout.cxx +++ b/vcl/quartz/ctlayout.cxx @@ -85,8 +85,8 @@ private: CTLayout::CTLayout( const CoreTextStyle* pTextStyle ) : mpTextStyle( pTextStyle ) - , mpAttrString( NULL ) - , mpCTLine( NULL ) + , mpAttrString( nullptr ) + , mpCTLine( nullptr ) , mnCharCount( 0 ) , mnTrailingSpaceCount( 0 ) , mfTrailingSpaceWidth( 0.0 ) @@ -115,13 +115,13 @@ bool CTLayout::LayoutText( ImplLayoutArgs& rArgs ) // release an eventual older layout if( mpAttrString ) CFRelease( mpAttrString ); - mpAttrString = NULL; + mpAttrString = nullptr; if( mpCTLine ) { SAL_INFO( "vcl.ct", "CFRelease(" << mpCTLine << ")" ); CFRelease( mpCTLine ); } - mpCTLine = NULL; + mpCTLine = nullptr; // initialize the new layout SalLayout::AdjustLayout( rArgs ); @@ -134,12 +134,12 @@ bool CTLayout::LayoutText( ImplLayoutArgs& rArgs ) const sal_Unicode *pStr = rArgs.mrStr.getStr(); // create the CoreText line layout - CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL, + CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( nullptr, pStr + mnMinCharPos, mnCharCount, kCFAllocatorNull ); // CFAttributedStringCreate copies the attribues parameter - mpAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() ); + mpAttrString = CFAttributedStringCreate( nullptr, aCFText, mpTextStyle->GetStyleDict() ); mpCTLine = CTLineCreateWithAttributedString( mpAttrString ); SAL_INFO( "vcl.ct", "CTLineCreateWithAttributedString(\"" << GetOUString(aCFText) << "\") =p " << mpCTLine ); CFRelease( aCFText); @@ -212,11 +212,11 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs ) SAL_INFO( "vcl.ct", "CFRelease(" << mpCTLine << ")" ); CFRelease( mpCTLine ); const sal_Unicode *pStr = rArgs.mrStr.getStr(); - CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL, + CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( nullptr, pStr + mnMinCharPos, mnCharCount - mnTrailingSpaceCount, kCFAllocatorNull ); - CFAttributedStringRef pAttrStr = CFAttributedStringCreate( NULL, + CFAttributedStringRef pAttrStr = CFAttributedStringCreate( nullptr, aCFText, mpTextStyle->GetStyleDict() ); mpCTLine = CTLineCreateWithAttributedString( pAttrStr ); @@ -489,9 +489,9 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, i { nStart = 0; } - const PhysicalFontFace* pFallbackFont = NULL; - CTFontRef pFont = NULL; - CTFontDescriptorRef pFontDesc = NULL; + const PhysicalFontFace* pFallbackFont = nullptr; + CTFontRef pFont = nullptr; + CTFontDescriptorRef pFontDesc = nullptr; ImplDevFontAttributes rDevFontAttr; boost::ptr_vector<CTRunData>::const_iterator iter = m_vRunData.begin(); @@ -510,7 +510,7 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, i { pFont = static_cast<CTFontRef>(CFDictionaryGetValue( mpTextStyle->GetStyleDict(), kCTFontAttributeName )); pFontDesc = CTFontCopyFontDescriptor( iter->m_pFont ); - rDevFontAttr = DevFontFromCTFontDescriptor( pFontDesc, NULL ); + rDevFontAttr = DevFontFromCTFontDescriptor( pFontDesc, nullptr ); } } int i = nStart; @@ -537,7 +537,7 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, i } else { - *(pFallbackFonts++) = NULL; + *(pFallbackFonts++) = nullptr; } } if( i == nStart ) @@ -559,7 +559,7 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, i { pFont = static_cast<CTFontRef>(CFDictionaryGetValue( mpTextStyle->GetStyleDict(), kCTFontAttributeName )); pFontDesc = CTFontCopyFontDescriptor( iter->m_pFont ); - rDevFontAttr = DevFontFromCTFontDescriptor( pFontDesc, NULL ); + rDevFontAttr = DevFontFromCTFontDescriptor( pFontDesc, nullptr ); } } } @@ -576,7 +576,7 @@ DeviceCoordinate CTLayout::GetTextWidth() const if( mfCachedWidth < 0.0 ) { - mfCachedWidth = CTLineGetTypographicBounds( mpCTLine, NULL, NULL, NULL); + mfCachedWidth = CTLineGetTypographicBounds( mpCTLine, nullptr, nullptr, nullptr); } return mfCachedWidth; diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index bbf1a54c9436..9683066eecca 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -93,8 +93,8 @@ static bool isValidBitCount( sal_uInt16 nBitCount ) } QuartzSalBitmap::QuartzSalBitmap() - : mxGraphicContext( NULL ) - , mxCachedImage( NULL ) + : mxGraphicContext( nullptr ) + , mxCachedImage( nullptr ) , mnBits(0) , mnWidth(0) , mnHeight(0) @@ -211,14 +211,14 @@ void QuartzSalBitmap::DestroyContext() { SAL_INFO("vcl.cg", "CGImageRelease(" << mxCachedImage << ")" ); CGImageRelease( mxCachedImage ); - mxCachedImage = NULL; + mxCachedImage = nullptr; } if( mxGraphicContext ) { SAL_INFO("vcl.cg", "CGContextRelease(" << mxGraphicContext << ")" ); CGContextRelease( mxGraphicContext ); - mxGraphicContext = NULL; + mxGraphicContext = nullptr; maContextBuffer.reset(); } } @@ -275,7 +275,7 @@ bool QuartzSalBitmap::CreateContext() } catch( const std::bad_alloc& ) { - mxGraphicContext = 0; + mxGraphicContext = nullptr; } } @@ -290,7 +290,7 @@ bool QuartzSalBitmap::CreateContext() if( !mxGraphicContext ) maContextBuffer.reset(); - return mxGraphicContext != NULL; + return mxGraphicContext != nullptr; } bool QuartzSalBitmap::AllocateUserData() @@ -328,7 +328,7 @@ bool QuartzSalBitmap::AllocateUserData() if (!alloc) { SAL_WARN( "vcl.quartz", "bad alloc " << mnBytesPerRow << "x" << mnHeight); - maUserBuffer.reset( static_cast<sal_uInt8*>(NULL) ); + maUserBuffer.reset( static_cast<sal_uInt8*>(nullptr) ); mnBytesPerRow = 0; } #ifdef DBG_UTIL @@ -341,7 +341,7 @@ bool QuartzSalBitmap::AllocateUserData() } #endif - return maUserBuffer.get() != 0; + return maUserBuffer.get() != nullptr; } namespace { @@ -569,7 +569,7 @@ ImplPixelFormat* ImplPixelFormat::GetFormat( sal_uInt16 nBits, const BitmapPalet return nullptr; } - return 0; + return nullptr; } } // namespace @@ -747,7 +747,7 @@ BitmapBuffer* QuartzSalBitmap::AcquireBuffer( BitmapAccessMode /*nMode*/ ) { // fprintf(stderr,"ASB::Acq(%dx%d,d=%d)\n",mnWidth,mnHeight,mnBits); // TODO: AllocateUserData(); - return NULL; + return nullptr; } BitmapBuffer* pBuffer = new BitmapBuffer; @@ -828,14 +828,14 @@ CGImageRef QuartzSalBitmap::CreateCroppedImage( int nX, int nY, int nNewWidth, i { if( !const_cast<QuartzSalBitmap*>(this)->CreateContext() ) { - return NULL; + return nullptr; } } mxCachedImage = CGBitmapContextCreateImage( mxGraphicContext ); SAL_INFO("vcl.cg", "CGBitmapContextCreateImage(" << mxGraphicContext << ") = " << mxCachedImage ); } - CGImageRef xCroppedImage = NULL; + CGImageRef xCroppedImage = nullptr; // short circuit if there is nothing to crop if( !nX && !nY && (mnWidth == nNewWidth) && (mnHeight == nNewHeight) ) { @@ -864,7 +864,7 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask, { CGImageRef xImage( CreateCroppedImage( nX, nY, nWidth, nHeight ) ); if( !xImage ) - return NULL; + return nullptr; CGImageRef xMask = rMask.CreateCroppedImage( nX, nY, nWidth, nHeight ); if( !xMask ) @@ -888,10 +888,10 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask, CGContextDrawImage( xMaskContext, xImageRect, xMask ); SAL_INFO("vcl.cg", "CFRelease(" << xMask << ")" ); CFRelease( xMask ); - CGDataProviderRef xDataProvider( CGDataProviderCreateWithData( NULL, + CGDataProviderRef xDataProvider( CGDataProviderCreateWithData( nullptr, pMaskMem, nHeight * nMaskBytesPerRow, &CFRTLFree ) ); - static const CGFloat* pDecode = NULL; + static const CGFloat* pDecode = nullptr; xMask = CGImageMaskCreate( nWidth, nHeight, 8, 8, nMaskBytesPerRow, xDataProvider, pDecode, false ); SAL_INFO("vcl.cg", "CGImageMaskCreate(" << nWidth << "," << nHeight << ",8,8) = " << xMask ); CFRelease( xDataProvider ); @@ -919,7 +919,7 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask, CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int nY, int nWidth, int nHeight, SalColor nMaskColor ) const { - CGImageRef xMask = 0; + CGImageRef xMask = nullptr; if( maUserBuffer.get() && (nX + nWidth <= mnWidth) && (nY + nHeight <= mnHeight) ) { const sal_uInt32 nDestBytesPerRow = nWidth << 2; @@ -953,8 +953,8 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int nY, int nWidth, pSource += mnBytesPerRow; } - CGDataProviderRef xDataProvider( CGDataProviderCreateWithData(NULL, pMaskBuffer, nHeight * nDestBytesPerRow, &CFRTLFree) ); - xMask = CGImageCreate(nWidth, nHeight, 8, 32, nDestBytesPerRow, GetSalData()->mxRGBSpace, kCGImageAlphaPremultipliedFirst, xDataProvider, NULL, true, kCGRenderingIntentDefault); + CGDataProviderRef xDataProvider( CGDataProviderCreateWithData(nullptr, pMaskBuffer, nHeight * nDestBytesPerRow, &CFRTLFree) ); + xMask = CGImageCreate(nWidth, nHeight, 8, 32, nDestBytesPerRow, GetSalData()->mxRGBSpace, kCGImageAlphaPremultipliedFirst, xDataProvider, nullptr, true, kCGRenderingIntentDefault); SAL_INFO("vcl.cg", "CGImageCreate(" << nWidth << "x" << nHeight << "x8) = " << xMask ); CFRelease(xDataProvider); } diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index ec7b0e006d09..32bbb4fe61a1 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -77,7 +77,7 @@ CoreTextFontData::~CoreTextFontData() { if( mpCharMap ) { - mpCharMap = 0; + mpCharMap = nullptr; } } @@ -100,7 +100,7 @@ const FontCharMapPtr CoreTextFontData::GetFontCharMap() const // get the CMAP byte size // allocate a buffer for the CMAP raw data - const int nBufSize = GetFontTable( "cmap", NULL ); + const int nBufSize = GetFontTable( "cmap", nullptr ); DBG_ASSERT( (nBufSize > 0), "CoreTextFontData::GetFontCharMap : GetFontTable1 failed!\n"); if( nBufSize <= 0 ) return mpCharMap; @@ -138,7 +138,7 @@ bool CoreTextFontData::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilit int nBufSize = 0; // prepare to get the GSUB table raw data - nBufSize = GetFontTable( "GSUB", NULL ); + nBufSize = GetFontTable( "GSUB", nullptr ); if( nBufSize > 0 ) { // allocate a buffer for the GSUB raw data @@ -151,7 +151,7 @@ bool CoreTextFontData::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilit vcl::getTTScripts(maFontCapabilities.maGSUBScriptTags, pGSUBTable, nRawLength); } } - nBufSize = GetFontTable( "OS/2", NULL ); + nBufSize = GetFontTable( "OS/2", nullptr ); if( nBufSize > 0 ) { // allocate a buffer for the OS/2 raw data @@ -180,7 +180,7 @@ void CoreTextFontData::ReadOs2Table() const mbHasOs2Table = false; // prepare to get the OS/2 table raw data - const int nBufSize = GetFontTable( "OS/2", NULL ); + const int nBufSize = GetFontTable( "OS/2", nullptr ); DBG_ASSERT( (nBufSize > 0), "CoreTextFontData::ReadOs2Table : GetFontTable1 failed!\n"); if( nBufSize <= 0 ) return; @@ -207,7 +207,7 @@ void CoreTextFontData::ReadMacCmapEncoding() const mbCmapEncodingRead = true; - const int nBufSize = GetFontTable( "cmap", NULL ); + const int nBufSize = GetFontTable( "cmap", nullptr ); if( nBufSize <= 0 ) return; @@ -224,26 +224,26 @@ void CoreTextFontData::ReadMacCmapEncoding() const } AquaSalGraphics::AquaSalGraphics() - : mxLayer( NULL ) - , mrContext( NULL ) + : mxLayer( nullptr ) + , mrContext( nullptr ) #ifdef MACOSX - , mpFrame( NULL ) + , mpFrame( nullptr ) #endif #if OSL_DEBUG_LEVEL > 0 , mnContextStackDepth( 0 ) #endif - , mpXorEmulation( NULL ) + , mpXorEmulation( nullptr ) , mnXorMode( 0 ) , mnWidth( 0 ) , mnHeight( 0 ) , mnBitmapDepth( 0 ) , mnRealDPIX( 0 ) , mnRealDPIY( 0 ) - , mxClipPath( NULL ) + , mxClipPath( nullptr ) , maLineColor( COL_WHITE ) , maFillColor( COL_BLACK ) - , mpFontData( NULL ) - , mpTextStyle( NULL ) + , mpFontData( nullptr ) + , mpTextStyle( nullptr ) , maTextColor( COL_BLACK ) , mbNonAntialiasedText( false ) , mbPrinter( false ) @@ -290,13 +290,13 @@ AquaSalGraphics::~AquaSalGraphics() // destroy backbuffer bitmap context that we created ourself SAL_INFO("vcl.cg", "CGContextRelease(" << mrContext << ")" ); CGContextRelease( mrContext ); - mrContext = NULL; + mrContext = nullptr; } } SalGraphicsImpl* AquaSalGraphics::GetImpl() const { - return NULL; + return nullptr; } void AquaSalGraphics::SetTextColor( SalColor nSalColor ) @@ -316,8 +316,8 @@ static bool AddTempDevFont(const OUString& rFontFileURL) OSL_VERIFY( !osl::FileBase::getSystemPathFromFileURL( rFontFileURL, aUSytemPath ) ); OString aCFileName = OUStringToOString( aUSytemPath, RTL_TEXTENCODING_UTF8 ); - CFStringRef rFontPath = CFStringCreateWithCString(NULL, aCFileName.getStr(), kCFStringEncodingUTF8); - CFURLRef rFontURL = CFURLCreateWithFileSystemPath(NULL, rFontPath, kCFURLPOSIXPathStyle, true); + CFStringRef rFontPath = CFStringCreateWithCString(nullptr, aCFileName.getStr(), kCFStringEncodingUTF8); + CFURLRef rFontURL = CFURLCreateWithFileSystemPath(nullptr, rFontPath, kCFURLPOSIXPathStyle, true); CFErrorRef error; bool success = CTFontManagerRegisterFontsForURL(rFontURL, kCTFontManagerScopeProcess, &error); @@ -390,7 +390,7 @@ void AquaSalGraphics::ClearDevFontCache() { SalData* pSalData = GetSalData(); delete pSalData->mpFontList; - pSalData->mpFontList = NULL; + pSalData->mpFontList = nullptr; } bool AquaSalGraphics::AddTempDevFont( PhysicalFontCollection*, @@ -419,12 +419,12 @@ sal_uInt16 AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbac { // release the text style delete mpTextStyle; - mpTextStyle = NULL; + mpTextStyle = nullptr; // handle NULL request meaning: release-font-resources request if( !pReqFont ) { - mpFontData = NULL; + mpFontData = nullptr; return 0; } @@ -508,8 +508,8 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData, const CoreTextFontData* pMacFont = static_cast<const CoreTextFontData*>(pFontData); // short circuit for CFF-only fonts - const int nCffSize = pMacFont->GetFontTable( "CFF ", NULL); - if( pJustCFF != NULL ) + const int nCffSize = pMacFont->GetFontTable( "CFF ", nullptr); + if( pJustCFF != nullptr ) { *pJustCFF = (nCffSize > 0); if( *pJustCFF) @@ -525,27 +525,27 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData, } // get font table availability and size in bytes - const int nHeadSize = pMacFont->GetFontTable( "head", NULL); + const int nHeadSize = pMacFont->GetFontTable( "head", nullptr); if( nHeadSize <= 0) return false; - const int nMaxpSize = pMacFont->GetFontTable( "maxp", NULL); + const int nMaxpSize = pMacFont->GetFontTable( "maxp", nullptr); if( nMaxpSize <= 0) return false; - const int nCmapSize = pMacFont->GetFontTable( "cmap", NULL); + const int nCmapSize = pMacFont->GetFontTable( "cmap", nullptr); if( nCmapSize <= 0) return false; - const int nNameSize = pMacFont->GetFontTable( "name", NULL); + const int nNameSize = pMacFont->GetFontTable( "name", nullptr); if( nNameSize <= 0) return false; - const int nHheaSize = pMacFont->GetFontTable( "hhea", NULL); + const int nHheaSize = pMacFont->GetFontTable( "hhea", nullptr); if( nHheaSize <= 0) return false; - const int nHmtxSize = pMacFont->GetFontTable( "hmtx", NULL); + const int nHmtxSize = pMacFont->GetFontTable( "hmtx", nullptr); if( nHmtxSize <= 0) return false; @@ -554,11 +554,11 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData, int nGlyfSize = 0; if( nCffSize <= 0) { - nLocaSize = pMacFont->GetFontTable( "loca", NULL); + nLocaSize = pMacFont->GetFontTable( "loca", nullptr); if( nLocaSize <= 0) return false; - nGlyfSize = pMacFont->GetFontTable( "glyf", NULL); + nGlyfSize = pMacFont->GetFontTable( "glyf", nullptr); if( nGlyfSize <= 0) return false; } @@ -566,9 +566,9 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData, int nPrepSize = 0, nCvtSize = 0, nFpgmSize = 0; if( nGlyfSize) // TODO: reduce PDF size by making hint subsetting optional { - nPrepSize = pMacFont->GetFontTable( "prep", NULL); - nCvtSize = pMacFont->GetFontTable( "cvt ", NULL); - nFpgmSize = pMacFont->GetFontTable( "fpgm", NULL); + nPrepSize = pMacFont->GetFontTable( "prep", nullptr); + nCvtSize = pMacFont->GetFontTable( "cvt ", nullptr); + nFpgmSize = pMacFont->GetFontTable( "fpgm", nullptr); } // prepare a byte buffer for a fake font @@ -705,7 +705,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV } ByteVector aBuffer; - if( !GetRawFontData( pFontData, aBuffer, NULL ) ) + if( !GetRawFontData( pFontData, aBuffer, nullptr ) ) return; // TODO: modernize psprint's horrible fontsubset C-API @@ -713,7 +713,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV // that can preserve change history after file renames // use the font subsetter to get the widths - TrueTypeFont* pSftFont = NULL; + TrueTypeFont* pSftFont = nullptr; int nRC = ::OpenTTFontBuffer( static_cast<void*>(&aBuffer[0]), aBuffer.size(), 0, &pSftFont); if( nRC != SF_OK ) return; @@ -760,7 +760,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV } } - pMap = 0; + pMap = nullptr; } ::CloseTTFont( pSftFont ); @@ -770,7 +770,7 @@ const Ucs2SIntMap* AquaSalGraphics::GetFontEncodingVector( const PhysicalFontFac const Ucs2OStrMap** /*ppNonEncoded*/, std::set<sal_Unicode> const** ) { - return NULL; + return nullptr; } const void* AquaSalGraphics::GetEmbedFontData( const PhysicalFontFace*, @@ -780,7 +780,7 @@ const void* AquaSalGraphics::GetEmbedFontData( const PhysicalFontFace*, FontSubsetInfo&, long* /*pDataLen*/ ) { - return NULL; + return nullptr; } void AquaSalGraphics::FreeEmbedFontData( const void* pData, long /*nDataLen*/ ) @@ -788,7 +788,7 @@ void AquaSalGraphics::FreeEmbedFontData( const void* pData, long /*nDataLen*/ ) // TODO: implementing this only makes sense when the implementation of // AquaSalGraphics::GetEmbedFontData() returns non-NULL (void)pData; - DBG_ASSERT( (pData!=NULL), "AquaSalGraphics::FreeEmbedFontData() is not implemented\n"); + DBG_ASSERT( (pData!=nullptr), "AquaSalGraphics::FreeEmbedFontData() is not implemented\n"); } bool AquaSalGraphics::IsFlipped() const diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 6135eff3bae7..385c8761715f 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -123,7 +123,7 @@ static void AddPolygonToPath( CGMutablePathRef xPath, { // first point => just move there SAL_INFO( "vcl.cg", "CGPathMoveToPoint(" << xPath << ",NULL," << aPoint.getX() << "," << aPoint.getY() << ")"); - CGPathMoveToPoint( xPath, NULL, aPoint.getX(), aPoint.getY() ); + CGPathMoveToPoint( xPath, nullptr, aPoint.getX(), aPoint.getY() ); continue; } @@ -137,7 +137,7 @@ static void AddPolygonToPath( CGMutablePathRef xPath, if( !bPendingCurve ) // line segment { SAL_INFO( "vcl.cg", "CGPathAddLineToPoint(" << xPath << ",NULL," << aPoint.getX() << "," << aPoint.getY() << ")"); - CGPathAddLineToPoint( xPath, NULL, aPoint.getX(), aPoint.getY() ); + CGPathAddLineToPoint( xPath, nullptr, aPoint.getX(), aPoint.getY() ); } else // cubic bezier segment { @@ -150,7 +150,7 @@ static void AddPolygonToPath( CGMutablePathRef xPath, } SAL_INFO( "vcl.cg", "CGPathAddCurveToPoint(" << xPath << ",NULL," << aCP1.getX() << "," << aCP1.getY() << "," << aCP2.getX() << "," << aCP2.getY() << "," << aPoint.getX() << "," << aPoint.getY() << ")" ); - CGPathAddCurveToPoint( xPath, NULL, aCP1.getX(), aCP1.getY(), + CGPathAddCurveToPoint( xPath, nullptr, aCP1.getX(), aCP1.getY(), aCP2.getX(), aCP2.getY(), aPoint.getX(), aPoint.getY() ); } } @@ -215,7 +215,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, // make the subsetter provide the requested subset FILE* pOutFile = fopen( aToFile.getStr(), "wb" ); - bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL, + bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, nullptr, pGlyphIds, pEncoding, nGlyphCount, pGlyphWidths ); fclose( pOutFile ); return bRC; @@ -226,7 +226,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, // that can preserve change history after file renames // prepare data for psprint's font subsetter - TrueTypeFont* pSftFont = NULL; + TrueTypeFont* pSftFont = nullptr; int nRC = ::OpenTTFontBuffer( static_cast<void*>(&aBuffer[0]), aBuffer.size(), 0, &pSftFont); if( nRC != SF_OK ) { @@ -332,7 +332,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, // write subset into destination file nRC = ::CreateTTFromTTGlyphs( pSftFont, aToFile.getStr(), aShortIDs, - aTempEncs, nGlyphCount, 0, NULL, 0 ); + aTempEncs, nGlyphCount, 0, nullptr, 0 ); ::CloseTTFont(pSftFont); return (nRC == SF_OK); } @@ -551,7 +551,7 @@ void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY, // TODO: if( mnBitmapDepth > 0 ) { const CGSize aSrcSize = CGSizeMake(nSrcWidth, nSrcHeight); - xSrcLayer = CGLayerCreateWithContext( xCopyContext, aSrcSize, NULL ); + xSrcLayer = CGLayerCreateWithContext( xCopyContext, aSrcSize, nullptr ); SAL_INFO( "vcl.cg", "CGLayerCreateWithContext(" << xCopyContext << "," << aSrcSize << ",NULL) = " << xSrcLayer ); const CGContextRef xSrcContext = CGLayerGetContext( xSrcLayer ); @@ -679,7 +679,7 @@ bool AquaSalGraphics::drawTransformedBitmap( } // get the Quartz image - CGImageRef xImage = NULL; + CGImageRef xImage = nullptr; const Size aSize = rSrcBitmap.GetSize(); const QuartzSalBitmap& rSrcSalBmp = static_cast<const QuartzSalBitmap&>(rSrcBitmap); const QuartzSalBitmap* pMaskSalBmp = static_cast<const QuartzSalBitmap*>(pAlphaBmp); @@ -1469,7 +1469,7 @@ SalBitmap* AquaSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY if( !pBitmap->Create( mxLayer, mnBitmapDepth, nX, nY, nDX, nDY) ) { delete pBitmap; - pBitmap = NULL; + pBitmap = nullptr; } return pBitmap; } @@ -1788,9 +1788,9 @@ void AquaSalGraphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalIn void AquaSalGraphics::Pattern50Fill() { static const CGFloat aFillCol[4] = { 1,1,1,1 }; - static const CGPatternCallbacks aCallback = { 0, &DrawPattern50, NULL }; + static const CGPatternCallbacks aCallback = { 0, &DrawPattern50, nullptr }; static const CGColorSpaceRef mxP50Space = CGColorSpaceCreatePattern( GetSalData()->mxRGBSpace ); - static const CGPatternRef mxP50Pattern = CGPatternCreate( NULL, CGRectMake( 0, 0, 4, 4 ), + static const CGPatternRef mxP50Pattern = CGPatternCreate( nullptr, CGRectMake( 0, 0, 4, 4 ), CGAffineTransformIdentity, 4, 4, kCGPatternTilingConstantSpacing, false, &aCallback ); @@ -1810,7 +1810,7 @@ void AquaSalGraphics::ResetClipRegion() { SAL_INFO( "vcl.cg", "CGPathRelease(" << mxClipPath << ")" ); CGPathRelease( mxClipPath ); - mxClipPath = NULL; + mxClipPath = nullptr; } if( CheckContext() ) { @@ -1916,7 +1916,7 @@ bool AquaSalGraphics::setClipRegion( const vcl::Region& i_rClip ) { SAL_INFO( "vcl.cg", "CGPathRelease(" << mxClipPath << ")" ); CGPathRelease( mxClipPath ); - mxClipPath = NULL; + mxClipPath = nullptr; } mxClipPath = CGPathCreateMutable(); SAL_INFO( "vcl.cg", "CGPathCreateMutable() = " << mxClipPath ); @@ -1946,7 +1946,7 @@ bool AquaSalGraphics::setClipRegion( const vcl::Region& i_rClip ) { const CGRect aRect = CGRectMake( aRectIter->Left(), aRectIter->Top(), nW, nH); SAL_INFO( "vcl.cg", "CGPathAddRect(" << mxClipPath << ",NULL," << aRect << ")" ); - CGPathAddRect( mxClipPath, NULL, aRect ); + CGPathAddRect( mxClipPath, nullptr, aRect ); } } } @@ -1995,11 +1995,11 @@ void AquaSalGraphics::SetXORMode( bool bSet, bool bInvertOnly ) return; } - if( (mpXorEmulation == NULL) && !bSet ) + if( (mpXorEmulation == nullptr) && !bSet ) { return; } - if( (mpXorEmulation != NULL) && (bSet == mpXorEmulation->IsEnabled()) ) + if( (mpXorEmulation != nullptr) && (bSet == mpXorEmulation->IsEnabled()) ) { return; } @@ -2042,12 +2042,12 @@ void AquaSalGraphics::updateResolution() #endif XorEmulation::XorEmulation() - : m_xTargetLayer( NULL ) - , m_xTargetContext( NULL ) - , m_xMaskContext( NULL ) - , m_xTempContext( NULL ) - , m_pMaskBuffer( NULL ) - , m_pTempBuffer( NULL ) + : m_xTargetLayer( nullptr ) + , m_xTargetContext( nullptr ) + , m_xMaskContext( nullptr ) + , m_xTempContext( nullptr ) + , m_pMaskBuffer( nullptr ) + , m_pTempBuffer( nullptr ) , m_nBufferLongs( 0 ) , m_bIsEnabled( false ) { @@ -2058,7 +2058,7 @@ XorEmulation::~XorEmulation() { SAL_INFO( "vcl.quartz", "XorEmulation::~XorEmulation() this=" << this ); Disable(); - SetTarget( 0, 0, 0, NULL, NULL ); + SetTarget( 0, 0, 0, nullptr, nullptr ); } void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth, @@ -2075,8 +2075,8 @@ void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth, SAL_INFO( "vcl.cg", "CGContextRelease(" << m_xMaskContext << ")" ); CGContextRelease( m_xMaskContext ); delete[] m_pMaskBuffer; - m_xMaskContext = NULL; - m_pMaskBuffer = NULL; + m_xMaskContext = nullptr; + m_pMaskBuffer = nullptr; // cleanup the temp context if needed if( m_xTempContext ) @@ -2084,8 +2084,8 @@ void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth, SAL_INFO( "vcl.cg", "CGContextRelease(" << m_xTempContext << ")" ); CGContextRelease( m_xTempContext ); delete[] m_pTempBuffer; - m_xTempContext = NULL; - m_pTempBuffer = NULL; + m_xTempContext = nullptr; + m_pTempBuffer = nullptr; } } @@ -2180,7 +2180,7 @@ bool XorEmulation::UpdateTarget() // update the temp bitmap buffer if needed if( m_xTempContext ) { - SAL_WARN_IF( m_xTargetContext == NULL, "vcl.quartz", "Target layer is NULL"); + SAL_WARN_IF( m_xTargetContext == nullptr, "vcl.quartz", "Target layer is NULL"); SAL_INFO( "vcl.cg", "CGContextDrawLayerAtPoint(" << m_xTempContext << "," << CGPointZero << "," << m_xTargetLayer << ")" ); CGContextDrawLayerAtPoint( m_xTempContext, CGPointZero, m_xTargetLayer ); } diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx index f1426203be7a..75458d2cc004 100644 --- a/vcl/quartz/salgdiutils.cxx +++ b/vcl/quartz/salgdiutils.cxx @@ -55,7 +55,7 @@ void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, lon if( mxClipPath ) { CGPathRelease( mxClipPath ); - mxClipPath = NULL; + mxClipPath = nullptr; } if( mrContext ) @@ -70,7 +70,7 @@ void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, lon void AquaSalGraphics::InvalidateContext() { UnsetState(); - mrContext = 0; + mrContext = nullptr; } void AquaSalGraphics::UnsetState() @@ -79,13 +79,13 @@ void AquaSalGraphics::UnsetState() { SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << mrContext << ")" ); CGContextRestoreGState( mrContext ); - mrContext = 0; + mrContext = nullptr; } if( mxClipPath ) { SAL_INFO( "vcl.cg", "CGPathRelease(" << mxClipPath << ")" ); CGPathRelease( mxClipPath ); - mxClipPath = NULL; + mxClipPath = nullptr; } } @@ -100,8 +100,8 @@ bool AquaSalGraphics::CheckContext() const unsigned int nWidth = mpFrame->maGeometry.nWidth; const unsigned int nHeight = mpFrame->maGeometry.nHeight; - CGContextRef rReleaseContext = 0; - CGLayerRef rReleaseLayer = NULL; + CGContextRef rReleaseContext = nullptr; + CGLayerRef rReleaseLayer = nullptr; // check if a new drawing context is needed (e.g. after a resize) if( (unsigned(mnWidth) != nWidth) || (unsigned(mnHeight) != nHeight) ) @@ -111,8 +111,8 @@ bool AquaSalGraphics::CheckContext() // prepare to release the corresponding resources rReleaseContext = mrContext; rReleaseLayer = mxLayer; - mrContext = NULL; - mxLayer = NULL; + mrContext = nullptr; + mxLayer = nullptr; } if( !mrContext ) @@ -120,7 +120,7 @@ bool AquaSalGraphics::CheckContext() const CGSize aLayerSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) }; NSGraphicsContext* pNSGContext = [NSGraphicsContext graphicsContextWithWindow: mpFrame->getNSWindow()]; CGContextRef xCGContext = static_cast<CGContextRef>([pNSGContext graphicsPort]); - mxLayer = CGLayerCreateWithContext( xCGContext, aLayerSize, NULL ); + mxLayer = CGLayerCreateWithContext( xCGContext, aLayerSize, nullptr ); SAL_INFO( "vcl.cg", "CGLayerCreateWithContext(" << xCGContext << "," << aLayerSize << ",NULL) = " << mxLayer ); if( mxLayer ) { @@ -166,7 +166,7 @@ bool AquaSalGraphics::CheckContext() } DBG_ASSERT( mrContext || mbPrinter, "<<<WARNING>>> AquaSalGraphics::CheckContext() FAILED!!!!\n" ); - return (mrContext != NULL); + return (mrContext != nullptr); } CGContextRef AquaSalGraphics::GetContext() @@ -191,7 +191,7 @@ void AquaSalGraphics::UpdateWindow( NSRect& ) } NSGraphicsContext* pContext = [NSGraphicsContext currentContext]; - if( (mxLayer != NULL) && (pContext != NULL) ) + if( (mxLayer != nullptr) && (pContext != nullptr) ) { CGContextRef rCGContext = static_cast<CGContextRef>([pContext graphicsPort]); SAL_INFO( "vcl.cg", "[[NSGraphicsContext currentContext] graphicsPort] = " << rCGContext ); diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx index 5427eb096940..485ac2018757 100644 --- a/vcl/quartz/salvd.cxx +++ b/vcl/quartz/salvd.cxx @@ -65,13 +65,13 @@ SalVirtualDevice* AquaSalInstance::CreateVirtualDevice( SalGraphics* pGraphics, AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX, long &nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData ) : mbGraphicsUsed( false ) - , mxBitmapContext( NULL ) + , mxBitmapContext( nullptr ) , mnBitmapDepth( 0 ) - , mxLayer( NULL ) + , mxLayer( nullptr ) { SAL_INFO( "vcl.virdev", "AquaSalVirtualDevice::AquaSalVirtualDevice() this=" << this << " size=(" << nDX << "x" << nDY << ") bitcount=" << nBitCount << - " pData=" << pData << " context=" << (pData ? pData->rCGContext : 0) ); + " pData=" << pData << " context=" << (pData ? pData->rCGContext : nullptr) ); if( pGraphic && pData && pData->rCGContext ) { @@ -88,7 +88,7 @@ AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX { nDY = 1; } - mxLayer = CGLayerCreateWithContext( pData->rCGContext, CGSizeMake( nDX, nDY), NULL ); + mxLayer = CGLayerCreateWithContext( pData->rCGContext, CGSizeMake( nDX, nDY), nullptr ); // Interrogate the context as to its real size if (mxLayer) { @@ -137,9 +137,9 @@ AquaSalVirtualDevice::~AquaSalVirtualDevice() if( mpGraphics ) { - mpGraphics->SetVirDevGraphics( NULL, NULL ); + mpGraphics->SetVirDevGraphics( nullptr, nullptr ); delete mpGraphics; - mpGraphics = 0; + mpGraphics = nullptr; } Destroy(); } @@ -151,7 +151,7 @@ void AquaSalVirtualDevice::Destroy() if( mbForeignContext ) { // Do not delete mxContext that we have received from outside VCL - mxLayer = NULL; + mxLayer = nullptr; return; } @@ -159,11 +159,11 @@ void AquaSalVirtualDevice::Destroy() { if( mpGraphics ) { - mpGraphics->SetVirDevGraphics( NULL, NULL ); + mpGraphics->SetVirDevGraphics( nullptr, nullptr ); } SAL_INFO( "vcl.cg", "CGLayerRelease(" << mxLayer << ")" ); CGLayerRelease( mxLayer ); - mxLayer = NULL; + mxLayer = nullptr; } if( mxBitmapContext ) @@ -172,7 +172,7 @@ void AquaSalVirtualDevice::Destroy() rtl_freeMemory( pRawData ); SAL_INFO( "vcl.cg", "CGContextRelease(" << mxBitmapContext << ")" ); CGContextRelease( mxBitmapContext ); - mxBitmapContext = NULL; + mxBitmapContext = nullptr; } } @@ -180,7 +180,7 @@ SalGraphics* AquaSalVirtualDevice::AcquireGraphics() { if( mbGraphicsUsed || !mpGraphics ) { - return 0; + return nullptr; } mbGraphicsUsed = true; return mpGraphics; @@ -216,7 +216,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY ) Destroy(); // create a Quartz layer matching to the intended virdev usage - CGContextRef xCGContext = NULL; + CGContextRef xCGContext = nullptr; if( mnBitmapDepth && (mnBitmapDepth < 16) ) { mnBitmapDepth = 8; // TODO: are 1bit vdevs worth it? @@ -251,7 +251,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY ) { // ensure we don't reuse a dead AquaSalFrame on the very // unlikely case of no other frame to use - pSalFrame = NULL; + pSalFrame = nullptr; } // update the frame reference mpGraphics->setGraphicsFrame( pSalFrame ); @@ -308,7 +308,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY ) SAL_WARN_IF( !xCGContext, "vcl.quartz", "No context" ); const CGSize aNewSize = { static_cast<CGFloat>(nDX), static_cast<CGFloat>(nDY) }; - mxLayer = CGLayerCreateWithContext( xCGContext, aNewSize, NULL ); + mxLayer = CGLayerCreateWithContext( xCGContext, aNewSize, nullptr ); SAL_INFO( "vcl.cg", "CGLayerCreateWithContext(" << xCGContext << "," << aNewSize << ",NULL) = " << mxLayer ); if( mxLayer && mpGraphics ) @@ -319,7 +319,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY ) mpGraphics->SetVirDevGraphics( mxLayer, xDrawContext, mnBitmapDepth ); } - return (mxLayer != NULL); + return (mxLayer != nullptr); } long AquaSalVirtualDevice::GetWidth() const diff --git a/vcl/quartz/utils.cxx b/vcl/quartz/utils.cxx index 86832ff88be9..7194ad3963ef 100644 --- a/vcl/quartz/utils.cxx +++ b/vcl/quartz/utils.cxx @@ -29,7 +29,7 @@ OUString GetOUString( CFStringRef rStr ) { - if( rStr == 0 ) + if( rStr == nullptr ) { return OUString(); } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 49acb2e0c10c..f12a855d48b4 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -319,7 +319,7 @@ void Menu::ImplSelectWithStart( Menu* pSMenu ) { Menu* pOldStartedFrom = pStartedFrom; pStartedFrom = pSMenu; - Menu* pOldStartedStarted = pOldStartedFrom ? pOldStartedFrom->pStartedFrom : NULL; + Menu* pOldStartedStarted = pOldStartedFrom ? pOldStartedFrom->pStartedFrom : nullptr; Select(); if( pOldStartedFrom ) pOldStartedFrom->pStartedFrom = pOldStartedStarted; |