mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
new version of the SpaceLess function
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@278 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3ef1eca9c2
commit
a3a55117e1
@ -1,5 +1,9 @@
|
|||||||
1999-11-02 Lars Gullik Bjønnes <larsbj@lyx.org>
|
1999-11-02 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||||
|
|
||||||
|
* src/support/filetools.C (SpaceLess): new version of the
|
||||||
|
SpaceLess functions. What problems does this one give? Please
|
||||||
|
report.
|
||||||
|
|
||||||
* images/banner_bw.xbm: made the arrays unsigned char *
|
* images/banner_bw.xbm: made the arrays unsigned char *
|
||||||
|
|
||||||
1999-11-02 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
1999-11-02 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||||
|
@ -561,7 +561,7 @@ int MakeDVIOutput(Buffer *buffer)
|
|||||||
/* wait == true means wait for termination */
|
/* wait == true means wait for termination */
|
||||||
// The bool should be placed last on the argument line. (Lgb)
|
// The bool should be placed last on the argument line. (Lgb)
|
||||||
// Returns false if we fail.
|
// Returns false if we fail.
|
||||||
bool RunScript(Buffer *buffer, bool wait,
|
bool RunScript(Buffer * buffer, bool wait,
|
||||||
string const & command, string const & orgname = string(),
|
string const & command, string const & orgname = string(),
|
||||||
bool need_shell=true)
|
bool need_shell=true)
|
||||||
{
|
{
|
||||||
@ -828,7 +828,7 @@ bool MenuPreview(Buffer *buffer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MenuMakeLaTeX(Buffer *buffer)
|
void MenuMakeLaTeX(Buffer * buffer)
|
||||||
{
|
{
|
||||||
if (buffer->text) {
|
if (buffer->text) {
|
||||||
// Get LaTeX-Filename
|
// Get LaTeX-Filename
|
||||||
|
@ -74,14 +74,15 @@ string SpaceLess(string const & file)
|
|||||||
|
|
||||||
for (string::size_type i = 0; i < name.length(); ++i) {
|
for (string::size_type i = 0; i < name.length(); ++i) {
|
||||||
name[i] &= 0x7f; // set 8th bit to 0
|
name[i] &= 0x7f; // set 8th bit to 0
|
||||||
if (!isalnum(name[i]) && name[i] != '.')
|
if (!isgraph(name[i])) name[i] = '_'; // get rid of cntrl chars
|
||||||
name[i] = '_';
|
};
|
||||||
|
// ok so we scan through the string twice, but who cares.
|
||||||
|
string change("/");
|
||||||
|
string::size_type pos = 0;
|
||||||
|
while ((pos = name.find_first_of(change, pos)) != string::npos) {
|
||||||
|
name[pos] = '-';
|
||||||
}
|
}
|
||||||
string temp = AddName(path, name);
|
string temp = AddName(path, name);
|
||||||
// Replace spaces with underscores, also in directory
|
|
||||||
// No!!! I checked it that it is not necessary.
|
|
||||||
// temp = subst(temp, ' ', '_');
|
|
||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user