]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInfo.cpp
Fix bug #12772
[lyx.git] / src / insets / InsetInfo.cpp
index 46d656c817c9ad9d78a221f321867717e368c566..06851bb08059bdac277aedd00d500e0d92faaba0 100644 (file)
@@ -465,6 +465,22 @@ string InsetInfoParams::infoType() const
 /////////////////////////////////////////////////////////////////////////
 
 
+namespace {
+
+class InsetGraphicsTight : public InsetGraphics
+{
+public:
+       ///
+       explicit InsetGraphicsTight(Buffer * buf) : InsetGraphics(buf) {}
+
+       ///
+       int leftOffset(BufferView const *) const override { return 0; }
+       ///
+       int rightOffset(BufferView const *) const override { return 0; }
+};
+
+}
+
 
 InsetInfo::InsetInfo(Buffer * buf, string const & info)
        : InsetCollapsible(buf), initialized_(false)
@@ -796,8 +812,12 @@ void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype, bool cons
        // in the original Buffer. This is especially important for VCS.
        // Otherwise, we could in principle have different settings here
        // than in the Buffer we were exporting.
-       if (buffer().isClone())
+       // However, we need to check whether the inset is in an intitle
+       // context.
+       if (buffer().isClone()) {
+               InsetText::checkIntitleContext(it);
                return;
+       }
        BufferParams const & bp = buffer().params();
        params_.lang = it.paragraph().getFontSettings(bp, it.pos()).language();
        InsetCollapsible::updateBuffer(it, utype, deleted);
@@ -1123,7 +1143,7 @@ void InsetInfo::build()
                                percent_scale = (100 * iconsize + imgsize / 2)/imgsize;
                        }
                }
-               InsetGraphics * inset = new InsetGraphics(buffer_);
+               InsetGraphicsTight * inset = new InsetGraphicsTight(buffer_);
                InsetGraphicsParams igp;
                igp.filename = file;
                igp.lyxscale = percent_scale;