LyX file-format changes
-----------------------
-2008-03-01 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
- * Format incremented to 316: support for subfloats (subfig package).
+2008-03-02 Uwe Stöhr <uwestoehr@web.de>
+ * Format incremented to 317: support floating placements for wrap floats
+
+2008-03-02 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+ * Format incremented to 316: support for subfloats (subfig package)
2008-02-18 Richard Heck <rgheck@comcast.net>
* Format incremented to 315: support for column separation in page margins
* Format incremented to 308: support for Serbian (Latin)
2007-12-05 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
- * Format incremented to 307: support for \slash and \nobreakdash.
+ * Format incremented to 307: support for \slash and \nobreakdash
2007-12-05 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 306: support for Interlingua
* Format incremented to 291: Support for Vietnamese.
2007-10-03 Uwe Stöhr <uwestoehr@web.de>
- * Format incremented to 290: Add table wrap floats.
+ * Format incremented to 290: Add table wrap floats
2007-10-03 Martin Vermeer <martin.vermeer@tkk.fi>
* Format incremented to 289: make Index a collapsable inset.
of its options.
2007-09-11 Bo Peng <ben.bob@gmail.com>
- * Format incremented to 285: Tweaks to embedded file format.
+ * Format incremented to 285: Tweaks to embedded file format
Remove inzip parameter from graphics insets.
2007-09-09 Helge Hafting <helge.hafting@aitel.hist.no>
2007-08-29 Richard Heck <rgheck@comcast.net>
- * format incremented to 281: allow modules for layout files.
+ * format incremented to 281: allow modules for layout files
2007-08-17 Martin Vermeer <martin.vermeer@tkk.fi>
("1_3", [221], minor_versions("1.3" , 7)),
("1_4", range(222,246), minor_versions("1.4" , 5)),
("1_5", range(246,277), minor_versions("1.5" , 2)),
- ("1_6", range(277,317), minor_versions("1.6" , 0))] # jspitzm: subfig
+ ("1_6", range(277,318), minor_versions("1.6" , 0))] # Uwe: wrap placement
def formats_list():
i = i + 1
+def revert_wrapplacement(document):
+ "Revert placement options wrap floats (wrapfig)."
+ i = 0
+ while True:
+ i = find_token(document.body, "lines", i)
+ if i == -1:
+ return
+ j = find_token(document.body, "placement", i+1)
+ if j != i + 1:
+ document.warning("Malformed LyX document: Couldn't find placement parameter of wrap float.")
+ return
+ document.body[j] = document.body[j].replace("placement O", "placement o")
+ document.body[j] = document.body[j].replace("placement I", "placement i")
+ document.body[j] = document.body[j].replace("placement L", "placement l")
+ document.body[j] = document.body[j].replace("placement R", "placement r")
+ i = i + 1
+
+
##
# Conversion hub
#
[313, [convert_module_names]],
[314, []],
[315, []],
- [316, [convert_subfig]]
+ [316, [convert_subfig]],
+ [317, []]
]
-revert = [[315, [revert_subfig]],
+revert = [[316, [revert_wrapplacement]],
+ [315, [revert_subfig]],
[314, [revert_colsep]],
[313, []],
[312, [revert_module_names]],
namespace {
-int const LYX_FORMAT = 316; // JSpitzm: subfig support
+int const LYX_FORMAT = 317; // Uwe Stöhr: float placement support for wrap floats
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
+ connect(valignCO, SIGNAL(highlighted(QString)),
+ this, SLOT(change_adaptor()));
+ connect(floatCB, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
connect(widthED, SIGNAL(textChanged(QString)),
this, SLOT(change_adaptor()));
connect(widthUnitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SLOT(change_adaptor()));
- connect(valignCO, SIGNAL(highlighted(QString)),
- this, SLOT(change_adaptor()));
connect(overhangCB, SIGNAL(stateChanged(int)),
this, SLOT(change_adaptor()));
connect(overhangED, SIGNAL(textChanged(QString)),
bc().setApply(applyPB);
bc().setCancel(closePB);
+ bc().addReadOnly(valignCO);
+ bc().addReadOnly(floatCB);
bc().addReadOnly(widthED);
bc().addReadOnly(widthUnitLC);
- bc().addReadOnly(valignCO);
bc().addReadOnly(overhangCB);
bc().addReadOnly(overhangED);
bc().addReadOnly(overhangUnitLC);
// in InsetWrap.cpp
params_.lines = 0;
+ bool floatOn = false;
+ if (floatCB->checkState() == Qt::Checked)
+ floatOn = true;
switch (valignCO->currentIndex()) {
case 0:
- params_.placement = "o";
+ if (floatOn)
+ params_.placement = "O";
+ else
+ params_.placement = "o";
break;
case 1:
- params_.placement = "i";
+ if (floatOn)
+ params_.placement = "I";
+ else
+ params_.placement = "i";
break;
case 2:
- params_.placement = "l";
+ if (floatOn)
+ params_.placement = "L";
+ else
+ params_.placement = "l";
break;
case 3:
- params_.placement = "r";
+ if (floatOn)
+ params_.placement = "R";
+ else
+ params_.placement = "r";
break;
}
}
linesCB->setCheckState(Qt::Checked);
int item = 0;
- if (params_.placement == "i")
+ if (params_.placement == "i" || params_.placement == "I")
item = 1;
- else if (params_.placement == "l")
+ else if (params_.placement == "l" || params_.placement == "L")
item = 2;
- else if (params_.placement == "r")
+ else if (params_.placement == "r" || params_.placement == "R")
item = 3;
valignCO->setCurrentIndex(item);
+
+ if (params_.placement == "O" || params_.placement == "I"
+ || params_.placement == "L" || params_.placement == "R")
+ floatCB->setCheckState(Qt::Checked);
}
<bool>true</bool>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
<number>9</number>
</property>
- <property name="spacing" >
+ <property name="topMargin" >
+ <number>9</number>
+ </property>
+ <property name="rightMargin" >
+ <number>9</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>9</number>
+ </property>
+ <property name="horizontalSpacing" >
+ <number>6</number>
+ </property>
+ <property name="verticalSpacing" >
<number>6</number>
</property>
<item row="3" column="2" >
<item row="1" column="3" >
<widget class="LengthCombo" name="widthUnitLC" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>3</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1" colspan="2" >
<widget class="QLineEdit" name="widthED" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="4" column="0" colspan="4" >
<layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
<property name="spacing" >
<number>6</number>
</property>
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
<item>
<widget class="QPushButton" name="restorePB" >
<property name="toolTip" >
<bool>false</bool>
</property>
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<bool>false</bool>
</property>
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>13</hsizetype>
- <vsizetype>13</vsizetype>
+ <sizepolicy vsizetype="Ignored" hsizetype="Ignored" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
+ <item row="0" column="3" >
+ <widget class="QCheckBox" name="floatCB" >
+ <property name="toolTip" >
+ <string>by checking this the placement can float</string>
+ </property>
+ <property name="text" >
+ <string>&float</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<customwidgets>
</customwidgets>
<tabstops>
<tabstop>valignCO</tabstop>
+ <tabstop>floatCB</tabstop>
<tabstop>widthED</tabstop>
<tabstop>widthUnitLC</tabstop>
<tabstop>overhangCB</tabstop>
<tabstop>overhangUnitLC</tabstop>
<tabstop>linesCB</tabstop>
<tabstop>linesSB</tabstop>
- <tabstop>restorePB</tabstop>
<tabstop>okPB</tabstop>
- <tabstop>closePB</tabstop>
<tabstop>applyPB</tabstop>
+ <tabstop>closePB</tabstop>
+ <tabstop>restorePB</tabstop>
</tabstops>
<includes>
<include location="local" >qt_helpers.h</include>
<y>93</y>
</hint>
<hint type="destinationlabel" >
- <x>164</x>
- <y>101</y>
+ <x>132</x>
+ <y>108</y>
</hint>
</hints>
</connection>