break;
case wxT('.'):
- CHECK_PREC
+ // don't use CHECK_PREC here to avoid warning about the value
+ // assigned to prec_dot inside it being never used (because
+ // overwritten just below) from Borland in release build
+ if (in_prec && !prec_dot)
+ m_szFlags[flagofs++] = '.';
in_prec = true;
prec_dot = false;
m_nMaxWidth = 0;
wxSizer *wxDialogBase::CreateButtonSizer(long flags)
{
- wxSizer *sizer = NULL;
-
#ifdef __SMARTPHONE__
wxDialog* dialog = (wxDialog*) this;
if ( flags & wxOK )
if ( flags & wxNO )
dialog->SetRightMenu(wxID_NO);
+
+ return NULL;
#else // !__SMARTPHONE__
#if wxUSE_BUTTON
wxSystemOptions::GetOptionInt(wxT("wince.dialog.real-ok-cancel")) )
#endif // __POCKETPC__
{
- sizer = CreateStdDialogButtonSizer(flags);
+ return CreateStdDialogButtonSizer(flags);
}
+#ifdef __POCKETPC__
+ return NULL;
+#endif // __POCKETPC__
+
#else // !wxUSE_BUTTON
wxUnusedVar(flags);
+
+ return NULL;
#endif // wxUSE_BUTTON/!wxUSE_BUTTON
#endif // __SMARTPHONE__/!__SMARTPHONE__
-
- return sizer;
}
wxSizer *wxDialogBase::CreateSeparatedButtonSizer(long flags)
if ( evtConnRef )
evtConnRef->IncRef( );
else
- evtConnRef = new wxEventConnectionRef(this, eventSink);
+ new wxEventConnectionRef(this, eventSink);
}
}
static void AdjustFontSize(wxFont& font, wxDC& dc, const wxSize& pixelSize)
{
- int currentSize = 0;
int largestGood = 0;
int smallestBad = 0;
// NB: this assignment was separated from the variable definition
// in order to fix a gcc v3.3.3 compiler crash
- currentSize = font.GetPointSize();
+ int currentSize = font.GetPointSize();
while (currentSize > 0)
{
dc.SetFont(font);
// compute which columns needs to be redrawn
unsigned int cols = GetOwner()->GetColumnCount();
unsigned int col_start = 0;
- unsigned int x_start = 0;
+ unsigned int x_start;
for (x_start = 0; col_start < cols; col_start++)
{
wxDataViewColumn *col = GetOwner()->GetColumn(col_start);
{
wxRect rect = GetClientRect();
int colnum = 0;
- int x_start = 0, x_end = 0, w = 0;
+ int x_start = 0, w = 0;
int xx, yy, xe;
m_owner->CalcUnscrolledPosition( rect.x, rect.y, &xx, &yy );
for (x_start = 0; colnum < column; colnum++)
x_start += w;
}
- x_end = x_start + w;
+ int x_end = x_start + w;
xe = xx + rect.width;
if( x_end > xe )
{
{
if (IsVirtualList())
return;
-
+
wxDataViewTreeNode * node = GetTreeNodeByRow(row);
if( node != NULL )
{
wxDataViewColumn *col = NULL;
unsigned int cols = GetOwner()->GetColumnCount();
unsigned int colnum = 0;
- unsigned int x_start = 0;
int x, y;
m_owner->CalcUnscrolledPosition( point.x, point.y, &x, &y );
- for (x_start = 0; colnum < cols; colnum++)
+ for (unsigned x_start = 0; colnum < cols; colnum++)
{
col = GetOwner()->GetColumn(colnum);
if (col->IsHidden())
//Compose the a parent-chain of the finding item
ItemList list;
- wxDataViewItem * pItem = NULL;
+ wxDataViewItem * pItem;
list.DeleteContents( true );
wxDataViewItem it( item );
while( it.IsOk() )
{
m_cols.DeleteContents(true);
m_notifier = NULL;
-
+
// No sorting column at start
m_sortingColumn = NULL;
m_headerArea = NULL;
wxSize newsize = size;
if (!HasFlag(wxDV_NO_HEADER) && (m_headerArea))
newsize.y -= m_headerArea->GetSize().y;
-
+
return newsize;
}
if ((ctrl || alt) && !(ctrl && alt))
return false;
- int key = 0;
- bool keyOk = true;
-
-#ifdef __WXGTK20__
- // If it's a F-Key or other special key then it shouldn't start the
- // editor.
- if (event.GetKeyCode() >= WXK_START)
- return false;
-#endif
#if wxUSE_UNICODE
// if the unicode key code is not really a unicode character (it may
// be a function key or etc., the platforms appear to always give us a
// small value in this case) then fallback to the ASCII key code but
// don't do anything for function keys or etc.
- key = event.GetUnicodeKey();
- if (key <= 127)
- {
- key = event.GetKeyCode();
- keyOk = (key <= 127);
- }
+ if ( event.GetUnicodeKey() > 127 && event.GetKeyCode() > 127 )
+ return false;
#else
- key = event.GetKeyCode();
- keyOk = (key <= 255);
+ if ( event.GetKeyCode() > 255 )
+ return false;
#endif
- return keyOk;
+ return true;
}
void wxGridCellEditor::StartingKey(wxKeyEvent& event)
m_colWidths.Add( m_defaultColWidth, m_numCols );
- int colRight = 0;
for ( int i = 0; i < m_numCols; i++ )
{
- colRight = ( GetColPos( i ) + 1 ) * m_defaultColWidth;
+ int colRight = ( GetColPos( i ) + 1 ) * m_defaultColWidth;
m_colRights.Add( colRight );
}
}
// open file
// ---------
- bool bOk = false;
+ bool bOk;
if ( wxFile::Exists(filename) ) {
bool bAppend = false;
wxString strMsg;
else
state_w += MARGIN_BETWEEN_IMAGE_AND_TEXT;
}
- else
- {
- state = wxTREE_ITEMSTATE_NONE;
- }
}
m_height = (image_h > text_h) ? image_h : text_h;
while (substitutions[substitutions_cnt].code != 0)
substitutions_cnt++;
- wxHtmlEntityInfo *info = NULL;
+ wxHtmlEntityInfo *info;
#ifdef __WXWINCE__
// bsearch crashes under WinCE for some reason
+ info = NULL;
size_t i;
for (i = 0; i < substitutions_cnt; i++)
{
int ppiPrinterX, ppiPrinterY;
GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
+ wxUnusedVar(ppiPrinterX);
int ppiScreenX, ppiScreenY;
GetPPIScreen(&ppiScreenX, &ppiScreenY);
+ wxUnusedVar(ppiScreenX);
wxDisplaySize(&scr_w, &scr_h);
GetDC()->GetSize(&dc_w, &dc_h);
if (m_movie)
Cleanup();
- bool result = true;
- OSErr err = noErr;
short movieResFile = 0; //= 0 because of annoying VC6 warning
FSSpec sfFile;
- err = m_lib.NativePathNameToFSSpec(
+ OSErr err = m_lib.NativePathNameToFSSpec(
(char*) (const char*) fileName.mb_str(),
&sfFile, 0);
- result = (err == noErr);
+ bool result = (err == noErr);
if (result)
{
HRESULT hret =
cpContainer->FindConnectionPoint(ta->guid, cp.GetRef());
- wxASSERT ( SUCCEEDED(hret));
+ if ( !SUCCEEDED(hret) )
+ {
+ wxFAIL_MSG( wxString::Format("FindConnectionPoint(): %X",
+ (unsigned)hret) );
+ }
IDispatch* disp;
frame->QueryInterface(IID_IDispatch, (void**)&disp);
hret = cp->Advise(new wxActiveXEvents(this, ta->guid),
&adviseCookie);
- wxASSERT_MSG( SUCCEEDED(hret),
- wxString::Format(wxT("Cannot connect!\nHRESULT:%X"), (unsigned int)hret)
- );
+ if ( !SUCCEEDED(hret) )
+ {
+ wxFAIL_MSG( wxString::Format("Advise(): %X",
+ (unsigned)hret) );
+ }
}
}
{
wxTopLevelWindowBase::SetIcons(icons);
- bool ok = DoSelectAndSetIcon(icons, SM_CXSMICON, SM_CYSMICON, ICON_SMALL);
- if ( DoSelectAndSetIcon(icons, SM_CXICON, SM_CYICON, ICON_BIG) )
- ok = true;
-
- wxASSERT_MSG( ok, "icon bundle doesn't contain any suitable icon" );
+ if ( !DoSelectAndSetIcon(icons, SM_CXSMICON, SM_CYSMICON, ICON_SMALL) &&
+ !DoSelectAndSetIcon(icons, SM_CXICON, SM_CYICON, ICON_BIG) )
+ {
+ wxFAIL_MSG( "icon bundle doesn't contain any suitable icon" );
+ }
}
bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
rc.result = MSWDefWindowProc(message, wParam, lParam);
processed = true;
- // now alter the client size making room for drawing a themed border
- NCCALCSIZE_PARAMS *csparam = NULL;
+ // now alter the client size making room for drawing a
+ // themed border
RECT *rect;
if ( wParam )
{
- csparam = (NCCALCSIZE_PARAMS *)lParam;
+ NCCALCSIZE_PARAMS *csparam = (NCCALCSIZE_PARAMS *)lParam;
rect = &csparam->rgrc[0];
}
else