From a6a948feb1644b51fce7a11657a5e45fed80906c Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 10 Mar 2003 13:33:39 +0000 Subject: [PATCH] Store an InsetBase & in MailInset. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6420 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/graphics/GraphicsConverter.C | 8 ++++---- src/insets/ChangeLog | 15 +++++++++++++++ src/insets/inset.h | 5 ----- src/insets/insetbase.h | 6 ++++++ src/insets/insetcommand.h | 2 +- src/insets/insetert.h | 2 +- src/insets/insetexternal.h | 2 +- src/insets/insetfloat.h | 2 +- src/insets/insetgraphics.h | 2 +- src/insets/insetinclude.h | 2 +- src/insets/insetminipage.h | 2 +- src/insets/insettabular.h | 2 +- src/insets/insetwrap.h | 2 +- src/insets/mailinset.h | 4 ++-- 14 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/graphics/GraphicsConverter.C b/src/graphics/GraphicsConverter.C index 58f83eec3e..ce04d9bf20 100644 --- a/src/graphics/GraphicsConverter.C +++ b/src/graphics/GraphicsConverter.C @@ -158,9 +158,9 @@ Converter::Impl::Impl(string const & from_file, string const & to_file_base, } else { lyxerr[Debug::GRAPHICS] << "\tConversion script:" - << "\n--------------------------------------\n" - << STRCONV(script.str()) - << "\n--------------------------------------\n"; + << "\n--------------------------------------\n" + << STRCONV(script.str()) + << "\n--------------------------------------\n"; // Output the script to file. static int counter = 0; @@ -177,7 +177,7 @@ Converter::Impl::Impl(string const & from_file, string const & to_file_base, // The command needed to run the conversion process // We create a dummy command for ease of understanding of the // list of forked processes. - // Note that 'sh ' is absolutely essential, or execvp will fail. + // Note: 'sh ' is absolutely essential, or execvp will fail. script_command_ = "sh " + script_file_ + ' ' + OnlyFilename(from_file) + ' ' + to_format; } diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 10233ff6ee..47899ff409 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,18 @@ +2003-03-10 Angus Leeming + + * inset.h, insetbase.h: move cache() and view() into InsetBase. + + * insetcommand.h (inset): + * insetert.h (inset): + * insetexternal.h (inset): + * insetfloat.h (inset): + * insetgraphics.h (inset): + * insetinclude.h (inset): + * insetminipage.h (inset): + * insettabular.h (inset): + * insetwrap.h (inset): + * mailinset.h (inset): return an InsetBase &, not an Inset &. + 2003-03-10 Angus Leeming * insetcommand.C (string2params): diff --git a/src/insets/inset.h b/src/insets/inset.h index 77bb0bae81..77216216bc 100644 --- a/src/insets/inset.h +++ b/src/insets/inset.h @@ -24,7 +24,6 @@ #include "support/types.h" class LyXFont; -class BufferView; class Buffer; class Painter; class LyXText; @@ -337,10 +336,6 @@ public: * defaults to empty. */ virtual void generatePreview() const {} - /// - virtual void cache(BufferView *) const {} - /// - virtual BufferView * view() const { return 0; } protected: /// diff --git a/src/insets/insetbase.h b/src/insets/insetbase.h index 79933fcc62..c6dc34894e 100644 --- a/src/insets/insetbase.h +++ b/src/insets/insetbase.h @@ -14,6 +14,7 @@ #include +class BufferView; class FuncRequest; /** Dispatch result codes @@ -64,6 +65,11 @@ public: /// virtual ~InsetBase() {} + + /// Methods to cache and retrieve a cached BufferView. + virtual void cache(BufferView *) const {} + /// + virtual BufferView * view() const { return 0; } }; #endif diff --git a/src/insets/insetcommand.h b/src/insets/insetcommand.h index 6d8df729c3..08a05823dd 100644 --- a/src/insets/insetcommand.h +++ b/src/insets/insetcommand.h @@ -84,7 +84,7 @@ public: /// InsetCommandMailer(string const & name, InsetCommand & inset); /// - virtual Inset & inset() const { return inset_; } + virtual InsetBase & inset() const { return inset_; } /// virtual string const & name() const { return name_; } /// diff --git a/src/insets/insetert.h b/src/insets/insetert.h index 1a1cc59c0d..0217b16e69 100644 --- a/src/insets/insetert.h +++ b/src/insets/insetert.h @@ -159,7 +159,7 @@ public: /// InsetERTMailer(InsetERT & inset); /// - virtual Inset & inset() const { return inset_; } + virtual InsetBase & inset() const { return inset_; } /// virtual string const & name() const { return name_; } /// diff --git a/src/insets/insetexternal.h b/src/insets/insetexternal.h index 7d099fcfb6..fe4f0eb622 100644 --- a/src/insets/insetexternal.h +++ b/src/insets/insetexternal.h @@ -131,7 +131,7 @@ public: /// InsetExternalMailer(InsetExternal & inset); /// - virtual Inset & inset() const { return inset_; } + virtual InsetBase & inset() const { return inset_; } /// virtual string const & name() const { return name_; } /// diff --git a/src/insets/insetfloat.h b/src/insets/insetfloat.h index 38fc1284af..cee68959a2 100644 --- a/src/insets/insetfloat.h +++ b/src/insets/insetfloat.h @@ -100,7 +100,7 @@ public: /// InsetFloatMailer(InsetFloat & inset); /// - virtual Inset & inset() const { return inset_; } + virtual InsetBase & inset() const { return inset_; } /// virtual string const & name() const { return name_; } /// diff --git a/src/insets/insetgraphics.h b/src/insets/insetgraphics.h index ac13376ae9..a0e1f2b89a 100644 --- a/src/insets/insetgraphics.h +++ b/src/insets/insetgraphics.h @@ -134,7 +134,7 @@ public: /// InsetGraphicsMailer(InsetGraphics & inset); /// - virtual Inset & inset() const { return inset_; } + virtual InsetBase & inset() const { return inset_; } /// virtual string const & name() const { return name_; } /// diff --git a/src/insets/insetinclude.h b/src/insets/insetinclude.h index 8a57c739fb..dcddeeb22f 100644 --- a/src/insets/insetinclude.h +++ b/src/insets/insetinclude.h @@ -156,7 +156,7 @@ public: /// InsetIncludeMailer(InsetInclude & inset); /// - virtual Inset & inset() const { return inset_; } + virtual InsetBase & inset() const { return inset_; } /// virtual string const & name() const { return name_; } /// diff --git a/src/insets/insetminipage.h b/src/insets/insetminipage.h index f5f5cafada..d4f544a4d5 100644 --- a/src/insets/insetminipage.h +++ b/src/insets/insetminipage.h @@ -126,7 +126,7 @@ public: /// InsetMinipageMailer(InsetMinipage & inset); /// - virtual Inset & inset() const { return inset_; } + virtual InsetBase & inset() const { return inset_; } /// virtual string const & name() const { return name_; } /// diff --git a/src/insets/insettabular.h b/src/insets/insettabular.h index ffb6c4d236..81cb7f3fb3 100644 --- a/src/insets/insettabular.h +++ b/src/insets/insettabular.h @@ -377,7 +377,7 @@ public: /// InsetTabularMailer(InsetTabular & inset); /// - virtual Inset & inset() const { return inset_; } + virtual InsetBase & inset() const { return inset_; } /// virtual string const & name() const { return name_; } /// diff --git a/src/insets/insetwrap.h b/src/insets/insetwrap.h index a35b782b0b..2090d350f9 100644 --- a/src/insets/insetwrap.h +++ b/src/insets/insetwrap.h @@ -97,7 +97,7 @@ public: /// InsetWrapMailer(InsetWrap & inset); /// - virtual Inset & inset() const { return inset_; } + virtual InsetBase & inset() const { return inset_; } /// virtual string const & name() const { return name_; } /// diff --git a/src/insets/mailinset.h b/src/insets/mailinset.h index 965895deb9..e4d1fe3048 100644 --- a/src/insets/mailinset.h +++ b/src/insets/mailinset.h @@ -16,7 +16,7 @@ #include "LString.h" -class Inset; +class InsetBase; class MailInset { @@ -34,7 +34,7 @@ public: protected: /// - virtual Inset & inset() const = 0; + virtual InsetBase & inset() const = 0; /// virtual string const & name() const = 0; }; -- 2.39.2