[LyX/master] Fix compilation of ACM-sigplan

2014-04-21 Thread Scott Kostyshak
commit afdab15aa3e9551d2323634520df49669e6dcc76
Author: Scott Kostyshak skost...@lyx.org
Date:   Mon Apr 21 01:55:45 2014 -0400

Fix compilation of ACM-sigplan

Compilation was failing with TeX Live 2013 because of
the format of one of the references. This commit just
changes one of the references to a different one.

diff --git a/lib/templates/ACM-sigplan.lyx b/lib/templates/ACM-sigplan.lyx
index 8dc503e..6e746c4 100644
--- a/lib/templates/ACM-sigplan.lyx
+++ b/lib/templates/ACM-sigplan.lyx
@@ -329,7 +329,7 @@ Introduction
 Bla bla, as listed in 
 \begin_inset CommandInset citation
 LatexCommand cite
-key article-minimal,book-crossref
+key article-minimal,phdthesis-minimal
 
 \end_inset
 


[LyX/master] Invert new tests failing outside of default format

2014-04-21 Thread Scott Kostyshak
commit 06f12532d1c6d6e565dd11624442de45d1bd117f
Author: Scott Kostyshak skost...@lyx.org
Date:   Mon Apr 21 02:42:00 2014 -0400

Invert new tests failing outside of default format

These started failing after we implemented tests for formats
that are in the complement set to the default format (7ecbb068).
It might be worth it in the future to take a look at each individually
and see whether they are supposed to fail or if there is something LyX
can do to add support for exporting them.

diff --git a/development/autotests/revertedTests 
b/development/autotests/revertedTests
index a2e8629..f8d12e4 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -185,3 +185,265 @@ export/doc/zh_CN/Tutorial_dvi3_texF
 export/doc/zh_CN/Tutorial_pdf4_texF
 export/doc/zh_CN/Tutorial_pdf5_texF
 export/templates/ctex_pdf4_texF
+#
+# These started failing after we implemented tests for formats
+# that are in the complement set to the default format (7ecbb068).
+# TODO it might be worth it to take a look at each individually and
+# see whether they are supposed to fail or if there is something LyX
+# can do to add support for exporting them.
+export/doc/hu/Tutorial_dvi3_texF
+export/doc/hu/Tutorial_dvi3_systemF
+export/doc/ja/Additional_dvi3_texF
+export/doc/ja/Additional_dvi3_systemF
+export/doc/ja/Additional_pdf2
+export/doc/ja/Additional_pdf4_texF
+export/doc/ja/Additional_pdf4_systemF
+export/doc/ja/Additional_pdf5_texF
+export/doc/ja/Additional_pdf5_systemF
+export/doc/ja/Customization_dvi3_texF
+export/doc/ja/Customization_dvi3_systemF
+export/doc/ja/Customization_pdf2
+export/doc/ja/Customization_pdf4_texF
+export/doc/ja/Customization_pdf4_systemF
+export/doc/ja/Customization_pdf5_texF
+export/doc/ja/Customization_pdf5_systemF
+export/doc/ja/DummyDocument1_dvi3_texF
+export/doc/ja/DummyDocument1_dvi3_systemF
+export/doc/ja/DummyDocument1_pdf2
+export/doc/ja/DummyDocument1_pdf4_texF
+export/doc/ja/DummyDocument1_pdf4_systemF
+export/doc/ja/DummyDocument1_pdf5_texF
+export/doc/ja/DummyDocument1_pdf5_systemF
+export/doc/ja/DummyDocument2_dvi3_texF
+export/doc/ja/DummyDocument2_dvi3_systemF
+export/doc/ja/DummyDocument2_pdf2
+export/doc/ja/DummyDocument2_pdf4_texF
+export/doc/ja/DummyDocument2_pdf4_systemF
+export/doc/ja/DummyDocument2_pdf5_texF
+export/doc/ja/DummyDocument2_pdf5_systemF
+export/doc/ja/EmbeddedObjects_dvi3_texF
+export/doc/ja/EmbeddedObjects_dvi3_systemF
+export/doc/ja/EmbeddedObjects_pdf2
+export/doc/ja/EmbeddedObjects_pdf4_texF
+export/doc/ja/EmbeddedObjects_pdf4_systemF
+export/doc/ja/EmbeddedObjects_pdf5_texF
+export/doc/ja/EmbeddedObjects_pdf5_systemF
+export/doc/ja/Formula-numbering_dvi3_texF
+export/doc/ja/Formula-numbering_dvi3_systemF
+export/doc/ja/Formula-numbering_pdf2
+export/doc/ja/Formula-numbering_pdf4_texF
+export/doc/ja/Formula-numbering_pdf4_systemF
+export/doc/ja/Formula-numbering_pdf5_texF
+export/doc/ja/Formula-numbering_pdf5_systemF
+export/doc/ja/Intro_dvi3_texF
+export/doc/ja/Intro_dvi3_systemF
+export/doc/ja/Intro_pdf2
+export/doc/ja/Intro_pdf4_texF
+export/doc/ja/Intro_pdf4_systemF
+export/doc/ja/Intro_pdf5_texF
+export/doc/ja/Intro_pdf5_systemF
+export/doc/ja/LaTeXConfig_dvi3_texF
+export/doc/ja/LaTeXConfig_dvi3_systemF
+export/doc/ja/LaTeXConfig_pdf2
+export/doc/ja/LaTeXConfig_pdf4_texF
+export/doc/ja/LaTeXConfig_pdf4_systemF
+export/doc/ja/LaTeXConfig_pdf5_texF
+export/doc/ja/LaTeXConfig_pdf5_systemF
+export/doc/ja/Math_dvi3_texF
+export/doc/ja/Math_dvi3_systemF
+export/doc/ja/Math_pdf2
+export/doc/ja/Math_pdf4_texF
+export/doc/ja/Math_pdf4_systemF
+export/doc/ja/Math_pdf5_texF
+export/doc/ja/Math_pdf5_systemF
+export/doc/ja/Shortcuts_dvi3_texF
+export/doc/ja/Shortcuts_dvi3_systemF
+export/doc/ja/Shortcuts_pdf2
+export/doc/ja/Shortcuts_pdf4_texF
+export/doc/ja/Shortcuts_pdf4_systemF
+export/doc/ja/Shortcuts_pdf5_texF
+export/doc/ja/Shortcuts_pdf5_systemF
+export/doc/ja/Tutorial_dvi3_texF
+export/doc/ja/Tutorial_dvi3_systemF
+export/doc/ja/Tutorial_pdf2
+export/doc/ja/Tutorial_pdf4_texF
+export/doc/ja/Tutorial_pdf4_systemF
+export/doc/ja/Tutorial_pdf5_texF
+export/doc/ja/Tutorial_pdf5_systemF
+export/doc/ja/UserGuide_dvi3_texF
+export/doc/ja/UserGuide_dvi3_systemF
+export/doc/ja/UserGuide_pdf2
+export/doc/ja/UserGuide_pdf4_texF
+export/doc/ja/UserGuide_pdf4_systemF
+export/doc/ja/UserGuide_pdf5_texF
+export/doc/ja/UserGuide_pdf5_systemF
+export/examples/chess-article_pdf2
+export/examples/chess-article_pdf5_texF
+export/examples/chess-article_pdf5_systemF
+export/examples/chessgame_pdf2
+export/examples/chessgame_pdf5_texF
+export/examples/chessgame_pdf5_systemF
+export/examples/docbook_article_dvi3_texF
+export/examples/docbook_article_dvi3_systemF
+export/examples/docbook_article_pdf2
+export/examples/docbook_article_pdf4_texF
+export/examples/docbook_article_pdf4_systemF
+export/examples/docbook_article_pdf5_texF
+export/examples/docbook_article_pdf5_systemF
+export/examples/instant_preview_dvi3_systemF

[LyX/master] Fix the ignored path of the JASA files

2014-04-21 Thread Scott Kostyshak
commit 55b3341fba1f3a080d99927dd6f46d7746c0c8b1
Author: Scott Kostyshak skost...@lyx.org
Date:   Mon Apr 21 02:01:03 2014 -0400

Fix the ignored path of the JASA files

This follows a860d18b which moved the JASA file back from
being an example to a template.

diff --git a/development/autotests/ignoredTests 
b/development/autotests/ignoredTests
index 174247d..6f8ed09 100644
--- a/development/autotests/ignoredTests
+++ b/development/autotests/ignoredTests
@@ -5,7 +5,7 @@
 check_load/templates/attic/latex8
 export/templates/attic/latex8_pdf.*
 # LuaTeX and XeTeX both enter in infinite loops
-export/examples/JASA_.*_systemF
+export/templates/JASA_.*_systemF
 #
 # not compilable with LuaTeX
 export/doc/hu/Tutorial_pdf5_.*


[LyX/master] Fix compilation of Springer template

2014-04-21 Thread Scott Kostyshak
commit 4133be11b3ba4a15e7b01ebf375b8b3398dd5999
Author: Scott Kostyshak skost...@lyx.org
Date:   Mon Apr 21 02:12:10 2014 -0400

Fix compilation of Springer template

Replace two images with text placeholders. This is necessary
after a860d18b moved the file back from being an example.

diff --git a/lib/templates/springer/svjour3.lyx 
b/lib/templates/springer/svjour3.lyx
index fb42425..e874ed5 100644
--- a/lib/templates/springer/svjour3.lyx
+++ b/lib/templates/springer/svjour3.lyx
@@ -592,15 +592,10 @@ only for one column documents:
 \begin_inset Float figure
 wide false
 sideways false
-status collapsed
+status open
 
 \begin_layout Plain Layout
-\begin_inset Graphics
-   filename ../CV-image.png
-
-\end_inset
-
-
+insert a figure here
 \end_layout
 
 \begin_layout Plain Layout
@@ -640,16 +635,10 @@ only for two column documents:
 \begin_inset Float figure
 wide true
 sideways false
-status collapsed
+status open
 
 \begin_layout Plain Layout
-\begin_inset Graphics
-   filename ../CV-image.png
-   width 75text%
-
-\end_inset
-
-
+insert a figure here
 \end_layout
 
 \begin_layout Plain Layout


[LyX/master] CMake: specific modules for Qt5

2014-04-21 Thread Richard Heck
commit 2da0d3277165bb8a6ea1049460c3a161f74017fc
Author: Benjamin Piwowarski benja...@bpiwowar.net
Date:   Sun Mar 9 10:24:41 2014 +0100

CMake: specific modules for Qt5

diff --git a/src/frontends/qt4/CMakeLists.txt b/src/frontends/qt4/CMakeLists.txt
index 14283ea..16d8b51 100644
--- a/src/frontends/qt4/CMakeLists.txt
+++ b/src/frontends/qt4/CMakeLists.txt
@@ -54,7 +54,11 @@ else()
 endif()
 set_target_properties(frontend_qt4 PROPERTIES FOLDER applications/LyX)
 
-qt_use_modules(frontend_qt4 Core Gui Widgets Concurrent)
+if(Qt5Core_FOUND AND APPLE)
+   qt_use_modules(frontend_qt4 Core Gui Widgets Concurrent MacExtras)
+else()
+   qt_use_modules(frontend_qt4 Core Gui Widgets Concurrent)
+endif()
 target_link_libraries(frontend_qt4
frontends
${QT_QTCORE_LIBRARY}
diff --git a/src/support/CMakeLists.txt b/src/support/CMakeLists.txt
index 04eb38e..b0916b5 100644
--- a/src/support/CMakeLists.txt
+++ b/src/support/CMakeLists.txt
@@ -74,7 +74,11 @@ else()
 endif()
 set_target_properties(support PROPERTIES FOLDER applications/LyX)
 
-qt_use_modules(support Core)
+if(USE_MACOSX_PACKAGING AND Qt5Core_FOUND)
+   qt_use_modules(support Core Gui)
+else()
+   qt_use_modules(support Core)
+endif()
 
 target_link_libraries(support ${Lyx_Boost_Libraries} ${QT_QTCORE_LIBRARY} 
${ZLIB_LIBRARY})
 


[LyX/master] Fix problem with python and change of PATH

2014-04-21 Thread Richard Heck
commit 4e38cf152430c6293319642099f162299acde922
Author: Benjamin Piwowarski bpiwo...@lyx.org
Date:   Fri Mar 14 11:48:40 2014 +0100

Fix problem with python and change of PATH

- waits that lyxrc has been read before finding python
- when the PATH changes, resets the value

diff --git a/src/support/Package.cpp b/src/support/Package.cpp
index b4b0e14..f5ee5d5 100644
--- a/src/support/Package.cpp
+++ b/src/support/Package.cpp
@@ -154,8 +154,9 @@ Package::Package(string const  command_line_arg0,
 std::string const  Package::configure_command() const
 {
if (configure_command_.empty()) {
+   std::string command = 
const_caststd::string(configure_command_);
FileName const 
configure_script(addName(system_support().absFileName(), configure.py));
-   configure_command_ = os::python() + ' ' +
+   command = os::python() + ' ' +
quoteName(configure_script.toFilesystemEncoding()) +
with_version_suffix() +  --binary-dir= +

quoteName(FileName(binary_dir().absFileName()).toFilesystemEncoding());


[LyX/master] Revert Tooltip for completion word length.

2014-04-21 Thread Richard Heck
commit f00104d222d39da2b2abaff78ab1c3082124cbf7
Author: Richard Heck rgh...@lyx.org
Date:   Sat Mar 22 21:21:59 2014 -0400

Revert Tooltip for completion word length.

This reverts commit 2aadcec1fc9ae784e6029b56790753ce82b9f055.

Conflicts:
src/frontends/qt4/ui/PrefCompletionUi.ui

diff --git a/src/frontends/qt4/ui/PrefCompletionUi.ui 
b/src/frontends/qt4/ui/PrefCompletionUi.ui
index d833302..0cb8751 100644
--- a/src/frontends/qt4/ui/PrefCompletionUi.ui
+++ b/src/frontends/qt4/ui/PrefCompletionUi.ui
@@ -1,63 +1,62 @@
-?xml version=1.0 encoding=UTF-8?
-ui version=4.0
+2aadcec1fc9ui version=4.0 
  classPrefCompletionUi/class
- widget class=QWidget name=PrefCompletionUi
-  property name=geometry
+ widget class=QWidget name=PrefCompletionUi 
+  property name=geometry 
rect
 x0/x
 y0/y
-width412/width
-height468/height
+width400/width
+height404/height
/rect
   /property
-  property name=windowTitle
+  property name=windowTitle 
string/
   /property
-  layout class=QGridLayout
-   property name=margin
+  layout class=QGridLayout 
+   property name=margin 
 number9/number
/property
-   property name=spacing
+   property name=spacing 
 number6/number
/property
-   item row=1 column=0
-widget class=QGroupBox name=groupBox_3
- property name=title
+   item row=1 column=0 
+widget class=QGroupBox name=groupBox_3 
+ property name=title 
   stringIn Math/string
  /property
- property name=flat
+ property name=flat 
   booltrue/bool
  /property
- layout class=QVBoxLayout
-  property name=spacing
-   number6/number
-  /property
-  property name=margin
+ layout class=QVBoxLayout 
+  property name=margin 
number9/number
   /property
+  property name=spacing 
+   number6/number
+  /property
   item
-   widget class=QCheckBox name=inlineMathCB
-property name=toolTip
+   widget class=QCheckBox name=inlineMathCB 
+property name=toolTip 
  stringShow the grey inline completion behind the cursor in math 
mode after the delay./string
 /property
-property name=text
+property name=text 
  stringAutomatic inamp;line completion/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=popupMathCB
-property name=toolTip
+   widget class=QCheckBox name=popupMathCB 
+property name=toolTip 
  stringShow the popup in math mode after the delay./string
 /property
-property name=text
+property name=text 
  stringAutomatic pamp;opup/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=autocorrectionCB
-property name=text
+   widget class=QCheckBox name=autocorrectionCB 
+property name=text 
  stringAutocoamp;rrection/string
 /property
/widget
@@ -65,47 +64,47 @@
  /layout
 /widget
/item
-   item row=0 column=0
-widget class=QGroupBox name=groupBox_2
- property name=title
+   item row=0 column=0 
+widget class=QGroupBox name=groupBox_2 
+ property name=title 
   stringIn Text/string
  /property
- property name=flat
+ property name=flat 
   booltrue/bool
  /property
- layout class=QVBoxLayout
-  property name=spacing
-   number6/number
-  /property
-  property name=margin
+ layout class=QVBoxLayout 
+  property name=margin 
number9/number
   /property
+  property name=spacing 
+   number6/number
+  /property
   item
-   widget class=QCheckBox name=inlineTextCB
-property name=toolTip
+   widget class=QCheckBox name=inlineTextCB 
+property name=toolTip 
  stringShow the grey inline completion behind the cursor in text 
mode after the delay./string
 /property
-property name=text
+property name=text 
  stringAutomatic amp;inline completion/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=popupTextCB
-property name=toolTip
+   widget class=QCheckBox name=popupTextCB 
+property name=toolTip 
  stringShow the popup after the set delay in text mode./string
 /property
-property name=text
+property name=text 
  stringAutomatic amp;popup/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=cursorTextCB
-property name=toolTip
+   widget class=QCheckBox name=cursorTextCB 
+property name=toolTip 
  stringShow a small triangle on the cursor if a completion is 
available in text mode./string
 /property
-property name=text
+property name=text 
  stringCursor iamp;ndicator/string
 /property
/widget
@@ -113,58 +112,58 @@
  

[LyX/master] Objective-C compililation support with cmake and C++11

2014-04-21 Thread Richard Heck
commit c2e67a41ce4b3b281f6c8a805be5e821ce0aea0a
Author: Benjamin Piwowarski benja...@bpiwowar.net
Date:   Sun Mar 9 08:29:27 2014 +0100

Objective-C compililation support with cmake and C++11

This fixes an issue whe compiling with C++11 flags on: The
objective-C clang compiler produces an error. This patch waits
avoid including specific C++ flags and uses LYX_CPP_SPECIFIC_FLAGS
to store the confliciting flags (for the moment, just C++11).

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 023c3e1..fce4bed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -202,7 +202,8 @@ else()
 endif()
 
 
-set(LYX_GCC11_MODE)
+# Variable that hold the flags that should only be used with C++ files
+set(LYX_CXX_SPECIFIC_FLAGS)
 if(UNIX OR MINGW)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion 
OUTPUT_VARIABLE GCC_VERSION)
message(STATUS Using GCC version ${GCC_VERSION})
@@ -217,7 +218,7 @@ if(UNIX OR MINGW)
if(NOT CXX11COMPILER_FOUND)
message(FATAL_ERROR A C++11 compatible compiler is 
required.)
endif()
-   set(LYX_GCC11_MODE ${CXX11_FLAG})
+   set(LYX_CXX_SPECIFIC_FLAGS ${LYX_CXX_SPECIFIC_FLAGS} 
${CXX11_FLAG})
endif()
 else()
if(MSVC10)
@@ -453,7 +454,7 @@ if(NOT MSVC)
if(NOT LYX_QUIET)
set(CMAKE_VERBOSE_MAKEFILE ON)
endif()
-   set(LYX_CXX_FLAGS -Wall -Wunused-parameter ${LYX_GCC11_MODE})
+   set(LYX_CXX_FLAGS -Wall -Wunused-parameter)
if(LYX_STDLIB_DEBUG)
set(LYX_CXX_FLAGS ${LYX_CXX_FLAGS} -D_GLIBCXX_DEBUG 
-D_GLIBCXX_DEBUG_PEDANTIC)
endif()
diff --git a/boost/CMakeLists.txt b/boost/CMakeLists.txt
index 6d7839a..8dcb275 100644
--- a/boost/CMakeLists.txt
+++ b/boost/CMakeLists.txt
@@ -4,5 +4,6 @@
 # Copyright (c) 2006-2011 Peter Kümmel, syntheti...@gmx.net
 #
 
+set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${LYX_CXX_SPECIFIC_FLAGS})
 add_subdirectory(libs) 
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5203d45..425cd9e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -11,11 +11,15 @@ include_directories(${TOP_SRC_DIR}/src)
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER CMakeTargets)
 
+# support is the only directory containing objective-c files...
+add_subdirectory(support)
+# ...so we can add all the c++ specific flags after
+set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${LYX_CXX_SPECIFIC_FLAGS})
+
 add_subdirectory(frontends)
 add_subdirectory(graphics)
 add_subdirectory(insets)
 add_subdirectory(mathed)
-add_subdirectory(support)
 add_subdirectory(tex2lyx)
 if (UNIX)
add_subdirectory(client)
diff --git a/src/support/CMakeLists.txt b/src/support/CMakeLists.txt
index ba0dfdc..04eb38e 100644
--- a/src/support/CMakeLists.txt
+++ b/src/support/CMakeLists.txt
@@ -22,6 +22,7 @@ file(GLOB support_mythes_headers 
${TOP_SRC_DIR}/src/support/mythes/*.hxx)
 file(GLOB support_linkback_sources ${TOP_SRC_DIR}/src/support/linkback/*.m*)
 file(GLOB support_linkback_headers ${TOP_SRC_DIR}/src/support/linkback/*.h)
 
+set_source_files_properties(${support_sources} ${support_mythes_sources} 
PROPERTIES COMPILE_FLAGS ${LYX_CXX_SPECIFIC_FLAGS})
 list(REMOVE_ITEM support_sources
${TOP_SRC_DIR}/src/support/os_win32.cpp
${TOP_SRC_DIR}/src/support/os_unix.cpp
diff --git a/src/support/tests/CMakeLists.txt b/src/support/tests/CMakeLists.txt
index eac5aa7..7c4600f 100644
--- a/src/support/tests/CMakeLists.txt
+++ b/src/support/tests/CMakeLists.txt
@@ -6,6 +6,8 @@
 
 project(supporttest)
 
+set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${LYX_CXX_SPECIFIC_FLAGS})
+
 macro(sources _program)
set(_tmplist)
foreach(_tmp ${ARGN})


[LyX/master] Avoids const_cast in configure_command by using mutable

2014-04-21 Thread Richard Heck
commit 73405549cb122d30dfdba13414660a3427eb0db2
Author: Benjamin Piwowarski bpiwo...@lyx.org
Date:   Fri Mar 21 18:38:09 2014 +0100

Avoids const_cast in configure_command by using mutable

diff --git a/src/support/Package.cpp b/src/support/Package.cpp
index f5ee5d5..b4b0e14 100644
--- a/src/support/Package.cpp
+++ b/src/support/Package.cpp
@@ -154,9 +154,8 @@ Package::Package(string const  command_line_arg0,
 std::string const  Package::configure_command() const
 {
if (configure_command_.empty()) {
-   std::string command = 
const_caststd::string(configure_command_);
FileName const 
configure_script(addName(system_support().absFileName(), configure.py));
-   command = os::python() + ' ' +
+   configure_command_ = os::python() + ' ' +
quoteName(configure_script.toFilesystemEncoding()) +
with_version_suffix() +  --binary-dir= +

quoteName(FileName(binary_dir().absFileName()).toFilesystemEncoding());


[LyX/master] When LYX_ASPELL is on, fails if not finding the library

2014-04-21 Thread Richard Heck
commit 6468cd97e3c088fe4f29b4738978644e0a4e32ca
Author: Benjamin Piwowarski benja...@bpiwowar.net
Date:   Sun Mar 9 10:24:07 2014 +0100

When LYX_ASPELL is on, fails if not finding the library

Otherwise, this was triggering errors latter in the build process

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f68222a..03b957d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -302,7 +302,7 @@ endif()
 # Set the programs (lyx, tex2lyx, etc.) suffix 
 # When building an OS X bundle, we will append
 # the suffix only to the bundle, not to the programs
-   set(PROGRAM_SUFFIX )
+set(PROGRAM_SUFFIX )
 if(LYX_PROGRAM_SUFFIX AND NOT (APPLE AND LYX_BUNDLE))
set(PROGRAM_SUFFIX ${LYX_INSTALL_SUFFIX})
 endif()
@@ -541,7 +541,7 @@ endif()
 include_directories(${TOP_BINARY_DIR} ${TOP_SRC_DIR}/src)
 
 if(LYX_ASPELL)
-   find_package(ASPELL)
+   find_package(ASPELL REQUIRED)
include_directories(${ASPELL_INCLUDE_DIR})
 endif()
 
@@ -786,8 +786,8 @@ if(LYX_INSTALL)
add_subdirectory(${LYX_CMAKE_DIR}/man ${TOP_BINARY_DIR}/man)
add_subdirectory(${LYX_CMAKE_DIR}/doc ${TOP_BINARY_DIR}/doc)
endif()
-   include(../Install)
-   endif()
+   include(../Install)
+endif()
 
 add_subdirectory(src ${TOP_BINARY_DIR}/src)
 add_subdirectory(lib/lyx2lyx ${TOP_BINARY_DIR}/lyx2lyx)


[LyX/master] CMake install and bundling improvements (esp. OS X)

2014-04-21 Thread Richard Heck
commit 14de3aa49b4fb38093ff12ccaf3200daf0f62c77
Author: Benjamin Piwowarski benja...@bpiwowar.net
Date:   Sun Mar 9 10:21:51 2014 +0100

CMake install and bundling improvements (esp. OS X)

This patch improves the cmake bundling process:
- reworked bundle handling for OS X: only when installing resources are 
copied, otherwise
only the smallest bundle is built
- on OS X, the utility programs (tex2lyx) are now installed in the right 
location
- it removes some unneeded BUNDLE DESTINATION
- it provides a basic support for QT plugins inclusion
- it properly builds a disk image on OS X (only the background image is 
missing)
- it fixes the library paths for all executables (not only LyX)
- Use the COPYING file for cmake install license

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fce4bed..f68222a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,8 @@ file(MAKE_DIRECTORY ${LYX_TESTS_USERDIR})
 if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 OLD)
cmake_policy(SET CMP0005 OLD)
+   # Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION
+   cmake_policy(SET CMP0006 NEW)
 endif()
 
 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
@@ -297,41 +299,66 @@ else()
set(LYX_REVISION_VERSION ${LYX_PATCH_VERSION})
 endif()
 
-if(LYX_PROGRAM_SUFFIX)
-   set(PROGRAM_SUFFIX ${LYX_INSTALL_SUFFIX})
-else()
+# Set the programs (lyx, tex2lyx, etc.) suffix 
+# When building an OS X bundle, we will append
+# the suffix only to the bundle, not to the programs
set(PROGRAM_SUFFIX )
+if(LYX_PROGRAM_SUFFIX AND NOT (APPLE AND LYX_BUNDLE))
+   set(PROGRAM_SUFFIX ${LYX_INSTALL_SUFFIX})
 endif()
+set(_lyx ${PACKAGE_BASE}${PROGRAM_SUFFIX})
+set(_tex2lyx tex2lyx${PROGRAM_SUFFIX})
 
 add_custom_target(lyx_version ALL
   COMMAND ${CMAKE_COMMAND} -DTOP_SRC_DIR=${TOP_SRC_DIR} 
-DTOP_CMAKE_PATH=${TOP_CMAKE_PATH} -DTOP_BINARY_DIR=${TOP_BINARY_DIR} 
-DLYX_DATE=${LYX_DATE} -P ${TOP_SCRIPT_PATH}/LyXGetVersion.cmake
   )
 set_target_properties(lyx_version PROPERTIES FOLDER applications)
 
-if(APPLE)
-   set(osx_bundle_program_name ${PACKAGE_BASE}${PROGRAM_SUFFIX})
-   
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/development/MacOSX/Info.plist.in 
${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
-endif()
+# Default paths for installed utilities (tex2lyx, lyxclient, etc.)
+set(LYX_UTILITIES_INSTALL_PATH bin)
 
 if(LYX_BUNDLE)
set(LYX_CPACK ON)
+
message(STATUS)
message(STATUS Bundle creation is enabled (experimental):)
message(STATUS make)
message(STATUS make install/strip)
message(STATUS make package)
if(APPLE)
+   set(MACOSX_BUNDLE TRUE)
+   # This sets the bundle + executable names
+   set(_lyx ${PACKAGE_BASE}${LYX_INSTALL_SUFFIX})
+   # This sets the Info.plist executable name
+   set(osx_bundle_program_name ${_lyx})
+   # Bundle name
+   set(LYX_BUNDLE_NAME ${_lyx})
+
+   # This will contain the list of files that need to be included
+   # in the bundle and their location within the bundle
+   set(OSX_BUNDLE_FILES 
${TOP_SRC_DIR}/development/MacOSX/LyX.sdef;${TOP_SRC_DIR}/development/MacOSX/LyXapp.icns;${CMAKE_BINARY_DIR}/lyxrc.dist)
+   set(OSX_BUNDLE_DIRS Resources;Resources;Resources)
+
+   # Process Info.plist and lyxrc.dist
+   
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/development/MacOSX/Info.plist.in 
${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
+   
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/development/MacOSX/lyxrc.dist.in 
${CMAKE_CURRENT_BINARY_DIR}/lyxrc.dist)
+
set(LYX_BUILD_BUNDLE MACOSX_BUNDLE)
-   set(CPACK_BUNDLE_NAME ${PACKAGE_BASE}${PROGRAM_SUFFIX})
+   set(LYX_DATA_SUBDIR ${LYX_BUNDLE_NAME}.app/Contents/Resources/ 
CACHE STRING Bundle Contents dir FORCE)
+
+   # Variables used by CPack
+   set(CPACK_BUNDLE_NAME ${LYX_BUNDLE_NAME})
set(CPACK_BUNDLE_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
-   set(LYX_DATA_SUBDIR 
${PACKAGE_BASE}${PROGRAM_SUFFIX}.app/Contents/Resources/ CACHE STRING Bundle 
Contents dir FORCE)
-   set(MACOSX_BUNDLE_STARTUP_COMMAND 
${PACKAGE_BASE}${PROGRAM_SUFFIX}.app)
+   set(MACOSX_BUNDLE_STARTUP_COMMAND ${LYX_BUNDLE_NAME}.app)
+
+   # Set the install paths
+   set(LYX_UTILITIES_INSTALL_PATH 
${LYX_BUNDLE_NAME}.app/Contents/MacOS)
if(NOT LYX_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/LyX CACHE 
PATH Mac bundle dir FORCE)
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
endif()
# Change the owner so that the install can work
-   install(CODE set(BU_CHMOD_BUNDLE_ITEMS 1))
+   install(CODE 

[LyX/master] Fix selection drawing after mouse-double/triple in mathed

2014-04-21 Thread Richard Heck
commit 33e10ff2138ae95ae42d922a51e93b9ba9c7bca6
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Fri Mar 21 10:20:12 2014 +0100

Fix selection drawing after mouse-double/triple in mathed

Fixes: #8829

diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index ab88cf9..479a682 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -736,6 +736,7 @@ void InsetMathNest::doDispatch(Cursor  cur, FuncRequest  
cmd)
cur.setSelection(true);
cur.idx() = cur.lastidx();
cur.pos() = cur.lastpos();
+   cur.bv().cursor() = cur;
break;
 
case LFUN_PARAGRAPH_UP:


[LyX/master] style

2014-04-21 Thread Richard Heck
commit b8661bcfb33bb7f8c0598c0f0c45229b77526bbb
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Sat Mar 22 12:22:41 2014 +0100

style

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index ab5501c..2d3df5f 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -2499,7 +2499,7 @@ void BufferView::putSelectionAt(DocIterator const  cur,
 bool BufferView::selectIfEmpty(DocIterator  cur)
 {
if ((cur.inTexted()  !cur.paragraph().empty())
-   || cur.inMathed()  !cur.cell().empty())
+   || (cur.inMathed()  !cur.cell().empty()))
return false;
 
pit_type const beg_pit = cur.pit();


[LyX/master] In Paragraph::changeCase, correctly track the font of the changed characters (fix crash)

2014-04-21 Thread Richard Heck
commit 0b2d89eaea7ca8075c43154a0bf7ef49221d3fab
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Mon Mar 24 09:15:00 2014 +0100

In Paragraph::changeCase, correctly track the font of the changed 
characters (fix crash)

Fixes: #7943

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index d32c0be..ffcb5f2 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -3670,7 +3670,9 @@ void Paragraph::changeCase(BufferParams const  bparams, 
pos_type pos,
// process sequences of modified characters; in change
// tracking mode, this approach results in much better
// usability than changing case on a char-by-char basis
-   docstring changes;
+   // We also need to track the current font, since font
+   // changes within sequences can occur.
+   vectorpairchar_type, Font  changes;
 
bool const trackChanges = bparams.trackChanges;
 
@@ -3704,7 +3706,7 @@ void Paragraph::changeCase(BufferParams const  bparams, 
pos_type pos,
}
 
if (oldChar != newChar) {
-   changes += newChar;
+   changes.push_back(make_pair(newChar, 
getFontSettings(bparams, pos)));
if (pos != right - 1)
continue;
// step behind the changing area
@@ -3713,9 +3715,8 @@ void Paragraph::changeCase(BufferParams const  bparams, 
pos_type pos,
 
int erasePos = pos - changes.size();
for (size_t i = 0; i  changes.size(); i++) {
-   insertChar(pos, changes[i],
-  getFontSettings(bparams,
-  erasePos),
+   insertChar(pos, changes[i].first,
+  changes[i].second,
   trackChanges);
if (!eraseChar(erasePos, trackChanges)) {
++erasePos;


[LyX/master] Typos in algorithm module.

2014-04-21 Thread Richard Heck
commit 47c3b0fce7936f686389438b80357c5b45be0ab4
Author: Richard Heck rgh...@lyx.org
Date:   Wed Mar 26 15:53:15 2014 -0400

Typos in algorithm module.

diff --git a/lib/layouts/algorithm2e.module b/lib/layouts/algorithm2e.module
index 8125506..17b5131 100644
--- a/lib/layouts/algorithm2e.module
+++ b/lib/layouts/algorithm2e.module
@@ -1,7 +1,7 @@
 #\DeclareLyXModule[algorithm2e.sty]{Algorithm2e}
 #DescriptionBegin
 # Use the algorithm2e package for algorithm floats rather
-# then LyX's home-brewn algorithm floats.
+# than LyX's home-brewed algorithm floats.
 #DescriptionEnd
 #
 #Author: Jürgen Spitzmüller


[LyX/master] \lyxdeleted uses an ulem command.

2014-04-21 Thread Richard Heck
commit 5a4363c0f56780cbf83306d2f5c5451897528050
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Sat Mar 22 12:27:46 2014 +0100

\lyxdeleted uses an ulem command.

Therefore we need to put \cite and \ref into \mboxes, as in our native ulem 
commands.

Fixes: #8806.

diff --git a/src/Changes.cpp b/src/Changes.cpp
index d03a371..4292f1b 100644
--- a/src/Changes.cpp
+++ b/src/Changes.cpp
@@ -398,6 +398,8 @@ int Changes::latexMarkChange(otexstream  os, BufferParams 
const  bparams,
// close \lyxadded or \lyxdeleted
os  '}';
column++;
+   if (oldChange.type == Change::DELETED)
+   --runparams.inulemcmd;
}
 
docstring chgTime;
@@ -406,8 +408,10 @@ int Changes::latexMarkChange(otexstream  os, BufferParams 
const  bparams,
chgTime.erase(chgTime.end() - 1);
 
docstring macro_beg;
-   if (change.type == Change::DELETED)
+   if (change.type == Change::DELETED) {
macro_beg = from_ascii(\\lyxdeleted{);
+   ++runparams.inulemcmd;
+   }
else if (change.type == Change::INSERTED)
macro_beg = from_ascii(\\lyxadded{);



[LyX/master] PrefCompletionUi.ui: port commit 1a137950

2014-04-21 Thread Richard Heck
commit 9776519cc597c81be5c69ff42dc0dd7cf7e72f5a
Author: Uwe Stöhr uwesto...@lyx.org
Date:   Sun Mar 23 14:49:57 2014 +0100

PrefCompletionUi.ui: port commit 1a137950

diff --git a/src/frontends/qt4/ui/PrefCompletionUi.ui 
b/src/frontends/qt4/ui/PrefCompletionUi.ui
index 010b308..45faee4 100644
--- a/src/frontends/qt4/ui/PrefCompletionUi.ui
+++ b/src/frontends/qt4/ui/PrefCompletionUi.ui
@@ -1,7 +1,8 @@
-ui version=4.0 
+?xml version=1.0 encoding=UTF-8?
+ui version=4.0
  classPrefCompletionUi/class
- widget class=QWidget name=PrefCompletionUi 
-  property name=geometry 
+ widget class=QWidget name=PrefCompletionUi
+  property name=geometry
rect
 x0/x
 y0/y
@@ -9,54 +10,54 @@
 height404/height
/rect
   /property
-  property name=windowTitle 
+  property name=windowTitle
string/
   /property
-  layout class=QGridLayout 
-   property name=margin 
+  layout class=QGridLayout
+   property name=margin
 number9/number
/property
-   property name=spacing 
+   property name=spacing
 number6/number
/property
-   item row=1 column=0 
-widget class=QGroupBox name=groupBox_3 
- property name=title 
+   item row=1 column=0
+widget class=QGroupBox name=groupBox_3
+ property name=title
   stringIn Math/string
  /property
- property name=flat 
+ property name=flat
   booltrue/bool
  /property
- layout class=QVBoxLayout 
-  property name=margin 
-   number9/number
-  /property
-  property name=spacing 
+ layout class=QVBoxLayout
+  property name=spacing
number6/number
   /property
+  property name=margin
+   number9/number
+  /property
   item
-   widget class=QCheckBox name=inlineMathCB 
-property name=toolTip 
+   widget class=QCheckBox name=inlineMathCB
+property name=toolTip
  stringShow the grey inline completion behind the cursor in math 
mode after the delay./string
 /property
-property name=text 
+property name=text
  stringAutomatic inamp;line completion/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=popupMathCB 
-property name=toolTip 
+   widget class=QCheckBox name=popupMathCB
+property name=toolTip
  stringShow the popup in math mode after the delay./string
 /property
-property name=text 
+property name=text
  stringAutomatic pamp;opup/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=autocorrectionCB 
-property name=text 
+   widget class=QCheckBox name=autocorrectionCB
+property name=text
  stringAutocoamp;rrection/string
 /property
/widget
@@ -64,47 +65,47 @@
  /layout
 /widget
/item
-   item row=0 column=0 
-widget class=QGroupBox name=groupBox_2 
- property name=title 
+   item row=0 column=0
+widget class=QGroupBox name=groupBox_2
+ property name=title
   stringIn Text/string
  /property
- property name=flat 
+ property name=flat
   booltrue/bool
  /property
- layout class=QVBoxLayout 
-  property name=margin 
-   number9/number
-  /property
-  property name=spacing 
+ layout class=QVBoxLayout
+  property name=spacing
number6/number
   /property
+  property name=margin
+   number9/number
+  /property
   item
-   widget class=QCheckBox name=inlineTextCB 
-property name=toolTip 
+   widget class=QCheckBox name=inlineTextCB
+property name=toolTip
  stringShow the grey inline completion behind the cursor in text 
mode after the delay./string
 /property
-property name=text 
+property name=text
  stringAutomatic amp;inline completion/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=popupTextCB 
-property name=toolTip 
+   widget class=QCheckBox name=popupTextCB
+property name=toolTip
  stringShow the popup after the set delay in text mode./string
 /property
-property name=text 
+property name=text
  stringAutomatic amp;popup/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=cursorTextCB 
-property name=toolTip 
+   widget class=QCheckBox name=cursorTextCB
+property name=toolTip
  stringShow a small triangle on the cursor if a completion is 
available in text mode./string
 /property
-property name=text 
+property name=text
  stringCursor iamp;ndicator/string
 /property
/widget
@@ -112,58 +113,58 @@
  /layout
 /widget
/item
-   item row=2 column=0 
-widget class=QGroupBox name=groupBox_4 
- property name=title 
+   item row=2 column=0
+widget class=QGroupBox name=groupBox_4

[LyX/master] Change forToc() to forOutliner(), to avoid confusion. The old name is left over from when the outliner really did just display a TOC.

2014-04-21 Thread Richard Heck
commit 8b00b355ca7012ca703c78a8be89193ac6435fcb
Author: Richard Heck rgh...@lyx.org
Date:   Sat Mar 29 13:34:36 2014 -0400

Change forToc() to forOutliner(), to avoid confusion. The old name
is left over from when the outliner really did just display a TOC.

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 4d9b37c..098ea65 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -3374,7 +3374,7 @@ docstring Paragraph::asString(pos_type beg, pos_type end, 
int options) const
 }
 
 
-void Paragraph::forToc(docstring  os, size_t maxlen) const
+void Paragraph::forOutliner(docstring  os, size_t maxlen) const
 {
if (!d-params_.labelString().empty())
os += d-params_.labelString() + ' ';
@@ -3387,7 +3387,7 @@ void Paragraph::forToc(docstring  os, size_t maxlen) 
const
else if (c == '\t' || c == '\n')
os += ' ';
else if (c == META_INSET)
-   getInset(i)-forToc(os, maxlen);
+   getInset(i)-forOutliner(os, maxlen);
}
 }
 
diff --git a/src/Paragraph.h b/src/Paragraph.h
index 9558048..ba62f9b 100644
--- a/src/Paragraph.h
+++ b/src/Paragraph.h
@@ -177,7 +177,7 @@ public:
docstring asString(pos_type beg, pos_type end,
int options = AS_STR_NONE) const;
///
-   void forToc(docstring , size_t maxlen) const;
+   void forOutliner(docstring , size_t maxlen) const;
 
/// Extract only the explicitly visible text (without any formatting),
/// descending into insets
diff --git a/src/Text.cpp b/src/Text.cpp
index cdcc200..589fd25 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -2012,14 +2012,14 @@ docstring Text::asString(pit_type beg, pit_type end, 
int options) const
 }
 
 
-void Text::forToc(docstring  os, size_t maxlen, bool shorten) const
+void Text::forOutliner(docstring  os, size_t maxlen, bool shorten) const
 {
if (maxlen == 0)
maxlen = std::numeric_limitsstd::size_t::max();
else
LASSERT(maxlen = 8, maxlen = TOC_ENTRY_LENGTH);
for (size_t i = 0; i != pars_.size()  os.length()  maxlen; ++i)
-   pars_[i].forToc(os, maxlen);
+   pars_[i].forOutliner(os, maxlen);
if (shorten  os.length() = maxlen)
os = os.substr(0, maxlen - 3) + from_ascii(...);
 }
diff --git a/src/Text.h b/src/Text.h
index 7ee76d2..189a422 100644
--- a/src/Text.h
+++ b/src/Text.h
@@ -130,7 +130,7 @@ public:
/// if \param os is longer than maxlen chars.
/// if \param maxlen is passed as 0, then it is ignored. (In fact,
/// it is reset to the maximum value for size_t.)
-   void forToc(docstring  os, size_t maxlen, bool shorten = true) const;
+   void forOutliner(docstring  os, size_t maxlen, bool shorten = true) 
const;
 
/// insert a character at cursor position
/// FIXME: replace Cursor with DocIterator.
diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp
index 66bdf0b..cce0f32 100644
--- a/src/insets/Inset.cpp
+++ b/src/insets/Inset.cpp
@@ -258,7 +258,7 @@ docstring Inset::toolTip(BufferView const , int, int) const
 }
 
 
-void Inset::forToc(docstring , size_t) const
+void Inset::forOutliner(docstring , size_t) const
 {
 }
 
diff --git a/src/insets/Inset.h b/src/insets/Inset.h
index b18f8a5..0ed8ff4 100644
--- a/src/insets/Inset.h
+++ b/src/insets/Inset.h
@@ -333,7 +333,7 @@ public:
virtual void toString(odocstream ) const {}
/// Appends a potentially abbreviated version of the inset to
/// \param str. Intended for use by the TOC.
-   virtual void forToc(docstring  str,
+   virtual void forOutliner(docstring  str,
size_t maxlen = TOC_ENTRY_LENGTH) const;
 
/// can the contents of the inset be edited on screen ?
diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp
index 2676d93..144123f 100644
--- a/src/insets/InsetBranch.cpp
+++ b/src/insets/InsetBranch.cpp
@@ -299,10 +299,10 @@ void InsetBranch::toString(odocstream  os) const
 }
 
 
-void InsetBranch::forToc(docstring  os, size_t maxlen) const
+void InsetBranch::forOutliner(docstring  os, size_t maxlen) const
 {
if (isBranchSelected())
-   InsetCollapsable::forToc(os, maxlen);
+   InsetCollapsable::forOutliner(os, maxlen);
 }
 
 
@@ -355,7 +355,7 @@ void InsetBranch::addToToc(DocIterator const  cpit, bool 
output_active) const
 
Toc  toc = buffer().tocBackend().toc(branch);
docstring str = params_.branch + : ;
-   text().forToc(str, TOC_ENTRY_LENGTH);
+   text().forOutliner(str, TOC_ENTRY_LENGTH);
toc.push_back(TocItem(pit, 0, str, output_active, 
toolTipText(docstring(), 3, 60)));
// Proceed with the rest of the inset.
bool const doing_output = output_active  isBranchSelected();
diff --git a/src/insets/InsetBranch.h b/src/insets/InsetBranch.h
index 7521fbe..ecd2f7d 100644
--- 

[LyX/master] Fix oversight in autotools packaging selection

2014-04-21 Thread Richard Heck
commit 5ff8a01cb610b58f5c3c84f7e65440b0a001b5f6
Author: Jean-Marc Lasgouttes lasgout...@lyx.org
Date:   Thu Mar 27 13:51:25 2014 +0100

Fix oversight in autotools packaging selection

The only consequence of this thinko is that the lyx.desktop and the svg 
icons were installed on Mac OS and Windows platform, whereas they are useless.

diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index d1b78f9..61ea48d 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -463,6 +463,7 @@ AC_ARG_WITH(packaging,
   *) lyx_use_packaging=posix;;
   esac])
 AC_MSG_RESULT($lyx_use_packaging)
+lyx_install_posix=false
 lyx_install_macosx=false
 lyx_install_cygwin=false
 lyx_install_windows=false


[LyX/master] PrefLanguageUi.ui: change a string

2014-04-21 Thread Richard Heck
commit 658aa3f02606000de788360bed4f66624065f6f1
Author: Uwe Stöhr uwesto...@lyx.org
Date:   Wed Mar 26 05:19:38 2014 +0100

PrefLanguageUi.ui: change a string

to have uniform uppercases in this dialog

diff --git a/src/frontends/qt4/ui/PrefLanguageUi.ui 
b/src/frontends/qt4/ui/PrefLanguageUi.ui
index 1027e7f..c91961b 100644
--- a/src/frontends/qt4/ui/PrefLanguageUi.ui
+++ b/src/frontends/qt4/ui/PrefLanguageUi.ui
@@ -1,3 +1,4 @@
+?xml version=1.0 encoding=UTF-8?
 ui version=4.0
  classPrefLanguageUi/class
  widget class=QWidget name=PrefLanguageUi
@@ -131,7 +132,7 @@
item row=4 column=0
 widget class=QLabel name=decimalPointL
  property name=text
-  stringDefault Decimal amp;Separator:/string
+  stringDefault decimal amp;separator:/string
  /property
  property name=buddy
   cstringdefaultDecimalPointLE/cstring
@@ -154,20 +155,20 @@
  /property
 /widget
/item
-item row=5 column=0
-  widget class=QLabel name=defaultLengthUnitLA
-property name=text
-  stringDefault length amp;unit:/string
-/property
-property name=buddy
-  cstringdefaultLengthUnitCO/cstring
-/property
-  /widget
-/item
-item row=5 column=1
-  widget class=QComboBox name=defaultLengthUnitCO /
-/item
-item row=6 column=0 colspan=2
+   item row=5 column=0
+widget class=QLabel name=defaultLengthUnitLA
+ property name=text
+  stringDefault length amp;unit:/string
+ /property
+ property name=buddy
+  cstringdefaultLengthUnitCO/cstring
+ /property
+/widget
+   /item
+   item row=5 column=1
+widget class=QComboBox name=defaultLengthUnitCO/
+   /item
+   item row=6 column=0 colspan=2
 widget class=QCheckBox name=globalCB
  property name=toolTip
   stringCheck to pass the language globally (to the document class), not 
locally (to the language package)/string


[LyX/master] Merged Paragraph::stringify into asString().

2014-04-21 Thread Richard Heck
commit 13cb7da11d04bba9fb4af5e538ca2332a5341b71
Author: Tommaso Cucinotta tomm...@lyx.org
Date:   Thu Mar 27 23:12:56 2014 +

Merged Paragraph::stringify into asString().

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index ed0ddd0..3751cfd 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -3347,7 +3347,7 @@ docstring Paragraph::asString(int options) const
 }
 
 
-docstring Paragraph::asString(pos_type beg, pos_type end, int options) const
+docstring Paragraph::asString(pos_type beg, pos_type end, int options, const 
OutputParams *runparams) const
 {
odocstringstream os;
 
@@ -3364,9 +3364,14 @@ docstring Paragraph::asString(pos_type beg, pos_type 
end, int options) const
|| (c == '\n'  (options  AS_STR_NEWLINES)))
os.put(c);
else if (c == META_INSET  (options  AS_STR_INSETS)) {
-   getInset(i)-toString(os);
-   if (getInset(i)-asInsetMath())
-   os   ;
+   if (c == META_INSET  (options  AS_STR_PLAINTEXT)) {
+   LASSERT(runparams != 0, return docstring());
+   getInset(i)-plaintext(os, *runparams);
+   } else {
+   getInset(i)-toString(os);
+   if (getInset(i)-asInsetMath())
+   os   ;
+   }
}
}
 
@@ -3392,33 +3397,6 @@ void Paragraph::forOutliner(docstring  os, size_t 
maxlen) const
 }
 
 
-docstring Paragraph::stringify(pos_type beg, pos_type end, int options,
-OutputParams const  runparams) const
-{
-   odocstringstream os;
-
-   if (beg == 0
-options  AS_STR_LABEL
-!d-params_.labelString().empty())
-   os  d-params_.labelString()  ' ';
-
-   OutputParams op = runparams;
-   op.for_search = true;
-
-   for (pos_type i = beg; i  end; ++i) {
-   char_type const c = d-text_[i];
-   if (isPrintable(c) || c == '\t'
-   || (c == '\n'  (options  AS_STR_NEWLINES)))
-   os.put(c);
-   else if (c == META_INSET  (options  AS_STR_INSETS)) {
-   getInset(i)-plaintext(os, op);
-   }
-   }
-
-   return os.str();
-}
-
-
 void Paragraph::setInsetOwner(Inset const * inset)
 {
d-inset_owner_ = inset;
diff --git a/src/Paragraph.h b/src/Paragraph.h
index ba62f9b..587612d 100644
--- a/src/Paragraph.h
+++ b/src/Paragraph.h
@@ -127,7 +127,8 @@ enum AsStringParameter
AS_STR_LABEL = 1, /// Prefix with paragraph label.
AS_STR_INSETS = 2, /// Go into insets.
AS_STR_NEWLINES = 4, /// Get also newline characters.
-   AS_STR_SKIPDELETE = 8 /// Skip deleted text in change tracking.
+   AS_STR_SKIPDELETE = 8, /// Skip deleted text in change tracking.
+   AS_STR_PLAINTEXT = 16 /// Don't export formatting when descending into 
insets.
 };
 
 
@@ -173,17 +174,15 @@ public:
/// asString(AS_STR_LABEL | AS_STR_INSETS)
/// asString(AS_STR_INSETS)
docstring asString(int options = AS_STR_NONE) const;
-   ///
+
+   /// Convert the paragraph to a string.
+   /// \note If options includes AS_STR_PLAINTEXT, then runparams must be 
!= 0
docstring asString(pos_type beg, pos_type end,
-   int options = AS_STR_NONE) const;
+  int options = AS_STR_NONE,
+  const OutputParams *runparams = 0) const;
///
void forOutliner(docstring , size_t maxlen) const;
 
-   /// Extract only the explicitly visible text (without any formatting),
-   /// descending into insets
-   docstring stringify(pos_type beg, pos_type end, int options,
-   OutputParams const  runparams) const;
-
///
void write(std::ostream , BufferParams const ,
depth_type  depth) const;
diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index 75f0412..1b32ae3 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -782,14 +782,17 @@ static docstring stringifySearchBuffer(Buffer  buffer, 
FindAndReplaceOptions co
runparams.flavor = OutputParams::LATEX;
runparams.linelen = 10; //lyxrc.plaintext_linelen;
runparams.dryrun = true;
+   runparams.for_search = true;
for (pos_type pit = pos_type(0); pit  
(pos_type)buffer.paragraphs().size(); ++pit) {
Paragraph const  par = buffer.paragraphs().at(pit);
LYXERR(Debug::FIND, Adding to search string: '
-   par.stringify(pos_type(0), par.size(),
-   AS_STR_INSETS, runparams)
+   par.asString(pos_type(0), par.size(),
+

[LyX/master] Fix two thinkos caught by the cppcheck script.

2014-04-21 Thread Richard Heck
commit 84d4d45daa9e0b1a18ab0133c6caa5f34e7f8616
Author: Richard Heck rgh...@lyx.org
Date:   Fri Apr 4 15:53:27 2014 -0400

Fix two thinkos caught by the cppcheck script.

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index acf8ace..113715a 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -876,7 +876,7 @@ void Tabular::insertColumn(col_type const col, bool copy)
setBottomLine(i, bottomLine(j));
setTopLine(i, topLine(j));
setLeftLine(i, leftLine(j));
-   if (rightLine(j)  rightLine(j)) {
+   if (rightLine(i)  rightLine(j)) {
setRightLine(i, true);
setRightLine(j, false);
}
diff --git a/src/mathed/InsetMathPhantom.cpp b/src/mathed/InsetMathPhantom.cpp
index cd4ae45..b8c965b 100644
--- a/src/mathed/InsetMathPhantom.cpp
+++ b/src/mathed/InsetMathPhantom.cpp
@@ -346,7 +346,7 @@ void InsetMathPhantom::validate(LaTeXFeatures  features) 
const
 
 bool InsetMathPhantom::visibleContents() const 
 { 
-   return kind_ == phantom || kind_ == vphantom || kind_ == vphantom;
+   return kind_ == phantom || kind_ == vphantom || kind_ == hphantom;
 }
 
 


[LyX/master] Make some functions return const refs, and add a comment.

2014-04-21 Thread Richard Heck
commit 75aa0d61dba848cda39ceddcde9c2f3f0b9afbe8
Author: Richard Heck rgh...@lyx.org
Date:   Sun Apr 6 21:53:54 2014 -0400

Make some functions return const refs, and add a comment.

diff --git a/src/insets/InsetLayout.h b/src/insets/InsetLayout.h
index 74e1af9..83bbb2d 100644
--- a/src/insets/InsetLayout.h
+++ b/src/insets/InsetLayout.h
@@ -85,13 +85,18 @@ public:
FontInfo labelfont() const { return labelfont_; }
///
ColorCode bgcolor() const { return bgcolor_; }
-   ///
+   /// 
+   Layout::LaTeXArgMap const  latexargs() const { return latexargs_; }
+   ///
+   Layout::LaTeXArgMap const  postcommandargs() const { return 
postcommandargs_; }
+   /// Returns latexargs() + postcommandargs().
+   /// But note that it returns a *copy*, not a reference, so do not do 
+   /// anything like:
+   ///   Layout::LaTeXArgMap it = args().begin();
+   ///   Layout::LaTeXArgMap en = args().end();
+   /// Those are iterators for different containers.
Layout::LaTeXArgMap args() const;
///
-   Layout::LaTeXArgMap latexargs() const { return latexargs_; }
-   ///
-   Layout::LaTeXArgMap postcommandargs() const { return postcommandargs_; }
-   ///
unsigned int optArgs() const;
///
unsigned int requiredArgs() const;


[LyX/master] Stabilize mouse selection in mathed

2014-04-21 Thread Richard Heck
commit 302228625b46788d4301e9bbdc2883b4e581f508
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Fri Apr 4 15:40:05 2014 +0200

Stabilize mouse selection in mathed

Fixes: #9074

diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 479a682..83e49c4 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -1567,16 +1567,29 @@ void InsetMathNest::lfunMousePress(Cursor  cur, 
FuncRequest  cmd)
 void InsetMathNest::lfunMouseMotion(Cursor  cur, FuncRequest  cmd)
 {
// only select with button 1
-   if (cmd.button() == mouse_button::button1) {
-   Cursor  bvcur = cur.bv().cursor();
-   if (bvcur.realAnchor().hasPart(cur)) {
-   //lyxerr  ## lfunMouseMotion: cursor:   cur  
endl;
-   bvcur.setCursor(cur);
-   bvcur.setSelection(true);
-   //lyxerr  MOTION   bvcur  endl;
-   } else
-   cur.undispatched();
+   if (cmd.button() != mouse_button::button1)
+   return;
+
+   Cursor  bvcur = cur.bv().cursor();
+
+   // ignore motions deeper nested than the real anchor
+   if (!bvcur.realAnchor().hasPart(cur)) {
+   cur.undispatched();
+   return;
}
+
+   CursorSlice old = bvcur.top();
+
+   // We continue with our existing selection or start a new one, so don't
+   // reset the anchor.
+   bvcur.setCursor(cur);
+   // Did we actually move?
+   if (cur.top() == old)
+   // We didn't move one iota, so no need to change selection 
status
+   // or update the screen.
+   cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor);
+   else
+   bvcur.setSelection();
 }
 
 


[LyX/master] Update other comment.

2014-04-21 Thread Richard Heck
commit 39ac113ba1e066f9e50a9e58c604f7c86170e5ba
Author: Richard Heck rgh...@lyx.org
Date:   Mon Apr 7 11:02:21 2014 -0400

Update other comment.

diff --git a/src/Layout.h b/src/Layout.h
index 05f6cbd..d0abcec 100644
--- a/src/Layout.h
+++ b/src/Layout.h
@@ -116,8 +116,8 @@ public:
/// Returns latexargs() + postcommandargs() + itemargs().
/// But note that it returns a *copy*, not a reference, so do not do
/// anything like:
-   ///   Layout::LaTeXArgMap it = args().begin();
-   ///   Layout::LaTeXArgMap en = args().end();
+   ///   Layout::LaTeXArgMap::iterator it = args().begin();
+   ///   Layout::LaTeXArgMap::iterator en = args().end();
/// Those are iterators for different containers.
LaTeXArgMap args() const;
///


[LyX/master] Typo.

2014-04-21 Thread Richard Heck
commit f80ef1a1593f31f085823f0d11e27a5d168101fd
Author: Richard Heck rgh...@lyx.org
Date:   Fri Apr 11 11:28:04 2014 -0400

Typo.

diff --git a/lib/lyx2lyx/lyx2lyx_tools.py b/lib/lyx2lyx/lyx2lyx_tools.py
index 1edd1fb..fefc53f 100644
--- a/lib/lyx2lyx/lyx2lyx_tools.py
+++ b/lib/lyx2lyx/lyx2lyx_tools.py
@@ -17,7 +17,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
 
 '''
-This modules offer several free functions to help with lyx2lyx'ing. 
+This module offers several free functions to help with lyx2lyx'ing. 
 More documentaton is below, but here is a quick guide to what 
 they do. Optional arguments are marked by brackets.
 


[LyX/master] Use subdir-objects for automake 1.14 or newer

2014-04-21 Thread Richard Heck
commit 6c8a775c73f58eea81a7fe0208c23972c6abba5d
Author: Jean-Marc Lasgouttes lasgout...@lyx.org
Date:   Sun Apr 20 20:20:25 2014 +0200

Use subdir-objects for automake 1.14 or newer

This option is going to be mandatory starting with automake 2.0.
LyX is able to use this since version 2.1, but it turns out that it is
badly implemented in versions of automake older than 1.14.

We rely on some (undocumented) symbol to detect automake 1.14 and
use the subdirs-objects option in this case.

For more details, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181023.html

Making everything work with autotools required making a copy of two
files from support/tests. It seems that we should not point to source files
that are handled by another Makefile.am.

diff --git a/configure.ac b/configure.ac
index 1ce2ed3..e3302e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,7 +27,11 @@ fi
 AM_MAINTAINER_MODE
 
 save_PACKAGE=$PACKAGE
-AM_INIT_AUTOMAKE([foreign dist-bzip2 no-define 1.8])
+dnl The test for _AM_PROG_CC_C_O intends to test for automake 1.14 or newer,
+dnl which are the versions where subdir-objects can beused.
+dnl see: https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181023.html
+m4_define([LYX_OBJECTS_LAYOUT], m4_ifdef([_AM_PROG_CC_C_O],[subdir-objects],))
+AM_INIT_AUTOMAKE([foreign dist-bzip2 no-define 1.8] LYX_OBJECTS_LAYOUT)
 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 PACKAGE=$save_PACKAGE
 
diff --git a/src/Makefile.am b/src/Makefile.am
index ea5ca42..2a98643 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -708,7 +708,7 @@ check_layout_SOURCES = \
Spacing.cpp \
TextClass.cpp \
tests/check_layout.cpp \
-   support/tests/boost.cpp \
-   support/tests/dummy_functions.cpp
+   tests/boost.cpp \
+   tests/dummy_functions.cpp
 
 .PHONY: alltests alltests-recursive updatetests
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 2a8b39e..ce5b355 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -8,7 +8,7 @@ set(check_layout_SOURCES)
 foreach(_f insets/InsetLayout.cpp Color.cpp Counters.cpp Floating.cpp
FloatList.cpp FontInfo.cpp Layout.cpp LayoutFile.cpp Lexer.cpp
ModuleList.cpp Spacing.cpp TextClass.cpp tests/check_layout.cpp
-   support/tests/boost.cpp support/tests/dummy_functions.cpp)
+   tests/boost.cpp tests/dummy_functions.cpp)
   list(APPEND check_layout_SOURCES ${TOP_SRC_DIR}/src/${_f})
 endforeach()
 
diff --git a/src/tests/boost.cpp b/src/tests/boost.cpp
new file mode 100644
index 000..426263b
--- /dev/null
+++ b/src/tests/boost.cpp
@@ -0,0 +1,36 @@
+/**
+ * \file boost.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include config.h
+
+#include support/lassert.h
+
+#include cstdlib
+#include exception
+
+using namespace std;
+
+namespace boost {
+
+#ifndef BOOST_NO_EXCEPTIONS
+void throw_exception(exception const  /*e*/)
+{
+   LASSERT(false, /**/);
+}
+#endif
+
+
+void assertion_failed(char const * /*expr*/, char const * /*function*/,
+ char const * /*file*/, long /*line*/)
+{
+   ::abort();
+}
+
+} // namespace boost
diff --git a/src/tests/dummy_functions.cpp b/src/tests/dummy_functions.cpp
new file mode 100644
index 000..5a99081
--- /dev/null
+++ b/src/tests/dummy_functions.cpp
@@ -0,0 +1,38 @@
+#include config.h
+
+#include ../Messages.h
+
+using namespace std;
+
+namespace lyx {
+   // Dummy LyXRC support
+   class LyXRC { string icon_set; } lyxrc;
+
+   // Dummy LyXAlignment support
+   enum LyXAlignment {
+   DUMMY
+   };
+
+   // Keep the linker happy on Windows
+   void lyx_exit(int) {}
+
+   // Dummy language support
+   Messages const  getGuiMessages()
+   {
+   static Messages lyx_messages;
+
+   return lyx_messages;
+   }
+   Messages const  getMessages(string const )
+   {
+   static Messages lyx_messages;
+
+   return lyx_messages;
+   }
+
+   string alignmentToCSS(LyXAlignment)
+   {
+   return string();
+   }
+
+}


[LyX/master] ulem commands can be nested.

2014-04-21 Thread Richard Heck
commit 9aa0fe91f6f39ffd889af02e7bb00b7eef585abc
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Sat Mar 22 12:25:25 2014 +0100

ulem commands can be nested.

diff --git a/src/Font.cpp b/src/Font.cpp
index a155ec5..7e8b3f4 100644
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -418,22 +418,22 @@ int Font::latexWriteStartChanges(odocstream  os, 
BufferParams const  bparams,
if (f.underbar() == FONT_ON) {
os  \\uline{;
count += 10;
-   runparams.inulemcmd = true;
+   ++runparams.inulemcmd;
}
if (f.strikeout() == FONT_ON) {
os  \\sout{;
count += 9;
-   runparams.inulemcmd = true;
+   ++runparams.inulemcmd;
}
if (f.uuline() == FONT_ON) {
os  \\uuline{;
count += 11;
-   runparams.inulemcmd = true;
+   ++runparams.inulemcmd;
}
if (f.uwave() == FONT_ON) {
os  \\uwave{;
count += 10;
-   runparams.inulemcmd = true;
+   ++runparams.inulemcmd;
}
return count;
 }
@@ -497,22 +497,22 @@ int Font::latexWriteEndChanges(otexstream  os, 
BufferParams const  bparams,
if (f.underbar() == FONT_ON) {
os  '}';
++count;
-   runparams.inulemcmd = false;
+   --runparams.inulemcmd;
}
if (f.strikeout() == FONT_ON) {
os  '}';
++count;
-   runparams.inulemcmd = false;
+   --runparams.inulemcmd;
}
if (f.uuline() == FONT_ON) {
os  '}';
++count;
-   runparams.inulemcmd = false;
+   --runparams.inulemcmd;
}
if (f.uwave() == FONT_ON) {
os  '}';
++count;
-   runparams.inulemcmd = false;
+   --runparams.inulemcmd;
}
 
// If the current language is Hebrew, Arabic, or Farsi
diff --git a/src/OutputParams.cpp b/src/OutputParams.cpp
index df58ff4..e74eaa3 100644
--- a/src/OutputParams.cpp
+++ b/src/OutputParams.cpp
@@ -20,7 +20,7 @@ namespace lyx {
 
 OutputParams::OutputParams(Encoding const * enc)
: flavor(LATEX), math_flavor(NotApplicable), nice(false), 
is_child(false),
- moving_arg(false), inulemcmd(false), local_font(0), 
master_language(0),
+ moving_arg(false), inulemcmd(0), local_font(0), master_language(0),
  encoding(enc), free_spacing(false), use_babel(false), 
use_polyglossia(false),
  use_indices(false), use_japanese(false), linelen(0), depth(0),
  exportdata(new ExportData),
diff --git a/src/OutputParams.h b/src/OutputParams.h
index f220b5e..598b575 100644
--- a/src/OutputParams.h
+++ b/src/OutputParams.h
@@ -99,13 +99,13 @@ public:
*/
bool intitle;
 
-   /** inulemcmd == true means that the environment in which the
+   /** inulemcmd  0 means that the environment in which the
inset is typeset is part of a ulem command (\uline, \uuline,
\uwave, or \sout). Insets that output latex commands relying
on local assignments (such as \cite) should enclose such
commands in \mbox{} in order to avoid breakage.
*/
-   mutable bool inulemcmd;
+   mutable int inulemcmd;
 
/** the font at the point where the inset is
 */
diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp
index c0e6179..96620c1 100644
--- a/src/insets/InsetCitation.cpp
+++ b/src/insets/InsetCitation.cpp
@@ -422,7 +422,7 @@ void InsetCitation::latex(otexstream  os, OutputParams 
const  runparams) const
// FIXME UNICODE
docstring const cite_str = from_utf8(citationStyleToString(cs));
 
-   if (runparams.inulemcmd)
+   if (runparams.inulemcmd  0)
os  \\mbox{;
 
os  \\  cite_str;
diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp
index a3f0596..464a3dd 100644
--- a/src/insets/InsetRef.cpp
+++ b/src/insets/InsetRef.cpp
@@ -143,7 +143,7 @@ void InsetRef::latex(otexstream  os, OutputParams const  
rp) const
string const cmd = getCmdName();
docstring const data = getEscapedLabel(rp);
 
-   if (rp.inulemcmd)
+   if (rp.inulemcmd  0)
os  \\mbox{;
 
if (cmd == eqref  buffer().params().use_refstyle) {
@@ -168,7 +168,7 @@ void InsetRef::latex(otexstream  os, OutputParams const  
rp) const
os  p.getCommand(rp);
}
 
-   if (rp.inulemcmd)
+   if (rp.inulemcmd  0)
os  };
 }
 


[LyX/master] Typos and style.

2014-04-21 Thread Richard Heck
commit 0a6ff99f28686066675848f3410f77c0947bc357
Author: Richard Heck rgh...@lyx.org
Date:   Sat Mar 29 18:52:36 2014 -0400

Typos and style.

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 6f7a5cd..51430e4 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -929,7 +929,7 @@ bool Buffer::readDocument(Lexer  lex)
 
readHeader(lex);
 
-   if (params().outputChanges) {
+   if (params().output_changes) {
bool dvipost= LaTeXFeatures::isAvailable(dvipost);
bool xcolorulem = LaTeXFeatures::isAvailable(ulem) 
  LaTeXFeatures::isAvailable(xcolor);
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index a70bc9e..454ccbe 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -371,8 +371,8 @@ BufferParams::BufferParams()
biblio_style = plain;
use_bibtopic = false;
use_indices = false;
-   trackChanges = false;
-   outputChanges = false;
+   track_changes = false;
+   output_changes = false;
use_default_options = true;
maintain_unincluded_children = false;
secnumdepth = 3;
@@ -752,9 +752,9 @@ string BufferParams::readToken(Lexer  lex, string const  
token,
} else if (token == \\use_indices) {
lex  use_indices;
} else if (token == \\tracking_changes) {
-   lex  trackChanges;
+   lex  track_changes;
} else if (token == \\output_changes) {
-   lex  outputChanges;
+   lex  output_changes;
} else if (token == \\branch) {
lex.eatLine();
docstring branch = lex.getDocString();
@@ -1178,8 +1178,8 @@ void BufferParams::writeFile(ostream  os) const
}
}
 
-   os  \\tracking_changes   convertstring(trackChanges)  '\n'
-   \\output_changes   convertstring(outputChanges)  '\n'
+   os  \\tracking_changes   convertstring(track_changes)  '\n'
+   \\output_changes   convertstring(output_changes)  '\n'
\\html_math_output   html_math_output  '\n'
\\html_css_as_file   html_css_as_file  '\n'
\\html_be_strict   convertstring(html_be_strict)  '\n';
@@ -1202,7 +1202,7 @@ void BufferParams::validate(LaTeXFeatures  features) 
const
if (columns  1  language-rightToLeft())
features.require(rtloutputdblcol);
 
-   if (outputChanges) {
+   if (output_changes) {
bool dvipost= LaTeXFeatures::isAvailable(dvipost);
bool xcolorulem = LaTeXFeatures::isAvailable(ulem) 
  LaTeXFeatures::isAvailable(xcolor);
diff --git a/src/BufferParams.h b/src/BufferParams.h
index 0825616..3706399 100644
--- a/src/BufferParams.h
+++ b/src/BufferParams.h
@@ -120,7 +120,7 @@ public:
/// Set the LyX layout file this document is using.
/// NOTE: This does not call makeDocumentClass() to update the local
/// DocumentClass. That needs to be done manually.
-   /// \param filename the name of the layout file
+   /// \param classname: the name of the layout file
bool setBaseClass(std::string const  classname);
/// Adds the module information to the baseClass information to
/// create our local DocumentClass.
@@ -369,12 +369,12 @@ public:
/// Split the index?
bool use_indices;
/// revision tracking for this buffer ?
-   bool trackChanges;
+   bool track_changes;
/** This param decides whether change tracking marks should be used
 *  in output (irrespective of how these marks are actually defined;
 *  for instance, they may differ for DVI and PDF generation)
 */
-   bool outputChanges;
+   bool output_changes;
///
bool compressed;
 
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 392f380..ba0df6e 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -1108,12 +1108,12 @@ bool BufferView::getStatus(FuncRequest const  cmd, 
FuncStatus  flag)
 
case LFUN_CHANGES_TRACK:
flag.setEnabled(true);
-   flag.setOnOff(buffer_.params().trackChanges);
+   flag.setOnOff(buffer_.params().track_changes);
break;
 
case LFUN_CHANGES_OUTPUT:
flag.setEnabled(true);
-   flag.setOnOff(buffer_.params().outputChanges);
+   flag.setOnOff(buffer_.params().output_changes);
break;
 
case LFUN_CHANGES_MERGE:
@@ -1430,12 +1430,12 @@ void BufferView::dispatch(FuncRequest const  cmd, 
DispatchResult  dr)
}
 
case LFUN_CHANGES_TRACK:
-   buffer_.params().trackChanges = !buffer_.params().trackChanges;
+   buffer_.params().track_changes = 
!buffer_.params().track_changes;
break;
 
case LFUN_CHANGES_OUTPUT:
-   buffer_.params().outputChanges = 
!buffer_.params().outputChanges;
-

[LyX/master] Patch from Enrico fixing a problem with the lyxpak.py script when Add Bibliography to TOC is used. Fixes #9044.

2014-04-21 Thread Richard Heck
commit 4540e6c2efa1853c3abe9fc4811301570400a954
Author: Richard Heck rgh...@lyx.org
Date:   Sat Mar 22 20:19:17 2014 -0400

Patch from Enrico fixing a problem with the lyxpak.py script when
Add Bibliography to TOC is used. Fixes #9044.

diff --git a/lib/scripts/lyxpak.py b/lib/scripts/lyxpak.py
index f3b8078..ed4f206 100755
--- a/lib/scripts/lyxpak.py
+++ b/lib/scripts/lyxpak.py
@@ -145,6 +145,8 @@ def gather_files(curfile, incfiles, lyx2lyx):
 match = re_options.match(lines[i])
 if match:
 file = match.group(3).strip('')
+if file.startswith(bibtotoc,):
+file = file[9:]
 if not os.path.isabs(file):
 file = os.path.join(curdir, file + '.bst')
 if os.path.exists(file):


[LyX/master] OS X: Title bar can be clicked to access file path

2014-04-21 Thread Richard Heck
commit 382b42d6c21ec7dc5e0a2c918b0764ba4fb7ca7d
Author: Benjamin Piwowarski bpiwo...@lyx.org
Date:   Mon Mar 17 17:46:14 2014 +0100

OS X: Title bar can be clicked to access file path

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index cd5d3ff..6a6c1e8 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1002,6 +1002,9 @@ void GuiView::updateWindowTitle(GuiWorkArea * wa)
return;
setWindowTitle(qt_(LyX: ) + wa-windowTitle());
setWindowIconText(wa-windowIconText());
+#if (QT_VERSION = 0x040400)
+   setWindowFilePath(wa-bufferView().buffer().absFileName().c_str());
+#endif
 }
 
 


[LyX/master] Tooltip for completion word length.

2014-04-21 Thread Richard Heck
commit 3d6790607ef6dec5c5be8b1a720eb1ca31c3a15b
Author: Richard Heck rgh...@lyx.org
Date:   Thu Mar 20 23:12:09 2014 -0400

Tooltip for completion word length.

diff --git a/src/frontends/qt4/ui/PrefCompletionUi.ui 
b/src/frontends/qt4/ui/PrefCompletionUi.ui
index 010b308..c8cbe1f 100644
--- a/src/frontends/qt4/ui/PrefCompletionUi.ui
+++ b/src/frontends/qt4/ui/PrefCompletionUi.ui
@@ -1,62 +1,63 @@
-ui version=4.0 
+?xml version=1.0 encoding=UTF-8?
+ui version=4.0
  classPrefCompletionUi/class
- widget class=QWidget name=PrefCompletionUi 
-  property name=geometry 
+ widget class=QWidget name=PrefCompletionUi
+  property name=geometry
rect
 x0/x
 y0/y
-width400/width
-height404/height
+width412/width
+height468/height
/rect
   /property
-  property name=windowTitle 
+  property name=windowTitle
string/
   /property
-  layout class=QGridLayout 
-   property name=margin 
+  layout class=QGridLayout
+   property name=margin
 number9/number
/property
-   property name=spacing 
+   property name=spacing
 number6/number
/property
-   item row=1 column=0 
-widget class=QGroupBox name=groupBox_3 
- property name=title 
+   item row=1 column=0
+widget class=QGroupBox name=groupBox_3
+ property name=title
   stringIn Math/string
  /property
- property name=flat 
+ property name=flat
   booltrue/bool
  /property
- layout class=QVBoxLayout 
-  property name=margin 
-   number9/number
-  /property
-  property name=spacing 
+ layout class=QVBoxLayout
+  property name=spacing
number6/number
   /property
+  property name=margin
+   number9/number
+  /property
   item
-   widget class=QCheckBox name=inlineMathCB 
-property name=toolTip 
+   widget class=QCheckBox name=inlineMathCB
+property name=toolTip
  stringShow the grey inline completion behind the cursor in math 
mode after the delay./string
 /property
-property name=text 
+property name=text
  stringAutomatic inamp;line completion/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=popupMathCB 
-property name=toolTip 
+   widget class=QCheckBox name=popupMathCB
+property name=toolTip
  stringShow the popup in math mode after the delay./string
 /property
-property name=text 
+property name=text
  stringAutomatic pamp;opup/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=autocorrectionCB 
-property name=text 
+   widget class=QCheckBox name=autocorrectionCB
+property name=text
  stringAutocoamp;rrection/string
 /property
/widget
@@ -64,47 +65,47 @@
  /layout
 /widget
/item
-   item row=0 column=0 
-widget class=QGroupBox name=groupBox_2 
- property name=title 
+   item row=0 column=0
+widget class=QGroupBox name=groupBox_2
+ property name=title
   stringIn Text/string
  /property
- property name=flat 
+ property name=flat
   booltrue/bool
  /property
- layout class=QVBoxLayout 
-  property name=margin 
-   number9/number
-  /property
-  property name=spacing 
+ layout class=QVBoxLayout
+  property name=spacing
number6/number
   /property
+  property name=margin
+   number9/number
+  /property
   item
-   widget class=QCheckBox name=inlineTextCB 
-property name=toolTip 
+   widget class=QCheckBox name=inlineTextCB
+property name=toolTip
  stringShow the grey inline completion behind the cursor in text 
mode after the delay./string
 /property
-property name=text 
+property name=text
  stringAutomatic amp;inline completion/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=popupTextCB 
-property name=toolTip 
+   widget class=QCheckBox name=popupTextCB
+property name=toolTip
  stringShow the popup after the set delay in text mode./string
 /property
-property name=text 
+property name=text
  stringAutomatic amp;popup/string
 /property
/widget
   /item
   item
-   widget class=QCheckBox name=cursorTextCB 
-property name=toolTip 
+   widget class=QCheckBox name=cursorTextCB
+property name=toolTip
  stringShow a small triangle on the cursor if a completion is 
available in text mode./string
 /property
-property name=text 
+property name=text
  stringCursor iamp;ndicator/string
 /property
/widget
@@ -112,58 +113,58 @@
  /layout
 /widget
/item
-   item row=2 column=0 
-widget class=QGroupBox name=groupBox_4 
- property name=title 
+   item row=2 column=0
+

[LyX/master] Whitespace.

2014-04-21 Thread Richard Heck
commit c0be76a2d6bd8646df43e1abd7a1f98dcef7e104
Author: Richard Heck rgh...@lyx.org
Date:   Fri Apr 4 16:52:21 2014 -0400

Whitespace.

diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp
index 98fc589..79924fe 100644
--- a/src/mathed/InsetMathSymbol.cpp
+++ b/src/mathed/InsetMathSymbol.cpp
@@ -29,13 +29,13 @@
 namespace lyx {
 
 InsetMathSymbol::InsetMathSymbol(latexkeys const * l)
-  : sym_(l), h_(0), kerning_(0), scriptable_(false)
+   : sym_(l), h_(0), kerning_(0), scriptable_(false)
 {}
 
 
 InsetMathSymbol::InsetMathSymbol(char const * name)
: sym_(in_word_set(from_ascii(name))), h_(0),
-kerning_(0), scriptable_(false)
+ kerning_(0), scriptable_(false)
 {}
 
 


[LyX/master] Typo.

2014-04-21 Thread Richard Heck
commit cd32001de672fb80d37c5f6febd6e15c25a704aa
Author: Richard Heck rgh...@lyx.org
Date:   Wed Mar 26 15:17:57 2014 -0400

Typo.

diff --git a/src/support/lassert.h b/src/support/lassert.h
index 5a47edf..5e152e0 100644
--- a/src/support/lassert.h
+++ b/src/support/lassert.h
@@ -21,7 +21,7 @@ namespace lyx {
 
 /**
 
-LyX has five different macros that can be used to make assertions. The behave
+LyX has five different macros that can be used to make assertions. They behave
 the same way in devel mode: They assert. The differences between them are how
 they behave in release mode.
 


[LyX/master] Add comment.

2014-04-21 Thread Richard Heck
commit 2928afbd01b58cfe639b8390081c9dfcd4fb3a0f
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Mon Apr 7 08:46:35 2014 +0200

Add comment.

diff --git a/src/Layout.h b/src/Layout.h
index 913546f..05f6cbd 100644
--- a/src/Layout.h
+++ b/src/Layout.h
@@ -108,13 +108,18 @@ public:
///
typedef std::mapstd::string, latexarg LaTeXArgMap;
///
-   LaTeXArgMap args() const;
-   ///
LaTeXArgMap const  latexargs() const { return latexargs_; }
///
LaTeXArgMap const  postcommandargs() const { return postcommandargs_; }
///
LaTeXArgMap const  itemargs() const { return itemargs_; }
+   /// Returns latexargs() + postcommandargs() + itemargs().
+   /// But note that it returns a *copy*, not a reference, so do not do
+   /// anything like:
+   ///   Layout::LaTeXArgMap it = args().begin();
+   ///   Layout::LaTeXArgMap en = args().end();
+   /// Those are iterators for different containers.
+   LaTeXArgMap args() const;
///
int optArgs() const;
///


[LyX/master] Do not allow the manual insertion of a directory (without filename) into the import dialog and thus prevent an assertion.

2014-04-21 Thread Richard Heck
commit df1dbe28ce8b1a095ec9b9de92a1dc697c015c28
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Sun Mar 23 13:31:21 2014 +0100

Do not allow the manual insertion of a directory (without filename) into 
the import dialog and thus prevent an assertion.

Fixes: #7437

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 4a4ab00..22681f1 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -2121,6 +2121,18 @@ void GuiView::importDocument(string const  argument)
// get absolute path of file
FileName const fullname(support::makeAbsPath(filename));
 
+   // Can happen if the user entered a path into the dialog
+   // (see bug #7437)
+   if (fullname.onlyFileName().empty()) {
+   docstring msg = bformat(_(The file name '%1$s' is invalid!\n
+ Aborting import.),
+   from_utf8(fullname.absFileName()));
+   frontend::Alert::error(_(File name error), msg);
+   message(_(Canceled.));
+   return;
+   }
+
+
FileName const lyxfile(support::changeExtension(fullname.absFileName(), 
.lyx));
 
// Check if the document already is open


[LyX/master] Fix section-select when issued from outliner

2014-04-21 Thread Richard Heck
commit 8913031fafeb37dda18edc7932e4311f5691aea4
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Fri Mar 21 10:21:18 2014 +0100

Fix section-select when issued from outliner

Fixes: #8936

diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp
index 3619e6c..2069035 100644
--- a/src/frontends/qt4/TocWidget.cpp
+++ b/src/frontends/qt4/TocWidget.cpp
@@ -187,9 +187,15 @@ void TocWidget::doDispatch(Cursor  cur, FuncRequest const 
 cmd)
{
case LFUN_CHANGE_ACCEPT:
case LFUN_CHANGE_REJECT:
+   dispatch(item.action());
+   cur.dispatch(tmpcmd);
+   break;
+
case LFUN_SECTION_SELECT:
dispatch(item.action());
cur.dispatch(tmpcmd);
+   // necessary to get the selection drawn.
+   cur.buffer()-changed(true);
break;
 
case LFUN_LABEL_COPY_AS_REFERENCE: {


[LyX/master] Return an error if LaTeX is unable to compile the file.

2014-04-21 Thread Richard Heck
commit 64e0c5589c866a505bebff87da98a08979848516
Author: Richard Heck rgh...@lyx.org
Date:   Wed Mar 19 12:42:57 2014 -0400

Return an error if LaTeX is unable to compile the file.

diff --git a/lib/scripts/legacy_lyxpreview2ppm.py 
b/lib/scripts/legacy_lyxpreview2ppm.py
index fdc5a8e..d16e867 100644
--- a/lib/scripts/legacy_lyxpreview2ppm.py
+++ b/lib/scripts/legacy_lyxpreview2ppm.py
@@ -293,6 +293,8 @@ def legacy_conversion_step1(latex_file, dpi, output_format, 
fg_color, bg_color,
 
 # Compile the latex file.
 latex_status, latex_stdout = run_latex(latex, latex_file)
+if latex_status:
+  return (latex_status, [])
 
 if pdf_output:
 return legacy_conversion_step3(latex_file, dpi, output_format, True, 
skipMetrics)
diff --git a/lib/scripts/lyxpreview2bitmap.py b/lib/scripts/lyxpreview2bitmap.py
index 4a2cddb..ace46d2 100755
--- a/lib/scripts/lyxpreview2bitmap.py
+++ b/lib/scripts/lyxpreview2bitmap.py
@@ -409,6 +409,8 @@ def main(argv):
 
 # Compile the latex file.
 latex_status, latex_stdout = run_latex(latex, latex_file, bibtex)
+if latex_status:
+  return (latex_status, [])
 
 # The dvi output file name
 dvi_file = latex_file_re.sub(.dvi, latex_file)


[LyX/master] Really use qstr to convert a string in a QString

2014-04-21 Thread Richard Heck
commit 54a534c81fe1ff344e4972303cc59aeaac9c6e1b
Author: Benjamin Piwowarski bpiwo...@lyx.org
Date:   Fri Mar 21 14:15:07 2014 +0100

Really use qstr to convert a string in a QString

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index ce39a6e..4a4ab00 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1006,7 +1006,7 @@ void GuiView::updateWindowTitle(GuiWorkArea * wa)
// Sets the path for the window: this is used by OSX to 
// allow a context click on the title bar showing a menu
// with the path up to the file
-   
setWindowFilePath(toqstr(wa-bufferView().buffer().absFileName().c_str()));
+   setWindowFilePath(toqstr(wa-bufferView().buffer().absFileName()));
 #endif
 }
 


[LyX/master] Fix a bunch of minor issues discovered by the cppcheck script.

2014-04-21 Thread Richard Heck
commit 065db6806771190d12d37d64c4c86f9c5ebaf225
Author: Richard Heck rgh...@lyx.org
Date:   Fri Apr 4 15:54:32 2014 -0400

Fix a bunch of minor issues discovered by the cppcheck script.

diff --git a/src/Author.h b/src/Author.h
index 7d9f3dd..d62fcb0 100644
--- a/src/Author.h
+++ b/src/Author.h
@@ -67,10 +67,10 @@ public:
///
Author const  get(int id) const;
///
-   typedef std::vectorAuthor Authors;
-   ///
void sort();
///
+   typedef std::vectorAuthor Authors;
+   ///
Authors::const_iterator begin() const;
///
Authors::const_iterator end() const;
diff --git a/src/Compare.cpp b/src/Compare.cpp
index 1d72ebf..c2a01a6 100644
--- a/src/Compare.cpp
+++ b/src/Compare.cpp
@@ -384,7 +384,7 @@ void Compare::run()
AuthorList const  extra_authors = options_.settings_from_new ?
old_buffer-params().authors() : new_buffer-params().authors();
AuthorList::Authors::const_iterator it = extra_authors.begin();
-   for (; it != extra_authors.end(); it++)
+   for (; it != extra_authors.end(); ++it)
dest_buffer-params().authors().record(*it);

doStatusMessage();
diff --git a/src/ConverterCache.cpp b/src/ConverterCache.cpp
index e384cdc..1451f6e 100644
--- a/src/ConverterCache.cpp
+++ b/src/ConverterCache.cpp
@@ -56,8 +56,7 @@ static FileName cache_dir;
 
 class CacheItem {
 public:
-   CacheItem()
-   {}
+   CacheItem() {}
CacheItem(FileName const  orig_from, string const  to_format,
  time_t t, unsigned long c)
: timestamp(t), checksum(c)
diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index d431965..964b593 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -635,7 +635,6 @@ bool Cursor::posVisRight(bool skip_inset)
Cursor new_cur = *this; // where we will move to
pos_type left_pos; // position visually left of current cursor
pos_type right_pos; // position visually right of current cursor
-   bool new_pos_is_RTL; // is new position we're moving to RTL?
 
getSurroundingPos(left_pos, right_pos);
 
@@ -679,7 +678,7 @@ bool Cursor::posVisRight(bool skip_inset)
// we're currently to the left of 'right_pos'). In
// order to move to the right, it depends whether or
// not the character at 'right_pos' is RTL.
-   new_pos_is_RTL = paragraph().getFontSettings(
+   bool const new_pos_is_RTL = paragraph().getFontSettings(
buffer()-params(), right_pos).isVisibleRightToLeft();
// If the character at 'right_pos' *is* LTR, then in
// order to move to the right of it, we need to be
@@ -735,7 +734,6 @@ bool Cursor::posVisLeft(bool skip_inset)
Cursor new_cur = *this; // where we will move to
pos_type left_pos; // position visually left of current cursor
pos_type right_pos; // position visually right of current cursor
-   bool new_pos_is_RTL; // is new position we're moving to RTL?
 
getSurroundingPos(left_pos, right_pos);
 
@@ -779,7 +777,7 @@ bool Cursor::posVisLeft(bool skip_inset)
// currently to the right of 'left_pos'). In order to
// move to the left, it depends whether or not the
// character at 'left_pos' is RTL.
-   new_pos_is_RTL = paragraph().getFontSettings(
+   bool const new_pos_is_RTL = paragraph().getFontSettings(
buffer()-params(), left_pos).isVisibleRightToLeft();
// If the character at 'left_pos' *is* RTL, then in
// order to move to the left of it, we need to be
diff --git a/src/Floating.cpp b/src/Floating.cpp
index 513c4fa..61b3b15 100644
--- a/src/Floating.cpp
+++ b/src/Floating.cpp
@@ -24,10 +24,6 @@ using namespace std;
 namespace lyx {
 
 
-Floating::Floating()
-{}
-
-
 Floating::Floating(string const  type, string const  placement,
   string const  ext, string const  within,
   string const  style, string const  name,
diff --git a/src/Floating.h b/src/Floating.h
index d1bf74c..b677f0c 100644
--- a/src/Floating.h
+++ b/src/Floating.h
@@ -26,7 +26,7 @@ namespace lyx {
 class Floating {
 public:
///
-   Floating();
+   Floating() {}
///
Floating(std::string const  type, std::string const  placement,
 std::string const  ext, std::string const  within,
diff --git a/src/OutputParams.cpp b/src/OutputParams.cpp
index e74eaa3..cf81253 100644
--- a/src/OutputParams.cpp
+++ b/src/OutputParams.cpp
@@ -20,7 +20,7 @@ namespace lyx {
 
 OutputParams::OutputParams(Encoding const * enc)
: flavor(LATEX), math_flavor(NotApplicable), nice(false), 
is_child(false),
- moving_arg(false), inulemcmd(0), local_font(0), master_language(0),
+ moving_arg(false), intitle(false), inulemcmd(0), local_font(0), 

[LyX/master] Do not store Languages objects in completion words lists

2014-04-21 Thread Richard Heck
commit f8da042312cf9a563f46e4a767fc3c4ae6ecb764
Author: Jean-Marc Lasgouttes lasgout...@lyx.org
Date:   Fri Mar 21 12:24:47 2014 +0100

Do not store Languages objects in completion words lists

In the current code each paragraph contains a mapLanguage,
WordList*, which means that it contains a full copy of the language
object. Since these objects contain translation tables nowadays, this
is a very bad idea.

This patch simply replaces the Language key by a string.

When loading the Userguide on linux/x86_64, the total memory
consumption decreases from 36.27MB to 31.50MB.

diff --git a/src/LyX.cpp b/src/LyX.cpp
index 41c69f7..b784831 100644
--- a/src/LyX.cpp
+++ b/src/LyX.cpp
@@ -33,6 +33,7 @@
 #include FuncStatus.h
 #include HunspellChecker.h
 #include KeyMap.h
+#include Language.h
 #include LaTeXFonts.h
 #include LayoutFile.h
 #include Lexer.h
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index ffcb5f2..4d9b37c 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -499,7 +499,7 @@ public:
TextContainer text_;
 
typedef setdocstring Words;
-   typedef mapLanguage, Words LangWordsMap;
+   typedef mapstring, Words LangWordsMap;
///
LangWordsMap words_;
///
@@ -3867,7 +3867,7 @@ void Paragraph::collectWords()
if (cit == d-fontlist_.end())
return;
Language const * lang = cit-font().language();
-   d-words_[*lang].insert(word);
+   d-words_[lang-lang()].insert(word);
}
}
 }
diff --git a/src/Text.cpp b/src/Text.cpp
index c4cac88..cdcc200 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -2120,7 +2120,7 @@ bool Text::completionSupported(Cursor const  cur) const
 
 CompletionList const * Text::createCompletionList(Cursor const  cur) const
 {
-   WordList const * list = theWordList(*cur.getFont().language());
+   WordList const * list = theWordList(cur.getFont().language()-lang());
return new TextCompletionList(cur, list);
 }
 
diff --git a/src/WordList.cpp b/src/WordList.cpp
index 762e1b9..3a095af 100644
--- a/src/WordList.cpp
+++ b/src/WordList.cpp
@@ -12,14 +12,11 @@
 
 #include WordList.h
 
-#include Language.h
-
 #include support/convert.h
 #include support/debug.h
 #include support/docstring.h
-#include support/weighted_btree.h
-
 #include support/lassert.h
+#include support/weighted_btree.h
 
 #include map
 
@@ -28,12 +25,13 @@ using namespace std;
 namespace lyx {
 
 ///
-mapLanguage, WordList * theGlobalWordList;
+typedef mapstring, WordList * GlobalWordList;
+GlobalWordList theGlobalWordList;
 
 
-WordList * theWordList(Language const  lang)
+WordList * theWordList(string const  lang)
 {
-   mapLanguage, WordList *::iterator it = theGlobalWordList.find(lang);
+   GlobalWordList::iterator it = theGlobalWordList.find(lang);
if (it != theGlobalWordList.end())
return it-second;
else
@@ -44,7 +42,7 @@ WordList * theWordList(Language const  lang)
 
 void WordList::cleanupWordLists()
 {
-   mapLanguage, WordList *::const_iterator it = 
theGlobalWordList.begin();
+   GlobalWordList::const_iterator it = theGlobalWordList.begin();
for (; it != theGlobalWordList.end(); ++it)
delete it-second;
theGlobalWordList.clear();
diff --git a/src/WordList.h b/src/WordList.h
index b7f88fb..f57f20b 100644
--- a/src/WordList.h
+++ b/src/WordList.h
@@ -14,8 +14,6 @@
 
 #include support/docstring.h
 
-#include Language.h
-
 namespace lyx {
 
 class WordList {
@@ -41,7 +39,7 @@ private:
Impl * d;
 };
 
-WordList * theWordList(Language const  lang);
+WordList * theWordList(std::string const  lang);
 
 } // namespace lyx
 


[LyX/master] Workaround for #7987: deleted text in change-tracking mode is not found in Advanced FR any more.

2014-04-21 Thread Richard Heck
commit cb79658e54e63e6e11417982cd52f8edc1deaa6a
Author: Tommaso Cucinotta tomm...@lyx.org
Date:   Fri Mar 28 22:56:20 2014 +

Workaround for #7987: deleted text in change-tracking mode is not found in 
Advanced FR any more.

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index 1b32ae3..0c10e19 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -787,11 +787,11 @@ static docstring stringifySearchBuffer(Buffer  buffer, 
FindAndReplaceOptions co
Paragraph const  par = buffer.paragraphs().at(pit);
LYXERR(Debug::FIND, Adding to search string: '
par.asString(pos_type(0), par.size(),
-  AS_STR_INSETS | AS_STR_PLAINTEXT,
+  AS_STR_INSETS | 
AS_STR_SKIPDELETE | AS_STR_PLAINTEXT,
   runparams)
');
str += par.asString(pos_type(0), par.size(),
-   AS_STR_INSETS | AS_STR_PLAINTEXT,
+   AS_STR_INSETS | AS_STR_SKIPDELETE | 
AS_STR_PLAINTEXT,
runparams);
}
}
@@ -1044,7 +1044,7 @@ docstring stringifyFromCursor(DocIterator const  cur, 
int len)
LYXERR(Debug::FIND, Stringifying with cur: 
cur  , from pos:   cur.pos()  , end:   
end);
return par.asString(cur.pos(), end,
-   AS_STR_INSETS | AS_STR_PLAINTEXT,
+   AS_STR_INSETS | AS_STR_SKIPDELETE | AS_STR_PLAINTEXT,
runparams);
} else if (cur.inMathed()) {
docstring s;


[LyX/master] Draw a small red frame around preview images that are too small.

2014-04-21 Thread Richard Heck
commit 7765b1c9a8673d06e84709f787b720f4df6cf00f
Author: Richard Heck rgh...@lyx.org
Date:   Wed Mar 19 12:43:21 2014 -0400

Draw a small red frame around preview images that are too small.

diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index e994d44..4c20625 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -44,6 +44,7 @@
 #include insets/InsetRef.h
 #include insets/RenderPreview.h
 
+#include graphics/GraphicsImage.h
 #include graphics/PreviewImage.h
 #include graphics/PreviewLoader.h
 
@@ -410,7 +411,7 @@ ColorCode InsetMathHull::standardColor() const
 }
 
 
-bool InsetMathHull::previewState(BufferView * bv) const
+bool InsetMathHull::previewState(const BufferView *const bv) const
 {
if (!editing(bv)  RenderPreview::status() == LyXRC::PREVIEW_ON
 type_ != hullRegexp)
@@ -423,14 +424,24 @@ bool InsetMathHull::previewState(BufferView * bv) const
 }
 
 
+namespace {
+static const int ERROR_FRAME_WIDTH = 2;
+}
+
 void InsetMathHull::metrics(MetricsInfo  mi, Dimension  dim) const
 {
if (previewState(mi.base.bv)) {
preview_-metrics(mi, dim);
-   // insert a one pixel gap in front of the formula
-   dim.wid += 1;
-   if (display())
-   dim.des += displayMargin();
+   if (previewTooSmall(dim)) {
+   // preview image is too small
+   dim.wid += 2 * ERROR_FRAME_WIDTH;
+   dim.asc += 2 * ERROR_FRAME_WIDTH;
+   } else {
+   // insert a one pixel gap in front of the formula
+   dim.wid += 1;
+   if (display())
+   dim.des += displayMargin();
+   }
// Cache the inset dimension.
setDimCache(mi, dim);
return;
@@ -471,10 +482,21 @@ void InsetMathHull::metrics(MetricsInfo  mi, Dimension  
dim) const
 }
 
 
+bool InsetMathHull::previewTooSmall(Dimension const  dim) const
+{
+   return dim.width() = 10  dim.height() = 10;
+}
+
+
 ColorCode InsetMathHull::backgroundColor(PainterInfo const  pi) const
 {
-   if (previewState(pi.base.bv))
+   BufferView const * const bv = pi.base.bv;
+   if (previewState(bv)) {
+   Dimension const dim = dimension(*pi.base.bv);
+   if (previewTooSmall(dim))
+   return Color_error;
return graphics::PreviewLoader::backgroundColor();
+   }
return Color_mathbg;
 }
 
@@ -482,23 +504,36 @@ ColorCode InsetMathHull::backgroundColor(PainterInfo 
const  pi) const
 void InsetMathHull::drawBackground(PainterInfo  pi, int x, int y) const
 {
Dimension const dim = dimension(*pi.base.bv);
+   if (previewTooSmall(dim)) {
+   pi.pain.fillRectangle(x, y - 2 * ERROR_FRAME_WIDTH, 
+   dim.wid, dim.asc + dim.des, backgroundColor(pi));
+   return;
+   } 
pi.pain.fillRectangle(x + 1, y - dim.asc + 1, dim.wid - 2,
-   dim.asc + dim.des - 1, pi.backgroundColor(this));
+   dim.asc + dim.des - 1, backgroundColor(pi));
 }
 
 
 void InsetMathHull::draw(PainterInfo  pi, int x, int y) const
 {
-   use_preview_ = previewState(pi.base.bv);
+   BufferView const * const bv = pi.base.bv;
+   use_preview_ = previewState(bv);
 
if (type_ == hullRegexp) {
-   Dimension const dim = dimension(*pi.base.bv);
+   Dimension const dim = dimension(*bv);
pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
dim.width() - 2, dim.height() - 2, Color_regexpframe);
}
+
if (use_preview_) {
-   // one pixel gap in front
-   preview_-draw(pi, x + 1, y);
+   Dimension const dim = dimension(*bv);
+   if (previewTooSmall(dim)) {
+   // we have an extra frame
+   preview_-draw(pi, x + ERROR_FRAME_WIDTH, y);
+   } else {
+   // one pixel gap in front
+   preview_-draw(pi, x + 1, y);
+   }
setPosCache(pi, x, y);
return;
}
diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h
index af00eaf..0cd 100644
--- a/src/mathed/InsetMathHull.h
+++ b/src/mathed/InsetMathHull.h
@@ -271,7 +271,9 @@ protected:
///
void handleFont2(Cursor  cur, docstring const  arg);
///
-   bool previewState(BufferView * bv) const;
+   bool previewState(BufferView const * const bv) const;
+   ///
+   bool previewTooSmall(Dimension const  dim) const;
 };
 
 


[LyX/master] Fix assertion when ChkTeX hit math.

2014-04-21 Thread Richard Heck
commit a70571258d1253e5576b94fdc21209a54041626e
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Sat Mar 22 12:09:18 2014 +0100

Fix assertion when ChkTeX hit math.

The problem here was that we used texted-only methods (via paragraph()), 
which triggered the assertion as soon as we were inside math.

Fixes: #8798

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 435a806..ab5501c 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -62,6 +62,8 @@
 #include insets/InsetRef.h
 #include insets/InsetText.h
 
+#include mathed/MathData.h
+
 #include frontends/alert.h
 #include frontends/Application.h
 #include frontends/Delegates.h
@@ -2496,7 +2498,8 @@ void BufferView::putSelectionAt(DocIterator const  cur,
 
 bool BufferView::selectIfEmpty(DocIterator  cur)
 {
-   if (!cur.paragraph().empty())
+   if ((cur.inTexted()  !cur.paragraph().empty())
+   || cur.inMathed()  !cur.cell().empty())
return false;
 
pit_type const beg_pit = cur.pit();
diff --git a/src/frontends/qt4/GuiErrorList.cpp 
b/src/frontends/qt4/GuiErrorList.cpp
index 9924d64..1ab9198 100644
--- a/src/frontends/qt4/GuiErrorList.cpp
+++ b/src/frontends/qt4/GuiErrorList.cpp
@@ -188,7 +188,7 @@ bool GuiErrorList::goTo(int item)
return false;
}
// if pos_end is 0, this means it is end-of-paragraph
-   pos_type const s = dit.paragraph().size();
+   pos_type const s = dit.lastpos();
pos_type const end = err.pos_end ? min(err.pos_end, s) : s;
pos_type const start = min(err.pos_start, end);
pos_type const range = end == start ? s - start : end - start;


[LyX/master] Do not substract cursors pos from two different cells (fix assertion while doing adv search)

2014-04-21 Thread Richard Heck
commit ad6f96bf4815b182372adf70d5829523c35249d9
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Mon Mar 31 18:33:53 2014 +0200

Do not substract cursors pos from two different cells (fix assertion while 
doing adv search)

Fixes: #7944.

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index 8166a11..75f0412 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -1377,7 +1377,8 @@ static void findAdvReplace(BufferView * bv, 
FindAndReplaceOptions const  opt, M
DocIterator sel_beg = cur.selectionBegin();
DocIterator sel_end = cur.selectionEnd();
if (sel_beg.inset() != sel_end.inset()
-   || sel_beg.pit() != sel_end.pit())
+   || sel_beg.pit() != sel_end.pit()
+   || sel_beg.idx() != sel_end.idx())
return;
int sel_len = sel_end.pos() - sel_beg.pos();
LYXERR(Debug::FIND, sel_beg:   sel_beg  , sel_end:   sel_end


[LyX/master] stdmenus.inc: add move rows/columns feature to Edit menu

2014-04-21 Thread Richard Heck
commit 30f2c2c4e390fcbe407ae36a5d5f8d9e7945b8f1
Author: Uwe Stöhr uwesto...@lyx.org
Date:   Sun Mar 23 15:30:13 2014 +0100

stdmenus.inc: add move rows/columns feature to Edit menu

fixes bug #9047

diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc
index 2da0b7c..32ed83e 100644
--- a/lib/ui/stdmenus.inc
+++ b/lib/ui/stdmenus.inc
@@ -217,11 +217,15 @@ Menuset
Item Add Row|A inset-modify tabular append-row
Item Delete Row|D inset-modify tabular delete-row
Item Copy Row|o inset-modify tabular copy-row
+   Item Move Row Up inset-modify tabular move-row-up
+   Item Move Row Down inset-modify tabular move-row-down
# Item Swap Rows|S inset-modify tabular swap-row # 
currently broken
Separator
Item Add Column|u inset-modify tabular append-column
Item Delete Column|e inset-modify tabular delete-column
Item Copy Column|p inset-modify tabular copy-column
+   Item Move Column Right|v inset-modify tabular 
move-column-right
+   Item Move Column Left inset-modify tabular move-column-left
# Item Swap Columns|w inset-modify tabular swap-column # 
currently broken
End
 


[LyX/master] Focus on buffer after section select in Outliner

2014-04-21 Thread Richard Heck
commit abc4c663cafcbb923345dcaefb7e31dc3d446e29
Author: Scott Kostyshak skost...@lyx.org
Date:   Fri Mar 21 19:34:46 2014 -0400

Focus on buffer after section select in Outliner

diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp
index 2069035..83ac1bf 100644
--- a/src/frontends/qt4/TocWidget.cpp
+++ b/src/frontends/qt4/TocWidget.cpp
@@ -196,6 +196,7 @@ void TocWidget::doDispatch(Cursor  cur, FuncRequest const 
 cmd)
cur.dispatch(tmpcmd);
// necessary to get the selection drawn.
cur.buffer()-changed(true);
+   gui_view_.setFocus();
break;
 
case LFUN_LABEL_COPY_AS_REFERENCE: {


[LyX/master] This is the result of an audit of all static variables, looking for possible thread conflicts, of the sort Georg resolved at 6a30211f. I have made static variables const where possible, a

2014-04-21 Thread Richard Heck
commit fdbe775b9f5468e8f53dc83a66583f412b5970fb
Author: Richard Heck rgh...@lyx.org
Date:   Mon Oct 7 18:59:05 2013 -0400

This is the result of an audit of all static variables, looking
for possible thread conflicts, of the sort Georg resolved at
6a30211f. I have made static variables const where possible,
and marked cases that looked potentially problematic with the
comment:
// FIXME THREAD
Many of these definitely are vulnerable to concurrent access, such
as the static variables declared at the start of output_latex.cpp.
Suppose, e.g., we were outputting latex and also displaying the
source of a different document.

I'd appreciate it if others could grep for FIXME THREAD and see
if some of these are harmless, or what.

diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp
index a50a865..7c77610 100644
--- a/src/BiblioInfo.cpp
+++ b/src/BiblioInfo.cpp
@@ -472,7 +472,7 @@ docstring BibTeXInfo::expandFormat(docstring const  format,
docstring before, docstring after, docstring dialog, bool next) 
const
 {
// incorrect use of macros could put us in an infinite loop
-   static int max_passes = 5000;
+   static int const max_passes = 5000;
// the use of overly large keys can lead to performance problems, due
// to eventual attempts to convert LaTeX macros to unicode. See bug
// #8944. This is perhaps not the best solution, but it will have to
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index ab2164b..6f7a5cd 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -354,6 +354,7 @@ private:
 /// Creates the per buffer temporary directory
 static FileName createBufferTmpDir()
 {
+   // FIXME THREAD
static int count;
// We are in our own directory.  Why bother to mangle name?
// In fact I wrote this code to circumvent a problematic behaviour
diff --git a/src/BufferList.cpp b/src/BufferList.cpp
index 341ddf4..de5a7ab 100644
--- a/src/BufferList.cpp
+++ b/src/BufferList.cpp
@@ -156,6 +156,7 @@ void BufferList::closeAll()
 
 FileNameList const  BufferList::fileNames() const
 {
+   // FIXME THREAD
static FileNameList nvec;
nvec.clear();
BufferStorage::const_iterator it = bstore.begin();
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 3b85ff7..a70bc9e 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -122,7 +122,8 @@ ParSepTranslator const init_parseptranslator()
 
 ParSepTranslator const  parseptranslator()
 {
-   static ParSepTranslator translator = init_parseptranslator();
+   static ParSepTranslator const translator =
+   init_parseptranslator();
return translator;
 }
 
@@ -146,7 +147,8 @@ QuotesLangTranslator const init_quoteslangtranslator()
 
 QuotesLangTranslator const  quoteslangtranslator()
 {
-   static QuotesLangTranslator translator = init_quoteslangtranslator();
+   static QuotesLangTranslator const translator =
+   init_quoteslangtranslator();
return translator;
 }
 
@@ -196,7 +198,8 @@ static PaperSizeTranslator initPaperSizeTranslator()
 
 PaperSizeTranslator const  papersizetranslator()
 {
-   static PaperSizeTranslator translator = initPaperSizeTranslator();
+   static PaperSizeTranslator const translator =
+   initPaperSizeTranslator();
return translator;
 }
 
@@ -215,7 +218,8 @@ PaperOrientationTranslator const 
init_paperorientationtranslator()
 
 PaperOrientationTranslator const  paperorientationtranslator()
 {
-   static PaperOrientationTranslator translator = 
init_paperorientationtranslator();
+   static PaperOrientationTranslator const translator =
+   init_paperorientationtranslator();
return translator;
 }
 
@@ -234,7 +238,7 @@ SidesTranslator const init_sidestranslator()
 
 SidesTranslator const  sidestranslator()
 {
-   static SidesTranslator translator = init_sidestranslator();
+   static SidesTranslator const translator = init_sidestranslator();
return translator;
 }
 
@@ -254,7 +258,8 @@ PackageTranslator const init_packagetranslator()
 
 PackageTranslator const  packagetranslator()
 {
-   static PackageTranslator translator = init_packagetranslator();
+   static PackageTranslator const translator =
+   init_packagetranslator();
return translator;
 }
 
@@ -274,7 +279,8 @@ CiteEngineTypeTranslator const 
init_citeenginetypetranslator()
 
 CiteEngineTypeTranslator const  citeenginetypetranslator()
 {
-   static CiteEngineTypeTranslator translator = 
init_citeenginetypetranslator();
+   static CiteEngineTypeTranslator const translator =
+   init_citeenginetypetranslator();
return translator;
 }
 
@@ -296,7 +302,7 @@ SpaceTranslator const init_spacetranslator()
 
 SpaceTranslator const  spacetranslator()
 {
-   static SpaceTranslator translator = init_spacetranslator();
+   static SpaceTranslator const translator = 

[LyX/master] Typo.

2014-04-21 Thread Richard Heck
commit d53cf7f575276759fbcb7c613060fc49560e178f
Author: Richard Heck rgh...@lyx.org
Date:   Fri Mar 21 17:15:47 2014 -0400

Typo.

diff --git a/src/frontends/qt4/ui/PrefCompletionUi.ui 
b/src/frontends/qt4/ui/PrefCompletionUi.ui
index c8cbe1f..d833302 100644
--- a/src/frontends/qt4/ui/PrefCompletionUi.ui
+++ b/src/frontends/qt4/ui/PrefCompletionUi.ui
@@ -247,7 +247,7 @@
 item
  widget class=QLabel name=label_5
   property name=toolTip
-   stringShortest word that LyX will offer to compete./string
+   stringShortest word that LyX will offer to complete./string
   /property
   property name=text
stringMinimum word length for completion/string


[LyX/master] Fix corrupted PrefCompletionUI.ui

2014-04-21 Thread Richard Heck
commit da196ed5b220872e5388ba3db606b686270dd3f8
Author: Juergen Spitzmueller sp...@lyx.org
Date:   Sun Mar 23 09:50:39 2014 +0100

Fix corrupted PrefCompletionUI.ui

diff --git a/src/frontends/qt4/ui/PrefCompletionUi.ui 
b/src/frontends/qt4/ui/PrefCompletionUi.ui
index 0cb8751..010b308 100644
--- a/src/frontends/qt4/ui/PrefCompletionUi.ui
+++ b/src/frontends/qt4/ui/PrefCompletionUi.ui
@@ -1,4 +1,4 @@
-2aadcec1fc9ui version=4.0 
+ui version=4.0 
  classPrefCompletionUi/class
  widget class=QWidget name=PrefCompletionUi 
   property name=geometry 


[LyX/master] Update comment slightly.

2014-04-21 Thread Richard Heck
commit 6021322c015708bbd2c7618eef2df14f1e6fa8b8
Author: Richard Heck rgh...@lyx.org
Date:   Mon Apr 7 10:57:22 2014 -0400

Update comment slightly.

diff --git a/src/insets/InsetLayout.h b/src/insets/InsetLayout.h
index 83bbb2d..9398e91 100644
--- a/src/insets/InsetLayout.h
+++ b/src/insets/InsetLayout.h
@@ -92,8 +92,8 @@ public:
/// Returns latexargs() + postcommandargs().
/// But note that it returns a *copy*, not a reference, so do not do 
/// anything like:
-   ///   Layout::LaTeXArgMap it = args().begin();
-   ///   Layout::LaTeXArgMap en = args().end();
+   ///   Layout::LaTeXArgMap::iterator it = args().begin();
+   ///   Layout::LaTeXArgMap::iterator en = args().end();
/// Those are iterators for different containers.
Layout::LaTeXArgMap args() const;
///


[LyX/master] Whitespace.

2014-04-21 Thread Richard Heck
commit f83aab43e5b207e77f6eb12e1b48f7a54714277d
Author: Richard Heck rgh...@lyx.org
Date:   Fri Apr 11 11:31:24 2014 -0400

Whitespace.

diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py
index c989515..9707f7a 100644
--- a/lib/lyx2lyx/parser_tools.py
+++ b/lib/lyx2lyx/parser_tools.py
@@ -425,7 +425,7 @@ def is_in_inset(lines, i, inset):
 def get_containing_inset(lines, i):
   ''' 
   Finds out what kind of inset line i is within. Returns a 
-  list containing (i) what follows \begin_inset on the line 
+  list containing (i) what follows \begin_inset on the line
   on which the inset begins, plus the starting and ending line.
   Returns False on any kind of error or if it isn't in an inset.
   '''
@@ -438,7 +438,7 @@ def get_containing_inset(lines, i):
   if endins  j:
   break
   j = stins - 1
-  
+
   inset = get_value(lines, \\begin_inset, stins)
   if inset == :
   # shouldn't happen
@@ -449,7 +449,7 @@ def get_containing_inset(lines, i):
 def get_containing_layout(lines, i):
   ''' 
   Finds out what kind of layout line i is within. Returns a 
-  list containing what follows \begin_layout on the line 
+  list containing what follows \begin_layout on the line
   on which the layout begins, plus the starting and ending line
   and the start of the paragraph (after all params). I.e, returns:
 (layoutname, layoutstart, layoutend, startofcontent)
@@ -464,7 +464,7 @@ def get_containing_layout(lines, i):
   if endlay  i:
   break
   j = stlay - 1
-  
+
   lay = get_value(lines, \\begin_layout, stlay)
   if lay == :
   # shouldn't happen
@@ -482,7 +482,7 @@ def get_containing_layout(lines, i):
 
 
 def count_pars_in_inset(lines, i):
-  ''' 
+  '''
   Counts the paragraphs within this inset
   '''
   ins = get_containing_inset(lines, i)
@@ -493,12 +493,12 @@ def count_pars_in_inset(lines, i):
   m = re.match(r'\\begin_layout (.*)', lines[j])
   if m and get_containing_inset(lines, j)[0] == ins[0]:
   pars += 1
-  
+
   return pars
 
 
 def find_end_of_sequence(lines, i):
-  ''' 
+  '''
   Returns the end of a sequence of identical layouts.
   '''
   lay = get_containing_layout(lines, i)


r41002 - www-user/trunk/farm/cookbook/LyX

2014-04-21 Thread rgheck
Author: rgheck
Date: Mon Apr 21 18:23:29 2014
New Revision: 41002
URL: http://www.lyx.org/trac/changeset/41002

Log:
* i18n_trunk.inc: update stats

Modified:
   www-user/trunk/farm/cookbook/LyX/i18n_trunk.inc

Modified: www-user/trunk/farm/cookbook/LyX/i18n_trunk.inc
==
--- www-user/trunk/farm/cookbook/LyX/i18n_trunk.inc Sun Apr 20 00:49:51 
2014(r41001)
+++ www-user/trunk/farm/cookbook/LyX/i18n_trunk.inc Mon Apr 21 18:23:29 
2014(r41002)
@@ -1,102 +1,102 @@
 ?php
 // The current version
-$lyx_version = 2.1.0git;
+$lyx_version = 2.2.0dev;
 // The branch tag
 $branch_tag = master;
 
 // The data itself
 $podata = array (
 array ( 'langcode' = 'ar', date = 2014-01-10,
-msg_tr = 4863, msg_fu = 443, msg_nt = 1151,
+msg_tr = 4860, msg_fu = 445, msg_nt = 1154,
 translator = Hatim Alahmadi, email = Dr ! hatim () hotmail ! com),
 array ( 'langcode' = 'ca', date = 2008-07-28,
-msg_tr = 2934, msg_fu = 1980, msg_nt = 1543,
+msg_tr = 2933, msg_fu = 1981, msg_nt = 1545,
 translator = joan, email = joan () montane ! cat),
 array ( 'langcode' = 'cs', date = 2013-03-26,
-msg_tr = 6335, msg_fu = 48, msg_nt = 74,
+msg_tr = 6332, msg_fu = 50, msg_nt = 77,
 translator = Pavel Sanda, email = sanda () lyx ! org),
 array ( 'langcode' = 'da', date = 2011-04-20,
-msg_tr = 3684, msg_fu = 1646, msg_nt = 1127,
+msg_tr = 3684, msg_fu = 1647, msg_nt = 1128,
 translator = Jesper Stemann Andersen, email = jesper () sait ! dk),
 array ( 'langcode' = 'de', date = 2014-03-17,
-msg_tr = 6457, msg_fu = 0, msg_nt = 0,
+msg_tr = 6453, msg_fu = 3, msg_nt = 3,
 translator = J#252;rgen Spitzm#252;ller, email = spitz () lyx ! 
org),
 array ( 'langcode' = 'el', date = 2010-07-07,
-msg_tr = 3182, msg_fu = 971, msg_nt = 2304,
+msg_tr = 3182, msg_fu = 971, msg_nt = 2306,
 translator = #927;#948;#965;#963;#963;#941;#945;#962; 
#916;#945;#947;#954;#955;#942;#962;, email = o2d () freemail ! gr),
 array ( 'langcode' = 'es', date = 2014-04-03,
-msg_tr = 6457, msg_fu = 0, msg_nt = 0,
+msg_tr = 6453, msg_fu = 3, msg_nt = 3,
 translator = Ignacio Garc#237;a, email = ignacio ! gmorales () gmail 
! com),
 array ( 'langcode' = 'eu', date = 2012-06-21,
-msg_tr = 5192, msg_fu = 697, msg_nt = 568,
+msg_tr = 5190, msg_fu = 698, msg_nt = 571,
 translator = I#241;aki Larra#241;aga Murgoitio, email = dooteo () 
zundan ! com),
 array ( 'langcode' = 'fi', date = 2007-07-14,
-msg_tr = 2913, msg_fu = 2246, msg_nt = 1298,
+msg_tr = 2912, msg_fu = 2247, msg_nt = 1300,
 translator = Martin Vermeer, email = martin ! vermeer () tkk ! fi),
 array ( 'langcode' = 'fr', date = 2014-04-11,
-msg_tr = 6457, msg_fu = 0, msg_nt = 0,
+msg_tr = 6453, msg_fu = 3, msg_nt = 3,
 translator = Jean-Pierre Chr#233;tien, email = jeanpierre ! chretien 
() free ! fr),
 array ( 'langcode' = 'gl', date = 2007-07-11,
-msg_tr = 3052, msg_fu = 2192, msg_nt = 1213,
+msg_tr = 3051, msg_fu = 2193, msg_nt = 1215,
 translator = Ramon Flores, email = fa2ramon () usc ! es),
 array ( 'langcode' = 'he', date = 2013-10-26,
-msg_tr = 3222, msg_fu = 1688, msg_nt = 1547,
+msg_tr = 3220, msg_fu = 1689, msg_nt = 1550,
 translator = Gilad Orr, email = giladorr () gmail ! com),
 array ( 'langcode' = 'hu', date = 2011-04-26,
-msg_tr = 4478, msg_fu = 1175, msg_nt = 804,
+msg_tr = 4477, msg_fu = 1176, msg_nt = 806,
 translator = Sz#337;ke S#225;ndor, email = alex () lyx ! hu),
 array ( 'langcode' = 'ia', date = 2013-09-03,
-msg_tr = 6280, msg_fu = 56, msg_nt = 121,
+msg_tr = 6277, msg_fu = 58, msg_nt = 124,
 translator = G.Sora, email = g ! sora () tiscali ! it),
 array ( 'langcode' = 'id', date = 2014-03-28,
-msg_tr = 5487, msg_fu = 556, msg_nt = 414,
+msg_tr = 5487, msg_fu = 557, msg_nt = 415,
 translator = Waluyo Adi Siswanto, email = was ! uthm () gmail ! com),
 array ( 'langcode' = 'it', date = 2014-04-10,
-msg_tr = 6457, msg_fu = 0, msg_nt = 0,
+msg_tr = 6453, msg_fu = 3, msg_nt = 3,
 translator = Enrico Forestieri, email = forenr () lyx ! org),
 array ( 'langcode' = 'ja', date = 2014-04-13,
-msg_tr = 6457, msg_fu = 0, msg_nt = 0,
+msg_tr = 6453, msg_fu = 3, msg_nt = 3,
 translator = Koji Yokota, email = yokota () res ! otaru-uc ! ac ! 
jp),
 array ( 'langcode' = 'nb', date = 2013-11-06,
-msg_tr = 6199, msg_fu = 133, msg_nt = 125,
+msg_tr = 6196, msg_fu = 135, msg_nt = 128,
 translator = Helge Hafting, email = helge ! hafting () aitel ! hist ! 
no),
 array ( 'langcode' = 'nl', date = 2011-12-08,
-msg_tr = 2776, msg_fu = 970, msg_nt = 2711,
+msg_tr = 2775, msg_fu = 972, msg_nt = 2712,
 translator = Timo Kluck, email = tkluck () infty ! nl),
 array ( 'langcode' = 'nn', date = 2014-01-24,
-msg_tr = 5543, msg_fu = 487, msg_nt = 427,
+msg_tr = 5540, msg_fu = 489, msg_nt = 430,
 translator = Ingar Pareliussen, email = ),
 array ( 'langcode' = 'pl', date = 2012-11-03,
-msg_tr = 4520, msg_fu = 1163, msg_nt = 774,
+msg_tr = 4519, msg_fu = 1164, msg_nt = 776,
 translator = Micha#322; Fita, email = michal ! fita () gmail ! com),

[LyX/master] Cmake build: Add include path for src/tests/dummy_functions.cpp

2014-04-21 Thread Kornel Benko
commit f3a96fb833a3c6773790de82df39a8c95a8abe77
Author: Kornel Benko kor...@lyx.org
Date:   Mon Apr 21 19:14:25 2014 +0200

Cmake build: Add include path for src/tests/dummy_functions.cpp

Othervise the statement '#include ../Messages.h' results in error.

diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index ce5b355..0a45ad5 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -12,6 +12,8 @@ foreach(_f insets/InsetLayout.cpp Color.cpp Counters.cpp 
Floating.cpp
   list(APPEND check_layout_SOURCES ${TOP_SRC_DIR}/src/${_f})
 endforeach()
 
+include_directories(${TOP_SRC_DIR}/src/support/tests)
+
 add_executable(check_layout ${check_layout_SOURCES})
 
 target_link_libraries(check_layout support


[LyX/master] Cmake tests: Allow regular expressions to select for reverted tests.

2014-04-21 Thread Kornel Benko
commit dae08c371fdda0972eb1b64db0d2a07951b2aa3e
Author: Kornel Benko kor...@lyx.org
Date:   Mon Apr 21 19:18:42 2014 +0200

Cmake tests: Allow regular expressions to select for reverted tests.

diff --git a/development/autotests/CMakeLists.txt 
b/development/autotests/CMakeLists.txt
index 6c438ca..9a6e6c4 100644
--- a/development/autotests/CMakeLists.txt
+++ b/development/autotests/CMakeLists.txt
@@ -136,19 +136,24 @@ macro(getoutputformats filepath varname)
   set(${varname} ${out_formats})
 endmacro()
 
-macro(maketestname testname reverted listreverted listignored)
-  set(_idx -1)
-  foreach(_itrx ${${listignored}})
+macro(findexpr found testname listname)
+  set(_found 0)
+  foreach(_itrx ${${listname}})
 set(_itr ^${_itrx}$)
 if(${testname} MATCHES ${_itr})
-  set(_idx 0)
+  set(_found 1)
   break()
 endif()
   endforeach()
-  #list(FIND ${listignored} ${${testname}} _idx)
-  if (${_idx} LESS 0)
+  set(${found} ${_found})
+endmacro()
+  
+macro(maketestname testname reverted listreverted listignored)
+  findexpr(mfound ${testname} ${listignored})
+  if (NOT mfound)
+findexpr(mfound ${testname} ${listreverted})
 list(FIND ${listreverted} ${${testname}} _idx)
-if (${_idx} LESS 0)
+if (NOT mfound)
   set(${reverted} 0)
 else()
   set(${reverted} 1)


[LyX/master] Cmake tests: simplify part of the set of reverted tests using regex

2014-04-21 Thread Kornel Benko
commit ae33fa9e39c389df5bf14f2645eaebaff0bf185f
Author: Kornel Benko kor...@lyx.org
Date:   Mon Apr 21 19:20:40 2014 +0200

Cmake tests: simplify part of the set of reverted tests using regex

diff --git a/development/autotests/revertedTests 
b/development/autotests/revertedTests
index f8d12e4..2549aba 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -1,79 +1,21 @@
 # Hebrew docs do not currently work with LuaTeX
-export/doc/he/Intro_pdf5_systemF
-export/doc/he/Intro_pdf5_texF
-export/doc/he/Intro_dvi3_systemF
-export/doc/he/Intro_dvi3_texF
-export/doc/he/Tutorial_pdf5_systemF
-export/doc/he/Tutorial_pdf5_texF
-export/doc/he/Tutorial_dvi3_systemF
-export/doc/he/Tutorial_dvi3_texF
-export/examples/he/example_lyxified_pdf5_systemF
-export/examples/he/example_lyxified_pdf5_texF
-export/examples/he/example_lyxified_dvi3_systemF
-export/examples/he/example_lyxified_dvi3_texF
-export/examples/he/example_raw_pdf5_systemF
-export/examples/he/example_raw_pdf5_texF
-export/examples/he/example_raw_dvi3_systemF
-export/examples/he/example_raw_dvi3_texF
-export/examples/he/splash_pdf5_systemF
-export/examples/he/splash_pdf5_texF
-export/examples/he/splash_dvi3_systemF
-export/examples/he/splash_dvi3_texF
+export/.*/he/.*(pdf5|dvi3)_.*
 #
 # FIXME
 # After LyX 2.1 is released, apply the patch and remove these
 # See http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181595.html
-export/doc/id/Intro_pdf5_systemF
-export/doc/id/Intro_pdf5_texF
-export/doc/id/Intro_dvi3_systemF
-export/doc/id/Intro_dvi3_texF
-export/doc/id/Shortcuts_pdf5_systemF
-export/doc/id/Shortcuts_pdf5_texF
-export/doc/id/Shortcuts_dvi3_systemF
-export/doc/id/Shortcuts_dvi3_texF
-export/doc/id/Tutorial_pdf5_systemF
-export/doc/id/Tutorial_pdf5_texF
-export/doc/id/Tutorial_dvi3_systemF
-export/doc/id/Tutorial_dvi3_texF
-export/doc/id/UserGuide_pdf5_systemF
-export/doc/id/UserGuide_pdf5_texF
-export/doc/id/UserGuide_dvi3_systemF
-export/doc/id/UserGuide_dvi3_texF
-export/examples/id/splash_pdf5_systemF
-export/examples/id/splash_pdf5_texF
-export/examples/id/splash_dvi3_systemF
-export/examples/id/splash_dvi3_texF
+export/.*/id/.*(pdf5|dvi3)_.*
 #
 # FIXME
 # Similar to the Indonesian support, see:
 # http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181595.html
-export/doc/hu/Intro_pdf5_systemF
-export/doc/hu/Intro_pdf5_texF
-export/doc/hu/Intro_dvi3_systemF
-export/doc/hu/Intro_dvi3_texF
-export/examples/hu/example_lyxified_pdf5_systemF
-export/examples/hu/example_lyxified_pdf5_texF
-export/examples/hu/example_lyxified_dvi3_systemF
-export/examples/hu/example_lyxified_dvi3_texF
-export/examples/hu/example_raw_pdf5_systemF
-export/examples/hu/example_raw_pdf5_texF
-export/examples/hu/example_raw_dvi3_systemF
-export/examples/hu/example_raw_dvi3_texF
-export/examples/hu/splash_pdf5_systemF
-export/examples/hu/splash_pdf5_texF
-export/examples/hu/splash_dvi3_systemF
-export/examples/hu/splash_dvi3_texF
+export/.*/hu/.*(pdf5|dvi3)_.*
 #
 # Export with XeTeX and LuaTeX (with either non-tex fonts or 8-bit
 # compatibility mode) does not work because the loading of inputenc with
 # utf8x is hardcoded in europecv.cls at the time of this writing. See:
 # http://comments.gmane.org/gmane.editors.lyx.devel/145896
-export/examples/es/europeCV_pdf4_systemF
-export/examples/es/europeCV_pdf4_texF
-export/examples/es/europeCV_pdf5_systemF
-export/examples/es/europeCV_pdf5_texF
-export/examples/es/europeCV_dvi3_systemF
-export/examples/es/europeCV_dvi3_texF
+export/.*/es/europeCV_(pdf[45]|dvi3)_.*
 #
 # somehow lualatex is not able to compile with non-tex fonts
 export/doc/es/Math_dvi3_systemF
@@ -178,12 +120,7 @@ export/doc/ru/Tutorial_dvi3_texF
 export/doc/ru/Tutorial_pdf5_texF
 #
 # There is no Chinese LuaTeX or XeTeX TeX font support yet.
-export/doc/zh_CN/Intro_dvi3_texF
-export/doc/zh_CN/Intro_pdf4_texF
-export/doc/zh_CN/Intro_pdf5_texF
-export/doc/zh_CN/Tutorial_dvi3_texF
-export/doc/zh_CN/Tutorial_pdf4_texF
-export/doc/zh_CN/Tutorial_pdf5_texF
+export/.*/zh_CN/.*(pdf[45]|dvi3)_texF
 export/templates/ctex_pdf4_texF
 #
 # These started failing after we implemented tests for formats
@@ -191,92 +128,8 @@ export/templates/ctex_pdf4_texF
 # TODO it might be worth it to take a look at each individually and
 # see whether they are supposed to fail or if there is something LyX
 # can do to add support for exporting them.
-export/doc/hu/Tutorial_dvi3_texF
-export/doc/hu/Tutorial_dvi3_systemF
-export/doc/ja/Additional_dvi3_texF
-export/doc/ja/Additional_dvi3_systemF
-export/doc/ja/Additional_pdf2
-export/doc/ja/Additional_pdf4_texF
-export/doc/ja/Additional_pdf4_systemF
-export/doc/ja/Additional_pdf5_texF
-export/doc/ja/Additional_pdf5_systemF
-export/doc/ja/Customization_dvi3_texF
-export/doc/ja/Customization_dvi3_systemF
-export/doc/ja/Customization_pdf2
-export/doc/ja/Customization_pdf4_texF
-export/doc/ja/Customization_pdf4_systemF
-export/doc/ja/Customization_pdf5_texF

[LyX/master] * sk.po

2014-04-21 Thread Kornel Benko
commit b8e4fbbd8f24ea4402addc2383966e86a631fd01
Author: Kornel Benko kor...@lyx.org
Date:   Mon Apr 21 19:36:22 2014 +0200

* sk.po

diff --git a/po/sk.gmo b/po/sk.gmo
index 02a5515..281ab7f 100644
Binary files a/po/sk.gmo and b/po/sk.gmo differ
diff --git a/po/sk.po b/po/sk.po
index d6d4d9c..cac9d20 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -8,7 +8,7 @@ msgid 
 msgstr 
 Project-Id-Version: LyX-2.1\n
 Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n
-POT-Creation-Date: 2014-04-21 12:11-0400\n
+POT-Creation-Date: 2014-04-21 19:31+0200\n
 PO-Revision-Date: 2013-01-16 12:46+0100\n
 Last-Translator: Kornel Benko kor...@lyx.org\n
 Language-Team: Slovak lyx-d...@lists.lyx.org\n
@@ -335,9 +335,8 @@ msgid The LaTeX command that ends a switch to a foreign 
language
 msgstr LaTeXovský príkaz na zakončenie zmeny jazyka
 
 #: src/frontends/qt4/ui/PrefLanguageUi.ui:135
-#, fuzzy
 msgid Default decimal separator:
-msgstr Štandardný Decimálny Oddeľovač:
+msgstr Štandardný decimálny oddeľovač:
 
 #: src/frontends/qt4/ui/PrefLanguageUi.ui:161
 msgid Default length unit:
@@ -3171,11 +3170,11 @@ msgstr Sek. - zdržať pre vyťahovacie menu
 msgid 
 Words with less than the specified number of characters will not be 
 completed.
-msgstr 
+msgstr Slová kratšie ako zadané dľžkou sa nebudú doplňovať.
 
 #: src/frontends/qt4/ui/PrefCompletionUi.ui:250
 msgid Minimum characters for words that should be completed
-msgstr 
+msgstr Minimálny počet písmen pre doplňovanie slov
 
 #: src/frontends/qt4/ui/PrefCompletionUi.ui:275
 msgid 
@@ -13278,7 +13277,6 @@ msgid Algorithm2e
 msgstr Algorithm2e
 
 #: lib/layouts/algorithm2e.module:6
-#, fuzzy
 msgid 
 Use the algorithm2e package for algorithm floats rather than LyX's home-
 brewed algorithm floats.
@@ -27479,6 +27477,8 @@ msgid 
 The file name '%1$s' is invalid!\n
 Aborting import.
 msgstr 
+Meno súboru '%1$s' je neplatné!\n
+Ruším import.
 
 #: src/frontends/qt4/GuiView.cpp:2154 src/frontends/qt4/GuiView.cpp:2340
 #: src/frontends/qt4/GuiView.cpp:2454


[LyX/master] Fix compilation of ACM-sigplan

2014-04-21 Thread Scott Kostyshak
commit afdab15aa3e9551d2323634520df49669e6dcc76
Author: Scott Kostyshak 
Date:   Mon Apr 21 01:55:45 2014 -0400

Fix compilation of ACM-sigplan

Compilation was failing with TeX Live 2013 because of
the format of one of the references. This commit just
changes one of the references to a different one.

diff --git a/lib/templates/ACM-sigplan.lyx b/lib/templates/ACM-sigplan.lyx
index 8dc503e..6e746c4 100644
--- a/lib/templates/ACM-sigplan.lyx
+++ b/lib/templates/ACM-sigplan.lyx
@@ -329,7 +329,7 @@ Introduction
 Bla bla, as listed in 
 \begin_inset CommandInset citation
 LatexCommand cite
-key "article-minimal,book-crossref"
+key "article-minimal,phdthesis-minimal"
 
 \end_inset
 


[LyX/master] Invert new tests failing outside of default format

2014-04-21 Thread Scott Kostyshak
commit 06f12532d1c6d6e565dd11624442de45d1bd117f
Author: Scott Kostyshak 
Date:   Mon Apr 21 02:42:00 2014 -0400

Invert new tests failing outside of default format

These started failing after we implemented tests for formats
that are in the complement set to the default format (7ecbb068).
It might be worth it in the future to take a look at each individually
and see whether they are supposed to fail or if there is something LyX
can do to add support for exporting them.

diff --git a/development/autotests/revertedTests 
b/development/autotests/revertedTests
index a2e8629..f8d12e4 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -185,3 +185,265 @@ export/doc/zh_CN/Tutorial_dvi3_texF
 export/doc/zh_CN/Tutorial_pdf4_texF
 export/doc/zh_CN/Tutorial_pdf5_texF
 export/templates/ctex_pdf4_texF
+#
+# These started failing after we implemented tests for formats
+# that are in the complement set to the default format (7ecbb068).
+# TODO it might be worth it to take a look at each individually and
+# see whether they are supposed to fail or if there is something LyX
+# can do to add support for exporting them.
+export/doc/hu/Tutorial_dvi3_texF
+export/doc/hu/Tutorial_dvi3_systemF
+export/doc/ja/Additional_dvi3_texF
+export/doc/ja/Additional_dvi3_systemF
+export/doc/ja/Additional_pdf2
+export/doc/ja/Additional_pdf4_texF
+export/doc/ja/Additional_pdf4_systemF
+export/doc/ja/Additional_pdf5_texF
+export/doc/ja/Additional_pdf5_systemF
+export/doc/ja/Customization_dvi3_texF
+export/doc/ja/Customization_dvi3_systemF
+export/doc/ja/Customization_pdf2
+export/doc/ja/Customization_pdf4_texF
+export/doc/ja/Customization_pdf4_systemF
+export/doc/ja/Customization_pdf5_texF
+export/doc/ja/Customization_pdf5_systemF
+export/doc/ja/DummyDocument1_dvi3_texF
+export/doc/ja/DummyDocument1_dvi3_systemF
+export/doc/ja/DummyDocument1_pdf2
+export/doc/ja/DummyDocument1_pdf4_texF
+export/doc/ja/DummyDocument1_pdf4_systemF
+export/doc/ja/DummyDocument1_pdf5_texF
+export/doc/ja/DummyDocument1_pdf5_systemF
+export/doc/ja/DummyDocument2_dvi3_texF
+export/doc/ja/DummyDocument2_dvi3_systemF
+export/doc/ja/DummyDocument2_pdf2
+export/doc/ja/DummyDocument2_pdf4_texF
+export/doc/ja/DummyDocument2_pdf4_systemF
+export/doc/ja/DummyDocument2_pdf5_texF
+export/doc/ja/DummyDocument2_pdf5_systemF
+export/doc/ja/EmbeddedObjects_dvi3_texF
+export/doc/ja/EmbeddedObjects_dvi3_systemF
+export/doc/ja/EmbeddedObjects_pdf2
+export/doc/ja/EmbeddedObjects_pdf4_texF
+export/doc/ja/EmbeddedObjects_pdf4_systemF
+export/doc/ja/EmbeddedObjects_pdf5_texF
+export/doc/ja/EmbeddedObjects_pdf5_systemF
+export/doc/ja/Formula-numbering_dvi3_texF
+export/doc/ja/Formula-numbering_dvi3_systemF
+export/doc/ja/Formula-numbering_pdf2
+export/doc/ja/Formula-numbering_pdf4_texF
+export/doc/ja/Formula-numbering_pdf4_systemF
+export/doc/ja/Formula-numbering_pdf5_texF
+export/doc/ja/Formula-numbering_pdf5_systemF
+export/doc/ja/Intro_dvi3_texF
+export/doc/ja/Intro_dvi3_systemF
+export/doc/ja/Intro_pdf2
+export/doc/ja/Intro_pdf4_texF
+export/doc/ja/Intro_pdf4_systemF
+export/doc/ja/Intro_pdf5_texF
+export/doc/ja/Intro_pdf5_systemF
+export/doc/ja/LaTeXConfig_dvi3_texF
+export/doc/ja/LaTeXConfig_dvi3_systemF
+export/doc/ja/LaTeXConfig_pdf2
+export/doc/ja/LaTeXConfig_pdf4_texF
+export/doc/ja/LaTeXConfig_pdf4_systemF
+export/doc/ja/LaTeXConfig_pdf5_texF
+export/doc/ja/LaTeXConfig_pdf5_systemF
+export/doc/ja/Math_dvi3_texF
+export/doc/ja/Math_dvi3_systemF
+export/doc/ja/Math_pdf2
+export/doc/ja/Math_pdf4_texF
+export/doc/ja/Math_pdf4_systemF
+export/doc/ja/Math_pdf5_texF
+export/doc/ja/Math_pdf5_systemF
+export/doc/ja/Shortcuts_dvi3_texF
+export/doc/ja/Shortcuts_dvi3_systemF
+export/doc/ja/Shortcuts_pdf2
+export/doc/ja/Shortcuts_pdf4_texF
+export/doc/ja/Shortcuts_pdf4_systemF
+export/doc/ja/Shortcuts_pdf5_texF
+export/doc/ja/Shortcuts_pdf5_systemF
+export/doc/ja/Tutorial_dvi3_texF
+export/doc/ja/Tutorial_dvi3_systemF
+export/doc/ja/Tutorial_pdf2
+export/doc/ja/Tutorial_pdf4_texF
+export/doc/ja/Tutorial_pdf4_systemF
+export/doc/ja/Tutorial_pdf5_texF
+export/doc/ja/Tutorial_pdf5_systemF
+export/doc/ja/UserGuide_dvi3_texF
+export/doc/ja/UserGuide_dvi3_systemF
+export/doc/ja/UserGuide_pdf2
+export/doc/ja/UserGuide_pdf4_texF
+export/doc/ja/UserGuide_pdf4_systemF
+export/doc/ja/UserGuide_pdf5_texF
+export/doc/ja/UserGuide_pdf5_systemF
+export/examples/chess-article_pdf2
+export/examples/chess-article_pdf5_texF
+export/examples/chess-article_pdf5_systemF
+export/examples/chessgame_pdf2
+export/examples/chessgame_pdf5_texF
+export/examples/chessgame_pdf5_systemF
+export/examples/docbook_article_dvi3_texF
+export/examples/docbook_article_dvi3_systemF
+export/examples/docbook_article_pdf2
+export/examples/docbook_article_pdf4_texF
+export/examples/docbook_article_pdf4_systemF
+export/examples/docbook_article_pdf5_texF
+export/examples/docbook_article_pdf5_systemF
+export/examples/instant_preview_dvi3_systemF

[LyX/master] Fix the ignored path of the JASA files

2014-04-21 Thread Scott Kostyshak
commit 55b3341fba1f3a080d99927dd6f46d7746c0c8b1
Author: Scott Kostyshak 
Date:   Mon Apr 21 02:01:03 2014 -0400

Fix the ignored path of the JASA files

This follows a860d18b which moved the JASA file back from
being an example to a template.

diff --git a/development/autotests/ignoredTests 
b/development/autotests/ignoredTests
index 174247d..6f8ed09 100644
--- a/development/autotests/ignoredTests
+++ b/development/autotests/ignoredTests
@@ -5,7 +5,7 @@
 check_load/templates/attic/latex8
 export/templates/attic/latex8_pdf.*
 # LuaTeX and XeTeX both enter in infinite loops
-export/examples/JASA_.*_systemF
+export/templates/JASA_.*_systemF
 #
 # not compilable with LuaTeX
 export/doc/hu/Tutorial_pdf5_.*


[LyX/master] Fix compilation of Springer template

2014-04-21 Thread Scott Kostyshak
commit 4133be11b3ba4a15e7b01ebf375b8b3398dd5999
Author: Scott Kostyshak 
Date:   Mon Apr 21 02:12:10 2014 -0400

Fix compilation of Springer template

Replace two images with text placeholders. This is necessary
after a860d18b moved the file back from being an example.

diff --git a/lib/templates/springer/svjour3.lyx 
b/lib/templates/springer/svjour3.lyx
index fb42425..e874ed5 100644
--- a/lib/templates/springer/svjour3.lyx
+++ b/lib/templates/springer/svjour3.lyx
@@ -592,15 +592,10 @@ only for one column documents:
 \begin_inset Float figure
 wide false
 sideways false
-status collapsed
+status open
 
 \begin_layout Plain Layout
-\begin_inset Graphics
-   filename ../CV-image.png
-
-\end_inset
-
-
+
 \end_layout
 
 \begin_layout Plain Layout
@@ -640,16 +635,10 @@ only for two column documents:
 \begin_inset Float figure
 wide true
 sideways false
-status collapsed
+status open
 
 \begin_layout Plain Layout
-\begin_inset Graphics
-   filename ../CV-image.png
-   width 75text%
-
-\end_inset
-
-
+
 \end_layout
 
 \begin_layout Plain Layout


[LyX/master] CMake: specific modules for Qt5

2014-04-21 Thread Richard Heck
commit 2da0d3277165bb8a6ea1049460c3a161f74017fc
Author: Benjamin Piwowarski 
Date:   Sun Mar 9 10:24:41 2014 +0100

CMake: specific modules for Qt5

diff --git a/src/frontends/qt4/CMakeLists.txt b/src/frontends/qt4/CMakeLists.txt
index 14283ea..16d8b51 100644
--- a/src/frontends/qt4/CMakeLists.txt
+++ b/src/frontends/qt4/CMakeLists.txt
@@ -54,7 +54,11 @@ else()
 endif()
 set_target_properties(frontend_qt4 PROPERTIES FOLDER "applications/LyX")
 
-qt_use_modules(frontend_qt4 Core Gui Widgets Concurrent)
+if(Qt5Core_FOUND AND APPLE)
+   qt_use_modules(frontend_qt4 Core Gui Widgets Concurrent MacExtras)
+else()
+   qt_use_modules(frontend_qt4 Core Gui Widgets Concurrent)
+endif()
 target_link_libraries(frontend_qt4
frontends
${QT_QTCORE_LIBRARY}
diff --git a/src/support/CMakeLists.txt b/src/support/CMakeLists.txt
index 04eb38e..b0916b5 100644
--- a/src/support/CMakeLists.txt
+++ b/src/support/CMakeLists.txt
@@ -74,7 +74,11 @@ else()
 endif()
 set_target_properties(support PROPERTIES FOLDER "applications/LyX")
 
-qt_use_modules(support Core)
+if(USE_MACOSX_PACKAGING AND Qt5Core_FOUND)
+   qt_use_modules(support Core Gui)
+else()
+   qt_use_modules(support Core)
+endif()
 
 target_link_libraries(support ${Lyx_Boost_Libraries} ${QT_QTCORE_LIBRARY} 
${ZLIB_LIBRARY})
 


[LyX/master] Fix problem with python and change of PATH

2014-04-21 Thread Richard Heck
commit 4e38cf152430c6293319642099f162299acde922
Author: Benjamin Piwowarski 
Date:   Fri Mar 14 11:48:40 2014 +0100

Fix problem with python and change of PATH

- waits that lyxrc has been read before finding python
- when the PATH changes, resets the value

diff --git a/src/support/Package.cpp b/src/support/Package.cpp
index b4b0e14..f5ee5d5 100644
--- a/src/support/Package.cpp
+++ b/src/support/Package.cpp
@@ -154,8 +154,9 @@ Package::Package(string const & command_line_arg0,
 std::string const & Package::configure_command() const
 {
if (configure_command_.empty()) {
+   std::string  = 
const_cast(configure_command_);
FileName const 
configure_script(addName(system_support().absFileName(), "configure.py"));
-   configure_command_ = os::python() + ' ' +
+   command = os::python() + ' ' +
quoteName(configure_script.toFilesystemEncoding()) +
with_version_suffix() + " --binary-dir=" +

quoteName(FileName(binary_dir().absFileName()).toFilesystemEncoding());


[LyX/master] Revert "Tooltip for completion word length."

2014-04-21 Thread Richard Heck
commit f00104d222d39da2b2abaff78ab1c3082124cbf7
Author: Richard Heck 
Date:   Sat Mar 22 21:21:59 2014 -0400

Revert "Tooltip for completion word length."

This reverts commit 2aadcec1fc9ae784e6029b56790753ce82b9f055.

Conflicts:
src/frontends/qt4/ui/PrefCompletionUi.ui

diff --git a/src/frontends/qt4/ui/PrefCompletionUi.ui 
b/src/frontends/qt4/ui/PrefCompletionUi.ui
index d833302..0cb8751 100644
--- a/src/frontends/qt4/ui/PrefCompletionUi.ui
+++ b/src/frontends/qt4/ui/PrefCompletionUi.ui
@@ -1,63 +1,62 @@
-
-
+2aadcec1fc9
  PrefCompletionUi
- 
-  
+ 
+  

 0
 0
-412
-468
+400
+404

   
-  
+  

   
-  
-   
+  
+   
 9

-   
+   
 6

-   
-
- 
+   
+
+ 
   In Math
  
- 
+ 
   true
  
- 
-  
-   6
-  
-  
+ 
+  
9
   
+  
+   6
+  
   
-   
-
+   
+
  Show the grey inline completion behind the cursor in math 
mode after the delay.
 
-
+
  Automatic inline completion
 

   
   
-   
-
+   
+
  Show the popup in math mode after the delay.
 
-
+
  Automatic popup
 

   
   
-   
-
+   
+
  Autocorrection
 

@@ -65,47 +64,47 @@
  
 

-   
-
- 
+   
+
+ 
   In Text
  
- 
+ 
   true
  
- 
-  
-   6
-  
-  
+ 
+  
9
   
+  
+   6
+  
   
-   
-
+   
+
  Show the grey inline completion behind the cursor in text 
mode after the delay.
 
-
+
  Automatic inline completion
 

   
   
-   
-
+   
+
  Show the popup after the set delay in text mode.
 
-
+
  Automatic popup
 

   
   
-   
-
+   
+
  Show a small triangle on the cursor if a completion is 
available in text mode.
 
-
+
  Cursor indicator
 

@@ -113,58 +112,58 @@
  
 

-   
-
- 
+   
+
+ 
   General
  
- 
+ 
   true
  
- 
-  
-   6
-  
-  
+ 
+  
9
   
+  
+   6
+  
   
-   
-
- 6
-
-
+   
+
  0
 
+
+ 6
+
 
- 
-  
+ 
+  
After the cursor has not moved for this time, the inline 
completion is shown if it is available.
   
-  
+  
10.000
   
-  
+  
0.100
   
  
 
 
- 
-  
+ 
+  
s inline completion delay
   
-  
+  
inlineDelaySB
   
  
 
 
  
-  
+  
Qt::Horizontal
   
-  
+  

 40
 20
@@ -175,42 +174,42 @@

   
   
-   
-
- 6
-
-
+   
+
  0
 
+
+ 6
+
 
- 
-  
+ 
+  
After the cursor has not moved for this time, the 
completion popup is shown if it is available.
   
-  
+  
10.000
   
-  
+  
0.100
   
  
 
 
- 
-  
+ 
+  
s popup delay
   
-  
+  
popupDelaySB
   
  
 
 
  
-  
+  
Qt::Horizontal
   
-  
+  

 40
 20
@@ -221,16 +220,16 @@

   
   
-   
-
- 6
-
-
+   
+
  0
 
+
+ 6
+
 
- 
-  
+ 
+  
.
   
   
@@ -245,24 +244,21 @@
  
 
 
- 
-  
-   Shortest word that LyX will offer to complete.
-  
-  
+ 
+  
Minimum word length for completion
   
-  
+  
minlengthSB
   
  
 
 
  
-  
+  
Qt::Horizontal
   
-  
+  

 40
 20
@@ -273,37 +269,37 @@

   
   
-   
-
+   
+
 

[LyX/master] Objective-C compililation support with cmake and C++11

2014-04-21 Thread Richard Heck
commit c2e67a41ce4b3b281f6c8a805be5e821ce0aea0a
Author: Benjamin Piwowarski 
Date:   Sun Mar 9 08:29:27 2014 +0100

Objective-C compililation support with cmake and C++11

This fixes an issue whe compiling with C++11 flags on: The
objective-C clang compiler produces an error. This patch waits
avoid including specific C++ flags and uses LYX_CPP_SPECIFIC_FLAGS
to store the confliciting flags (for the moment, just C++11).

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 023c3e1..fce4bed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -202,7 +202,8 @@ else()
 endif()
 
 
-set(LYX_GCC11_MODE)
+# Variable that hold the flags that should only be used with C++ files
+set(LYX_CXX_SPECIFIC_FLAGS)
 if(UNIX OR MINGW)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion 
OUTPUT_VARIABLE GCC_VERSION)
message(STATUS "Using GCC version ${GCC_VERSION}")
@@ -217,7 +218,7 @@ if(UNIX OR MINGW)
if(NOT CXX11COMPILER_FOUND)
message(FATAL_ERROR "A C++11 compatible compiler is 
required.")
endif()
-   set(LYX_GCC11_MODE "${CXX11_FLAG}")
+   set(LYX_CXX_SPECIFIC_FLAGS "${LYX_CXX_SPECIFIC_FLAGS} 
${CXX11_FLAG}")
endif()
 else()
if(MSVC10)
@@ -453,7 +454,7 @@ if(NOT MSVC)
if(NOT LYX_QUIET)
set(CMAKE_VERBOSE_MAKEFILE ON)
endif()
-   set(LYX_CXX_FLAGS "-Wall -Wunused-parameter ${LYX_GCC11_MODE}")
+   set(LYX_CXX_FLAGS "-Wall -Wunused-parameter")
if(LYX_STDLIB_DEBUG)
set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCXX_DEBUG 
-D_GLIBCXX_DEBUG_PEDANTIC")
endif()
diff --git a/boost/CMakeLists.txt b/boost/CMakeLists.txt
index 6d7839a..8dcb275 100644
--- a/boost/CMakeLists.txt
+++ b/boost/CMakeLists.txt
@@ -4,5 +4,6 @@
 # Copyright (c) 2006-2011 Peter Kümmel, 
 #
 
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LYX_CXX_SPECIFIC_FLAGS}")
 add_subdirectory(libs) 
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5203d45..425cd9e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -11,11 +11,15 @@ include_directories(${TOP_SRC_DIR}/src)
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets")
 
+# support is the only directory containing objective-c files...
+add_subdirectory(support)
+# ...so we can add all the c++ specific flags after
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LYX_CXX_SPECIFIC_FLAGS}")
+
 add_subdirectory(frontends)
 add_subdirectory(graphics)
 add_subdirectory(insets)
 add_subdirectory(mathed)
-add_subdirectory(support)
 add_subdirectory(tex2lyx)
 if (UNIX)
add_subdirectory(client)
diff --git a/src/support/CMakeLists.txt b/src/support/CMakeLists.txt
index ba0dfdc..04eb38e 100644
--- a/src/support/CMakeLists.txt
+++ b/src/support/CMakeLists.txt
@@ -22,6 +22,7 @@ file(GLOB support_mythes_headers 
${TOP_SRC_DIR}/src/support/mythes/*.hxx)
 file(GLOB support_linkback_sources ${TOP_SRC_DIR}/src/support/linkback/*.m*)
 file(GLOB support_linkback_headers ${TOP_SRC_DIR}/src/support/linkback/*.h)
 
+set_source_files_properties(${support_sources} ${support_mythes_sources} 
PROPERTIES COMPILE_FLAGS "${LYX_CXX_SPECIFIC_FLAGS}")
 list(REMOVE_ITEM support_sources
${TOP_SRC_DIR}/src/support/os_win32.cpp
${TOP_SRC_DIR}/src/support/os_unix.cpp
diff --git a/src/support/tests/CMakeLists.txt b/src/support/tests/CMakeLists.txt
index eac5aa7..7c4600f 100644
--- a/src/support/tests/CMakeLists.txt
+++ b/src/support/tests/CMakeLists.txt
@@ -6,6 +6,8 @@
 
 project(supporttest)
 
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LYX_CXX_SPECIFIC_FLAGS}")
+
 macro(sources _program)
set(_tmplist)
foreach(_tmp ${ARGN})


[LyX/master] Avoids const_cast in configure_command by using mutable

2014-04-21 Thread Richard Heck
commit 73405549cb122d30dfdba13414660a3427eb0db2
Author: Benjamin Piwowarski 
Date:   Fri Mar 21 18:38:09 2014 +0100

Avoids const_cast in configure_command by using mutable

diff --git a/src/support/Package.cpp b/src/support/Package.cpp
index f5ee5d5..b4b0e14 100644
--- a/src/support/Package.cpp
+++ b/src/support/Package.cpp
@@ -154,9 +154,8 @@ Package::Package(string const & command_line_arg0,
 std::string const & Package::configure_command() const
 {
if (configure_command_.empty()) {
-   std::string  = 
const_cast(configure_command_);
FileName const 
configure_script(addName(system_support().absFileName(), "configure.py"));
-   command = os::python() + ' ' +
+   configure_command_ = os::python() + ' ' +
quoteName(configure_script.toFilesystemEncoding()) +
with_version_suffix() + " --binary-dir=" +

quoteName(FileName(binary_dir().absFileName()).toFilesystemEncoding());


[LyX/master] When LYX_ASPELL is on, fails if not finding the library

2014-04-21 Thread Richard Heck
commit 6468cd97e3c088fe4f29b4738978644e0a4e32ca
Author: Benjamin Piwowarski 
Date:   Sun Mar 9 10:24:07 2014 +0100

When LYX_ASPELL is on, fails if not finding the library

Otherwise, this was triggering errors latter in the build process

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f68222a..03b957d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -302,7 +302,7 @@ endif()
 # Set the programs (lyx, tex2lyx, etc.) suffix 
 # When building an OS X bundle, we will append
 # the suffix only to the bundle, not to the programs
-   set(PROGRAM_SUFFIX "")
+set(PROGRAM_SUFFIX "")
 if(LYX_PROGRAM_SUFFIX AND NOT (APPLE AND LYX_BUNDLE))
set(PROGRAM_SUFFIX "${LYX_INSTALL_SUFFIX}")
 endif()
@@ -541,7 +541,7 @@ endif()
 include_directories(${TOP_BINARY_DIR} ${TOP_SRC_DIR}/src)
 
 if(LYX_ASPELL)
-   find_package(ASPELL)
+   find_package(ASPELL REQUIRED)
include_directories(${ASPELL_INCLUDE_DIR})
 endif()
 
@@ -786,8 +786,8 @@ if(LYX_INSTALL)
add_subdirectory(${LYX_CMAKE_DIR}/man "${TOP_BINARY_DIR}/man")
add_subdirectory(${LYX_CMAKE_DIR}/doc "${TOP_BINARY_DIR}/doc")
endif()
-   include(../Install)
-   endif()
+   include(../Install)
+endif()
 
 add_subdirectory(src "${TOP_BINARY_DIR}/src")
 add_subdirectory(lib/lyx2lyx "${TOP_BINARY_DIR}/lyx2lyx")


[LyX/master] CMake install and bundling improvements (esp. OS X)

2014-04-21 Thread Richard Heck
commit 14de3aa49b4fb38093ff12ccaf3200daf0f62c77
Author: Benjamin Piwowarski 
Date:   Sun Mar 9 10:21:51 2014 +0100

CMake install and bundling improvements (esp. OS X)

This patch improves the cmake bundling process:
- reworked bundle handling for OS X: only when installing resources are 
copied, otherwise
only the smallest bundle is built
- on OS X, the utility programs (tex2lyx) are now installed in the right 
location
- it removes some unneeded BUNDLE DESTINATION
- it provides a basic support for QT plugins inclusion
- it properly builds a disk image on OS X (only the background image is 
missing)
- it fixes the library paths for all executables (not only LyX)
- Use the COPYING file for cmake install license

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fce4bed..f68222a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,8 @@ file(MAKE_DIRECTORY "${LYX_TESTS_USERDIR}")
 if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 OLD)
cmake_policy(SET CMP0005 OLD)
+   # Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION
+   cmake_policy(SET CMP0006 NEW)
 endif()
 
 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
@@ -297,41 +299,66 @@ else()
set(LYX_REVISION_VERSION ${LYX_PATCH_VERSION})
 endif()
 
-if(LYX_PROGRAM_SUFFIX)
-   set(PROGRAM_SUFFIX "${LYX_INSTALL_SUFFIX}")
-else()
+# Set the programs (lyx, tex2lyx, etc.) suffix 
+# When building an OS X bundle, we will append
+# the suffix only to the bundle, not to the programs
set(PROGRAM_SUFFIX "")
+if(LYX_PROGRAM_SUFFIX AND NOT (APPLE AND LYX_BUNDLE))
+   set(PROGRAM_SUFFIX "${LYX_INSTALL_SUFFIX}")
 endif()
+set(_lyx "${PACKAGE_BASE}${PROGRAM_SUFFIX}")
+set(_tex2lyx tex2lyx${PROGRAM_SUFFIX})
 
 add_custom_target(lyx_version ALL
   COMMAND ${CMAKE_COMMAND} -DTOP_SRC_DIR=${TOP_SRC_DIR} 
-DTOP_CMAKE_PATH=${TOP_CMAKE_PATH} -DTOP_BINARY_DIR=${TOP_BINARY_DIR} 
-DLYX_DATE=${LYX_DATE} -P ${TOP_SCRIPT_PATH}/LyXGetVersion.cmake
   )
 set_target_properties(lyx_version PROPERTIES FOLDER "applications")
 
-if(APPLE)
-   set(osx_bundle_program_name ${PACKAGE_BASE}${PROGRAM_SUFFIX})
-   
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/development/MacOSX/Info.plist.in" 
"${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
-endif()
+# Default paths for installed utilities (tex2lyx, lyxclient, etc.)
+set(LYX_UTILITIES_INSTALL_PATH bin)
 
 if(LYX_BUNDLE)
set(LYX_CPACK ON)
+
message(STATUS)
message(STATUS "Bundle creation is enabled (experimental):")
message(STATUS "make")
message(STATUS "make install/strip")
message(STATUS "make package")
if(APPLE)
+   set(MACOSX_BUNDLE TRUE)
+   # This sets the bundle + executable names
+   set(_lyx "${PACKAGE_BASE}${LYX_INSTALL_SUFFIX}")
+   # This sets the Info.plist executable name
+   set(osx_bundle_program_name ${_lyx})
+   # Bundle name
+   set(LYX_BUNDLE_NAME ${_lyx})
+
+   # This will contain the list of files that need to be included
+   # in the bundle and their location within the bundle
+   set(OSX_BUNDLE_FILES 
"${TOP_SRC_DIR}/development/MacOSX/LyX.sdef;${TOP_SRC_DIR}/development/MacOSX/LyXapp.icns;${CMAKE_BINARY_DIR}/lyxrc.dist")
+   set(OSX_BUNDLE_DIRS "Resources;Resources;Resources")
+
+   # Process Info.plist and lyxrc.dist
+   
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/development/MacOSX/Info.plist.in" 
"${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
+   
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/development/MacOSX/lyxrc.dist.in" 
"${CMAKE_CURRENT_BINARY_DIR}/lyxrc.dist")
+
set(LYX_BUILD_BUNDLE MACOSX_BUNDLE)
-   set(CPACK_BUNDLE_NAME ${PACKAGE_BASE}${PROGRAM_SUFFIX})
+   set(LYX_DATA_SUBDIR ${LYX_BUNDLE_NAME}.app/Contents/Resources/ 
CACHE STRING "Bundle Contents dir" FORCE)
+
+   # Variables used by CPack
+   set(CPACK_BUNDLE_NAME ${LYX_BUNDLE_NAME})
set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
-   set(LYX_DATA_SUBDIR 
${PACKAGE_BASE}${PROGRAM_SUFFIX}.app/Contents/Resources/ CACHE STRING "Bundle 
Contents dir" FORCE)
-   set(MACOSX_BUNDLE_STARTUP_COMMAND 
${PACKAGE_BASE}${PROGRAM_SUFFIX}.app)
+   set(MACOSX_BUNDLE_STARTUP_COMMAND ${LYX_BUNDLE_NAME}.app)
+
+   # Set the install paths
+   set(LYX_UTILITIES_INSTALL_PATH 
${LYX_BUNDLE_NAME}.app/Contents/MacOS)
if(NOT LYX_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/LyX CACHE 
PATH "Mac bundle dir" FORCE)
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
endif()
# Change the owner so that the install can work
-   install(CODE 

[LyX/master] Fix selection drawing after mouse-double/triple in mathed

2014-04-21 Thread Richard Heck
commit 33e10ff2138ae95ae42d922a51e93b9ba9c7bca6
Author: Juergen Spitzmueller 
Date:   Fri Mar 21 10:20:12 2014 +0100

Fix selection drawing after mouse-double/triple in mathed

Fixes: #8829

diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index ab88cf9..479a682 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -736,6 +736,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & 
cmd)
cur.setSelection(true);
cur.idx() = cur.lastidx();
cur.pos() = cur.lastpos();
+   cur.bv().cursor() = cur;
break;
 
case LFUN_PARAGRAPH_UP:


[LyX/master] style

2014-04-21 Thread Richard Heck
commit b8661bcfb33bb7f8c0598c0f0c45229b77526bbb
Author: Juergen Spitzmueller 
Date:   Sat Mar 22 12:22:41 2014 +0100

style

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index ab5501c..2d3df5f 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -2499,7 +2499,7 @@ void BufferView::putSelectionAt(DocIterator const & cur,
 bool BufferView::selectIfEmpty(DocIterator & cur)
 {
if ((cur.inTexted() && !cur.paragraph().empty())
-   || cur.inMathed() && !cur.cell().empty())
+   || (cur.inMathed() && !cur.cell().empty()))
return false;
 
pit_type const beg_pit = cur.pit();


[LyX/master] In Paragraph::changeCase, correctly track the font of the changed characters (fix crash)

2014-04-21 Thread Richard Heck
commit 0b2d89eaea7ca8075c43154a0bf7ef49221d3fab
Author: Juergen Spitzmueller 
Date:   Mon Mar 24 09:15:00 2014 +0100

In Paragraph::changeCase, correctly track the font of the changed 
characters (fix crash)

Fixes: #7943

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index d32c0be..ffcb5f2 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -3670,7 +3670,9 @@ void Paragraph::changeCase(BufferParams const & bparams, 
pos_type pos,
// process sequences of modified characters; in change
// tracking mode, this approach results in much better
// usability than changing case on a char-by-char basis
-   docstring changes;
+   // We also need to track the current font, since font
+   // changes within sequences can occur.
+   vector > changes;
 
bool const trackChanges = bparams.trackChanges;
 
@@ -3704,7 +3706,7 @@ void Paragraph::changeCase(BufferParams const & bparams, 
pos_type pos,
}
 
if (oldChar != newChar) {
-   changes += newChar;
+   changes.push_back(make_pair(newChar, 
getFontSettings(bparams, pos)));
if (pos != right - 1)
continue;
// step behind the changing area
@@ -3713,9 +3715,8 @@ void Paragraph::changeCase(BufferParams const & bparams, 
pos_type pos,
 
int erasePos = pos - changes.size();
for (size_t i = 0; i < changes.size(); i++) {
-   insertChar(pos, changes[i],
-  getFontSettings(bparams,
-  erasePos),
+   insertChar(pos, changes[i].first,
+  changes[i].second,
   trackChanges);
if (!eraseChar(erasePos, trackChanges)) {
++erasePos;


[LyX/master] Typos in algorithm module.

2014-04-21 Thread Richard Heck
commit 47c3b0fce7936f686389438b80357c5b45be0ab4
Author: Richard Heck 
Date:   Wed Mar 26 15:53:15 2014 -0400

Typos in algorithm module.

diff --git a/lib/layouts/algorithm2e.module b/lib/layouts/algorithm2e.module
index 8125506..17b5131 100644
--- a/lib/layouts/algorithm2e.module
+++ b/lib/layouts/algorithm2e.module
@@ -1,7 +1,7 @@
 #\DeclareLyXModule[algorithm2e.sty]{Algorithm2e}
 #DescriptionBegin
 # Use the algorithm2e package for algorithm floats rather
-# then LyX's home-brewn algorithm floats.
+# than LyX's home-brewed algorithm floats.
 #DescriptionEnd
 #
 #Author: Jürgen Spitzmüller


[LyX/master] \lyxdeleted uses an ulem command.

2014-04-21 Thread Richard Heck
commit 5a4363c0f56780cbf83306d2f5c5451897528050
Author: Juergen Spitzmueller 
Date:   Sat Mar 22 12:27:46 2014 +0100

\lyxdeleted uses an ulem command.

Therefore we need to put \cite and \ref into \mboxes, as in our native ulem 
commands.

Fixes: #8806.

diff --git a/src/Changes.cpp b/src/Changes.cpp
index d03a371..4292f1b 100644
--- a/src/Changes.cpp
+++ b/src/Changes.cpp
@@ -398,6 +398,8 @@ int Changes::latexMarkChange(otexstream & os, BufferParams 
const & bparams,
// close \lyxadded or \lyxdeleted
os << '}';
column++;
+   if (oldChange.type == Change::DELETED)
+   --runparams.inulemcmd;
}
 
docstring chgTime;
@@ -406,8 +408,10 @@ int Changes::latexMarkChange(otexstream & os, BufferParams 
const & bparams,
chgTime.erase(chgTime.end() - 1);
 
docstring macro_beg;
-   if (change.type == Change::DELETED)
+   if (change.type == Change::DELETED) {
macro_beg = from_ascii("\\lyxdeleted{");
+   ++runparams.inulemcmd;
+   }
else if (change.type == Change::INSERTED)
macro_beg = from_ascii("\\lyxadded{");



[LyX/master] PrefCompletionUi.ui: port commit 1a137950

2014-04-21 Thread Richard Heck
commit 9776519cc597c81be5c69ff42dc0dd7cf7e72f5a
Author: Uwe Stöhr 
Date:   Sun Mar 23 14:49:57 2014 +0100

PrefCompletionUi.ui: port commit 1a137950

diff --git a/src/frontends/qt4/ui/PrefCompletionUi.ui 
b/src/frontends/qt4/ui/PrefCompletionUi.ui
index 010b308..45faee4 100644
--- a/src/frontends/qt4/ui/PrefCompletionUi.ui
+++ b/src/frontends/qt4/ui/PrefCompletionUi.ui
@@ -1,7 +1,8 @@
-
+
+
  PrefCompletionUi
- 
-  
+ 
+  

 0
 0
@@ -9,54 +10,54 @@
 404

   
-  
+  

   
-  
-   
+  
+   
 9

-   
+   
 6

-   
-
- 
+   
+
+ 
   In Math
  
- 
+ 
   true
  
- 
-  
-   9
-  
-  
+ 
+  
6
   
+  
+   9
+  
   
-   
-
+   
+
  Show the grey inline completion behind the cursor in math 
mode after the delay.
 
-
+
  Automatic inline completion
 

   
   
-   
-
+   
+
  Show the popup in math mode after the delay.
 
-
+
  Automatic popup
 

   
   
-   
-
+   
+
  Autocorrection
 

@@ -64,47 +65,47 @@
  
 

-   
-
- 
+   
+
+ 
   In Text
  
- 
+ 
   true
  
- 
-  
-   9
-  
-  
+ 
+  
6
   
+  
+   9
+  
   
-   
-
+   
+
  Show the grey inline completion behind the cursor in text 
mode after the delay.
 
-
+
  Automatic inline completion
 

   
   
-   
-
+   
+
  Show the popup after the set delay in text mode.
 
-
+
  Automatic popup
 

   
   
-   
-
+   
+
  Show a small triangle on the cursor if a completion is 
available in text mode.
 
-
+
  Cursor indicator
 

@@ -112,58 +113,58 @@
  
 

-   
-
- 
+   
+
+ 
   General
  
- 
+ 
   true
  
- 
-  
-   9
-  
-  
+ 
+  
6
   
+  
+   9
+  
   
-   
-
- 0
-
-
+   
+
  6
 
+
+ 0
+
 
- 
-  
+ 
+  
After the cursor has not moved for this time, the inline 
completion is shown if it is available.
   
-  
+  
10.000
   
-  
+  
0.100
   
  
 
 
- 
-  
+ 
+  
s inline completion delay
   
-  
+  
inlineDelaySB
   
  
 
 
  
-  
+  
Qt::Horizontal
   
-  
+  

 40
 20
@@ -174,42 +175,42 @@

   
   
-   
-
- 0
-
-
+   
+
  6
 
+
+ 0
+
 
- 
-  
+ 
+  
After the cursor has not moved for this time, the 
completion popup is shown if it is available.
   
-  
+  
10.000
   
-  
+  
0.100
   
  
 
 
- 
-  
+ 
+  
s popup delay
   
-  
+  
popupDelaySB
   
  
 
 
  
-  
+  
Qt::Horizontal
   
-  
+  

 40
 20
@@ -220,17 +221,17 @@

   
   
-   
-
- 0
-
-
+   
+
  6
 
+
+ 0
+
 
- 
-  
-   .
+ 
+  
+   Words with less than the specified number of characters 
will not be completed.
   
   
5
@@ -244,21 +245,21 @@
  
 
 
- 
-  
-   Minimum word length for completion
+ 
+  
+   Minimum characters for words that should be 
completed
   
-  
+  
minlengthSB
   
  
 
 
  
-  
+  
Qt::Horizontal
   
-  
+  

 40
 20
@@ -269,37 +270,37 @@

   
   
-   
-
+   
+
  When the TAB completion is not unique, there won't be a delay 
of the 

[LyX/master] Change forToc() to forOutliner(), to avoid confusion. The old name is left over from when the outliner really did just display a TOC.

2014-04-21 Thread Richard Heck
commit 8b00b355ca7012ca703c78a8be89193ac6435fcb
Author: Richard Heck 
Date:   Sat Mar 29 13:34:36 2014 -0400

Change forToc() to forOutliner(), to avoid confusion. The old name
is left over from when the outliner really did just display a TOC.

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 4d9b37c..098ea65 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -3374,7 +3374,7 @@ docstring Paragraph::asString(pos_type beg, pos_type end, 
int options) const
 }
 
 
-void Paragraph::forToc(docstring & os, size_t maxlen) const
+void Paragraph::forOutliner(docstring & os, size_t maxlen) const
 {
if (!d->params_.labelString().empty())
os += d->params_.labelString() + ' ';
@@ -3387,7 +3387,7 @@ void Paragraph::forToc(docstring & os, size_t maxlen) 
const
else if (c == '\t' || c == '\n')
os += ' ';
else if (c == META_INSET)
-   getInset(i)->forToc(os, maxlen);
+   getInset(i)->forOutliner(os, maxlen);
}
 }
 
diff --git a/src/Paragraph.h b/src/Paragraph.h
index 9558048..ba62f9b 100644
--- a/src/Paragraph.h
+++ b/src/Paragraph.h
@@ -177,7 +177,7 @@ public:
docstring asString(pos_type beg, pos_type end,
int options = AS_STR_NONE) const;
///
-   void forToc(docstring &, size_t maxlen) const;
+   void forOutliner(docstring &, size_t maxlen) const;
 
/// Extract only the explicitly visible text (without any formatting),
/// descending into insets
diff --git a/src/Text.cpp b/src/Text.cpp
index cdcc200..589fd25 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -2012,14 +2012,14 @@ docstring Text::asString(pit_type beg, pit_type end, 
int options) const
 }
 
 
-void Text::forToc(docstring & os, size_t maxlen, bool shorten) const
+void Text::forOutliner(docstring & os, size_t maxlen, bool shorten) const
 {
if (maxlen == 0)
maxlen = std::numeric_limits::max();
else
LASSERT(maxlen >= 8, maxlen = TOC_ENTRY_LENGTH);
for (size_t i = 0; i != pars_.size() && os.length() < maxlen; ++i)
-   pars_[i].forToc(os, maxlen);
+   pars_[i].forOutliner(os, maxlen);
if (shorten && os.length() >= maxlen)
os = os.substr(0, maxlen - 3) + from_ascii("...");
 }
diff --git a/src/Text.h b/src/Text.h
index 7ee76d2..189a422 100644
--- a/src/Text.h
+++ b/src/Text.h
@@ -130,7 +130,7 @@ public:
/// if \param os is longer than maxlen chars.
/// if \param maxlen is passed as 0, then it is ignored. (In fact,
/// it is reset to the maximum value for size_t.)
-   void forToc(docstring & os, size_t maxlen, bool shorten = true) const;
+   void forOutliner(docstring & os, size_t maxlen, bool shorten = true) 
const;
 
/// insert a character at cursor position
/// FIXME: replace Cursor with DocIterator.
diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp
index 66bdf0b..cce0f32 100644
--- a/src/insets/Inset.cpp
+++ b/src/insets/Inset.cpp
@@ -258,7 +258,7 @@ docstring Inset::toolTip(BufferView const &, int, int) const
 }
 
 
-void Inset::forToc(docstring &, size_t) const
+void Inset::forOutliner(docstring &, size_t) const
 {
 }
 
diff --git a/src/insets/Inset.h b/src/insets/Inset.h
index b18f8a5..0ed8ff4 100644
--- a/src/insets/Inset.h
+++ b/src/insets/Inset.h
@@ -333,7 +333,7 @@ public:
virtual void toString(odocstream &) const {}
/// Appends a potentially abbreviated version of the inset to
/// \param str. Intended for use by the TOC.
-   virtual void forToc(docstring & str,
+   virtual void forOutliner(docstring & str,
size_t maxlen = TOC_ENTRY_LENGTH) const;
 
/// can the contents of the inset be edited on screen ?
diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp
index 2676d93..144123f 100644
--- a/src/insets/InsetBranch.cpp
+++ b/src/insets/InsetBranch.cpp
@@ -299,10 +299,10 @@ void InsetBranch::toString(odocstream & os) const
 }
 
 
-void InsetBranch::forToc(docstring & os, size_t maxlen) const
+void InsetBranch::forOutliner(docstring & os, size_t maxlen) const
 {
if (isBranchSelected())
-   InsetCollapsable::forToc(os, maxlen);
+   InsetCollapsable::forOutliner(os, maxlen);
 }
 
 
@@ -355,7 +355,7 @@ void InsetBranch::addToToc(DocIterator const & cpit, bool 
output_active) const
 
Toc & toc = buffer().tocBackend().toc("branch");
docstring str = params_.branch + ": ";
-   text().forToc(str, TOC_ENTRY_LENGTH);
+   text().forOutliner(str, TOC_ENTRY_LENGTH);
toc.push_back(TocItem(pit, 0, str, output_active, 
toolTipText(docstring(), 3, 60)));
// Proceed with the rest of the inset.
bool const doing_output = output_active && isBranchSelected();
diff --git a/src/insets/InsetBranch.h b/src/insets/InsetBranch.h
index 7521fbe..ecd2f7d 

[LyX/master] Fix oversight in autotools packaging selection

2014-04-21 Thread Richard Heck
commit 5ff8a01cb610b58f5c3c84f7e65440b0a001b5f6
Author: Jean-Marc Lasgouttes 
Date:   Thu Mar 27 13:51:25 2014 +0100

Fix oversight in autotools packaging selection

The only consequence of this thinko is that the lyx.desktop and the svg 
icons were installed on Mac OS and Windows platform, whereas they are useless.

diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index d1b78f9..61ea48d 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -463,6 +463,7 @@ AC_ARG_WITH(packaging,
   *) lyx_use_packaging=posix;;
   esac])
 AC_MSG_RESULT($lyx_use_packaging)
+lyx_install_posix=false
 lyx_install_macosx=false
 lyx_install_cygwin=false
 lyx_install_windows=false


[LyX/master] PrefLanguageUi.ui: change a string

2014-04-21 Thread Richard Heck
commit 658aa3f02606000de788360bed4f66624065f6f1
Author: Uwe Stöhr 
Date:   Wed Mar 26 05:19:38 2014 +0100

PrefLanguageUi.ui: change a string

to have uniform uppercases in this dialog

diff --git a/src/frontends/qt4/ui/PrefLanguageUi.ui 
b/src/frontends/qt4/ui/PrefLanguageUi.ui
index 1027e7f..c91961b 100644
--- a/src/frontends/qt4/ui/PrefLanguageUi.ui
+++ b/src/frontends/qt4/ui/PrefLanguageUi.ui
@@ -1,3 +1,4 @@
+
 
  PrefLanguageUi
  
@@ -131,7 +132,7 @@

 
  
-  Default Decimal Separator:
+  Default decimal separator:
  
  
   defaultDecimalPointLE
@@ -154,20 +155,20 @@
  
 

-
-  
-
-  Default length unit:
-
-
-  defaultLengthUnitCO
-
-  
-
-
-  
-
-
+   
+
+ 
+  Default length unit:
+ 
+ 
+  defaultLengthUnitCO
+ 
+
+   
+   
+
+   
+   
 
  
   Check to pass the language globally (to the document class), not 
locally (to the language package)


[LyX/master] Merged Paragraph::stringify into asString().

2014-04-21 Thread Richard Heck
commit 13cb7da11d04bba9fb4af5e538ca2332a5341b71
Author: Tommaso Cucinotta 
Date:   Thu Mar 27 23:12:56 2014 +

Merged Paragraph::stringify into asString().

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index ed0ddd0..3751cfd 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -3347,7 +3347,7 @@ docstring Paragraph::asString(int options) const
 }
 
 
-docstring Paragraph::asString(pos_type beg, pos_type end, int options) const
+docstring Paragraph::asString(pos_type beg, pos_type end, int options, const 
OutputParams *runparams) const
 {
odocstringstream os;
 
@@ -3364,9 +3364,14 @@ docstring Paragraph::asString(pos_type beg, pos_type 
end, int options) const
|| (c == '\n' && (options & AS_STR_NEWLINES)))
os.put(c);
else if (c == META_INSET && (options & AS_STR_INSETS)) {
-   getInset(i)->toString(os);
-   if (getInset(i)->asInsetMath())
-   os << " ";
+   if (c == META_INSET && (options & AS_STR_PLAINTEXT)) {
+   LASSERT(runparams != 0, return docstring());
+   getInset(i)->plaintext(os, *runparams);
+   } else {
+   getInset(i)->toString(os);
+   if (getInset(i)->asInsetMath())
+   os << " ";
+   }
}
}
 
@@ -3392,33 +3397,6 @@ void Paragraph::forOutliner(docstring & os, size_t 
maxlen) const
 }
 
 
-docstring Paragraph::stringify(pos_type beg, pos_type end, int options,
-OutputParams const & runparams) const
-{
-   odocstringstream os;
-
-   if (beg == 0
-   && options & AS_STR_LABEL
-   && !d->params_.labelString().empty())
-   os << d->params_.labelString() << ' ';
-
-   OutputParams op = runparams;
-   op.for_search = true;
-
-   for (pos_type i = beg; i < end; ++i) {
-   char_type const c = d->text_[i];
-   if (isPrintable(c) || c == '\t'
-   || (c == '\n' && (options & AS_STR_NEWLINES)))
-   os.put(c);
-   else if (c == META_INSET && (options & AS_STR_INSETS)) {
-   getInset(i)->plaintext(os, op);
-   }
-   }
-
-   return os.str();
-}
-
-
 void Paragraph::setInsetOwner(Inset const * inset)
 {
d->inset_owner_ = inset;
diff --git a/src/Paragraph.h b/src/Paragraph.h
index ba62f9b..587612d 100644
--- a/src/Paragraph.h
+++ b/src/Paragraph.h
@@ -127,7 +127,8 @@ enum AsStringParameter
AS_STR_LABEL = 1, ///< Prefix with paragraph label.
AS_STR_INSETS = 2, ///< Go into insets.
AS_STR_NEWLINES = 4, ///< Get also newline characters.
-   AS_STR_SKIPDELETE = 8 ///< Skip deleted text in change tracking.
+   AS_STR_SKIPDELETE = 8, ///< Skip deleted text in change tracking.
+   AS_STR_PLAINTEXT = 16 ///< Don't export formatting when descending into 
insets.
 };
 
 
@@ -173,17 +174,15 @@ public:
/// asString(AS_STR_LABEL | AS_STR_INSETS)
/// asString(AS_STR_INSETS)
docstring asString(int options = AS_STR_NONE) const;
-   ///
+
+   /// Convert the paragraph to a string.
+   /// \note If options includes AS_STR_PLAINTEXT, then runparams must be 
!= 0
docstring asString(pos_type beg, pos_type end,
-   int options = AS_STR_NONE) const;
+  int options = AS_STR_NONE,
+  const OutputParams *runparams = 0) const;
///
void forOutliner(docstring &, size_t maxlen) const;
 
-   /// Extract only the explicitly visible text (without any formatting),
-   /// descending into insets
-   docstring stringify(pos_type beg, pos_type end, int options,
-   OutputParams const & runparams) const;
-
///
void write(std::ostream &, BufferParams const &,
depth_type & depth) const;
diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index 75f0412..1b32ae3 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -782,14 +782,17 @@ static docstring stringifySearchBuffer(Buffer & buffer, 
FindAndReplaceOptions co
runparams.flavor = OutputParams::LATEX;
runparams.linelen = 10; //lyxrc.plaintext_linelen;
runparams.dryrun = true;
+   runparams.for_search = true;
for (pos_type pit = pos_type(0); pit < 
(pos_type)buffer.paragraphs().size(); ++pit) {
Paragraph const & par = buffer.paragraphs().at(pit);
LYXERR(Debug::FIND, "Adding to search string: '"
-  << par.stringify(pos_type(0), par.size(),
-   AS_STR_INSETS, runparams)
+  << 

[LyX/master] Fix two thinkos caught by the cppcheck script.

2014-04-21 Thread Richard Heck
commit 84d4d45daa9e0b1a18ab0133c6caa5f34e7f8616
Author: Richard Heck 
Date:   Fri Apr 4 15:53:27 2014 -0400

Fix two thinkos caught by the cppcheck script.

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index acf8ace..113715a 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -876,7 +876,7 @@ void Tabular::insertColumn(col_type const col, bool copy)
setBottomLine(i, bottomLine(j));
setTopLine(i, topLine(j));
setLeftLine(i, leftLine(j));
-   if (rightLine(j) && rightLine(j)) {
+   if (rightLine(i) && rightLine(j)) {
setRightLine(i, true);
setRightLine(j, false);
}
diff --git a/src/mathed/InsetMathPhantom.cpp b/src/mathed/InsetMathPhantom.cpp
index cd4ae45..b8c965b 100644
--- a/src/mathed/InsetMathPhantom.cpp
+++ b/src/mathed/InsetMathPhantom.cpp
@@ -346,7 +346,7 @@ void InsetMathPhantom::validate(LaTeXFeatures & features) 
const
 
 bool InsetMathPhantom::visibleContents() const 
 { 
-   return kind_ == phantom || kind_ == vphantom || kind_ == vphantom;
+   return kind_ == phantom || kind_ == vphantom || kind_ == hphantom;
 }
 
 


[LyX/master] Make some functions return const refs, and add a comment.

2014-04-21 Thread Richard Heck
commit 75aa0d61dba848cda39ceddcde9c2f3f0b9afbe8
Author: Richard Heck 
Date:   Sun Apr 6 21:53:54 2014 -0400

Make some functions return const refs, and add a comment.

diff --git a/src/insets/InsetLayout.h b/src/insets/InsetLayout.h
index 74e1af9..83bbb2d 100644
--- a/src/insets/InsetLayout.h
+++ b/src/insets/InsetLayout.h
@@ -85,13 +85,18 @@ public:
FontInfo labelfont() const { return labelfont_; }
///
ColorCode bgcolor() const { return bgcolor_; }
-   ///
+   /// 
+   Layout::LaTeXArgMap const & latexargs() const { return latexargs_; }
+   ///
+   Layout::LaTeXArgMap const & postcommandargs() const { return 
postcommandargs_; }
+   /// Returns latexargs() + postcommandargs().
+   /// But note that it returns a *copy*, not a reference, so do not do 
+   /// anything like:
+   ///   Layout::LaTeXArgMap it = args().begin();
+   ///   Layout::LaTeXArgMap en = args().end();
+   /// Those are iterators for different containers.
Layout::LaTeXArgMap args() const;
///
-   Layout::LaTeXArgMap latexargs() const { return latexargs_; }
-   ///
-   Layout::LaTeXArgMap postcommandargs() const { return postcommandargs_; }
-   ///
unsigned int optArgs() const;
///
unsigned int requiredArgs() const;


[LyX/master] Stabilize mouse selection in mathed

2014-04-21 Thread Richard Heck
commit 302228625b46788d4301e9bbdc2883b4e581f508
Author: Juergen Spitzmueller 
Date:   Fri Apr 4 15:40:05 2014 +0200

Stabilize mouse selection in mathed

Fixes: #9074

diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 479a682..83e49c4 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -1567,16 +1567,29 @@ void InsetMathNest::lfunMousePress(Cursor & cur, 
FuncRequest & cmd)
 void InsetMathNest::lfunMouseMotion(Cursor & cur, FuncRequest & cmd)
 {
// only select with button 1
-   if (cmd.button() == mouse_button::button1) {
-   Cursor & bvcur = cur.bv().cursor();
-   if (bvcur.realAnchor().hasPart(cur)) {
-   //lyxerr << "## lfunMouseMotion: cursor: " << cur << 
endl;
-   bvcur.setCursor(cur);
-   bvcur.setSelection(true);
-   //lyxerr << "MOTION " << bvcur << endl;
-   } else
-   cur.undispatched();
+   if (cmd.button() != mouse_button::button1)
+   return;
+
+   Cursor & bvcur = cur.bv().cursor();
+
+   // ignore motions deeper nested than the real anchor
+   if (!bvcur.realAnchor().hasPart(cur)) {
+   cur.undispatched();
+   return;
}
+
+   CursorSlice old = bvcur.top();
+
+   // We continue with our existing selection or start a new one, so don't
+   // reset the anchor.
+   bvcur.setCursor(cur);
+   // Did we actually move?
+   if (cur.top() == old)
+   // We didn't move one iota, so no need to change selection 
status
+   // or update the screen.
+   cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor);
+   else
+   bvcur.setSelection();
 }
 
 


[LyX/master] Update other comment.

2014-04-21 Thread Richard Heck
commit 39ac113ba1e066f9e50a9e58c604f7c86170e5ba
Author: Richard Heck 
Date:   Mon Apr 7 11:02:21 2014 -0400

Update other comment.

diff --git a/src/Layout.h b/src/Layout.h
index 05f6cbd..d0abcec 100644
--- a/src/Layout.h
+++ b/src/Layout.h
@@ -116,8 +116,8 @@ public:
/// Returns latexargs() + postcommandargs() + itemargs().
/// But note that it returns a *copy*, not a reference, so do not do
/// anything like:
-   ///   Layout::LaTeXArgMap it = args().begin();
-   ///   Layout::LaTeXArgMap en = args().end();
+   ///   Layout::LaTeXArgMap::iterator it = args().begin();
+   ///   Layout::LaTeXArgMap::iterator en = args().end();
/// Those are iterators for different containers.
LaTeXArgMap args() const;
///


[LyX/master] Typo.

2014-04-21 Thread Richard Heck
commit f80ef1a1593f31f085823f0d11e27a5d168101fd
Author: Richard Heck 
Date:   Fri Apr 11 11:28:04 2014 -0400

Typo.

diff --git a/lib/lyx2lyx/lyx2lyx_tools.py b/lib/lyx2lyx/lyx2lyx_tools.py
index 1edd1fb..fefc53f 100644
--- a/lib/lyx2lyx/lyx2lyx_tools.py
+++ b/lib/lyx2lyx/lyx2lyx_tools.py
@@ -17,7 +17,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
 
 '''
-This modules offer several free functions to help with lyx2lyx'ing. 
+This module offers several free functions to help with lyx2lyx'ing. 
 More documentaton is below, but here is a quick guide to what 
 they do. Optional arguments are marked by brackets.
 


[LyX/master] Use subdir-objects for automake 1.14 or newer

2014-04-21 Thread Richard Heck
commit 6c8a775c73f58eea81a7fe0208c23972c6abba5d
Author: Jean-Marc Lasgouttes 
Date:   Sun Apr 20 20:20:25 2014 +0200

Use subdir-objects for automake 1.14 or newer

This option is going to be mandatory starting with automake 2.0.
LyX is able to use this since version 2.1, but it turns out that it is
badly implemented in versions of automake older than 1.14.

We rely on some (undocumented) symbol to detect automake 1.14 and
use the subdirs-objects option in this case.

For more details, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181023.html

Making everything work with autotools required making a copy of two
files from support/tests. It seems that we should not point to source files
that are handled by another Makefile.am.

diff --git a/configure.ac b/configure.ac
index 1ce2ed3..e3302e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,7 +27,11 @@ fi
 AM_MAINTAINER_MODE
 
 save_PACKAGE=$PACKAGE
-AM_INIT_AUTOMAKE([foreign dist-bzip2 no-define 1.8])
+dnl The test for _AM_PROG_CC_C_O intends to test for automake 1.14 or newer,
+dnl which are the versions where subdir-objects can beused.
+dnl see: https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181023.html
+m4_define([LYX_OBJECTS_LAYOUT], m4_ifdef([_AM_PROG_CC_C_O],[subdir-objects],))
+AM_INIT_AUTOMAKE([foreign dist-bzip2 no-define 1.8] LYX_OBJECTS_LAYOUT)
 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 PACKAGE=$save_PACKAGE
 
diff --git a/src/Makefile.am b/src/Makefile.am
index ea5ca42..2a98643 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -708,7 +708,7 @@ check_layout_SOURCES = \
Spacing.cpp \
TextClass.cpp \
tests/check_layout.cpp \
-   support/tests/boost.cpp \
-   support/tests/dummy_functions.cpp
+   tests/boost.cpp \
+   tests/dummy_functions.cpp
 
 .PHONY: alltests alltests-recursive updatetests
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 2a8b39e..ce5b355 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -8,7 +8,7 @@ set(check_layout_SOURCES)
 foreach(_f insets/InsetLayout.cpp Color.cpp Counters.cpp Floating.cpp
FloatList.cpp FontInfo.cpp Layout.cpp LayoutFile.cpp Lexer.cpp
ModuleList.cpp Spacing.cpp TextClass.cpp tests/check_layout.cpp
-   support/tests/boost.cpp support/tests/dummy_functions.cpp)
+   tests/boost.cpp tests/dummy_functions.cpp)
   list(APPEND check_layout_SOURCES "${TOP_SRC_DIR}/src/${_f}")
 endforeach()
 
diff --git a/src/tests/boost.cpp b/src/tests/boost.cpp
new file mode 100644
index 000..426263b
--- /dev/null
+++ b/src/tests/boost.cpp
@@ -0,0 +1,36 @@
+/**
+ * \file boost.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include 
+
+#include "support/lassert.h"
+
+#include 
+#include 
+
+using namespace std;
+
+namespace boost {
+
+#ifndef BOOST_NO_EXCEPTIONS
+void throw_exception(exception const & /*e*/)
+{
+   LASSERT(false, /**/);
+}
+#endif
+
+
+void assertion_failed(char const * /*expr*/, char const * /*function*/,
+ char const * /*file*/, long /*line*/)
+{
+   ::abort();
+}
+
+} // namespace boost
diff --git a/src/tests/dummy_functions.cpp b/src/tests/dummy_functions.cpp
new file mode 100644
index 000..5a99081
--- /dev/null
+++ b/src/tests/dummy_functions.cpp
@@ -0,0 +1,38 @@
+#include 
+
+#include "../Messages.h"
+
+using namespace std;
+
+namespace lyx {
+   // Dummy LyXRC support
+   class LyXRC { string icon_set; } lyxrc;
+
+   // Dummy LyXAlignment support
+   enum LyXAlignment {
+   DUMMY
+   };
+
+   // Keep the linker happy on Windows
+   void lyx_exit(int) {}
+
+   // Dummy language support
+   Messages const & getGuiMessages()
+   {
+   static Messages lyx_messages;
+
+   return lyx_messages;
+   }
+   Messages const & getMessages(string const &)
+   {
+   static Messages lyx_messages;
+
+   return lyx_messages;
+   }
+
+   string alignmentToCSS(LyXAlignment)
+   {
+   return string();
+   }
+
+}


[LyX/master] ulem commands can be nested.

2014-04-21 Thread Richard Heck
commit 9aa0fe91f6f39ffd889af02e7bb00b7eef585abc
Author: Juergen Spitzmueller 
Date:   Sat Mar 22 12:25:25 2014 +0100

ulem commands can be nested.

diff --git a/src/Font.cpp b/src/Font.cpp
index a155ec5..7e8b3f4 100644
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -418,22 +418,22 @@ int Font::latexWriteStartChanges(odocstream & os, 
BufferParams const & bparams,
if (f.underbar() == FONT_ON) {
os << "\\uline{";
count += 10;
-   runparams.inulemcmd = true;
+   ++runparams.inulemcmd;
}
if (f.strikeout() == FONT_ON) {
os << "\\sout{";
count += 9;
-   runparams.inulemcmd = true;
+   ++runparams.inulemcmd;
}
if (f.uuline() == FONT_ON) {
os << "\\uuline{";
count += 11;
-   runparams.inulemcmd = true;
+   ++runparams.inulemcmd;
}
if (f.uwave() == FONT_ON) {
os << "\\uwave{";
count += 10;
-   runparams.inulemcmd = true;
+   ++runparams.inulemcmd;
}
return count;
 }
@@ -497,22 +497,22 @@ int Font::latexWriteEndChanges(otexstream & os, 
BufferParams const & bparams,
if (f.underbar() == FONT_ON) {
os << '}';
++count;
-   runparams.inulemcmd = false;
+   --runparams.inulemcmd;
}
if (f.strikeout() == FONT_ON) {
os << '}';
++count;
-   runparams.inulemcmd = false;
+   --runparams.inulemcmd;
}
if (f.uuline() == FONT_ON) {
os << '}';
++count;
-   runparams.inulemcmd = false;
+   --runparams.inulemcmd;
}
if (f.uwave() == FONT_ON) {
os << '}';
++count;
-   runparams.inulemcmd = false;
+   --runparams.inulemcmd;
}
 
// If the current language is Hebrew, Arabic, or Farsi
diff --git a/src/OutputParams.cpp b/src/OutputParams.cpp
index df58ff4..e74eaa3 100644
--- a/src/OutputParams.cpp
+++ b/src/OutputParams.cpp
@@ -20,7 +20,7 @@ namespace lyx {
 
 OutputParams::OutputParams(Encoding const * enc)
: flavor(LATEX), math_flavor(NotApplicable), nice(false), 
is_child(false),
- moving_arg(false), inulemcmd(false), local_font(0), 
master_language(0),
+ moving_arg(false), inulemcmd(0), local_font(0), master_language(0),
  encoding(enc), free_spacing(false), use_babel(false), 
use_polyglossia(false),
  use_indices(false), use_japanese(false), linelen(0), depth(0),
  exportdata(new ExportData),
diff --git a/src/OutputParams.h b/src/OutputParams.h
index f220b5e..598b575 100644
--- a/src/OutputParams.h
+++ b/src/OutputParams.h
@@ -99,13 +99,13 @@ public:
*/
bool intitle;
 
-   /** inulemcmd == true means that the environment in which the
+   /** inulemcmd > 0 means that the environment in which the
inset is typeset is part of a ulem command (\uline, \uuline,
\uwave, or \sout). Insets that output latex commands relying
on local assignments (such as \cite) should enclose such
commands in \mbox{} in order to avoid breakage.
*/
-   mutable bool inulemcmd;
+   mutable int inulemcmd;
 
/** the font at the point where the inset is
 */
diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp
index c0e6179..96620c1 100644
--- a/src/insets/InsetCitation.cpp
+++ b/src/insets/InsetCitation.cpp
@@ -422,7 +422,7 @@ void InsetCitation::latex(otexstream & os, OutputParams 
const & runparams) const
// FIXME UNICODE
docstring const cite_str = from_utf8(citationStyleToString(cs));
 
-   if (runparams.inulemcmd)
+   if (runparams.inulemcmd > 0)
os << "\\mbox{";
 
os << "\\" << cite_str;
diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp
index a3f0596..464a3dd 100644
--- a/src/insets/InsetRef.cpp
+++ b/src/insets/InsetRef.cpp
@@ -143,7 +143,7 @@ void InsetRef::latex(otexstream & os, OutputParams const & 
rp) const
string const cmd = getCmdName();
docstring const data = getEscapedLabel(rp);
 
-   if (rp.inulemcmd)
+   if (rp.inulemcmd > 0)
os << "\\mbox{";
 
if (cmd == "eqref" && buffer().params().use_refstyle) {
@@ -168,7 +168,7 @@ void InsetRef::latex(otexstream & os, OutputParams const & 
rp) const
os << p.getCommand(rp);
}
 
-   if (rp.inulemcmd)
+   if (rp.inulemcmd > 0)
os << "}";
 }
 


[LyX/master] Typos and style.

2014-04-21 Thread Richard Heck
commit 0a6ff99f28686066675848f3410f77c0947bc357
Author: Richard Heck 
Date:   Sat Mar 29 18:52:36 2014 -0400

Typos and style.

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 6f7a5cd..51430e4 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -929,7 +929,7 @@ bool Buffer::readDocument(Lexer & lex)
 
readHeader(lex);
 
-   if (params().outputChanges) {
+   if (params().output_changes) {
bool dvipost= LaTeXFeatures::isAvailable("dvipost");
bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
  LaTeXFeatures::isAvailable("xcolor");
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index a70bc9e..454ccbe 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -371,8 +371,8 @@ BufferParams::BufferParams()
biblio_style = "plain";
use_bibtopic = false;
use_indices = false;
-   trackChanges = false;
-   outputChanges = false;
+   track_changes = false;
+   output_changes = false;
use_default_options = true;
maintain_unincluded_children = false;
secnumdepth = 3;
@@ -752,9 +752,9 @@ string BufferParams::readToken(Lexer & lex, string const & 
token,
} else if (token == "\\use_indices") {
lex >> use_indices;
} else if (token == "\\tracking_changes") {
-   lex >> trackChanges;
+   lex >> track_changes;
} else if (token == "\\output_changes") {
-   lex >> outputChanges;
+   lex >> output_changes;
} else if (token == "\\branch") {
lex.eatLine();
docstring branch = lex.getDocString();
@@ -1178,8 +1178,8 @@ void BufferParams::writeFile(ostream & os) const
}
}
 
-   os << "\\tracking_changes " << convert(trackChanges) << '\n'
-  << "\\output_changes " << convert(outputChanges) << '\n'
+   os << "\\tracking_changes " << convert(track_changes) << '\n'
+  << "\\output_changes " << convert(output_changes) << '\n'
   << "\\html_math_output " << html_math_output << '\n'
   << "\\html_css_as_file " << html_css_as_file << '\n'
   << "\\html_be_strict " << convert(html_be_strict) << '\n';
@@ -1202,7 +1202,7 @@ void BufferParams::validate(LaTeXFeatures & features) 
const
if (columns > 1 && language->rightToLeft())
features.require("rtloutputdblcol");
 
-   if (outputChanges) {
+   if (output_changes) {
bool dvipost= LaTeXFeatures::isAvailable("dvipost");
bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
  LaTeXFeatures::isAvailable("xcolor");
diff --git a/src/BufferParams.h b/src/BufferParams.h
index 0825616..3706399 100644
--- a/src/BufferParams.h
+++ b/src/BufferParams.h
@@ -120,7 +120,7 @@ public:
/// Set the LyX layout file this document is using.
/// NOTE: This does not call makeDocumentClass() to update the local
/// DocumentClass. That needs to be done manually.
-   /// \param filename the name of the layout file
+   /// \param classname: the name of the layout file
bool setBaseClass(std::string const & classname);
/// Adds the module information to the baseClass information to
/// create our local DocumentClass.
@@ -369,12 +369,12 @@ public:
/// Split the index?
bool use_indices;
/// revision tracking for this buffer ?
-   bool trackChanges;
+   bool track_changes;
/** This param decides whether change tracking marks should be used
 *  in output (irrespective of how these marks are actually defined;
 *  for instance, they may differ for DVI and PDF generation)
 */
-   bool outputChanges;
+   bool output_changes;
///
bool compressed;
 
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 392f380..ba0df6e 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -1108,12 +1108,12 @@ bool BufferView::getStatus(FuncRequest const & cmd, 
FuncStatus & flag)
 
case LFUN_CHANGES_TRACK:
flag.setEnabled(true);
-   flag.setOnOff(buffer_.params().trackChanges);
+   flag.setOnOff(buffer_.params().track_changes);
break;
 
case LFUN_CHANGES_OUTPUT:
flag.setEnabled(true);
-   flag.setOnOff(buffer_.params().outputChanges);
+   flag.setOnOff(buffer_.params().output_changes);
break;
 
case LFUN_CHANGES_MERGE:
@@ -1430,12 +1430,12 @@ void BufferView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
}
 
case LFUN_CHANGES_TRACK:
-   buffer_.params().trackChanges = !buffer_.params().trackChanges;
+   buffer_.params().track_changes = 
!buffer_.params().track_changes;
break;
 
case LFUN_CHANGES_OUTPUT:
-   

[LyX/master] Patch from Enrico fixing a problem with the lyxpak.py script when "Add Bibliography to TOC" is used. Fixes #9044.

2014-04-21 Thread Richard Heck
commit 4540e6c2efa1853c3abe9fc4811301570400a954
Author: Richard Heck 
Date:   Sat Mar 22 20:19:17 2014 -0400

Patch from Enrico fixing a problem with the lyxpak.py script when
"Add Bibliography to TOC" is used. Fixes #9044.

diff --git a/lib/scripts/lyxpak.py b/lib/scripts/lyxpak.py
index f3b8078..ed4f206 100755
--- a/lib/scripts/lyxpak.py
+++ b/lib/scripts/lyxpak.py
@@ -145,6 +145,8 @@ def gather_files(curfile, incfiles, lyx2lyx):
 match = re_options.match(lines[i])
 if match:
 file = match.group(3).strip('"')
+if file.startswith("bibtotoc,"):
+file = file[9:]
 if not os.path.isabs(file):
 file = os.path.join(curdir, file + '.bst')
 if os.path.exists(file):


[LyX/master] OS X: Title bar can be clicked to access file path

2014-04-21 Thread Richard Heck
commit 382b42d6c21ec7dc5e0a2c918b0764ba4fb7ca7d
Author: Benjamin Piwowarski 
Date:   Mon Mar 17 17:46:14 2014 +0100

OS X: Title bar can be clicked to access file path

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index cd5d3ff..6a6c1e8 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1002,6 +1002,9 @@ void GuiView::updateWindowTitle(GuiWorkArea * wa)
return;
setWindowTitle(qt_("LyX: ") + wa->windowTitle());
setWindowIconText(wa->windowIconText());
+#if (QT_VERSION >= 0x040400)
+   setWindowFilePath(wa->bufferView().buffer().absFileName().c_str());
+#endif
 }
 
 


[LyX/master] Tooltip for completion word length.

2014-04-21 Thread Richard Heck
commit 3d6790607ef6dec5c5be8b1a720eb1ca31c3a15b
Author: Richard Heck 
Date:   Thu Mar 20 23:12:09 2014 -0400

Tooltip for completion word length.

diff --git a/src/frontends/qt4/ui/PrefCompletionUi.ui 
b/src/frontends/qt4/ui/PrefCompletionUi.ui
index 010b308..c8cbe1f 100644
--- a/src/frontends/qt4/ui/PrefCompletionUi.ui
+++ b/src/frontends/qt4/ui/PrefCompletionUi.ui
@@ -1,62 +1,63 @@
-
+
+
  PrefCompletionUi
- 
-  
+ 
+  

 0
 0
-400
-404
+412
+468

   
-  
+  

   
-  
-   
+  
+   
 9

-   
+   
 6

-   
-
- 
+   
+
+ 
   In Math
  
- 
+ 
   true
  
- 
-  
-   9
-  
-  
+ 
+  
6
   
+  
+   9
+  
   
-   
-
+   
+
  Show the grey inline completion behind the cursor in math 
mode after the delay.
 
-
+
  Automatic inline completion
 

   
   
-   
-
+   
+
  Show the popup in math mode after the delay.
 
-
+
  Automatic popup
 

   
   
-   
-
+   
+
  Autocorrection
 

@@ -64,47 +65,47 @@
  
 

-   
-
- 
+   
+
+ 
   In Text
  
- 
+ 
   true
  
- 
-  
-   9
-  
-  
+ 
+  
6
   
+  
+   9
+  
   
-   
-
+   
+
  Show the grey inline completion behind the cursor in text 
mode after the delay.
 
-
+
  Automatic inline completion
 

   
   
-   
-
+   
+
  Show the popup after the set delay in text mode.
 
-
+
  Automatic popup
 

   
   
-   
-
+   
+
  Show a small triangle on the cursor if a completion is 
available in text mode.
 
-
+
  Cursor indicator
 

@@ -112,58 +113,58 @@
  
 

-   
-
- 
+   
+
+ 
   General
  
- 
+ 
   true
  
- 
-  
-   9
-  
-  
+ 
+  
6
   
+  
+   9
+  
   
-   
-
- 0
-
-
+   
+
  6
 
+
+ 0
+
 
- 
-  
+ 
+  
After the cursor has not moved for this time, the inline 
completion is shown if it is available.
   
-  
+  
10.000
   
-  
+  
0.100
   
  
 
 
- 
-  
+ 
+  
s inline completion delay
   
-  
+  
inlineDelaySB
   
  
 
 
  
-  
+  
Qt::Horizontal
   
-  
+  

 40
 20
@@ -174,42 +175,42 @@

   
   
-   
-
- 0
-
-
+   
+
  6
 
+
+ 0
+
 
- 
-  
+ 
+  
After the cursor has not moved for this time, the 
completion popup is shown if it is available.
   
-  
+  
10.000
   
-  
+  
0.100
   
  
 
 
- 
-  
+ 
+  
s popup delay
   
-  
+  
popupDelaySB
   
  
 
 
  
-  
+  
Qt::Horizontal
   
-  
+  

 40
 20
@@ -220,16 +221,16 @@

   
   
-   
-
- 0
-
-
+   
+
  6
 
+
+ 0
+
 
- 
-  
+ 
+  
.
   
   
@@ -244,21 +245,24 @@
  
 
 
- 
-  
+ 
+  
+   Shortest word that LyX will offer to compete.
+  
+  
Minimum word length for completion
   
-  
+  
minlengthSB
   
  
 
 
  
-  
+  
Qt::Horizontal
   
-  
+  

 40
 20
@@ -269,37 +273,37 @@

   
   
-   
-
+   
+
  When the TAB completion is not unique, there won't be a delay 
of the popup. It will be shown right away.
 
-
+
  Show popup 

[LyX/master] Whitespace.

2014-04-21 Thread Richard Heck
commit c0be76a2d6bd8646df43e1abd7a1f98dcef7e104
Author: Richard Heck 
Date:   Fri Apr 4 16:52:21 2014 -0400

Whitespace.

diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp
index 98fc589..79924fe 100644
--- a/src/mathed/InsetMathSymbol.cpp
+++ b/src/mathed/InsetMathSymbol.cpp
@@ -29,13 +29,13 @@
 namespace lyx {
 
 InsetMathSymbol::InsetMathSymbol(latexkeys const * l)
-  : sym_(l), h_(0), kerning_(0), scriptable_(false)
+   : sym_(l), h_(0), kerning_(0), scriptable_(false)
 {}
 
 
 InsetMathSymbol::InsetMathSymbol(char const * name)
: sym_(in_word_set(from_ascii(name))), h_(0),
-kerning_(0), scriptable_(false)
+ kerning_(0), scriptable_(false)
 {}
 
 


[LyX/master] Typo.

2014-04-21 Thread Richard Heck
commit cd32001de672fb80d37c5f6febd6e15c25a704aa
Author: Richard Heck 
Date:   Wed Mar 26 15:17:57 2014 -0400

Typo.

diff --git a/src/support/lassert.h b/src/support/lassert.h
index 5a47edf..5e152e0 100644
--- a/src/support/lassert.h
+++ b/src/support/lassert.h
@@ -21,7 +21,7 @@ namespace lyx {
 
 /**
 
-LyX has five different macros that can be used to make assertions. The behave
+LyX has five different macros that can be used to make assertions. They behave
 the same way in devel mode: They assert. The differences between them are how
 they behave in release mode.
 


[LyX/master] Add comment.

2014-04-21 Thread Richard Heck
commit 2928afbd01b58cfe639b8390081c9dfcd4fb3a0f
Author: Juergen Spitzmueller 
Date:   Mon Apr 7 08:46:35 2014 +0200

Add comment.

diff --git a/src/Layout.h b/src/Layout.h
index 913546f..05f6cbd 100644
--- a/src/Layout.h
+++ b/src/Layout.h
@@ -108,13 +108,18 @@ public:
///
typedef std::map LaTeXArgMap;
///
-   LaTeXArgMap args() const;
-   ///
LaTeXArgMap const & latexargs() const { return latexargs_; }
///
LaTeXArgMap const & postcommandargs() const { return postcommandargs_; }
///
LaTeXArgMap const & itemargs() const { return itemargs_; }
+   /// Returns latexargs() + postcommandargs() + itemargs().
+   /// But note that it returns a *copy*, not a reference, so do not do
+   /// anything like:
+   ///   Layout::LaTeXArgMap it = args().begin();
+   ///   Layout::LaTeXArgMap en = args().end();
+   /// Those are iterators for different containers.
+   LaTeXArgMap args() const;
///
int optArgs() const;
///


[LyX/master] Do not allow the manual insertion of a directory (without filename) into the import dialog and thus prevent an assertion.

2014-04-21 Thread Richard Heck
commit df1dbe28ce8b1a095ec9b9de92a1dc697c015c28
Author: Juergen Spitzmueller 
Date:   Sun Mar 23 13:31:21 2014 +0100

Do not allow the manual insertion of a directory (without filename) into 
the import dialog and thus prevent an assertion.

Fixes: #7437

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 4a4ab00..22681f1 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -2121,6 +2121,18 @@ void GuiView::importDocument(string const & argument)
// get absolute path of file
FileName const fullname(support::makeAbsPath(filename));
 
+   // Can happen if the user entered a path into the dialog
+   // (see bug #7437)
+   if (fullname.onlyFileName().empty()) {
+   docstring msg = bformat(_("The file name '%1$s' is invalid!\n"
+ "Aborting import."),
+   from_utf8(fullname.absFileName()));
+   frontend::Alert::error(_("File name error"), msg);
+   message(_("Canceled."));
+   return;
+   }
+
+
FileName const lyxfile(support::changeExtension(fullname.absFileName(), 
".lyx"));
 
// Check if the document already is open


[LyX/master] Fix section-select when issued from outliner

2014-04-21 Thread Richard Heck
commit 8913031fafeb37dda18edc7932e4311f5691aea4
Author: Juergen Spitzmueller 
Date:   Fri Mar 21 10:21:18 2014 +0100

Fix section-select when issued from outliner

Fixes: #8936

diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp
index 3619e6c..2069035 100644
--- a/src/frontends/qt4/TocWidget.cpp
+++ b/src/frontends/qt4/TocWidget.cpp
@@ -187,9 +187,15 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const 
& cmd)
{
case LFUN_CHANGE_ACCEPT:
case LFUN_CHANGE_REJECT:
+   dispatch(item.action());
+   cur.dispatch(tmpcmd);
+   break;
+
case LFUN_SECTION_SELECT:
dispatch(item.action());
cur.dispatch(tmpcmd);
+   // necessary to get the selection drawn.
+   cur.buffer()->changed(true);
break;
 
case LFUN_LABEL_COPY_AS_REFERENCE: {


[LyX/master] Return an error if LaTeX is unable to compile the file.

2014-04-21 Thread Richard Heck
commit 64e0c5589c866a505bebff87da98a08979848516
Author: Richard Heck 
Date:   Wed Mar 19 12:42:57 2014 -0400

Return an error if LaTeX is unable to compile the file.

diff --git a/lib/scripts/legacy_lyxpreview2ppm.py 
b/lib/scripts/legacy_lyxpreview2ppm.py
index fdc5a8e..d16e867 100644
--- a/lib/scripts/legacy_lyxpreview2ppm.py
+++ b/lib/scripts/legacy_lyxpreview2ppm.py
@@ -293,6 +293,8 @@ def legacy_conversion_step1(latex_file, dpi, output_format, 
fg_color, bg_color,
 
 # Compile the latex file.
 latex_status, latex_stdout = run_latex(latex, latex_file)
+if latex_status:
+  return (latex_status, [])
 
 if pdf_output:
 return legacy_conversion_step3(latex_file, dpi, output_format, True, 
skipMetrics)
diff --git a/lib/scripts/lyxpreview2bitmap.py b/lib/scripts/lyxpreview2bitmap.py
index 4a2cddb..ace46d2 100755
--- a/lib/scripts/lyxpreview2bitmap.py
+++ b/lib/scripts/lyxpreview2bitmap.py
@@ -409,6 +409,8 @@ def main(argv):
 
 # Compile the latex file.
 latex_status, latex_stdout = run_latex(latex, latex_file, bibtex)
+if latex_status:
+  return (latex_status, [])
 
 # The dvi output file name
 dvi_file = latex_file_re.sub(".dvi", latex_file)


[LyX/master] Really use qstr to convert a string in a QString

2014-04-21 Thread Richard Heck
commit 54a534c81fe1ff344e4972303cc59aeaac9c6e1b
Author: Benjamin Piwowarski 
Date:   Fri Mar 21 14:15:07 2014 +0100

Really use qstr to convert a string in a QString

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index ce39a6e..4a4ab00 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1006,7 +1006,7 @@ void GuiView::updateWindowTitle(GuiWorkArea * wa)
// Sets the path for the window: this is used by OSX to 
// allow a context click on the title bar showing a menu
// with the path up to the file
-   
setWindowFilePath(toqstr(wa->bufferView().buffer().absFileName().c_str()));
+   setWindowFilePath(toqstr(wa->bufferView().buffer().absFileName()));
 #endif
 }
 


[LyX/master] Fix a bunch of minor issues discovered by the cppcheck script.

2014-04-21 Thread Richard Heck
commit 065db6806771190d12d37d64c4c86f9c5ebaf225
Author: Richard Heck 
Date:   Fri Apr 4 15:54:32 2014 -0400

Fix a bunch of minor issues discovered by the cppcheck script.

diff --git a/src/Author.h b/src/Author.h
index 7d9f3dd..d62fcb0 100644
--- a/src/Author.h
+++ b/src/Author.h
@@ -67,10 +67,10 @@ public:
///
Author const & get(int id) const;
///
-   typedef std::vector Authors;
-   ///
void sort();
///
+   typedef std::vector Authors;
+   ///
Authors::const_iterator begin() const;
///
Authors::const_iterator end() const;
diff --git a/src/Compare.cpp b/src/Compare.cpp
index 1d72ebf..c2a01a6 100644
--- a/src/Compare.cpp
+++ b/src/Compare.cpp
@@ -384,7 +384,7 @@ void Compare::run()
AuthorList const & extra_authors = options_.settings_from_new ?
old_buffer->params().authors() : new_buffer->params().authors();
AuthorList::Authors::const_iterator it = extra_authors.begin();
-   for (; it != extra_authors.end(); it++)
+   for (; it != extra_authors.end(); ++it)
dest_buffer->params().authors().record(*it);

doStatusMessage();
diff --git a/src/ConverterCache.cpp b/src/ConverterCache.cpp
index e384cdc..1451f6e 100644
--- a/src/ConverterCache.cpp
+++ b/src/ConverterCache.cpp
@@ -56,8 +56,7 @@ static FileName cache_dir;
 
 class CacheItem {
 public:
-   CacheItem()
-   {}
+   CacheItem() {}
CacheItem(FileName const & orig_from, string const & to_format,
  time_t t, unsigned long c)
: timestamp(t), checksum(c)
diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index d431965..964b593 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -635,7 +635,6 @@ bool Cursor::posVisRight(bool skip_inset)
Cursor new_cur = *this; // where we will move to
pos_type left_pos; // position visually left of current cursor
pos_type right_pos; // position visually right of current cursor
-   bool new_pos_is_RTL; // is new position we're moving to RTL?
 
getSurroundingPos(left_pos, right_pos);
 
@@ -679,7 +678,7 @@ bool Cursor::posVisRight(bool skip_inset)
// we're currently to the left of 'right_pos'). In
// order to move to the right, it depends whether or
// not the character at 'right_pos' is RTL.
-   new_pos_is_RTL = paragraph().getFontSettings(
+   bool const new_pos_is_RTL = paragraph().getFontSettings(
buffer()->params(), right_pos).isVisibleRightToLeft();
// If the character at 'right_pos' *is* LTR, then in
// order to move to the right of it, we need to be
@@ -735,7 +734,6 @@ bool Cursor::posVisLeft(bool skip_inset)
Cursor new_cur = *this; // where we will move to
pos_type left_pos; // position visually left of current cursor
pos_type right_pos; // position visually right of current cursor
-   bool new_pos_is_RTL; // is new position we're moving to RTL?
 
getSurroundingPos(left_pos, right_pos);
 
@@ -779,7 +777,7 @@ bool Cursor::posVisLeft(bool skip_inset)
// currently to the right of 'left_pos'). In order to
// move to the left, it depends whether or not the
// character at 'left_pos' is RTL.
-   new_pos_is_RTL = paragraph().getFontSettings(
+   bool const new_pos_is_RTL = paragraph().getFontSettings(
buffer()->params(), left_pos).isVisibleRightToLeft();
// If the character at 'left_pos' *is* RTL, then in
// order to move to the left of it, we need to be
diff --git a/src/Floating.cpp b/src/Floating.cpp
index 513c4fa..61b3b15 100644
--- a/src/Floating.cpp
+++ b/src/Floating.cpp
@@ -24,10 +24,6 @@ using namespace std;
 namespace lyx {
 
 
-Floating::Floating()
-{}
-
-
 Floating::Floating(string const & type, string const & placement,
   string const & ext, string const & within,
   string const & style, string const & name,
diff --git a/src/Floating.h b/src/Floating.h
index d1bf74c..b677f0c 100644
--- a/src/Floating.h
+++ b/src/Floating.h
@@ -26,7 +26,7 @@ namespace lyx {
 class Floating {
 public:
///
-   Floating();
+   Floating() {}
///
Floating(std::string const & type, std::string const & placement,
 std::string const & ext, std::string const & within,
diff --git a/src/OutputParams.cpp b/src/OutputParams.cpp
index e74eaa3..cf81253 100644
--- a/src/OutputParams.cpp
+++ b/src/OutputParams.cpp
@@ -20,7 +20,7 @@ namespace lyx {
 
 OutputParams::OutputParams(Encoding const * enc)
: flavor(LATEX), math_flavor(NotApplicable), nice(false), 
is_child(false),
- moving_arg(false), inulemcmd(0), local_font(0), master_language(0),
+ moving_arg(false), intitle(false), inulemcmd(0), local_font(0), 

[LyX/master] Do not store Languages objects in completion words lists

2014-04-21 Thread Richard Heck
commit f8da042312cf9a563f46e4a767fc3c4ae6ecb764
Author: Jean-Marc Lasgouttes 
Date:   Fri Mar 21 12:24:47 2014 +0100

Do not store Languages objects in completion words lists

In the current code each paragraph contains a map, which means that it contains a full copy of the language
object. Since these objects contain translation tables nowadays, this
is a very bad idea.

This patch simply replaces the Language key by a string.

When loading the Userguide on linux/x86_64, the total memory
consumption decreases from 36.27MB to 31.50MB.

diff --git a/src/LyX.cpp b/src/LyX.cpp
index 41c69f7..b784831 100644
--- a/src/LyX.cpp
+++ b/src/LyX.cpp
@@ -33,6 +33,7 @@
 #include "FuncStatus.h"
 #include "HunspellChecker.h"
 #include "KeyMap.h"
+#include "Language.h"
 #include "LaTeXFonts.h"
 #include "LayoutFile.h"
 #include "Lexer.h"
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index ffcb5f2..4d9b37c 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -499,7 +499,7 @@ public:
TextContainer text_;
 
typedef set Words;
-   typedef map LangWordsMap;
+   typedef map LangWordsMap;
///
LangWordsMap words_;
///
@@ -3867,7 +3867,7 @@ void Paragraph::collectWords()
if (cit == d->fontlist_.end())
return;
Language const * lang = cit->font().language();
-   d->words_[*lang].insert(word);
+   d->words_[lang->lang()].insert(word);
}
}
 }
diff --git a/src/Text.cpp b/src/Text.cpp
index c4cac88..cdcc200 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -2120,7 +2120,7 @@ bool Text::completionSupported(Cursor const & cur) const
 
 CompletionList const * Text::createCompletionList(Cursor const & cur) const
 {
-   WordList const * list = theWordList(*cur.getFont().language());
+   WordList const * list = theWordList(cur.getFont().language()->lang());
return new TextCompletionList(cur, list);
 }
 
diff --git a/src/WordList.cpp b/src/WordList.cpp
index 762e1b9..3a095af 100644
--- a/src/WordList.cpp
+++ b/src/WordList.cpp
@@ -12,14 +12,11 @@
 
 #include "WordList.h"
 
-#include "Language.h"
-
 #include "support/convert.h"
 #include "support/debug.h"
 #include "support/docstring.h"
-#include "support/weighted_btree.h"
-
 #include "support/lassert.h"
+#include "support/weighted_btree.h"
 
 #include 
 
@@ -28,12 +25,13 @@ using namespace std;
 namespace lyx {
 
 ///
-map theGlobalWordList;
+typedef map GlobalWordList;
+GlobalWordList theGlobalWordList;
 
 
-WordList * theWordList(Language const & lang)
+WordList * theWordList(string const & lang)
 {
-   map::iterator it = theGlobalWordList.find(lang);
+   GlobalWordList::iterator it = theGlobalWordList.find(lang);
if (it != theGlobalWordList.end())
return it->second;
else
@@ -44,7 +42,7 @@ WordList * theWordList(Language const & lang)
 
 void WordList::cleanupWordLists()
 {
-   map::const_iterator it = 
theGlobalWordList.begin();
+   GlobalWordList::const_iterator it = theGlobalWordList.begin();
for (; it != theGlobalWordList.end(); ++it)
delete it->second;
theGlobalWordList.clear();
diff --git a/src/WordList.h b/src/WordList.h
index b7f88fb..f57f20b 100644
--- a/src/WordList.h
+++ b/src/WordList.h
@@ -14,8 +14,6 @@
 
 #include "support/docstring.h"
 
-#include "Language.h"
-
 namespace lyx {
 
 class WordList {
@@ -41,7 +39,7 @@ private:
Impl * d;
 };
 
-WordList * theWordList(Language const & lang);
+WordList * theWordList(std::string const & lang);
 
 } // namespace lyx
 


[LyX/master] Workaround for #7987: deleted text in change-tracking mode is not found in Advanced F any more.

2014-04-21 Thread Richard Heck
commit cb79658e54e63e6e11417982cd52f8edc1deaa6a
Author: Tommaso Cucinotta 
Date:   Fri Mar 28 22:56:20 2014 +

Workaround for #7987: deleted text in change-tracking mode is not found in 
Advanced F any more.

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index 1b32ae3..0c10e19 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -787,11 +787,11 @@ static docstring stringifySearchBuffer(Buffer & buffer, 
FindAndReplaceOptions co
Paragraph const & par = buffer.paragraphs().at(pit);
LYXERR(Debug::FIND, "Adding to search string: '"
   << par.asString(pos_type(0), par.size(),
-  AS_STR_INSETS | AS_STR_PLAINTEXT,
+  AS_STR_INSETS | 
AS_STR_SKIPDELETE | AS_STR_PLAINTEXT,
   )
   << "'");
str += par.asString(pos_type(0), par.size(),
-   AS_STR_INSETS | AS_STR_PLAINTEXT,
+   AS_STR_INSETS | AS_STR_SKIPDELETE | 
AS_STR_PLAINTEXT,
);
}
}
@@ -1044,7 +1044,7 @@ docstring stringifyFromCursor(DocIterator const & cur, 
int len)
LYXERR(Debug::FIND, "Stringifying with cur: "
   << cur << ", from pos: " << cur.pos() << ", end: " << 
end);
return par.asString(cur.pos(), end,
-   AS_STR_INSETS | AS_STR_PLAINTEXT,
+   AS_STR_INSETS | AS_STR_SKIPDELETE | AS_STR_PLAINTEXT,
);
} else if (cur.inMathed()) {
docstring s;


[LyX/master] Draw a small red frame around preview images that are too small.

2014-04-21 Thread Richard Heck
commit 7765b1c9a8673d06e84709f787b720f4df6cf00f
Author: Richard Heck 
Date:   Wed Mar 19 12:43:21 2014 -0400

Draw a small red frame around preview images that are too small.

diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index e994d44..4c20625 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -44,6 +44,7 @@
 #include "insets/InsetRef.h"
 #include "insets/RenderPreview.h"
 
+#include "graphics/GraphicsImage.h"
 #include "graphics/PreviewImage.h"
 #include "graphics/PreviewLoader.h"
 
@@ -410,7 +411,7 @@ ColorCode InsetMathHull::standardColor() const
 }
 
 
-bool InsetMathHull::previewState(BufferView * bv) const
+bool InsetMathHull::previewState(const BufferView *const bv) const
 {
if (!editing(bv) && RenderPreview::status() == LyXRC::PREVIEW_ON
&& type_ != hullRegexp)
@@ -423,14 +424,24 @@ bool InsetMathHull::previewState(BufferView * bv) const
 }
 
 
+namespace {
+static const int ERROR_FRAME_WIDTH = 2;
+}
+
 void InsetMathHull::metrics(MetricsInfo & mi, Dimension & dim) const
 {
if (previewState(mi.base.bv)) {
preview_->metrics(mi, dim);
-   // insert a one pixel gap in front of the formula
-   dim.wid += 1;
-   if (display())
-   dim.des += displayMargin();
+   if (previewTooSmall(dim)) {
+   // preview image is too small
+   dim.wid += 2 * ERROR_FRAME_WIDTH;
+   dim.asc += 2 * ERROR_FRAME_WIDTH;
+   } else {
+   // insert a one pixel gap in front of the formula
+   dim.wid += 1;
+   if (display())
+   dim.des += displayMargin();
+   }
// Cache the inset dimension.
setDimCache(mi, dim);
return;
@@ -471,10 +482,21 @@ void InsetMathHull::metrics(MetricsInfo & mi, Dimension & 
dim) const
 }
 
 
+bool InsetMathHull::previewTooSmall(Dimension const & dim) const
+{
+   return dim.width() <= 10 && dim.height() <= 10;
+}
+
+
 ColorCode InsetMathHull::backgroundColor(PainterInfo const & pi) const
 {
-   if (previewState(pi.base.bv))
+   BufferView const * const bv = pi.base.bv;
+   if (previewState(bv)) {
+   Dimension const dim = dimension(*pi.base.bv);
+   if (previewTooSmall(dim))
+   return Color_error;
return graphics::PreviewLoader::backgroundColor();
+   }
return Color_mathbg;
 }
 
@@ -482,23 +504,36 @@ ColorCode InsetMathHull::backgroundColor(PainterInfo 
const & pi) const
 void InsetMathHull::drawBackground(PainterInfo & pi, int x, int y) const
 {
Dimension const dim = dimension(*pi.base.bv);
+   if (previewTooSmall(dim)) {
+   pi.pain.fillRectangle(x, y - 2 * ERROR_FRAME_WIDTH, 
+   dim.wid, dim.asc + dim.des, backgroundColor(pi));
+   return;
+   } 
pi.pain.fillRectangle(x + 1, y - dim.asc + 1, dim.wid - 2,
-   dim.asc + dim.des - 1, pi.backgroundColor(this));
+   dim.asc + dim.des - 1, backgroundColor(pi));
 }
 
 
 void InsetMathHull::draw(PainterInfo & pi, int x, int y) const
 {
-   use_preview_ = previewState(pi.base.bv);
+   BufferView const * const bv = pi.base.bv;
+   use_preview_ = previewState(bv);
 
if (type_ == hullRegexp) {
-   Dimension const dim = dimension(*pi.base.bv);
+   Dimension const dim = dimension(*bv);
pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
dim.width() - 2, dim.height() - 2, Color_regexpframe);
}
+
if (use_preview_) {
-   // one pixel gap in front
-   preview_->draw(pi, x + 1, y);
+   Dimension const dim = dimension(*bv);
+   if (previewTooSmall(dim)) {
+   // we have an extra frame
+   preview_->draw(pi, x + ERROR_FRAME_WIDTH, y);
+   } else {
+   // one pixel gap in front
+   preview_->draw(pi, x + 1, y);
+   }
setPosCache(pi, x, y);
return;
}
diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h
index af00eaf..0cd 100644
--- a/src/mathed/InsetMathHull.h
+++ b/src/mathed/InsetMathHull.h
@@ -271,7 +271,9 @@ protected:
///
void handleFont2(Cursor & cur, docstring const & arg);
///
-   bool previewState(BufferView * bv) const;
+   bool previewState(BufferView const * const bv) const;
+   ///
+   bool previewTooSmall(Dimension const & dim) const;
 };
 
 


  1   2   >