]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSendto.cpp
fix completion painting for RTL (inline completion and completion list)
[lyx.git] / src / frontends / qt4 / GuiSendto.cpp
index 891d2b97217e2377881c8d85a9770439f31c61a5..fe644a40f50c76a7091b0331ad7994af14a8b332 100644 (file)
 #include <config.h>
 
 #include "GuiSendto.h"
+#include "qt_helpers.h"
 
 #include "Buffer.h"
 #include "Converter.h"
 #include "Format.h"
 #include "FuncRequest.h"
 #include "LyXRC.h"
-#include "qt_helpers.h"
 
+#include "support/qstring_helpers.h"
 #include "support/filetools.h"
-#include "support/lstrings.h"
 
 #include <QListWidget>
 #include <QPushButton>
-#include <QCloseEvent>
 
 using namespace std;
 using namespace lyx::support;
@@ -65,13 +64,6 @@ void GuiSendTo::changed_adaptor()
 }
 
 
-void GuiSendTo::closeEvent(QCloseEvent * e)
-{
-       slotClose();
-       e->accept();
-}
-
-
 void GuiSendTo::updateContents()
 {
        all_formats_ = allFormats();
@@ -92,10 +84,10 @@ void GuiSendTo::updateContents()
 
        for (vector<string>::const_iterator it = keys.begin();
             it != keys.end(); ++it) {
-               formatLW->addItem(toqstr(*it));
+               formatLW->addItem(qt_(*it));
        }
 
-       commandCO->addItem(toqstr(command_));
+       commandCO->addItem(command_);
 }
 
 
@@ -103,11 +95,11 @@ void GuiSendTo::applyView()
 {
        int const line = formatLW->currentRow();
 
-       if (line < 0 || line > int(formatLW->count()))
+       if (line < 0 || line > formatLW->count())
                return;
 
        format_ = all_formats_[line];
-       command_ = trim(fromqstr(commandCO->currentText()));
+       command_ = commandCO->currentText().trimmed();
 }
 
 
@@ -126,17 +118,17 @@ bool GuiSendTo::isValid()
 bool GuiSendTo::initialiseParams(string const &)
 {
        format_ = 0;
-       command_ = lyxrc.custom_export_command;
+       command_ = toqstr(lyxrc.custom_export_command);
        return true;
 }
 
 
 void GuiSendTo::dispatchParams()
 {
-       if (command_.empty() || !format_ || format_->name().empty())
+       if (command_.isEmpty() || !format_ || format_->name().empty())
                return;
 
-       string const data = format_->name() + " " + command_;
+       string const data = format_->name() + " " + fromqstr(command_);
        dispatch(FuncRequest(getLfun(), data));
 }