From be3fc71676afe51ce340412b61e748a8141e84f7 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 25 Mar 2007 16:13:14 +0000 Subject: [PATCH] Third present for Bo: Add syntax highlighting to the LateX preamble. TODO: extract the latexHighlighter class into its own .[Ch] files. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17553 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/QDocumentDialog.C | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/frontends/qt4/QDocumentDialog.C b/src/frontends/qt4/QDocumentDialog.C index 63cf65817b..b5ff4faa02 100644 --- a/src/frontends/qt4/QDocumentDialog.C +++ b/src/frontends/qt4/QDocumentDialog.C @@ -24,6 +24,8 @@ #include "Qt2BC.h" #include "checkedwidgets.h" #include "qt_helpers.h" +// For latexHighlighter use in the preamble. +#include "QViewSource.h" #include "bufferparams.h" #include "encoding.h" @@ -373,6 +375,9 @@ QDocumentDialog::QDocumentDialog(QDocument * form) // preamble preambleModule = new UiWidget; connect(preambleModule->preambleTE, SIGNAL(textChanged()), this, SLOT(change_adaptor())); + // This is not a memory leak. The object will be destroyed + // with preambleModule. + new latexHighlighter(preambleModule->preambleTE->document()); // bullets