Style fixes and automatic whitespace cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31570 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8856fd5fcf
commit
9e1a62419e
|
@ -972,7 +972,6 @@ SourceView::TextView::MouseDown(BPoint where)
|
|||
void
|
||||
SourceView::TextView::MouseMoved(BPoint where, uint32 transit,
|
||||
const BMessage* dragMessage)
|
||||
|
||||
{
|
||||
if (fSelectionMode) {
|
||||
BRegion oldRegion;
|
||||
|
@ -1053,7 +1052,8 @@ SourceView::TextView::SelectionPoint
|
|||
SourceView::TextView::_SelectionPointAt(BPoint where) const
|
||||
{
|
||||
int32 line = LineAtOffset(where.y);
|
||||
int32 offset = (int32)max_c((where.x - kLeftTextMargin) / fCharacterWidth, 0);
|
||||
int32 offset = (int32)max_c((where.x - kLeftTextMargin)
|
||||
/ fCharacterWidth, 0);
|
||||
int32 lineLength = strlen(fSourceCode->LineAt(line));
|
||||
if (offset > lineLength)
|
||||
offset = (lineLength > 0) ? lineLength - 1 : 0;
|
||||
|
@ -1085,6 +1085,7 @@ SourceView::TextView::_GetSelectionRegion(BRegion ®ion) const
|
|||
selectionRect.right = Bounds().right;
|
||||
selectionRect.bottom = selectionRect.top + fFontInfo->lineHeight;
|
||||
region.Include(selectionRect);
|
||||
|
||||
// compute rect for all lines in middle of selection
|
||||
if (fSelectionEnd.line - fSelectionStart.line > 1) {
|
||||
selectionRect.left = 0.0;
|
||||
|
@ -1094,6 +1095,7 @@ SourceView::TextView::_GetSelectionRegion(BRegion ®ion) const
|
|||
selectionRect.bottom = fSelectionEnd.line * fFontInfo->lineHeight;
|
||||
region.Include(selectionRect);
|
||||
}
|
||||
|
||||
// add rect for last line (if needed)
|
||||
if (fSelectionEnd.offset > 0) {
|
||||
selectionRect.left = 0.0;
|
||||
|
@ -1114,11 +1116,11 @@ SourceView::TextView::CopySelectionToClipboard(void) const
|
|||
return;
|
||||
|
||||
BString text;
|
||||
if (fSelectionStart.line == fSelectionEnd.line)
|
||||
if (fSelectionStart.line == fSelectionEnd.line) {
|
||||
text.SetTo(fSourceCode->LineAt(fSelectionStart.line)
|
||||
+ fSelectionStart.offset, fSelectionEnd.offset
|
||||
- fSelectionStart.offset);
|
||||
else {
|
||||
} else {
|
||||
text.SetTo(fSourceCode->LineAt(fSelectionStart.line)
|
||||
+ fSelectionStart.offset);
|
||||
text << "\n";
|
||||
|
@ -1134,7 +1136,6 @@ SourceView::TextView::CopySelectionToClipboard(void) const
|
|||
B_MIME_TYPE, text.String(), text.Length());
|
||||
be_clipboard->Commit();
|
||||
be_clipboard->Unlock();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1323,8 +1324,8 @@ printf(" -> scrolling to (%f, %f)\n", visible.left, top - (visible.Height() + 1
|
|||
void
|
||||
SourceView::HighlightBorder(bool state)
|
||||
{
|
||||
BScrollView *parent = dynamic_cast<BScrollView *>(Parent());
|
||||
if (parent)
|
||||
BScrollView* parent = dynamic_cast<BScrollView*>(Parent());
|
||||
if (parent != NULL)
|
||||
parent->SetBorderHighlighted(state);
|
||||
}
|
||||
|
||||
|
@ -1337,7 +1338,7 @@ SourceView::TargetedByScrollView(BScrollView* scrollView)
|
|||
|
||||
|
||||
void
|
||||
SourceView::MessageReceived(BMessage *message)
|
||||
SourceView::MessageReceived(BMessage* message)
|
||||
{
|
||||
switch (message->what)
|
||||
{
|
||||
|
|
|
@ -64,7 +64,6 @@ private:
|
|||
float lineHeight;
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
void _Init();
|
||||
void _UpdateScrollBars();
|
||||
|
|
|
@ -391,9 +391,9 @@ TeamWindow::_Init()
|
|||
fStepOutButton->SetTarget(this);
|
||||
|
||||
// add menus and menu items
|
||||
BMenu *menu = new BMenu("File");
|
||||
BMenu* menu = new BMenu("File");
|
||||
fMenuBar->AddItem(menu);
|
||||
BMenuItem *item = new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED),
|
||||
BMenuItem* item = new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED),
|
||||
'Q');
|
||||
menu->AddItem(item);
|
||||
item->SetTarget(this);
|
||||
|
|
Loading…
Reference in New Issue