MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / SetDocPointer

Method SetDocPointer

scintilla/src/Editor.cxx:7048–7075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7046}
7047
7048void Editor::SetDocPointer ( Document *document )
7049{
7050 //Platform::DebugPrintf("** %x setdoc to %x\n", pdoc, document);
7051 pdoc->RemoveWatcher ( this, 0 );
7052 pdoc->Release();
7053 if ( document == NULL ) {
7054 pdoc = new Document();
7055 } else {
7056 pdoc = document;
7057 }
7058 pdoc->AddRef();
7059 // Ensure all positions within document
7060 sel.Clear();
7061 targetStart = 0;
7062 targetEnd = 0;
7063 braces[0] = invalidPosition;
7064 braces[1] = invalidPosition;
7065 vs.ReleaseAllExtendedStyles();
7066 // Reset the contraction state to fully shown.
7067 cs.Clear();
7068 cs.InsertLines ( 0, pdoc->LinesTotal() - 1 );
7069 SetAnnotationHeights ( 0, pdoc->LinesTotal() );
7070 llc.Deallocate();
7071 NeedWrapping();
7072 pdoc->AddWatcher ( this, 0 );
7073 SetScrollBars();
7074 Redraw();
7075}
7076
7077void Editor::SetAnnotationVisible ( int visible )
7078{

Callers

nothing calls this directly

Calls 9

RemoveWatcherMethod · 0.80
InsertLinesMethod · 0.80
LinesTotalMethod · 0.80
DeallocateMethod · 0.80
AddWatcherMethod · 0.80
ReleaseMethod · 0.45
AddRefMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected