examples: UWord now checks for correct file types in drop

git-svn-id: svn://ultimatepp.org/upp/trunk@5697 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-01-02 22:00:20 +00:00
parent eb9cda0219
commit d3a2d90f9d

View file

@ -139,11 +139,24 @@ void UWord::Open()
void UWord::DragAndDrop(Point, PasteClip& d)
{
if(AcceptFiles(d)) {
if(IsAvailableFiles(d)) {
Vector<String> fn = GetFiles(d);
for(int i = 0; i < fn.GetCount(); i++)
if(FileExists(fn[i]))
OpenFile(fn[i]);
for(int open = 0; open < 2; open++) {
for(int i = 0; i < fn.GetCount(); i++) {
String ext = GetFileExt(fn[i]);
if(FileExists(fn[i]) && (ext == ".rtf" || ext == ".qtf")) {
if(open)
OpenFile(fn[i]);
else {
if(d.Accept())
break;
return;
}
}
}
if(!d.IsAccepted())
return;
}
}
}