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
This commit is contained in:
Abdelrazak Younes 2006-10-08 08:47:26 +00:00
parent 94c10102c0
commit d81ffbdc23
4 changed files with 19 additions and 32 deletions

View File

@ -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()));
}

View File

@ -20,6 +20,8 @@
#include "box.h"
#include "lyxfont.h"
#include <string>
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:
///

View File

@ -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);

View File

@ -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();