From f672df5dc20c5bb4b44d18b77e2c304ba83a19a6 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Fri, 18 May 2007 20:01:56 +0000 Subject: [PATCH] BUG 3649: display float listings inline, like other float insets git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18413 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetListings.cpp | 2 +- src/insets/InsetListingsParams.cpp | 6 ++++++ src/insets/InsetListingsParams.h | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp index 398d22921a..d8cf10a767 100644 --- a/src/insets/InsetListings.cpp +++ b/src/insets/InsetListings.cpp @@ -81,7 +81,7 @@ InsetListings::~InsetListings() Inset::DisplayType InsetListings::display() const { - return params().isInline() ? Inline : AlignLeft; + return params().isInline() || params().isFloat() ? Inline : AlignLeft; } diff --git a/src/insets/InsetListingsParams.cpp b/src/insets/InsetListingsParams.cpp index f651f453b4..473538475c 100644 --- a/src/insets/InsetListingsParams.cpp +++ b/src/insets/InsetListingsParams.cpp @@ -560,6 +560,12 @@ void InsetListingsParams::fromEncodedString(string const & in) } +bool InsetListingsParams::isFloat() const +{ + return find(keys_.begin(), keys_.end(), "float") != keys_.end(); +} + + string InsetListingsParams::getParamValue(string const & param) const { // is this parameter defined? diff --git a/src/insets/InsetListingsParams.h b/src/insets/InsetListingsParams.h index 56a70d7fc8..828892bedf 100644 --- a/src/insets/InsetListingsParams.h +++ b/src/insets/InsetListingsParams.h @@ -60,6 +60,9 @@ public: /// bool isInline() const { return inline_; } + /// + bool isFloat() const; + /// InsetCollapsable::CollapseStatus status() const { return status_; }