use correct wxELLIPSIZE_* constants after r57625
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57626 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -241,7 +241,7 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc,
|
|||||||
// remove characters in excess
|
// remove characters in excess
|
||||||
size_t initialChar, // index of first char to erase
|
size_t initialChar, // index of first char to erase
|
||||||
nChars; // how many chars do we need to erase?
|
nChars; // how many chars do we need to erase?
|
||||||
if (mode == wxST_ELLIPSIZE_START)
|
if (mode == wxELLIPSIZE_START)
|
||||||
{
|
{
|
||||||
initialChar = 0;
|
initialChar = 0;
|
||||||
for (nChars=0;
|
for (nChars=0;
|
||||||
@@ -249,7 +249,7 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc,
|
|||||||
nChars++)
|
nChars++)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
else if (mode == wxST_ELLIPSIZE_MIDDLE)
|
else if (mode == wxELLIPSIZE_MIDDLE)
|
||||||
{
|
{
|
||||||
// the start & end of the removed span of chars
|
// the start & end of the removed span of chars
|
||||||
initialChar = len/2;
|
initialChar = len/2;
|
||||||
@@ -293,7 +293,7 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxASSERT(mode == wxST_ELLIPSIZE_END);
|
wxASSERT(mode == wxELLIPSIZE_END);
|
||||||
wxASSERT(len > 0);
|
wxASSERT(len > 0);
|
||||||
|
|
||||||
int maxWidth = totalWidth - excessPixels;
|
int maxWidth = totalWidth - excessPixels;
|
||||||
@@ -330,7 +330,7 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if everything was ok, we should have shortened this line
|
// if everything was ok, we should have shortened this line
|
||||||
// enough to make it fit in sz.maxFinalWidth:
|
// enough to make it fit in maxFinalWidth:
|
||||||
wxASSERT(dc.GetTextExtent(curLine).GetWidth() < maxFinalWidth);
|
wxASSERT(dc.GetTextExtent(curLine).GetWidth() < maxFinalWidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -339,6 +339,7 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc,
|
|||||||
ret << curLine;
|
ret << curLine;
|
||||||
if ( pc == label.end() )
|
if ( pc == label.end() )
|
||||||
{
|
{
|
||||||
|
// NOTE: this is the return which always exits the function
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -368,7 +369,10 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
// this return would generate a
|
||||||
|
// warning C4702: unreachable code
|
||||||
|
// with MSVC since the function always exits from inside the loop
|
||||||
|
//return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBorder wxControlBase::GetDefaultBorder() const
|
wxBorder wxControlBase::GetDefaultBorder() const
|
||||||
|
Reference in New Issue
Block a user