]> git.lyx.org Git - features.git/commitdiff
Now generate previews when loading the buffer for insets in insets.
authorAngus Leeming <leeming@lyx.org>
Fri, 2 Aug 2002 16:39:43 +0000 (16:39 +0000)
committerAngus Leeming <leeming@lyx.org>
Fri, 2 Aug 2002 16:39:43 +0000 (16:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4847 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetcollapsable.C
src/insets/insetcollapsable.h
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h

index 6050ae6bfee4816f6dbae709204ca0277b64676e..b75d552a6fe85c5504cd28264e987905a30c55cd 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-02  Angus Leeming  <leeming@lyx.org>
+
+       * insetcollapsable.[Ch] (addPreview):
+       * insettabular.[Ch] (addPreview):
+       * insettext.[Ch] (addPreview): new methods. Can now generate previews
+       for insets in insets.
+
 2002-08-02  Angus Leeming  <leeming@lyx.org>
 
        * insetcite.C: fix typo.
index 0f2cde6adee5604983db25974290227a8f756267..de8e98f74087331991c7e78b7f43b334c12f08f6 100644 (file)
@@ -676,3 +676,9 @@ string const InsetCollapsable::selectNextWordToSpellcheck(BufferView * bv,
        first_after_edit = false;
        return str;
 }
+
+
+void InsetCollapsable::addPreview(grfx::PreviewLoader & loader) const
+{
+       inset.addPreview(loader);
+}
index a86e00df5b281127499692e215e7de3f03ce8d97..b9fca1d3d37f67461976a0a6721290a002f379fa 100644 (file)
@@ -190,6 +190,9 @@ public:
        bool searchBackward(BufferView * bv, string const & str,
                            bool = true, bool = false);
 
+       ///
+       void addPreview(grfx::PreviewLoader &) const;
+
 protected:
        ///
        int ascent_collapsed() const;
index 3c43db7997116a2d2e3cbf83ad3230d3ad6900f7..f88e9dbb83f5e5b944f4f89f8c743fc32d856405 100644 (file)
@@ -2917,3 +2917,15 @@ bool InsetTabular::insertAsciiString(BufferView * bv, string const & buf,
 
        return true;
 }
+
+
+void InsetTabular::addPreview(grfx::PreviewLoader & loader) const
+{
+       int const rows = tabular->rows();
+       int const columns = tabular->columns();
+       for (int i = 0; i < rows; ++i) {
+               for (int j = 0; j < columns; ++j) {
+                       tabular->GetCellInset(i,j)->addPreview(loader);
+               }
+       }
+}
index f6e52575877b78ca48819029962986bda05e5d91..298790526cfdc320df6fd7cfdd4680e02b15a214 100644 (file)
@@ -229,6 +229,9 @@ public:
        // "normal" means without width set!
        bool forceDefaultParagraphs(Inset const * in) const;
 
+       ///
+       void addPreview(grfx::PreviewLoader &) const;
+
        //
        // Public structures and variables
        ///
index 54965683201dd6f5f3b7ca19e5be186ad84b6019..c3b93db51082af2eec8a6af922366dd48c99972d 100644 (file)
@@ -2797,3 +2797,18 @@ void InsetText::appendParagraphs(BufferParams const & bparams,
 
        reinitLyXText();
 }
+
+
+void InsetText::addPreview(grfx::PreviewLoader & loader) const
+{
+       Paragraph * par = getFirstParagraph(0);
+       while (par) {
+               Paragraph::inset_iterator it  = par->inset_iterator_begin();
+               Paragraph::inset_iterator end = par->inset_iterator_end();
+               for (; it != end; ++it) {
+                       it->addPreview(loader);
+               }
+
+               par = par->next();
+       }
+}
index 9f0fe2dc9412b991f42f5db751464c4fea7f887c..eaeba72355bd8a62fbcb83a06f77304a15506ee0 100644 (file)
@@ -248,6 +248,8 @@ public:
        ///
        void appendParagraphs(BufferParams const & bparams, Paragraph *);
        ///
+       void addPreview(grfx::PreviewLoader &) const;
+
        //
        // Public structures and variables
        ///