diff options
author | Kristian Monsen <kristianm@google.com> | 2010-06-28 16:42:48 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-07-02 10:29:56 +0100 |
commit | 06ea8e899e48f1f2f396b70e63fae369f2f23232 (patch) | |
tree | 20c1428cd05c76f32394ab354ea35ed99acd86d8 /WebCore/platform/efl/FileChooserEfl.cpp | |
parent | 72aad67af14193199e29cdd5c4ddc095a8b9a8a8 (diff) | |
download | external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.zip external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.gz external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.bz2 |
Merge WebKit at r61871: Initial merge by git.
Change-Id: I6cff43abca9cc4782e088a469ad4f03f166a65d5
Diffstat (limited to 'WebCore/platform/efl/FileChooserEfl.cpp')
-rw-r--r-- | WebCore/platform/efl/FileChooserEfl.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/WebCore/platform/efl/FileChooserEfl.cpp b/WebCore/platform/efl/FileChooserEfl.cpp index 866caae..c77fa9e 100644 --- a/WebCore/platform/efl/FileChooserEfl.cpp +++ b/WebCore/platform/efl/FileChooserEfl.cpp @@ -31,6 +31,7 @@ #include "FileChooser.h" #include "LocalizedStrings.h" +#include "StringTruncator.h" namespace WebCore { @@ -39,8 +40,15 @@ String FileChooser::basenameForWidth(const Font& font, int width) const if (width <= 0) return String(); + String string; if (m_filenames.isEmpty()) - return fileButtonNoFileSelectedLabel(); + string = fileButtonNoFileSelectedLabel(); + else if (m_filenames.size() == 1) + string = m_filenames[0]; + else + return StringTruncator::rightTruncate(multipleFileUploadText(m_filenames.size()), width, font, false); + + return StringTruncator::centerTruncate(string, static_cast<float>(width), font, false); } } |