fix some warnings

svn path=/trunk/; revision=31988
This commit is contained in:
Christoph von Wittich 2008-01-25 13:26:12 +00:00
parent 6fd43506eb
commit d19078580f
8 changed files with 34 additions and 10 deletions

View file

@ -299,10 +299,12 @@ void FileChildWindow::set_curdir(Entry* entry)
SetWindowText(_hwnd, _path);
if (_path[0])
{
if (SetCurrentDirectory(_path))
set_url(_path); //set_url(FmtString(TEXT("file://%s"), _path));
else
_path[0] = TEXT('\0');
}
}
@ -508,8 +510,9 @@ LRESULT FileChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
case WM_CONTEXTMENU: {
// first select the current item in the listbox
HWND hpanel = (HWND) wparam;
const POINTS& pos = MAKEPOINTS(lparam);
POINT pt; POINTSTOPOINT(pt, pos);
POINT pt;
pt.x = LOWORD(lparam);
pt.y = HIWORD(lparam);
POINT pt_screen = pt;
ScreenToClient(hpanel, &pt);
SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt.x, pt.y));

View file

@ -377,12 +377,13 @@ void Pane::draw_item(LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol)
bool following_child = (up->_next->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)!=0; // a directory?
if (!following_child)
{
for(Entry*n=up->_next; n; n=n->_next)
if (n->_down) { // any file with NTFS sub-streams?
following_child = true;
break;
}
}
if (following_child)
#endif
{
@ -403,12 +404,13 @@ void Pane::draw_item(LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol)
bool following_child = (entry->_next->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)!=0; // a directory?
if (!following_child)
{
for(Entry*n=entry->_next; n; n=n->_next)
if (n->_down) { // any file with NTFS sub-streams?
following_child = true;
break;
}
}
if (following_child)
#endif
LineTo(dis->hDC, x, dis->rcItem.bottom);

View file

@ -122,6 +122,7 @@ ShellPath ShellEntry::create_absolute_pidl() const
CONTEXT("ShellEntry::create_absolute_pidl()");
if (_up)
{
if (_up->_etype == ET_SHELL) {
ShellDirectory* dir = static_cast<ShellDirectory*>(_up);
@ -129,7 +130,7 @@ ShellPath ShellEntry::create_absolute_pidl() const
return _pidl.create_absolute_pidl(dir->create_absolute_pidl());
} else
return _pidl.create_absolute_pidl(_up->create_absolute_pidl());
}
return _pidl;
}

View file

@ -314,9 +314,12 @@ LRESULT DesktopBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
return ProcessCopyData((COPYDATASTRUCT*)lparam);
case WM_CONTEXTMENU: {
POINTS p;
p.x = LOWORD(lparam);
p.y = HIWORD(lparam);
PopupMenu menu(IDM_DESKTOPBAR);
SetMenuDefaultItem(menu, 0, MF_BYPOSITION);
menu.TrackPopupMenu(_hwnd, MAKEPOINTS(lparam));
menu.TrackPopupMenu(_hwnd, p);
break;}
case PM_GET_LAST_ACTIVE:

View file

@ -311,7 +311,9 @@ LRESULT StartMenu::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
break;
case WM_MOVE: {
const POINTS& pos = MAKEPOINTS(lparam);
POINTS pos;
pos.x = LOWORD(lparam);
pos.y = HIWORD(lparam);
// move open submenus of floating menus
if (_submenu) {
@ -699,10 +701,12 @@ bool StartMenu::Navigate(int step)
int idx = GetSelectionIndex();
if (idx == -1)
{
if (step > 0)
idx = 0 - step;
else
idx = _buttons.size() - step;
}
for(;;) {
idx += step;
@ -1067,10 +1071,12 @@ ShellEntryMap::iterator StartMenu::AddEntry(const String& title, ICON_ID icon_id
{
// search for an already existing subdirectory entry with the same name
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
for(ShellEntryMap::iterator it=_entries.begin(); it!=_entries.end(); ++it) {
StartMenuEntry& sme = it->second;
if (!_tcsicmp(sme._title, title)) ///@todo speed up by using a map indexed by name
{
for(ShellEntrySet::iterator it2=sme._entries.begin(); it2!=sme._entries.end(); ++it2) {
if ((*it2)->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
// merge the new shell entry with the existing of the same name
@ -1079,7 +1085,9 @@ ShellEntryMap::iterator StartMenu::AddEntry(const String& title, ICON_ID icon_id
return it;
}
}
}
}
}
ShellEntryMap::iterator sme = AddEntry(title, icon_id);

View file

@ -419,6 +419,9 @@ LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
case WM_CONTEXTMENU: {
Point pt(lparam);
POINTS p;
p.x = pt.x;
p.y = pt.y;
ScreenToClient(_hwnd, &pt);
if (IconHitTest(pt) == _sorted_icons.end()) { // display menu only when no icon clicked
@ -426,7 +429,7 @@ LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
SetMenuDefaultItem(menu, 0, MF_BYPOSITION);
CheckMenuItem(menu, ID_SHOW_HIDDEN_ICONS, MF_BYCOMMAND|(_show_hidden?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(menu, ID_SHOW_ICON_BUTTON, MF_BYCOMMAND|(_show_button?MF_CHECKED:MF_UNCHECKED));
menu.TrackPopupMenu(_hwnd, MAKEPOINTS(lparam));
menu.TrackPopupMenu(_hwnd, p);
}
break;}

View file

@ -705,6 +705,7 @@ void XMLReaderBase::StartElementHandler(const XS_String& name, const XMLNode::At
break;
if (p != s)
{
if (_pos->_children.empty()) { // no children in last node?
if (_last_tag == TAG_START)
_pos->_content.append(s, p-s);
@ -714,7 +715,7 @@ void XMLReaderBase::StartElementHandler(const XS_String& name, const XMLNode::At
p = s;
} else
_pos->_children.back()->_trailing.append(s, p-s);
}
std::string leading;
if (p != e)
@ -752,12 +753,14 @@ void XMLReaderBase::EndElementHandler()
}
if (p != s)
{
if (_pos->_children.empty()) // no children in current node?
_pos->_content.append(s, p-s);
else if (_last_tag == TAG_START)
_pos->_content.append(s, p-s);
else
_pos->_children.back()->_trailing.append(s, p-s);
}
if (p != e)
_pos->_end_leading.assign(p, e-p);

View file

@ -361,6 +361,7 @@ bool XMLReaderBase::parse()
for(;;) {
// check for the encoding of the first line end
if (!_endl_defined)
{
if (c == '\n') {
_format._endl = "\n";
_endl_defined = true;
@ -368,7 +369,7 @@ bool XMLReaderBase::parse()
_format._endl = "\r\n";
_endl_defined = true;
}
}
c = get();
if (c == EOF)