]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QWrap.C
the convert patch
[lyx.git] / src / frontends / qt2 / QWrap.C
index b871e28a8ab25cf445fdb1662fdb5bc2d059ff15..72fd1181b1b5f7dde3593118f6f5ff03f2ec38b9 100644 (file)
@@ -3,36 +3,40 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Juergen Spitzmueller
+ * \author Jürgen Spitzmüller
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#include "debug.h"
-#include "qt_helpers.h"
-#include "support/lstrings.h"
-#include "LyXView.h"
-#include "ControlWrap.h"
-
 #include "QWrap.h"
 #include "QWrapDialog.h"
 #include "Qt2BC.h"
+
 #include "lengthcombo.h"
+#include "qt_helpers.h"
+
+#include "controllers/ControlWrap.h"
 
 #include "insets/insetwrap.h"
 
-#include <qpushbutton.h>
-#include <qcombobox.h>
+#include "support/convert.h"
+#include "support/lstrings.h"
+
 #include <qlineedit.h>
+#include <qpushbutton.h>
 
 
-typedef QController<ControlWrap, QView<QWrapDialog> > base_class;
+using std::string;
 
+namespace lyx {
+namespace frontend {
+
+typedef QController<ControlWrap, QView<QWrapDialog> > base_class;
 
 QWrap::QWrap(Dialog & parent)
-       : base_class(parent, qt_("LyX: Text Wrap Settings"))
+       : base_class(parent, _("LyX: Text Wrap Settings"))
 {
 }
 
@@ -54,7 +58,7 @@ void QWrap::build_dialog()
 
 void QWrap::apply()
 {
-       double const value = strToDbl(fromqstr(dialog_->widthED->text()));
+       double const value = convert<double>(fromqstr(dialog_->widthED->text()));
        LyXLength::UNIT unit = dialog_->unitsLC->currentLengthItem();
        if (dialog_->widthED->text().isEmpty())
                unit = LyXLength::UNIT_NONE;
@@ -83,7 +87,10 @@ void QWrap::apply()
 namespace {
 
 string const numtostr(double val) {
-       string a(tostr(val));
+       string a(convert<string>(val));
+#ifdef WITH_WARNINGS
+#warning Will this test ever trigger? (Lgb)
+#endif
        if (a == "0")
                a.erase();
        return a;
@@ -110,3 +117,6 @@ void QWrap::update_contents()
 
        dialog_->valignCO->setCurrentItem(item);
 }
+
+} // namespace frontend
+} // namespace lyx