2003-11-05 12:06:20 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file output_docbook.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author Jos<EFBFBD> Matos
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "output_docbook.h"
|
|
|
|
|
|
|
|
|
|
#include "buffer.h"
|
2005-02-25 11:55:36 +00:00
|
|
|
|
#include "buffer_funcs.h"
|
2003-11-05 12:06:20 +00:00
|
|
|
|
#include "bufferparams.h"
|
view-source feature, from Bo Peng <ben.bob@gmail.com>
* src/buffer.h buffer.C - getSourceCode()
* src/lyxfunc.C - open view-source dialog
* src/text3.C - change LFUN_MOUSE_RELEASE
* src/output_linuxdoc.C, src/output_docbook.C, src/output_latex.C
- intercept output
* src/outputparams.h, outputparams.C - add par_begin, par_end, dryrun
* src/insets/insetgraphics.C - add dryrun mode of file conversion
* lib/ui/stdmenus.ui - add view-source menu item under view
* Add view-source dialog, add
src/frontends/qt2/QViewSourceDialog.h, QViewSource.C, QViewSource.h, QViewSourceDialog.C
src/frontends/qt2/ui/QViewSourceDialogBase.ui
src/frontends/controllers/ControlViewSource.h ControlViewSource.C
modify
src/frontends/qt2/Makefile.dialogs, Makefile.am, Dialogs.C,
src/frontends/controllers/Makefile.am, po.POTFILES.in
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13610 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-09 02:48:54 +00:00
|
|
|
|
#include "outputparams.h"
|
2003-11-25 17:23:36 +00:00
|
|
|
|
#include "counters.h"
|
2003-12-31 08:44:42 +00:00
|
|
|
|
#include "debug.h"
|
2003-11-05 12:06:20 +00:00
|
|
|
|
#include "paragraph.h"
|
|
|
|
|
#include "paragraph_funcs.h"
|
2006-03-23 20:11:06 +00:00
|
|
|
|
#include "ParagraphList.h"
|
2003-11-05 12:06:20 +00:00
|
|
|
|
#include "ParagraphParameters.h"
|
|
|
|
|
#include "sgml.h"
|
|
|
|
|
|
|
|
|
|
#include "insets/insetcommand.h"
|
|
|
|
|
|
|
|
|
|
#include "support/lstrings.h"
|
|
|
|
|
#include "support/lyxlib.h"
|
2005-01-06 16:39:35 +00:00
|
|
|
|
#include "support/convert.h"
|
2004-10-24 23:53:42 +00:00
|
|
|
|
#include "support/types.h"
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LOCALE
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-10-24 23:53:42 +00:00
|
|
|
|
using lyx::pos_type;
|
2006-10-19 21:00:33 +00:00
|
|
|
|
using lyx::odocstream;
|
2003-11-25 17:23:36 +00:00
|
|
|
|
using lyx::support::subst;
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
|
|
|
|
using std::endl;
|
|
|
|
|
using std::ostream;
|
|
|
|
|
using std::vector;
|
|
|
|
|
using std::string;
|
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
namespace {
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
ParagraphList::const_iterator searchParagraph(ParagraphList::const_iterator const & par,
|
|
|
|
|
ParagraphList::const_iterator const & pend)
|
2003-11-05 12:06:20 +00:00
|
|
|
|
{
|
2006-03-23 20:11:06 +00:00
|
|
|
|
ParagraphList::const_iterator p = boost::next(par);
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
for( ; p != pend && p->layout()->latextype == LATEX_PARAGRAPH; ++p);
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
return p;
|
|
|
|
|
}
|
2003-11-25 17:23:36 +00:00
|
|
|
|
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
ParagraphList::const_iterator searchCommand(ParagraphList::const_iterator const & par,
|
|
|
|
|
ParagraphList::const_iterator const & pend)
|
|
|
|
|
{
|
|
|
|
|
LyXLayout_ptr const & bstyle = par->layout();
|
2006-03-23 20:11:06 +00:00
|
|
|
|
ParagraphList::const_iterator p = boost::next(par);
|
2004-04-03 08:37:12 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
for( ; p != pend; ++p) {
|
|
|
|
|
LyXLayout_ptr const & style = p->layout();
|
|
|
|
|
if( style->latextype == LATEX_COMMAND && style->commanddepth <= bstyle->commanddepth)
|
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
return pend;
|
|
|
|
|
}
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
ParagraphList::const_iterator searchEnvironment(ParagraphList::const_iterator const & par,
|
|
|
|
|
ParagraphList::const_iterator const & pend)
|
|
|
|
|
{
|
|
|
|
|
LyXLayout_ptr const & bstyle = par->layout();
|
2006-03-23 20:11:06 +00:00
|
|
|
|
ParagraphList::const_iterator p = boost::next(par);
|
2004-10-24 00:02:39 +00:00
|
|
|
|
for( ; p != pend; ++p) {
|
|
|
|
|
LyXLayout_ptr const & style = p->layout();
|
|
|
|
|
if( style->latextype == LATEX_COMMAND)
|
|
|
|
|
return p;
|
|
|
|
|
|
|
|
|
|
if( style->latextype == LATEX_PARAGRAPH) {
|
|
|
|
|
if (p->params().depth() > par->params().depth())
|
|
|
|
|
continue;
|
|
|
|
|
return p;
|
2003-11-05 12:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-10-24 18:28:18 +00:00
|
|
|
|
if(p->params().depth() < par->params().depth())
|
|
|
|
|
return p;
|
|
|
|
|
|
2005-01-18 14:15:57 +00:00
|
|
|
|
if( style->latexname() != bstyle->latexname() && p->params().depth() == par->params().depth() )
|
2004-10-24 00:02:39 +00:00
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
return pend;
|
|
|
|
|
}
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
2004-04-03 08:37:12 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
ParagraphList::const_iterator makeParagraph(Buffer const & buf,
|
2006-10-19 21:00:33 +00:00
|
|
|
|
odocstream & os,
|
2004-10-24 00:02:39 +00:00
|
|
|
|
OutputParams const & runparams,
|
|
|
|
|
ParagraphList const & paragraphs,
|
|
|
|
|
ParagraphList::const_iterator const & pbegin,
|
2004-10-28 13:07:45 +00:00
|
|
|
|
ParagraphList::const_iterator const & pend)
|
|
|
|
|
{
|
2004-10-30 13:05:31 +00:00
|
|
|
|
LyXLayout_ptr const & defaultstyle = buf.params().getLyXTextClass().defaultLayout();
|
2004-10-28 13:07:45 +00:00
|
|
|
|
for(ParagraphList::const_iterator par = pbegin; par != pend; ++par) {
|
2005-02-28 13:14:48 +00:00
|
|
|
|
if (par != pbegin)
|
|
|
|
|
os << '\n';
|
2004-10-30 13:05:31 +00:00
|
|
|
|
if (par->layout() == defaultstyle && par->emptyTag()) {
|
2006-03-23 20:11:06 +00:00
|
|
|
|
par->simpleDocBookOnePar(buf, os, runparams, outerFont(std::distance(paragraphs.begin(), par), paragraphs));
|
2004-10-30 13:05:31 +00:00
|
|
|
|
} else {
|
2004-11-02 11:25:20 +00:00
|
|
|
|
sgml::openTag(buf, os, runparams, *par);
|
2006-03-23 20:11:06 +00:00
|
|
|
|
par->simpleDocBookOnePar(buf, os, runparams, outerFont(std::distance(paragraphs.begin(), par), paragraphs));
|
2004-10-30 13:05:31 +00:00
|
|
|
|
sgml::closeTag(os, *par);
|
|
|
|
|
}
|
2004-10-24 00:02:39 +00:00
|
|
|
|
}
|
|
|
|
|
return pend;
|
|
|
|
|
}
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
|
2006-10-19 21:00:33 +00:00
|
|
|
|
odocstream & os,
|
2004-10-24 00:02:39 +00:00
|
|
|
|
OutputParams const & runparams,
|
|
|
|
|
ParagraphList const & paragraphs,
|
|
|
|
|
ParagraphList::const_iterator const & pbegin,
|
|
|
|
|
ParagraphList::const_iterator const & pend) {
|
|
|
|
|
ParagraphList::const_iterator par = pbegin;
|
2004-05-14 15:47:35 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
LyXLayout_ptr const & defaultstyle = buf.params().getLyXTextClass().defaultLayout();
|
|
|
|
|
LyXLayout_ptr const & bstyle = par->layout();
|
|
|
|
|
string item_tag;
|
2004-10-26 21:16:44 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
// Opening outter tag
|
2004-11-02 11:25:20 +00:00
|
|
|
|
sgml::openTag(buf, os, runparams, *pbegin);
|
2004-10-24 00:02:39 +00:00
|
|
|
|
os << '\n';
|
2005-01-18 14:15:57 +00:00
|
|
|
|
if (bstyle->latextype == LATEX_ENVIRONMENT && bstyle->pass_thru)
|
2004-10-24 00:02:39 +00:00
|
|
|
|
os << "<![CDATA[";
|
|
|
|
|
|
|
|
|
|
while (par != pend) {
|
|
|
|
|
LyXLayout_ptr const & style = par->layout();
|
|
|
|
|
ParagraphList::const_iterator send;
|
2004-11-02 11:25:20 +00:00
|
|
|
|
string id = par->getID(buf, runparams);
|
2004-10-24 00:02:39 +00:00
|
|
|
|
string wrapper = "";
|
2004-10-24 23:53:42 +00:00
|
|
|
|
pos_type sep = 0;
|
2003-11-25 17:23:36 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
// Opening inner tag
|
|
|
|
|
switch (bstyle->latextype) {
|
|
|
|
|
case LATEX_ENVIRONMENT:
|
2004-10-30 18:44:55 +00:00
|
|
|
|
if (!bstyle->innertag().empty()) {
|
2004-10-28 15:10:10 +00:00
|
|
|
|
sgml::openTag(os, bstyle->innertag(), id);
|
2003-11-25 17:23:36 +00:00
|
|
|
|
}
|
2003-11-05 12:06:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LATEX_ITEM_ENVIRONMENT:
|
2004-10-24 00:02:39 +00:00
|
|
|
|
if (!bstyle->labeltag().empty()) {
|
2004-10-28 15:10:10 +00:00
|
|
|
|
sgml::openTag(os, bstyle->innertag(), id);
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::openTag(os, bstyle->labeltag());
|
2004-10-24 23:53:42 +00:00
|
|
|
|
sep = par->getFirstWord(buf, os, runparams) + 1;
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::closeTag(os, bstyle->labeltag());
|
2003-11-05 12:06:20 +00:00
|
|
|
|
}
|
2004-10-24 23:53:42 +00:00
|
|
|
|
wrapper = defaultstyle->latexname();
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::openTag(os, bstyle->itemtag());
|
2004-10-24 00:02:39 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
switch (style->latextype) {
|
|
|
|
|
case LATEX_ENVIRONMENT:
|
|
|
|
|
case LATEX_ITEM_ENVIRONMENT: {
|
|
|
|
|
if(par->params().depth() == pbegin->params().depth()) {
|
2004-10-28 15:10:10 +00:00
|
|
|
|
sgml::openTag(os, wrapper);
|
2006-03-23 20:11:06 +00:00
|
|
|
|
par->simpleDocBookOnePar(buf, os, runparams, outerFont(std::distance(paragraphs.begin(), par), paragraphs), sep);
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::closeTag(os, wrapper);
|
2004-10-24 00:02:39 +00:00
|
|
|
|
++par;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
send = searchEnvironment(par, pend);
|
|
|
|
|
par = makeEnvironment(buf, os, runparams, paragraphs, par,send);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case LATEX_PARAGRAPH:
|
|
|
|
|
send = searchParagraph(par, pend);
|
|
|
|
|
par = makeParagraph(buf, os, runparams, paragraphs, par,send);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
// Closing inner tag
|
|
|
|
|
switch (bstyle->latextype) {
|
|
|
|
|
case LATEX_ENVIRONMENT:
|
2004-10-30 18:44:55 +00:00
|
|
|
|
if (!bstyle->innertag().empty()) {
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::closeTag(os, bstyle->innertag());
|
2004-10-24 00:02:39 +00:00
|
|
|
|
os << '\n';
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case LATEX_ITEM_ENVIRONMENT:
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::closeTag(os, bstyle->itemtag());
|
2004-10-24 23:53:42 +00:00
|
|
|
|
if (!bstyle->labeltag().empty())
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::closeTag(os, bstyle->innertag());
|
2003-11-05 12:06:20 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2004-10-24 00:02:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-01-18 14:15:57 +00:00
|
|
|
|
if (bstyle->latextype == LATEX_ENVIRONMENT && bstyle->pass_thru)
|
2004-10-24 00:02:39 +00:00
|
|
|
|
os << "]]>";
|
|
|
|
|
|
|
|
|
|
// Closing outter tag
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::closeTag(os, *pbegin);
|
2004-10-24 00:02:39 +00:00
|
|
|
|
|
|
|
|
|
return pend;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ParagraphList::const_iterator makeCommand(Buffer const & buf,
|
2006-10-19 21:00:33 +00:00
|
|
|
|
odocstream & os,
|
2004-10-24 00:02:39 +00:00
|
|
|
|
OutputParams const & runparams,
|
|
|
|
|
ParagraphList const & paragraphs,
|
|
|
|
|
ParagraphList::const_iterator const & pbegin,
|
|
|
|
|
ParagraphList::const_iterator const & pend)
|
|
|
|
|
{
|
|
|
|
|
ParagraphList::const_iterator par = pbegin;
|
|
|
|
|
LyXLayout_ptr const & bstyle = par->layout();
|
2004-10-26 21:16:44 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
//Open outter tag
|
2004-11-02 11:25:20 +00:00
|
|
|
|
sgml::openTag(buf, os, runparams, *pbegin);
|
2004-10-24 00:02:39 +00:00
|
|
|
|
os << '\n';
|
|
|
|
|
|
|
|
|
|
// Label around sectioning number:
|
|
|
|
|
if (!bstyle->labeltag().empty()) {
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::openTag(os, bstyle->labeltag());
|
2006-10-19 21:00:33 +00:00
|
|
|
|
// FIXME UNICODE
|
|
|
|
|
os << lyx::from_ascii(expandLabel(buf, bstyle, false));
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::closeTag(os, bstyle->labeltag());
|
2004-10-24 00:02:39 +00:00
|
|
|
|
}
|
2004-10-26 21:16:44 +00:00
|
|
|
|
|
2005-01-06 15:40:49 +00:00
|
|
|
|
// Opend inner tag and close inner tags
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::openTag(os, bstyle->innertag());
|
2006-03-23 20:11:06 +00:00
|
|
|
|
par->simpleDocBookOnePar(buf, os, runparams, outerFont(std::distance(paragraphs.begin(), par), paragraphs));
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::closeTag(os, bstyle->innertag());
|
2004-10-24 00:02:39 +00:00
|
|
|
|
os << '\n';
|
2004-10-26 21:16:44 +00:00
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
++par;
|
|
|
|
|
while (par != pend) {
|
|
|
|
|
LyXLayout_ptr const & style = par->layout();
|
|
|
|
|
ParagraphList::const_iterator send;
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
|
|
|
|
switch (style->latextype) {
|
2004-10-24 00:02:39 +00:00
|
|
|
|
case LATEX_COMMAND: {
|
|
|
|
|
send = searchCommand(par, pend);
|
|
|
|
|
par = makeCommand(buf, os, runparams, paragraphs, par,send);
|
2003-11-05 12:06:20 +00:00
|
|
|
|
break;
|
2004-10-24 00:02:39 +00:00
|
|
|
|
}
|
2003-11-05 12:06:20 +00:00
|
|
|
|
case LATEX_ENVIRONMENT:
|
2004-10-24 00:02:39 +00:00
|
|
|
|
case LATEX_ITEM_ENVIRONMENT: {
|
|
|
|
|
send = searchEnvironment(par, pend);
|
|
|
|
|
par = makeEnvironment(buf, os, runparams, paragraphs, par,send);
|
2003-11-05 12:06:20 +00:00
|
|
|
|
break;
|
2004-10-24 00:02:39 +00:00
|
|
|
|
}
|
2003-11-05 12:06:20 +00:00
|
|
|
|
case LATEX_PARAGRAPH:
|
2004-10-24 00:02:39 +00:00
|
|
|
|
send = searchParagraph(par, pend);
|
|
|
|
|
par = makeParagraph(buf, os, runparams, paragraphs, par,send);
|
2003-11-05 12:06:20 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-10-24 00:02:39 +00:00
|
|
|
|
// Close outter tag
|
2004-10-28 13:07:45 +00:00
|
|
|
|
sgml::closeTag(os, *pbegin);
|
2004-10-24 00:02:39 +00:00
|
|
|
|
|
|
|
|
|
return pend;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // end anonym namespace
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void docbookParagraphs(ParagraphList const & paragraphs,
|
|
|
|
|
Buffer const & buf,
|
2006-10-19 21:00:33 +00:00
|
|
|
|
odocstream & os,
|
2004-10-24 00:02:39 +00:00
|
|
|
|
OutputParams const & runparams)
|
|
|
|
|
{
|
|
|
|
|
ParagraphList::const_iterator par = paragraphs.begin();
|
|
|
|
|
ParagraphList::const_iterator pend = paragraphs.end();
|
2003-11-05 12:06:20 +00:00
|
|
|
|
|
view-source feature, from Bo Peng <ben.bob@gmail.com>
* src/buffer.h buffer.C - getSourceCode()
* src/lyxfunc.C - open view-source dialog
* src/text3.C - change LFUN_MOUSE_RELEASE
* src/output_linuxdoc.C, src/output_docbook.C, src/output_latex.C
- intercept output
* src/outputparams.h, outputparams.C - add par_begin, par_end, dryrun
* src/insets/insetgraphics.C - add dryrun mode of file conversion
* lib/ui/stdmenus.ui - add view-source menu item under view
* Add view-source dialog, add
src/frontends/qt2/QViewSourceDialog.h, QViewSource.C, QViewSource.h, QViewSourceDialog.C
src/frontends/qt2/ui/QViewSourceDialogBase.ui
src/frontends/controllers/ControlViewSource.h ControlViewSource.C
modify
src/frontends/qt2/Makefile.dialogs, Makefile.am, Dialogs.C,
src/frontends/controllers/Makefile.am, po.POTFILES.in
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13610 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-09 02:48:54 +00:00
|
|
|
|
BOOST_ASSERT(runparams.par_begin <= runparams.par_end);
|
|
|
|
|
// if only part of the paragraphs will be outputed
|
|
|
|
|
if (runparams.par_begin != runparams.par_end) {
|
|
|
|
|
par = boost::next(paragraphs.begin(), runparams.par_begin);
|
|
|
|
|
pend = boost::next(paragraphs.begin(), runparams.par_end);
|
|
|
|
|
// runparams will be passed to nested paragraphs, so
|
|
|
|
|
// we have to reset the range parameters.
|
|
|
|
|
const_cast<OutputParams&>(runparams).par_begin = 0;
|
|
|
|
|
const_cast<OutputParams&>(runparams).par_end = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2004-10-24 00:02:39 +00:00
|
|
|
|
while (par != pend) {
|
|
|
|
|
LyXLayout_ptr const & style = par->layout();
|
view-source feature, from Bo Peng <ben.bob@gmail.com>
* src/buffer.h buffer.C - getSourceCode()
* src/lyxfunc.C - open view-source dialog
* src/text3.C - change LFUN_MOUSE_RELEASE
* src/output_linuxdoc.C, src/output_docbook.C, src/output_latex.C
- intercept output
* src/outputparams.h, outputparams.C - add par_begin, par_end, dryrun
* src/insets/insetgraphics.C - add dryrun mode of file conversion
* lib/ui/stdmenus.ui - add view-source menu item under view
* Add view-source dialog, add
src/frontends/qt2/QViewSourceDialog.h, QViewSource.C, QViewSource.h, QViewSourceDialog.C
src/frontends/qt2/ui/QViewSourceDialogBase.ui
src/frontends/controllers/ControlViewSource.h ControlViewSource.C
modify
src/frontends/qt2/Makefile.dialogs, Makefile.am, Dialogs.C,
src/frontends/controllers/Makefile.am, po.POTFILES.in
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13610 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-09 02:48:54 +00:00
|
|
|
|
ParagraphList::const_iterator lastpar = par;
|
2004-10-24 00:02:39 +00:00
|
|
|
|
ParagraphList::const_iterator send;
|
|
|
|
|
|
|
|
|
|
switch (style->latextype) {
|
|
|
|
|
case LATEX_COMMAND: {
|
|
|
|
|
send = searchCommand(par, pend);
|
|
|
|
|
par = makeCommand(buf, os, runparams, paragraphs, par,send);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case LATEX_ENVIRONMENT:
|
|
|
|
|
case LATEX_ITEM_ENVIRONMENT: {
|
|
|
|
|
send = searchEnvironment(par, pend);
|
|
|
|
|
par = makeEnvironment(buf, os, runparams, paragraphs, par,send);
|
|
|
|
|
break;
|
2003-11-05 12:06:20 +00:00
|
|
|
|
}
|
2004-10-24 00:02:39 +00:00
|
|
|
|
case LATEX_PARAGRAPH:
|
|
|
|
|
send = searchParagraph(par, pend);
|
|
|
|
|
par = makeParagraph(buf, os, runparams, paragraphs, par,send);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
view-source feature, from Bo Peng <ben.bob@gmail.com>
* src/buffer.h buffer.C - getSourceCode()
* src/lyxfunc.C - open view-source dialog
* src/text3.C - change LFUN_MOUSE_RELEASE
* src/output_linuxdoc.C, src/output_docbook.C, src/output_latex.C
- intercept output
* src/outputparams.h, outputparams.C - add par_begin, par_end, dryrun
* src/insets/insetgraphics.C - add dryrun mode of file conversion
* lib/ui/stdmenus.ui - add view-source menu item under view
* Add view-source dialog, add
src/frontends/qt2/QViewSourceDialog.h, QViewSource.C, QViewSource.h, QViewSourceDialog.C
src/frontends/qt2/ui/QViewSourceDialogBase.ui
src/frontends/controllers/ControlViewSource.h ControlViewSource.C
modify
src/frontends/qt2/Makefile.dialogs, Makefile.am, Dialogs.C,
src/frontends/controllers/Makefile.am, po.POTFILES.in
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13610 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-09 02:48:54 +00:00
|
|
|
|
// makeEnvironment may process more than one paragraphs and bypass pend
|
|
|
|
|
if (std::distance(lastpar, par) >= std::distance(lastpar, pend))
|
|
|
|
|
break;
|
2004-10-24 00:02:39 +00:00
|
|
|
|
}
|
2003-11-05 12:06:20 +00:00
|
|
|
|
}
|