- if (!params_.placement.empty()
- && params_.placement != def_placement) {
- placement = params_.placement;
- } else if (params_.placement.empty()
- && !buf_placement.empty()
- && buf_placement != def_placement) {
- placement = buf_placement;
+ if (params_.placement == "document"
+ && !buf_placement.empty()
+ && buf_placement != def_placement) {
+ tmpplacement = buf_placement;
+ } else if (!params_.placement.empty()
+ && params_.placement != "document"
+ && params_.placement != def_placement) {
+ tmpplacement = params_.placement;
+ }
+
+ // Check if placement is allowed by this float
+ string const allowed_placement =
+ floats.allowedPlacement(params_.type);
+ string placement;
+ string::const_iterator lit = tmpplacement.begin();
+ string::const_iterator end = tmpplacement.end();
+ for (; lit != end; ++lit) {
+ if (contains(allowed_placement, *lit))
+ placement += *lit;