From: Lars Gullik Bjønnes Date: Sun, 10 Dec 2000 05:20:36 +0000 (+0000) Subject: several small patches X-Git-Tag: 1.6.10~21775 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4abaf6ab919465346a731e83712df7c766551c80;p=lyx.git several small patches git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1271 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index dac8695a65..af384fb035 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2000-12-09 Dekel Tsur + + * src/converter.C (Move): New method. Used to move file or files + from temp dir to the output dir. (this fixes the bug that + exporting linuxdoc/docbook document to html would not move all + html file from temp directory). + + * src/support/filetools.C (DirList): Fixed. + + * src/lstrings.C (prefixIs): Fixed (how nobody noticed it before??). + +2000-12-08 Dekel Tsur + + * src/converter.C (Add): Remove $$i when setting latex_command. + + * src/text.C (IsBoundary): Return false when pos = 0. + +2000-12-08 Dekel Tsur + + * lib/kbd/hebrew.kmap: Add Hebrew points (nikud). + +2000-12-07 Angus Leeming + + * src/frontends/xforms/FormDocument.C (checkMarginValues): you don't + need to empty the fields to turn off use of the geometry package! + 2000-12-07 Angus Leeming * src/lyxparagraph.h, src/paragraph.C (CopyIntoMinibuffer): pass a diff --git a/lib/kbd/hebrew.kmap b/lib/kbd/hebrew.kmap index c0f1f332f0..281f25465f 100644 --- a/lib/kbd/hebrew.kmap +++ b/lib/kbd/hebrew.kmap @@ -1,7 +1,7 @@ # # Hebrew keyboard definition for LyX # -# (C)2000 by Dekel Tsur, dekel@math.tau.ac.il +# (C)2000 by Dekel Tsur, dekelts@tau.ac.il # \kmap ` ; \kmap q / @@ -67,3 +67,22 @@ \kmap B ð \kmap N î \kmap M ö + +# Hebrew points (nikud) +\kmap E È # Shift+Qof = Qamats +\kmap R Ì # Shift+Resh = Shuruq (= Dagesh) +\kmap U É # Shift+Vav = Holam +\kmap P Ç # Shift+Pe = Patah + +\kmap A À # Shift+Shin = Sheva +\kmap S Ì # Shift+Delat = Dagesh (= Shuruq) +\kmap G Ò # Shin dot +\kmap H Ñ # Sin dot +\kmap J Ä # Shift+Het = Hiriq + +\kmap X Æ # Shift+Samekh = Segol +\kmap C Ë # Shift+Bet = Qubuts +\kmap V Á # Hataf segol +\kmap B Â # Hataf patah +\kmap N Ã # Hataf qamats +\kmap M Å # Shift+Tsadi = Tsere diff --git a/po/POTFILES.in b/po/POTFILES.in index 59c622c560..6bbe76c923 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -53,35 +53,35 @@ src/frontends/kde/refdlg.C src/frontends/kde/tocdlg.C src/frontends/kde/urldlg.C src/frontends/xforms/FormBase.h -src/frontends/xforms/FormCitation.C src/frontends/xforms/form_citation.C -src/frontends/xforms/FormCopyright.C +src/frontends/xforms/FormCitation.C src/frontends/xforms/form_copyright.C -src/frontends/xforms/FormDocument.C +src/frontends/xforms/FormCopyright.C src/frontends/xforms/form_document.C -src/frontends/xforms/FormError.C +src/frontends/xforms/FormDocument.C src/frontends/xforms/form_error.C -src/frontends/xforms/FormGraphics.C +src/frontends/xforms/FormError.C src/frontends/xforms/form_graphics.C -src/frontends/xforms/FormIndex.C +src/frontends/xforms/FormGraphics.C src/frontends/xforms/form_index.C +src/frontends/xforms/FormIndex.C src/frontends/xforms/FormInset.h -src/frontends/xforms/FormParagraph.C src/frontends/xforms/form_paragraph.C -src/frontends/xforms/FormPreferences.C +src/frontends/xforms/FormParagraph.C src/frontends/xforms/form_preferences.C -src/frontends/xforms/FormPrint.C +src/frontends/xforms/FormPreferences.C src/frontends/xforms/form_print.C -src/frontends/xforms/FormRef.C +src/frontends/xforms/FormPrint.C src/frontends/xforms/form_ref.C -src/frontends/xforms/FormTabular.C +src/frontends/xforms/FormRef.C src/frontends/xforms/form_tabular.C -src/frontends/xforms/FormTabularCreate.C +src/frontends/xforms/FormTabular.C src/frontends/xforms/form_tabular_create.C -src/frontends/xforms/FormToc.C +src/frontends/xforms/FormTabularCreate.C src/frontends/xforms/form_toc.C -src/frontends/xforms/FormUrl.C +src/frontends/xforms/FormToc.C src/frontends/xforms/form_url.C +src/frontends/xforms/FormUrl.C src/frontends/xforms/input_validators.C src/frontends/xforms/Menubar_pimpl.C src/frontends/xforms/xform_helpers.C diff --git a/src/converter.C b/src/converter.C index 90babcaa0d..23a9fcad77 100644 --- a/src/converter.C +++ b/src/converter.C @@ -314,7 +314,7 @@ void Converters::Add(string const & from, string const & to, converter.ReadFlags(); if (converter.latex && (latex_command.empty() || to == "dvi")) - latex_command = command; + latex_command = subst(command, token_from, ""); // If we have both latex & pdflatex, we set latex_command to latex. // The latex_command is used to update the .aux file when running // a converter that uses it. @@ -540,10 +540,7 @@ bool Converters::Convert(Buffer const * buffer, formats.Extension(to_format)); if (from_format == to_format) - if (from_file != to_file) - return lyx::rename(from_file, to_file); - else - return true; + return Move(from_file, to_file, false); EdgePath edgepath = GetPath(from_format, to_format); if (edgepath.empty()) { @@ -665,20 +662,43 @@ bool Converters::Convert(Buffer const * buffer, return false; } } - } else if (outfile != to_file) { - bool moved = (conv.latex) - ? lyx::copy(outfile, to_file) - : lyx::rename(outfile, to_file); - if (!moved) { - WriteAlert(_("Error while trying to move file:"), - outfile, _("to ") + to_file); - return false; - } - } - - return true; + return true; + } else + return Move(outfile, to_file, conv.latex); } +// If from = /path/file.ext and to = /path2/file2.ext2 then this method +// moves each /path/file*.ext file to /path2/file2*.ext2' +bool Converters::Move(string const & from, string const & to, bool copy) +{ + if (from == to) + return true; + + bool no_errors = true; + string path = OnlyPath(from); + string base = OnlyFilename(ChangeExtension(from, "")); + string to_base = ChangeExtension(to, ""); + string to_extension = GetExtension(to); + + vector files = DirList(OnlyPath(from), GetExtension(from)); + for (vector::const_iterator it = files.begin(); + it != files.end(); ++it) + if (prefixIs(*it, base)) { + string from2 = path + *it; + string to2 = to_base + (*it).substr(base.length()); + to2 = ChangeExtension(to2, to_extension); + lyxerr << "moving " << from2 << " to " << to2 << endl; + bool moved = (copy) + ? lyx::copy(from2, to2) + : lyx::rename(from2, to2); + if (!moved && no_errors) { + WriteAlert(_("Error while trying to move file:"), + from2, _("to ") + to2); + no_errors = false; + } + } + return no_errors; +} bool Converters::Convert(Buffer const * buffer, string const & from_file, string const & to_file_base, @@ -690,6 +710,7 @@ bool Converters::Convert(Buffer const * buffer, } + void Converters::BuildGraph() { vertices = vector(formats.size()); @@ -697,8 +718,8 @@ void Converters::BuildGraph() for (ConverterList::iterator it = converterlist.begin(); it != converterlist.end(); ++it) { - int s = formats.GetNumber(it->from); - int t = formats.GetNumber(it->to); + int const s = formats.GetNumber(it->from); + int const t = formats.GetNumber(it->to); vertices[t].in_vertices.push_back(s); vertices[s].out_vertices.push_back(t); vertices[s].out_edges.push_back(it - converterlist.begin()); diff --git a/src/converter.h b/src/converter.h index 1b8b85556e..013370c393 100644 --- a/src/converter.h +++ b/src/converter.h @@ -258,6 +258,8 @@ private: std::queue Q; /// int BFS_init(string const & start, bool clear_visited = true); + /// + bool Move(string const & from, string const & to, bool copy); }; extern Formats formats; diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 6f28e14685..b144834f81 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -833,6 +833,7 @@ void FormDocument::checkReadOnly() void FormDocument::checkMarginValues() { +#if 0 int const allEmpty = (!strlen(fl_get_input(paper_->input_top_margin)) && !strlen(fl_get_input(paper_->input_bottom_margin)) && !strlen(fl_get_input(paper_->input_left_margin)) && @@ -844,8 +845,10 @@ void FormDocument::checkMarginValues() !strlen(fl_get_input(paper_->input_custom_height))); if (!allEmpty) fl_set_button(paper_->push_use_geometry, 1); +#endif } + bool FormDocument::CheckDocumentInput(FL_OBJECT * ob, long) { string str; diff --git a/src/support/filetools.C b/src/support/filetools.C index 0c5393e518..f4480d3b6c 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -209,14 +209,14 @@ vector const DirList(string const & dir, string const & ext) { // This is a non-error checking C/system implementation string extension(ext); - if (extension[0] != '.') + if (!extension.empty() && extension[0] != '.') extension.insert(0, "."); vector dirlist; DIR * dirp = ::opendir(dir.c_str()); dirent * dire; while ((dire = ::readdir(dirp))) { string const fil = dire->d_name; - if (prefixIs(fil, extension)) { + if (suffixIs(fil, extension)) { dirlist.push_back(fil); } } diff --git a/src/support/lstrings.C b/src/support/lstrings.C index 74fc4fee8c..c270def0ce 100644 --- a/src/support/lstrings.C +++ b/src/support/lstrings.C @@ -258,7 +258,7 @@ bool prefixIs(string const & a, string const & pre) string::size_type const prelen = pre.length(); string::size_type const alen = a.length(); - if (prelen < alen || a.empty()) + if (prelen > alen || a.empty()) return false; else { #if !defined(USE_INCLUDED_STRING) && !defined(STD_STRING_IS_GOOD) diff --git a/src/text.C b/src/text.C index dd45c0c0b7..d915aac728 100644 --- a/src/text.C +++ b/src/text.C @@ -344,11 +344,11 @@ void LyXText::ComputeBidiTables(Buffer const * buf, Row * row) const bool LyXText::IsBoundary(Buffer const * buf, LyXParagraph * par, LyXParagraph::size_type pos) const { - if (!lyxrc.rtl_support) - return false; // This is just for speedup + if (!lyxrc.rtl_support || pos == 0) + return false; if (!bidi_InRange(pos - 1)) { - lyxerr << "LyXText::IsBoundary This shouldn't happen\n"; + lyxerr << "LyXText::IsBoundary This shouldn't happen." << endl; return false; } diff --git a/src/vc-backend.C b/src/vc-backend.C index 81efc9f6ce..7b042baf46 100644 --- a/src/vc-backend.C +++ b/src/vc-backend.C @@ -26,7 +26,7 @@ int VCS::doVCCommand(string const & cmd, string const & path) lyxerr[Debug::LYXVC] << "doVCCommand: " << cmd << endl; Systemcalls one; Path p(path); - int ret = one.startscript(Systemcalls::System, cmd); + int const ret = one.startscript(Systemcalls::System, cmd); return ret; } @@ -205,12 +205,11 @@ string const CVS::find_file(string const & file) { // First we look for the CVS/Entries in the same dir // where we have file. - string dir = OnlyPath(file); - string tmpf = "/" + OnlyFilename(file) + "/"; - dir += "/CVS/Entries"; + string const dir = OnlyPath(file) + "/CVS/Entries"; + string const tmpf = "/" + OnlyFilename(file) + "/"; lyxerr[Debug::LYXVC] << "LyXVC: checking in `" << dir << "' for `" << tmpf << "'" << endl; - FileInfo f(dir); + FileInfo const f(dir); if (f.readable()) { // Ok we are at least in a CVS dir. Parse the CVS/Entries // and see if we can find this file. We do a fast and