several small patches

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1271 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-12-10 05:20:36 +00:00
parent 7d6a0f9506
commit 4abaf6ab91
10 changed files with 115 additions and 45 deletions

View File

@ -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

View 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 /
@ -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

View 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

View 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());

View 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;

View 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;

View 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);
}
}

View 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)

View 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;
}

View 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