fixed stupid bug in my previous check in
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -256,7 +256,7 @@ void XmlResApp::FindFilesInXML(wxXmlNode *node, wxArrayString& flist, const wxSt
|
|||||||
if (node->GetType() != wxXML_ELEMENT_NODE) return;
|
if (node->GetType() != wxXML_ELEMENT_NODE) return;
|
||||||
|
|
||||||
// Does 'node' contain filename information at all?
|
// Does 'node' contain filename information at all?
|
||||||
if (
|
bool containsFilename = (
|
||||||
// Any bitmaps:
|
// Any bitmaps:
|
||||||
(node->GetName() == _T("bitmap")) ||
|
(node->GetName() == _T("bitmap")) ||
|
||||||
// URLs in wxHtmlWindow:
|
// URLs in wxHtmlWindow:
|
||||||
@@ -267,39 +267,39 @@ void XmlResApp::FindFilesInXML(wxXmlNode *node, wxArrayString& flist, const wxSt
|
|||||||
(node->GetName() == _T("focus") ||
|
(node->GetName() == _T("focus") ||
|
||||||
node->GetName() == _T("disabled") ||
|
node->GetName() == _T("disabled") ||
|
||||||
node->GetName() == _T("selected")))
|
node->GetName() == _T("selected")))
|
||||||
)
|
);
|
||||||
|
|
||||||
|
wxXmlNode *n = node->GetChildren();
|
||||||
|
while (n)
|
||||||
{
|
{
|
||||||
wxXmlNode *n = node->GetChildren();
|
if (containsFilename &&
|
||||||
while (n)
|
(n->GetType() == wxXML_TEXT_NODE ||
|
||||||
|
n->GetType() == wxXML_CDATA_SECTION_NODE))
|
||||||
{
|
{
|
||||||
if (n->GetType() == wxXML_TEXT_NODE ||
|
wxString fullname;
|
||||||
n->GetType() == wxXML_CDATA_SECTION_NODE)
|
if (wxIsAbsolutePath(n->GetContent()) || inputPath == "")
|
||||||
{
|
fullname = n->GetContent();
|
||||||
wxString fullname;
|
else
|
||||||
if (wxIsAbsolutePath(n->GetContent()) || inputPath == "")
|
fullname = inputPath + "/" + n->GetContent();
|
||||||
fullname = n->GetContent();
|
|
||||||
else
|
|
||||||
fullname = inputPath + "/" + n->GetContent();
|
|
||||||
|
|
||||||
if (flagVerbose)
|
if (flagVerbose)
|
||||||
wxPrintf("adding " + fullname + "...\n");
|
wxPrintf("adding " + fullname + "...\n");
|
||||||
|
|
||||||
wxString filename = GetInternalFileName(n->GetContent(), flist);
|
wxString filename = GetInternalFileName(n->GetContent(), flist);
|
||||||
n->SetContent(filename);
|
n->SetContent(filename);
|
||||||
|
|
||||||
flist.Add(filename);
|
flist.Add(filename);
|
||||||
|
|
||||||
wxFileInputStream sin(fullname);
|
wxFileInputStream sin(fullname);
|
||||||
wxFileOutputStream sout(parOutputPath + "/" + filename);
|
wxFileOutputStream sout(parOutputPath + "/" + filename);
|
||||||
sin.Read(sout); // copy the stream
|
sin.Read(sout); // copy the stream
|
||||||
}
|
|
||||||
|
|
||||||
// subnodes:
|
|
||||||
if (n->GetType() == wxXML_ELEMENT_NODE)
|
|
||||||
FindFilesInXML(n, flist, inputPath);
|
|
||||||
|
|
||||||
n = n->GetNext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// subnodes:
|
||||||
|
if (n->GetType() == wxXML_ELEMENT_NODE)
|
||||||
|
FindFilesInXML(n, flist, inputPath);
|
||||||
|
|
||||||
|
n = n->GetNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -256,7 +256,7 @@ void XmlResApp::FindFilesInXML(wxXmlNode *node, wxArrayString& flist, const wxSt
|
|||||||
if (node->GetType() != wxXML_ELEMENT_NODE) return;
|
if (node->GetType() != wxXML_ELEMENT_NODE) return;
|
||||||
|
|
||||||
// Does 'node' contain filename information at all?
|
// Does 'node' contain filename information at all?
|
||||||
if (
|
bool containsFilename = (
|
||||||
// Any bitmaps:
|
// Any bitmaps:
|
||||||
(node->GetName() == _T("bitmap")) ||
|
(node->GetName() == _T("bitmap")) ||
|
||||||
// URLs in wxHtmlWindow:
|
// URLs in wxHtmlWindow:
|
||||||
@@ -267,39 +267,39 @@ void XmlResApp::FindFilesInXML(wxXmlNode *node, wxArrayString& flist, const wxSt
|
|||||||
(node->GetName() == _T("focus") ||
|
(node->GetName() == _T("focus") ||
|
||||||
node->GetName() == _T("disabled") ||
|
node->GetName() == _T("disabled") ||
|
||||||
node->GetName() == _T("selected")))
|
node->GetName() == _T("selected")))
|
||||||
)
|
);
|
||||||
|
|
||||||
|
wxXmlNode *n = node->GetChildren();
|
||||||
|
while (n)
|
||||||
{
|
{
|
||||||
wxXmlNode *n = node->GetChildren();
|
if (containsFilename &&
|
||||||
while (n)
|
(n->GetType() == wxXML_TEXT_NODE ||
|
||||||
|
n->GetType() == wxXML_CDATA_SECTION_NODE))
|
||||||
{
|
{
|
||||||
if (n->GetType() == wxXML_TEXT_NODE ||
|
wxString fullname;
|
||||||
n->GetType() == wxXML_CDATA_SECTION_NODE)
|
if (wxIsAbsolutePath(n->GetContent()) || inputPath == "")
|
||||||
{
|
fullname = n->GetContent();
|
||||||
wxString fullname;
|
else
|
||||||
if (wxIsAbsolutePath(n->GetContent()) || inputPath == "")
|
fullname = inputPath + "/" + n->GetContent();
|
||||||
fullname = n->GetContent();
|
|
||||||
else
|
|
||||||
fullname = inputPath + "/" + n->GetContent();
|
|
||||||
|
|
||||||
if (flagVerbose)
|
if (flagVerbose)
|
||||||
wxPrintf("adding " + fullname + "...\n");
|
wxPrintf("adding " + fullname + "...\n");
|
||||||
|
|
||||||
wxString filename = GetInternalFileName(n->GetContent(), flist);
|
wxString filename = GetInternalFileName(n->GetContent(), flist);
|
||||||
n->SetContent(filename);
|
n->SetContent(filename);
|
||||||
|
|
||||||
flist.Add(filename);
|
flist.Add(filename);
|
||||||
|
|
||||||
wxFileInputStream sin(fullname);
|
wxFileInputStream sin(fullname);
|
||||||
wxFileOutputStream sout(parOutputPath + "/" + filename);
|
wxFileOutputStream sout(parOutputPath + "/" + filename);
|
||||||
sin.Read(sout); // copy the stream
|
sin.Read(sout); // copy the stream
|
||||||
}
|
|
||||||
|
|
||||||
// subnodes:
|
|
||||||
if (n->GetType() == wxXML_ELEMENT_NODE)
|
|
||||||
FindFilesInXML(n, flist, inputPath);
|
|
||||||
|
|
||||||
n = n->GetNext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// subnodes:
|
||||||
|
if (n->GetType() == wxXML_ELEMENT_NODE)
|
||||||
|
FindFilesInXML(n, flist, inputPath);
|
||||||
|
|
||||||
|
n = n->GetNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user