Compare commits

..

2 Commits

Author SHA1 Message Date
d48fbe5f38 . 2025-02-04 20:12:47 +03:00
6e65479569 fix bug #71868 2025-02-04 19:35:35 +03:00
13 changed files with 112 additions and 148 deletions

View File

@ -160,30 +160,16 @@ void CGraphicsEmbed::SetAppImage(CGraphicsAppImage* appImage)
JSSmart<CJSValue> CGraphicsEmbed::create(JSSmart<CJSValue> Native, JSSmart<CJSValue> width_px, JSSmart<CJSValue> height_px, JSSmart<CJSValue> width_mm, JSSmart<CJSValue> height_mm)
{
NSNativeControl::CNativeControl* pControl = NULL;
if (!Native->isNull())
{
JSSmart<CJSObject> pNativeObject = Native->toObject();
CJSEmbedObject* pNativeEmbedObject = pNativeObject->getNative();
pControl = (NSNativeControl::CNativeControl*)Native->toObject()->getNative()->getObject();
if (m_pInternal->m_pAppImage)
delete m_pInternal->m_pAppImage;
m_pInternal->m_pAppImage = new CGraphicsAppImage();
if (pNativeEmbedObject)
{
NSNativeControl::CNativeControl* pControl = (NSNativeControl::CNativeControl*)pNativeEmbedObject->getObject();
m_pInternal->m_pAppImage->SetFontsDirectory(pControl->m_strFontsDirectory);
m_pInternal->m_pAppImage->SetImagesDirectory(pControl->m_strImagesDirectory);
}
else
{
JSSmart<CJSValue> checkResources = pNativeObject->get("isResourcesObject");
if (checkResources->isBool() && true == checkResources->toBool())
{
m_pInternal->m_pAppImage->SetFontsDirectory(pNativeObject->get("fontsDirectory")->toStringW());
m_pInternal->m_pAppImage->SetImagesDirectory(pNativeObject->get("imagesDirectory")->toStringW());
}
}
m_pInternal->m_pAppImage->SetFontsDirectory(pControl->m_strFontsDirectory);
m_pInternal->m_pAppImage->SetImagesDirectory(pControl->m_strImagesDirectory);
}
m_pInternal->init(width_px->toDouble(), height_px->toDouble(), width_mm->toDouble(), height_mm->toDouble());

View File

@ -374,7 +374,7 @@ namespace NSJSBase
JSSmart<CJSContext> CJSContext::GetCurrent()
{
CJSContext* ret = new CJSContext(false);
CJSContext* ret = new CJSContext();
ret->m_internal->context = NSJSBase::CJSContextPrivate::GetCurrentContext();
return ret;
}

View File

@ -730,14 +730,14 @@ bool Location::IsTouching() noexcept
PointD pt;
bool straight = C.IsStraight() && Inters->C.IsStraight();
return !straight || !intersect(C.Segment1.P.X,
C.Segment1.P.Y,
C.Segment2.P.X,
C.Segment2.P.Y,
Inters->C.Segment1.P.X,
Inters->C.Segment1.P.Y,
Inters->C.Segment2.P.X,
Inters->C.Segment2.P.Y, pt);
return !straight || !intersect({C.Segment1.P.X,
C.Segment1.P.Y,
C.Segment2.P.X,
C.Segment2.P.Y,
Inters->C.Segment1.P.X,
Inters->C.Segment1.P.Y,
Inters->C.Segment2.P.X,
Inters->C.Segment2.P.Y}, pt);
}
CBooleanOperations::CBooleanOperations(const CGraphicsPath& path1,
@ -943,7 +943,7 @@ void CBooleanOperations::TraceAllOverlap()
{
int touchCount = 0;
for (const auto& c : OriginCurves2)
count1 += CheckInters(s, c, touchCount);
count1 += CheckInters(MIN_POINT, s, c, touchCount);
break;
}
}
@ -954,7 +954,7 @@ void CBooleanOperations::TraceAllOverlap()
{
int touchCount = 0;
for (const auto& c : OriginCurves1)
count2 += CheckInters(s, c, touchCount);
count2 += CheckInters(MIN_POINT, s, c, touchCount);
break;
}
}
@ -1255,26 +1255,20 @@ void CBooleanOperations::SetVisited(const Segment& segment)
std::vector<std::vector<int>> CBooleanOperations::FindBoundsCollisions()
{
int length1 = static_cast<int>(Curves1.size()),
length2 = static_cast<int>(Curves2.size());
std::vector<std::vector<double>> allBounds, bounds2;
allBounds.reserve(length1 + length2);
bounds2.reserve(length2);
for (const auto& c : Curves1)
allBounds.emplace_back(c.GetBound());
allBounds.push_back(c.GetBound());
for (const auto& c : Curves2)
bounds2.emplace_back(c.GetBound());
bounds2.push_back(c.GetBound());
bool self = allBounds == bounds2;
if (!self)
{
allBounds.resize(length1 + length2);
for (size_t i = 0; i < length2; i++)
allBounds[i + length1] = std::move(bounds2[i]);
}
for (auto it = bounds2.begin(); it != bounds2.end(); ++it)
allBounds.push_back(*it);
int allLength = static_cast<int>(allBounds.size());
int allLength = static_cast<int>(allBounds.size()),
length1 = static_cast<int>(Curves1.size());
std::vector<int> allIdicesByPri1(allLength);
for (int i = 0; i < allLength; i++)
@ -1508,8 +1502,8 @@ void CBooleanOperations::LinkIntersection(std::shared_ptr<Location> from,
void CBooleanOperations::AddLineIntersection(const Curve& curve1, const Curve& curve2)
{
PointD pt;
if (intersect(curve1.Segment1.P.X, curve1.Segment1.P.Y, curve1.Segment2.P.X, curve1.Segment2.P.Y,
curve2.Segment1.P.X, curve2.Segment1.P.Y, curve2.Segment2.P.X, curve2.Segment2.P.Y, pt))
if (intersect({curve1.Segment1.P.X, curve1.Segment1.P.Y, curve1.Segment2.P.X, curve1.Segment2.P.Y,
curve2.Segment1.P.X, curve2.Segment1.P.Y, curve2.Segment2.P.X, curve2.Segment2.P.Y}, pt))
AddLocation(curve1, curve2, curve1.GetTimeOf(pt), curve2.GetTimeOf(pt));
}
@ -1632,10 +1626,10 @@ int CBooleanOperations::AddCurveIntersection(const Curve& curve1, const Curve& c
return calls;
}
int CBooleanOperations::CheckInters(const Segment& segment, const Curve& curve, int& touchCount) const
int CBooleanOperations::CheckInters(const PointD& point, const Segment& segment, const Curve& curve, int& touchCount) const
{
PointD pt{};
if (intersect(MIN_POINT.X, MIN_POINT.Y, segment.P.X, segment.P.Y, curve.Segment1.P.X, curve.Segment1.P.Y, curve.Segment2.P.X, curve.Segment2.P.Y, pt))
if (intersect({point.X, point.Y, segment.P.X, segment.P.Y, curve.Segment1.P.X, curve.Segment1.P.Y, curve.Segment2.P.X, curve.Segment2.P.Y}, pt))
{
if (getDistance(segment.P, pt) <= GEOMETRIC_EPSILON) return (touchCount + 1) % 2;
if (getDistance(curve.Segment1.P, pt) <= GEOMETRIC_EPSILON || getDistance(curve.Segment2.P, pt) <= GEOMETRIC_EPSILON)
@ -1648,8 +1642,8 @@ int CBooleanOperations::CheckInters(const Segment& segment, const Curve& curve,
}
if (!curve.IsStraight())
{
std::vector<double> roots = curve.GetCurveLineIntersection(segment.P.X,segment.P.Y, MIN_POINT.X - segment.P.X, MIN_POINT.Y - segment.P.Y);
Curve line(segment, Segment(MIN_POINT));
std::vector<double> roots = curve.GetCurveLineIntersection(segment.P.X,segment.P.Y, point.X - segment.P.X, point.Y - segment.P.Y);
Curve line(segment, Segment(point));
int count = 0;
for (const auto& r : roots)
@ -1678,7 +1672,7 @@ void CBooleanOperations::SetWinding()
int count = 0,
touchCount = 0;
for (const auto& c : OriginCurves2)
count += CheckInters(s1, c, touchCount);
count += CheckInters(MIN_POINT, s1, c, touchCount);
for (auto& s : Segments1)
s.Winding = count % 2;
@ -1686,7 +1680,7 @@ void CBooleanOperations::SetWinding()
count = 0;
touchCount = 0;
for (const auto& c : OriginCurves1)
count += CheckInters(s2, c, touchCount);
count += CheckInters(MIN_POINT, s2, c, touchCount);
for (auto& s : Segments2)
s.Winding = count % 2;
@ -1704,7 +1698,7 @@ void CBooleanOperations::SetWinding()
int count = 0,
touchCount = 0;
for (const auto& c : (s.Id == 1 ? OriginCurves2 : OriginCurves1))
count += CheckInters(s, c, touchCount);
count += CheckInters(MIN_POINT, s, c, touchCount);
do
{

View File

@ -140,7 +140,7 @@ namespace Aggplus
void AddCurveLineIntersection(const Curve& curve1, const Curve& curve2, bool flip);
int AddCurveIntersection(const Curve& curve1, const Curve& curve2, const Curve& startCurve1, const Curve& startCurve2, bool flip,
int recursion = 0, int calls = 0, double tMin = 0.0, double tMax = 1.0, double uMin = 0.0, double uMax = 1.0);
int CheckInters(const Segment& segment, const Curve& curve, int& touchCount) const;
int CheckInters(const PointD& point, const Segment& segment, const Curve& curve, int& touchCount) const;
void SetWinding();
// Location

View File

@ -837,13 +837,12 @@ namespace Aggplus
{
std::vector<PointD> points;
unsigned length = m_internal->m_agg_ps.total_vertices();
points.resize(count);
for (unsigned i = 0; i < count; i++)
{
double x,y;
if (idx + i > length) break;
this->m_internal->m_agg_ps.vertex(idx + i, &x, &y);
points[i] = PointD(x, y);
points.push_back(PointD(x, y));
}
return points;
@ -886,37 +885,37 @@ namespace Aggplus
{
std::vector<CGraphicsPath> result;
CGraphicsPath subPath;
bool close = true;
CGraphicsPath sub_path;
for (unsigned i = 0; i < m_internal->m_agg_ps.total_vertices(); i++)
{
if (IsMovePoint(i))
{
if (!close)
{
PointD firstPoint = sub_path.GetPoints(0, 1)[0];
PointD firstPoint = subPath.GetPoints(0, 1)[0];
double x, y;
sub_path.GetLastPoint(x, y);
subPath.GetLastPoint(x, y);
if ((abs(firstPoint.X - x) <= 1e-2 && abs(firstPoint.Y - y) <= 1e-2) ||
sub_path.GetPointCount() == 1)
subPath.GetPointCount() == 1)
{
if (!firstPoint.Equals(PointD(x, y)) || sub_path.GetPointCount() == 1)
sub_path.LineTo(firstPoint.X, firstPoint.Y);
sub_path.CloseFigure();
if (!firstPoint.Equals(PointD(x, y)) || subPath.GetPointCount() == 1)
subPath.LineTo(firstPoint.X, firstPoint.Y);
subPath.CloseFigure();
}
result.push_back(sub_path);
sub_path.Reset();
result.push_back(subPath);
subPath.Reset();
}
sub_path.StartFigure();
subPath.StartFigure();
PointD point = GetPoints(i, 1)[0];
sub_path.MoveTo(point.X, point.Y);
subPath.MoveTo(point.X, point.Y);
close = false;
}
else if (IsCurvePoint(i))
{
std::vector<PointD> points = GetPoints(i, 3);
sub_path.CurveTo(points[0].X, points[0].Y,
subPath.CurveTo(points[0].X, points[0].Y,
points[1].X, points[1].Y,
points[2].X, points[2].Y);
i += 2;
@ -924,40 +923,40 @@ namespace Aggplus
else if (IsLinePoint(i))
{
PointD point = GetPoints(i, 1)[0];
sub_path.LineTo(point.X, point.Y);
subPath.LineTo(point.X, point.Y);
}
else if (IsClosePoint(i))
{
PointD firstPoint = sub_path.GetPoints(0, 1)[0];
PointD firstPoint = subPath.GetPoints(0, 1)[0];
double x, y;
sub_path.GetLastPoint(x, y);
subPath.GetLastPoint(x, y);
if (!firstPoint.Equals(PointD(x, y)) || sub_path.GetPointCount() == 1)
sub_path.LineTo(firstPoint.X, firstPoint.Y);
if (!firstPoint.Equals(PointD(x, y)) || subPath.GetPointCount() == 1)
subPath.LineTo(firstPoint.X, firstPoint.Y);
sub_path.CloseFigure();
result.push_back(sub_path);
sub_path.Reset();
subPath.CloseFigure();
result.push_back(subPath);
subPath.Reset();
close = true;
}
}
if (!close)
{
PointD firstPoint = sub_path.GetPoints(0, 1)[0];
PointD firstPoint = subPath.GetPoints(0, 1)[0];
double x, y;
sub_path.GetLastPoint(x, y);
subPath.GetLastPoint(x, y);
if ((abs(firstPoint.X - x) <= 1e-2 && abs(firstPoint.Y - y) <= 1e-2) ||
sub_path.GetPointCount() == 1)
subPath.GetPointCount() == 1)
{
if (!firstPoint.Equals(PointD(x, y)) ||
sub_path.GetPointCount() == 1)
sub_path.LineTo(firstPoint.X, firstPoint.Y);
sub_path.CloseFigure();
subPath.GetPointCount() == 1)
subPath.LineTo(firstPoint.X, firstPoint.Y);
subPath.CloseFigure();
}
result.push_back(sub_path);
result.push_back(subPath);
}
return result;

View File

@ -151,28 +151,27 @@ inline double integrate(const double& ax, const double& bx, const double& cx, co
return A * sum;
}
inline bool intersect(double v0, double v1, double v2, double v3, double v4,
double v5, double v6, double v7, Aggplus::PointD& res)
inline bool intersect(std::vector<double> v, Aggplus::PointD& res)
{
v2 -= v0;
v3 -= v1;
v6 -= v4;
v7 -= v5;
v[2] -= v[0];
v[3] -= v[1];
v[6] -= v[4];
v[7] -= v[5];
double cross = v2 * v7 - v3 * v6;
double cross = v[2] * v[7] - v[3] * v[6];
if (!isMachineZero(cross))
{
double dx = v0 - v4,
dy = v1 - v5,
u1 = (v6 * dy - v7 * dx) / cross,
u2 = (v2 * dy - v3 * dx) / cross,
double dx = v[0] - v[4],
dy = v[1] - v[5],
u1 = (v[6] * dy - v[7] * dx) / cross,
u2 = (v[2] * dy - v[3] * dx) / cross,
uMin = -EPSILON,
uMax = 1 + EPSILON;
if (uMin < u1 && u1 < uMax && uMin < u2 && u2 < uMax)
{
u1 = u1 <= 0 ? 0 : u1 >= 1 ? 1 : u1;
res = Aggplus::PointD(v0 + u1 * v2, v1 + u1 * v3);
res = Aggplus::PointD(v[0] + u1 * v[2], v[1] + u1 * v[3]);
return true;
}

View File

@ -133,7 +133,8 @@ _UINT32 COfficePPTFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDs
oPPTXWriter.m_xmlApp = ((PPT::CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_app_xml;
oPPTXWriter.m_xmlCore = ((PPT::CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_core_xml;
oPPTXWriter.CreateFile(((PPT::CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers[0]);
if (false == oPPTXWriter.CreateFile(((PPT::CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers[0]))
return AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_TEMP_DIR;
oPPTXWriter.CloseFile();
}
return S_OK;

View File

@ -110,7 +110,7 @@ namespace PPT
RELEASEOBJECT(m_pShapeWriter);
}
void CPPTXWriter::CreateFile(CPPTUserInfo* pUserInfo)
bool CPPTXWriter::CreateFile(CPPTUserInfo* pUserInfo)
{
m_pUserInfo = pUserInfo;
@ -124,12 +124,15 @@ namespace PPT
m_pShapeWriter->InitNextId();
NSDirectory::CreateDirectory(m_strDestPath);
if (NSDirectory::CreateDirectory(m_strDestPath) == false)
return false;
NSFile::CFileBinary oFile;
std::wstring strMemory;
// _rels
NSDirectory::CreateDirectory(m_strDestPath + FILE_SEPARATOR_STR + L"_rels");
if (NSDirectory::CreateDirectory(m_strDestPath + FILE_SEPARATOR_STR + L"_rels") == false)
return false;
oFile.CreateFileW(m_strDestPath + FILE_SEPARATOR_STR + L"_rels" + FILE_SEPARATOR_STR + L".rels");
strMemory = NSPPTXWriterConst::g_string_rels_presentation;
@ -137,7 +140,8 @@ namespace PPT
oFile.CloseFile();
// docProps
NSDirectory::CreateDirectory(m_strDestPath + FILE_SEPARATOR_STR + L"docProps");
if (NSDirectory::CreateDirectory(m_strDestPath + FILE_SEPARATOR_STR + L"docProps") == false)
return false;
// core
oFile.CreateFileW(m_strDestPath + FILE_SEPARATOR_STR + L"docProps" + FILE_SEPARATOR_STR + L"core.xml");

View File

@ -60,7 +60,7 @@ namespace PPT
~CPPTXWriter();
void CreateFile(CDocument * pDocument);
void CreateFile(CPPTUserInfo* pUserInfo);
bool CreateFile(CPPTUserInfo* pUserInfo);
void CloseFile();

View File

@ -63,7 +63,7 @@ CPPTFileReader::CPPTFileReader(POLE::Storage* pStorage, const std::wstring& strT
{
m_oCommonInfo.tempPath = NSDirectory::GetTempPath();
}
m_oCommonInfo.tempPath = NSDirectory::CreateDirectoryWithUniqueName(m_oCommonInfo.tempPath);
//m_oCommonInfo.tempPath = m_oCommonInfo.tempPath + FILE_SEPARATOR_STR + L"temp";
m_oDocumentInfo.m_pCommonInfo = &m_oCommonInfo;
@ -98,7 +98,7 @@ CPPTFileReader::~CPPTFileReader()
{
RELEASEOBJECT(m_pStorage);
NSDirectory::DeleteDirectory(m_oCommonInfo.tempPath);
//NSDirectory::DeleteDirectory(m_oCommonInfo.tempPath);
}
bool CPPTFileReader::IsPowerPoint()

View File

@ -44,6 +44,7 @@ RoundTripExtractor::RoundTripExtractor(const CUnknownRoundTrip* rt, const std::w
RoundTripExtractor::~RoundTripExtractor()
{
NSDirectory::DeleteDirectory(m_extractedFolderPath);
}
vector_string RoundTripExtractor::find(const std::wstring& strRegEx) const
@ -66,6 +67,8 @@ vector_string RoundTripExtractor::find(const std::wstring& strRegEx) const
std::wstring RoundTripExtractor::getOneFile(const std::wstring &shortPath) const
{
if (m_hasError) return L"";
const std::wstring fullPath = m_extractedFolderPath + FILE_SEPARATOR_STR + shortPath;
return NSFile::CFileBinary::Exists(fullPath) ? fullPath : L"";
@ -76,7 +79,7 @@ bool RoundTripExtractor::extract()
if (!m_roundTripRecord)
return false;
std::wstring tempZipPath = NSFile::CFileBinary::CreateTempFileWithUniqueName(m_tempPath, L"RndT") + L".zip";
std::wstring tempZipPath = NSFile::CFileBinary::CreateTempFileWithUniqueName(m_tempPath, L"RndT");
BYTE* zipData = m_roundTripRecord->data.first.get();
ULONG zipDataLen = m_roundTripRecord->data.second;
@ -88,11 +91,16 @@ bool RoundTripExtractor::extract()
COfficeUtils officeUtils(NULL);
m_extractedFolderPath = NSDirectory::CreateDirectoryWithUniqueName(m_tempPath);
if(S_FALSE == officeUtils.ExtractToDirectory(tempZipPath, m_extractedFolderPath, NULL, 0))
if (m_extractedFolderPath.empty())
{
NSFile::CFileBinary::Remove(tempZipPath);
return false;
}
bool result = (S_FALSE != officeUtils.ExtractToDirectory(tempZipPath, m_extractedFolderPath, NULL, 0));
NSFile::CFileBinary::Remove(tempZipPath);
return true;
return result;
}
bool RoundTripExtractor::hasError() const

View File

@ -935,7 +935,7 @@ void CPPTElement::SetUpPropertyShape(CElementPtr pElement, CTheme* pTheme, CSlid
case ODRAW::metroBlob:
{
NSFile::CFileBinary file;
std::wstring tempFileName = NSFile::CFileBinary::CreateTempFileWithUniqueName(m_tempPath, L"Blob") + L".zip";
std::wstring tempFileName = NSFile::CFileBinary::CreateTempFileWithUniqueName(m_tempPath, L"Blob");
if (file.CreateFileW(tempFileName))
{
@ -2168,8 +2168,7 @@ std::wstring CRecordShapeContainer::getTableXmlStr() const
if (xmlProp.m_pOptions && xmlProp.m_lValue > 0) // file513.ppt
{
std::wstring tempPath = NSDirectory::CreateDirectoryWithUniqueName(m_pCommonInfo->tempPath);
std::wstring tempFileName = tempPath + FILE_SEPARATOR_STR + L"tempMetroBlob.zip";
std::wstring tempFileName = NSFile::CFileBinary::CreateTempFileWithUniqueName(m_pCommonInfo->tempPath, L"Blob");
NSFile::CFileBinary file;
if (file.CreateFileW(tempFileName))
@ -2185,7 +2184,6 @@ std::wstring CRecordShapeContainer::getTableXmlStr() const
delete[] utf8Data;
NSFile::CFileBinary::Remove(tempFileName);
NSDirectory::DeleteDirectory(tempPath);
}
}

View File

@ -142,6 +142,12 @@ public:
void OpenDir(std::wstring sDir)
{
m_sInputFolder = sDir;
if (m_bDiffOnly)
{
m_files = NSDirectory::GetDirectories(m_sInputFolder);
m_nCount = (int)m_files.size();
return;
}
std::vector<std::wstring> arFiles = NSDirectory::GetFiles(sDir, true);
for (std::vector<std::wstring>::iterator iter = arFiles.begin(); iter != arFiles.end(); iter++)
@ -292,6 +298,7 @@ public:
NSFile::CFileBinary::SaveToFile(sLogFile, sLogContent, true);
}
int GenerateDiff(const std::wstring strDirIn, const std::wstring strDirOut, const std::wstring strDiffs)
{
int nCountInPages = GetPagesCount(strDirIn);
@ -514,10 +521,6 @@ class CConverter : public NSThreads::CBaseThread
{
public:
CInternalWorker* m_pInternal;
std::wstring m_input_dir;
std::wstring m_output_dir;
std::wstring m_file;
std::wstring m_folder_dst;
int m_format;
@ -534,40 +537,15 @@ public:
Stop();
}
std::wstring GetOutputFile(const std::wstring& sFolderAddon = L"", const bool& isStandart = false)
{
std::wstring input_dir = m_input_dir;
NSStringUtils::string_replace(input_dir, L"\\", L"/");
std::wstring input_file = m_file;
NSStringUtils::string_replace(input_file, L"\\", L"/");
std::wstring output_dir = isStandart ? (m_input_dir + L"/../out/master") : (m_output_dir + L"/");
if (!sFolderAddon.empty())
output_dir += (sFolderAddon + L"/");
NSStringUtils::string_replace(output_dir, L"\\", L"/");
NSStringUtils::string_replace(output_dir, L"//", L"/");
std::wstring output_file = output_dir + input_file.substr(input_dir.length());
NSStringUtils::string_replace(output_file, L"//", L"/");
#ifdef _WIN32
NSStringUtils::string_replace(output_file, L"/", L"\\");
#endif
return output_file;
}
virtual DWORD ThreadProc()
{
if (m_bDiffOnly)
{
std::wstring strDirIn = GetOutputFile(L"", true);
std::wstring strDirIn = m_file;
std::wstring strDirOut = m_folder_dst;
std::wstring strDiffs = GetOutputFile(L"DIFF");
std::wstring strDiffsMain = NSFile::GetDirectoryName(strDirOut) + L"/DIFF";
std::wstring strDiffs = strDiffsMain + L"/" + NSFile::GetFileName(m_file);
int checkCode = m_pInternal->GenerateDiff(strDirIn, strDirOut, strDiffs);
@ -672,10 +650,12 @@ public:
if (!m_pInternal->m_bIsStandard)
{
// смотрим разницу
std::wstring strDirIn = GetOutputFile(L"", true);
std::wstring strDirIn = NSFile::GetDirectoryName(m_file);
std::wstring strDirOut = sDirectoryDst;
std::wstring strDiffs = GetOutputFile(L"DIFF");
std::wstring strDiffsMain = NSFile::GetDirectoryName(strDirOut) + L"/DIFF";
std::wstring strDiffs = strDiffsMain + L"/" + NSFile::GetFileName(m_file);
checkCode = m_pInternal->GenerateDiff(strDirIn, strDirOut, strDiffs);
}
@ -693,18 +673,13 @@ CConverter* CInternalWorker::GetNextConverter()
CConverter* pConverter = new CConverter(this);
pConverter->DestroyOnFinish();
pConverter->m_input_dir = m_sInputFolder;
pConverter->m_output_dir = m_sOutputFolder;
pConverter->m_file = m_files[m_nCurrent];
pConverter->m_bDiffOnly = m_bDiffOnly;
++m_nCurrent;
std::wstring sName = NSFile::GetFileName(pConverter->m_file);
pConverter->m_folder_dst = pConverter->GetOutputFile();
NSDirectory::CreateDirectories(pConverter->m_folder_dst);
pConverter->m_folder_dst = m_sOutputFolder + L"/" + sName;
NSDirectory::CreateDirectory(pConverter->m_folder_dst);
if (m_bIsStandard)
NSFile::CFileBinary::Copy(pConverter->m_file, pConverter->m_folder_dst + L"/" + sName);