mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Fix bug #10879.
This commit is contained in:
parent
f22954b89d
commit
1a74a654e8
@ -142,12 +142,12 @@ ErrorList const & GuiErrorList::errorList() const
|
||||
}
|
||||
|
||||
|
||||
bool GuiErrorList::initialiseParams(string const & data)
|
||||
bool GuiErrorList::initialiseParams(string const & sdata)
|
||||
{
|
||||
from_master_ = prefixIs(data, "from_master|");
|
||||
string error_type = data;
|
||||
from_master_ = prefixIs(sdata, "from_master|");
|
||||
string error_type = sdata;
|
||||
if (from_master_)
|
||||
error_type = split(data, '|');
|
||||
error_type = split(sdata, '|');
|
||||
error_type_ = error_type;
|
||||
buf_ = from_master_ ?
|
||||
bufferview()->buffer().masterBuffer()
|
||||
|
@ -71,10 +71,10 @@ void GuiHyperlink::paramsToDialog(Inset const * inset)
|
||||
}
|
||||
|
||||
|
||||
bool GuiHyperlink::initialiseParams(std::string const & data)
|
||||
bool GuiHyperlink::initialiseParams(std::string const & sdata)
|
||||
{
|
||||
InsetCommandParams params(insetCode());
|
||||
if (!InsetCommand::string2params(data, params))
|
||||
if (!InsetCommand::string2params(sdata, params))
|
||||
return false;
|
||||
targetED->setText(toqstr(params["target"]));
|
||||
nameED->setText(toqstr(params["name"]));
|
||||
|
@ -79,9 +79,9 @@ void GuiIndex::applyView()
|
||||
}
|
||||
|
||||
|
||||
bool GuiIndex::initialiseParams(string const & data)
|
||||
bool GuiIndex::initialiseParams(string const & sdata)
|
||||
{
|
||||
InsetIndex::string2params(data, params_);
|
||||
InsetIndex::string2params(sdata, params_);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -58,10 +58,10 @@ docstring GuiLabel::dialogToParams() const
|
||||
}
|
||||
|
||||
|
||||
bool GuiLabel::initialiseParams(std::string const & data)
|
||||
bool GuiLabel::initialiseParams(std::string const & sdata)
|
||||
{
|
||||
InsetCommandParams p(insetCode());
|
||||
if (!InsetCommand::string2params(data, p))
|
||||
if (!InsetCommand::string2params(sdata, p))
|
||||
return false;
|
||||
keywordED->setText(toqstr(p["name"]));
|
||||
return true;
|
||||
|
@ -661,9 +661,9 @@ bool GuiListings::isValid()
|
||||
}
|
||||
|
||||
|
||||
bool GuiListings::initialiseParams(string const & data)
|
||||
bool GuiListings::initialiseParams(string const & sdata)
|
||||
{
|
||||
InsetListings::string2params(data, params_);
|
||||
InsetListings::string2params(sdata, params_);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -219,9 +219,9 @@ bool GuiLog::contains(QRegExp const & exp) const
|
||||
}
|
||||
|
||||
|
||||
bool GuiLog::initialiseParams(string const & data)
|
||||
bool GuiLog::initialiseParams(string const & sdata)
|
||||
{
|
||||
istringstream is(data);
|
||||
istringstream is(sdata);
|
||||
Lexer lex;
|
||||
lex.setStream(is);
|
||||
|
||||
|
@ -65,10 +65,10 @@ docstring GuiNomenclature::dialogToParams() const
|
||||
}
|
||||
|
||||
|
||||
bool GuiNomenclature::initialiseParams(std::string const & data)
|
||||
bool GuiNomenclature::initialiseParams(std::string const & sdata)
|
||||
{
|
||||
InsetCommandParams p(insetCode());
|
||||
if (!InsetCommand::string2params(data, p))
|
||||
if (!InsetCommand::string2params(sdata, p))
|
||||
return false;
|
||||
symbolED->setText(toqstr(p["symbol"]));
|
||||
return true;
|
||||
|
@ -73,9 +73,9 @@ void GuiNote::applyView()
|
||||
}
|
||||
|
||||
|
||||
bool GuiNote::initialiseParams(string const & data)
|
||||
bool GuiNote::initialiseParams(string const & sdata)
|
||||
{
|
||||
InsetNote::string2params(data, params_);
|
||||
InsetNote::string2params(sdata, params_);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -340,9 +340,9 @@ ParagraphParameters const & GuiParagraph::params() const
|
||||
|
||||
void GuiParagraph::dispatchParams()
|
||||
{
|
||||
ostringstream data;
|
||||
params_.write(data);
|
||||
FuncRequest const fr(getLfun(), data.str());
|
||||
ostringstream os;
|
||||
params_.write(os);
|
||||
FuncRequest const fr(getLfun(), os.str());
|
||||
dispatch(fr);
|
||||
}
|
||||
|
||||
|
@ -72,9 +72,9 @@ void GuiPhantom::applyView()
|
||||
}
|
||||
|
||||
|
||||
bool GuiPhantom::initialiseParams(string const & data)
|
||||
bool GuiPhantom::initialiseParams(string const & sdata)
|
||||
{
|
||||
InsetPhantom::string2params(data, params_);
|
||||
InsetPhantom::string2params(sdata, params_);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -114,11 +114,11 @@ void GuiPrintindex::paramsToDialog(InsetCommandParams const & /*icp*/)
|
||||
}
|
||||
|
||||
|
||||
bool GuiPrintindex::initialiseParams(string const & data)
|
||||
bool GuiPrintindex::initialiseParams(string const & sdata)
|
||||
{
|
||||
// The name passed with LFUN_INSET_APPLY is also the name
|
||||
// used to identify the mailer.
|
||||
InsetCommand::string2params(data, params_);
|
||||
InsetCommand::string2params(sdata, params_);
|
||||
paramsToDialog(params_);
|
||||
return true;
|
||||
}
|
||||
|
@ -123,9 +123,9 @@ void GuiSearch::replaceallClicked()
|
||||
void GuiSearch::find(docstring const & search, bool casesensitive,
|
||||
bool matchword, bool forward)
|
||||
{
|
||||
docstring const data =
|
||||
docstring const sdata =
|
||||
find2string(search, casesensitive, matchword, forward);
|
||||
dispatch(FuncRequest(LFUN_WORD_FIND, data));
|
||||
dispatch(FuncRequest(LFUN_WORD_FIND, sdata));
|
||||
}
|
||||
|
||||
|
||||
@ -133,10 +133,10 @@ void GuiSearch::replace(docstring const & search, docstring const & replace,
|
||||
bool casesensitive, bool matchword,
|
||||
bool forward, bool all)
|
||||
{
|
||||
docstring const data =
|
||||
docstring const sdata =
|
||||
replace2string(replace, search, casesensitive,
|
||||
matchword, all, forward);
|
||||
dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
|
||||
dispatch(FuncRequest(LFUN_WORD_REPLACE, sdata));
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,9 +50,9 @@ void GuiShowFile::updateContents()
|
||||
}
|
||||
|
||||
|
||||
bool GuiShowFile::initialiseParams(string const & data)
|
||||
bool GuiShowFile::initialiseParams(string const & sdata)
|
||||
{
|
||||
filename_ = FileName(data);
|
||||
filename_ = FileName(sdata);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -93,8 +93,9 @@ void GuiTabularCreate::clearParams()
|
||||
|
||||
void GuiTabularCreate::dispatchParams()
|
||||
{
|
||||
string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
|
||||
dispatch(FuncRequest(getLfun(), data));
|
||||
string const sdata =
|
||||
convert<string>(params().first) + ' ' + convert<string>(params().second);
|
||||
dispatch(FuncRequest(getLfun(), sdata));
|
||||
}
|
||||
|
||||
|
||||
|
@ -93,10 +93,10 @@ void GuiTexInfo::viewClicked()
|
||||
// takes advantage of enum order
|
||||
static QString const ext[] = { "cls", "sty", "bst", "bib", "bbx", "cbx" };
|
||||
int const fitem = fileListLW->currentRow();
|
||||
QStringList const & data = texdata_[activeStyle_];
|
||||
QString file = data[fitem];
|
||||
QStringList const & sdata = texdata_[activeStyle_];
|
||||
QString file = sdata[fitem];
|
||||
if (!pathCB->isChecked())
|
||||
file = texFileFromList(data[fitem], ext[activeStyle_]);
|
||||
file = texFileFromList(sdata[fitem], ext[activeStyle_]);
|
||||
viewFile(file);
|
||||
}
|
||||
|
||||
@ -124,28 +124,28 @@ void GuiTexInfo::updateStyles(TexFileType type)
|
||||
|
||||
QString const filename = filenames[type];
|
||||
|
||||
QStringList data = texFileList(filename);
|
||||
if (data.empty()) {
|
||||
QStringList flist = texFileList(filename);
|
||||
if (flist.empty()) {
|
||||
// build filelists of all availabe bst/cls/sty-files.
|
||||
// Done through kpsewhich and an external script,
|
||||
// saved in *Files.lst
|
||||
rescanTexStyles();
|
||||
data = texFileList(filename);
|
||||
flist = texFileList(filename);
|
||||
}
|
||||
|
||||
if (!pathCB->isChecked()) {
|
||||
for (int i = 0; i != data.size(); ++i)
|
||||
data[i] = onlyFileName(data[i]);
|
||||
for (int i = 0; i != flist.size(); ++i)
|
||||
flist[i] = onlyFileName(flist[i]);
|
||||
}
|
||||
// sort on filename only (no path)
|
||||
data.sort();
|
||||
flist.sort();
|
||||
|
||||
fileListLW->clear();
|
||||
for(QString const & item : data)
|
||||
for(QString const & item : flist)
|
||||
fileListLW->addItem(item);
|
||||
|
||||
activeStyle_ = type;
|
||||
texdata_[type] = data;
|
||||
texdata_[type] = flist;
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,9 +48,9 @@ void GuiToc::updateView()
|
||||
}
|
||||
|
||||
|
||||
bool GuiToc::initialiseParams(string const & data)
|
||||
bool GuiToc::initialiseParams(string const & sdata)
|
||||
{
|
||||
widget_->init(toqstr(data));
|
||||
widget_->init(toqstr(sdata));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1704,10 +1704,10 @@ void GuiView::errors(string const & error_type, bool from_master)
|
||||
if (el.empty())
|
||||
return;
|
||||
|
||||
string data = error_type;
|
||||
string err = error_type;
|
||||
if (from_master)
|
||||
data = "from_master|" + error_type;
|
||||
showDialog("errorlist", data);
|
||||
err = "from_master|" + error_type;
|
||||
showDialog("errorlist", err);
|
||||
}
|
||||
|
||||
|
||||
@ -1732,7 +1732,7 @@ void GuiView::structureChanged()
|
||||
}
|
||||
|
||||
|
||||
void GuiView::updateDialog(string const & name, string const & data)
|
||||
void GuiView::updateDialog(string const & name, string const & sdata)
|
||||
{
|
||||
if (!isDialogVisible(name))
|
||||
return;
|
||||
@ -1743,7 +1743,7 @@ void GuiView::updateDialog(string const & name, string const & data)
|
||||
|
||||
Dialog * const dialog = it->second.get();
|
||||
if (dialog->isVisibleView())
|
||||
dialog->initialiseParams(data);
|
||||
dialog->initialiseParams(sdata);
|
||||
}
|
||||
|
||||
|
||||
@ -4044,43 +4044,43 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
||||
|
||||
case LFUN_DIALOG_SHOW: {
|
||||
string const name = cmd.getArg(0);
|
||||
string data = trim(to_utf8(cmd.argument()).substr(name.size()));
|
||||
string sdata = trim(to_utf8(cmd.argument()).substr(name.size()));
|
||||
|
||||
if (name == "character") {
|
||||
data = freefont2string();
|
||||
if (!data.empty())
|
||||
showDialog("character", data);
|
||||
sdata = freefont2string();
|
||||
if (!sdata.empty())
|
||||
showDialog("character", sdata);
|
||||
} else if (name == "latexlog") {
|
||||
// getStatus checks that
|
||||
// gettatus checks that
|
||||
LATTEST(doc_buffer);
|
||||
Buffer::LogType type;
|
||||
string const logfile = doc_buffer->logName(&type);
|
||||
switch (type) {
|
||||
case Buffer::latexlog:
|
||||
data = "latex ";
|
||||
sdata = "latex ";
|
||||
break;
|
||||
case Buffer::buildlog:
|
||||
data = "literate ";
|
||||
sdata = "literate ";
|
||||
break;
|
||||
}
|
||||
data += Lexer::quoteString(logfile);
|
||||
showDialog("log", data);
|
||||
sdata += Lexer::quoteString(logfile);
|
||||
showDialog("log", sdata);
|
||||
} else if (name == "vclog") {
|
||||
// getStatus checks that
|
||||
LATTEST(doc_buffer);
|
||||
string const data = "vc " +
|
||||
string const sdata2 = "vc " +
|
||||
Lexer::quoteString(doc_buffer->lyxvc().getLogFile());
|
||||
showDialog("log", data);
|
||||
showDialog("log", sdata2);
|
||||
} else if (name == "symbols") {
|
||||
data = bv->cursor().getEncoding()->name();
|
||||
if (!data.empty())
|
||||
showDialog("symbols", data);
|
||||
sdata = bv->cursor().getEncoding()->name();
|
||||
if (!sdata.empty())
|
||||
showDialog("symbols", sdata);
|
||||
// bug 5274
|
||||
} else if (name == "prefs" && isFullScreen()) {
|
||||
lfunUiToggle("fullscreen");
|
||||
showDialog("prefs", data);
|
||||
showDialog("prefs", sdata);
|
||||
} else
|
||||
showDialog(name, data);
|
||||
showDialog(name, sdata);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -4506,10 +4506,10 @@ Dialog * GuiView::findOrBuild(string const & name, bool hide_it)
|
||||
}
|
||||
|
||||
|
||||
void GuiView::showDialog(string const & name, string const & data,
|
||||
void GuiView::showDialog(string const & name, string const & sdata,
|
||||
Inset * inset)
|
||||
{
|
||||
triggerShowDialog(toqstr(name), toqstr(data), inset);
|
||||
triggerShowDialog(toqstr(name), toqstr(sdata), inset);
|
||||
}
|
||||
|
||||
|
||||
@ -4520,14 +4520,14 @@ void GuiView::doShowDialog(QString const & qname, QString const & qdata,
|
||||
return;
|
||||
|
||||
const string name = fromqstr(qname);
|
||||
const string data = fromqstr(qdata);
|
||||
const string sdata = fromqstr(qdata);
|
||||
|
||||
d.in_show_ = true;
|
||||
try {
|
||||
Dialog * dialog = findOrBuild(name, false);
|
||||
if (dialog) {
|
||||
bool const visible = dialog->isVisibleView();
|
||||
dialog->showData(data);
|
||||
dialog->showData(sdata);
|
||||
if (inset && currentBufferView())
|
||||
currentBufferView()->editInset(name, inset);
|
||||
// We only set the focus to the new dialog if it was not yet
|
||||
|
@ -187,9 +187,9 @@ void GuiWrap::paramsToDialog(InsetWrapParams const & params)
|
||||
}
|
||||
|
||||
|
||||
bool GuiWrap::initialiseParams(string const & data)
|
||||
bool GuiWrap::initialiseParams(string const & sdata)
|
||||
{
|
||||
InsetWrap::string2params(data, params_);
|
||||
InsetWrap::string2params(sdata, params_);
|
||||
paramsToDialog(params_);
|
||||
return true;
|
||||
}
|
||||
|
@ -110,8 +110,8 @@ void InsertTableWidget::mouseMoveEvent(QMouseEvent * event)
|
||||
void InsertTableWidget::mouseReleaseEvent(QMouseEvent * /*event*/)
|
||||
{
|
||||
if (underMouse_) {
|
||||
QString const data = QString("%1 %2").arg(bottom_).arg(right_);
|
||||
lyx::dispatch(FuncRequest(LFUN_TABULAR_INSERT, fromqstr(data)));
|
||||
QString const qdata = QString("%1 %2").arg(bottom_).arg(right_);
|
||||
lyx::dispatch(FuncRequest(LFUN_TABULAR_INSERT, fromqstr(qdata)));
|
||||
}
|
||||
// emit signal
|
||||
visible(false);
|
||||
|
@ -90,9 +90,9 @@ InsetParamsDialog::~InsetParamsDialog()
|
||||
}
|
||||
|
||||
|
||||
bool InsetParamsDialog::initialiseParams(std::string const & data)
|
||||
bool InsetParamsDialog::initialiseParams(std::string const & sdata)
|
||||
{
|
||||
if (!d->widget_->initialiseParams(data))
|
||||
if (!d->widget_->initialiseParams(sdata))
|
||||
on_restorePB_clicked();
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user