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