Commit 8e97f861 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander Trofimov

to Revision: 65405 delete unused ASCHTMLRenderer


git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@65406 954022d7-b5bf-4e40-9824-e11837661b57
parent d057b02f
...@@ -185,7 +185,6 @@ HEADERS += \ ...@@ -185,7 +185,6 @@ HEADERS += \
../Records/ViewInfoAtom.h \ ../Records/ViewInfoAtom.h \
../Records/ZoomViewInfoAtom.h \ ../Records/ZoomViewInfoAtom.h \
../Records/Animations/AnimationTypes.h \ ../Records/Animations/AnimationTypes.h \
../Records/Drawing/BitmapBlip.h \
../Records/Drawing/BlipStoreContainer.h \ ../Records/Drawing/BlipStoreContainer.h \
../Records/Drawing/BlipStoreEntry.h \ ../Records/Drawing/BlipStoreEntry.h \
../Records/Drawing/ChildAnchor.h \ ../Records/Drawing/ChildAnchor.h \
...@@ -200,6 +199,7 @@ HEADERS += \ ...@@ -200,6 +199,7 @@ HEADERS += \
../Records/Drawing/ShapeContainer.h \ ../Records/Drawing/ShapeContainer.h \
../Records/Drawing/ShapeProperties.h \ ../Records/Drawing/ShapeProperties.h \
../Records/Drawing/TextBox.h \ ../Records/Drawing/TextBox.h \
../Records/Drawing/ArtBlip.h \
../../../ASCPresentationEditor/PPTXWriter/Converter.h \ ../../../ASCPresentationEditor/PPTXWriter/Converter.h \
../../../ASCPresentationEditor/PPTXWriter/CSS.h \ ../../../ASCPresentationEditor/PPTXWriter/CSS.h \
../../../ASCPresentationEditor/PPTXWriter/ImageManager.h \ ../../../ASCPresentationEditor/PPTXWriter/ImageManager.h \
...@@ -224,6 +224,7 @@ SOURCES += \ ...@@ -224,6 +224,7 @@ SOURCES += \
../Reader/Records.cpp \ ../Reader/Records.cpp \
../Reader/SlidePersist.cpp \ ../Reader/SlidePersist.cpp \
../Records/Animations/AnimationTypes.cpp \ ../Records/Animations/AnimationTypes.cpp \
../Records/Drawing/ArtBlip.cpp \
../../../ASCPresentationEditor/PPTXWriter/Converter.cpp \ ../../../ASCPresentationEditor/PPTXWriter/Converter.cpp \
../../../ASCPresentationEditor/PPTXWriter/ShapeWriter.cpp \ ../../../ASCPresentationEditor/PPTXWriter/ShapeWriter.cpp \
../../../ASCPresentationEditor/OfficeDrawing/Elements.cpp \ ../../../ASCPresentationEditor/OfficeDrawing/Elements.cpp \
......
...@@ -5,49 +5,15 @@ ...@@ -5,49 +5,15 @@
#include <atltypes.h> #include <atltypes.h>
#include <atlcoll.h> #include <atlcoll.h>
#endif #endif
#include "../../DesktopEditor/graphics/IRenderer.h"
#include "../../HtmlRenderer/include/ASCSVGWriter.h"
#include "../../ASCHTMLRenderer/CASCImage.h"
#include "../../Common/DocxFormat/Source/SystemUtility/File.h" #include "../../Common/DocxFormat/Source/SystemUtility/File.h"
#include <algorithm> #include <algorithm>
#ifdef BUILD_CONFIG_FULL_VERSION
namespace NSWMFToImageConverter namespace NSWMFToImageConverter
{ {
class CImageExt class CImageExt
{ {
private:
NSHtmlRenderer::CASCSVGWriter* m_pSVGRenderer;
CFontManager* m_pFontManager;
void Init()
{
if (NULL != m_pSVGRenderer)
{
m_pSVGRenderer->ReInit();
}
else
{
m_pSVGRenderer = new NSHtmlRenderer::CASCSVGWriter();
}
if(NULL != m_pFontManager && m_pSVGRenderer)
m_pSVGRenderer->SetFontManager(m_pFontManager);
}
public:
CImageExt()
{
m_pSVGRenderer = NULL;
m_pFontManager = NULL;
}
~CImageExt()
{
RELEASEOBJECT(m_pSVGRenderer);
}
public: public:
LONG GetImageType(CString strFile) LONG GetImageType(CString strFile)
{ {
...@@ -102,135 +68,6 @@ namespace NSWMFToImageConverter ...@@ -102,135 +68,6 @@ namespace NSWMFToImageConverter
return 0; return 0;
} }
private:
void MetaDrawOnRenderer(IRenderer* pRenderer, BSTR strFile, double dW, double dH)
{
if (NULL == pRenderer)
return;
// Запоминаем все настройки Brush, Font, Pen, Shadow и т.д.
LONG brush_Alpha1 = 0;
LONG brush_Alpha2 = 0;
LONG brush_Color1 = 0;
LONG brush_Color2 = 0;
double brush_LinearAngle = 0;
std::wstring brush_TexturePath;
LONG brush_TextureMode = 0;
LONG brush_TextureAlpha = 0;
LONG brush_Type = 0;
pRenderer->get_BrushAlpha1( &brush_Alpha1 );
pRenderer->get_BrushAlpha2( &brush_Alpha2 );
pRenderer->get_BrushColor1( &brush_Color1 );
pRenderer->get_BrushColor2( &brush_Color2 );
pRenderer->get_BrushLinearAngle( &brush_LinearAngle );
pRenderer->get_BrushTextureMode( &brush_TextureMode );
pRenderer->get_BrushTextureAlpha( &brush_TextureAlpha );
pRenderer->get_BrushTexturePath( &brush_TexturePath );
pRenderer->get_BrushType( &brush_Type );
std::wstring font_Path;
std::wstring font_Name;
double font_Size = 0;
LONG font_Style = 0;
INT font_GID = 0;
pRenderer->get_FontName( &font_Name );
pRenderer->get_FontPath( &font_Path );
pRenderer->get_FontSize( &font_Size );
pRenderer->get_FontStyle( &font_Style );
pRenderer->get_FontStringGID( &font_GID );
LONG pen_Align = 0;
LONG pen_Alpha = 0;
LONG pen_Color = 0;
pRenderer->get_PenAlign( &pen_Align );
pRenderer->get_PenAlpha( &pen_Alpha );
pRenderer->get_PenColor( &pen_Color );
CApplicationFonts *pAppFonts = (NULL != m_pFontManager) ? m_pFontManager->m_pApplication : NULL;
NSHtmlRenderer::CASCImage oASCImage(pAppFonts);
oASCImage.LoadFromFile( strFile );
if (dW <= 0 && dH <= 0)
{
LONG _lw = 0;
LONG _lh = 0;
oASCImage.get_Width(&_lw);
oASCImage.get_Height(&_lh);
if(_lw <= 0)
_lw = 1;
if(_lh <= 0)
_lh = 1;
LONG lMax = (std::max) (_lw, _lh);
double dKoef = 1000.0 / lMax;
dW = (double)dKoef * _lw * 100;
dH = (double)dKoef * _lh * 100;
m_pSVGRenderer->put_Width(dW);
m_pSVGRenderer->put_Height(dH);
}
oASCImage.DrawOnRenderer( pRenderer, 0, 0, dW, dH );
// Восстанавливаем параметры
pRenderer->put_BrushAlpha1( brush_Alpha1 );
pRenderer->put_BrushAlpha2( brush_Alpha2 );
pRenderer->put_BrushColor1( brush_Color1 );
pRenderer->put_BrushColor2( brush_Color2 );
pRenderer->put_BrushLinearAngle( brush_LinearAngle );
pRenderer->put_BrushTextureMode( brush_TextureMode );
pRenderer->put_BrushTextureAlpha( brush_TextureAlpha );
pRenderer->put_BrushTexturePath( brush_TexturePath );
pRenderer->put_BrushType( brush_Type );
pRenderer->put_FontName( font_Name );
pRenderer->put_FontPath( font_Path );
pRenderer->put_FontSize( font_Size );
pRenderer->put_FontStyle( font_Style );
pRenderer->put_FontStringGID( font_GID );
pRenderer->put_PenAlign( pen_Align );
pRenderer->put_PenAlpha( pen_Alpha );
pRenderer->put_PenColor( pen_Color );
// на всякий случай скидываем path
pRenderer->PathCommandEnd();
}
public:
bool Convert(CString strPath, LONG lWidth, LONG lHeight, CString strDstPath)
{
Init();
m_pSVGRenderer->put_Width(lWidth);
m_pSVGRenderer->put_Height(lHeight);
#if !defined(_WIN32) && !defined (_WIN64)
MetaDrawOnRenderer(m_pSVGRenderer, strPath, (double)lWidth, (double)lHeight);
#else
BSTR bsFilePath = strPath.AllocSysString();
MetaDrawOnRenderer(m_pSVGRenderer, bsFilePath, (double)lWidth, (double)lHeight);
SysFreeString(bsFilePath);
#endif
bool bIsRaster = false;
m_pSVGRenderer->IsRaster(&bIsRaster);
if (bIsRaster)
return false;
m_pSVGRenderer->SaveFile(std::wstring(strDstPath.GetString()));
return true;
}
void SetFontManager(CFontManager* pFontManager)
{
m_pFontManager = pFontManager;
}
}; };
} }
#endif
...@@ -147,9 +147,7 @@ namespace NSShapeImageGen ...@@ -147,9 +147,7 @@ namespace NSShapeImageGen
LONG m_lDstFormat; LONG m_lDstFormat;
#ifdef BUILD_CONFIG_FULL_VERSION
NSWMFToImageConverter::CImageExt m_oImageExt; NSWMFToImageConverter::CImageExt m_oImageExt;
#endif
CFontManager* m_pFontManager; CFontManager* m_pFontManager;
public: public:
...@@ -323,10 +321,6 @@ namespace NSShapeImageGen ...@@ -323,10 +321,6 @@ namespace NSShapeImageGen
void SetFontManager(CFontManager* pFontManager) void SetFontManager(CFontManager* pFontManager)
{ {
m_pFontManager = pFontManager; m_pFontManager = pFontManager;
#ifdef BUILD_CONFIG_FULL_VERSION
m_oImageExt.SetFontManager(pFontManager);
#endif
} }
protected: protected:
inline void CopyFile(CString& strFileSrc, CString& strFileDst) inline void CopyFile(CString& strFileSrc, CString& strFileDst)
......
...@@ -134,7 +134,8 @@ SOURCES += pptxformatlib.cpp \ ...@@ -134,7 +134,8 @@ SOURCES += pptxformatlib.cpp \
../../../../ASCPresentationEditor/OfficeDrawing/Layout.cpp \ ../../../../ASCPresentationEditor/OfficeDrawing/Layout.cpp \
../../../../ASCPresentationEditor/OfficeDrawing/TextAttributesEx.cpp \ ../../../../ASCPresentationEditor/OfficeDrawing/TextAttributesEx.cpp \
../../../../ASCPresentationEditor/OfficeDrawing/Elements.cpp \ ../../../../ASCPresentationEditor/OfficeDrawing/Elements.cpp \
../../../PPTXFormat/Logic/Controls.cpp ../../../PPTXFormat/Logic/Controls.cpp \
../../../../HtmlRenderer/src/ASCSVGWriter.cpp
HEADERS += pptxformatlib.h \ HEADERS += pptxformatlib.h \
../../../ASCOfficeDrawingConverter.h \ ../../../ASCOfficeDrawingConverter.h \
...@@ -558,7 +559,8 @@ HEADERS += pptxformatlib.h \ ...@@ -558,7 +559,8 @@ HEADERS += pptxformatlib.h \
../../../PPTXFormat/DocxFormat/Drawing/VmlDrawing.h \ ../../../PPTXFormat/DocxFormat/Drawing/VmlDrawing.h \
../../../PPTXFormat/Logic/Controls.h \ ../../../PPTXFormat/Logic/Controls.h \
../../../../Common/DocxFormat/Source/Base/Nullable.h \ ../../../../Common/DocxFormat/Source/Base/Nullable.h \
../../../../Common/DocxFormat/Source/XML/xmlutils.h ../../../../Common/DocxFormat/Source/XML/xmlutils.h \
../../../../HtmlRenderer/include/ASCSVGWriter.h
unix { unix {
target.path = /usr/lib target.path = /usr/lib
INSTALLS += target INSTALLS += target
......
#pragma once #pragma once
#include "Theme.h" #include "Theme.h"
#include "Shapes/Shape.h" #include "Shapes/Shape.h"
#include "../../ASCHTMLRenderer/CASCSVGRenderer.h"
#ifdef _SVG_CONVERT_TO_IMAGE_ #ifdef _SVG_CONVERT_TO_IMAGE_
#include "SVGTransformer.h" #include "SVGTransformer.h"
......
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