+2005-03-31 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * math_amsarrayinset.[Ch], math_tabularinset.[Ch],
+ math_splitinset.[Ch] (infoize): implement
+ * math_casesinset.C (getStatus, doDispatch): use cmd.argument directly
+ * math_gridinset.C (getStatus): ditto
+ * math_arrayinset.C (infoize): generalize
+
+2005-03-30 Martin Vermeer <martin.vermeer@hut.fi>
+
+ * math_amsarrayinset.[Ch] (getStatus):
+ * math_splitinset.[Ch] (getStatus):
+ * math_substackinset.[Ch]: suppress output of vertical gridlines
+ where appropriate
+
2005-04-03 Martin Vermeer <martin.vermeer@hut.fi>
* math_fontinset.[Ch] (draw): add call to setPosCache,
#include "math_streamstr.h"
#include "math_support.h"
+#include "funcrequest.h"
+#include "FuncStatus.h"
+#include "gettext.h"
+
+#include "support/lstrings.h"
+#include "support/std_ostream.h"
+
+
using std::string;
using std::auto_ptr;
+using lyx::support::bformat;
MathAMSArrayInset::MathAMSArrayInset(string const & name, int m, int n)
}
+bool MathAMSArrayInset::getStatus(LCursor & cur, FuncRequest const & cmd,
+ FuncStatus & flag) const
+{
+ switch (cmd.action) {
+ case LFUN_TABULAR_FEATURE: {
+ string const s = cmd.argument;
+ if (s == "add-vline-left" || s == "add-vline-right") {
+ flag.message(bformat(
+ N_("Can't add vertical grid lines in '%1$s'"),
+ name_));
+ flag.enabled(false);
+ return true;
+ }
+ return MathGridInset::getStatus(cur, cmd, flag);
+ }
+ default:
+ return MathGridInset::getStatus(cur, cmd, flag);
+ }
+}
+
+
void MathAMSArrayInset::write(WriteStream & os) const
{
os << "\\begin{" << name_ << '}';
}
+void MathAMSArrayInset::infoize(std::ostream & os) const
+{
+ string name = name_;
+ name[0] = lyx::support::uppercase(name[0]);
+ os << name << ' ';
+}
+
+
void MathAMSArrayInset::normalize(NormalStream & os) const
{
os << '[' << name_ << ' ';
///
MathAMSArrayInset const * asAMSArrayInset() const { return this; }
+ ///
+ bool getStatus(LCursor & cur, FuncRequest const & cmd,
+ FuncStatus & flag) const;
///
void write(WriteStream & os) const;
///
+ void infoize(std::ostream & os) const;
+ ///
void normalize(NormalStream &) const;
///
void validate(LaTeXFeatures & features) const;
#include "math_mathmlstream.h"
#include "math_streamstr.h"
+#include "support/lstrings.h"
+
#include <iterator>
#include <sstream>
void MathArrayInset::infoize(std::ostream & os) const
{
- os << "Array";
+ string name = name_;
+ name[0] = lyx::support::uppercase(name[0]);
+ os << name << ' ';
}
#include "support/lstrings.h"
-#include <sstream>
using lyx::support::bformat;
using std::max;
using std::min;
using std::swap;
-using std::istringstream;
using std::string;
using std::auto_ptr;
switch (cmd.action) {
case LFUN_TABULAR_FEATURE: {
recordUndo(cur);
- istringstream is(cmd.argument);
- string s;
- is >> s;
+ string const s = cmd.argument;
if (s == "add-vline-left" || s == "add-vline-right") {
cur.undispatched();
break;
{
switch (cmd.action) {
case LFUN_TABULAR_FEATURE: {
- istringstream is(cmd.argument);
- string s;
- is >> s;
+ string const s = cmd.argument;
if (s == "add-vline-left" || s == "add-vline-right") {
flag.enabled(false);
flag.message(bformat(
{
switch (cmd.action) {
case LFUN_TABULAR_FEATURE: {
- istringstream is(cmd.argument);
- string s;
- is >> s;
+ string const s = cmd.argument;
if (nrows() <= 1 && (s == "delete-row" || s == "swap-row")) {
flag.enabled(false);
flag.message(N_("Only one row"));
#include "math_mathmlstream.h"
#include "math_streamstr.h"
+#include "funcrequest.h"
+#include "FuncStatus.h"
+#include "gettext.h"
+#include "support/lstrings.h"
+#include "support/std_ostream.h"
+
+
+using lyx::support::bformat;
using std::string;
using std::auto_ptr;
}
+bool MathSplitInset::getStatus(LCursor & cur, FuncRequest const & cmd,
+ FuncStatus & flag) const
+{
+ switch (cmd.action) {
+ case LFUN_TABULAR_FEATURE: {
+ string const s = cmd.argument;
+ if (s == "add-vline-left" || s == "add-vline-right") {
+ flag.message(bformat(
+ N_("Can't add vertical grid lines in '%1$s'"),
+ name_));
+ flag.enabled(false);
+ return true;
+ }
+ return MathGridInset::getStatus(cur, cmd, flag);
+ }
+ default:
+ return MathGridInset::getStatus(cur, cmd, flag);
+ }
+}
+
+
void MathSplitInset::write(WriteStream & ws) const
{
if (ws.fragile())
ws << "\\protect";
ws << "\\end{" << name_ << "}\n";
}
+
+
+void MathSplitInset::infoize(std::ostream & os) const
+{
+ string name = name_;
+ name[0] = lyx::support::uppercase(name[0]);
+ os << name << ' ';
+}
public:
///
explicit MathSplitInset(std::string const & name);
+
///
+ bool getStatus(LCursor & cur, FuncRequest const & cmd,
+ FuncStatus & flag) const;
+
void write(WriteStream & os) const;
///
+ void infoize(std::ostream & os) const;
+ ///
int defaultColSpace(col_type) { return 0; }
///
char defaultColAlign(col_type);
#include "math_mathmlstream.h"
#include "support/std_ostream.h"
+#include "funcrequest.h"
+#include "FuncStatus.h"
+#include "gettext.h"
+
+#include "support/lstrings.h"
+
+
+using lyx::support::bformat;
+using std::string;
using std::auto_ptr;
}
+bool MathSubstackInset::getStatus(LCursor & cur, FuncRequest const & cmd,
+ FuncStatus & flag) const
+{
+ switch (cmd.action) {
+ case LFUN_TABULAR_FEATURE: {
+ string const name("substack");
+ string const s = cmd.argument;
+ if (s == "add-vline-left" || s == "add-vline-right") {
+ flag.message(bformat(
+ N_("Can't add vertical grid lines in '%1$s'"), name));
+ flag.enabled(false);
+ return true;
+ }
+ return MathGridInset::getStatus(cur, cmd, flag);
+ }
+ default:
+ return MathGridInset::getStatus(cur, cmd, flag);
+ }
+}
+
+
void MathSubstackInset::infoize(std::ostream & os) const
{
os << "Substack ";
MathSubstackInset const * asSubstackInset() const { return this; }
///
- void normalize();
+ bool getStatus(LCursor & cur, FuncRequest const & cmd,
+ FuncStatus & flag) const;
///
void infoize(std::ostream & os) const;
///
#include "math_mathmlstream.h"
#include "math_streamstr.h"
+#include "support/lstrings.h"
+#include "support/std_ostream.h"
+
#include <iterator>
}
+void MathTabularInset::infoize(std::ostream & os) const
+{
+ string name = name_;
+ name[0] = lyx::support::uppercase(name[0]);
+ os << name << ' ';
+}
+
+
void MathTabularInset::normalize(NormalStream & os) const
{
os << '[' << name_ << ' ';
///
void write(WriteStream & os) const;
///
+ void infoize(std::ostream & os) const;
+ ///
void normalize(NormalStream &) const;
///
void maple(MapleStream &) const;