diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-02-08 20:32:09 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-02-08 20:32:09 +0000 |
| commit | d659a2076f730e5bbfc5b191d6502d0fb90c320d (patch) | |
| tree | 12cfb814c53796af0850e6b70239ccb851ea5a4d /src/ui | |
| parent | Patch from lp 819209 to fix python extensions on OSX Lion (diff) | |
| download | inkscape-d659a2076f730e5bbfc5b191d6502d0fb90c320d.tar.gz inkscape-d659a2076f730e5bbfc5b191d6502d0fb90c320d.zip | |
(cppcheck and janitorial tasks:) C-style casting to C++-style casting
(bzr r10952)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/filedialogimpl-win32.cpp | 36 | ||||
| -rw-r--r-- | src/ui/widget/color-picker.cpp | 23 |
2 files changed, 25 insertions, 34 deletions
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp index 01a5c0e75..ad7486f44 100644 --- a/src/ui/dialog/filedialogimpl-win32.cpp +++ b/src/ui/dialog/filedialogimpl-win32.cpp @@ -487,8 +487,8 @@ void FileOpenDialogImplWin32::register_preview_wnd_class() UINT_PTR CALLBACK FileOpenDialogImplWin32::GetOpenFileName_hookproc( HWND hdlg, UINT uiMsg, WPARAM, LPARAM lParam) { - FileOpenDialogImplWin32 *pImpl = (FileOpenDialogImplWin32*) - GetWindowLongPtr(hdlg, GWLP_USERDATA); + FileOpenDialogImplWin32 *pImpl = reinterpret_cast<FileOpenDialogImplWin32*> + (GetWindowLongPtr(hdlg, GWLP_USERDATA)); switch(uiMsg) { @@ -498,10 +498,10 @@ UINT_PTR CALLBACK FileOpenDialogImplWin32::GetOpenFileName_hookproc( HINSTANCE hInstance = GetModuleHandle(NULL); // Set the pointer to the object - OPENFILENAMEW *ofn = (OPENFILENAMEW*)lParam; + OPENFILENAMEW *ofn = reinterpret_cast<OPENFILENAMEW*>(lParam); SetWindowLongPtr(hdlg, GWLP_USERDATA, ofn->lCustData); SetWindowLongPtr(hParentWnd, GWLP_USERDATA, ofn->lCustData); - pImpl = (FileOpenDialogImplWin32*)ofn->lCustData; + pImpl = reinterpret_cast<FileOpenDialogImplWin32*>(ofn->lCustData); // Make the window a bit wider RECT rcRect; @@ -614,8 +614,8 @@ UINT_PTR CALLBACK FileOpenDialogImplWin32::GetOpenFileName_hookproc( LRESULT CALLBACK FileOpenDialogImplWin32::file_dialog_subclass_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - FileOpenDialogImplWin32 *pImpl = (FileOpenDialogImplWin32*) - GetWindowLongPtr(hwnd, GWLP_USERDATA); + FileOpenDialogImplWin32 *pImpl = reinterpret_cast<FileOpenDialogImplWin32*> + (GetWindowLongPtr(hwnd, GWLP_USERDATA)); LRESULT lResult = CallWindowProc(pImpl->_base_window_proc, hwnd, uMsg, wParam, lParam); @@ -648,8 +648,8 @@ LRESULT CALLBACK FileOpenDialogImplWin32::preview_wnd_proc(HWND hwnd, UINT uMsg, const int CaptionPadding = 4; const int IconSize = 32; - FileOpenDialogImplWin32 *pImpl = (FileOpenDialogImplWin32*) - GetWindowLongPtr(hwnd, GWLP_USERDATA); + FileOpenDialogImplWin32 *pImpl = reinterpret_cast<FileOpenDialogImplWin32*> + (GetWindowLongPtr(hwnd, GWLP_USERDATA)); LRESULT lResult = 0; @@ -671,9 +671,9 @@ LRESULT CALLBACK FileOpenDialogImplWin32::preview_wnd_proc(HWND hwnd, UINT uMsg, PAINTSTRUCT paint_struct; HDC dc = BeginPaint(hwnd, &paint_struct); - HFONT hCaptionFont = (HFONT)SendMessage(GetParent(hwnd), - WM_GETFONT, 0, 0); - HFONT hOldFont = (HFONT)SelectObject(dc, hCaptionFont); + HFONT hCaptionFont = reinterpret_cast<HFONT>(SendMessage(GetParent(hwnd), + WM_GETFONT, 0, 0)); + HFONT hOldFont = static_cast<HFONT>(SelectObject(dc, hCaptionFont)); SetBkMode(dc, TRANSPARENT); pImpl->_mutex->lock(); @@ -682,7 +682,7 @@ LRESULT CALLBACK FileOpenDialogImplWin32::preview_wnd_proc(HWND hwnd, UINT uMsg, { WCHAR* noFileText=(WCHAR*)g_utf8_to_utf16(_("No file selected"), -1, NULL, NULL, NULL); - FillRect(dc, &rcClient, (HBRUSH)(COLOR_3DFACE + 1)); + FillRect(dc, &rcClient, reinterpret_cast<HBRUSH>(COLOR_3DFACE + 1)); DrawTextW(dc, noFileText, -1, &rcClient, DT_CENTER | DT_VCENTER | DT_NOPREFIX); g_free(noFileText); @@ -729,7 +729,7 @@ LRESULT CALLBACK FileOpenDialogImplWin32::preview_wnd_proc(HWND hwnd, UINT uMsg, } else if(pImpl->_preview_file_icon != NULL) { - FillRect(dc, &rcClient, (HBRUSH)(COLOR_3DFACE + 1)); + FillRect(dc, &rcClient, reinterpret_cast<HBRUSH>(COLOR_3DFACE + 1)); // Draw the files icon const int destX = (rcClient.right - IconSize) / 2; @@ -755,7 +755,7 @@ LRESULT CALLBACK FileOpenDialogImplWin32::preview_wnd_proc(HWND hwnd, UINT uMsg, else { // Can't show anything! - FillRect(dc, &rcClient, (HBRUSH)(COLOR_3DFACE + 1)); + FillRect(dc, &rcClient, reinterpret_cast<HBRUSH>(COLOR_3DFACE + 1)); } pImpl->_mutex->unlock(); @@ -1768,8 +1768,8 @@ void FileSaveDialogImplWin32::setSelectionType( Inkscape::Extension::Extension * UINT_PTR CALLBACK FileSaveDialogImplWin32::GetSaveFileName_hookproc( HWND hdlg, UINT uiMsg, WPARAM, LPARAM lParam) { - FileSaveDialogImplWin32 *pImpl = (FileSaveDialogImplWin32*) - GetWindowLongPtr(hdlg, GWLP_USERDATA); + FileSaveDialogImplWin32 *pImpl = reinterpret_cast<FileSaveDialogImplWin32*> + (GetWindowLongPtr(hdlg, GWLP_USERDATA)); switch(uiMsg) { @@ -1803,10 +1803,10 @@ UINT_PTR CALLBACK FileSaveDialogImplWin32::GetSaveFileName_hookproc( HGDIOBJ dlgFont = GetStockObject(DEFAULT_GUI_FONT); // Set the pointer to the object - OPENFILENAMEW *ofn = (OPENFILENAMEW*)lParam; + OPENFILENAMEW *ofn = reinterpret_cast<OPENFILENAMEW*>(lParam); SetWindowLongPtr(hdlg, GWLP_USERDATA, ofn->lCustData); SetWindowLongPtr(hParentWnd, GWLP_USERDATA, ofn->lCustData); - pImpl = (FileSaveDialogImplWin32*)ofn->lCustData; + pImpl = reinterpret_cast<FileSaveDialogImplWin32*>(ofn->lCustData); // Create the Title label and edit control pImpl->_title_label = CreateWindowEx(NULL, "STATIC", "Title:", diff --git a/src/ui/widget/color-picker.cpp b/src/ui/widget/color-picker.cpp index 429aba6e8..2bcb5a157 100644 --- a/src/ui/widget/color-picker.cpp +++ b/src/ui/widget/color-picker.cpp @@ -45,8 +45,7 @@ ColorPicker::~ColorPicker() _colorSelector = NULL; } -void -ColorPicker::setupDialog(const Glib::ustring &title) +void ColorPicker::setupDialog(const Glib::ustring &title) { GtkWidget *dlg = GTK_WIDGET(_colorSelectorDialog.gobj()); sp_transientize(dlg); @@ -69,11 +68,7 @@ ColorPicker::setupDialog(const Glib::ustring &title) } - - - -void -ColorPicker::setRgba32 (guint32 rgba) +void ColorPicker::setRgba32 (guint32 rgba) { if (_in_use) return; @@ -87,14 +82,12 @@ ColorPicker::setRgba32 (guint32 rgba) } } -void -ColorPicker::closeWindow() +void ColorPicker::closeWindow() { _colorSelectorDialog.hide(); } -void -ColorPicker::on_clicked() +void ColorPicker::on_clicked() { if (_colorSelector) { @@ -105,13 +98,11 @@ ColorPicker::on_clicked() _colorSelectorDialog.show(); } -void -ColorPicker::on_changed (guint32) +void ColorPicker::on_changed (guint32) { } -void -sp_color_picker_color_mod(SPColorSelector *csel, GObject *cp) +void sp_color_picker_color_mod(SPColorSelector *csel, GObject *cp) { if (_in_use) { return; @@ -124,7 +115,7 @@ sp_color_picker_color_mod(SPColorSelector *csel, GObject *cp) csel->base->getColorAlpha(color, alpha); guint32 rgba = color.toRGBA32( alpha ); - ColorPicker *ptr = (ColorPicker *)(cp); + ColorPicker *ptr = reinterpret_cast<ColorPicker *>(cp); (ptr->_preview).setRgba32 (rgba); |
