diff options
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 96 | ||||
-rw-r--r-- | libreofficekit/qa/tilebench/tilebench.cxx | 6 | ||||
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 160 | ||||
-rw-r--r-- | libreofficekit/source/gtk/tilebuffer.cxx | 12 | ||||
-rw-r--r-- | libreofficekit/source/gtk/tilebuffer.hxx | 10 |
5 files changed, 142 insertions, 142 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index 903dc9b1e48a..cface1bd48a5 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -119,31 +119,31 @@ public: std::shared_ptr<TiledCornerButton> m_pCornerButton; TiledWindow() - : m_pDocView(0), - m_pStatusBar(0), - m_pProgressBar(0), - m_pStatusbarLabel(0), - m_pZoomLabel(0), - m_pEnableEditing(0), - m_pBold(0), - m_pItalic(0), - m_pUnderline(0), - m_pStrikethrough(0), - m_pSuperscript(0), - m_pSubscript(0), - m_pLeftpara(0), - m_pCenterpara(0), - m_pRightpara(0), - m_pJustifypara(0), - m_pScrolledWindow(0), + : m_pDocView(nullptr), + m_pStatusBar(nullptr), + m_pProgressBar(nullptr), + m_pStatusbarLabel(nullptr), + m_pZoomLabel(nullptr), + m_pEnableEditing(nullptr), + m_pBold(nullptr), + m_pItalic(nullptr), + m_pUnderline(nullptr), + m_pStrikethrough(nullptr), + m_pSuperscript(nullptr), + m_pSubscript(nullptr), + m_pLeftpara(nullptr), + m_pCenterpara(nullptr), + m_pRightpara(nullptr), + m_pJustifypara(nullptr), + m_pScrolledWindow(nullptr), m_bToolItemBroadcast(true), - m_pVBox(0), - m_pPartSelector(0), - m_pPartModeComboBox(0), + m_pVBox(nullptr), + m_pPartSelector(nullptr), + m_pPartModeComboBox(nullptr), m_bPartSelectorBroadcast(true), - m_pFindbar(0), - m_pFindbarEntry(0), - m_pFindbarLabel(0), + m_pFindbar(nullptr), + m_pFindbarEntry(nullptr), + m_pFindbarLabel(nullptr), m_bFindAll(false) { } @@ -240,7 +240,7 @@ gboolean TiledRowColumnBar::drawImpl(GtkWidget* /*pWidget*/, cairo_t* pCairo) void TiledRowColumnBar::docAdjustmentChanged(GtkAdjustment* /*pAdjustment*/, gpointer pData) { GtkWidget* pDocView = static_cast<GtkWidget*>(pData); - docConfigureEvent(pDocView, 0, 0); + docConfigureEvent(pDocView, nullptr, nullptr); } gboolean TiledRowColumnBar::docConfigureEvent(GtkWidget* pDocView, GdkEventConfigure* /*pEvent*/, gpointer /*pData*/) @@ -470,11 +470,11 @@ static void createView(GtkWidget* pButton, gpointer /*pItem*/) /// Creates a new model, i.e. LOK init and document load, one view implicitly. static void createModelAndView(const char* pLOPath, const char* pDocPath) { - GtkWidget* pDocView = lok_doc_view_new(pLOPath, 0, 0); + GtkWidget* pDocView = lok_doc_view_new(pLOPath, nullptr, nullptr); setupWidgetAndCreateWindow(pDocView); - lok_doc_view_open_document(LOK_DOC_VIEW(pDocView), pDocPath, 0, openDocumentCallback, pDocView); + lok_doc_view_open_document(LOK_DOC_VIEW(pDocView), pDocPath, nullptr, openDocumentCallback, pDocView); } /// Our GtkClipboardGetFunc implementation for HTML. @@ -494,7 +494,7 @@ static void htmlClearFunc(GtkClipboard* /*pClipboard*/, gpointer pData) /// Same as gtk_clipboard_set_text(), but sets HTML. static void clipboardSetHtml(GtkClipboard* pClipboard, const char* pSelection) { - GtkTargetList* pList = gtk_target_list_new(0, 0); + GtkTargetList* pList = gtk_target_list_new(nullptr, 0); GdkAtom aAtom(gdk_atom_intern("text/html", false)); gtk_target_list_add(pList, aAtom, 0, 0); gint nTargets = 0; @@ -512,7 +512,7 @@ static void doCopy(GtkWidget* pButton, gpointer /*pItem*/) TiledWindow& rWindow = lcl_getTiledWindow(pButton); LOKDocView* pLOKDocView = LOK_DOC_VIEW(rWindow.m_pDocView); LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(pLOKDocView); - char* pUsedFormat = 0; + char* pUsedFormat = nullptr; char* pSelection = pDocument->pClass->getTextSelection(pDocument, "text/html", &pUsedFormat); GtkClipboard* pClipboard = gtk_clipboard_get_for_display(gtk_widget_get_display(rWindow.m_pDocView), GDK_SELECTION_CLIPBOARD); @@ -709,9 +709,9 @@ static void signalPart(LOKDocView* pLOKDocView, int nPart, gpointer /*pData*/) /// User clicked on a command button -> inform LOKDocView. static void signalHyperlink(LOKDocView* /*pLOKDocView*/, char* pPayload, gpointer /*pData*/) { - GError* pError = NULL; - gtk_show_uri(NULL, pPayload, GDK_CURRENT_TIME, &pError); - if (pError != NULL) + GError* pError = nullptr; + gtk_show_uri(nullptr, pPayload, GDK_CURRENT_TIME, &pError); + if (pError != nullptr) { g_warning("Unable to show URI %s : %s", pPayload, pError->message); g_error_free(pError); @@ -782,7 +782,7 @@ static void toggleToolItem(GtkWidget* pWidget, gpointer /*pData*/) // notify about the finished Save gboolean bNotify = (rString == ".uno:Save"); - lok_doc_view_post_command(pLOKDocView, rString.c_str(), 0, bNotify); + lok_doc_view_post_command(pLOKDocView, rString.c_str(), nullptr, bNotify); } } @@ -864,8 +864,8 @@ static void openDocumentCallback (GObject* source_object, GAsyncResult* res, gpo { LOKDocView* pDocView = LOK_DOC_VIEW (source_object); TiledWindow& rWindow = lcl_getTiledWindow(GTK_WIDGET(pDocView)); - GError* error = NULL; - GList *focusChain = NULL; + GError* error = nullptr; + GList *focusChain = nullptr; if (!lok_doc_view_open_document_finish(pDocView, res, &error)) { @@ -914,7 +914,7 @@ static GtkWidget* createWindow(TiledWindow& rWindow) gtk_toolbar_set_style(GTK_TOOLBAR(pUpperToolbar), GTK_TOOLBAR_ICONS); // Save. - GtkToolItem* pSave = gtk_tool_button_new(NULL, NULL); + GtkToolItem* pSave = gtk_tool_button_new(nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(pSave), "document-save-symbolic"); gtk_tool_item_set_tooltip_text(pSave, "Save"); gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pSave, -1); @@ -923,12 +923,12 @@ static GtkWidget* createWindow(TiledWindow& rWindow) lcl_registerToolItem(rWindow, pSave, ".uno:Save"); // Copy and paste. - GtkToolItem* pCopyButton = gtk_tool_button_new( NULL, NULL); + GtkToolItem* pCopyButton = gtk_tool_button_new( nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(pCopyButton), "edit-copy-symbolic"); gtk_tool_item_set_tooltip_text(pCopyButton, "Copy"); gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pCopyButton, -1); g_signal_connect(G_OBJECT(pCopyButton), "clicked", G_CALLBACK(doCopy), NULL); - GtkToolItem* pPasteButton = gtk_tool_button_new( NULL, NULL); + GtkToolItem* pPasteButton = gtk_tool_button_new( nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(pPasteButton), "edit-paste-symbolic"); gtk_tool_item_set_tooltip_text(pPasteButton, "Paste"); gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pPasteButton, -1); @@ -936,13 +936,13 @@ static GtkWidget* createWindow(TiledWindow& rWindow) gtk_toolbar_insert( GTK_TOOLBAR(pUpperToolbar), gtk_separator_tool_item_new(), -1); // Undo and redo. - GtkToolItem* pUndo = gtk_tool_button_new(NULL, NULL); + GtkToolItem* pUndo = gtk_tool_button_new(nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(pUndo), "edit-undo-symbolic"); gtk_tool_item_set_tooltip_text(pUndo, "Undo"); gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pUndo, -1); g_signal_connect(G_OBJECT(pUndo), "clicked", G_CALLBACK(toggleToolItem), NULL); lcl_registerToolItem(rWindow, pUndo, ".uno:Undo"); - GtkToolItem* pRedo = gtk_tool_button_new(NULL, NULL); + GtkToolItem* pRedo = gtk_tool_button_new(nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(pRedo), "edit-redo-symbolic"); gtk_tool_item_set_tooltip_text(pRedo, "Redo"); gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pRedo, -1); @@ -951,7 +951,7 @@ static GtkWidget* createWindow(TiledWindow& rWindow) gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), gtk_separator_tool_item_new(), -1); // Find. - GtkToolItem* pFindButton = gtk_tool_button_new( NULL, NULL); + GtkToolItem* pFindButton = gtk_tool_button_new( nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (pFindButton), "edit-find-symbolic"); gtk_tool_item_set_tooltip_text(pFindButton, "Find"); gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pFindButton, -1); @@ -959,19 +959,19 @@ static GtkWidget* createWindow(TiledWindow& rWindow) gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), gtk_separator_tool_item_new(), -1); // Misc upper toolbar. - GtkToolItem* pZoomIn = gtk_tool_button_new(NULL, NULL); + GtkToolItem* pZoomIn = gtk_tool_button_new(nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (pZoomIn), "zoom-in-symbolic"); gtk_tool_item_set_tooltip_text(pZoomIn, "Zoom In"); gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pZoomIn, -1); g_signal_connect(G_OBJECT(pZoomIn), "clicked", G_CALLBACK(changeZoom), NULL); - GtkToolItem* pZoom1 = gtk_tool_button_new(NULL, NULL); + GtkToolItem* pZoom1 = gtk_tool_button_new(nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(pZoom1), "zoom-original-symbolic"); gtk_tool_item_set_tooltip_text(pZoom1, "Normal Size"); gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pZoom1, -1); g_signal_connect(G_OBJECT(pZoom1), "clicked", G_CALLBACK(changeZoom), NULL); - GtkToolItem* pZoomOut = gtk_tool_button_new(NULL, NULL); + GtkToolItem* pZoomOut = gtk_tool_button_new(nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (pZoomOut), "zoom-out-symbolic"); gtk_tool_item_set_tooltip_text(pZoomOut, "Zoom Out"); gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pZoomOut, -1); @@ -996,7 +996,7 @@ static GtkWidget* createWindow(TiledWindow& rWindow) gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pEnableEditing, -1); g_signal_connect(G_OBJECT(pEnableEditing), "toggled", G_CALLBACK(toggleEditing), NULL); - GtkToolItem* pNewViewButton = gtk_tool_button_new( NULL, NULL); + GtkToolItem* pNewViewButton = gtk_tool_button_new( nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (pNewViewButton), "view-continuous-symbolic"); gtk_tool_item_set_tooltip_text(pNewViewButton, "New View"); gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pNewViewButton, -1); @@ -1080,7 +1080,7 @@ static GtkWidget* createWindow(TiledWindow& rWindow) rWindow.m_pFindbar = gtk_toolbar_new(); gtk_toolbar_set_style(GTK_TOOLBAR(rWindow.m_pFindbar), GTK_TOOLBAR_ICONS); - GtkToolItem* pFindbarClose = gtk_tool_button_new( NULL, NULL); + GtkToolItem* pFindbarClose = gtk_tool_button_new( nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (pFindbarClose), "window-close-symbolic"); gtk_toolbar_insert(GTK_TOOLBAR(rWindow.m_pFindbar), pFindbarClose, -1); g_signal_connect(G_OBJECT(pFindbarClose), "clicked", G_CALLBACK(toggleFindbar), NULL); @@ -1091,12 +1091,12 @@ static GtkWidget* createWindow(TiledWindow& rWindow) g_signal_connect(rWindow.m_pFindbarEntry, "key-press-event", G_CALLBACK(signalFindbar), 0); gtk_toolbar_insert(GTK_TOOLBAR(rWindow.m_pFindbar), pEntryContainer, -1); - GtkToolItem* pFindbarNext = gtk_tool_button_new( NULL, NULL); + GtkToolItem* pFindbarNext = gtk_tool_button_new( nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (pFindbarNext), "go-down-symbolic"); gtk_toolbar_insert(GTK_TOOLBAR(rWindow.m_pFindbar), pFindbarNext, -1); g_signal_connect(G_OBJECT(pFindbarNext), "clicked", G_CALLBACK(signalSearchNext), NULL); - GtkToolItem* pFindbarPrev = gtk_tool_button_new( NULL, NULL); + GtkToolItem* pFindbarPrev = gtk_tool_button_new( nullptr, nullptr); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (pFindbarPrev), "go-up-symbolic"); gtk_toolbar_insert(GTK_TOOLBAR(rWindow.m_pFindbar), pFindbarPrev, -1); g_signal_connect(G_OBJECT(pFindbarPrev), "clicked", G_CALLBACK(signalSearchPrev), NULL); @@ -1127,7 +1127,7 @@ static GtkWidget* createWindow(TiledWindow& rWindow) gtk_grid_attach(GTK_GRID(pGrid), rWindow.m_pColumnBar->m_pDrawingArea, 1, 0, 1, 1); // Scrolled window for DocView - rWindow.m_pScrolledWindow = gtk_scrolled_window_new(0, 0); + rWindow.m_pScrolledWindow = gtk_scrolled_window_new(nullptr, nullptr); gtk_widget_set_hexpand(rWindow.m_pScrolledWindow, TRUE); gtk_widget_set_vexpand(rWindow.m_pScrolledWindow, TRUE); // "B2" cell of the grid diff --git a/libreofficekit/qa/tilebench/tilebench.cxx b/libreofficekit/qa/tilebench/tilebench.cxx index e72c730a6dfe..20777de49fe1 100644 --- a/libreofficekit/qa/tilebench/tilebench.cxx +++ b/libreofficekit/qa/tilebench/tilebench.cxx @@ -42,7 +42,7 @@ int main( int argc, char* argv[] ) const char *mpName; double mfTime; - TimeRecord() : mpName(NULL), mfTime(getTimeNow()) { } + TimeRecord() : mpName(nullptr), mfTime(getTimeNow()) { } explicit TimeRecord(const char *pName) : mpName(pName ), mfTime(getTimeNow()) { } }; @@ -62,7 +62,7 @@ int main( int argc, char* argv[] ) Office *pOffice = lok_cpp_init(argv[1]); aTimes.push_back(TimeRecord()); - if (argv[2] != NULL) + if (argv[2] != nullptr) { aTimes.push_back(TimeRecord("load document")); Document *pDocument(pOffice->documentLoad(argv[2])); @@ -157,7 +157,7 @@ int main( int argc, char* argv[] ) { double nDelta = aTimes[i+1].mfTime - aTimes[i].mfTime; fprintf (stderr, " %s - %2.4f(ms)\n", aTimes[i].mpName, nDelta * 1000.0); - if (aTimes[i+1].mpName == NULL) + if (aTimes[i+1].mpName == nullptr) i++; // skip it. nTotal += nDelta; } diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index b68405f250f7..cff78895ab84 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -119,15 +119,15 @@ struct LOKDocViewPrivateImpl int m_nViewId; LOKDocViewPrivateImpl() - : m_aLOPath(0), - m_aDocPath(0), + : m_aLOPath(nullptr), + m_aDocPath(nullptr), m_nLoadProgress(0), m_bIsLoading(false), m_bCanZoomIn(false), m_bCanZoomOut(false), - m_pOffice(0), - m_pDocument(0), - lokThreadPool(0), + m_pOffice(nullptr), + m_pDocument(nullptr), + lokThreadPool(nullptr), m_fZoom(0), m_nDocumentWidthTwips(0), m_nDocumentHeightTwips(0), @@ -144,16 +144,16 @@ struct LOKDocViewPrivateImpl m_aGraphicSelection({0, 0, 0, 0}), m_aCellCursor({0, 0, 0, 0}), m_bInDragGraphicSelection(false), - m_pHandleStart(0), + m_pHandleStart(nullptr), m_aHandleStartRect({0, 0, 0, 0}), m_bInDragStartHandle(0), - m_pHandleMiddle(0), + m_pHandleMiddle(nullptr), m_aHandleMiddleRect({0, 0, 0, 0}), m_bInDragMiddleHandle(false), - m_pHandleEnd(0), + m_pHandleEnd(nullptr), m_aHandleEndRect({0, 0, 0, 0}), m_bInDragEndHandle(false), - m_pGraphicHandle(0), + m_pGraphicHandle(nullptr), m_nViewId(0) { memset(&m_aGraphicHandleRects, 0, sizeof(m_aGraphicHandleRects)); @@ -299,7 +299,7 @@ callbackTypeToString (int nType) case LOK_CALLBACK_SEARCH_RESULT_SELECTION: return "LOK_CALLBACK_SEARCH_RESULT_SELECTION"; } - return 0; + return nullptr; } static bool @@ -330,7 +330,7 @@ signalKey (GtkWidget* pWidget, GdkEventKey* pEvent) LOKDocViewPrivate& priv = getPrivate(pDocView); int nCharCode = 0; int nKeyCode = 0; - GError* error = NULL; + GError* error = nullptr; if (!priv->m_bEdit) { @@ -419,14 +419,14 @@ signalKey (GtkWidget* pWidget, GdkEventKey* pEvent) if (pEvent->type == GDK_KEY_RELEASE) { - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_POST_KEY); pLOEvent->m_nKeyEvent = LOK_KEYEVENT_KEYUP; pLOEvent->m_nCharCode = nCharCode; pLOEvent->m_nKeyCode = nKeyCode; g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_POST_KEY: %s", error->message); g_clear_error(&error); @@ -435,14 +435,14 @@ signalKey (GtkWidget* pWidget, GdkEventKey* pEvent) } else { - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_POST_KEY); pLOEvent->m_nKeyEvent = LOK_KEYEVENT_KEYINPUT; pLOEvent->m_nCharCode = nCharCode; pLOEvent->m_nKeyCode = nKeyCode; g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_POST_KEY: %s", error->message); g_clear_error(&error); @@ -664,7 +664,7 @@ setTilesInvalid (LOKDocView* pDocView, const GdkRectangle& rRectangle) { for (int j = aStart.y; j < aEnd.y; j++) { - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); priv->m_pTileBuffer->setInvalid(i, j, priv->m_fZoom, task, priv->lokThreadPool); g_object_unref(task); } @@ -927,7 +927,7 @@ paintTileFinish(LOKDocView* pDocView, GAsyncResult* res, GError **error) g_return_val_if_fail(LOK_IS_DOC_VIEW(pDocView), NULL); g_return_val_if_fail(g_task_is_valid(res, pDocView), NULL); - g_return_val_if_fail(error == NULL || *error == NULL, NULL); + g_return_val_if_fail(error == nullptr || *error == nullptr, NULL); return g_task_propagate_pointer(task, error); } @@ -943,9 +943,9 @@ paintTileCallback(GObject* sourceObject, GAsyncResult* res, gpointer userData) int index = pLOEvent->m_nPaintTileX * buffer->m_nWidth + pLOEvent->m_nPaintTileY; GError* error; - error = NULL; + error = nullptr; GdkPixbuf* pPixBuf = static_cast<GdkPixbuf*>(paintTileFinish(pDocView, res, &error)); - if (error != NULL) + if (error != nullptr) { if (error->domain == LOK_TILEBUFFER_ERROR && error->code == LOK_TILEBUFFER_CHANGED) @@ -1008,7 +1008,7 @@ renderDocument(LOKDocView* pDocView, cairo_t* pCairo) aTileRectangleTwips.width = pixelToTwip(aTileRectanglePixels.width, priv->m_fZoom); aTileRectangleTwips.height = pixelToTwip(aTileRectanglePixels.height, priv->m_fZoom); - if (!gdk_rectangle_intersect(&aVisibleArea, &aTileRectangleTwips, 0)) + if (!gdk_rectangle_intersect(&aVisibleArea, &aTileRectangleTwips, nullptr)) bPaint = false; if (bPaint) @@ -1018,7 +1018,7 @@ renderDocument(LOKDocView* pDocView, cairo_t* pCairo) pLOEvent->m_nPaintTileY = nColumn; pLOEvent->m_fPaintTileZoom = priv->m_fZoom; pLOEvent->m_pTileBuffer = &*priv->m_pTileBuffer; - GTask* task = g_task_new(pDocView, NULL, paintTileCallback, pLOEvent); + GTask* task = g_task_new(pDocView, nullptr, paintTileCallback, pLOEvent); g_task_set_task_data(task, pLOEvent, LOEvent::destroy); Tile& currentTile = priv->m_pTileBuffer->getTile(nRow, nColumn, task, priv->lokThreadPool); @@ -1145,7 +1145,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) { LOKDocView* pDocView = LOK_DOC_VIEW (pWidget); LOKDocViewPrivate& priv = getPrivate(pDocView); - GError* error = NULL; + GError* error = nullptr; g_info("LOKDocView_Impl::signalButton: %d, %d (in twips: %d, %d)", (int)pEvent->x, (int)pEvent->y, @@ -1181,7 +1181,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) g_info("LOKDocView_Impl::signalButton: end of drag graphic handle #%d", i); priv->m_bInDragGraphicHandles[i] = false; - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_SET_GRAPHIC_SELECTION); pLOEvent->m_nSetGraphicSelectionType = LOK_SETGRAPHICSELECTION_END; pLOEvent->m_nSetGraphicSelectionX = pixelToTwip(pEvent->x, priv->m_fZoom); @@ -1189,7 +1189,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_SET_GRAPHIC_SELECTION: %s", error->message); g_clear_error(&error); @@ -1205,7 +1205,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) g_info("LOKDocView_Impl::signalButton: end of drag graphic selection"); priv->m_bInDragGraphicSelection = false; - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_SET_GRAPHIC_SELECTION); pLOEvent->m_nSetGraphicSelectionType = LOK_SETGRAPHICSELECTION_END; pLOEvent->m_nSetGraphicSelectionX = pixelToTwip(pEvent->x, priv->m_fZoom); @@ -1213,7 +1213,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_SET_GRAPHIC_SELECTION: %s", error->message); g_clear_error(&error); @@ -1233,19 +1233,19 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) aClick.height = 1; if (pEvent->type == GDK_BUTTON_PRESS) { - if (gdk_rectangle_intersect(&aClick, &priv->m_aHandleStartRect, NULL)) + if (gdk_rectangle_intersect(&aClick, &priv->m_aHandleStartRect, nullptr)) { g_info("LOKDocView_Impl::signalButton: start of drag start handle"); priv->m_bInDragStartHandle = true; return FALSE; } - else if (gdk_rectangle_intersect(&aClick, &priv->m_aHandleMiddleRect, NULL)) + else if (gdk_rectangle_intersect(&aClick, &priv->m_aHandleMiddleRect, nullptr)) { g_info("LOKDocView_Impl::signalButton: start of drag middle handle"); priv->m_bInDragMiddleHandle = true; return FALSE; } - else if (gdk_rectangle_intersect(&aClick, &priv->m_aHandleEndRect, NULL)) + else if (gdk_rectangle_intersect(&aClick, &priv->m_aHandleEndRect, nullptr)) { g_info("LOKDocView_Impl::signalButton: start of drag end handle"); priv->m_bInDragEndHandle = true; @@ -1254,12 +1254,12 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) for (int i = 0; i < GRAPHIC_HANDLE_COUNT; ++i) { - if (gdk_rectangle_intersect(&aClick, &priv->m_aGraphicHandleRects[i], NULL)) + if (gdk_rectangle_intersect(&aClick, &priv->m_aGraphicHandleRects[i], nullptr)) { g_info("LOKDocView_Impl::signalButton: start of drag graphic handle #%d", i); priv->m_bInDragGraphicHandles[i] = true; - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_SET_GRAPHIC_SELECTION); pLOEvent->m_nSetGraphicSelectionType = LOK_SETGRAPHICSELECTION_START; pLOEvent->m_nSetGraphicSelectionX = pixelToTwip(priv->m_aGraphicHandleRects[i].x + priv->m_aGraphicHandleRects[i].width / 2, priv->m_fZoom); @@ -1267,7 +1267,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_SET_GRAPHIC_SELECTION: %s", error->message); g_clear_error(&error); @@ -1291,7 +1291,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) if ((pEvent->time - priv->m_nLastButtonPressTime) < 250) nCount++; priv->m_nLastButtonPressTime = pEvent->time; - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_POST_MOUSE_EVENT); pLOEvent->m_nPostMouseEventType = LOK_MOUSEEVENT_MOUSEBUTTONDOWN; pLOEvent->m_nPostMouseEventX = pixelToTwip(pEvent->x, priv->m_fZoom); @@ -1314,7 +1314,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_POST_MOUSE_EVENT: %s", error->message); g_clear_error(&error); @@ -1328,7 +1328,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) if ((pEvent->time - priv->m_nLastButtonReleaseTime) < 250) nCount++; priv->m_nLastButtonReleaseTime = pEvent->time; - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_POST_MOUSE_EVENT); pLOEvent->m_nPostMouseEventType = LOK_MOUSEEVENT_MOUSEBUTTONUP; pLOEvent->m_nPostMouseEventX = pixelToTwip(pEvent->x, priv->m_fZoom); @@ -1351,7 +1351,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent) g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_POST_MOUSE_EVENT: %s", error->message); g_clear_error(&error); @@ -1389,7 +1389,7 @@ lok_doc_view_signal_motion (GtkWidget* pWidget, GdkEventMotion* pEvent) LOKDocView* pDocView = LOK_DOC_VIEW (pWidget); LOKDocViewPrivate& priv = getPrivate(pDocView); GdkPoint aPoint; - GError* error = NULL; + GError* error = nullptr; priv->m_pDocument->pClass->setView(priv->m_pDocument, priv->m_nViewId); if (priv->m_bInDragMiddleHandle) @@ -1432,12 +1432,12 @@ lok_doc_view_signal_motion (GtkWidget* pWidget, GdkEventMotion* pEvent) aMotionInTwipsInTwips.y = pixelToTwip(pEvent->y, priv->m_fZoom); aMotionInTwipsInTwips.width = 1; aMotionInTwipsInTwips.height = 1; - if (gdk_rectangle_intersect(&aMotionInTwipsInTwips, &priv->m_aGraphicSelection, 0)) + if (gdk_rectangle_intersect(&aMotionInTwipsInTwips, &priv->m_aGraphicSelection, nullptr)) { g_info("lcl_signalMotion: start of drag graphic selection"); priv->m_bInDragGraphicSelection = true; - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_SET_GRAPHIC_SELECTION); pLOEvent->m_nSetGraphicSelectionType = LOK_SETGRAPHICSELECTION_START; pLOEvent->m_nSetGraphicSelectionX = pixelToTwip(pEvent->x, priv->m_fZoom); @@ -1445,7 +1445,7 @@ lok_doc_view_signal_motion (GtkWidget* pWidget, GdkEventMotion* pEvent) g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_SET_GRAPHIC_SELECTION: %s", error->message); g_clear_error(&error); @@ -1457,7 +1457,7 @@ lok_doc_view_signal_motion (GtkWidget* pWidget, GdkEventMotion* pEvent) // Otherwise a mouse move, as on the desktop. - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_POST_MOUSE_EVENT); pLOEvent->m_nPostMouseEventType = LOK_MOUSEEVENT_MOUSEMOVE; pLOEvent->m_nPostMouseEventX = pixelToTwip(pEvent->x, priv->m_fZoom); @@ -1469,7 +1469,7 @@ lok_doc_view_signal_motion (GtkWidget* pWidget, GdkEventMotion* pEvent) g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_MOUSEEVENT_MOUSEMOVE: %s", error->message); g_clear_error(&error); @@ -1522,7 +1522,7 @@ openDocumentInThread (gpointer data) if ( priv->m_pDocument ) { priv->m_pDocument->pClass->destroy( priv->m_pDocument ); - priv->m_pDocument = 0; + priv->m_pDocument = nullptr; } priv->m_pOffice->pClass->registerCallback(priv->m_pOffice, globalCallbackWorker, pDocView); @@ -1728,10 +1728,10 @@ static void lok_doc_view_init (LOKDocView* pDocView) |GDK_KEY_RELEASE_MASK); priv->lokThreadPool = g_thread_pool_new(lokThreadFunc, - NULL, + nullptr, 1, FALSE, - NULL); + nullptr); } static void lok_doc_view_set_property (GObject* object, guint propId, const GValue *value, GParamSpec *pspec) @@ -1838,7 +1838,7 @@ static void lok_doc_view_finalize (GObject* object) if (priv->m_pOffice) priv->m_pOffice->pClass->destroy (priv->m_pOffice); delete priv.m_pImpl; - priv.m_pImpl = 0; + priv.m_pImpl = nullptr; G_OBJECT_CLASS (lok_doc_view_parent_class)->finalize (object); } @@ -1848,12 +1848,12 @@ static gboolean lok_doc_view_initable_init (GInitable *initable, GCancellable* / LOKDocView *pDocView = LOK_DOC_VIEW (initable); LOKDocViewPrivate& priv = getPrivate(pDocView); - if (priv->m_pOffice != NULL) + if (priv->m_pOffice != nullptr) return TRUE; priv->m_pOffice = lok_init (priv->m_aLOPath); - if (priv->m_pOffice == NULL) + if (priv->m_pOffice == nullptr) { g_set_error (error, g_quark_from_static_string ("LOK initialization error"), 0, @@ -1896,7 +1896,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) g_param_spec_string("lopath", "LO Path", "LibreOffice Install Path", - 0, + nullptr, static_cast<GParamFlags>(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS))); @@ -1926,7 +1926,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) g_param_spec_string("docpath", "Document Path", "The URI of the document to open", - 0, + nullptr, static_cast<GParamFlags>(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); @@ -2072,7 +2072,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_FROM_CLASS (pGObjectClass), G_SIGNAL_RUN_FIRST, 0, - NULL, NULL, + nullptr, nullptr, g_cclosure_marshal_VOID__DOUBLE, G_TYPE_NONE, 1, G_TYPE_DOUBLE); @@ -2087,7 +2087,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_FROM_CLASS (pGObjectClass), G_SIGNAL_RUN_FIRST, 0, - NULL, NULL, + nullptr, nullptr, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); @@ -2102,7 +2102,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_FROM_CLASS(pGObjectClass), G_SIGNAL_RUN_FIRST, 0, - NULL, NULL, + nullptr, nullptr, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); @@ -2117,7 +2117,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_FROM_CLASS(pGObjectClass), G_SIGNAL_RUN_FIRST, 0, - NULL, NULL, + nullptr, nullptr, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); @@ -2132,7 +2132,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_FROM_CLASS(pGObjectClass), G_SIGNAL_RUN_FIRST, 0, - NULL, NULL, + nullptr, nullptr, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); @@ -2147,7 +2147,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_FROM_CLASS(pGObjectClass), G_SIGNAL_RUN_FIRST, 0, - NULL, NULL, + nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 1, G_TYPE_INT); @@ -2162,7 +2162,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_FROM_CLASS(pGObjectClass), G_SIGNAL_RUN_FIRST, 0, - NULL, NULL, + nullptr, nullptr, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); @@ -2180,7 +2180,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_FROM_CLASS(pGObjectClass), G_SIGNAL_RUN_FIRST, 0, - NULL, NULL, + nullptr, nullptr, g_cclosure_marshal_generic, G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_INT, @@ -2196,7 +2196,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_FROM_CLASS(pGObjectClass), G_SIGNAL_RUN_FIRST, 0, - NULL, NULL, + nullptr, nullptr, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); @@ -2212,7 +2212,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_FROM_CLASS(pGObjectClass), G_SIGNAL_RUN_FIRST, 0, - NULL, NULL, + nullptr, nullptr, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); @@ -2228,7 +2228,7 @@ lok_doc_view_new (const gchar* pPath, GCancellable *cancellable, GError **error) SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new_from_widget(LOKDocView* pOldLOKDocView) { LOKDocViewPrivate& pOldPriv = getPrivate(pOldLOKDocView); - GtkWidget* pNewDocView = GTK_WIDGET(g_initable_new(LOK_TYPE_DOC_VIEW, /*cancellable=*/0, /*error=*/0, + GtkWidget* pNewDocView = GTK_WIDGET(g_initable_new(LOK_TYPE_DOC_VIEW, /*cancellable=*/nullptr, /*error=*/nullptr, "lopath", pOldPriv->m_aLOPath, "lopointer", pOldPriv->m_pOffice, "docpointer", pOldPriv->m_pDocument, NULL)); // No documentLoad(), just a createView(). @@ -2248,7 +2248,7 @@ lok_doc_view_open_document_finish (LOKDocView* pDocView, GAsyncResult* res, GErr g_return_val_if_fail(g_task_is_valid(res, pDocView), false); //FIXME: make source_tag work //g_return_val_if_fail(g_task_get_source_tag(task) == lok_doc_view_open_document, NULL); - g_return_val_if_fail(error == NULL || *error == NULL, false); + g_return_val_if_fail(error == nullptr || *error == nullptr, false); return g_task_propagate_boolean(task, error); } @@ -2262,7 +2262,7 @@ lok_doc_view_open_document (LOKDocView* pDocView, { GTask* task = g_task_new(pDocView, cancellable, callback, userdata); LOKDocViewPrivate& priv = getPrivate(pDocView); - GError* error = NULL; + GError* error = nullptr; LOEvent* pLOEvent = new LOEvent(LOK_LOAD_DOC); pLOEvent->m_pPath = pPath; @@ -2271,7 +2271,7 @@ lok_doc_view_open_document (LOKDocView* pDocView, g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_LOAD_DOC: %s", error->message); g_clear_error(&error); @@ -2331,15 +2331,15 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_part (LOKDocView* pDocView, int nPart) { LOKDocViewPrivate& priv = getPrivate(pDocView); - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_SET_PART); - GError* error = NULL; + GError* error = nullptr; pLOEvent->m_nPart = nPart; g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_SET_PART: %s", error->message); g_clear_error(&error); @@ -2360,14 +2360,14 @@ lok_doc_view_set_partmode(LOKDocView* pDocView, int nPartMode) { LOKDocViewPrivate& priv = getPrivate(pDocView); - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_SET_PARTMODE); - GError* error = NULL; + GError* error = nullptr; pLOEvent->m_nPartMode = nPartMode; g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_SET_PARTMODE: %s", error->message); g_clear_error(&error); @@ -2397,22 +2397,22 @@ lok_doc_view_reset_view(LOKDocView* pDocView) memset(&priv->m_aCellCursor, 0, sizeof(priv->m_aCellCursor)); cairo_surface_destroy(priv->m_pHandleStart); - priv->m_pHandleStart = 0; + priv->m_pHandleStart = nullptr; memset(&priv->m_aHandleStartRect, 0, sizeof(priv->m_aHandleStartRect)); priv->m_bInDragStartHandle = false; cairo_surface_destroy(priv->m_pHandleMiddle); - priv->m_pHandleMiddle = 0; + priv->m_pHandleMiddle = nullptr; memset(&priv->m_aHandleMiddleRect, 0, sizeof(priv->m_aHandleMiddleRect)); priv->m_bInDragMiddleHandle = false; cairo_surface_destroy(priv->m_pHandleEnd); - priv->m_pHandleEnd = 0; + priv->m_pHandleEnd = nullptr; memset(&priv->m_aHandleEndRect, 0, sizeof(priv->m_aHandleEndRect)); priv->m_bInDragEndHandle = false; cairo_surface_destroy(priv->m_pGraphicHandle); - priv->m_pGraphicHandle = 0; + priv->m_pGraphicHandle = nullptr; memset(&priv->m_aGraphicHandleRects, 0, sizeof(priv->m_aGraphicHandleRects)); memset(&priv->m_bInDragGraphicHandles, 0, sizeof(priv->m_bInDragGraphicHandles)); @@ -2426,14 +2426,14 @@ lok_doc_view_set_edit(LOKDocView* pDocView, gboolean bEdit) { LOKDocViewPrivate& priv = getPrivate(pDocView); - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_SET_EDIT); - GError* error = NULL; + GError* error = nullptr; pLOEvent->m_bEdit = bEdit; g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_SET_EDIT: %s", error->message); g_clear_error(&error); @@ -2456,16 +2456,16 @@ lok_doc_view_post_command (LOKDocView* pDocView, gboolean bNotifyWhenFinished) { LOKDocViewPrivate& priv = getPrivate(pDocView); - GTask* task = g_task_new(pDocView, NULL, NULL, NULL); + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); LOEvent* pLOEvent = new LOEvent(LOK_POST_COMMAND); - GError* error = NULL; + GError* error = nullptr; pLOEvent->m_pCommand = pCommand; pLOEvent->m_pArguments = g_strdup(pArguments); pLOEvent->m_bNotifyWhenFinished = bNotifyWhenFinished; g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_POST_COMMAND: %s", error->message); g_clear_error(&error); diff --git a/libreofficekit/source/gtk/tilebuffer.cxx b/libreofficekit/source/gtk/tilebuffer.cxx index 330b44675c9c..675384c4582e 100644 --- a/libreofficekit/source/gtk/tilebuffer.cxx +++ b/libreofficekit/source/gtk/tilebuffer.cxx @@ -38,7 +38,7 @@ void Tile::setPixbuf(GdkPixbuf *buffer) if (m_pBuffer == buffer) return; g_clear_object(&m_pBuffer); - if (buffer != NULL) + if (buffer != nullptr) g_object_ref(buffer); m_pBuffer = buffer; } @@ -60,7 +60,7 @@ void TileBuffer::setInvalid(int x, int y, float fZoom, GTask* task, GThreadPool* lokThreadPool) { int index = x * m_nWidth + y; - GError* error = NULL; + GError* error = nullptr; if (m_mTiles.find(index) != m_mTiles.end()) { m_mTiles[index].valid = false; @@ -71,7 +71,7 @@ void TileBuffer::setInvalid(int x, int y, float fZoom, GTask* task, pLOEvent->m_fPaintTileZoom = fZoom; g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_thread_pool_push(lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_PAINT_TILE: %s", error->message); g_clear_error(&error); @@ -83,12 +83,12 @@ Tile& TileBuffer::getTile(int x, int y, GTask* task, GThreadPool* lokThreadPool) { int index = x * m_nWidth + y; - GError* error = NULL; + GError* error = nullptr; if (m_mTiles.find(index) != m_mTiles.end() && !m_mTiles[index].valid) { g_thread_pool_push(lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_PAINT_TILE: %s", error->message); g_clear_error(&error); @@ -98,7 +98,7 @@ Tile& TileBuffer::getTile(int x, int y, GTask* task, else if(m_mTiles.find(index) == m_mTiles.end()) { g_thread_pool_push(lokThreadPool, g_object_ref(task), &error); - if (error != NULL) + if (error != nullptr) { g_warning("Unable to call LOK_PAINT_TILE: %s", error->message); g_clear_error(&error); diff --git a/libreofficekit/source/gtk/tilebuffer.hxx b/libreofficekit/source/gtk/tilebuffer.hxx index 7127e0b1b498..7d7160e0450e 100644 --- a/libreofficekit/source/gtk/tilebuffer.hxx +++ b/libreofficekit/source/gtk/tilebuffer.hxx @@ -58,7 +58,7 @@ GQuark LOKTileBufferErrorQuark(void); class Tile { public: - Tile() : valid(false), m_pBuffer(0) {} + Tile() : valid(false), m_pBuffer(nullptr) {} ~Tile() { g_clear_object(&m_pBuffer); @@ -90,7 +90,7 @@ private: class TileBuffer { public: - TileBuffer(LibreOfficeKitDocument *document = 0, + TileBuffer(LibreOfficeKitDocument *document = nullptr, int columns = 0) : m_pLOKDocument(document) , m_nWidth(columns) @@ -234,10 +234,10 @@ struct LOEvent /// Constructor to instantiate an object of type `type`. LOEvent(int type) : m_nType(type) - , m_pCommand(0) - , m_pArguments(0) + , m_pCommand(nullptr) + , m_pArguments(nullptr) , m_bNotifyWhenFinished(false) - , m_pPath(0) + , m_pPath(nullptr) , m_bEdit(false) , m_nPartMode(0) , m_nPart(0) |