On Wednesday 27 December 2006 15:56, Jean-Marc Lasgouttes wrote:
> * These ones should probably be applied now:
> 2476 fixedintrunk, patch Copied ERT inset produces wrong language
I put this in since it is trivial.
> 2868 fixedintrunk, patch Vector graphics should be converted to pdf for
> pdflatex e...
That would look like the attached (untested). If that is OK I'll test it and
put it in.
> 3019 patch Undo crash with nested font changes in math
>
> * This one should be applied too, but I believe the in_ert variable is
> useless. 2978 fixedintrunk, patch inset-dissolve does not reset
> latex
> language
I read your comment on bugzilla, but did not find the time to look after it.
I'll remove this variable and put the fix in.
> * I am preparing a patch for this one.
> 2908 crash LyX 1.4.3 crashes when typing superscripts
>
> * I am not sure of the status of these:
> 2795 regression Mathed doesn't display cyrillic characters properly
> 2921 dataloss Radicand is lost when it consists of more than one
> character
>
> * could be postponed but should not be lost
> 2840 patch Save All modified files
> 2876 patch Mark modified files in View menu
>
> * Some need more thought, probably postponed.
> 2445 Do not decrease environment depth when parent is not enum...
> 2841 paragraph nested within list item becomes separate item
> 2851 "Accept all changes" hogs CPU without returning.
> 2929 Include Arabic article layout file to LyX
> 2946 patch In LyX/Mac in non-english locale, some menus are wrong
I would only fix these bugs in 1.4.x if they are fixed in trunk, and a
backport is easy.
Georg
Index: src/insets/insetgraphics.C
===================================================================
--- src/insets/insetgraphics.C (Revision 16404)
+++ src/insets/insetgraphics.C (Arbeitskopie)
@@ -135,11 +135,12 @@
// Are we using latex or pdflatex?
if (runparams.flavor == OutputParams::PDFLATEX) {
lyxerr[Debug::GRAPHICS] << "findTargetFormat: PDF mode" << endl;
- // Convert postscript to pdf
- if (format == "eps" || format == "ps")
+ Format const * const f = formats.getFormat(format);
+ // Convert vector graphics to pdf
+ if (f && f->vectorFormat())
return "pdf";
// pdflatex can use jpeg, png and pdf directly
- if (format == "jpg" || format == "pdf")
+ if (format == "jpg")
return format;
// Convert everything else to png
return "png";
Index: src/format.C
===================================================================
--- src/format.C (Revision 16404)
+++ src/format.C (Arbeitskopie)
@@ -93,8 +93,10 @@
}
Format::Format(string const & n, string const & e, string const & p,
- string const & s, string const & v, string const & ed)
- : name_(n), extension_(e), prettyname_(p), shortcut_(s), viewer_(v), editor_(ed)
+ string const & s, string const & v, string const & ed,
+ int flags)
+ : name_(n), extension_(e), prettyname_(p), shortcut_(s), viewer_(v),
+ editor_(ed), flags_(flags)
{}
@@ -208,22 +210,25 @@
void Formats::add(string const & name)
{
if (!getFormat(name))
- add(name, name, name, string(), string(), string());
+ add(name, name, name, string(), string(), string(),
+ Format::none);
}
void Formats::add(string const & name, string const & extension,
string const & prettyname, string const & shortcut,
- string const & viewer, string const & editor)
+ string const & viewer, string const & editor,
+ int flags)
{
FormatList::iterator it =
find_if(formatlist.begin(), formatlist.end(),
FormatNamesEqual(name));
if (it == formatlist.end())
formatlist.push_back(Format(name, extension, prettyname,
- shortcut, viewer, editor));
+ shortcut, viewer, editor, flags));
else
- *it = Format(name, extension, prettyname, shortcut, viewer, editor);
+ *it = Format(name, extension, prettyname, shortcut, viewer,
+ editor, flags);
}
Index: src/frontends/qt2/QPrefsDialog.C
===================================================================
--- src/frontends/qt2/QPrefsDialog.C (Revision 16404)
+++ src/frontends/qt2/QPrefsDialog.C (Arbeitskopie)
@@ -187,6 +187,7 @@
connect(fileformatsModule->extensionED, SIGNAL(textChanged(const QString&)), this, SLOT(fileformat_changed()));
connect(fileformatsModule->viewerED, SIGNAL(textChanged(const QString&)), this, SLOT(fileformat_changed()));
connect(fileformatsModule->editorED, SIGNAL(textChanged(const QString&)), this, SLOT(fileformat_changed()));
+ connect(fileformatsModule->vectorCB, SIGNAL(toggled(bool)), this, SLOT(fileformat_changed()));
connect(convertersModule->converterNewPB, SIGNAL(clicked()), this, SLOT(new_converter()));
connect(convertersModule->converterRemovePB, SIGNAL(clicked()), this, SLOT(remove_converter()));
@@ -727,6 +728,7 @@
fileformatsModule->shortcutED->setText(toqstr(f.shortcut()));
fileformatsModule->viewerED->setText(toqstr(f.viewer()));
fileformatsModule->editorED->setText(toqstr(f.editor()));
+ fileformatsModule->vectorCB->setChecked(f.vectorFormat());
fileformatsModule->formatRemovePB->setEnabled(
!form_->converters().formatIsUsed(f.name()));
@@ -768,16 +770,18 @@
string const old_extension(f.extension());
string const old_viewer(f.viewer());
string const old_editor(f.editor());
+ bool const old_vector(f.vectorFormat());
string const new_pretty(fromqstr(gui_name));
string const new_shortcut(fromqstr(fileformatsModule->shortcutED->text()));
string const new_extension(fromqstr(fileformatsModule->extensionED->text()));
string const new_viewer(fromqstr(fileformatsModule->viewerED->text()));
string const new_editor(fromqstr(fileformatsModule->editorED->text()));
+ bool const new_vector(fileformatsModule->vectorCB->isChecked());
bool modified = ((old_pretty != new_pretty) || (old_shortcut != new_shortcut)
|| (old_extension != new_extension) || (old_viewer != new_viewer)
- || (old_editor != new_editor));
+ || old_editor != new_editor || old_vector != new_vector);
fileformatsModule->formatModifyPB->setEnabled(
valid && known && modified && !known_otherwise);
@@ -794,8 +798,12 @@
string const shortcut = fromqstr(fileformatsModule->shortcutED->text());
string const viewer = fromqstr(fileformatsModule->viewerED->text());
string const editor = fromqstr(fileformatsModule->editorED->text());
+ int flags = Format::none;
+ if (fileformatsModule->vectorCB->isChecked())
+ flags |= Format::vector;
- form_->formats().add(name, extension, prettyname, shortcut, viewer, editor);
+ form_->formats().add(name, extension, prettyname, shortcut, viewer,
+ editor, flags);
form_->formats().sort();
updateFormats();
fileformatsModule->formatsLB->setCurrentItem(form_->formats().getNumber(name));
@@ -823,8 +831,12 @@
string const shortcut = fromqstr(fileformatsModule->shortcutED->text());
string const viewer = fromqstr(fileformatsModule->viewerED->text());
string const editor = fromqstr(fileformatsModule->editorED->text());
+ int flags = Format::none;
+ if (fileformatsModule->vectorCB->isChecked())
+ flags |= Format::vector;
- form_->formats().add(name, extension, prettyname, shortcut, viewer, editor);
+ form_->formats().add(name, extension, prettyname, shortcut, viewer,
+ editor, flags);
form_->formats().sort();
fileformatsModule->formatsLB->setUpdatesEnabled(false);
Index: src/frontends/qt2/ui/QPrefFileformatsModule.ui
===================================================================
--- src/frontends/qt2/ui/QPrefFileformatsModule.ui (Revision 16404)
+++ src/frontends/qt2/ui/QPrefFileformatsModule.ui (Arbeitskopie)
@@ -59,6 +59,21 @@
<cstring>editorED</cstring>
</property>
</widget>
+ <widget row="7" column="1" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>vectorCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Vector graphi&cs format</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Tell whether this format can contain vector graphics.</string>
+ </property>
+ </widget>
<widget row="2" column="1" >
<class>QLineEdit</class>
<property stdset="1">
@@ -402,5 +417,6 @@
<tabstop>extensionED</tabstop>
<tabstop>viewerED</tabstop>
<tabstop>editorED</tabstop>
+ <tabstop>vectorCB</tabstop>
</tabstops>
</UI>
Index: src/format.h
===================================================================
--- src/format.h (Revision 16404)
+++ src/format.h (Arbeitskopie)
@@ -19,9 +19,16 @@
class Format {
public:
+ /// Flags for some format properties
+ enum Flags {
+ none = 0,
+ /// Set if this format can contain vector graphics.
+ vector = 1,
+ };
///
Format(std::string const & n, std::string const & e, std::string const & p,
- std::string const & s, std::string const & v, std::string const & ed);
+ std::string const & s, std::string const & v, std::string const & ed,
+ int);
///
bool dummy() const;
///
@@ -60,6 +67,10 @@
void setEditor(std::string const & v) {
editor_ = v;
}
+ ///
+ bool vectorFormat() const {
+ return flags_ & vector;
+ }
private:
std::string name_;
///
@@ -72,11 +83,14 @@
std::string viewer_;
///
std::string editor_;
+ ///
+ int flags_;
};
bool operator<(Format const & a, Format const & b);
+
///
class Formats {
public:
@@ -107,7 +121,8 @@
///
void add(std::string const & name, std::string const & extension,
std::string const & prettyname, std::string const & shortcut,
- std::string const & viewer, std::string const & editor);
+ std::string const & viewer, std::string const & editor,
+ int flags);
///
void erase(std::string const & name);
///
Index: src/lyxrc.C
===================================================================
--- src/lyxrc.C (Revision 16404)
+++ src/lyxrc.C (Arbeitskopie)
@@ -1053,6 +1053,7 @@
shortcut = lexrc.getString();
}
string viewer, editor;
+ string flags;
// Hack to ensure compatibility with versions older
// than 1.4.0
int le = lexrc.lex();
@@ -1061,6 +1062,15 @@
if (le == LyXLex::LEX_DATA) {
if (lexrc.next()) {
editor = lexrc.getString();
+ le = lexrc.lex();
+ if (le != LyXLex::LEX_FEOF &&
+ le != LyXLex::LEX_UNDEF) {
+ flags = lexrc.getString();
+ if (le != LyXLex::LEX_DATA) {
+ lexrc.pushToken(flags);
+ flags.erase();
+ }
+ }
}
} else {
// We have got a known token.
@@ -1071,6 +1081,17 @@
viewer.erase();
}
}
+ int flgs = Format::none;
+ while (!flags.empty()) {
+ string flag;
+ flags = lyx::support::split(flags, flag, ',');
+ if (flag == "vector")
+ flgs |= Format::vector;
+ else
+ lyxerr << "Ignoring unknown flag `"
+ << flag << "' for format `"
+ << format << "'." << endl;
+ }
if (prettyname.empty()) {
if (converters.formatIsUsed(format)) {
lyxerr << "Can't delete format "
@@ -1080,7 +1101,7 @@
}
} else {
formats.add(format, extension, prettyname,
- shortcut, viewer, editor);
+ shortcut, viewer, editor, flgs);
}
break;
}
@@ -1960,13 +1981,20 @@
format->prettyname() != cit->prettyname() ||
format->shortcut() != cit->shortcut() ||
format->viewer() != cit->viewer() ||
- format->editor() != cit->editor())
+ format->editor() != cit->editor() ||
+ format->vectorFormat() != cit->vectorFormat()) {
os << "\\format \"" << cit->name() << "\" \""
<< cit->extension() << "\" \""
<< cit->prettyname() << "\" \""
<< cit->shortcut() << "\" \""
<< cit->viewer() << "\" \""
- << cit->editor() << "\"\n";
+ << cit->editor() << "\" \"";
+ std::vector<string> flags;
+ if (cit->vectorFormat())
+ flags.push_back("vector");
+ os << lyx::support::getStringFromVector(flags);
+ os << "\"\n";
+ }
}
// Look for deleted formats
Index: lib/doc/Customization.lyx
===================================================================
--- lib/doc/Customization.lyx (Revision 16404)
+++ lib/doc/Customization.lyx (Arbeitskopie)
@@ -1,4 +1,4 @@
-#LyX 1.4.3svn created this file. For more info see http://www.lyx.org/
+#LyX 1.4.3 created this file. For more info see http://www.lyx.org/
\lyxformat 245
\begin_document
\begin_header
@@ -1791,8 +1791,9 @@
references:Conversion
\family default
dialog.
- This does currently only work in the Windows� port of LyX, but it is planned
- to implement this feature on all other ports that can support it, too.
+ This does currently only work in the Windows� and Mac OS X ports of LyX,
+ but it is planned to implement this feature on all other ports that can
+ support it, too.
\end_layout
\begin_layout Standard
@@ -1848,6 +1849,68 @@
directory and may modify it in the process.
\end_layout
+\begin_layout Standard
+Sometimes LyX needs to know a bit more about the properties of a format.
+ These bits can be specified with flags.
+ Currently there is only one flag, but more will be added in the future:
+\end_layout
+
+\begin_layout Standard
+The
+\family typewriter
+vector
+\family default
+ flag tells LyX whether a format can contain vector graphics.
+ This information is used to determine the target format of included graphics
+ for
+\family typewriter
+pdflatex
+\family default
+ export.
+ Included graphics may need to be converted to either
+\family typewriter
+pdf
+\family default
+,
+\family typewriter
+png
+\family default
+ or
+\family typewriter
+jpg
+\family default
+, since
+\family typewriter
+pdflatex
+\family default
+ can not handle other image formats.
+ If an included graphic is not already in
+\family typewriter
+pdf
+\family default
+,
+\family typewriter
+png
+\family default
+ or
+\family typewriter
+jpg
+\family default
+ format it is converted to
+\family typewriter
+pdf
+\family default
+ if the
+\family typewriter
+vector
+\family default
+ flag of the format is set, and otherwise to
+\family typewriter
+png
+\family default
+.
+\end_layout
+
\begin_layout Section
BibTeX and makeindex
\end_layout
Index: lib/configure.py
===================================================================
--- lib/configure.py (Revision 16404)
+++ lib/configure.py (Arbeitskopie)
@@ -240,13 +240,13 @@
def checkFormatEntries(dtl_tools):
''' Check all formats (\Format entries) '''
checkViewer('a Tgif viewer and editor', ['tgif'],
- rc_entry = [r'\Format tgif obj Tgif "" "%%" "%%"'])
+ rc_entry = [r'\Format tgif obj Tgif "" "%%" "%%" "vector"'])
#
checkViewer('a FIG viewer and editor', ['xfig'],
- rc_entry = [r'\Format fig fig FIG "" "%%" "%%"'])
+ rc_entry = [r'\Format fig fig FIG "" "%%" "%%" "vector"'])
#
checkViewer('a Grace viewer and editor', ['xmgrace'],
- rc_entry = [r'\Format agr agr Grace "" "%%" "%%"'])
+ rc_entry = [r'\Format agr agr Grace "" "%%" "%%" "vector"'])
#
checkViewer('a FEN viewer and editor', ['xboard -lpf $$i -mode EditPosition'],
rc_entry = [r'\Format fen fen FEN "" "%%" "%%"'])
@@ -284,38 +284,38 @@
#checkProg('a Postscript interpreter', ['gs'],
# rc_entry = [ r'\ps_command "%%"' ])
checkViewer('a Postscript previewer', ['gv', 'ghostview -swap', 'kghostview'],
- rc_entry = [r'''\Format eps eps EPS "" "%%" ""
-\Format ps ps Postscript t "%%" ""'''])
+ rc_entry = [r'''\Format eps eps EPS "" "%%" "" "vector"
+\Format ps ps Postscript t "%%" "" "vector"'''])
#
checkViewer('a PDF previewer', ['acrobat', 'acroread', 'gv', 'ghostview', \
'xpdf', 'kpdf', 'kghostview'],
- rc_entry = [r'''\Format pdf pdf "PDF (ps2pdf)" P "%%" ""
-\Format pdf2 pdf "PDF (pdflatex)" F "%%" ""
-\Format pdf3 pdf "PDF (dvipdfm)" m "%%" ""'''])
+ rc_entry = [r'''\Format pdf pdf "PDF (ps2pdf)" P "%%" "" "vector"
+\Format pdf2 pdf "PDF (pdflatex)" F "%%" "" "vector"
+\Format pdf3 pdf "PDF (dvipdfm)" m "%%" "" "vector"'''])
#
checkViewer('a DVI previewer', ['xdvi', 'kdvi'],
- rc_entry = [r'\Format dvi dvi DVI D "%%" ""'])
+ rc_entry = [r'\Format dvi dvi DVI D "%%" "" "vector"'])
if dtl_tools:
# Windows only: DraftDVI
- addToRC(r'\Format dvi2 dvi DraftDVI "" "" ""')
+ addToRC(r'\Format dvi2 dvi DraftDVI "" "" "vector"')
#
checkViewer('a HTML previewer', ['mozilla file://$$p$$i', 'netscape'],
rc_entry = [r'\Format html html HTML H "%%" ""'])
#
# entried that do not need checkProg
- addToRC(r'''\Format date "" "date command" "" "" ""
-\Format fax "" Fax "" "" ""
-\Format lyx lyx LyX "" "" ""
-\Format lyx13x lyx13 "LyX 1.3.x" "" "" ""
-\Format lyxpreview lyxpreview "LyX Preview" "" "" ""
-\Format pdftex pdftex_t PDFTEX "" "" ""
-\Format program "" Program "" "" ""
-\Format pstex pstex_t PSTEX "" "" ""
-\Format rtf rtf "Rich Text Format" "" "" ""
-\Format sxw sxw "OpenOffice.Org Writer" O "" ""
-\Format wmf wmf "Windows Meta File" "" "" ""
-\Format word doc "MS Word" W "" ""
-\Format wordhtml html "MS Word (HTML)" "" "" ""
+ addToRC(r'''\Format date "" "date command" "" "" "" ""
+\Format fax "" Fax "" "" "" ""
+\Format lyx lyx LyX "" "" "" ""
+\Format lyx13x lyx13 "LyX 1.3.x" "" "" "" ""
+\Format lyxpreview lyxpreview "LyX Preview" "" "" "" ""
+\Format pdftex pdftex_t PDFTEX "" "" "" ""
+\Format program "" Program "" "" "" ""
+\Format pstex pstex_t PSTEX "" "" "" ""
+\Format rtf rtf "Rich Text Format" "" "" "" "vector"
+\Format sxw sxw "OpenOffice.Org Writer" O "" "" "vector"
+\Format wmf wmf "Windows Meta File" "" "" "" "vector"
+\Format word doc "MS Word" W "" "" "vector"
+\Format wordhtml html "MS Word (HTML)" "" "" "" ""
''')