#include <locale>
#endif
+#ifndef CXX_GLOBAL_CSTD
+using std::pow;
+#endif
using std::ostream;
using std::ofstream;
} else if (token == "\\added_space_top") {
lex.nextToken();
VSpace value = VSpace(lex.getString());
+ // only add the length when value > 0 or
+ // with option keep
if ((value.length().len().value() != 0) ||
+ value.keep() ||
(value.kind() != VSpace::LENGTH))
- par->params().spaceTop(value);
+ par->params().spaceTop(value);
} else if (token == "\\added_space_bottom") {
lex.nextToken();
VSpace value = VSpace(lex.getString());
+ // only add the length when value > 0 or
+ // with option keep
if ((value.length().len().value() != 0) ||
+ value.keep() ||
(value.kind() != VSpace::LENGTH))
- par->params().spaceBottom(value);
+ par->params().spaceBottom(value);
#ifndef NO_COMPABILITY
#ifndef NO_PEXTRA_REALLY
} else if (token == "\\pextra_type") {
void Buffer::sgmlError(Paragraph * /*par*/, int /*pos*/,
string const & /*message*/) const
{
+#ifdef WITH_WARNINGS
#warning This is wrong we cannot insert an inset like this!!!
// I guess this was Jose' so I explain you more or less why this
// is wrong. This way you insert something in the paragraph and
// don't tell it to LyXText (row rebreaking and undo handling!!!)
// I deactivate this code, have a look at BufferView::insertErrors
// how you should do this correctly! (Jug 20020315)
+#endif
#if 0
// insert an error marker in text
InsetError * new_inset = new InsetError(message);
}
-bool Buffer::dispatch(string const & command)
+bool Buffer::dispatch(string const & command, bool * result)
{
// Split command string into command and argument
string cmd;
string line = frontStrip(command);
string const arg = strip(frontStrip(split(line, cmd, ' ')));
- return dispatch(lyxaction.LookupFunc(cmd), arg);
+ return dispatch(lyxaction.LookupFunc(cmd), arg, result);
}
-bool Buffer::dispatch(int action, string const & argument)
+bool Buffer::dispatch(int action, string const & argument, bool * result)
{
bool dispatched = true;
+
switch (action) {
- case LFUN_EXPORT:
- Exporter::Export(this, argument, false);
+ case LFUN_EXPORT: {
+ bool const tmp = Exporter::Export(this, argument, false);
+ if (result)
+ *result = tmp;
break;
+ }
default:
dispatched = false;