You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
2.9 KiB
93 lines
2.9 KiB
9 years ago
|
From 7d824fd0b64a316e360243ab4641e1a8a47ee88e Mon Sep 17 00:00:00 2001
|
||
|
From: Christoph Cullmann <cullmann@kde.org>
|
||
|
Date: Sat, 10 Oct 2015 10:13:17 +0200
|
||
|
Subject: [PATCH 38/44] CHANGELOG: Printing again honors the selected font &
|
||
|
color schema BUG: 344976
|
||
|
|
||
|
---
|
||
|
src/printing/printpainter.cpp | 6 +-----
|
||
|
src/printing/printpainter.h | 8 +++++---
|
||
|
2 files changed, 6 insertions(+), 8 deletions(-)
|
||
|
|
||
|
diff --git a/src/printing/printpainter.cpp b/src/printing/printpainter.cpp
|
||
|
index 7bdfeee..0b5023a 100644
|
||
|
--- a/src/printing/printpainter.cpp
|
||
|
+++ b/src/printing/printpainter.cpp
|
||
|
@@ -25,9 +25,7 @@
|
||
|
#include "katetextfolding.h"
|
||
|
#include "katedocument.h"
|
||
|
#include "katebuffer.h"
|
||
|
-#include "katerenderer.h"
|
||
|
#include "kateview.h"
|
||
|
-#include "kateconfig.h"
|
||
|
#include "katehighlight.h"
|
||
|
#include "katepartdebug.h"
|
||
|
#include "katetextlayout.h"
|
||
|
@@ -86,7 +84,6 @@ public:
|
||
|
PrintPainter::PrintPainter(KTextEditor::DocumentPrivate *doc, KTextEditor::ViewPrivate *view)
|
||
|
: m_view(view)
|
||
|
, m_doc(doc)
|
||
|
- , m_colorScheme()
|
||
|
, m_printGuide(false)
|
||
|
, m_printLineNumbers(false)
|
||
|
, m_useHeader(false)
|
||
|
@@ -109,7 +106,6 @@ PrintPainter::PrintPainter(KTextEditor::DocumentPrivate *doc, KTextEditor::ViewP
|
||
|
m_folding = new Kate::TextFolding(m_doc->buffer());
|
||
|
|
||
|
m_renderer = new KateRenderer(m_doc, *m_folding, m_view);
|
||
|
- m_renderer->config()->setSchema(m_colorScheme);
|
||
|
m_renderer->setPrinterFriendly(true);
|
||
|
|
||
|
m_fontHeight = m_renderer->fontHeight();
|
||
|
@@ -499,7 +495,7 @@ void PrintPainter::paintGuide(QPainter &painter, uint &y, const PageLayout &pl)
|
||
|
QString _hlName = m_doc->highlight()->name();
|
||
|
|
||
|
QList<KTextEditor::Attribute::Ptr> _attributes; // list of highlight attributes for the legend
|
||
|
- m_doc->highlight()->getKateExtendedAttributeList(m_colorScheme, _attributes);
|
||
|
+ m_doc->highlight()->getKateExtendedAttributeList(m_renderer->config()->schema(), _attributes);
|
||
|
|
||
|
KateAttributeList _defaultAttributes;
|
||
|
KateHlManager::self()->getDefaults(m_renderer->config()->schema(), _defaultAttributes);
|
||
|
diff --git a/src/printing/printpainter.h b/src/printing/printpainter.h
|
||
|
index 44f4146..01877ce 100644
|
||
|
--- a/src/printing/printpainter.h
|
||
|
+++ b/src/printing/printpainter.h
|
||
|
@@ -27,13 +27,15 @@
|
||
|
#include <QColor>
|
||
|
#include <QFont>
|
||
|
|
||
|
+#include "kateconfig.h"
|
||
|
+#include "katerenderer.h"
|
||
|
+
|
||
|
namespace KTextEditor
|
||
|
{
|
||
|
class DocumentPrivate;
|
||
|
class ViewPrivate;
|
||
|
}
|
||
|
|
||
|
-class KateRenderer;
|
||
|
class QPrinter;
|
||
|
class QPainter;
|
||
|
|
||
|
@@ -62,7 +64,8 @@ public:
|
||
|
// Attributes
|
||
|
void setColorScheme(const QString &scheme)
|
||
|
{
|
||
|
- m_colorScheme = scheme;
|
||
|
+ // directly set that for the renderer
|
||
|
+ m_renderer->config()->setSchema(scheme);
|
||
|
}
|
||
|
void setPrintGuide(const bool on)
|
||
|
{
|
||
|
@@ -136,7 +139,6 @@ private:
|
||
|
KTextEditor::ViewPrivate *m_view;
|
||
|
KTextEditor::DocumentPrivate *m_doc;
|
||
|
|
||
|
- QString m_colorScheme;
|
||
|
bool m_printGuide;
|
||
|
bool m_printLineNumbers;
|
||
|
bool m_useHeader;
|
||
|
--
|
||
|
2.5.0
|
||
|
|