]> git.saurik.com Git - wxWidgets.git/commitdiff
revert insert=>append change; only for wxELLIPSIZE_END append() is valid
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 8 Feb 2009 19:14:56 +0000 (19:14 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 8 Feb 2009 19:14:56 +0000 (19:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/ctrlcmn.cpp

index 3b32359f668223c26b6a322669c4d4d254c96dc9..b5e5ad8891b27242a901cbc313a3839ccb3fc3da 100644 (file)
@@ -254,6 +254,7 @@ wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxD
     int excessPixels = totalWidth - maxFinalWidth +
                        replacementWidth +
                        marginWidth;     // security margin (NEEDED!)
+    wxASSERT(excessPixels>0);
 
     // remove characters in excess
     size_t initialChar,     // index of first char to erase
@@ -353,7 +354,7 @@ wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxD
 
         // if there is space for the replacement dots, add them
         if (maxFinalWidth > replacementWidth)
-            ret.append(wxELLIPSE_REPLACEMENT);//.insert(initialChar, wxELLIPSE_REPLACEMENT);
+            ret.insert(initialChar, wxELLIPSE_REPLACEMENT);
     }
 
     // if everything was ok, we should have shortened this line