Compare commits

...

11 Commits

Author SHA1 Message Date
f4d636539e Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2017-02-03 18:34:43 +03:00
92e02257d7 fix bug #33918 2017-02-03 18:33:50 +03:00
d2046d7ccb add missed include 2017-02-03 18:15:57 +03:00
7bc35a157a Implemented case when the size of the masked image doesn't match to the size of the mask. 2017-02-03 18:02:28 +03:00
903245e8a7 fixed converter for iOS 2017-02-03 17:33:48 +03:00
25ee9c3c1c Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  x2t vesion up  2.0.3.435
  PDFReader: text clip
  .
  fix...
  .
  x2t version up
  DocxFormat - fix vml single geom position RtfFormat - read/write background page (solid, pattern, gradient, image)
2017-02-03 16:28:47 +03:00
9ead40d279 up header 2017-02-03 16:28:42 +03:00
e097379c21 x2t vesion up 2.0.3.435 2017-02-03 15:27:12 +03:00
f86579d601 PDFReader: text clip 2017-02-03 13:02:26 +03:00
de7511f243 . 2017-02-03 12:42:06 +03:00
9a68a75f70 fix... 2017-02-02 18:43:38 +03:00
38 changed files with 4252 additions and 4002 deletions

View File

@ -232,7 +232,8 @@ namespace DocFileFormat
case sprmOldCIss:
case sprmCIss:
appendValueElement( parent, L"vertAlign", FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ), true );
if (iter->argumentsSize > 0 && iter->Arguments[0] < 3) //Metaevan.doc
appendValueElement( parent, L"vertAlign", FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ), true );
break;
case sprmCRgLid0_80:

View File

@ -378,6 +378,7 @@
MAC,
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (
@ -414,6 +415,7 @@
MAC,
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (

View File

@ -305,9 +305,80 @@ void OoxConverter::convert(PPTX::Logic::PathBase *oox_path)
}
void OoxConverter::convert(PPTX::Logic::BlipFill *oox_fill)
void OoxConverter::convert(PPTX::Logic::BlipFill *oox_bitmap_fill)
{
if (!oox_fill) return;
if (oox_bitmap_fill == NULL)return;
odf_context()->drawing_context()->start_bitmap_style();
{
double Width=0, Height = 0;
if (oox_bitmap_fill->blip.IsInit())
{
std::wstring sID, pathImage;
if (oox_bitmap_fill->blip->embed.IsInit())
{
sID = oox_bitmap_fill->blip->embed->get();
pathImage = find_link_by_id(sID,1);
if (!pathImage.empty())
{
odf_context()->drawing_context()->set_bitmap_link(pathImage);
_graphics_utils_::GetResolution(pathImage.c_str(), Width, Height);
}
}
else if (oox_bitmap_fill->blip->link.IsInit())
{
sID = pathImage = oox_bitmap_fill->blip->link->get();
odf_context()->drawing_context()->set_bitmap_link(pathImage);
//...
}
//for (size_t i = 0 ; i < oox_bitmap_fill->blip->m_arrEffects.size(); i++)
//{
// convert(oox_bitmap_fill->blip->m_arrEffects[i]);
//}
}
if (oox_bitmap_fill->srcRect.IsInit() && Width >0 && Height >0)//часть изображения
{
odf_context()->drawing_context()->set_image_client_rect_inch(
(oox_bitmap_fill->srcRect->l.IsInit() ? XmlUtils::GetInteger(oox_bitmap_fill->srcRect->l.get()) : 0 ) /100. * Width / currentSystemDPI,
(oox_bitmap_fill->srcRect->t.IsInit() ? XmlUtils::GetInteger(oox_bitmap_fill->srcRect->t.get()) : 0 ) /100. * Height/ currentSystemDPI,
(oox_bitmap_fill->srcRect->r.IsInit() ? XmlUtils::GetInteger(oox_bitmap_fill->srcRect->r.get()) : 0 ) /100. * Width / currentSystemDPI,
(oox_bitmap_fill->srcRect->b.IsInit() ? XmlUtils::GetInteger(oox_bitmap_fill->srcRect->b.get()) : 0 ) /100. * Height/ currentSystemDPI);
}
if (oox_bitmap_fill->tile.IsInit())
{
odf_context()->drawing_context()->set_image_style_repeat(2);
if (oox_bitmap_fill->tile->algn.IsInit())
odf_context()->drawing_context()->set_bitmap_tile_align(oox_bitmap_fill->tile->algn->GetBYTECode());
if (oox_bitmap_fill->tile->flip.IsInit()) {}
if (oox_bitmap_fill->tile->sx.IsInit() && Width >0)
{
odf_context()->drawing_context()->set_bitmap_tile_scale_x(*oox_bitmap_fill->tile->sx / 100. * Width);
}
if (oox_bitmap_fill->tile->sy.IsInit()&& Height >0)
{
odf_context()->drawing_context()->set_bitmap_tile_scale_y(*oox_bitmap_fill->tile->sy / 100. * Height);
}
if (oox_bitmap_fill->tile->tx.IsInit() && Width >0)
{
odf_context()->drawing_context()->set_bitmap_tile_translate_x(*oox_bitmap_fill->tile->tx * 100. / Width );
}
if (oox_bitmap_fill->tile->ty.IsInit() && Height >0)
{
odf_context()->drawing_context()->set_bitmap_tile_translate_y(*oox_bitmap_fill->tile->ty * 100. / Height );
}
}
if (oox_bitmap_fill->stretch.IsInit())
{
odf_context()->drawing_context()->set_image_style_repeat(1);
if (oox_bitmap_fill->stretch->fillRect.IsInit()){} //заполнение неполного объема
}
}
odf_context()->drawing_context()->end_bitmap_style();
}
void OoxConverter::convert(PPTX::Logic::GradFill *oox_grad_fill)
{

View File

@ -158,8 +158,9 @@ namespace PPTX
std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = map.find(normPath);
if (bIsSlide && (pRelation->Type() == OOX::Presentation::FileTypes::Slide))
{
if (bIsSlide && (pRelation->Type() == OOX::FileTypes::HyperLink))
{// + external audio, video ...
normPath = pRelation->Target();
long percent = Event->GetPercent();
smart_ptr<OOX::File> file = smart_ptr<OOX::File>(new OOX::HyperLink(pRelation->Target()));

View File

@ -119,7 +119,8 @@ namespace PPTX
if ((pDiagramDrawing) && (pDiagramDrawing->m_oShapeTree.IsInit()))
{
m_diag = pDiagramDrawing->m_oShapeTree;
m_oCommonRels = smart_ptr<PPTX::CCommonRels>(dynamic_cast<PPTX::CCommonRels*>(pDiagramDrawing));
m_oCommonRels = smart_ptr<PPTX::CCommonRels>( new PPTX::CCommonRels());
m_oCommonRels->_read(pDiagramDrawing->m_oReadPath);
}
else
{

View File

@ -2288,6 +2288,7 @@
DONT_WRITE_EMBEDDED_FONTS,
CXIMAGE_DONT_DECLARE_TCHAR,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (
@ -2329,6 +2330,7 @@
DONT_WRITE_EMBEDDED_FONTS,
CXIMAGE_DONT_DECLARE_TCHAR,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (

View File

@ -546,6 +546,7 @@
USE_LITE_READER,
PPT_DEF,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
@ -577,6 +578,7 @@
USE_LITE_READER,
PPT_DEF,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",

View File

@ -125,20 +125,20 @@ std::wstring RtfChar::renderTextToXML( std::wstring sParam, bool bDelete )
if (bDelete == false)
{
sResult += L"<w:t xml:space= \"preserve\">";
sResult += XmlUtils::EncodeXmlString( m_sChars );
sResult += XmlUtils::EncodeXmlString( m_sChars, true );
sResult += L"</w:t>";
}
else
{
sResult += L"<w:delText>";
sResult += XmlUtils::EncodeXmlString( m_sChars );
sResult += XmlUtils::EncodeXmlString( m_sChars, true );
sResult += L"</w:delText>";
}
}
else if( L"Math" == sParam && !m_sChars.empty())
{
sResult += L"<m:t>";
sResult += XmlUtils::EncodeXmlString( m_sChars );
sResult += XmlUtils::EncodeXmlString( m_sChars, true );
sResult += L"</m:t>";
}
return sResult;
@ -210,7 +210,7 @@ std::wstring RtfChar::renderRtfText( std::wstring& sText, void* poDocument, int
while (sTextBack.length() < sText.length())
sTextBack += L"-";
for( int i = 0; i < sText.length() ; i++ )
for( size_t i = 0; i < sText.length() ; i++ )
{
bool bWriteUnicode = true;
@ -222,7 +222,7 @@ std::wstring RtfChar::renderRtfText( std::wstring& sText, void* poDocument, int
// -> sTempAnsiChars
std::string sTempAnsiChars = RtfUtility::convert_string(unicodeStr.begin()+i, unicodeStr.begin() + i + 1, nCodePage);
for( int k = 0; k < sTempAnsiChars.length(); k++ )
for( size_t k = 0; k < sTempAnsiChars.length(); k++ )
{
unsigned char nCharCode = sTempAnsiChars[k];
bWriteUnicode = false;

View File

@ -237,7 +237,7 @@ std::wstring RtfField::RenderToOOX(RenderParameter oRenderParameter)
if (m_pInsert->m_pTextItems)
{
sResult += XmlUtils::EncodeXmlString( m_pInsert->m_pTextItems->RenderToOOX(oNewParametr) );
sResult += XmlUtils::EncodeXmlString( m_pInsert->m_pTextItems->RenderToOOX(oNewParametr), true );
}
sResult += L"</w:instrText></w:r>";

View File

@ -295,6 +295,7 @@
MAC,
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
@ -325,6 +326,7 @@
MAC,
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",

View File

@ -32,6 +32,7 @@
#pragma once
#include <map>
#include <string>
namespace XLS
{

View File

@ -1317,6 +1317,7 @@
MAC,
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (
@ -1356,6 +1357,7 @@
MAC,
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (

View File

@ -1017,7 +1017,7 @@ namespace NSFile
size_t sz = 0;
if ( (0 == _wdupenv_s(&wsTempDir, &sz, L"TEMP")) && (wsFolder == NULL))
{
wsTemp = std::wstring(wsTempDir, sz);
wsTemp = std::wstring(wsTempDir, sz-1);
#else
char *wsTempDirA;
if ((wsTempDirA = getenv("TEMP")) && (wsFolder == NULL))

View File

@ -0,0 +1,92 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef _BUILD_IGROBJECT_CROSSPLATFORM_H_
#define _BUILD_IGROBJECT_CROSSPLATFORM_H_
#include "Types.h"
#ifdef __APPLE__
#include <libkern/OSAtomic.h>
#endif
class IGrObject
{
protected:
#ifdef __APPLE__
volatile int32_t m_lRef;
#else
ULONG m_lRef;
#endif
public:
IGrObject()
{
m_lRef = 1;
}
virtual ~IGrObject()
{
}
#ifdef __APPLE__
virtual ULONG AddRef()
{
OSAtomicIncrement32(&m_lRef);
return (ULONG)m_lRef;
}
virtual ULONG Release()
{
int32_t ret = OSAtomicDecrement32(&m_lRef);
if (0 == m_lRef)
delete this;
return (ULONG)ret;
}
#else
virtual ULONG AddRef()
{
++m_lRef;
return m_lRef;
}
virtual ULONG Release()
{
ULONG ret = --m_lRef;
if (0 == m_lRef)
delete this;
return ret;
}
#endif
};
#endif //_BUILD_IGROBJECT_CROSSPLATFORM_H_

View File

@ -29,13 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//
// ImageUtils.h
// UTILS
//
// Created by alexey.musinov on 30.04.15.
// Copyright (c) 2015 Ascensio System SIA. All rights reserved.
//
#ifndef _IMAGE_UTILS_H_
#define _IMAGE_UTILS_H_

View File

@ -29,13 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//
// MemoryMacUtils.h
// UTILS
//
// Created by Alexey Musinov on 03.11.15.
// Copyright © 2015 Ascensio System SIA. All rights reserved.
//
#ifndef _MEMORY_MAC_UTILS_H_
#define _MEMORY_MAC_UTILS_H_

View File

@ -29,13 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//
// NSFileManager+Utils.h
// UTILS
//
// Created by alexey.musinov on 21.09.15.
// Copyright © 2015 Ascensio System SIA. All rights reserved.
//
#import <Foundation/Foundation.h>

View File

@ -29,13 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//
// NSFileManager+Utils.m
// UTILS
//
// Created by alexey.musinov on 21.09.15.
// Copyright © 2015 Ascensio System SIA. All rights reserved.
//
#import "NSFileManager+Utils.h"

View File

@ -29,13 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//
// NSString+StringUtils.h
// UTILS
//
// Created by alexey.musinov on 10.08.15.
// Copyright (c) 2015 Ascensio System SIA. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <string>

View File

@ -1,10 +1,34 @@
//
// NSString+StringUtils.m
// UTILS
//
// Created by alexey.musinov on 10.08.15.
// Copyright (c) 2015 Ascensio System SIA. All rights reserved.
//
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#import "NSString+StringUtils.h"

View File

@ -29,13 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//
// MathUtils.h
// UTILS
//
// Created by alexey.musinov on 19.06.15.
// Copyright (c) 2015 Ascensio System SIA. All rights reserved.
//
#ifndef _MATH_UTILS_
#define _MATH_UTILS_

View File

@ -29,13 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//
// ShapeAspects.h
// UTILS
//
// Created by alexey.musinov on 09.10.15.
// Copyright © 2015 Ascensio System SIA. All rights reserved.
//
#ifndef SHAPE_ASPECTS_H
#define SHAPE_ASPECTS_H

View File

@ -29,13 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//
// TrackingImages.h
// UTILS
//
// Created by alexey.musinov on 05.11.15.
// Copyright © 2015 Ascensio System SIA. All rights reserved.
//
#ifndef _TRACKING_IMAGES_H_
#define _TRACKING_IMAGES_H_

View File

@ -477,7 +477,7 @@ namespace Aggplus
Status CGraphics::CombineClip(CGraphicsPath* pPath, agg::sbool_op_e op)
{
Aggplus::CMatrix m;
return InternalClip(pPath, m_bIntegerGrid ? &m : &m_oFullTransform, op);
return InternalClip(pPath, (m_bIntegerGrid || pPath->m_pTransform != NULL) ? &m : &m_oFullTransform, op);
}
Status CGraphics::InternalClip(CGraphicsPath* pPath, CMatrix* pTransform, agg::sbool_op_e op)

View File

@ -38,6 +38,7 @@ namespace Aggplus
CGraphicsPath::CGraphicsPath() : ISimpleGraphicsPath()
{
m_bEvenOdd = false;
m_pTransform = NULL;
}
CGraphicsPath::~CGraphicsPath()
@ -406,14 +407,28 @@ namespace Aggplus
bool CGraphicsPath::_MoveTo(double x, double y)
{
if (NULL != m_pTransform)
{
m_pTransform->TransformPoint(x, y);
}
return (Ok == MoveTo(x, y));
}
bool CGraphicsPath::_LineTo(double x, double y)
{
if (NULL != m_pTransform)
{
m_pTransform->TransformPoint(x, y);
}
return (Ok == LineTo(x, y));
}
bool CGraphicsPath::_CurveTo(double x1, double y1, double x2, double y2, double x3, double y3)
{
if (NULL != m_pTransform)
{
m_pTransform->TransformPoint(x1, y1);
m_pTransform->TransformPoint(x2, y2);
m_pTransform->TransformPoint(x3, y3);
}
return (Ok == CurveTo(x1, y1, x2, y2, x3, y3));
}
bool CGraphicsPath::_Close()

View File

@ -113,6 +113,8 @@ public:
bool m_bEvenOdd;
bool m_bIsMoveTo;
CMatrix* m_pTransform;
public:
int EllipseArc(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection);

View File

@ -33,6 +33,21 @@
#include <algorithm>
#include "../raster/Metafile/MetaFile.h"
#if 0
static void LOGGING(char* buffer, ...)
{
FILE* f = fopen("path_to_log.txt", "a+");
va_list args;
va_start(args, buffer);
vfprintf(f, buffer, args);
fprintf(f, "\n");
fclose(f);
va_end(args);
}
#endif
////////////////////////////////////////////////////////////////////////////////
Aggplus::CBrush* CGraphicsRenderer::CreateBrush(NSStructures::CBrush* pBrush)
@ -687,7 +702,7 @@ HRESULT CGraphicsRenderer::CommandDrawTextEx(const std::wstring& bsUnicodeText,
HRESULT CGraphicsRenderer::BeginCommand(const DWORD& lType)
{
m_lCurrentCommandType = lType;
switch (lType)
{
case c_nPageType:
@ -1114,6 +1129,19 @@ HRESULT CGraphicsRenderer::CommandString(const LONG& lType, const std::wstring&
return S_OK;
}
HRESULT CGraphicsRenderer::StartConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = true;
m_pPath->m_pTransform = m_pRenderer->GetFullTransform();
return S_OK;
}
HRESULT CGraphicsRenderer::EndConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = false;
m_pPath->m_pTransform = NULL;
return S_OK;
}
// common
void CGraphicsRenderer::_SetFont()
{

View File

@ -247,6 +247,9 @@ public:
virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand);
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand);
virtual HRESULT StartConvertCoordsToIdentity();
virtual HRESULT EndConvertCoordsToIdentity();
void put_GlobalAlphaEnabled(const bool& bEnabled, const double& dVal);
inline void put_IntegerGrid(const bool& bEnabled)
{

View File

@ -34,65 +34,10 @@
#pragma once
#include "../common/Types.h"
#include "../common/IGrObject.h"
#include "Matrix.h"
#include <string>
#ifdef __APPLE__
#include <libkern/OSAtomic.h>
#endif
class IGrObject
{
protected:
#ifdef __APPLE__
volatile int32_t m_lRef;
#else
ULONG m_lRef;
#endif
public:
IGrObject()
{
m_lRef = 1;
}
virtual ~IGrObject()
{
}
#ifdef __APPLE__
virtual ULONG AddRef()
{
OSAtomicIncrement32(&m_lRef);
return (ULONG)m_lRef;
}
virtual ULONG Release()
{
int32_t ret = OSAtomicDecrement32(&m_lRef);
if (0 == m_lRef)
delete this;
return (ULONG)ret;
}
#else
virtual ULONG AddRef()
{
++m_lRef;
return m_lRef;
}
virtual ULONG Release()
{
ULONG ret = --m_lRef;
if (0 == m_lRef)
delete this;
return ret;
}
#endif
};
// тип в DrawPath
const long c_nStroke = 0x0001;
const long c_nWindingFillMode = 0x0100;
@ -177,6 +122,15 @@ const long c_nHtmlRendrerer3 = 0x0011;
// IRenderer
class IRenderer : public IGrObject
{
public:
bool m_bUseTransformCoordsToIdentity;
public:
IRenderer()
{
m_bUseTransformCoordsToIdentity = false;
}
public:
// тип рендерера-----------------------------------------------------------------------------
virtual HRESULT get_Type(LONG* lType) = 0;
@ -332,7 +286,18 @@ public:
// additiaonal params ----------------------------------------------------------------------
virtual HRESULT CommandLong(const LONG& lType, const LONG& lCommand) = 0;
virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand) = 0;
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand) = 0;
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand) = 0;
virtual HRESULT StartConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = true;
return S_OK;
}
virtual HRESULT EndConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = false;
return S_OK;
}
};
#define PROPERTY_RENDERER(NameBase, Name, Type) \

View File

@ -173,6 +173,9 @@ namespace NSHtmlRenderer
virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand);
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand);
virtual HRESULT StartConvertCoordsToIdentity();
virtual HRESULT EndConvertCoordsToIdentity();
// owner params ----------------------------------------------------------------------
virtual HRESULT get_Mode(LONG *plMode);
virtual HRESULT put_Mode(LONG lMode);

View File

@ -1206,6 +1206,21 @@ namespace NSHtmlRenderer
return S_OK;
}
HRESULT CASCHTMLRenderer3::StartConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = true;
if (m_pInternal->m_bIsGraphicsDumperMode)
return m_pInternal->m_oDumper.StartConvertCoordsToIdentity();
return S_OK;
}
HRESULT CASCHTMLRenderer3::EndConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = false;
if (m_pInternal->m_bIsGraphicsDumperMode)
return m_pInternal->m_oDumper.EndConvertCoordsToIdentity();
return S_OK;
}
// owner params ----------------------------------------------------------------------
HRESULT CASCHTMLRenderer3::get_Mode(LONG *plMode)
{

View File

@ -811,6 +811,19 @@ namespace NSHtmlRenderer
return m_pRenderer->put_ClipMode(lMode);
return S_OK;
}
inline virtual HRESULT StartConvertCoordsToIdentity()
{
if (m_pRenderer)
m_pRenderer->StartConvertCoordsToIdentity();
return S_OK;
}
inline virtual HRESULT EndConvertCoordsToIdentity()
{
if (m_pRenderer)
m_pRenderer->EndConvertCoordsToIdentity();
return S_OK;
}
};

View File

@ -46,7 +46,7 @@
//#define ONLINE_WORD_TO_PDF
//#define TO_PDF
#define TO_HTML_RENDERER
#define ONLY_TEXT
//#define ONLY_TEXT
int main(int argc, char *argv[])
{
@ -97,8 +97,18 @@ int main(int argc, char *argv[])
//std::wstring sFile = L"D:\\bankomats.xps";
//std::wstring sFile = L"\\\\kirillov8\\_Office\\DJVU\\Основы разработки приложений на платформе Microsoft .NET Framework. Учебный курс Microsoft экзамен 70-536.djvu";
//std::wstring sFile = L"D:\\TESTFILES\\Алгоритмы - построение и анализ.djvu";
std::wstring sFile = L"D:\\TESTFILES\\PDF 1-7 (756p).pdf";
#ifndef WIN32
std::wstring sFile = L"/home/oleg/GIT/ddd/ZfAvCwDsowJALpClgmE_/source/ZfAvCwDsowJALpClgmE_.pdf";
#else
//std::wstring sFile = L"D:\\ddd\\ZfAvCwDsowJALpClgmE_\\source\\ZfAvCwDsowJALpClgmE_.pdf";
std::wstring sFile = L"D:\\ddd\\knopk5_0.pdf";
#endif
#ifdef WIN32
std::wstring sDst = L"D:\\test\\Document";
#else
std::wstring sDst = L"/home/oleg/test/Document";
#endif
//std::wstring sFile = L"/home/oleg/activex/Android intro(2p).pdf";
//std::wstring sFile = L"/home/oleg/activex/Pi(1p).pdf";
@ -114,6 +124,8 @@ int main(int argc, char *argv[])
pReader->SetTempDirectory(sDst);
pReader->LoadFromFile(sFile);
//pReader->ConvertToRaster(0, L"D:\\111.png", 4);
#ifdef TO_HTML_RENDERER
NSHtmlRenderer::CASCHTMLRenderer3 oRenderer;
#ifdef ONLY_TEXT

View File

@ -25,42 +25,20 @@ INCLUDEPATH += \
TEMPLATE = app
############### destination path ###############
DESTINATION_SDK_PATH = $$PWD/../../build/lib
CORE_ROOT_DIR = $$PWD/../..
PWD_ROOT_DIR = $$PWD
include($$CORE_ROOT_DIR/Common/base.pri)
# WINDOWS
win32:contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_64/DEBUG
} else {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_64
}
}
win32:!contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_32/DEBUG
} else {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_32
}
}
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lgraphics
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lOfficeUtils
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lHtmlRenderer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPdfReader
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDjVuFile
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lXpsFile
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPdfWriter
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lUnicodeConverter
linux-g++:contains(QMAKE_HOST.arch, x86_64):{
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/linux_64
}
linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/linux_32
}
LIBS += -L$$DESTINATION_SDK_PATH -lgraphics
LIBS += -L$$DESTINATION_SDK_PATH -lOfficeUtils
LIBS += -L$$DESTINATION_SDK_PATH -lHtmlRenderer
LIBS += -L$$DESTINATION_SDK_PATH -lPdfReader
LIBS += -L$$DESTINATION_SDK_PATH -lDjVuFile
LIBS += -L$$DESTINATION_SDK_PATH -lXpsFile
LIBS += -L$$DESTINATION_SDK_PATH -lPdfWriter
LIBS += -L$$DESTINATION_SDK_PATH -lUnicodeConverter
LIBS += -L$$PWD/../../build/bin/icu/win_64
include($$PWD/../../Common/3dParty/icu/icu.pri)
win32 {
LIBS += -lgdi32 \

File diff suppressed because it is too large Load Diff

View File

@ -240,6 +240,7 @@ namespace PdfReader
virtual void ClipToStrokePath(GrState *pGState);
virtual void ClipToPath(GrState *pGState, GrPath *pPath, double *pMatrix, bool bEO);
//----- Вывод текста
virtual void EndTextObject(GrState *pGState);
virtual void BeginStringOperator(GrState *pGState);
virtual void EndStringOperator(GrState *pGState);
virtual void DrawString(GrState *pGState, StringExt *seString);

View File

@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.0.3.434
VERSION = 2.0.3.435
DEFINES += INTVER=$$VERSION
TARGET = x2t

View File

@ -226,16 +226,16 @@ namespace NExtractTools
}
else return AVS_FILEUTILS_ERROR_CONVERT; }
return xlsx_dir2xlst_bin(sTempUnpackedXLSX, sTo, params);
return xlsx_dir2xlst_bin(sTempUnpackedXLSX, sTo, params, true);
}
int xlsx_dir2xlst_bin (const std::wstring &sXlsxDir, const std::wstring &sTo, InputParams& params)
int xlsx_dir2xlst_bin (const std::wstring &sXlsxDir, const std::wstring &sTo, InputParams& params, bool bXmlOptions)
{
// Save to file (from temp dir)
BinXlsxRW::CXlsxSerializer m_oCXlsxSerializer;
m_oCXlsxSerializer.setFontDir(params.getFontPath());
return m_oCXlsxSerializer.saveToFile (sTo, sXlsxDir, params.getXmlOptions()) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
return m_oCXlsxSerializer.saveToFile (sTo, sXlsxDir, bXmlOptions ? params.getXmlOptions() : L"") ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}
// xslx -> xslt
@ -2016,47 +2016,48 @@ namespace NExtractTools
return nRes;
}
int fromXlsxDir(const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params)
{
int nRes = 0;
if(0 != (AVS_OFFICESTUDIO_FILE_SPREADSHEET & nFormatTo) && AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV != nFormatTo)
{
if(AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX == nFormatTo)
{
nRes = dir2zip(sFrom, sTo);
}
//else if(AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS == nFormatTo)
else if(AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS == nFormatTo)
{
nRes = xlsx_dir2ods(sFrom, sTo, sTemp, params);
}
else
nRes = AVS_FILEUTILS_ERROR_CONVERT;
}
else if(AVS_OFFICESTUDIO_FILE_OTHER_JSON == nFormatTo)
{
nRes = xlsx_dir2xlst_bin(sFrom, sTo, params);
}
else if(AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET == nFormatTo)
{
nRes = xlsx_dir2xlst_bin(sFrom, sTo, params);
}
else
{
std::wstring sXlstDir = sTemp + FILE_SEPARATOR_STR + L"xlst_unpacked";
NSDirectory::CreateDirectory(sXlstDir);
std::wstring sTFile = sXlstDir + FILE_SEPARATOR_STR + L"Editor.bin";
if(AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV == nFormatTo)
nRes = xlsx_dir2xlst_bin(sFrom, sTFile, params);
else
nRes = xlsx_dir2xlst_bin(sFrom, sTFile, params);
if(SUCCEEDED_X2T(nRes))
{
nRes = fromXlstBin(sTFile, sTo, nFormatTo, sTemp, sThemeDir, bFromChanges, bPaid, params);
}
}
return nRes;
}
int fromXlsxDir(const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params)
{
int nRes = 0;
if(0 != (AVS_OFFICESTUDIO_FILE_SPREADSHEET & nFormatTo) && AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV != nFormatTo)
{
if(AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX == nFormatTo)
{
nRes = dir2zip(sFrom, sTo);
}
//else if(AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS == nFormatTo)
else if(AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS == nFormatTo)
{
nRes = xlsx_dir2ods(sFrom, sTo, sTemp, params);
}
else
nRes = AVS_FILEUTILS_ERROR_CONVERT;
}
else if(AVS_OFFICESTUDIO_FILE_OTHER_JSON == nFormatTo)
{
nRes = xlsx_dir2xlst_bin(sFrom, sTo, params, true);
}
else if(AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET == nFormatTo)
{
nRes = xlsx_dir2xlst_bin(sFrom, sTo, params, true);
}
else
{
std::wstring sXlstDir = sTemp + FILE_SEPARATOR_STR + _T("xlst_unpacked");
NSDirectory::CreateDirectory(sXlstDir);
std::wstring sTFile = sXlstDir + FILE_SEPARATOR_STR + _T("Editor.bin");
if(AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV == nFormatTo)
nRes = xlsx_dir2xlst_bin(sFrom, sTFile, params, false);
else
nRes = xlsx_dir2xlst_bin(sFrom, sTFile, params, true);
if(SUCCEEDED_X2T(nRes))
{
nRes = fromXlstBin(sTFile, sTo, nFormatTo, sTemp, sThemeDir, bFromChanges, bPaid, params);
}
}
return nRes;
}
int fromXlstBin(const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params)
{
int nRes = 0;