+2001-06-27 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * LaTeXFeatures.C (getFloatDefinitions): std:: qualify ostream
+
2001-06-27 Juergen Vigna <jug@sad.it>
* text.C (cursorLeftOneWord): changed to return the cursor and added
}
-void LaTeXFeatures::getFloatDefinitions(ostream & os) const
+void LaTeXFeatures::getFloatDefinitions(std::ostream & os) const
{
// Here we will output the code to create the needed float styles.
// We will try to do this as minimal as possible.
+2001-06-27 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * insetfloatlist.C (Write): std:: qualify ostream
+ (Latex): ditto
+
2001-06-26 The LyX Project <lyx@violet.home.sad.it>
* figinset.C:
}
-void InsetFloatList::Write(Buffer const *, ostream & os) const
+void InsetFloatList::Write(Buffer const *, std::ostream & os) const
{
os << "FloatList " << float_type << "\n";
}
}
-int InsetFloatList::Latex(Buffer const *, ostream & os, bool, bool) const
+int InsetFloatList::Latex(Buffer const *, std::ostream & os, bool, bool) const
{
FloatList::const_iterator cit = floatList[float_type];
/// Change the case of the word at cursor position.
void changeCase(BufferView *, TextCase action);
///
+ void LyXText::changeRegionCase(BufferView * bview,
+ LyXCursor const & from,
+ LyXCursor const & to,
+ LyXText::TextCase action);
+ ///
void transposeChars(BufferView const &);
/** returns a printed row in a pixmap. The y value is needed to
+2001-06-27 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * math_sizeinset.C: include support/LOstream.h
+
+ * math_scriptinset.C (Metrics): std:: qualify max
+
+ * math_root.C (Metrics): std:: qualify max
+ (Write): std:: qualify ostream
+ (WriteNormal): ditto
+
+ * math_matrixinset.C (getLabelList): std:: qualify vector
+ include vector
+ (Metrics): std:: qualify max
+ (header_write): std:: qualify ostream
+ (footer_write): ditto
+
+ * math_macrotemplate.C (Write): std:: qualify ostream
+
+ * math_bigopinset.C (Metrics): std:: qualify max, and include
+ functional
+
+ * math_matrixinset.h: include vector and std:: qualify it.
+
+ * array.C (GetInset): get a pointer to the first element of bf_
+ not an iterator.
+
2001-06-25 The LyX Project <Asger>
* math_scriptinset.C: Fix for entering with cursor up/down.
if (!isInset(pos))
return 0;
MathInset * p;
- memcpy(&p, bf_.begin() + pos + 1, sizeof(p));
+ memcpy(&p, &bf_[0] + pos + 1, sizeof(p));
return p;
}
#include <config.h>
+#include <functional>
+
#include "math_bigopinset.h"
#include "LColor.h"
#include "Painter.h"
if (hasLimits()) {
ascent_ = asc + xcell(0).height() + 2;
descent_ = des + xcell(1).height() + 2;
- width_ = max(width_, wid);
+ width_ = std::max(width_, wid);
} else {
- ascent_ = max(ascent_, asc);
- descent_ = max(descent_, des);
+ ascent_ = std::max(ascent_, asc);
+ descent_ = std::max(descent_, des);
width_ += wid;
}
#pragma implementation
#endif
+#include <functional>
+
#include "math_fracinset.h"
#include "LColor.h"
#include "Painter.h"
xcell(0).Metrics(st);
xcell(1).Metrics(st);
size_ = st;
- width_ = max(xcell(0).width(), xcell(1).width()) + 4;
+ width_ = std::max(xcell(0).width(), xcell(1).width()) + 4;
ascent_ = xcell(0).height() + 4 + 5;
descent_ = xcell(1).height() + 4 - 5;
}
return new MathMacroTemplate(*this);
}
+
int MathMacroTemplate::numargs() const
{
return numargs_;
}
+
void MathMacroTemplate::numargs(int numargs)
{
numargs_ = numargs;
}
-void MathMacroTemplate::Write(ostream & os, bool fragile) const
+void MathMacroTemplate::Write(std::ostream & os, bool fragile) const
{
os << "\n\\newcommand{\\" << name_ << "}";
xcell(0).draw(pain, x + 2, y + 1);
pain.rectangle(x, y - ascent(), width(), height(), LColor::blue);
}
-
#pragma implementation
#endif
+#include <vector>
+#include <functional>
+
#include "math_matrixinset.h"
#include "debug.h"
#include "support/LOstream.h"
namespace {
-string getAlign(short int type, int cols)
+string const getAlign(short int type, int cols)
{
string align;
switch (type) {
}
-string star(bool n)
+string const star(bool n)
{
return n ? "" : "*";
}
+
int getCols(short int type)
{
int col;
if (numberedType()) {
int l = 0;
for (int row = 0; row < nrows(); ++row)
- l = max(l, mathed_string_width(LM_TC_TEXTRM, size(), nicelabel(row)));
+ l = std::max(l, mathed_string_width(LM_TC_TEXTRM, size(), nicelabel(row)));
if (l)
width_ += 30 + l;
}
-vector<string> const MathMatrixInset::getLabelList() const
+std::vector<string> const MathMatrixInset::getLabelList() const
{
std::vector<string> res;
for (int row = 0; row < nrows(); ++row)
*/
-void MathMatrixInset::header_write(ostream & os) const
+void MathMatrixInset::header_write(std::ostream & os) const
{
bool n = numberedType();
}
-void MathMatrixInset::footer_write(ostream & os) const
+void MathMatrixInset::footer_write(std::ostream & os) const
{
bool n = numberedType();
#ifndef MATH_MATRIXINSET_H
#define MATH_MATRIXINSET_H
+#include <vector>
+
#include "math_grid.h"
#ifdef __GNUG__
///
bool ams() const;
///
- vector<string> const getLabelList() const;
+ std::vector<string> const getLabelList() const;
///
void Validate(LaTeXFeatures & features);
#pragma implementation
#endif
+#include <functional>
+
#include "math_root.h"
#include "support/LOstream.h"
#include "Painter.h"
{
MathInset::Metrics(st);
size_ = st;
- ascent_ = max(xcell(0).ascent() + 5, xcell(1).ascent()) + 2;
- descent_ = max(xcell(1).descent() + 5, xcell(0).descent()) + 2;
+ ascent_ = std::max(xcell(0).ascent() + 5, xcell(1).ascent()) + 2;
+ descent_ = std::max(xcell(1).descent() + 5, xcell(0).descent()) + 2;
width_ = xcell(0).width() + xcell(1).width() + 10;
}
}
-void MathRootInset::Write(ostream & os, bool fragile) const
+void MathRootInset::Write(std::ostream & os, bool fragile) const
{
os << "\\sqrt[";
cell(0).Write(os, fragile);
}
-void MathRootInset::WriteNormal(ostream & os) const
+void MathRootInset::WriteNormal(std::ostream & os) const
{
os << "[root ";
cell(1).WriteNormal(os);
#pragma implementation
#endif
+#include <functional>
+
#include "math_scriptinset.h"
#include "LColor.h"
#include "Painter.h"
{
MathInset::Metrics(st);
size_ = st;
- width_ = max(xcell(0).width(), xcell(1).width()) + 2;
+ width_ = std::max(xcell(0).width(), xcell(1).width()) + 2;
if (up())
- ascent_ = max(ascent_, xcell(0).height() + 9);
+ ascent_ = std::max(ascent_, xcell(0).height() + 9);
if (down())
- descent_ = max(descent_, xcell(1).height());
+ descent_ = std::max(descent_, xcell(1).height());
}
#endif
#include "math_sizeinset.h"
+#include "support/LOstream.h"
MathSizeInset::MathSizeInset(MathStyles st)
name_ = verbose();
}
+
char const * MathSizeInset::verbose() const
{
switch (style_) {
return "unknownstyle";
}
+
MathInset * MathSizeInset::Clone() const
{
return new MathSizeInset(*this);
search_inset, matchIT());
if (it != owner_->insetlist.end() && (*it).pos == pos) {
lyxerr << "ERROR (Paragraph::InsertInset): "
- "there is an inset in position: " << pos << endl;
+ "there is an inset in position: " << pos << std::endl;
} else {
owner_->insetlist.insert(it, InsetTable(pos, inset));
}
}
-void Paragraph::Pimpl::simpleTeXBlanks(ostream & os, TexRow & texrow,
- Paragraph::size_type const i,
- int & column, LyXFont const & font,
- LyXLayout const & style)
+void Paragraph::Pimpl::simpleTeXBlanks(std::ostream & os, TexRow & texrow,
+ Paragraph::size_type const i,
+ int & column, LyXFont const & font,
+ LyXLayout const & style)
{
if (column > tex_code_break_column
&& i
void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
BufferParams const & bparams,
- ostream & os, TexRow & texrow,
+ std::ostream & os,
+ TexRow & texrow,
bool moving_arg,
LyXFont & font,
LyXFont & running_font,
Paragraph * Paragraph::Pimpl::TeXDeeper(Buffer const * buf,
BufferParams const & bparams,
- ostream & os, TexRow & texrow)
+ std::ostream & os, TexRow & texrow)
{
- lyxerr[Debug::LATEX] << "TeXDeeper... " << this << endl;
+ lyxerr[Debug::LATEX] << "TeXDeeper... " << this << std::endl;
Paragraph * par = owner_;
while (par && par->params().depth() == owner_->params().depth()) {
os, texrow, false);
}
}
- lyxerr[Debug::LATEX] << "TeXDeeper...done " << par << endl;
+ lyxerr[Debug::LATEX] << "TeXDeeper...done " << par << std::endl;
return par;
}
setUndo(bview->buffer(), Undo::FINISH,
from.par()->previous(), to.par()->next());
+#if 1
+ changeRegionCase(bview, to, from, action);
+#else
while(from != to) {
unsigned char c = from.par()->getChar(from.pos());
if (!IsInsetChar(c) && !IsHfillChar(c)) {
refresh_row = from.row();
status = LyXText::NEED_MORE_REFRESH;
}
+#endif
+}
+
+
+void LyXText::changeRegionCase(BufferView * bview,
+ LyXCursor const & from,
+ LyXCursor const & to,
+ LyXText::TextCase action)
+{
+ setUndo(bview->buffer(), Undo::FINISH,
+ from.par()->previous(), to.par()->next());
+
+ LyXCursor tmp(from);
+
+ while(tmp != to) {
+ unsigned char c = tmp.par()->getChar(tmp.pos());
+ if (!IsInsetChar(c) && !IsHfillChar(c)) {
+ switch (action) {
+ case text_lowercase:
+ c = tolower(c);
+ break;
+ case text_capitalization:
+ c = toupper(c);
+ action = text_lowercase;
+ break;
+ case text_uppercase:
+ c = toupper(c);
+ break;
+ }
+ }
+ tmp.par()->setChar(tmp.pos(), c);
+ checkParagraph(bview, tmp.par(), tmp.pos());
+ tmp.pos(tmp.pos() + 1);
+ if (tmp.pos() >= tmp.par()->size()) {
+ tmp.par(tmp.par()->next());
+ tmp.pos(0);
+ }
+ }
+ if (to.row() != tmp.row()) {
+ refresh_y = tmp.y() - tmp.row()->baseline();
+ refresh_row = tmp.row();
+ status = LyXText::NEED_MORE_REFRESH;
+ }
}