Changeset View
Changeset View
Standalone View
Standalone View
shell/textdocument.cpp
Show First 20 Lines • Show All 473 Lines • ▼ Show 20 Line(s) | 468 | { | |||
---|---|---|---|---|---|
474 | 474 | | |||
475 | if (view && view->selection()) { | 475 | if (view && view->selection()) { | ||
476 | return view->selectionRange(); | 476 | return view->selectionRange(); | ||
477 | } | 477 | } | ||
478 | 478 | | |||
479 | return PartDocument::textSelection(); | 479 | return PartDocument::textSelection(); | ||
480 | } | 480 | } | ||
481 | 481 | | |||
482 | QString TextDocument::text(const KTextEditor::Range &range) const | ||||
483 | { | ||||
484 | if (!d->document) { | ||||
485 | return QString(); | ||||
486 | } | ||||
487 | | ||||
488 | return d->document->text( range ); | ||||
mwolff: why do we need a view to get the text in a range? makes no sense to me. can't you just remove… | |||||
489 | } | ||||
490 | | ||||
482 | QString TextDocument::textLine() const | 491 | QString TextDocument::textLine() const | ||
483 | { | 492 | { | ||
484 | if (!d->document) { | 493 | if (!d->document) { | ||
485 | return QString(); | 494 | return QString(); | ||
486 | } | 495 | } | ||
487 | 496 | | |||
488 | KTextEditor::View *view = activeTextView(); | 497 | KTextEditor::View *view = activeTextView(); | ||
489 | 498 | | |||
▲ Show 20 Lines • Show All 290 Lines • Show Last 20 Lines |
why do we need a view to get the text in a range? makes no sense to me. can't you just remove this?