]> git.lyx.org Git - features.git/commitdiff
Fix linking issue with MacOSX.
authorAbdelrazak Younes <younes@lyx.org>
Sun, 8 Oct 2006 08:47:26 +0000 (08:47 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 8 Oct 2006 08:47:26 +0000 (08:47 +0000)
* 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
src/insets/insetcollapsable.h
src/insets/insetfloat.C
src/insets/insetwrap.C

index e7a547f475b77054cfcc14cfff76805e3eec221f..eae08e99d04d42312d831857ae2ecd97ff52a062 100644 (file)
 #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()));
+}
index 61493dac2363892c5a908e2dd49afe7659f4045b..a3cabdd1e267901702c26aac0db7a728d282b530 100644 (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:
        ///
index 491102b91e723b859ced685c365e899ad686c480..eae8bfc881f97e30ae5f71f4e2148ffdd4334c63 100644 (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);
index 645ec11f499d6f874d0acdf4ae161911eedbccb1..08f2af90e9ebed7d90a12d2190953090d2057e79 100644 (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();