Commit 52f22ef3 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

bug 29474 (pdf writer) linux build

поправлена вставка картинки из строки

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62832 954022d7-b5bf-4e40-9824-e11837661b57
parent 57012137
...@@ -3050,8 +3050,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std: ...@@ -3050,8 +3050,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std:
current += 1; current += 1;
curindex += 1; curindex += 1;
} }break;
break;
case ctBrushTexturePath: case ctBrushTexturePath:
{ {
_sLen = 2 * NSCommonReader::ReadUSHORT(current, curindex); _sLen = 2 * NSCommonReader::ReadUSHORT(current, curindex);
...@@ -3066,7 +3065,8 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std: ...@@ -3066,7 +3065,8 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std:
int nFind = wsTempString.find(_T(",")); int nFind = wsTempString.find(_T(","));
wsTempString = wsTempString.substr(nFind + 1); wsTempString = wsTempString.substr(nFind + 1);
base64TempFile = FileSystem::Directory::GetTempPath(); base64TempFile = sHtmlPlace + FILE_SEPARATOR_STR + _T("media");
base64TempFile = FileSystem::Directory::CreateTempFileWithUniqueName(base64TempFile, _T("img"));
std::string sBase64MultyByte(wsTempString.begin(), wsTempString.end()); std::string sBase64MultyByte(wsTempString.begin(), wsTempString.end());
...@@ -3076,7 +3076,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std: ...@@ -3076,7 +3076,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std:
if (Base64::Base64Decode(sBase64MultyByte.c_str(), sBase64MultyByte.length(), if (Base64::Base64Decode(sBase64MultyByte.c_str(), sBase64MultyByte.length(),
byteIm, &nBuffLen)) byteIm, &nBuffLen))
{ {
WriteFile_ (base64TempFile, byteIm); WriteFile_ (base64TempFile, byteIm, nBuffLen);
wsTempString = string2std_string(base64TempFile); wsTempString = string2std_string(base64TempFile);
} }
else throw; else throw;
...@@ -3127,12 +3127,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std: ...@@ -3127,12 +3127,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std:
put_BrushTexturePath(wsTempString); put_BrushTexturePath(wsTempString);
if (!base64TempFile.IsEmpty()) }break;
{
::CDirectory::DeleteFile(base64TempFile);
}
}
break;
case ctBrushGradient: case ctBrushGradient:
{ {
...@@ -3225,9 +3220,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std: ...@@ -3225,9 +3220,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std:
strXml = L"<radialGradient " + strAttrMain + L">" + strColors + L"</radialGradient>"; strXml = L"<radialGradient " + strAttrMain + L">" + strColors + L"</radialGradient>";
CreateRadialGradientFromSvgXml(strXml, true); CreateRadialGradientFromSvgXml(strXml, true);
} }
} }break;
break;
case ctBrushTextureMode: case ctBrushTextureMode:
{ {
...@@ -3238,8 +3231,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std: ...@@ -3238,8 +3231,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std:
current += 1; current += 1;
curindex += 1; curindex += 1;
} }break;
break;
case ctBrushTextureAlpha: case ctBrushTextureAlpha:
{ {
//ATLTRACE2 ("CommandType::ctBrushTextureAlpha:\n"); //ATLTRACE2 ("CommandType::ctBrushTextureAlpha:\n");
...@@ -3336,7 +3328,8 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std: ...@@ -3336,7 +3328,8 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std:
int nFind = wsTempString.find(_T(",")); int nFind = wsTempString.find(_T(","));
wsTempString = wsTempString.substr(nFind + 1); wsTempString = wsTempString.substr(nFind + 1);
base64TempFile = FileSystem::Directory::GetTempPath(); base64TempFile = sHtmlPlace + FILE_SEPARATOR_STR + _T("media");
base64TempFile = FileSystem::Directory::CreateTempFileWithUniqueName(base64TempFile, _T("img"));
std::string sBase64MultyByte(wsTempString.begin(), wsTempString.end()); std::string sBase64MultyByte(wsTempString.begin(), wsTempString.end());
...@@ -3345,7 +3338,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std: ...@@ -3345,7 +3338,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std:
if (Base64::Base64Decode(sBase64MultyByte.c_str(), sBase64MultyByte.length(), byteIm, &nBuffLen)) if (Base64::Base64Decode(sBase64MultyByte.c_str(), sBase64MultyByte.length(), byteIm, &nBuffLen))
{ {
WriteFile_ (base64TempFile, byteIm); WriteFile_ (base64TempFile, byteIm,nBuffLen);
wsTempString = string2std_string(base64TempFile); wsTempString = string2std_string(base64TempFile);
} }
else throw; else throw;
...@@ -3406,13 +3399,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std: ...@@ -3406,13 +3399,7 @@ void CPdfWriterLib::OnlineWordToPdfInternal(BYTE* dstArray, LONG len, const std:
{ {
//ATLTRACE2 ("DrawImageFromFile failed!\n"); //ATLTRACE2 ("DrawImageFromFile failed!\n");
} }
}break;
if (!base64TempFile.IsEmpty())
{
::CDirectory::DeleteFile(base64TempFile);
}
}
break;
case ctFontName: case ctFontName:
{ {
//ATLTRACE2 ("CommandType::ctFontName\n"); //ATLTRACE2 ("CommandType::ctFontName\n");
......
...@@ -596,7 +596,12 @@ SOURCES += \ ...@@ -596,7 +596,12 @@ SOURCES += \
../../../raster/JBig2/source/LeptonLib/zlibmemstub.cpp \ ../../../raster/JBig2/source/LeptonLib/zlibmemstub.cpp \
../../../raster/ImageFileFormatChecker.cpp \ ../../../raster/ImageFileFormatChecker.cpp \
../../../cximage/libpsd/test.c \ ../../../cximage/libpsd/test.c \
../../../raster/JBig2/source/LeptonLib/blend1.cpp ../../../raster/JBig2/source/LeptonLib/blend1.cpp \
../../../raster/JBig2/source/LeptonLib/blend1.cpp \
../../../raster/Metafile/StarView/SvmClip.cpp \
../../../raster/Metafile/StarView/SvmFile.cpp \
../../../raster/Metafile/StarView/SvmObjects.cpp \
../../../raster/Metafile/StarView/SvmPlayer.cpp
HEADERS += \ HEADERS += \
../../../graphics/AggPlusEnums.h \ ../../../graphics/AggPlusEnums.h \
...@@ -863,7 +868,12 @@ HEADERS += \ ...@@ -863,7 +868,12 @@ HEADERS += \
../../../raster/Jp2/Tier2.h \ ../../../raster/Jp2/Tier2.h \
../../../raster/Jp2/Tile.h \ ../../../raster/Jp2/Tile.h \
../../../raster/Jp2/Types.h \ ../../../raster/Jp2/Types.h \
../../../raster/Jp2/Utils.h ../../../raster/Jp2/Utils.h \
../../../raster/Metafile/StarView/SvmClip.h \
../../../raster/Metafile/StarView/SvmEnums.h \
../../../raster/Metafile/StarView/SvmFile.h \
../../../raster/Metafile/StarView/SvmObjects.h \
../../../raster/Metafile/StarView/SvmPlayer.h
unix { unix {
target.path = /usr/lib target.path = /usr/lib
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment