Compare commits

..

5 Commits

6 changed files with 63 additions and 6 deletions

2
ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp Normal file → Executable file
View File

@ -124,6 +124,8 @@ namespace PPTX
xfrm = oReader;
else if (L"cNvGraphicFramePr" == strName)
nvGraphicFramePr.cNvGraphicFramePr.fromXML( oReader );
else if (L"nvGraphicFramePr" == strName)
nvGraphicFramePr.fromXML( oReader );
else if (L"graphic" == strName)
{

View File

@ -365,7 +365,13 @@ namespace NSDirectory
SECURITY_ATTRIBUTES sa={};
codeResult = SHCreateDirectoryExW(NULL, strDirectory.c_str(), &sa);
if (strDirectory.find(L"./") == 0)
{
std::wstring sDir = NSFile::GetProcessDirectory() + L"/" + strDirectory;
codeResult = SHCreateDirectoryExW(NULL, sDir.c_str(), &sa);
}
else
codeResult = SHCreateDirectoryExW(NULL, strDirectory.c_str(), &sa);
bool created = false;
if (codeResult == ERROR_SUCCESS)

View File

@ -59,6 +59,8 @@ namespace NSDoctRenderer
void SetProperty(const char* param, const wchar_t* value);
void SetPropertyW(const wchar_t* param, const wchar_t* value);
char* GetVersion();
public:
static void Initialize();
static void Dispose();

View File

@ -1395,6 +1395,50 @@ namespace NSDoctRenderer
m_pInternal->CloseFile();
}
char* CDocBuilder::GetVersion()
{
m_pInternal->Init();
if (0 == m_pInternal->m_arDoctSDK.size())
return NULL;
std::wstring sFile;
for (std::vector<std::wstring>::iterator i = m_pInternal->m_arDoctSDK.begin(); i != m_pInternal->m_arDoctSDK.end(); i++)
{
if (std::wstring::npos != i->find(L"sdk-all-min.js"))
{
sFile = *i;
break;
}
}
if (sFile.empty())
return NULL;
std::string sData;
if (!NSFile::CFileBinary::ReadAllTextUtf8A(sFile, sData))
return NULL;
std::string::size_type startPos = sData.find("Version:");
if (std::string::npos == startPos)
return NULL;
startPos += 8;
std::string::size_type endPos = sData.find(')', startPos);
if (std::string::npos == endPos)
return NULL;
size_t sSrcLen = endPos - startPos + 1;
if (sSrcLen == 0)
return NULL;
char* sRet = new char[sSrcLen + 1];
memcpy(sRet, sData.c_str() + startPos, sSrcLen);
sRet[sSrcLen] = '\0';
return sRet;
}
bool CDocBuilder::Run(const wchar_t* path)
{
std::wstring sPath(path);

View File

@ -195,6 +195,9 @@ static const struct ActionNamesEmf
m_oStream >> ulType;
m_oStream >> ulSize;
if (ulSize < 1)
continue;
m_ulRecordPos = m_oStream.Tell();
m_ulRecordSize = ulSize - 8;
@ -1074,7 +1077,7 @@ static const struct ActionNamesEmf
m_oStream.Skip(4); // offBits
m_oStream.Skip(4); // cbBits
m_ulRecordSize -= 20;
unsigned int current_size = m_ulRecordSize - 20;
CEmfLogPen* pPen = new CEmfLogPen();
if (!pPen)
@ -1088,10 +1091,10 @@ static const struct ActionNamesEmf
m_oStream.Skip(4); // BrushHatch
m_oStream >> pPen->NumStyleEntries;
m_ulRecordSize -= 24;
current_size -= 24;
if (pPen->NumStyleEntries > 0)
{
m_ulRecordSize -= pPen->NumStyleEntries * 4;
current_size -= pPen->NumStyleEntries * 4;
pPen->StyleEntry = new unsigned int[pPen->NumStyleEntries];
if (!pPen->StyleEntry)
{
@ -1110,7 +1113,7 @@ static const struct ActionNamesEmf
}
// Пропускаем часть с картинкой, если она была
m_oStream.Skip(m_ulRecordSize);
m_oStream.Skip(current_size);
m_oPlayer.RegisterObject(ulPenIndex, (CEmfObjectBase*)pPen);
}

View File

@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.4.466.0
VERSION = 2.4.467.0
DEFINES += INTVER=$$VERSION
TARGET = x2t