Changeset 472


Ignore:
Timestamp:
10/26/08 02:28:23 (3 years ago)
Author:
szabgab
Message:

remove the need for the _DOCUMENT helper function and replace it
with calls to Padre::Documents methods

Location:
trunk/lib/Padre/Wx
Files:
2 edited

Legend:

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

    r468 r472  
    55use warnings; 
    66 
     7use Padre::Documents (); 
    78use Wx::STC; 
    89use Padre::Wx; 
     
    135136    my ( $self, $event ) = @_; 
    136137 
    137     my $doc = Padre::Wx::MainWindow::_DOCUMENT() or return; 
     138    my $doc = Padre::Documents->current or return; 
    138139    if ($doc->can('colourise')) { 
    139140        $doc->colourise; 
     
    160161    } 
    161162 
    162     my $doc = Padre::Wx::MainWindow::_DOCUMENT() or return; 
     163    my $doc = Padre::Documents->current or return; 
    163164    my $keywords = $doc->keywords; 
    164165 
  • trunk/lib/Padre/Wx/MainWindow.pm

    r471 r472  
    644644    # Save the list of open files 
    645645    $config->{host}->{main_files} = [ 
    646         map { $_->filename } 
    647         grep { $_ } map { _DOCUMENT($_) } 
     646        map  { $_->filename } 
     647        grep { $_ }  
     648        map  { Padre::Documents->by_id($_) } 
    648649        $self->pageids 
    649650    ]; 
     
    947948    my $page         = $self->{notebook}->GetPage($id); 
    948949    my $content      = $page->GetText; 
    949     my $doc          = _DOCUMENT($id) or return; 
     950    my $doc          = Padre::Documents->by_id($id) or return; 
    950951    my $filename     = $doc->filename; 
    951952    my $newline_type = $doc->get_newline_type; 
     
    10011002    $self->{menu}->remove_alt_n_menu; 
    10021003    foreach my $i ( 0 .. @{ $self->{menu}->{alt} } - 1 ) { 
    1003         my $doc = _DOCUMENT($i) or return; 
     1004        my $doc = Padre::Documents->by_id($i) or return; 
    10041005        my $file = $doc->filename 
    10051006            || $self->{notebook}->GetPageText($i); 
     
    12131214    my ($self, $file) = @_; 
    12141215    foreach my $id (0 .. $self->{notebook}->GetPageCount -1) { 
    1215         my $doc = _DOCUMENT($id) or return; 
     1216        my $doc = Padre::Documents->by_id($id) or return; 
    12161217        my $filename = $doc->filename; 
    12171218        next if not $filename; 
     
    12441245} 
    12451246 
    1246 sub _DOCUMENT { 
    1247     return (defined $_[0]) ? Padre::Documents->by_id($_[0]) : Padre::Documents->current; 
    1248 } 
    1249  
    125012471; 
Note: See TracChangeset for help on using the changeset viewer.