]> git.lyx.org Git - features.git/commitdiff
Enable previewing of Include insets within insets within insets...
authorAngus Leeming <leeming@lyx.org>
Thu, 18 Sep 2003 13:13:49 +0000 (13:13 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 18 Sep 2003 13:13:49 +0000 (13:13 +0000)
(Don't use a BufferView cache to supply the Buffer when you can just pass
'Buffer const &' instead, Angus.'

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7789 a592a061-630c-0410-9148-cb99ea01b6c8

src/graphics/ChangeLog
src/graphics/PreviewedInset.C
src/graphics/PreviewedInset.h
src/insets/ChangeLog
src/insets/insetinclude.C
src/mathed/ChangeLog
src/mathed/formula.C

index b65440d09b8c97d0df070eee0ea715d6ac491128..dc5ad2cd324a16520ffe9ec204ed168b44643d5e 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-18  Angus Leeming  <leeming@lyx.org>
+
+       * PreviewedInset.C (latexString): add a Buffer const & arg.
+       * PreviewedInset.C (addPreview): pass the buffer to latexString.
+
 2003-09-16  Angus Leeming  <leeming@lyx.org>
 
        * PreviewedInset.[Ch] (c-tor) move out of line.
index 85e4c95c31c9f0351f5f80a5d1e2e3e40a55e870..79ded1294ffd3fe7a0f76c18e226d7c8b808413d 100644 (file)
@@ -65,7 +65,7 @@ void PreviewedInset::addPreview(PreviewLoader & ploader)
        if (!Previews::activated() || !previewWanted())
                return;
 
-       snippet_ = support::trim(latexString());
+       snippet_ = support::trim(latexString(ploader.buffer()));
        if (snippet_.empty())
                return;
 
index 33c46eae14c72e399e5e45996169f2427f4965d5..197ded4d77b9c77d6b88322d2f5304f2a5bcc4b9 100644 (file)
 #include <boost/signals/trackable.hpp>
 #include <boost/signals/connection.hpp>
 
-class InsetOld;
+class Buffer;
 class BufferView;
+class InsetOld;
+
 
 namespace lyx {
 namespace graphics {
@@ -73,7 +75,7 @@ private:
        /// Does the owning inset want a preview?
        virtual bool previewWanted() const = 0;
        /// a wrapper to Inset::latex
-       virtual string const latexString() const = 0;
+       virtual string const latexString(Buffer const &) const = 0;
 
        ///
        InsetOld & inset_;
index d84a0548efeae9365ad7d1df29e1bced1b7e679e..48647ce2902829a5e828201caecea913cde3beca 100644 (file)
@@ -1,3 +1,7 @@
+2003-09-18  Angus Leeming  <leeming@lyx.org>
+
+       * insetinclude.C (latexString): add a Buffer const & arg.
+
 2003-09-18  Angus Leeming  <leeming@lyx.org>
 
        * inset.C:
index 96dc8c393cbf5ef580e357671a770948bd88d186..ef1032ff2d90f8395ae5fec8c4d043c1347bd957 100644 (file)
@@ -72,7 +72,7 @@ public:
        ///
        bool previewWanted() const;
        ///
-       string const latexString() const;
+       string const latexString(Buffer const &) const;
        ///
        InsetInclude const & parent() const {
                return dynamic_cast<InsetInclude const &>(inset());
@@ -600,15 +600,12 @@ bool InsetInclude::PreviewImpl::previewWanted() const
 }
 
 
-string const InsetInclude::PreviewImpl::latexString() const
+string const InsetInclude::PreviewImpl::latexString(Buffer const & buffer) const
 {
-       if (!view() || !view()->buffer())
-               return string();
-
        ostringstream os;
        LatexRunParams runparams;
        runparams.flavor = LatexRunParams::LATEX;
-       parent().latex(*view()->buffer(), os, runparams);
+       parent().latex(buffer, os, runparams);
 
        return os.str();
 }
index ad85d89e9f5e6fcbd2e5f4cd8c4f79989efd798e..bbdc3cb0776376f322089ee11da065d80aed200f 100644 (file)
@@ -1,3 +1,7 @@
+2003-09-18  Angus Leeming  <leeming@lyx.org>
+
+       * formula.C (latexString): add a Buffer const & arg.
+
 2003-09-16  Angus Leeming  <leeming@lyx.org>
 
        * formula.C (PreviewImpl::parent): return a const reference.
index b4fe5e2176cca17ec07d88753623a49af7876cad..36b39d32fda09f2da4968839df002f021d839da3 100644 (file)
@@ -46,7 +46,7 @@ private:
        ///
        bool previewWanted() const;
        ///
-       string const latexString() const;
+       string const latexString(Buffer const &) const;
        ///
        InsetFormula const & parent() const
        {
@@ -313,7 +313,7 @@ bool InsetFormula::PreviewImpl::previewWanted() const
 }
 
 
-string const InsetFormula::PreviewImpl::latexString() const
+string const InsetFormula::PreviewImpl::latexString(Buffer const &) const
 {
        ostringstream ls;
        WriteStream wi(ls, false, false);