* rename isStretchableSpace to isHfill
* inline a trivial method
* remove InsetIPAMacro::isLineSeparator, which has the same value as default.
bool Paragraph::isHfill(pos_type pos) const
{
Inset const * inset = getInset(pos);
bool Paragraph::isHfill(pos_type pos) const
{
Inset const * inset = getInset(pos);
- return inset && (inset->lyxCode() == SPACE_CODE &&
- inset->isStretchableSpace());
+ return inset && inset->isHfill();
InsetList::const_iterator iend = par.insetList().end();
for ( ; ii != iend; ++ii) {
if (ii->pos >= endpos || ii->pos < row.pos()
InsetList::const_iterator iend = par.insetList().end();
for ( ; ii != iend; ++ii) {
if (ii->pos >= endpos || ii->pos < row.pos()
- || (ii->inset->lyxCode() != SPACE_CODE ||
- !ii->inset->isStretchableSpace()))
+ || !ii->inset->isHfill())
continue;
Dimension dim = row.dimension();
if (pm.hfillExpansion(row, ii->pos))
continue;
Dimension dim = row.dimension();
if (pm.hfillExpansion(row, ii->pos))
/// is this equivalent to a space (which is BTW different from
/// a line separator)?
virtual bool isSpace() const { return false; }
/// is this equivalent to a space (which is BTW different from
/// a line separator)?
virtual bool isSpace() const { return false; }
- /// is this an expandible space (rubber length)?
- virtual bool isStretchableSpace() const { return false; }
+ /// does this inset try to use all available space (like \\hfill does)?
+ virtual bool isHfill() const { return false; }
enum DisplayType {
Inline = 0,
enum DisplayType {
Inline = 0,
-bool InsetIPAChar::isLetter() const
-{
- return true;
-}
-
-
-bool InsetIPAChar::isLineSeparator() const
-{
- return false;
-}
-
-
/// should this inset be handled like a normal character?
bool isChar() const { return true; }
/// is this equivalent to a letter?
/// should this inset be handled like a normal character?
bool isChar() const { return true; }
/// is this equivalent to a letter?
- bool isLetter() const;
- /// should we break lines after this inset?
- bool isLineSeparator() const;
+ bool isLetter() const { return true; }
private:
Inset * clone() const { return new InsetIPAChar(*this); }
private:
Inset * clone() const { return new InsetIPAChar(*this); }
void InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
{
void InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
{
- if (isStretchableSpace()) {
// The metrics for this kinds are calculated externally in
// \c TextMetrics::computeRowMetrics. Those are dummy value:
dim = Dimension(10, 10, 10);
// The metrics for this kinds are calculated externally in
// \c TextMetrics::computeRowMetrics. Those are dummy value:
dim = Dimension(10, 10, 10);
break;
case InsetSpaceParams::CUSTOM:
case InsetSpaceParams::CUSTOM_PROTECTED: {
break;
case InsetSpaceParams::CUSTOM:
case InsetSpaceParams::CUSTOM_PROTECTED: {
params_.length.len().inPixels(mi.base.textwidth,
fm.width(char_type('M')));
int const minw = (w < 0) ? 3 * arrow_size : 4;
params_.length.len().inPixels(mi.base.textwidth,
fm.width(char_type('M')));
int const minw = (w < 0) ? 3 * arrow_size : 4;
{
Dimension const dim = dimension(*pi.base.bv);
{
Dimension const dim = dimension(*pi.base.bv);
- if (isStretchableSpace() || params_.length.len().value() < 0) {
+ if (isHfill() || params_.length.len().value() < 0) {
int const asc = theFontMetrics(pi.base.font).ascent('M');
int const desc = theFontMetrics(pi.base.font).descent('M');
// Pixel height divisible by 2 for prettier fill graphics:
int const asc = theFontMetrics(pi.base.font).ascent('M');
int const desc = theFontMetrics(pi.base.font).descent('M');
// Pixel height divisible by 2 for prettier fill graphics:
os << "\\hspace*{}";
break;
}
os << "\\hspace*{}";
break;
}
if (!length.len().empty())
os << "\n\\length " << length.asString();
}
if (!length.len().empty())
os << "\n\\length " << length.asString();
}
-bool InsetSpace::isStretchableSpace() const
+bool InsetSpace::isHfill() const
{
return params_.kind == InsetSpaceParams::HFILL
|| params_.kind == InsetSpaceParams::HFILL_PROTECTED
{
return params_.kind == InsetSpaceParams::HFILL
|| params_.kind == InsetSpaceParams::HFILL_PROTECTED
bool clickable(int, int) const { return true; }
///
InsetCode lyxCode() const { return SPACE_CODE; }
bool clickable(int, int) const { return true; }
///
InsetCode lyxCode() const { return SPACE_CODE; }
- /// is this an expandible space (rubber length)?
- bool isStretchableSpace() const;
-
+ /// does this inset try to use all available space (like \\hfill does)?
+ bool isHfill() const;
/// should this inset be handled like a normal character?
bool isChar() const { return true; }
/// is this equivalent to a letter?
/// should this inset be handled like a normal character?
bool isChar() const { return true; }
/// is this equivalent to a letter?