DeskCalc: fix gcc8 build.
This commit is contained in:
@@ -802,19 +802,23 @@ void
|
|||||||
CalcView::Copy()
|
CalcView::Copy()
|
||||||
{
|
{
|
||||||
// access system clipboard
|
// access system clipboard
|
||||||
if (be_clipboard->Lock()) {
|
if (!be_clipboard->Lock())
|
||||||
BMessage* clipper;
|
return;
|
||||||
if (be_clipboard->Clear() == B_OK
|
if (be_clipboard->Clear() != B_OK)
|
||||||
&& (clipper = be_clipboard->Data()) == B_OK) {
|
return;
|
||||||
BString expression = fExpressionTextView->Text();
|
|
||||||
if (clipper->AddData("text/plain", B_MIME_TYPE,
|
BMessage* clipper;
|
||||||
expression.String(), expression.Length()) == B_OK) {
|
clipper = be_clipboard->Data();
|
||||||
clipper->what = B_MIME_DATA;
|
if (clipper == NULL)
|
||||||
be_clipboard->Commit();
|
return;
|
||||||
}
|
|
||||||
}
|
BString expression = fExpressionTextView->Text();
|
||||||
be_clipboard->Unlock();
|
if (clipper->AddData("text/plain", B_MIME_TYPE,
|
||||||
|
expression.String(), expression.Length()) == B_OK) {
|
||||||
|
clipper->what = B_MIME_DATA;
|
||||||
|
be_clipboard->Commit();
|
||||||
}
|
}
|
||||||
|
be_clipboard->Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user