aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Humpula <michal.humpula@seznam.cz>2014-01-19 16:43:36 (GMT)
committerMichal Humpula <michal.humpula@seznam.cz>2014-01-19 16:43:50 (GMT)
commite53632b0e86a12a3cf1f7b0a49170160eaf211a5 (patch)
tree39fcae76e32745ec18c4e0e0d7e49a56f006c6da
parent37a79b2aed45278e7ce9de23fa3759e4584e1178 (diff)
make KateRenderer actually work with m_view = 0
-rw-r--r--src/render/katerenderer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/render/katerenderer.cpp b/src/render/katerenderer.cpp
index 3f58fd6..849a57f 100644
--- a/src/render/katerenderer.cpp
+++ b/src/render/katerenderer.cpp
@@ -434,7 +434,7 @@ QList<QTextLayout::FormatRange> KateRenderer::decorationsForLine(const Kate::Tex
}
// Add selection highlighting if we're creating the selection decorations
- if ((selectionsOnly && showSelections() && m_view->selection()) || (completionHighlight && completionSelected) || m_view->blockSelection()) {
+ if ((m_view && selectionsOnly && showSelections() && m_view->selection()) || (completionHighlight && completionSelected) || (m_view && m_view->blockSelection())) {
NormalRenderRange *selectionHighlight = new NormalRenderRange();
// Set up the selection background attribute TODO: move this elsewhere, eg. into the config?
@@ -462,7 +462,7 @@ QList<QTextLayout::FormatRange> KateRenderer::decorationsForLine(const Kate::Tex
KTextEditor::Cursor currentPosition, endPosition;
// Calculate the range which we need to iterate in order to get the highlighting for just this line
- if (selectionsOnly) {
+ if (m_view && selectionsOnly) {
if (m_view->blockSelection()) {
KTextEditor::Range subRange = m_doc->rangeOnLine(m_view->selectionRange(), line);
currentPosition = subRange.start();
@@ -561,7 +561,7 @@ void KateRenderer::paintTextLine(QPainter &paint, KateLineLayoutPtr range, int x
paintTextLineBackground(paint, range, currentViewLine, xStart, xEnd);
if (range->layout()) {
- bool drawSelection = m_view->selection() && showSelections() && m_view->selectionRange().overlapsLine(range->line());
+ bool drawSelection = m_view && m_view->selection() && showSelections() && m_view->selectionRange().overlapsLine(range->line());
// Draw selection in block selecton mode. We need 2 kinds of selections that QTextLayout::draw can't render:
// - past-end-of-line selection and
// - 0-column-wide selection (used to indicate where text will be typed)
@@ -654,7 +654,7 @@ void KateRenderer::paintTextLine(QPainter &paint, KateLineLayoutPtr range, int x
if (!m_printerFriendly) {
bool draw = false;
QBrush drawBrush;
- if (m_view->selection() && !m_view->blockSelection() && m_view->lineEndSelected(line.end(true))) {
+ if (m_view && m_view->selection() && !m_view->blockSelection() && m_view->lineEndSelected(line.end(true))) {
draw = true;
drawBrush = config()->selectionColor();
} else if (backgroundBrushSet && !m_view->blockSelection()) {
@@ -1015,7 +1015,7 @@ void KateRenderer::layoutLine(KateLineLayoutPtr lineLayout, int maxwidth, bool c
int shiftX = 0;
bool needShiftX = (maxwidth != -1)
- && (m_view->config()->dynWordWrapAlignIndent() > 0);
+ && m_view && (m_view->config()->dynWordWrapAlignIndent() > 0);
forever {
QTextLine line = l->createLine();