4.24 beta

This commit is contained in:
Igor Pavlov
2005-07-05 00:00:00 +00:00
committed by Kornel Lesiński
parent ac2b563958
commit 47f4915611
66 changed files with 757 additions and 366 deletions

View File

@@ -81,7 +81,7 @@ STDMETHODIMP CAgent::SetFiles(const wchar_t *folderPrefix,
_folderPrefix = folderPrefix;
_names.Clear();
_names.Reserve(numNames);
for (int i = 0; i < numNames; i++)
for (UINT32 i = 0; i < numNames; i++)
_names.Add(names[i]);
return S_OK;
}
@@ -249,12 +249,23 @@ STDMETHODIMP CAgent::DoOperation(
for(i = 0; i < m_PropNames.Size(); i++)
names.Add((const wchar_t *)m_PropNames[i]);
RINOK(setProperties->SetProperties(&names.Front(),
&m_PropValues.front(), names.Size()));
NWindows::NCOM::CPropVariant *propValues = new NWindows::NCOM::CPropVariant[m_PropValues.Size()];
try
{
for (int i = 0; i < m_PropValues.Size(); i++)
propValues[i] = m_PropValues[i];
RINOK(setProperties->SetProperties(&names.Front(), propValues, names.Size()));
}
catch(...)
{
delete []propValues;
throw;
}
delete []propValues;
}
}
m_PropNames.Clear();
m_PropValues.clear();
m_PropValues.Clear();
if (sfxModule != NULL)
{
@@ -265,8 +276,7 @@ STDMETHODIMP CAgent::DoOperation(
RINOK(CopyBlock(sfxStream, outStream));
}
return outArchive->UpdateItems(outStream, updatePairs2.Size(),
updateCallback);
return outArchive->UpdateItems(outStream, updatePairs2.Size(),updateCallback);
}
@@ -340,9 +350,9 @@ STDMETHODIMP CAgent::DeleteItems(
_archiveFolderItem->GetRealIndices(indices, numItems, realIndices);
CObjectVector<CUpdatePair2> updatePairs;
int curIndex = 0;
UINT32 numItemsInArchive;
UInt32 numItemsInArchive;
RINOK(GetArchive()->GetNumberOfItems(&numItemsInArchive));
for (int i = 0; i < numItemsInArchive; i++)
for (UInt32 i = 0; i < numItemsInArchive; i++)
{
if (curIndex < realIndices.Size())
if (realIndices[curIndex] == i)
@@ -379,7 +389,7 @@ HRESULT CAgent::CreateFolder(
CObjectVector<CUpdatePair2> updatePairs;
UINT32 numItemsInArchive;
RINOK(GetArchive()->GetNumberOfItems(&numItemsInArchive));
for (int i = 0; i < numItemsInArchive; i++)
for (UInt32 i = 0; i < numItemsInArchive; i++)
{
CUpdatePair2 updatePair;
updatePair.NewData = updatePair.NewProperties = false;
@@ -450,7 +460,7 @@ HRESULT CAgent::RenameItem(
int curIndex = 0;
UINT32 numItemsInArchive;
RINOK(GetArchive()->GetNumberOfItems(&numItemsInArchive));
for (int i = 0; i < numItemsInArchive; i++)
for (UInt32 i = 0; i < numItemsInArchive; i++)
{
if (curIndex < realIndices.Size())
if (realIndices[curIndex] == i)
@@ -495,11 +505,11 @@ STDMETHODIMP CAgent::SetProperties(const wchar_t **names,
const PROPVARIANT *values, INT32 numProperties)
{
m_PropNames.Clear();
m_PropValues.clear();
m_PropValues.Clear();
for (int i = 0; i < numProperties; i++)
{
m_PropNames.Add(names[i]);
m_PropValues.push_back(values[i]);
m_PropValues.Add(values[i]);
}
return S_OK;
}