src/frontends/kde/urldlg.C
src/frontends/qt2/FormCopyright.C
src/frontends/xforms/FormBase.h
-src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibitem.C
-src/frontends/xforms/FormBibtex.C
+src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibtex.C
+src/frontends/xforms/FormBibtex.C
src/frontends/xforms/form_browser.C
-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/FormInclude.C
+src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_include.C
-src/frontends/xforms/FormIndex.C
+src/frontends/xforms/FormInclude.C
src/frontends/xforms/form_index.C
+src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormInset.h
src/frontends/xforms/FormLog.C
-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/FormRef.C
src/frontends/xforms/FormSplash.C
-src/frontends/xforms/FormTabular.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/FormVCLog.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C
+2001-02-14 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * array.C (begin): new method
+ (end): ditto
+
+2001-02-14 André Pönitz <poenitz@htwm.de>
+
+ * math_iter.[Ch]: remove 'insert', 'maxsize' and 'ARRAY_SIZE'
+
2001-02-14 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* math_spaceinset.C:
* math_accentinset.C:
* math_sqrtinset.C: include LOstream.h and add using directive.
-2001-02-12 André Pönitz <poenitz@htwm.de>
+2001-02-14 André Pönitz <poenitz@htwm.de>
* math_iter.C: reformatting
}
+MathedArray::MathedArray(int size)
+ : last_(0)
+{
+ int const newsize = (size < ARRAY_MIN_SIZE) ? ARRAY_MIN_SIZE : size;
+ bf_.resize(newsize);
+}
+
+
+MathedArray::iterator MathedArray::begin()
+{
+ return bf_.begin();
+}
+
+
+MathedArray::iterator MathedArray::end()
+{
+ return bf_.end();
+}
+
+
+MathedArray::const_iterator MathedArray::begin() const
+{
+ return bf_.begin();
+}
+
+
+MathedArray::const_iterator MathedArray::end() const
+{
+ return bf_.end();
+}
+
+
int MathedArray::empty() const
{
return (last_ == 0);
}
-int MathedArray::maxsize() const
-{
- return static_cast<int>(bf_.size());
-}
-
-
void MathedArray::need_size(int needed)
{
- if (needed >= maxsize())
+ if (needed >= static_cast<int>(bf_.size()))
resize(needed);
}
newsize = ARRAY_MIN_SIZE;
newsize += ARRAY_STEP - (newsize % ARRAY_STEP);
bf_.resize(newsize);
- if (last_ >= newsize) last_ = newsize - 1;
+ if (last_ >= newsize)
+ last_ = newsize - 1;
bf_[last_] = 0;
}
-MathedArray::MathedArray(int size)
-{
- int newsize = (size < ARRAY_MIN_SIZE) ? ARRAY_MIN_SIZE : size;
- bf_.resize(newsize);
- last_ = 0;
-}
-
-
void MathedArray::move(int p, int shift)
{
if (p <= last_) {
}
+#if 0
+void MathedArray::insert(MathedArray::iterator pos,
+ MathedArray::const_iterator beg,
+ MathedArray::const_iterator end)
+{
+ bf_.insert(pos, beg, end);
+ last_ = bf_.size() - 1;
+}
+#else
void MathedArray::mergeF(MathedArray * a, int p, int dx)
{
my_memcpy(&bf_[p], &a->bf_[0], dx);
}
+#endif
void MathedArray::raw_pointer_copy(MathedInset ** p, int pos) const
{
return bf_[i];
}
-
-
-void MathedArray::insert(int pos, byte c)
-{
- if (pos < 0) pos = last_;
-
- // I think this should be replaced by need_size(pos). Note that the
- // current code looks troublesome if pos > maxsize() + ARRAY_STEP.
- if (pos >= maxsize())
- resize(maxsize() + ARRAY_STEP);
- bf_[pos] = c;
- if (pos >= last_)
- last_ = pos + 1;
-}
typedef std::vector<byte> buffer_type;
typedef byte value_type;
typedef buffer_type::size_type size_type;
+ typedef buffer_type::iterator iterator;
+ typedef buffer_type::const_iterator const_iterator;
+
///
enum {
- ///
- ARRAY_SIZE = 256,
///
ARRAY_STEP = 16,
///
explicit
MathedArray(int size = ARRAY_STEP);
+ ///
+ iterator begin();
+ ///
+ iterator end();
+ ///
+ const_iterator begin() const;
+ ///
+ const_iterator end() const;
+
///
int empty() const;
int last() const;
///
void last(int l);
-
+
+#if 0
+ ///
+ void insert(iterator pos, const_iterator beg, const_iterator end);
+#else
/// Merge \a dx elements from array \a a at \apos.
/// This doesn't changes the size (dangerous)
void mergeF(MathedArray * a, int pos, int dx);
-
- /// Insert a character at position \a pos
- void insert(int pos, byte);
-
+#endif
///
void raw_pointer_copy(MathedInset ** p, int pos) const;
///
void move(int p, int shift);
///
void resize(int newsize);
- ///
- int maxsize() const;
/// Make sure we can access at least \a needed elements
void need_size(int needed);
private:
-
/// Buffer
buffer_type bf_;
/// Last position inserted.
// All insets must be clonned
MathedIter it(a0);
MathedArray * a = it.Copy();
-
+
+#if 0
+ array->insert(array->begin() + pos,
+ a->begin(), a->end());
+#else
// make room for the data
split(a->last());
array->mergeF(a, pos, a->last());
-
+#endif
int pos1 = pos;
int pos2 = pos + a->last();