]> git.lyx.org Git - features.git/commitdiff
* InsetPhantom.cpp (toolTip):
authorJürgen Spitzmüller <spitz@lyx.org>
Tue, 3 Feb 2009 10:03:47 +0000 (10:03 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Tue, 3 Feb 2009 10:03:47 +0000 (10:03 +0000)
- fix compiler warning, l7n, simplify.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28335 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetPhantom.cpp

index d9b0f89f5a05ba6355d7ebb25c31be69098c624d..9790e82e1d9c4d1e87f8487aa6a6f6e0b5ae91e5 100644 (file)
@@ -304,7 +304,7 @@ bool InsetPhantom::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-docstring InsetPhantom::toolTip(BufferView const & bv, int x, int y) const
+docstring InsetPhantom::toolTip(BufferView const &, int, int) const
 {
        OutputParams rp(&buffer().params().encoding());
        odocstringstream ods;
@@ -313,12 +313,10 @@ docstring InsetPhantom::toolTip(BufferView const & bv, int x, int y) const
        // shorten it if necessary
        if (content_tip.size() > 200)
                content_tip = content_tip.substr(0, 200) + "...";
-       if (params_.type == InsetPhantomParams::Phantom)
-               return from_ascii("Phantom: ") + content_tip;
-       if (params_.type == InsetPhantomParams::HPhantom)
-               return from_ascii("HPhantom: ") + content_tip;
-       if (params_.type == InsetPhantomParams::VPhantom)
-               return from_ascii("VPhantom: ") + content_tip;
+       docstring res = phantomtranslator_loc().find(params_.type);
+       if (!content_tip.empty())
+               res += from_ascii(": ") + content_tip;
+       return res;
 }