mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Coding style
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26335 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
4649511c2c
commit
c1173eb11c
@ -470,7 +470,7 @@ CitationStyle citationStyleFromString(string const & command)
|
||||
size_t const n = cmd.size() - 1;
|
||||
if (cmd != "cite" && cmd[n] == '*') {
|
||||
s.full = true;
|
||||
cmd = cmd.substr(0,n);
|
||||
cmd = cmd.substr(0, n);
|
||||
}
|
||||
|
||||
char const * const * const last = citeCommands + nCiteCommands;
|
||||
|
@ -1232,7 +1232,7 @@ void Buffer::writeDocBookSource(odocstream & os, string const & fname,
|
||||
if (runparams.flavor == OutputParams::XML)
|
||||
top += params().language->code();
|
||||
else
|
||||
top += params().language->code().substr(0,2);
|
||||
top += params().language->code().substr(0, 2);
|
||||
top += '"';
|
||||
|
||||
if (!params().options.empty()) {
|
||||
|
@ -77,9 +77,9 @@ RGBColor rgbFromHexName(string const & x11hexname)
|
||||
{
|
||||
RGBColor c;
|
||||
LASSERT(x11hexname.size() == 7 && x11hexname[0] == '#', /**/);
|
||||
c.r = hexstrToInt(x11hexname.substr(1,2));
|
||||
c.g = hexstrToInt(x11hexname.substr(3,2));
|
||||
c.b = hexstrToInt(x11hexname.substr(5,2));
|
||||
c.r = hexstrToInt(x11hexname.substr(1, 2));
|
||||
c.g = hexstrToInt(x11hexname.substr(3, 2));
|
||||
c.b = hexstrToInt(x11hexname.substr(5, 2));
|
||||
return c;
|
||||
}
|
||||
|
||||
|
@ -1017,7 +1017,7 @@ InsetLayout const & DocumentClass::insetLayout(docstring const & name) const
|
||||
size_t i = n.find(':');
|
||||
if (i == string::npos)
|
||||
break;
|
||||
n = n.substr(0,i);
|
||||
n = n.substr(0, i);
|
||||
}
|
||||
return plain_insetlayout_;
|
||||
}
|
||||
|
@ -474,7 +474,7 @@ void PreambleModule::update(BufferParams const & params, BufferId id)
|
||||
Coords::const_iterator it = preamble_coords_.find(current_id_);
|
||||
if (it == preamble_coords_.end())
|
||||
// First time we open this one.
|
||||
preamble_coords_[current_id_] = make_pair(0,0);
|
||||
preamble_coords_[current_id_] = make_pair(0, 0);
|
||||
else {
|
||||
// Restore saved coords.
|
||||
QTextCursor cur = preambleTE->textCursor();
|
||||
|
@ -79,7 +79,7 @@ int GuiFontMetrics::lbearing(char_type c) const
|
||||
if (!is_utf16(c))
|
||||
// FIXME: QFontMetrics::leftBearingdoes not support the
|
||||
// full unicode range. Once it does, we could use:
|
||||
//return metrics_.leftBearing(toqstr(docstring(1,c)));
|
||||
//return metrics_.leftBearing(toqstr(docstring(1, c)));
|
||||
return 0;
|
||||
|
||||
return metrics_.leftBearing(ucs4_to_qchar(c));
|
||||
@ -104,7 +104,7 @@ int GuiFontMetrics::rbearing(char_type c) const
|
||||
} else {
|
||||
// FIXME: QFontMetrics::leftBearing does not support the
|
||||
// full unicode range. Once it does, we could use:
|
||||
// metrics_.rightBearing(toqstr(docstring(1,c)));
|
||||
// metrics_.rightBearing(toqstr(docstring(1, c)));
|
||||
value = width(c);
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ int GuiFontMetrics::smallcapsWidth(char_type c) const
|
||||
else
|
||||
return metrics_.width(qc);
|
||||
} else {
|
||||
QString const s = toqstr(docstring(1,c));
|
||||
QString const s = toqstr(docstring(1, c));
|
||||
QString const us = s.toUpper();
|
||||
if (s != us)
|
||||
return smallcaps_metrics_.width(us);
|
||||
@ -216,7 +216,7 @@ GuiFontMetrics::AscendDescend const GuiFontMetrics::fillMetricsCache(
|
||||
if (is_utf16(c))
|
||||
r = metrics_.boundingRect(ucs4_to_qchar(c));
|
||||
else
|
||||
r = metrics_.boundingRect(toqstr(docstring(1,c)));
|
||||
r = metrics_.boundingRect(toqstr(docstring(1, c)));
|
||||
|
||||
AscendDescend ad = { -r.top(), r.bottom() + 1};
|
||||
// We could as well compute the width but this is not really
|
||||
|
@ -214,7 +214,7 @@ void GuiSelectionManager::deletePB_clicked()
|
||||
if (nrows > 1)
|
||||
selectedLV->setCurrentIndex(idx);
|
||||
else if (nrows == 1)
|
||||
selectedLV->setCurrentIndex(selectedLV->model()->index(0,0));
|
||||
selectedLV->setCurrentIndex(selectedLV->model()->index(0, 0));
|
||||
selectedHasFocus_ = (nrows > 0);
|
||||
updateHook();
|
||||
}
|
||||
|
@ -1102,7 +1102,7 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
|
||||
|
||||
QVariant GuiWorkArea::inputMethodQuery(Qt::InputMethodQuery query) const
|
||||
{
|
||||
QRect cur_r(0,0,0,0);
|
||||
QRect cur_r(0, 0, 0, 0);
|
||||
switch (query) {
|
||||
// this is the CJK-specific composition window position.
|
||||
case Qt::ImMicroFocus:
|
||||
|
@ -132,7 +132,7 @@ void TocWidget::setTreeDepth(int depth)
|
||||
// but my qt 4.1.2 doesn't have expandAll()..
|
||||
//tocTV->expandAll();
|
||||
QModelIndexList indices = tocTV->model()->match(
|
||||
tocTV->model()->index(0,0),
|
||||
tocTV->model()->index(0, 0),
|
||||
Qt::DisplayRole, "*", -1,
|
||||
Qt::MatchFlags(Qt::MatchWildcard|Qt::MatchRecursive));
|
||||
|
||||
|
@ -1139,7 +1139,7 @@ namespace {
|
||||
string mid = out.substr(i + 13, j - i - 13);
|
||||
if (mid.find("\\over") != npos)
|
||||
mid = '{' + mid + '}';
|
||||
out = out.substr(0,i)
|
||||
out = out.substr(0, i)
|
||||
+ mid
|
||||
+ out.substr(k + 1);
|
||||
//lyxerr << "output: " << out << endl;
|
||||
@ -1155,10 +1155,10 @@ namespace {
|
||||
size_t k = get_matching_brace(out, i + 5);
|
||||
if (k == npos || k + 1 == out.size())
|
||||
break;
|
||||
out = out.substr(0,j - 1)
|
||||
out = out.substr(0, j - 1)
|
||||
+ "\\frac"
|
||||
+ out.substr(j,i - j)
|
||||
+ out.substr(i + 5,k - i - 4)
|
||||
+ out.substr(j, i - j)
|
||||
+ out.substr(i + 5, k - i - 4)
|
||||
+ out.substr(k + 2);
|
||||
//lyxerr << "output: " << out << endl;
|
||||
i = out.find("\\over", i + 4);
|
||||
|
Loading…
Reference in New Issue
Block a user