Fix assert when constructing invalid wxGBSpan inside wxWidgets itself.

Various wxGridBagSizer methods returning wxGBSpan asserted when trying to
construct an invalid wxGBSpan as its components must now (since r66964) be
positive.

Fix this by adding a special new method to wxGBSpan for constructing such
invalid spans and use it now.

Closes #15124.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73731 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-03-27 23:10:25 +00:00
parent 1127eb3a6a
commit 46e2a1b8c2
2 changed files with 18 additions and 6 deletions

View File

@@ -67,6 +67,14 @@ public:
// default copy ctor and assignment operator are okay.
// Factor constructor creating an invalid wxGBSpan: this is mostly supposed
// to be used as return value for functions returning wxGBSpan in case of
// errors.
static wxGBSpan Invalid()
{
return wxGBSpan(NULL);
}
int GetRowspan() const { return m_rowspan; }
int GetColspan() const { return m_colspan; }
void SetRowspan(int rowspan)
@@ -87,6 +95,13 @@ public:
bool operator!=(const wxGBSpan& o) const { return !(*this == o); }
private:
// This private ctor is used by Invalid() only.
wxGBSpan(struct InvalidCtorTag*)
{
m_rowspan =
m_colspan = -1;
}
void Init()
{
m_rowspan =