mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
better placement handling
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2180 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7cb3b05491
commit
6627b6edde
@ -1,3 +1,9 @@
|
||||
2001-07-04 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* insetfloat.C (latex): let the specific placement take presedence
|
||||
if set, otherwise choose document placement if set, otherwise just
|
||||
use float default placement.
|
||||
|
||||
2001-07-03 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* insettext.C (localDispatch): call CutAndPaste::'s static method
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "LaTeXFeatures.h"
|
||||
#include "debug.h"
|
||||
#include "Floating.h"
|
||||
#include "buffer.h"
|
||||
|
||||
using std::ostream;
|
||||
using std::endl;
|
||||
@ -190,11 +191,28 @@ int InsetFloat::latex(Buffer const * buf,
|
||||
ostream & os, bool fragile, bool fp) const
|
||||
{
|
||||
string const tmptype = (wide_ ? floatType_ + "*" : floatType_);
|
||||
// Figure out the float placement to use.
|
||||
// From lowest to highest:
|
||||
// - float default placement
|
||||
// - document wide default placement
|
||||
// - specific float placement
|
||||
string placement;
|
||||
string const buf_placement = buf->params.float_placement;
|
||||
string const def_placement = floatList.defaultPlacement(floatType_);
|
||||
if (!floatPlacement_.empty()
|
||||
&& floatPlacement_ != def_placement) {
|
||||
placement = floatPlacement_;
|
||||
} else if (!buf_placement.empty()
|
||||
&& buf_placement != def_placement) {
|
||||
placement = buf_placement;
|
||||
}
|
||||
|
||||
os << "\\begin{" << tmptype << "}";
|
||||
if (!floatPlacement_.empty()
|
||||
&& floatPlacement_ != floatList.defaultPlacement(floatType_))
|
||||
os << "[" << floatPlacement_ << "]";
|
||||
// We only output placement if different from the def_placement.
|
||||
if (!placement.empty()) {
|
||||
os << "[" << placement << "]";
|
||||
}
|
||||
|
||||
os << "%\n";
|
||||
|
||||
int const i = inset.latex(buf, os, fragile, fp);
|
||||
|
Loading…
Reference in New Issue
Block a user