}
// remember width for the case that sl.inset() is positioned in an RTL inset
- if (i && dit[i - 1].text()) {
- // If this Inset is inside a Text Inset, retrieve the Dimension
- // from the containing text instead of using Inset::dimension() which
- // might not be implemented.
- // FIXME (Abdel 23/09/2007): this is a bit messy because of the
- // elimination of Inset::dim_ cache. This coordOffset() method needs
- // to be rewritten in light of the new design.
- Dimension const & dim = coordCache().getInsets().dim(&sl.inset());
- lastw = dim.wid;
- } else {
- Dimension const dim = sl.inset().dimension(*this);
- lastw = dim.wid;
- }
+ lastw = sl.inset().dimension(*this).wid;
//lyxerr << "Cursor::getPos, i: "
// << i << " x: " << xx << " y: " << y << endl;
void metricsMarkers(Dimension & dim, int framesize = 1) const;
/// add space for markers
void metricsMarkers2(Dimension & dim, int framesize = 1) const;
+
+ /// last metrics computed for the inset
+ Dimension const dimension(BufferView const &) const;
/// last drawn position for 'important' insets
int xo(BufferView const & bv) const;
/// last drawn position for 'important' insets
///
void setDimCache(MetricsInfo const &, Dimension const &) const;
/// do we cover screen position x/y?
- virtual bool covers(BufferView const & bv, int x, int y) const;
+ bool covers(BufferView const & bv, int x, int y) const;
/// get the screen positions of the cursor (see note in Cursor.cpp)
virtual void cursorPos(BufferView const & bv,
CursorSlice const & sl, bool boundary, int & x, int & y) const;
/// reject the changes within the inset
virtual void rejectChanges() {}
- ///
- virtual Dimension const dimension(BufferView const &) const;
///
virtual ColorCode backgroundColor(PainterInfo const &) const;
///
view_[&bv].button_dim_.y2 = 0;
}
- Dimension const textdim = InsetText::dimension(bv);
+ Dimension const textdim = dimensionHelper(bv);
int const baseline = y;
int textx, texty;
Geometry g = geometry(bv);
status_ = Open;
InsetText::cursorPos(bv, sl, boundary, x, y);
- Dimension const textdim = InsetText::dimension(bv);
+ Dimension const textdim = dimensionHelper(bv);
switch (geometry(bv)) {
case LeftButton:
std::string contextMenuName() const;
///
bool showInsetDialog(BufferView * bv) const;
- ///
- Dimension const dimension(BufferView const &) const
- { return button_.dimension(); }
//@}
protected:
void InsetIPADeco::metrics(MetricsInfo & mi, Dimension & dim) const
{
InsetText::metrics(mi, dim);
-
+
if (params_.type == InsetIPADecoParams::Toptiebar) {
// consider width of the inset label
FontInfo font(getLayout().labelfont());
// draw the inset marker
drawMarkers(pi, x, y);
- Dimension const dim = Inset::dimension(*pi.base.bv);
+ Dimension const dim = dimension(*pi.base.bv);
if (params_.type == InsetIPADecoParams::Toptiebar) {
FontInfo font(getLayout().labelfont());
docstring result = ods.str();
docstring const before = result.substr(0, h);
docstring const after = result.substr(h, result.size());
-
+
if (params_.type == InsetIPADecoParams::Toptiebar) {
os << before;
os.put(0x0361);
}
-Dimension const InsetLine::dimension(BufferView const & bv) const
-{
- // We cannot use InsetCommand::dimension() as this returns the dimension
- // of the button, which is not used here.
- return Inset::dimension(bv);
-}
-
-
void InsetLine::draw(PainterInfo & pi, int x, int y) const
{
Dimension const dim = dimension(*pi.base.bv);
/// Inset inherited methods.
//@{
InsetCode lyxCode() const { return LINE_CODE; }
- Dimension const dimension(BufferView const &) const;
int docbook(odocstream &, OutputParams const &) const;
/// Does nothing at the moment.
docstring xhtml(XHTMLStream &, OutputParams const &) const;
ColorCode const origcol = pi.base.font.color();
pi.base.font.setColor(Color_special);
pi.base.font.setColor(origcol);
- Dimension const dim = Inset::dimension(*pi.base.bv);
+ Dimension const dim = dimension(*pi.base.bv);
if (params_.type == InsetPhantomParams::Phantom ||
params_.type == InsetPhantomParams::VPhantom) {
}
-Dimension const InsetText::dimension(BufferView const & bv) const
+Dimension const InsetText::dimensionHelper(BufferView const & bv) const
{
TextMetrics const & tm = bv.textMetrics(&text_);
Dimension dim = tm.dimension();
void setBuffer(Buffer &);
///
- Dimension const dimension(BufferView const &) const;
+ Dimension const dimensionHelper(BufferView const &) const;
/// empty inset to empty par
void clear();