]> git.lyx.org Git - features.git/commitdiff
mathed25.diff
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 19 Feb 2001 10:18:21 +0000 (10:18 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 19 Feb 2001 10:18:21 +0000 (10:18 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1531 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/array.C
src/mathed/array.h
src/mathed/math_iter.C

index e9e3b5eafd7ead60164805e7c532ea1103728b38..ba1fe6514e4db2f80a6868bd7e2ca0a22e8e97a5 100644 (file)
@@ -1,3 +1,9 @@
+2001-02-14  André Pönitz  <poenitz@htwm.de>
+
+       * array.[Ch]: remove constructor and  enums ARRAY_MIN_SIZE and ARRAY_STEP
+
+       * math_iter.C: default-construct and resize array
+
 2001-02-17  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * math_xiter.h: move ipush and ipop to public, add _ on private
@@ -7,7 +13,7 @@
        remove default arg val. Call the public methods of xiter instead
        of private variables.
 
-       * changes to several files beacuse of the above.
+       * changes to several files because of the above.
        
 2001-02-14  André Pönitz  <poenitz@htwm.de>
 
index f93104b464f7d9007a735768b023a08913b6a320..4d42317fd75de97d67c6b06862136ec1aa638fdf 100644 (file)
@@ -18,12 +18,9 @@ void * my_memcpy(void * ps_in, void const * pt_in, size_t n)
 }
 
 
-MathedArray::MathedArray(int size)
-       : last_(0)
-{
-       int const newsize = (size < ARRAY_MIN_SIZE) ? ARRAY_MIN_SIZE : size;
-       bf_.resize(newsize);
-}
+MathedArray::MathedArray()
+       : bf_(1, 0), last_(0)
+{}
 
 
 MathedArray::iterator MathedArray::begin() 
@@ -77,10 +74,9 @@ void MathedArray::need_size(int needed)
 
 void MathedArray::resize(int newsize)
 {
-       if (newsize < ARRAY_MIN_SIZE)
-               newsize = ARRAY_MIN_SIZE;
-       newsize += ARRAY_STEP - (newsize % ARRAY_STEP);
-       bf_.resize(newsize);
+       // still a bit smelly...
+       ++newsize;
+       bf_.resize(newsize + 1);
        if (last_ >= newsize)
                last_ = newsize - 1;
        bf_[last_] = 0;
index 35a2f25c271bc1cd778d6db63c613fce2156b04e..c9cff48a7137d594f492dbe3ad2ce0ff3d17aeda 100644 (file)
@@ -46,16 +46,7 @@ public:
        typedef buffer_type::const_iterator const_iterator;
        
        ///
-       enum {
-               ///
-               ARRAY_STEP = 16,
-               ///
-               ARRAY_MIN_SIZE = 4
-       };
-
-       ///
-       explicit
-       MathedArray(int size = ARRAY_STEP);
+       MathedArray();
 
        ///
        iterator begin();
index 38c2c59f5ce4bd1997bc24b4dd981ff14e2f3bb8..2f5dfcb8420471c9f546f16103427cd671d6894d 100644 (file)
@@ -411,7 +411,8 @@ MathedArray * MathedIter::Copy(int pos1, int pos2)
                        --pos2;
 
                int dx = pos2 - pos1;
-               a = new MathedArray(dx + MathedArray::ARRAY_MIN_SIZE);
+               a = new MathedArray;
+               a->resize(dx + 1);
                //       lyxerr << "VA " << pos2 << " " << pos2 << " " << dx << endl;
                array->strange_copy(a, (fc) ? 1 : 0, pos1, dx);
                if (fc) {