mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Compare commits
6 Commits
0beb790a6a
...
6687b34c07
Author | SHA1 | Date | |
---|---|---|---|
|
6687b34c07 | ||
|
ffde470363 | ||
|
3d323412ad | ||
|
12d771c43f | ||
|
ed291f0d4f | ||
|
f725abea05 |
@ -495,7 +495,7 @@ docstring KeyMap::printBindings(FuncRequest const & func,
|
||||
if (!firstone)
|
||||
res << ", ";
|
||||
res << key.print(format, untranslated);
|
||||
firstone = true;
|
||||
firstone = false;
|
||||
}
|
||||
return res.str();
|
||||
}
|
||||
|
@ -460,8 +460,7 @@ int h(vector<docstring> const &)
|
||||
}
|
||||
|
||||
|
||||
docstring clientName =
|
||||
from_ascii(to_string(::getppid()) + ">" + to_string(::getpid()));
|
||||
docstring clientName;
|
||||
|
||||
int n(vector<docstring> const & arg)
|
||||
{
|
||||
@ -710,9 +709,12 @@ int LyXClientApp::run()
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
lyx::lyxerr.setStream(cerr);
|
||||
using namespace lyx;
|
||||
lyxerr.setStream(cerr);
|
||||
cmdline::clientName =
|
||||
from_ascii(to_string(::getppid()) + ">" + to_string(::getpid()));
|
||||
|
||||
lyx::LyXClientApp app(argc, argv);
|
||||
LyXClientApp app(argc, argv);
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
|
@ -1902,7 +1902,8 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
||||
// set default
|
||||
arg = "templates";
|
||||
if (arg != "templates" && arg != "examples") {
|
||||
current_view_->message(_("Wrong argument. Must be 'examples' or 'templates'."));
|
||||
if (current_view_)
|
||||
current_view_->message(_("Wrong argument. Must be 'examples' or 'templates'."));
|
||||
break;
|
||||
}
|
||||
lyx::dispatch(FuncRequest(LFUN_DIALOG_SHOW, "lyxfiles " + arg));
|
||||
|
@ -121,10 +121,6 @@ docstring const InsetBranch::buttonLabel(BufferView const &) const
|
||||
if (decoration() == InsetDecoration::MINIMALISTIC)
|
||||
return symb + inv_symb + params_.branch;
|
||||
|
||||
if (!buffer_) {
|
||||
return symb + inv_symb + _("Branch (undefined): ")
|
||||
+ params_.branch;
|
||||
}
|
||||
bool const has_layout =
|
||||
buffer().params().documentClass().hasInsetLayout(layoutName());
|
||||
if (has_layout) {
|
||||
|
@ -40,7 +40,7 @@ docstring const from_ascii(char const * ascii)
|
||||
char_type *d = &s[0];
|
||||
while (--n >= 0) {
|
||||
d[n] = ascii[n];
|
||||
LATTEST(static_cast<unsigned char>(ascii[n]) < 0x80);
|
||||
LATTEST_STATIC(static_cast<unsigned char>(ascii[n]) < 0x80);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#ifdef LYX_CALLSTACK_PRINTING
|
||||
#include <cstdio>
|
||||
@ -55,6 +56,13 @@ void doAssert(char const * expr, char const * file, long line)
|
||||
}
|
||||
|
||||
|
||||
void doAssertStatic(char const * expr, char const * file, long line)
|
||||
{
|
||||
cerr << "ASSERTION " << expr << " VIOLATED IN " << file << ":" << line << endl;
|
||||
BOOST_ASSERT(false);
|
||||
}
|
||||
|
||||
|
||||
docstring formatHelper(docstring const & msg,
|
||||
char const * expr, char const * file, long line)
|
||||
{
|
||||
|
@ -34,6 +34,11 @@ LATTEST(expr)
|
||||
continue with the usual program flow, but failure of expr still means that
|
||||
there is something that needs to be fixed.
|
||||
|
||||
LATTEST_STATIC(expr)
|
||||
This is the same as macro LATTEST above, except
|
||||
that it does not use lyxerr, so that it is suitable in static
|
||||
variables initialization.
|
||||
|
||||
LASSERT(expr, escape)
|
||||
This macro should be used when a failure of expr is not compatible with
|
||||
continuing the ordinary program flow, but is something from which we can
|
||||
@ -61,6 +66,7 @@ LAPPERR(expr)
|
||||
|
||||
|
||||
void doAssert(char const * expr, char const * file, long line);
|
||||
void doAssertStatic(char const * expr, char const * file, long line);
|
||||
void doWarnIf(char const * expr, char const * file, long line);
|
||||
void doBufErr(char const * expr, char const * file, long line);
|
||||
void doAppErr(char const * expr, char const * file, long line);
|
||||
@ -76,6 +82,9 @@ docstring printCallStack();
|
||||
#define LATTEST(expr) \
|
||||
if (expr) {} else { lyx::doAssert(#expr, __FILE__, __LINE__); }
|
||||
|
||||
#define LATTEST_STATIC(expr) \
|
||||
if (expr) {} else { lyx::doAssertStatic(#expr, __FILE__, __LINE__); }
|
||||
|
||||
#define LASSERT(expr, escape) \
|
||||
if (expr) {} else { lyx::doAssert(#expr, __FILE__, __LINE__); escape; }
|
||||
|
||||
|
@ -4574,7 +4574,12 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
||||
os << "reference \"";
|
||||
os << known_refstyle_prefixes[where - known_refstyle_commands]
|
||||
<< ":";
|
||||
os << convert_literate_command_inset_arg(p.getArg('{', '}'))
|
||||
string arg = p.getArg('{', '}');
|
||||
// with refstyle, labels containing blanks are grouped
|
||||
// remove the grouping
|
||||
if (contains(arg, ' '))
|
||||
arg = ltrim(rtrim(arg, "}"), "{");
|
||||
os << convert_literate_command_inset_arg(arg)
|
||||
<< "\"\n";
|
||||
os << "plural \"" << plural << "\"\n";
|
||||
os << "caps \"" << cap << "\"\n";
|
||||
|
Loading…
Reference in New Issue
Block a user