From 09df438f2e9103c81b69ad7b5160c5338b8a4fda Mon Sep 17 00:00:00 2001 From: Le Tan Date: Mon, 10 Jun 2019 20:44:41 +0800 Subject: [PATCH] Editor: bug fix for smart table caused by QString.arg() --- src/resources/vnote.ini | 2 +- src/vtable.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/resources/vnote.ini b/src/resources/vnote.ini index 39a88dc8..72db7cd9 100644 --- a/src/resources/vnote.ini +++ b/src/resources/vnote.ini @@ -334,7 +334,7 @@ editor_font_family= enable_smart_table=true ; Interval (milliseconds) to format table -table_format_interval=3000 +table_format_interval=2000 [export] ; Path of the wkhtmltopdf tool diff --git a/src/vtable.cpp b/src/vtable.cpp index ec9eb1cc..2704e841 100644 --- a/src/vtable.cpp +++ b/src/vtable.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "veditor.h" @@ -465,10 +466,10 @@ QString VTable::generateFormattedText(const QString &p_core, rightSpaces = 0; } - return QString("%1 %2%3%4 ").arg(c_borderChar) - .arg(QString(leftSpaces, ' ')) - .arg(p_core) - .arg(QString(rightSpaces, ' ')); + return QString("%1 %2%3%4 ").arg(c_borderChar, + QString(leftSpaces, ' '), + p_core, + QString(rightSpaces, ' ')); } VTable::Alignment VTable::getColumnAlignment(int p_idx) const