From d81ffbdc23a08fe467656cb568bd6dcf58263249 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 8 Oct 2006 08:47:26 +0000 Subject: [PATCH] Fix linking issue with MacOSX. * insetcollapsable: new floatName method. * insetfloat.C: floatname function deleted. * insetwrap.C: floatname function deleted. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15272 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/insetcollapsable.C | 11 +++++++++++ src/insets/insetcollapsable.h | 4 ++++ src/insets/insetfloat.C | 21 +++------------------ src/insets/insetwrap.C | 15 +-------------- 4 files changed, 19 insertions(+), 32 deletions(-) diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index e7a547f475..eae08e99d0 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -15,11 +15,14 @@ #include "insetcollapsable.h" #include "buffer.h" +#include "bufferparams.h" #include "BufferView.h" #include "cursor.h" #include "debug.h" #include "dispatchresult.h" +#include "FloatList.h" #include "FuncStatus.h" +#include "gettext.h" #include "LColor.h" #include "lyxlex.h" #include "funcrequest.h" @@ -407,3 +410,11 @@ void InsetCollapsable::setLabelFont(LyXFont & font) { labelfont_ = font; } + +string InsetCollapsable::floatName(string const & type, BufferParams const & bp) +{ + FloatList const & floats = bp.getLyXTextClass().floats(); + FloatList::const_iterator it = floats[type]; + // FIXME UNICODE + return (it == floats.end()) ? type : lyx::to_utf8(_(it->second.name())); +} diff --git a/src/insets/insetcollapsable.h b/src/insets/insetcollapsable.h index 61493dac23..a3cabdd1e2 100644 --- a/src/insets/insetcollapsable.h +++ b/src/insets/insetcollapsable.h @@ -20,6 +20,8 @@ #include "box.h" #include "lyxfont.h" +#include + class LyXText; class Paragraph; class CursorSlice; @@ -94,6 +96,8 @@ protected: InsetBase * editXY(LCursor & cur, int x, int y); /// void setInlined() { status_ = Inlined; } + /// + std::string floatName(std::string const & type, BufferParams const &); protected: /// diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index 491102b91e..eae8bfc881 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -114,27 +114,12 @@ using std::ostringstream; // // Lgb -namespace { - -string floatname(string const & type, BufferParams const & bp) -{ - FloatList const & floats = bp.getLyXTextClass().floats(); - FloatList::const_iterator it = floats[type]; - if (it == floats.end()) - return type; - - // FIXME UNICODE - return lyx::to_utf8(_(it->second.name())); -} - -} // namespace anon - InsetFloat::InsetFloat(BufferParams const & bp, string const & type) : InsetCollapsable(bp) { // FIXME UNICODE - setLabel(lyx::to_utf8(_("float: ")) + floatname(type, bp)); + setLabel(lyx::to_utf8(_("float: ")) + floatName(type, bp)); LyXFont font(LyXFont::ALL_SANE); font.decSize(); font.decSize(); @@ -375,7 +360,7 @@ void InsetFloat::wide(bool w, BufferParams const & bp) { params_.wide = w; // FIXME UNICODE - string lab = lyx::to_utf8(_("float: ")) + floatname(params_.type, bp); + string lab = lyx::to_utf8(_("float: ")) + floatName(params_.type, bp); if (params_.wide) lab += '*'; setLabel(lab); @@ -386,7 +371,7 @@ void InsetFloat::sideways(bool s, BufferParams const & bp) { params_.sideways = s; // FIXME UNICODE - string lab = lyx::to_utf8(_("float: ")) + floatname(params_.type, bp); + string lab = lyx::to_utf8(_("float: ")) + floatName(params_.type, bp); if (params_.sideways) lab += lyx::to_utf8(_(" (sideways)")); setLabel(lab); diff --git a/src/insets/insetwrap.C b/src/insets/insetwrap.C index 645ec11f49..08f2af90e9 100644 --- a/src/insets/insetwrap.C +++ b/src/insets/insetwrap.C @@ -44,24 +44,11 @@ using std::ostream; using std::ostringstream; -namespace { - -string floatname(string const & type, BufferParams const & bp) -{ - FloatList const & floats = bp.getLyXTextClass().floats(); - FloatList::const_iterator it = floats[type]; - // FIXME UNICODE - return (it == floats.end()) ? type : lyx::to_utf8(_(it->second.name())); -} - -} // namespace anon - - InsetWrap::InsetWrap(BufferParams const & bp, string const & type) : InsetCollapsable(bp) { // FIXME UNICODE - setLabel(lyx::to_utf8(_("wrap: ")) + floatname(type, bp)); + setLabel(lyx::to_utf8(_("wrap: ")) + floatName(type, bp)); LyXFont font(LyXFont::ALL_SANE); font.decSize(); font.decSize();