diff options
Diffstat (limited to 'osdmanager.c')
-rw-r--r-- | osdmanager.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/osdmanager.c b/osdmanager.c index 8fdd7f6..c74162d 100644 --- a/osdmanager.c +++ b/osdmanager.c @@ -1,6 +1,3 @@ -#include <string>
-#include <sstream>
-
#ifndef __TVGUIDE_OSDMANAGER_H
#define __TVGUIDE_OSDMANAGER_H
@@ -55,32 +52,4 @@ void cOsdManager::releasePixmap(cPixmap *pixmap) { if (!pixmap)
return;
osd->DestroyPixmap(pixmap);
-}
-
-static std::string CutText(std::string text, int width, const cFont *font) {
- if (width <= font->Size())
- return text.c_str();
- if (font->Width(text.c_str()) < width)
- return text.c_str();
- cTextWrapper twText;
- twText.Set(text.c_str(), font, width);
- std::string cuttedTextNative = twText.GetLine(0);
- std::stringstream sstrText;
- sstrText << cuttedTextNative << "...";
- std::string cuttedText = sstrText.str();
- int actWidth = font->Width(cuttedText.c_str());
- if (actWidth > width) {
- int overlap = actWidth - width;
- int charWidth = font->Width(".");
- if (charWidth == 0)
- charWidth = 1;
- int cutChars = overlap / charWidth;
- if (cutChars > 0) {
- cuttedTextNative = cuttedTextNative.substr(0, cuttedTextNative.length() - cutChars);
- std::stringstream sstrText2;
- sstrText2 << cuttedTextNative << "...";
- cuttedText = sstrText2.str();
- }
- }
- return cuttedText;
}
\ No newline at end of file |