]> git.lyx.org Git - lyx.git/commitdiff
Add layout tag that determines if/when a paragraph can be indented.
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 29 May 2014 12:10:32 +0000 (14:10 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 29 May 2014 12:10:32 +0000 (14:10 +0200)
Fixes: #7327, #7458, #8670
32 files changed:
lib/doc/Customization.lyx
lib/layouts/IEEEtran.layout
lib/layouts/aastex.layout
lib/layouts/agutex.layout
lib/layouts/amsdefs.inc
lib/layouts/apa.layout
lib/layouts/apa6.layout
lib/layouts/beamer.layout
lib/layouts/cl2emult.layout
lib/layouts/egs.layout
lib/layouts/elsarticle.layout
lib/layouts/ijmpc.layout
lib/layouts/ijmpd.layout
lib/layouts/iopart.layout
lib/layouts/jasatex.layout
lib/layouts/kluwer.layout
lib/layouts/llncs.layout
lib/layouts/moderncv.layout
lib/layouts/powerdot.layout
lib/layouts/siamltex.layout
lib/layouts/simplecv.layout
lib/layouts/stdlayouts.inc
lib/layouts/stdlists.inc
lib/layouts/stdsections.inc
lib/layouts/stdstruct.inc
lib/layouts/svcommon.inc
lib/scripts/layout2layout.py
src/Layout.cpp
src/Layout.h
src/LayoutEnums.h
src/Paragraph.cpp
src/frontends/qt4/GuiParagraph.cpp

index 41eaf633560531a5a2771fd1767187b99c961594..f25ca0b28b7a9837b53d7813ce68259d7cb6b707 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.1 created this file. For more info see http://www.lyx.org/
-\lyxformat 474
+\lyxformat 476
 \begin_document
 \begin_header
 \textclass scrbook
@@ -145,11 +145,12 @@ End
 \papercolumns 1
 \papersides 2
 \paperpagestyle headings
-\tracking_changes false
+\tracking_changes true
 \output_changes false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict true
+\author -712698321 "Jürgen Spitzmüller" 
 \end_header
 
 \begin_body
@@ -5850,6 +5851,10 @@ latex foiltex.ins
 \begin_layout Enumerate
 Now you need to decide if the package should be available for all users
  or only for you.
+\begin_inset Separator parbreak
+\end_inset
+
+
 \end_layout
 
 \begin_deeper
@@ -6144,6 +6149,10 @@ latex
 \begin_layout Enumerate
 Now one only need to tell LaTeX that there are new files.
  This depends on the used LaTeX-Distribution:
+\begin_inset Separator parbreak
+\end_inset
+
+
 \end_layout
 
 \begin_deeper
@@ -10495,6 +10504,10 @@ EndArgument
 
 .
  So a command with two optional arguments has:
+\begin_inset Separator parbreak
+\end_inset
+
+
 \end_layout
 
 \begin_deeper
@@ -12553,6 +12566,10 @@ Itemize, Bibliography
 \end_inset
 
 ]
+\begin_inset Separator parbreak
+\end_inset
+
+
 \end_layout
 
 \begin_deeper
@@ -12973,6 +12990,10 @@ LatexType
 \end_inset
 
 
+\begin_inset Separator parbreak
+\end_inset
+
+
 \end_layout
 
 \begin_deeper
@@ -13430,6 +13451,10 @@ Static
 \end_inset
 
 The kind of margin that the style has on the left side.
+\begin_inset Separator parbreak
+\end_inset
+
+
 \end_layout
 
 \begin_deeper
@@ -14504,6 +14529,128 @@ int=3
 \series default
  The level of the style in the table of contents.
  This is used for automatic numbering of section headings.
+\change_inserted -712698321 1401363541
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted -712698321 1401363906
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1401363547
+ToggleIndent
+\end_layout
+
+\end_inset
+
+ [
+\emph on
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1401363664
+
+\emph on
+default
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\emph default
+, 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1401363669
+always
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+, 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1401363675
+never
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+] This tag determines whether the first line indentation of this paragraph
+ can be toggled via the Paragraph settings dialog.
+ If 
+\emph on
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1401363761
+
+\emph off
+default
+\end_layout
+
+\end_inset
+
+
+\emph default
+ is set, indentation can be toggled if the document settings use 
+\begin_inset Quotes eld
+\end_inset
+
+indent
+\begin_inset Quotes erd
+\end_inset
+
+ paragraph style, with 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1401363844
+always
+\end_layout
+
+\end_inset
+
+, indentation can always be toggled, notwithstanding the document settings,
+ with 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1401363901
+never
+\end_layout
+
+\end_inset
+
+, indentation can never be toggled.
+\change_unchanged
+
 \end_layout
 
 \begin_layout Description
@@ -14602,6 +14749,10 @@ theorems-ams.inc
 
 \begin_layout LyX-Code
 Preamble
+\begin_inset Separator parbreak
+\end_inset
+
+
 \end_layout
 
 \begin_deeper
@@ -17314,6 +17465,10 @@ LatexType
 \end_inset
 
 
+\begin_inset Separator parbreak
+\end_inset
+
+
 \end_layout
 
 \begin_deeper
@@ -18249,6 +18404,10 @@ LabelStringAppendix
 
  to the same value.
  The following special constructs can be used in the string:
+\begin_inset Separator parbreak
+\end_inset
+
+
 \end_layout
 
 \begin_deeper
index bdd44b5d9f6b7afa74b0ddd8d95c75b21517149a..7d6e2a548c105db65b9458e47b1e582b38c3f6cc 100644 (file)
@@ -345,6 +345,7 @@ Style Bibliography
   LatexName    thebibliography
   Category     BackMatter
   NextNoIndent 1
+  ToggleIndent Never
   LeftMargin   MM
   ParSkip      0.4
   ItemSep      0
index 9c3b8668813b14142c4e30a249b91e25e14fa9a1..6187e2c87e8b68c0e1a9c583d3a093c4e43f25e1 100644 (file)
@@ -405,6 +405,7 @@ Style References
        LatexName       thebibliography
        Category        BackMatter
        NextNoIndent    1
+       ToggleIndent    Never
        LeftMargin      MM
        ParSkip         0.4
        ItemSep         0
index 6cf2882eb8c163dbf76fd6683ac6bf31bf0b00b9..514d45a7f156fab9aa0bd3a0f384a4f0595d9aed 100644 (file)
@@ -210,6 +210,7 @@ Style Bibliography
        LatexName       thebibliography
        Category        BackMatter
        NextNoIndent    1
+       ToggleIndent    Never
        LeftMargin      MM
        ParSkip         0.4
        ItemSep         0
index fcc1a29d83bf391b07c3bb3ae81ae52daae2c62c..1e3997661749d3a5ac1c831ec3d8af07ef704186 100644 (file)
@@ -202,6 +202,7 @@ Style Bibliography
        LatexType             Bib_Environment
        LatexName             thebibliography
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MM
        ParSkip               0.4
        ItemSep               0
index 578918c07af6abbfb05c6f1b286755ed38b07850..6df439d9f88618d8427b607ab8c01915fc784584 100644 (file)
@@ -357,6 +357,7 @@ Style Itemize
        LatexType             Item_Environment
        LatexName             APAitemize
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MMN
        LabelSep              xx
        ItemSep               0.2
@@ -379,6 +380,7 @@ Style Enumerate
        LatexType             Item_Environment
        LatexName             APAenumerate
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MMN
        LabelSep              xx
        ParSkip               0.0
index f8c22f96c8efa674c5d35bb648af6ea645c5e236..12f81cceb6bef55b98da21e3e0538b3bb8d0f1a4 100644 (file)
@@ -457,6 +457,7 @@ Style Itemize
        LatexType             Item_Environment
        LatexName             APAitemize
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MMN
        LabelSep              xx
        ItemSep               0.2
@@ -480,6 +481,7 @@ Style Enumerate
        LatexType             Item_Environment
        LatexName             APAenumerate
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MMN
        LabelSep              xx
        ParSkip               0.0
index f5dfe60a74f7ce7e703f7139827425fe1e1f65b6..b02f1625046307c784805aad57461f9332786be7 100644 (file)
@@ -100,6 +100,7 @@ Style Itemize
     RightDelim     >
   EndArgument
   NextNoIndent     1
+  ToggleIndent     Never
   LeftMargin       MMN
   LabelSep         xx
   ItemSep          0.2
@@ -137,6 +138,7 @@ Style Enumerate
     RightDelim     >
   EndArgument
   NextNoIndent     1
+  ToggleIndent     Never
   LeftMargin       MMN
   LabelSep         xx
   ParSkip          0.0
@@ -209,6 +211,7 @@ Style Part
   EndArgument
   NeedProtect      1
   NextNoIndent     1
+  ToggleIndent     Never
   Labelsep         xx
   ParSkip          0.4
   TopSep           4
@@ -236,6 +239,7 @@ Style Section
   LatexName        section
   NeedProtect      1
   NextNoIndent     1
+  ToggleIndent     Never
   LabelSep         xx
   ParSkip          0.4
   TopSep           2
@@ -293,6 +297,7 @@ Style Subsection
   LatexName        subsection
   NeedProtect      1
   NextNoIndent     1
+  ToggleIndent     Never
   LabelSep         xx
   ParSkip          0.4
   TopSep           2
@@ -350,6 +355,7 @@ Style Subsubsection
   LatexName        subsubsection
   NeedProtect      1
   NextNoIndent     1
+  ToggleIndent     Never
   LabelSep         xx
   ParSkip          0.4
   TopSep           2
@@ -596,6 +602,7 @@ Style Column
   LabelType        Static
   LabelSep         xx
   LabelString      "Start column (increase depth!), width:"
+  ToggleIndent     Never
   Argument 1
     MenuString     "Column Options"
     LabelString    "Options"
@@ -1048,6 +1055,7 @@ Style Bibliography
   LatexType        Bib_Environment
   LatexName        thebibliography
   NextNoIndent     1
+  ToggleIndent     Never
   LeftMargin       MM
   ParSkip          0.4
   ItemSep          0
@@ -1075,6 +1083,7 @@ Style Quotation
   LatexType        Environment
   LatexName        quotation
   NextNoIndent     1
+  ToggleIndent     Always
   LeftMargin       MMM
   RightMargin      MMM
   ParIndent        MM
@@ -1100,6 +1109,7 @@ Style Quote
   LatexType        Environment
   LatexName        quote
   NextNoIndent     1
+  ToggleIndent     Never
   LeftMargin       MMM
   RightMargin      MMM
   TopSep           0.5
index e012f996e3c900d6daa998a7a0a62382eaa4dfd1..5ff8ed32eb888a51779d8ad4692bd3de5f6a7b56 100644 (file)
@@ -109,6 +109,7 @@ Style Bibliography
        LatexType             Bib_Environment
        LatexName             thebibliography
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MM
        ParSkip               0.4
        ItemSep               0
index 18cac86dcc77c17b349219478af6668ce7aef36f..6772b508d54e2fee60bc4ea4b0b51d11f09d9435 100644 (file)
@@ -104,6 +104,7 @@ Style Quotation
        LatexType             Environment
        LatexName             quotation
        NextNoIndent          1
+       ToggleIndent          Always
        LeftMargin            MMM
        RightMargin           MMM
        ParIndent             MM
@@ -122,6 +123,7 @@ Style Quote
        LatexType             Environment
        LatexName             quote
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MMM
        RightMargin           MMM
        TopSep                0.5
@@ -180,6 +182,7 @@ Style Itemize
        LatexType             Item_Environment
        LatexName             itemize
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MMN
        LabelSep              xx
        ItemSep               0.2
@@ -201,6 +204,7 @@ Style Description
        LatexType             Item_environment
        LatexName             description
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MM
        LabelSep              xxx
        ParSkip               0.4
@@ -576,6 +580,7 @@ Style Bibliography
        LatexType             Bib_Environment
        LatexName             thebibliography
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MM
        ParSkip               0.4
        ItemSep               0
@@ -586,7 +591,7 @@ Style Bibliography
        AlignPossible         Block, Left
        LabelType             Bibliography
        LabelString           "References"
-       LabelBottomSep    0.7
+       LabelBottomSep        0.7
        LabelFont
          Series              Bold
        EndFont
index a5720e93c7a4cafb03fadf4f5ed0cf8f4ffe81b8..074cd5e55b61bffbceea2437cfd0d2dc2d0337e6 100644 (file)
@@ -310,6 +310,7 @@ Style Bibliography
        LatexName       thebibliography
        Category        BackMatter
        NextNoIndent    1
+       ToggleIndent    Never
        LeftMargin      MM
        ParSkip         0.4
        ItemSep         0
index bca85d36586e203659106a10a5b6b9a74e112772..f49ac244600549efea99c1c66de8e1ab83b96aaa 100644 (file)
@@ -286,6 +286,7 @@ Style ItemList
   LatexType    Item_Environment
   LatexName    itemlist
   NextNoIndent 1
+  ToggleIndent Never
   LeftMargin   MMN
   LabelSep     xx
   ItemSep      0.2
@@ -449,6 +450,7 @@ Style Bibliography
   LatexName    thebibliography
   Category     BackMatter
   NextNoIndent 1
+  ToggleIndent Never
   LeftMargin   MM
   ParSkip      0.4
   ItemSep      0
index 008a752f769e8deb3f708008708d229d9eeb7fb3..f7c5c814538d8066fa5be9577b984367b486b1fc 100644 (file)
@@ -289,6 +289,7 @@ Style ItemList
   LatexType    Item_Environment
   LatexName    itemlist
   NextNoIndent 1
+  ToggleIndent Never
   LeftMargin   MMN
   LabelSep     xx
   ItemSep      0.2
@@ -462,6 +463,7 @@ Style Bibliography
   LatexName    thebibliography
   Category     BackMatter
   NextNoIndent 1
+  ToggleIndent Never
   LeftMargin   MM
   ParSkip      0.4
   ItemSep      0
index 55d1941354a0611a60252d7e2a5b9257fc27a71a..3ecd4b17dfc631233a2316734859821e44f61ec9 100644 (file)
@@ -269,6 +269,7 @@ Style "Bibliography (plain)"
        LatexName       thebibliography
        Category        BackMatter
        NextNoIndent    1
+       ToggleIndent    Never
        LeftMargin      MM
        ParSkip         0.4
        ItemSep         0
index a67dea4def4dd3f70de0ec879f64ad23cc2523f1..ea102a25fbe1c2b6f5ada72b466abacafcf04d2d 100644 (file)
@@ -272,6 +272,7 @@ Style Bibliography
        LatexName       thebibliography
        Category        BackMatter
        NextNoIndent    1
+       ToggleIndent    Never
        LeftMargin      MM
        ParSkip         0.4
        ItemSep         0
index 872af1eee1b0aafc5098bb6727c5b5d90adcd195..8ce45daa91f73da8b9e4221626230cf7b58d5ac1 100644 (file)
@@ -349,6 +349,7 @@ Style References
        LatexType             Bib_Environment
        LatexName             thebibliography
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MM
        ParSkip               0.4
        ItemSep               0
index a8b07f656ea6c6ea355b50ef8d30470444521f72..0cede75f75fa25bb9b365e73bd6acd7c0b4945cc 100644 (file)
@@ -272,6 +272,7 @@ Style Bibliography
        LatexType             Bib_Environment
        LatexName             thebibliography
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MM
        ParSkip               0.4
        ItemSep               0
@@ -282,7 +283,7 @@ Style Bibliography
        AlignPossible         Block, Left
        LabelType             Bibliography
        LabelString           "References"
-       LabelBottomSep    0.7
+       LabelBottomSep        0.7
        LabelFont
          Series              Bold
        EndFont
index 61d2e593ef96e2aa2572008de7a2a27c533e22b6..1d204e89ab884430e295c6fcf76bdf82a39efbfd 100644 (file)
@@ -465,6 +465,7 @@ Style Bibliography
        LatexType       Bib_Environment
        LatexName       thebibliography
        NextNoIndent    1
+       ToggleIndent    Never
        LeftMargin      MM
        ParSkip         0.4
        ItemSep         0
index 7a3f19c98a9d9cc83f43aeba0d1b5c4c4b747898..60824e93a1bd6aa3fb86c67678fb5e22e8dd1e19 100644 (file)
@@ -257,6 +257,7 @@ Style Itemize
   LatexType     Item_Environment
   LatexName     itemize
   NextNoIndent  1
+  ToggleIndent  Never
   LeftMargin    MMN
   LabelSep      xx
   ItemSep       0.2
@@ -305,6 +306,7 @@ Style Enumerate
   LatexType     Item_Environment
   LatexName     enumerate
   NextNoIndent  1
+  ToggleIndent  Never
   LeftMargin    MMN
   LabelSep      xx
   ParSkip       0.0
@@ -356,6 +358,7 @@ Style Bibliography
   LatexType     Bib_Environment
   LatexName     thebibliography
   NextNoIndent  1
+  ToggleIndent  Never
   LeftMargin    MM
   ParSkip       0.4
   ItemSep       0
@@ -378,6 +381,7 @@ Style Quotation
   LatexType     Environment
   LatexName     quotation
   NextNoIndent  1
+  ToggleIndent  Always
   LeftMargin    MMM
   RightMargin   MMM
   ParIndent     MM
@@ -399,6 +403,7 @@ Style Quote
   LatexType     Environment
   LatexName     quote
   NextNoIndent  1
+  ToggleIndent  Never
   LeftMargin    MMM
   RightMargin   MMM
   TopSep        0.5
index 282eee0442a1ed9ddb64d943ce0a70777003f8ab..a4f6f585e21edddf0fdf6df66a2141a1a7f89c8d 100644 (file)
@@ -328,6 +328,7 @@ Style Bibliography
        LatexType             Bib_Environment
        LatexName             thebibliography
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MM
        ParSkip               0.4
        ItemSep               0
index ee4b0333aeae3444b095f41b81c870347a499f43..9fb19923e9f0c818e7484a411686db0d0276f53d 100644 (file)
@@ -89,6 +89,7 @@ Style Itemize
        LatexType             Item_Environment
        LatexName             itemize
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MMN
        LabelSep              xx
        ItemSep               0.2
@@ -157,6 +158,7 @@ Style Bibliography
        LatexType             Bib_Environment
        LabelType             Bibliography
        LabelBottomSep        0.7
+       ToggleIndent          Never
        LabelFont
          Size                Tiny
        EndFont
index 1e6deb8d2688abb7f1bff452979022ee212f85a0..73d928d8b397a441ca2c6502158de17d34ae67e8 100644 (file)
@@ -15,6 +15,7 @@ Style Quotation
        LatexType             Environment
        LatexName             quotation
        NextNoIndent          1
+       ToggleIndent          Always
        LeftMargin            MMM
        RightMargin           MMM
        ParIndent             MM
@@ -36,6 +37,7 @@ Style Quote
        LatexType             Environment
        LatexName             quote
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MMM
        RightMargin           MMM
        TopSep                0.5
index de794b6f8562d3f21d9f9470ec28e384326877fc..0d0dca1395e1cf16eb1067e4c3b13be282c2f277 100644 (file)
@@ -16,6 +16,7 @@ Style Itemize
        LatexType             Item_Environment
        LatexName             itemize
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MMN
        LabelSep              xx
        ItemSep               0.2
@@ -41,6 +42,7 @@ Style Enumerate
        LatexType             Item_Environment
        LatexName             enumerate
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MMN
        LabelSep              xx
        ParSkip               0.0
index 82c3cec930f13e76247e4ce873e6c903e5327bec..37bac0413ef997c5b6b187f7924f040d72428b58 100644 (file)
@@ -20,6 +20,7 @@ Style Part
        LatexName             part
        NeedProtect           1
        NextNoIndent          1
+       ToggleIndent          Never
        Labelsep              xxx
        ParSkip               0.4
        TopSep                4
@@ -51,6 +52,7 @@ Style Chapter
        LatexName             chapter
        NeedProtect           1
        NextNoIndent          1
+       ToggleIndent          Never
        ParSkip               0.4
        TopSep                4
        BottomSep             0.8
@@ -78,6 +80,7 @@ Style Section
        LatexName             section
        NeedProtect           1
        NextNoIndent          1
+       ToggleIndent          Never
        LabelSep              xxx
        ParSkip               0.4
        TopSep                1.3
index da792408dfaa2fe81f09ddd10a71982dbf2d02c6..6583e1afbf076b0dcbaf19c69b9b05f06f58324a 100644 (file)
@@ -15,6 +15,7 @@ Style Abstract
        LatexName             abstract
        Category              FrontMatter
        NextNoIndent          1
+       ToggleIndent          Always
        LeftMargin            MMM
        RightMargin           MMM
        ParIndent             MM
@@ -56,6 +57,7 @@ Style Bibliography
        LatexName             thebibliography
        Category              BackMatter
        NextNoIndent          1
+       ToggleIndent          Never
        LeftMargin            MM
        ParSkip               0.4
        ItemSep               0
index dd139ad9223bf02f232ac97f26d6cf4143717ed5..7b352220cd9e36bcbad3cb041a50fd0ed390b489 100644 (file)
@@ -577,6 +577,7 @@ Style Bibliography
        LatexName       thebibliography
        Category        BackMatter
        NextNoIndent    1
+       ToggleIndent    Never
        LeftMargin      MM
        ParSkip         0.4
        ItemSep         0
index 1326a81f8faba7572dfe077ac974091bf7ecbf98..62d5d6d6a6a797c38858240ebca3462bedfc909b 100644 (file)
@@ -168,6 +168,9 @@ import os, re, string, sys
 # Incremented to format 50, 9 May 2014 by forenr
 # Removal of "Separator" layouts
 
+# Incremented to format 51, 29 May 2014 by spitz
+# New Style tag "ToggleIndent"
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
@@ -399,6 +402,11 @@ def convert(lines):
                 i += 1
             continue
 
+        if format == 50:
+            # nothing to do.
+            i += 1
+            continue
+
         if format == 49:
             separator = []
 
index b7b7d1db8236bab800b734eca351295314b99beb..bb312877667c50908779db6ebdca0d727aafd446 100644 (file)
@@ -105,6 +105,7 @@ enum LayoutTags {
        LT_RESETARGS,
        LT_RIGHTDELIM,
        LT_FORCELOCAL,
+       LT_TOGGLE_INDENT,
        LT_INTITLE // keep this last!
 };
 
@@ -148,6 +149,7 @@ Layout::Layout()
        spellcheck = true;
        forcelocal = 0;
        itemcommand_ = "item";
+       toggle_indent = ITOGGLE_DOCUMENT_DEFAULT;
 }
 
 
@@ -243,6 +245,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
                { "spellcheck",     LT_SPELLCHECK },
                { "textfont",       LT_TEXTFONT },
                { "toclevel",       LT_TOCLEVEL },
+               { "toggleindent",   LT_TOGGLE_INDENT },
                { "topsep",         LT_TOPSEP }
        };
 
@@ -383,6 +386,19 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
                        lex >> nextnoindent;
                        break;
 
+               case LT_TOGGLE_INDENT: {
+                       string tog;
+                       lex >> tog;
+                       tog = support::ascii_lowercase(tog);
+                       if (tog == "always")
+                               toggle_indent = ITOGGLE_ALWAYS;
+                       else if (tog == "never")
+                               toggle_indent = ITOGGLE_NEVER;
+                       else
+                               toggle_indent = ITOGGLE_DOCUMENT_DEFAULT;
+                       break;
+               }
+
                case LT_COMMANDDEPTH:
                        lex >> commanddepth;
                        break;
index d0abcec6abb2d7966062e8be2c9b9d3e8ba19056..0f5ebbf86b43a20cd6eb8d8be73c8462406c4987 100644 (file)
@@ -280,6 +280,8 @@ public:
        ///
        bool nextnoindent;
        ///
+       ToggleIndentation toggle_indent;
+       ///
        bool free_spacing;
        ///
        bool pass_thru;
index c90c96850e079ff1b873b7e998cad8cee067e8d7..8bb206c6a98e46c46b4fa0b21c6970872ddbc1fa 100644 (file)
@@ -64,6 +64,17 @@ enum LyXAlignment {
        LYX_ALIGN_DECIMAL = 64
 };
 
+
+/// Paragraph indendation control
+enum ToggleIndentation {
+       /// Indentation can be toggled if document uses "indent" paragraph style
+       ITOGGLE_DOCUMENT_DEFAULT = 1,
+       /// Indentation cannot be toggled
+       ITOGGLE_NEVER,
+       /// Indentation can always be toggled
+       ITOGGLE_ALWAYS
+};
+
 ///
 inline void operator|=(LyXAlignment & la1, LyXAlignment la2)
 {
index c551ea022cccce1c7799b19f18cdd8a5b5913c5a..75f0171bf1a4863b7059e57b1784462541ede7f3 100644 (file)
@@ -2237,7 +2237,8 @@ int Paragraph::Private::startTeXParParams(BufferParams const & bparams,
 {
        int column = 0;
 
-       if (params_.noindent() && !layout_->pass_thru) {
+       if (params_.noindent() && !layout_->pass_thru
+           && (layout_->toggle_indent != ITOGGLE_NEVER)) {
                os << "\\noindent ";
                column += 10;
        }
index 306085dd08d962a50289b03dc3541718d358965a..975b6512b46d51e4ed90fed7412829238eec338b 100644 (file)
@@ -227,7 +227,7 @@ void GuiParagraph::applyView()
 
        // label width
        params_.labelWidthString(qstring_to_ucs4(labelWidth->text()));
-       // indendation
+       // indentation
        params_.noindent(!indentCB->isChecked());
 
        dispatchParams();
@@ -336,8 +336,11 @@ bool GuiParagraph::haveMultiParSelection() const
        
 bool GuiParagraph::canIndent() const
 {
-       return buffer().params().paragraph_separation
-               == BufferParams::ParagraphIndentSeparation;
+       Layout const lay = bufferview()->cursor().innerParagraph().layout();
+       if (buffer().params().paragraph_separation
+               == BufferParams::ParagraphIndentSeparation)
+               return (lay.toggle_indent != ITOGGLE_NEVER);
+       return (lay.toggle_indent == ITOGGLE_ALWAYS);
 }