From b374f06ded019b774fa9e122cf068bb7032f24e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 7 Feb 2000 20:17:03 +0000 Subject: [PATCH] small fixes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@530 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 13 +++++++++++++ src/TextCache.C | 4 ++-- src/TextCache.h | 2 +- src/paragraph.C | 9 +++++---- src/support/filetools.C | 10 ++++------ 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index cac3a5c7d3..500d63fc3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2000-02-07 Lars Gullik Bjønnes + + * src/support/filetools.C (ChangeExtension): patch from Etienne + applied. + + * src/TextCache.C (show): remove const_cast and make second + parameter non-const LyXText *. + + * src/TextCache.h: use non const LyXText in show. + + * src/paragraph.C (SimpleTeXSpecialChars): patch to make urls work + with hebrew. + 2000-02-04 Lars Gullik Bjønnes * src/support/lyxsum.C: rework to be more flexible. diff --git a/src/TextCache.C b/src/TextCache.C index 1b62b691c1..3a2795417f 100644 --- a/src/TextCache.C +++ b/src/TextCache.C @@ -73,10 +73,10 @@ void TextCache::show(ostream & os, string const & str) } -void TextCache::show(ostream & os, LyXText const * lt) +void TextCache::show(ostream & os, LyXText * lt) { show_text st(os); - st(const_cast(lt)); + st(lt); } diff --git a/src/TextCache.h b/src/TextCache.h index 457108540b..256d49bca1 100644 --- a/src/TextCache.h +++ b/src/TextCache.h @@ -122,7 +122,7 @@ public: Uses msg as header for the list. */ void show(ostream & o, string const & msg); /// Gives info on a single LyXText (buffer and width) - static void show(ostream & o, LyXText const *); + static void show(ostream & o, LyXText *); /** Adds a LyXText to the cache iff its buffer is present in bufferlist. */ void add(LyXText *); diff --git a/src/paragraph.C b/src/paragraph.C index 5ddf306f3c..3378476339 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -2923,10 +2923,11 @@ void LyXParagraph::SimpleTeXSpecialChars(string & file, TexRow & texrow, if (inset) { bool close = false; int len = file.length(); - if ( (inset->LyxCode() == Inset::GRAPHICS_CODE - || inset->LyxCode() == Inset::MATH_CODE) - && running_font.getFontDirection() - == LYX_DIR_RIGHT_TO_LEFT) { + if ((inset->LyxCode() == Inset::GRAPHICS_CODE + || inset->LyxCode() == Inset::MATH_CODE + || inset->LyxCode() == Inset::URL_CODE) + && running_font.getFontDirection() + == LYX_DIR_RIGHT_TO_LEFT) { file += "\\L{"; close = true; } diff --git a/src/support/filetools.C b/src/support/filetools.C index 2c816a913c..0c3cd19f24 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -904,12 +904,10 @@ string ChangeExtension(string const & oldname, string const & extension, bool no_path) { string::size_type last_slash = oldname.rfind('/'); - string::size_type last_dot; - if (last_slash != string::npos) - last_dot = oldname.find('.', last_slash); - else - last_dot = oldname.rfind('.'); - + string::size_type last_dot = oldname.rfind('.'); + if (last_dot < last_slash && last_slash != string::npos) + last_dot = string::npos; + string ext; // Make sure the extension starts with a dot if (!extension.empty() && extension[0] != '.') -- 2.39.2