Author: axeld Date: 2010-06-13 12:48:09 +0200 (Sun, 13 Jun 2010) New Revision: 37124 Changeset: http://dev.haiku-os.org/changeset/37124/haiku Modified: haiku/trunk/src/apps/sudoku/SudokuView.cpp Log: * Renamed "mio" to mallocIO. * Don't define status in CopyToClipboard() before it's actually used. Modified: haiku/trunk/src/apps/sudoku/SudokuView.cpp =================================================================== --- haiku/trunk/src/apps/sudoku/SudokuView.cpp 2010-06-12 19:00:11 UTC (rev 37123) +++ haiku/trunk/src/apps/sudoku/SudokuView.cpp 2010-06-13 10:48:09 UTC (rev 37124) @@ -1,5 +1,5 @@ /* - * Copyright 2007-2008, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx All rights reserved. + * Copyright 2007-2010, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx * Distributed under the terms of the MIT License. */ @@ -470,65 +470,64 @@ status_t SudokuView::CopyToClipboard() { - status_t status = B_ERROR; if (!be_clipboard->Lock()) - return status; + return B_ERROR; be_clipboard->Clear(); BMessage* clip = be_clipboard->Data(); if (clip == NULL) { be_clipboard->Unlock(); - return status; + return B_ERROR; } // As BBitmap - BMallocIO mio; - status = SaveTo(mio, kExportAsBitmap); + BMallocIO mallocIO; + status_t status = SaveTo(mallocIO, kExportAsBitmap); if (status >= B_OK) { - mio.Seek(0LL, SEEK_SET); + mallocIO.Seek(0LL, SEEK_SET); // ShowImage, ArtPaint & WonderBrush use that status = clip->AddData("image/bitmap", B_MESSAGE_TYPE, - mio.Buffer(), mio.BufferLength()); + mallocIO.Buffer(), mallocIO.BufferLength()); // Becasso uses that ? - clip->AddData("image/x-be-bitmap", B_MESSAGE_TYPE, mio.Buffer(), - mio.BufferLength()); + clip->AddData("image/x-be-bitmap", B_MESSAGE_TYPE, mallocIO.Buffer(), + mallocIO.BufferLength()); // Gobe Productive uses that... // QuickRes as well, with a rect field. - clip->AddData("image/x-vnd.Be-bitmap", B_MESSAGE_TYPE, mio.Buffer(), - mio.BufferLength()); + clip->AddData("image/x-vnd.Be-bitmap", B_MESSAGE_TYPE, + mallocIO.Buffer(), mallocIO.BufferLength()); } - mio.Seek(0LL, SEEK_SET); - mio.SetSize(0LL); + mallocIO.Seek(0LL, SEEK_SET); + mallocIO.SetSize(0LL); // As HTML if (status >= B_OK) - status = SaveTo(mio, kExportAsHTML); + status = SaveTo(mallocIO, kExportAsHTML); if (status >= B_OK) { - status = clip->AddData("text/html", B_MIME_TYPE, mio.Buffer(), - mio.BufferLength()); + status = clip->AddData("text/html", B_MIME_TYPE, mallocIO.Buffer(), + mallocIO.BufferLength()); } - mio.Seek(0LL, SEEK_SET); - mio.SetSize(0LL); + mallocIO.Seek(0LL, SEEK_SET); + mallocIO.SetSize(0LL); // As plain text if (status >= B_OK) - SaveTo(mio, kExportAsText); + SaveTo(mallocIO, kExportAsText); if (status >= B_OK) { - status = clip->AddData("text/plain", B_MIME_TYPE, mio.Buffer(), - mio.BufferLength()); + status = clip->AddData("text/plain", B_MIME_TYPE, mallocIO.Buffer(), + mallocIO.BufferLength()); } - mio.Seek(0LL, SEEK_SET); - mio.SetSize(0LL); + mallocIO.Seek(0LL, SEEK_SET); + mallocIO.SetSize(0LL); - // As flattened BPicture, anyone handles that ? + // As flattened BPicture, anyone handles that? if (status >= B_OK) - status = SaveTo(mio, kExportAsPicture); + status = SaveTo(mallocIO, kExportAsPicture); if (status >= B_OK) { status = clip->AddData("image/x-vnd.Be-picture", B_MIME_TYPE, - mio.Buffer(), mio.BufferLength()); + mallocIO.Buffer(), mallocIO.BufferLength()); } - mio.SetSize(0LL); + mallocIO.SetSize(0LL); be_clipboard->Commit(); be_clipboard->Unlock(); @@ -631,7 +630,7 @@ fHintFont.GetHeight(&fontHeight); fHintBaseline = ceilf(fontHeight.ascent) / 2 + (fHintHeight - ceilf(fontHeight.descent)) / 2; - + // fix the dragger's position BView *dragger = FindView("_dragger_"); if (dragger) @@ -1216,7 +1215,7 @@ SetLowColor(fBackgroundColor); FillRect(_Frame(x, y), B_SOLID_LOW); } - + if (fShowKeyboardFocus && x == fKeyboardX && y == fKeyboardY) _DrawKeyboardFocus();