]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiExternal.cpp
Don't allow newline characters in preference (#5840).
[lyx.git] / src / frontends / qt4 / GuiExternal.cpp
index 8f3402f20908b8decec5c2f4a92627e9eb994a3d..b3d9e44ec00de963541cba2e01bf39974648b4b7 100644 (file)
@@ -296,7 +296,7 @@ void GuiExternal::getbbClicked()
        if (filename.empty())
                return;
 
-       FileName const abs_file(support::makeAbsPath(filename, fromqstr(bufferFilepath())));
+       FileName const abs_file(support::makeAbsPath(filename, fromqstr(bufferFilePath())));
 
        // try to get it from the file, if possible
        string bb = readBB_from_PSFile(abs_file);
@@ -460,7 +460,7 @@ static void getCrop(external::ClipData & data,
 void GuiExternal::updateContents()
 {
        string const name =
-               params_.filename.outputFileName(fromqstr(bufferFilepath()));
+               params_.filename.outputFileName(fromqstr(bufferFilePath()));
        fileED->setText(toqstr(name));
 
        int index = 0;
@@ -512,21 +512,19 @@ void GuiExternal::updateTemplate()
        TransformIDs::const_iterator tr_begin = transformIds.begin();
        TransformIDs::const_iterator const tr_end = transformIds.end();
 
-       bool found = std::find(tr_begin, tr_end, external::Rotate) != tr_end;
-       rotationGB->setEnabled(found);
+       bool rotate = std::find(tr_begin, tr_end, external::Rotate) != tr_end;
+       rotationGB->setEnabled(rotate);
 
-       found = std::find(tr_begin, tr_end, external::Resize) != tr_end;
-       scaleGB->setEnabled(found);
+       bool resize = std::find(tr_begin, tr_end, external::Resize) != tr_end;
+       scaleGB->setEnabled(resize);
 
-       found = std::find(tr_begin, tr_end, external::Clip) != tr_end;
-       cropGB->setEnabled(found);
+       bool clip = std::find(tr_begin, tr_end, external::Clip) != tr_end;
+       cropGB->setEnabled(clip);
 
-       tab->setTabEnabled(tab->indexOf(sizetab),
-               rotationGB->isEnabled()
-               || scaleGB->isEnabled()
-               || cropGB->isEnabled());
+       sizetab->setEnabled(rotate || resize || clip);
+       tab->setTabEnabled(tab->indexOf(sizetab), rotate || resize || clip);
 
-       found = std::find(tr_begin, tr_end, external::Extra) != tr_end;
+       bool found = std::find(tr_begin, tr_end, external::Extra) != tr_end;
        optionsGB->setEnabled(found);
 
        bool scaled = displayGB->isChecked() && displayGB->isEnabled() &&
@@ -570,7 +568,7 @@ void GuiExternal::updateTemplate()
 
 void GuiExternal::applyView()
 {
-       params_.filename.set(fromqstr(fileED->text()), fromqstr(bufferFilepath()));
+       params_.filename.set(fromqstr(fileED->text()), fromqstr(bufferFilePath()));
        params_.settemplate(getTemplate(externalCO->currentIndex()).lyxName);
 
        params_.draft = draftCB->isChecked();
@@ -633,13 +631,13 @@ QString GuiExternal::browse(QString const & input,
                                     QString const & template_name) const
 {
        QString const title = qt_("Select external file");
-       QString const bufpath = bufferFilepath();
+       QString const bufpath = bufferFilePath();
        QStringList const filter = templateFilters(template_name);
 
        QString const label1 = qt_("Documents|#o#O");
        QString const dir1 = toqstr(lyxrc.document_path);
 
-       return browseRelFile(input, bufpath, title, filter, false, label1, dir1);
+       return browseRelToParent(input, bufpath, title, filter, false, label1, dir1);
 }