Am Mittwoch, 14. Februar 2007 12:24 schrieb José Matos:

>   But if no better solution is available then the menu solution is the 
least 
> worse. :-)

It would look like the attached patch. I chose one encoding for each of 
chinese, japanese and korean. Did I chose the most commonly used ones? Is 
this OK to go in?


Georg
Index: src/exporter.C
===================================================================
--- src/exporter.C	(Revision 17188)
+++ src/exporter.C	(Arbeitskopie)
@@ -153,27 +153,20 @@ bool Exporter::Export(Buffer * buffer, s
 	runparams.flavor = OutputParams::LATEX;
 	runparams.linelen = lyxrc.plaintext_linelen;
 	vector<string> backends = Backends(*buffer);
-	// FIXME: Without this test export to lyx1[34] would be through
-	// latex -> lyx -> lyx1[34], because the first backend below with a
-	// working conversion path is used. We should replace this test and
-	// the explicit loop below with a method
-	// getShortestPath(vector<string> const & from, string const & to)
-	// which returns the shortest path from one of the formats in 'from'
-	// to 'to'.
-	if ((format == "lyx13x" || format == "lyx14x") &&
-	    !theConverters().getPath("lyx", format).empty())
-		backend_format = "lyx";
-	else if (find(backends.begin(), backends.end(), format) == backends.end()) {
+	if (find(backends.begin(), backends.end(), format) == backends.end()) {
+		// Get shortest path to format
+		Graph::EdgePath path;
 		for (vector<string>::const_iterator it = backends.begin();
 		     it != backends.end(); ++it) {
 			Graph::EdgePath p = theConverters().getPath(*it, format);
-			if (!p.empty()) {
-				runparams.flavor = theConverters().getFlavor(p);
+			if (!p.empty() && (path.empty() || p.size() < path.size())) {
 				backend_format = *it;
-				break;
+				path = p;
 			}
 		}
-		if (backend_format.empty()) {
+		if (!path.empty())
+			runparams.flavor = theConverters().getFlavor(path);
+		else {
 			Alert::error(_("Couldn't export file"),
 				bformat(_("No information for exporting the format %1$s."),
 				   formats.prettyName(format)));
Index: lib/configure.py
===================================================================
--- lib/configure.py	(Revision 17188)
+++ lib/configure.py	(Arbeitskopie)
@@ -301,6 +301,9 @@ def checkFormatEntries(dtl_tools):  
 \Format lyx        lyx     LyX                    "" ""	""	""
 \Format lyx13x     lyx13  "LyX 1.3.x"             "" ""	""	"document"
 \Format lyx14x     lyx14  "LyX 1.4.x"             "" ""	""	"document"
+\Format clyx       cjklyx "CJK LyX (big5)"        "" ""	""	"document"
+\Format jlyx       cjklyx "CJK LyX (euc-jp)"      "" ""	""	"document"
+\Format klyx       cjklyx "CJK LyX (euc-kr)"      "" ""	""	"document"
 \Format lyxpreview lyxpreview "LyX Preview"       "" ""	""	""
 \Format pdftex     pdftex_t PDFTEX                "" ""	""	""
 \Format program    ""      Program                "" ""	""	""
@@ -449,7 +452,7 @@ def checkConverterEntries():
     # FIXME: no rc_entry? comment it out
     # checkProg('Image converter', ['convert $$i $$o'])
     #
-    # Entried that do not need checkProg
+    # Entries that do not need checkProg
     addToRC(r'''\converter lyxpreview ppm        "python -tt $$s/scripts/lyxpreview2bitmap.py"	""
 \converter date       dateout    "python -tt $$s/scripts/date.py %d-%m-%Y > $$o"	""
 \converter docbook    docbook-xml "cp $$i $$o"	"xml"
@@ -458,6 +461,12 @@ def checkConverterEntries():
 \converter fig        pstex      "python -tt $$s/scripts/fig2pstex.py $$i $$o"	""
 \converter lyx        lyx13x     "python -tt $$s/lyx2lyx/lyx2lyx -t 221 $$i > $$o"	""
 \converter lyx        lyx14x     "python -tt $$s/lyx2lyx/lyx2lyx -t 245 $$i > $$o"	""
+\converter lyx        clyx       "python -tt $$s/lyx2lyx/lyx2lyx -c big5 -t 245 $$i > $$o"	""
+\converter lyx        jlyx       "python -tt $$s/lyx2lyx/lyx2lyx -c euc_jp -t 245 $$i > $$o"	""
+\converter lyx        klyx       "python -tt $$s/lyx2lyx/lyx2lyx -c euc_kr -t 245 $$i > $$o"	""
+\converter clyx       lyx        "python -tt $$s/lyx2lyx/lyx2lyx -c big5 $$i > $$o"	""
+\converter jlyx       lyx        "python -tt $$s/lyx2lyx/lyx2lyx -c euc_jp $$i > $$o"	""
+\converter klyx       lyx        "python -tt $$s/lyx2lyx/lyx2lyx -c euc_kr $$i > $$o"	""
 ''')
 
 

Reply via email to