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

.......

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62919 954022d7-b5bf-4e40-9824-e11837661b57
parent 4374c122
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "../../Common/DocxFormat/Source/Base/Base.h" #include "../../Common/DocxFormat/Source/Base/Base.h"
#include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h" #include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "ConvertOO2OOX.h" #include "../src/ConvertOO2OOX.h"
#include "../../Common/XmlUtils.h" #include "../../Common/XmlUtils.h"
......
...@@ -19,7 +19,7 @@ namespace ...@@ -19,7 +19,7 @@ namespace
std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, CFontManager *pFontManager) std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, CFontManager *pFontManager)
{ {
if (pFontManager == NULL) return std::pair<float, float>(7.f,8.f); if (pFontManager == NULL) return std::pair<float, float>(7,8);
HRESULT hr = S_OK; HRESULT hr = S_OK;
...@@ -35,7 +35,7 @@ std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName, ...@@ -35,7 +35,7 @@ std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName,
float maxHeight = 0; float maxHeight = 0;
for (int i = 0; i <= 9; ++i) for (int i = 0; i <= 9; ++i)
{ {
if (S_OK != (hr = pFontManager->LoadString2( boost::lexical_cast<std::wstring>(i).c_str(), 0, 0))) if (S_OK != (hr = pFontManager->LoadString2( boost::lexical_cast<std::wstring>(i), 0, 0)))
return std::pair<float, float>(7,8); return std::pair<float, float>(7,8);
TBBox box; TBBox box;
...@@ -46,6 +46,10 @@ std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName, ...@@ -46,6 +46,10 @@ std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName,
{ {
return std::pair<float, float>(7,8); return std::pair<float, float>(7,8);
} }
if (box.fMaxX > 0xffff-1 || box.fMaxY > 0xffff-1 ||
box.fMinX < 0xffff+1 || box.fMinY > 0xffff+1)
return std::pair<float, float>(7,8);
if (box.fMaxX - box.fMinX > maxWidth) maxWidth = box.fMaxX - box.fMinX; if (box.fMaxX - box.fMinX > maxWidth) maxWidth = box.fMaxX - box.fMinX;
if (box.fMaxY - box.fMinY > maxHeight) maxHeight = box.fMaxY - box.fMinY; if (box.fMaxY - box.fMinY > maxHeight) maxHeight = box.fMaxY - box.fMinY;
...@@ -59,9 +63,13 @@ std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, dou ...@@ -59,9 +63,13 @@ std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, dou
{ {
try try
{ {
_CP_LOG(info) << "[info] : GetMaxDigitSizePixels..."; #if _DEBUG
_CP_LOG(info) << "[info] : GetMaxDigitSizePixels...";
#endif
std::pair<float, float> val = GetMaxDigitSizePixelsImpl(fontName, fontSize, dpi, fontStyle, pFontManager); std::pair<float, float> val = GetMaxDigitSizePixelsImpl(fontName, fontSize, dpi, fontStyle, pFontManager);
_CP_LOG(info) << "ok" << std::endl; #if _DEBUG
_CP_LOG(info) << "ok" << std::endl;
#endif
return val; return val;
} }
catch(...) catch(...)
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "oox_chart_shape.h" #include "oox_chart_shape.h"
#include "../../../Common/DocxFormat/Source/Base/Types_32.h"
namespace cpdoccore { namespace cpdoccore {
namespace oox { namespace oox {
...@@ -19,7 +21,7 @@ public: ...@@ -19,7 +21,7 @@ public:
oox_axis_content(int type/*,std::wstring name*/) oox_axis_content(int type/*,std::wstring name*/)
{ {
id_ = abs(*((int*)(this))); id_ = abs((int)*((_UINT32*)this));
type_=type; //dimension type_=type; //dimension
} }
~oox_axis_content(){} ~oox_axis_content(){}
......
...@@ -20,35 +20,47 @@ ...@@ -20,35 +20,47 @@
#include "odfcontext.h" #include "odfcontext.h"
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
#include "../../../DesktopEditor/raster/BgraFrame.h"
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
#include <Windows.h> #include <Windows.h>
#include <gdiplus.h> #include <gdiplus.h>
#pragma comment(lib, "gdiplus.lib") #pragma comment(lib, "gdiplus.lib")
#endif #endif
namespace _image_file_ namespace _image_file_
{ {
bool GetResolution(const wchar_t* fileName, int & Width, int &Height) bool GetResolution(const wchar_t* fileName, int & Width, int &Height)
{ {
bool result =false; bool result =false;
#if defined(_WIN32) || defined(_WIN64)
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken=0;
Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
Gdiplus::Bitmap *file = new Gdiplus::Bitmap(fileName,false); CBgraFrame image;
if ((file) && (file->GetLastStatus()==Gdiplus::Ok)) if (result = image.OpenFile(fileName, 0 ))
{ {
Height = file->GetHeight(); Width = image.get_Width();
Width = file->GetWidth(); Height = image.get_Height();
result = true; result = true;
delete file;
} }
Gdiplus::GdiplusShutdown(gdiplusToken); else
#else {
//todooo - CxImage !!!! #if defined(_WIN32) || defined(_WIN64)
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken=0;
Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
Gdiplus::Bitmap *file = new Gdiplus::Bitmap(fileName,false);
if ((file) && (file->GetLastStatus()==Gdiplus::Ok))
{
Height = file->GetHeight();
Width = file->GetWidth();
result = true;
delete file;
}
Gdiplus::GdiplusShutdown(gdiplusToken);
#endif #endif
}
return result; return result;
} }
}; };
......
This diff is collapsed.
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="../include" AdditionalIncludeDirectories="../include;&quot;../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="../include" AdditionalIncludeDirectories="../include;&quot;../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="../include" AdditionalIncludeDirectories="../include;&quot;../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="../include" AdditionalIncludeDirectories="../include;&quot;../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;../../../../DesktopEditor/freetype-2.5.2/include&quot;" AdditionalIncludeDirectories="&quot;../../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_" PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
......
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