[LyX/master] ru.po: is now 100% translated

2018-02-10 Thread Uwe Stöhr
commit 338dc16d767da7b3e6c19f71c5f03e44de5656a7
Author: Uwe Stöhr 
Date:   Sat Feb 10 19:34:42 2018 +0100

ru.po: is now 100% translated

big respect to Yuriy!

 po/ru.po |  954 +-
 1 files changed, 503 insertions(+), 451 deletions(-)


[LyX/2.3.x] ru.po: is now 100% translated

2018-02-10 Thread Uwe Stöhr
commit 037be1556d558eb11fef4d1fd399f003fb82deb9
Author: Uwe Stöhr 
Date:   Sat Feb 10 19:34:29 2018 +0100

ru.po: is now 100% translated

big respect to Yuriy!

 po/ru.po |  954 +-
 1 files changed, 503 insertions(+), 451 deletions(-)


[LyX/master] amend 71fea633266

2018-02-10 Thread Juergen Spitzmueller
commit be4d49ebd107cb4b91844a555302a6052457c483
Author: Juergen Spitzmueller 
Date:   Sat Feb 10 19:02:35 2018 +0100

amend 71fea633266
---
 src/frontends/qt4/GuiView.cpp |   10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 7090c3c..6f5441c 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1932,15 +1932,19 @@ bool GuiView::getStatus(FuncRequest const & cmd, 
FuncStatus & flag)
break;
 
case LFUN_BUFFER_CHKTEX: {
+   // hide if we have no checktex command
+   if (lyxrc.chktex_command.empty()) {
+   flag.setUnknown(true);
+   enable = false;
+   break;
+   }
if (!doc_buffer || !doc_buffer->params().isLatex()
|| d.processing_thread_watcher_.isRunning()) {
// grey out, don't hide
enable = false;
break;
}
-   // hide if we have no checktex command
-   enable = !lyxrc.chktex_command.empty();
-   flag.setUnknown(!enable);
+   enable = true;
break;
}
 


[LyX/2.3.x] Fix race condition in processFuncRequestQueue

2018-02-10 Thread Juergen Spitzmueller
commit fe414fcdd8a7c4d0aaf8b30afade7dc0d59ab2b7
Author: Juergen Spitzmueller 
Date:   Sat Feb 10 15:35:12 2018 +0100

Fix race condition in processFuncRequestQueue

The issue here was that the element was only removed from the queue
after the func request was processed, but within that process, other
function could access the queue, so the queue could even be empty
when this function finally wanted to remove the item.

Fixes: #10406.
(cherry picked from commit dadec50a18d92d24d42e1ccf7474f07a2a66b5b4)
---
 src/frontends/qt4/GuiApplication.cpp |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt4/GuiApplication.cpp 
b/src/frontends/qt4/GuiApplication.cpp
index 97a60e9..35b639c 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -2289,8 +2289,12 @@ void GuiApplication::processFuncRequestAsync(FuncRequest 
const & func)
 void GuiApplication::processFuncRequestQueue()
 {
while (!d->func_request_queue_.empty()) {
-   processFuncRequest(d->func_request_queue_.front());
+   // take the item from the stack _before_ processing the
+   // request in order to avoid race conditions from nested
+   // or parallel requests (see #10406)
+   FuncRequest const fr(d->func_request_queue_.front());
d->func_request_queue_.pop();
+   processFuncRequest(fr);
}
 }
 


[LyX/master] Disable CheckTeX while buffer is processed

2018-02-10 Thread Juergen Spitzmueller
commit 71fea6332667e1a9fe99c38624e4dcaf1129d6c5
Author: Juergen Spitzmueller 
Date:   Sat Feb 10 18:18:43 2018 +0100

Disable CheckTeX while buffer is processed

Since CheckTeX itself processes the tex file, a synchronous run with
a TeX process can lead to all sorts of conflicts, including crashes.

Fixes: #7434.
---
 lib/ui/stdmenus.inc   |2 +-
 src/Buffer.cpp|8 
 src/frontends/qt4/GuiView.cpp |   18 ++
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc
index 57077ed..1bed239 100644
--- a/lib/ui/stdmenus.inc
+++ b/lib/ui/stdmenus.inc
@@ -595,7 +595,7 @@ Menuset
Item "Spellchecker...|S" "dialog-show spellchecker"
OptItem "Thesaurus...|T" "thesaurus-entry"
Item "Statistics...|a" "statistics"
-   OptItem "Check TeX|h" "buffer-chktex"
+   Item "Check TeX|h" "buffer-chktex"
Item "TeX Information|I" "dialog-show texinfo"
Item "Compare...|C" "dialog-show compare"
Separator
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 462094f..f42233f 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -2528,10 +2528,6 @@ bool Buffer::getStatus(FuncRequest const & cmd, 
FuncStatus & flag)
break;
}
 
-   case LFUN_BUFFER_CHKTEX:
-   enable = params().isLatex() && !lyxrc.chktex_command.empty();
-   break;
-
case LFUN_BUILD_PROGRAM:
enable = params().isExportable("program", false);
break;
@@ -2644,10 +2640,6 @@ void Buffer::dispatch(FuncRequest const & func, 
DispatchResult & dr)
break;
}
 
-   case LFUN_BUFFER_CHKTEX:
-   runChktex();
-   break;
-
case LFUN_BUFFER_EXPORT_CUSTOM: {
string format_name;
string command = split(argument, format_name, ' ');
diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 9086464..7090c3c 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1931,6 +1931,19 @@ bool GuiView::getStatus(FuncRequest const & cmd, 
FuncStatus & flag)
enable = theBufferList().last() != theBufferList().first();
break;
 
+   case LFUN_BUFFER_CHKTEX: {
+   if (!doc_buffer || !doc_buffer->params().isLatex()
+   || d.processing_thread_watcher_.isRunning()) {
+   // grey out, don't hide
+   enable = false;
+   break;
+   }
+   // hide if we have no checktex command
+   enable = !lyxrc.chktex_command.empty();
+   flag.setUnknown(!enable);
+   break;
+   }
+
case LFUN_VIEW_SPLIT:
if (cmd.getArg(0) == "vertical")
enable = doc_buffer && (d.splitter_->count() == 1 ||
@@ -3794,6 +3807,11 @@ void GuiView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
gotoNextOrPreviousBuffer(PREVBUFFER, true);
break;
 
+   case LFUN_BUFFER_CHKTEX:
+   LASSERT(doc_buffer, break);
+   doc_buffer->runChktex();
+   break;
+
case LFUN_COMMAND_EXECUTE: {
command_execute_ = true;
minibuffer_focus_ = true;


[LyX/master] Fix race condition in processFuncRequestQueue

2018-02-10 Thread Juergen Spitzmueller
commit dadec50a18d92d24d42e1ccf7474f07a2a66b5b4
Author: Juergen Spitzmueller 
Date:   Sat Feb 10 15:35:12 2018 +0100

Fix race condition in processFuncRequestQueue

The issue here was that the element was only removed from the queue
after the func request was processed, but within that process, other
function could access the queue, so the queue could even be empty
when this function finally wanted to remove the item.

Fixes: #10406.
---
 src/frontends/qt4/GuiApplication.cpp |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt4/GuiApplication.cpp 
b/src/frontends/qt4/GuiApplication.cpp
index 67643d5..fbd0f54 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -2271,8 +2271,12 @@ void GuiApplication::processFuncRequestAsync(FuncRequest 
const & func)
 void GuiApplication::processFuncRequestQueue()
 {
while (!d->func_request_queue_.empty()) {
-   processFuncRequest(d->func_request_queue_.front());
+   // take the item from the stack _before_ processing the
+   // request in order to avoid race conditions from nested
+   // or parallel requests (see #10406)
+   FuncRequest const fr(d->func_request_queue_.front());
d->func_request_queue_.pop();
+   processFuncRequest(fr);
}
 }
 


[LyX/master] Cmake build: Allow cross-compiling with mingw again

2018-02-10 Thread Kornel Benko
commit 454f56b5f22e6a6e8d2f3ee41a33d1fdee034e4e
Author: Kornel Benko 
Date:   Sat Feb 10 11:21:08 2018 +0100

Cmake build: Allow cross-compiling with mingw again

1.) The check for "QT_USES_X11" expects the created application
  to run, but the '.exe' file does not run on linux.
2.) Don't use megered build anymore, it is not faster
  on multi-processor machines anyway
---
 development/cmake/ConfigureChecks.cmake |   39 ++
 development/cmake/scripts/xmingw|2 +-
 2 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/development/cmake/ConfigureChecks.cmake 
b/development/cmake/ConfigureChecks.cmake
index d2695b0..d998e5b 100644
--- a/development/cmake/ConfigureChecks.cmake
+++ b/development/cmake/ConfigureChecks.cmake
@@ -240,22 +240,29 @@ if(LYX_USE_QT MATCHES "QT5")
   else()
 set(lyx_qt5_config "QtCore/qconfig.h")
   endif()
-  check_cxx_source_runs(
-"
-#include <${lyx_qt5_config}>
-#include 
-using namespace std;
-string a(QT_QPA_DEFAULT_PLATFORM_NAME);
-int main(int argc, char **argv)
-{
-  if (a.compare(\"xcb\") == 0)
-   return(0);
-  else
-   return 1;
-}
-"
-QT_USES_X11)
-  set(QPA_XCB ${QT_USES_X11})
+  if(WIN32)
+set(QT_USES_X11 CACHE "Win32 compiled without X11" 0)
+# The try_run for minngw would not work here anyway
+  else()
+check_cxx_source_runs(
+  "
+  #include <${lyx_qt5_config}>
+  #include 
+  using namespace std;
+  string a(QT_QPA_DEFAULT_PLATFORM_NAME);
+  int main(int argc, char **argv)
+  {
+   if (a.compare(\"xcb\") == 0)
+ return(0);
+   else
+ return 1;
+  }
+  "
+  QT_USES_X11)
+if(QT_USES_X11)
+  set(QPA_XCB ${QT_USES_X11})
+endif()
+  endif()
 
   if (Qt5X11Extras_FOUND)
 get_target_property(_x11extra_prop Qt5::X11Extras IMPORTED_CONFIGURATIONS)
diff --git a/development/cmake/scripts/xmingw b/development/cmake/scripts/xmingw
index 3051a27..ec287da 100755
--- a/development/cmake/scripts/xmingw
+++ b/development/cmake/scripts/xmingw
@@ -98,7 +98,7 @@ checkExitCode
 # build LyX
 #
 
-mergefile=-DLYX_MERGE_FILES=1
+mergefile=-DLYX_MERGE_FILES=0
 #pch=-DLYX_PCH=1
 
 cmake $lyxsrcdir \


[LyX/2.3.x] Avoid an infinite loop

2018-02-10 Thread Enrico Forestieri
commit e43bf58223b5b4207211521b417c2ebf7c6b2fa3
Author: Enrico Forestieri 
Date:   Fri Feb 9 23:35:33 2018 +0100

Avoid an infinite loop

When pasting "\big" without any following delimiter, avoid
processing the same token again and again. For unknown reasons,
the delim docstring turns out to always be not empty: even when
it simply contains a '0' (no delimiter follows), its length is 1.

Fixes bug #11027.

(cherry picked from commit 8e8b3f610495493f4f1bff3f4a0ff48f4eab4539)
---
 src/mathed/MathParser.cpp |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp
index 35062ca..d7af40c 100644
--- a/src/mathed/MathParser.cpp
+++ b/src/mathed/MathParser.cpp
@@ -2000,7 +2000,10 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
new 
InsetMathBig(t.cs(), delim)));
else {

cell->push_back(createInsetMath(t.cs(), buf));
-   putback();
+   // For some reason delim.empty()
+   // is always false here
+   if (delim.at(0))
+   putback();
}
}