MCPcopy Create free account
hub / github.com/buggins/coolreader / LoadDocument

Method LoadDocument

cr3wx/src/view.cpp:657–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655}
656
657bool cr3view::LoadDocument( const wxString & fname )
658{
659 //printf("cr3view::LoadDocument()\n");
660 _renderTimer->Stop();
661 _clockTimer->Stop();
662 CloseDocument();
663
664 wxCursor hg( wxCURSOR_WAIT );
665 this->SetCursor( hg );
666 wxSetCursor( hg );
667 //===========================================
668 GetParent()->Update();
669 //printf(" loading... ");
670 bool res = getDocView()->LoadDocument( fname.c_str() );
671 //printf(" done. \n");
672 //DEBUG
673 //_docview->exportWolFile( "test.wol", true );
674 //_docview->SetPos(0);
675 if ( !res )
676 getDocView()->createDefaultDocument(lString16(L"File open error"), lString16(L"Cannot open file ") + fname.c_str() );
677 lString16 title = getDocView()->getAuthors();
678 if ( !title.empty() && !getDocView()->getTitle().empty() )
679 title << L". ";
680 title << getDocView()->getTitle();
681 GetParent()->SetLabel( wxString( title.c_str() ) );
682
683 //UpdateScrollBar();
684 _firstRender = true;
685 _allowRender = false;
686 ScheduleRender();
687 //_docview->restorePosition();
688 //_docview->Render();
689 //UpdateScrollBar();
690 //Paint();
691 GetParent()->SetFocus();
692 //===========================================
693 wxSetCursor( wxNullCursor );
694 this->SetCursor( wxNullCursor );
695 return res;
696}
697
698void cr3view::goToBookmark(ldomXPointer bm)
699{

Callers 9

OnHistItemActivatedMethod · 0.45
OnInitDialogMethod · 0.45
OnFileOpenMethod · 0.45
loadDocumentMethod · 0.45
loadDocumentMethod · 0.45
translateMethod · 0.45
setTranslationMethod · 0.45
CRViewDialogMethod · 0.45
loadDocumentMethod · 0.45

Calls 8

lString16Class · 0.85
StopMethod · 0.80
createDefaultDocumentMethod · 0.80
UpdateMethod · 0.45
c_strMethod · 0.45
getAuthorsMethod · 0.45
emptyMethod · 0.45
getTitleMethod · 0.45

Tested by

no test coverage detected