]> git.lyx.org Git - lyx.git/commitdiff
several small patches
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 10 Dec 2000 05:20:36 +0000 (05:20 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 10 Dec 2000 05:20:36 +0000 (05:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1271 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
lib/kbd/hebrew.kmap
po/POTFILES.in
src/converter.C
src/converter.h
src/frontends/xforms/FormDocument.C
src/support/filetools.C
src/support/lstrings.C
src/text.C
src/vc-backend.C

index dac8695a656199af2c690a97674a04d05b338704..af384fb035ddfda8e2ed7a324ea8271068fe2c3f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2000-12-09  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * 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  <dekelts@tau.ac.il>
+
+       * src/converter.C (Add): Remove $$i when setting latex_command.
+
+       * src/text.C (IsBoundary): Return false when pos = 0.
+       
+2000-12-08  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * lib/kbd/hebrew.kmap: Add Hebrew points (nikud).
+
+2000-12-07  Angus Leeming <a.leeming@ic.ac.uk>
+
+       * 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 <a.leeming@ic.ac.uk>
 
        * src/lyxparagraph.h, src/paragraph.C (CopyIntoMinibuffer): pass a
index c0f1f332f08dab012ecc08450c636fee46907a22..281f25465fb333be1f6fadfe1368d2b2f8472445 100644 (file)
@@ -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 /
 \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
index 59c622c5603bf49229119b68e9af317e5922d8d6..6bbe76c9238b543b588a1d074c3a5eb31ac3312f 100644 (file)
@@ -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
index 90babcaa0d66945604b5ea664c2782c8e9e956f1..23a9fcad7770fdd6e066aa84fd12f91813247d27 100644 (file)
@@ -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<string> files = DirList(OnlyPath(from), GetExtension(from));
+       for (vector<string>::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<Vertex>(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());
index 1b8b85556e180047153a322bb55bafdc6aca3e23..013370c3935517471d3d7cb73fc5f269ee4dbc10 100644 (file)
@@ -258,6 +258,8 @@ private:
        std::queue<int> Q;
        ///
        int BFS_init(string const & start, bool clear_visited = true);
+       ///
+       bool Move(string const & from, string const & to, bool copy);
 };
 
 extern Formats formats;
index 6f28e1468506914f497fc573e895e9261b033cd7..b144834f81f986e5e7b8d1a036d0d9f372b05045 100644 (file)
@@ -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;
index 0c5393e518b596993c3c4fbadab899714c75de21..f4480d3b6cf884554de56200626227f84a3f7e89 100644 (file)
@@ -209,14 +209,14 @@ vector<string> 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<string> 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);
                }
        }
index 74fc4fee8cb72d5a5934d3c64b31a90c67a849c5..c270def0cea9f7b80bcea10a7d694bbd871970a3 100644 (file)
@@ -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)
index dd45c0c0b7fb34336bb02bcd787699bc84510ad3..d915aac7280447325cb8f12ab8e540039e70dcc8 100644 (file)
@@ -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;
        }
 
index 81efc9f6ce2a6a7c6e0c085ec47c82d81f6a599e..7b042baf465ccd732ab44a0f4df186d713f0bd46 100644 (file)
@@ -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