Changeset 483


Ignore:
Timestamp:
10/26/08 04:37:10 (3 years ago)
Author:
szabgab
Message:

stop using {Document} and call a method to get the current document

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Padre/Wx/MainWindow.pm

    r482 r483  
    297297        return; 
    298298    } 
    299     my $page         = $self->{notebook}->GetPage($pageid); 
    300     my $doc          = $page->{Document} or return; 
    301     my $line         = $page->GetCurrentLine; 
     299    my $editor       = $self->{notebook}->GetPage($pageid); 
     300    my $doc          = Padre::Documents->current or return; 
     301    my $line         = $editor->GetCurrentLine; 
    302302    my $filename     = $doc->filename || ''; 
    303303    my $newline_type = $doc->get_newline_type || Padre::Util::NEWLINE; 
    304     my $modified     = $page->GetModify ? '*' : ' '; 
     304    my $modified     = $editor->GetModify ? '*' : ' '; 
    305305 
    306306    if ($filename) { 
     
    310310        $self->{notebook}->SetPageText($pageid, $modified . $text); 
    311311    } 
    312     my $pos = $page->GetCurrentPos; 
    313  
    314     my $start = $page->PositionFromLine($line); 
    315     my $char = $pos-$start; 
     312 
     313    my $pos   = $editor->GetCurrentPos; 
     314    my $start = $editor->PositionFromLine($line); 
     315    my $char  = $pos-$start; 
    316316 
    317317    $self->SetStatusText("$modified $filename",             0); 
Note: See TracChangeset for help on using the changeset viewer.