bolzano changes

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_1_6@2145 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-06-27 15:03:27 +00:00
parent 58b46f31be
commit 3883c95207
11 changed files with 86 additions and 12 deletions

View File

@ -1,3 +1,23 @@
2001-06-24 The LyX Project <jug@sad.it>
* src/lyxlex_pimpl.C (compare_tags): use compare_ascii_no_case instead
of compare_no_case
* src/support/lstrings.C (compare_ascii_no_case): version of
compare_no_case which only considers case of ascii characters
* src/support/lyxstring.C (replace): a new version of replace(),
to help with compatibility with <sstream> in gcc 2.95.3.
2001-06-24 The LyX Project <Asger>
* src/insets/insettabular.C (getMaxWidth): We cache a mapping from
inset to cell in order to speed this method up.
2001-06-23 The LyX Project <jug@sad.it>
* lib/templates/dinbrief.lyx: remove obsolete \cursor statement
2001-06-18 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lib/tex/cv.cls:

View File

@ -207,9 +207,7 @@ dnl Check the version of g++
2.95.2) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
2.95.*) CXXFLAGS="-g $lyx_opt -fno-exceptions";;
2.96*) CXXFLAGS="-g $lyx_opt -fno-exceptions";;
2.97*) CXXFLAGS="-g $lyx_opt -fvtable-thunks -fno-builtin -ffunction-sections -fdata-sections"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE=1";;
3.0*) CXXFLAGS="-g $lyx_opt -fvtable-thunks -fno-builtin -ffunction-sections -fdata-sections";;
3.0*) CXXFLAGS="-g $lyx_opt";;
*2.91.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
esac

View File

@ -37,7 +37,6 @@
\newline
<Deine Stadt>
\layout Stadt
\cursor 17
<Stadt für Datum>
\layout Datum

View File

@ -607,7 +607,7 @@ void LaTeX::deplog(DepTable & head)
// files used by the LaTeX run. The files are then entered into the
// dependency file.
string logfile = OnlyFilename(ChangeExtension(file, ".log"));
string const logfile = OnlyFilename(ChangeExtension(file, ".log"));
LRegex reg1("\\)* *\\(([^ )]+).*");
LRegex reg2("File: ([^ ]+).*");

View File

@ -1857,12 +1857,28 @@ int InsetTabular::GetMaxWidthOfCell(Painter &, int cell) const
int InsetTabular::getMaxWidth(Painter & pain,
UpdatableInset const * inset) const
{
int const n = tabular->GetNumberOfCells();
int cell = 0;
for (; cell < n; ++cell) {
if (tabular->GetCellInset(cell) == inset)
break;
typedef std::map<UpdatableInset const *, int> Cache;
static Cache cache;
int cell = -1;
Cache::const_iterator ci = cache.find(inset);
if (ci != cache.end()) {
cell = (*ci).second;
if (tabular->GetCellInset(cell) != inset) {
cell = -1;
}
}
int const n = tabular->GetNumberOfCells();
if (cell == -1) {
cell = 0;
for (; cell < n; ++cell) {
if (tabular->GetCellInset(cell) == inset)
break;
}
cache[inset] = cell;
}
if (cell >= n)
return -1;
int w = GetMaxWidthOfCell(pain, cell);

View File

@ -22,7 +22,7 @@ struct compare_tags {
// used by lower_bound, sort and sorted
inline
int operator()(keyword_item const & a, keyword_item const & b) const {
return compare_no_case(a.tag, b.tag) < 0;
return compare_ascii_no_case(a.tag, b.tag) < 0;
}
};
// } // end of anon namespace

View File

@ -241,7 +241,7 @@ void deco_cb(FL_OBJECT *, long data)
case MM_APPLY:
case MM_OK:
{
int i = fl_get_bmtable(fd_deco->menu);
unsigned int i = fl_get_bmtable(fd_deco->menu);
// ideally the callback should not be called if the index is
// greater than the maxitem of the bmtable, but I do not know
// how to enforce that (JMarc)

View File

@ -79,6 +79,35 @@ int compare_no_case(string const & s, string const & s2, unsigned int len)
}
static
int ascii_tolower(int c) {
if (c >= 'A' && c <= 'Z')
return c - 'A' + 'a';
return c;
}
int compare_ascii_no_case(string const & s, string const & s2)
{
string::const_iterator p = s.begin();
string::const_iterator p2 = s2.begin();
while (p != s.end() && p2 != s2.end()) {
int const lc1 = ascii_tolower(*p);
int const lc2 = ascii_tolower(*p2);
if (lc1 != lc2)
return (lc1 < lc2) ? -1 : 1;
++p;
++p2;
}
if (s.size() == s2.size())
return 0;
if (s.size() < s2.size())
return -1;
return 1;
}
bool isStrInt(string const & str)
{
if (str.empty()) return false;

View File

@ -23,6 +23,9 @@
///
int compare_no_case(string const & s, string const & s2);
///
int compare_ascii_no_case(string const & s, string const & s2);
///
int compare_no_case(string const & s, string const & s2, unsigned int len);

View File

@ -1332,6 +1332,12 @@ lyxstring & lyxstring::replace(size_type i, size_type n,
}
/// FY! FY! FY! go away !
lyxstring & lyxstring::replace(size_type i, size_type n, value_type c)
{
return replace(i, n, 1, c);
}
lyxstring & lyxstring::replace(iterator i, iterator i2, const lyxstring & str)
{
TestlyxstringInvariant(this);

View File

@ -441,6 +441,9 @@ public:
lyxstring & replace(size_type i, size_type n,
size_type n2, value_type c);
/// FY! FY! FY! go away !
lyxstring & replace(size_type i, size_type n, value_type c);
///
lyxstring & replace(iterator i, iterator i2, const lyxstring & str);