Check that a source file is in fact available before attempting to use it to
generate a clipping name. Fixes #7704. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42217 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
#include "FileSourceCode.h"
|
#include "FileSourceCode.h"
|
||||||
#include "LocatableFile.h"
|
#include "LocatableFile.h"
|
||||||
#include "MessageCodes.h"
|
#include "MessageCodes.h"
|
||||||
|
#include "SourceLanguage.h"
|
||||||
#include "StackTrace.h"
|
#include "StackTrace.h"
|
||||||
#include "Statement.h"
|
#include "Statement.h"
|
||||||
#include "Team.h"
|
#include "Team.h"
|
||||||
@@ -1232,7 +1233,13 @@ SourceView::TextView::MouseMoved(BPoint where, uint32 transit,
|
|||||||
BMessage message;
|
BMessage message;
|
||||||
message.AddData ("text/plain", B_MIME_TYPE, text.String(),
|
message.AddData ("text/plain", B_MIME_TYPE, text.String(),
|
||||||
text.Length());
|
text.Length());
|
||||||
BString clipName = fSourceCode->GetSourceFile()->Name();
|
BString clipName;
|
||||||
|
if (fSourceCode->GetSourceFile() != NULL)
|
||||||
|
clipName = fSourceCode->GetSourceFile()->Name();
|
||||||
|
else if (fSourceCode->GetSourceLanguage() != NULL)
|
||||||
|
clipName = fSourceCode->GetSourceLanguage()->Name();
|
||||||
|
else
|
||||||
|
clipName = "Text";
|
||||||
clipName << " clipping";
|
clipName << " clipping";
|
||||||
message.AddString ("be:clip_name", clipName.String());
|
message.AddString ("be:clip_name", clipName.String());
|
||||||
message.AddInt32 ("be:actions", B_COPY_TARGET);
|
message.AddInt32 ("be:actions", B_COPY_TARGET);
|
||||||
|
|||||||
Reference in New Issue
Block a user