|
a/src/qtgui/preview_w.cpp |
|
b/src/qtgui/preview_w.cpp |
|
... |
|
... |
80 |
return m_lastanchor != 0;
|
80 |
return m_lastanchor != 0;
|
81 |
}
|
81 |
}
|
82 |
|
82 |
|
83 |
virtual string header()
|
83 |
virtual string header()
|
84 |
{
|
84 |
{
|
85 |
if (m_inputhtml) {
|
85 |
if (!m_inputhtml) {
|
86 |
return cstr_null;
|
|
|
87 |
} else {
|
|
|
88 |
if (prefs.previewPlainPre) {
|
86 |
switch (prefs.previewPlainPre) {
|
|
|
87 |
case PrefsPack::PP_BR:
|
|
|
88 |
m_eolbr = true;
|
|
|
89 |
return "<qt><head><title></title></head><body>";
|
|
|
90 |
case PrefsPack::PP_PRE:
|
89 |
m_eolbr = false;
|
91 |
m_eolbr = false;
|
|
|
92 |
return "<qt><head><title></title></head><body><pre>";
|
|
|
93 |
case PrefsPack::PP_PREWRAP:
|
|
|
94 |
m_eolbr = false;
|
90 |
return string("<qt><head><title></title></head><body>"
|
95 |
return "<qt><head><title></title></head><body>"
|
91 |
"<pre>");
|
|
|
92 |
// Note: we could also use the following for
|
|
|
93 |
// line-folding instead of <br>s This would be
|
|
|
94 |
// possible without recomputing the whole text, much
|
|
|
95 |
// better perfs for toggling wrap/no-wrap:
|
|
|
96 |
// <pre style=\"white-space: pre-wrap\">
|
96 |
"<pre style=\"white-space: pre-wrap\">";
|
97 |
} else {
|
|
|
98 |
m_eolbr = true;
|
|
|
99 |
return string("<qt><head><title></title></head><body>");
|
|
|
100 |
}
|
97 |
}
|
101 |
}
|
98 |
}
|
|
|
99 |
return cstr_null;
|
102 |
}
|
100 |
}
|
103 |
|
101 |
|
104 |
virtual string startMatch(unsigned int grpidx)
|
102 |
virtual string startMatch(unsigned int grpidx)
|
105 |
{
|
103 |
{
|
106 |
LOGDEB2(("startMatch, grpidx %u\n", grpidx));
|
104 |
LOGDEB2(("startMatch, grpidx %u\n", grpidx));
|
|
... |
|
... |
671 |
raise();
|
669 |
raise();
|
672 |
return true;
|
670 |
return true;
|
673 |
}
|
671 |
}
|
674 |
void Preview::togglePlainPre()
|
672 |
void Preview::togglePlainPre()
|
675 |
{
|
673 |
{
|
676 |
prefs.previewPlainPre = !prefs.previewPlainPre;
|
674 |
switch (prefs.previewPlainPre) {
|
|
|
675 |
case PrefsPack::PP_BR:
|
|
|
676 |
prefs.previewPlainPre = PrefsPack::PP_PRE;
|
|
|
677 |
break;
|
|
|
678 |
case PrefsPack::PP_PRE:
|
|
|
679 |
prefs.previewPlainPre = PrefsPack::PP_BR;
|
|
|
680 |
break;
|
|
|
681 |
case PrefsPack::PP_PREWRAP:
|
|
|
682 |
default:
|
|
|
683 |
prefs.previewPlainPre = PrefsPack::PP_PRE;
|
|
|
684 |
break;
|
|
|
685 |
}
|
677 |
|
686 |
|
678 |
PreviewTextEdit *editor = currentEditor();
|
687 |
PreviewTextEdit *editor = currentEditor();
|
679 |
if (editor)
|
688 |
if (editor)
|
680 |
loadDocInCurrentTab(editor->m_dbdoc, editor->m_docnum);
|
689 |
loadDocInCurrentTab(editor->m_dbdoc, editor->m_docnum);
|
681 |
}
|
690 |
}
|