* 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
#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"
{
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()));
+}
#include "box.h"
#include "lyxfont.h"
+#include <string>
+
class LyXText;
class Paragraph;
class CursorSlice;
InsetBase * editXY(LCursor & cur, int x, int y);
///
void setInlined() { status_ = Inlined; }
+ ///
+ std::string floatName(std::string const & type, BufferParams const &);
protected:
///
//
// 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();
{
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);
{
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);
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();