Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
a4ee30d0
Commit
a4ee30d0
authored
Nov 17, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug #36201
parent
e05194b2
Changes
29
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
1487 additions
and
1823 deletions
+1487
-1823
ASCOfficeDocFile/DocFormatLib/Win32/DocFormatLib.vcproj
ASCOfficeDocFile/DocFormatLib/Win32/DocFormatLib.vcproj
+1
-1
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/ShapeWriter.cpp
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/ShapeWriter.cpp
+5
-3
ASCOfficePPTFile/PPTFormatLib/Records/Drawing/ShapeContainer.h
...ficePPTFile/PPTFormatLib/Records/Drawing/ShapeContainer.h
+5
-4
ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcproj
ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcproj
+1
-1
ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp
ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp
+63
-16
ASCOfficePPTXFile/ASCOfficeDrawingConverter.h
ASCOfficePPTXFile/ASCOfficeDrawingConverter.h
+3
-1
ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp
ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp
+0
-1
ASCOfficePPTXFile/Editor/Drawing/Elements.h
ASCOfficePPTXFile/Editor/Drawing/Elements.h
+5
-16
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/BaseShape.cpp
...icePPTXFile/Editor/Drawing/Shapes/BaseShape/BaseShape.cpp
+0
-17
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/CustomGeomShape.h
...ditor/Drawing/Shapes/BaseShape/PPTShape/CustomGeomShape.h
+1
-1
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.cpp
...ile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.cpp
+1
-1
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.h
...XFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.h
+1
-1
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PptFormula.cpp
...e/Editor/Drawing/Shapes/BaseShape/PPTShape/PptFormula.cpp
+166
-166
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PptFormula.h
...ile/Editor/Drawing/Shapes/BaseShape/PPTShape/PptFormula.h
+418
-417
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/ppt2pptxshapeconverter.h
...rawing/Shapes/BaseShape/PPTShape/ppt2pptxshapeconverter.h
+46
-26
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTXShape/PPTXShape.cpp
...e/Editor/Drawing/Shapes/BaseShape/PPTXShape/PPTXShape.cpp
+2
-2
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTXShape/PptxFormula.cpp
...Editor/Drawing/Shapes/BaseShape/PPTXShape/PptxFormula.cpp
+99
-99
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTXShape/PptxFormula.h
...e/Editor/Drawing/Shapes/BaseShape/PPTXShape/PptxFormula.h
+387
-387
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTXShape/pptx2pptshapeconverter.h
...awing/Shapes/BaseShape/PPTXShape/pptx2pptshapeconverter.h
+4
-46
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/Path.h
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/Path.h
+79
-391
ASCOfficePPTXFile/Editor/Drawing/Shapes/Shape.h
ASCOfficePPTXFile/Editor/Drawing/Shapes/Shape.h
+134
-132
ASCOfficePPTXFile/Editor/Drawing/TextAttributesEx.cpp
ASCOfficePPTXFile/Editor/Drawing/TextAttributesEx.cpp
+0
-13
ASCOfficePPTXFile/Editor/Drawing/TextAttributesEx.h
ASCOfficePPTXFile/Editor/Drawing/TextAttributesEx.h
+0
-5
ASCOfficePPTXFile/Editor/PresentationDrawingsDef.h
ASCOfficePPTXFile/Editor/PresentationDrawingsDef.h
+0
-55
ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.cpp
ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.cpp
+10
-7
ASCOfficePPTXFile/PPTXFormat/Logic/Path.h
ASCOfficePPTXFile/PPTXFormat/Logic/Path.h
+0
-4
ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro
...icePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro
+7
-5
ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj
ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj
+48
-4
X2tConverter/test/win32Test/X2tTest.vcproj
X2tConverter/test/win32Test/X2tTest.vcproj
+1
-1
No files found.
ASCOfficeDocFile/DocFormatLib/Win32/DocFormatLib.vcproj
View file @
a4ee30d0
...
...
@@ -44,7 +44,7 @@
Name=
"VCCLCompilerTool"
Optimization=
"0"
AdditionalIncludeDirectories=
""
PreprocessorDefinitions=
"WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;
PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions=
"WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild=
"true"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"3"
...
...
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/ShapeWriter.cpp
View file @
a4ee30d0
...
...
@@ -853,7 +853,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
m_oWriter
.
WriteString
(
std
::
wstring
(
L" prst=
\"
"
)
+
prstTxWarp
+
_T
(
"
\"
>"
));
m_oWriter
.
WriteString
(
std
::
wstring
(
L"<a:avLst>"
));
//модификаторы
CPPTShape
*
pPPTShape
=
dynamic_cast
<
CPPTShape
*>
(
m_pShapeElement
->
m_oShape
.
m_pShape
);
CPPTShape
*
pPPTShape
=
dynamic_cast
<
CPPTShape
*>
(
m_pShapeElement
->
m_oShape
.
getBaseShape
()
);
std
::
wstring
strVal
;
for
(
int
i
=
0
;
(
pPPTShape
)
&&
(
i
<
pPPTShape
->
m_arAdjustments
.
size
());
i
++
)
...
...
@@ -1308,12 +1308,14 @@ std::wstring NSPresentationEditor::CShapeWriter::ConvertShape()
m_oWriter
.
WriteString
(
std
::
wstring
(
L"</a:xfrm>"
));
}
if
(
m_pShapeElement
->
m_oShape
.
m_lDrawType
&
c_ShapeDrawType_Graphic
||
m_pShapeElement
->
m_oShape
.
m_pShape
->
m_bCustomShape
)
CBaseShape
*
shape
=
m_pShapeElement
->
m_oShape
.
getBaseShape
();
if
(
m_pShapeElement
->
m_oShape
.
m_lDrawType
&
c_ShapeDrawType_Graphic
||
shape
->
m_bCustomShape
)
{
m_pShapeElement
->
m_oShape
.
ToRenderer
(
dynamic_cast
<
IRenderer
*>
(
this
),
oInfo
,
m_oMetricInfo
,
0.0
,
1.0
);
}
if
((
prstGeom
.
empty
()
==
false
||
m_pShapeElement
->
m_bShapePreset
)
&&
prstTxWarp
.
empty
()
&&
!
m_pShapeElement
->
m_oShape
.
m_pS
hape
->
m_bCustomShape
)
if
((
prstGeom
.
empty
()
==
false
||
m_pShapeElement
->
m_bShapePreset
)
&&
prstTxWarp
.
empty
()
&&
!
s
hape
->
m_bCustomShape
)
{
if
(
prstGeom
.
empty
())
prstGeom
=
L"rect"
;
m_oWriter
.
WriteString
(
std
::
wstring
(
L"<a:prstGeom"
));
...
...
ASCOfficePPTFile/PPTFormatLib/Records/Drawing/ShapeContainer.h
View file @
a4ee30d0
...
...
@@ -265,7 +265,7 @@ public:
case
NSPresentationEditor
:
:
etShape
:
{
CShapeElement
*
pShapeElem
=
(
CShapeElement
*
)
pElement
;
CPPTShape
*
pPPTShape
=
dynamic_cast
<
CPPTShape
*>
(
pShapeElem
->
m_oShape
.
m_pShape
);
CPPTShape
*
pPPTShape
=
dynamic_cast
<
CPPTShape
*>
(
pShapeElem
->
m_oShape
.
getBaseShape
()
);
if
(
NULL
!=
pPPTShape
)
{
...
...
@@ -859,7 +859,7 @@ public:
SetUpProperty
((
IElement
*
)
pElement
,
pTheme
,
pInfo
,
pSlide
,
pProperty
);
CShape
*
pParentShape
=
&
pElement
->
m_oShape
;
CPPTShape
*
pShape
=
dynamic_cast
<
CPPTShape
*>
(
pParentShape
->
m_pShape
);
CPPTShape
*
pShape
=
dynamic_cast
<
CPPTShape
*>
(
pParentShape
->
getBaseShape
()
);
if
(
NULL
==
pShape
)
return
;
...
...
@@ -1402,7 +1402,8 @@ public:
{
// shape
CShapeElement
*
pShape
=
new
CShapeElement
(
NSBaseShape
::
ppt
,
eType
);
CPPTShape
*
ppt_shape
=
dynamic_cast
<
CPPTShape
*>
(
pShape
->
m_oShape
.
m_pShape
);
CPPTShape
*
ppt_shape
=
dynamic_cast
<
CPPTShape
*>
(
pShape
->
m_oShape
.
getBaseShape
());
if
(
(
ppt_shape
)
&&
(
OOXMLShapes
::
sptCustom
==
ppt_shape
->
m_eType
))
{
pShape
->
m_bShapePreset
=
true
;
...
...
@@ -2246,7 +2247,7 @@ protected:
ApplyHyperlink
(
pShape
,
oColor
);
}
CPPTShape
*
pPPTShape
=
dynamic_cast
<
CPPTShape
*>
(
pShape
->
m_oShape
.
m_pShape
);
CPPTShape
*
pPPTShape
=
dynamic_cast
<
CPPTShape
*>
(
pShape
->
m_oShape
.
getBaseShape
()
);
if
(
NULL
!=
pPPTShape
)
// проверка на wordart
{
...
...
ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcproj
View file @
a4ee30d0
...
...
@@ -56,7 +56,7 @@
Name=
"VCCLCompilerTool"
Optimization=
"0"
AdditionalIncludeDirectories=
""
PreprocessorDefinitions=
"_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;
PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions=
"_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild=
"true"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"3"
...
...
ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp
View file @
a4ee30d0
...
...
@@ -974,7 +974,6 @@ HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
if
(
oNode
.
IsValid
())
{
#ifdef PPT_DEF
CPPTShape
*
pShape
=
new
CPPTShape
();
pShape
->
m_bIsShapeType
=
true
;
...
...
@@ -984,11 +983,11 @@ HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
pShape
->
LoadFromXMLShapeType
(
oNodeST
);
CShape
*
pS
=
new
CShape
(
NSBaseShape
::
unknown
,
0
);
pS
->
m_pShape
=
pShape
;
pS
->
setBaseShape
(
pShape
);
LoadCoordSize
(
oNodeST
,
pS
);
m_mapShapeTypes
.
insert
(
std
::
pair
<
std
::
wstring
,
CShape
*>
(
strId
,
pS
));
#endif
}
return
S_OK
;
...
...
@@ -1850,8 +1849,8 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
if
(
m_mapShapeTypes
.
end
()
!=
pPair
)
{
pPPTShape
=
new
CPPTShape
();
pPair
->
second
->
m_pShape
->
SetToDublicate
(
pPPTShape
);
pPPTShape
->
m_eType
=
((
CPPTShape
*
)(
pPair
->
second
->
m_pShape
))
->
m_eType
;
pPair
->
second
->
getBaseShape
()
->
SetToDublicate
(
pPPTShape
);
pPPTShape
->
m_eType
=
((
CPPTShape
*
)(
pPair
->
second
->
getBaseShape
()
))
->
m_eType
;
}
}
...
...
@@ -1881,22 +1880,28 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
pPPTShape
->
m_eType
=
PPTShapes
::
sptCustom
;
}
}
oShapeElem
.
m_oShape
.
setBaseShape
(
pPPTShape
);
if
(
bIsNeedCoordSizes
)
{
LoadCoordPos
(
oNodeShape
,
&
oShapeElem
.
m_oShape
);
//for path calculate
}
pPPTShape
->
LoadFromXMLShapeType
(
oNodeShape
);
}
if
(
pPPTShape
!=
NULL
)
{
oShapeElem
.
m_oShape
.
m_pShape
=
pPPTShape
;
oShapeElem
.
m_oShape
.
setBaseShape
(
pPPTShape
);
if
(
bIsNeedCoordSizes
)
{
LoadCoordSize
(
oNodeShape
,
&
oShapeElem
.
m_oShape
);
}
else
{
oShapeElem
.
m_oShape
.
m_dWidthLogic
=
21600
;
oShapeElem
.
m_oShape
.
m_dHeightLogic
=
21600
;
oShapeElem
.
m_oShape
.
m_pShape
->
m_oPath
.
SetCoordsize
(
21600
,
21600
);
oShapeElem
.
m_oShape
.
getBaseShape
()
->
m_oPath
.
SetCoordsize
(
21600
,
21600
);
}
std
::
wstring
strXmlPPTX
;
...
...
@@ -2808,7 +2813,8 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
pShape
->
LoadFromXMLShapeType
(
oNodeT
);
CShape
*
pS
=
new
CShape
(
NSBaseShape
::
unknown
,
0
);
pS
->
m_pShape
=
pShape
;
pS
->
setBaseShape
(
pShape
);
LoadCoordSize
(
oNodeT
,
pS
);
m_mapShapeTypes
.
insert
(
std
::
pair
<
std
::
wstring
,
CShape
*>
(
strId
,
pS
));
...
...
@@ -2983,16 +2989,57 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
result
->
InitElem
(
pTree
);
}
void
CDrawingConverter
::
LoadCoordPos
(
XmlUtils
::
CXmlNode
&
oNode
,
CShape
*
pShape
)
{
pShape
->
m_dXLogic
=
0
;
pShape
->
m_dYLogic
=
0
;
XmlUtils
::
CXmlNode
oNodeTemplate
;
if
(
oNode
.
GetNode
(
L"coordorigin"
,
oNodeTemplate
))
{
std
::
wstring
strCoordSize
=
oNodeTemplate
.
GetAttributeOrValue
(
L"val"
);
if
(
!
strCoordSize
.
empty
())
{
std
::
vector
<
std
::
wstring
>
oArray
;
boost
::
algorithm
::
split
(
oArray
,
strCoordSize
,
boost
::
algorithm
::
is_any_of
(
L","
),
boost
::
algorithm
::
token_compress_on
);
if
(
oArray
.
size
()
>=
2
)
{
pShape
->
m_dXLogic
=
XmlUtils
::
GetInteger
(
oArray
[
0
]);
pShape
->
m_dYLogic
=
XmlUtils
::
GetInteger
(
oArray
[
1
]);
}
}
}
else
{
std
::
wstring
strCoordSize
=
oNode
.
GetAttributeOrValue
(
L"coordorigin"
);
if
(
!
strCoordSize
.
empty
())
{
std
::
vector
<
std
::
wstring
>
oArray
;
boost
::
algorithm
::
split
(
oArray
,
strCoordSize
,
boost
::
algorithm
::
is_any_of
(
L","
),
boost
::
algorithm
::
token_compress_on
);
if
(
oArray
.
size
()
>=
2
)
{
pShape
->
m_dXLogic
=
XmlUtils
::
GetInteger
(
oArray
[
0
]);
pShape
->
m_dYLogic
=
XmlUtils
::
GetInteger
(
oArray
[
1
]);
}
}
}
pShape
->
getBaseShape
()
->
m_oPath
.
SetCoordpos
((
LONG
)
pShape
->
m_dXLogic
,
(
LONG
)
pShape
->
m_dYLogic
);
}
void
CDrawingConverter
::
LoadCoordSize
(
XmlUtils
::
CXmlNode
&
oNode
,
CShape
*
pShape
)
{
pShape
->
m_dWidthLogic
=
ShapeSizeVML
;
pShape
->
m_dHeightLogic
=
ShapeSizeVML
;
XmlUtils
::
CXmlNode
oNodeTemplate
;
if
(
oNode
.
GetNode
(
L"coordsize"
,
oNodeTemplate
))
{
std
::
wstring
strCoordSize
=
oNodeTemplate
.
GetAttributeOrValue
(
L"val"
);
if
(
strCoordSize
!=
L""
)
if
(
!
strCoordSize
.
empty
()
)
{
std
::
vector
<
std
::
wstring
>
oArray
;
boost
::
algorithm
::
split
(
oArray
,
strCoordSize
,
boost
::
algorithm
::
is_any_of
(
L","
),
boost
::
algorithm
::
token_compress_on
);
...
...
@@ -3007,7 +3054,7 @@ void CDrawingConverter::LoadCoordSize(XmlUtils::CXmlNode& oNode, CShape* pShape)
else
{
std
::
wstring
strCoordSize
=
oNode
.
GetAttributeOrValue
(
L"coordsize"
);
if
(
strCoordSize
!=
L""
)
if
(
!
strCoordSize
.
empty
()
)
{
std
::
vector
<
std
::
wstring
>
oArray
;
boost
::
algorithm
::
split
(
oArray
,
strCoordSize
,
boost
::
algorithm
::
is_any_of
(
L","
),
boost
::
algorithm
::
token_compress_on
);
...
...
@@ -3020,7 +3067,7 @@ void CDrawingConverter::LoadCoordSize(XmlUtils::CXmlNode& oNode, CShape* pShape)
}
}
pShape
->
m_pShape
->
m_oPath
.
SetCoordsize
((
LONG
)
pShape
->
m_dWidthLogic
,
(
LONG
)
pShape
->
m_dHeightLogic
);
pShape
->
getBaseShape
()
->
m_oPath
.
SetCoordsize
((
LONG
)
pShape
->
m_dWidthLogic
,
(
LONG
)
pShape
->
m_dHeightLogic
);
}
std
::
wstring
CDrawingConverter
::
GetDrawingMainProps
(
XmlUtils
::
CXmlNode
&
oNode
,
PPTX
::
CCSS
&
oCssStyles
,
CSpTreeElemProps
&
oProps
)
...
...
ASCOfficePPTXFile/ASCOfficeDrawingConverter.h
View file @
a4ee30d0
...
...
@@ -277,6 +277,8 @@ namespace NSBinPptxRW
void
CheckPenShape
(
PPTX
::
Logic
::
SpTreeElem
*
oElem
,
XmlUtils
::
CXmlNode
&
oNode
,
PPTShapes
::
ShapeType
eType
,
CPPTShape
*
pPPTShape
);
void
LoadCoordSize
(
XmlUtils
::
CXmlNode
&
oNode
,
::
CShape
*
pShape
);
void
LoadCoordPos
(
XmlUtils
::
CXmlNode
&
oNode
,
::
CShape
*
pShape
);
std
::
wstring
GetDrawingMainProps
(
XmlUtils
::
CXmlNode
&
oNode
,
PPTX
::
CCSS
&
oCssStyles
,
CSpTreeElemProps
&
oProps
);
void
ConvertMainPropsToVML
(
const
std
::
wstring
&
sMainProps
,
NSBinPptxRW
::
CXmlWriter
&
oWriter
,
PPTX
::
Logic
::
SpTreeElem
&
oElem
);
...
...
ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp
View file @
a4ee30d0
...
...
@@ -46,7 +46,6 @@
#include "Editor/PPTXWriter.h"
#include "PPTXFormat/PPTXEvent.h"
#include "Editor/PresentationDrawingsDef.h"
CPPTXFile
::
CPPTXFile
(
extract_to_directory
fCallbackExtract
,
compress_from_directory
fCallbackCompress
,
progress_operation
fCallbackProgress
,
void
*
pCallbackArg
)
{
...
...
ASCOfficePPTXFile/Editor/Drawing/Elements.h
View file @
a4ee30d0
...
...
@@ -37,12 +37,8 @@
#include "../../../Common/FileDownloader/FileDownloader.h"
#endif
#include "Shapes/BaseShape/PPTShape/ppt2pptxshapeconverter.h"
#ifdef ENABLE_PPT_TO_PPTX_CONVERT
#include "Shapes/BaseShape/PPTShape/ppt2pptxshapeconverter.h"
#endif
#if defined(PPTX_DEF)
namespace
PPTX2EditorAdvanced
{
AVSINLINE
OOXMLShapes
::
ShapeType
GetShapeTypeFromStr
(
const
std
::
wstring
&
str
)
//const
...
...
@@ -284,7 +280,7 @@ namespace PPTX2EditorAdvanced
return
OOXMLShapes
::
sptNil
;
}
}
#endif
namespace
NSPresentationEditor
{
...
...
@@ -355,9 +351,6 @@ namespace NSPresentationEditor
return
(
IElement
*
)
pImageElement
;
}
#ifdef ENABLE_PPT_TO_PPTX_CONVERT
AVSINLINE
std
::
wstring
ConvertPPTShapeToPPTX
(
bool
bIsNamespace
=
false
)
{
NSGuidesVML
::
CFormParam
pParamCoef
;
...
...
@@ -383,7 +376,6 @@ namespace NSPresentationEditor
return
strXmlPPTX
;
}
#endif
AVSINLINE
std
::
wstring
DownloadImage
(
const
std
::
wstring
&
strFile
)
{
#ifndef DISABLE_FILE_DOWNLOADER
...
...
@@ -432,7 +424,7 @@ namespace NSPresentationEditor
m_bShapePreset
=
false
;
m_oShape
.
LoadFromXML
(
str
);
m_ClassType
=
m_oShape
.
m_pShape
->
GetClassType
();
m_ClassType
=
m_oShape
.
getBaseShape
()
->
GetClassType
();
}
virtual
void
NormalizeCoordsByMetric
()
{
...
...
@@ -469,7 +461,7 @@ namespace NSPresentationEditor
m_oShape
.
m_oText
.
m_lPlaceholderType
=
m_lPlaceholderType
;
m_oShape
.
m_oText
.
m_lPlaceholderID
=
m_lPlaceholderID
;
m_oShape
.
m_pShape
->
ReCalculate
();
m_oShape
.
getBaseShape
()
->
ReCalculate
();
SetupTextProperties
(
pSlide
,
pTheme
,
pLayout
);
...
...
@@ -482,11 +474,9 @@ namespace NSPresentationEditor
void
CalculateColor
(
CColor
&
oColor
,
CSlide
*
pSlide
,
CTheme
*
pTheme
,
CLayout
*
pLayout
);
#ifdef ENABLE_PPT_TO_PPTX_CONVERT
AVSINLINE
std
::
wstring
ConvertPPTShapeToPPTX
(
bool
bIsNamespace
=
false
)
{
CPPTShape
*
pPPTShape
=
dynamic_cast
<
CPPTShape
*>
(
m_oShape
.
m_pShape
);
CPPTShape
*
pPPTShape
=
dynamic_cast
<
CPPTShape
*>
(
m_oShape
.
getBaseShape
()
);
if
(
NULL
==
pPPTShape
)
{
// такого быть не может
...
...
@@ -688,7 +678,6 @@ namespace NSPresentationEditor
}
#endif
#endif
};
...
...
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/BaseShape.cpp
View file @
a4ee30d0
...
...
@@ -33,31 +33,21 @@
#include "BaseShape.h"
#if defined(PPTX_DEF)
#include "PPTXShape/PPTXShape.h"
#endif
#if defined(PPT_DEF)
#include "PPTShape/PPTShape.h"
#endif
NSPresentationEditor
::
CBaseShape
*
NSPresentationEditor
::
CBaseShape
::
CreateByType
(
NSPresentationEditor
::
NSBaseShape
::
ClassType
ClassType
,
int
ShapeType
)
{
#if defined(PPTX_DEF)
if
(
ClassType
==
pptx
)
{
return
CPPTXShape
::
CreateByType
((
OOXMLShapes
::
ShapeType
)
ShapeType
);
}
#endif
#if defined(PPT_DEF)
if
(
ClassType
==
ppt
)
{
return
CPPTShape
::
CreateByType
((
PPTShapes
::
ShapeType
)
ShapeType
);
}
#endif
return
NULL
;
}
...
...
@@ -67,21 +57,14 @@ bool NSPresentationEditor::CBaseShape::SetType(NSPresentationEditor::NSBaseShape
if
(
ClassType
!=
GetClassType
())
return
false
;
#if defined(PPTX_DEF)
if
(
ClassType
==
pptx
)
{
return
((
CPPTXShape
*
)
this
)
->
SetShapeType
((
OOXMLShapes
::
ShapeType
)
ShapeType
);
}
#endif
#if defined(PPT_DEF)
if
(
ClassType
==
ppt
)
{
return
((
CPPTShape
*
)
this
)
->
SetShapeType
((
PPTShapes
::
ShapeType
)
ShapeType
);
}
#endif
return
false
;
}
\ No newline at end of file
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/CustomGeomShape.h
View file @
a4ee30d0
...
...
@@ -34,7 +34,7 @@
#include "ElementSettings.h"
#include "../BaseShape.h"
#include "../../../Attributes.h"
#include "Formula.h"
#include "
Ppt
Formula.h"
namespace
NSCustomVML
{
...
...
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.cpp
View file @
a4ee30d0
...
...
@@ -31,7 +31,7 @@
*/
#pragma once
#include "P
PT
Shape.h"
#include "P
pt
Shape.h"
#include "PresetShapesHeader.h"
const
double
EMU_MM
=
36000
;
...
...
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.h
View file @
a4ee30d0
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/Formula.cpp
→
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/
Ppt
Formula.cpp
View file @
a4ee30d0
...
...
@@ -31,7 +31,7 @@
*/
#pragma once
#include "
Formula.h"
#include "
PptFormula.h"
LONG
NSGuidesVML
::
CFormula
::
Calculate
(
NSGuidesVML
::
CFormulasManager
*
pManager
)
{
...
...
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/Formula.h
→
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/
Ppt
Formula.h
View file @
a4ee30d0
...
...
@@ -41,8 +41,9 @@
#include "./../Common.h"
#include "../../../../../../DesktopEditor/xml/include/xmlutils.h"
#include "../../../../../../DesktopEditor/graphics/aggplustypes.h"
#include "../../../../../../Common/DocxFormat/Source/XML/utils.h"
namespace
NSGuidesVML
{
enum
FormulaType
...
...
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/ppt2pptxshapeconverter.h
View file @
a4ee30d0
...
...
@@ -30,7 +30,7 @@
*
*/
#pragma once
#include "
./
Formula.h"
#include "
Ppt
Formula.h"
#include "../Path.h"
#define OPTIMIZE_COMPILE_CONVERT_PPT_TO_PPTX
...
...
@@ -1860,18 +1860,18 @@ namespace NSGuidesVML
};
class
CSlicePath
{
private:
int
m_nCountElementsPoint
;
LONG
m_lX
;
LONG
m_lY
;
public:
RulesType
m_eRuler
;
std
::
vector
<
Aggplus
::
POINT
>
m_arPoints
;
std
::
vector
<
SPointType
>
m_arPointsType
;
private:
int
m_nCountElementsPoint
;
public:
CSlicePath
(
RulesType
eType
=
rtMoveTo
)
CSlicePath
(
RulesType
rule
=
rtMoveTo
,
LONG
x
=
0
,
LONG
y
=
0
)
:
m_lX
(
x
),
m_lY
(
y
),
m_eRuler
(
rule
)
{
m_eRuler
=
eType
;
m_nCountElementsPoint
=
0
;
}
...
...
@@ -1884,6 +1884,10 @@ namespace NSGuidesVML
SPointType
pointType
;
point
.
x
=
lParam
;
if
(
m_eRuler
!=
rtRMoveTo
&&
m_eRuler
!=
rtRLineTo
&&
m_eRuler
!=
rtRCurveTo
)
{
point
.
x
-=
m_lX
;
}
point
.
y
=
0
;
pointType
.
x
=
eParType
;
pointType
.
y
=
ptValue
;
...
...
@@ -1893,6 +1897,11 @@ namespace NSGuidesVML
else
{
m_arPoints
.
back
().
y
=
lParam
;
if
(
m_eRuler
!=
rtRMoveTo
&&
m_eRuler
!=
rtRLineTo
&&
m_eRuler
!=
rtRCurveTo
)
{
m_arPoints
.
back
().
y
-=
m_lY
;
}
m_arPointsType
.
back
().
y
=
eParType
;
}
++
m_nCountElementsPoint
;
...
...
@@ -1908,6 +1917,9 @@ namespace NSGuidesVML
LONG
m_lWidth
;
LONG
m_lHeight
;
LONG
m_lX
;
LONG
m_lY
;
std
::
vector
<
LONG
>
m_arIndexDst
;
std
::
vector
<
CSlicePath
>
m_arSlicesPath
;
std
::
vector
<
CPartPath
>
m_arParts
;
...
...
@@ -1924,7 +1936,6 @@ namespace NSGuidesVML
CFormParam
m_oParam
;
int
m_lMaxAdjUse
;
public:
// все в одно не получится, формулы появляются и при конвертации path/adj и т.д.
NSBinPptxRW
::
CXmlWriter
m_oGuidsRes
;
...
...
@@ -1934,14 +1945,17 @@ namespace NSGuidesVML
NSBinPptxRW
::
CXmlWriter
m_oTextRect
;
NSBinPptxRW
::
CXmlWriter
m_oCoef
;
public:
CFormulaConverter
()
{
m_lIndexDst
=
0
;
m_lIndexSrc
=
-
1
;
m_lWidth
=
0
;
m_lHeight
=
0
;
m_lX
=
0
;
m_lY
=
0
;
m_lMaxAdjUse
=
-
1
;
}
void
ConvertCoef
(
NSGuidesVML
::
CFormParam
pCoef
)
...
...
@@ -2125,8 +2139,13 @@ namespace NSGuidesVML
if
(
oPath
.
m_arParts
.
size
()
<=
nIndex
)
break
;
const
CPartPath
&
oPart
=
oPath
.
m_arParts
[
nIndex
];
m_lWidth
=
oPart
.
width
;
m_lHeight
=
oPart
.
height
;
m_lX
=
oPart
.
x
;
m_lY
=
oPart
.
y
;
bool
bFill
=
false
;
bool
bStroke
=
false
;
std
::
wstring
strValue
;
...
...
@@ -2690,7 +2709,8 @@ namespace NSGuidesVML
}
else
{
CSlicePath
oSlice
(
eRuler
);
CSlicePath
oSlice
(
eRuler
,
m_lX
,
m_lY
);
m_arSlicesPath
.
push_back
(
oSlice
);
}
}
...
...
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTXShape/PPTXShape.cpp
View file @
a4ee30d0
...
...
@@ -30,8 +30,8 @@
*
*/
#pragma once
//#include "stdafx.h"
#include "P
PTX
Shape.h"
#include "P
ptx
Shape.h"
#include "PresetShapesHeader.h"
CPPTXShape
*
CPPTXShape
::
CreateByType
(
OOXMLShapes
::
ShapeType
type
)
...
...
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTXShape/Formula.cpp
→
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTXShape/
Pptx
Formula.cpp
View file @
a4ee30d0
...
...
@@ -31,7 +31,7 @@
*/
#pragma once
#include "
Formula.h"
#include "
PptxFormula.h"
#ifndef min
#define min(a,b) (((a)<(b))?(a):(b))
...
...
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTXShape/Formula.h
→
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTXShape/
Pptx
Formula.h
View file @
a4ee30d0
...
...
@@ -38,7 +38,7 @@
#include <math.h>
#include "./../Common.h"
#include "../../../../../../DesktopEditor/xml/include/xmlutils.h"
#include "../../../../../../Common/DocxFormat/Source/XML/utils.h"
namespace
NSGuidesOOXML
{
const
double
dNonDefResult
=
27273042316900
;
...
...
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTXShape/pptx2pptshapeconverter.h
View file @
a4ee30d0
...
...
@@ -30,55 +30,13 @@
*
*/
#pragma once
#include "Formula.h"
#include "
Pptx
Formula.h"
#include "../Path.h"
#include "../PPTShape/Formula.h"
#include "../PPT
XShape/PPTX
Shape.h"
#include "../PPT
Shape/PPT
Shape.h"
#include "../PPTShape/
Ppt
Formula.h"
#include "../PPT
Shape/Ppt
Shape.h"
#include "../PPT
XShape/Pptx
Shape.h"
namespace
NSGuidesVML
{
#ifndef ENABLE_PPT_TO_PPTX_CONVERT
class
CSlicePath
{
public:
RulesType
m_eRuler
;
std
::
vector
<
Aggplus
::
POINT
>
m_arPoints
;
std
::
vector
<
SPointType
>
m_arPointsType
;
private:
int
m_nCountElementsPoint
;
public:
CSlicePath
(
RulesType
eType
=
rtMoveTo
)
{
m_eRuler
=
eType
;
m_nCountElementsPoint
=
0
;
}
void
AddParam
(
LONG
lParam
,
ParamType
eParType
)
{
long
lPoint
=
m_nCountElementsPoint
%
2
;
if
(
0
==
lPoint
)
{
Aggplus
::
POINT
point
;
SPointType
pointType
;
point
.
x
=
lParam
;
point
.
y
=
0
;
pointType
.
x
=
eParType
;
pointType
.
y
=
ptValue
;
m_arPoints
.
push_back
(
point
);
m_arPointsType
.
push_back
(
pointType
);
}
else
{
m_arPoints
[
m_arPoints
.
size
()
-
1
].
y
=
lParam
;
m_arPointsType
[
m_arPoints
.
size
()
-
1
].
y
=
eParType
;
}
++
m_nCountElementsPoint
;
}
};
#endif
class
CConverterPPTXPPT
{
...
...
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/Path.h
View file @
a4ee30d0
This diff is collapsed.
Click to expand it.
ASCOfficePPTXFile/Editor/Drawing/Shapes/Shape.h
View file @
a4ee30d0
...
...
@@ -31,15 +31,10 @@
*/
#pragma once
#include "../TextAttributesEx.h"
#include "BaseShape/BaseShape.h"
#i
f defined(PPTX_DEF)
#i
nclude "BaseShape/BaseShape.h"
#include "BaseShape/PPTXShape/PPTXShape.h"
#endif
#if defined(PPT_DEF)
#include "BaseShape/PPTShape/PPTShape.h"
#endif
using
namespace
NSPresentationEditor
;
...
...
@@ -56,6 +51,8 @@ const LONG c_ShapeDrawType_All = c_ShapeDrawType_Graphic | c_ShapeDrawType_Text
class
CShape
{
private:
CBaseShape
*
m_pShape
;
public:
double
m_dStartTime
;
double
m_dEndTime
;
...
...
@@ -70,6 +67,9 @@ public:
double
m_dWidthLogic
;
double
m_dHeightLogic
;
double
m_dXLogic
;
double
m_dYLogic
;
/* в миллиметрах!!! */
double
m_dTextMarginX
;
double
m_dTextMarginY
;
...
...
@@ -78,11 +78,11 @@ public:
LONG
m_lDrawType
;
CBaseShape
*
m_pShape
;
std
::
wstring
m_strPPTXShape
;
public:
CShape
(
NSBaseShape
::
ClassType
ClassType
,
int
ShapeType_
)
:
m_rcBounds
()
NSBaseShape
::
ClassType
m_classType
;
CShape
(
NSBaseShape
::
ClassType
classType
,
int
ShapeType_
)
:
m_rcBounds
()
{
m_lDrawType
=
c_ShapeDrawType_All
;
...
...
@@ -95,6 +95,9 @@ public:
m_dWidthLogic
=
ShapeSize
;
m_dHeightLogic
=
ShapeSize
;
m_dXLogic
=
0
;
m_dYLogic
=
0
;
m_dTextMarginX
=
0
;
m_dTextMarginY
=
0
;
m_dTextMarginRight
=
0
;
...
...
@@ -104,16 +107,14 @@ public:
m_pShape
=
NULL
;
#if defined(PPTX_DEF)
if
(
ClassType
==
NSBaseShape
::
pptx
)
m_classType
=
classType
;
if
(
m_classType
==
NSBaseShape
::
pptx
)
{
m_pShape
=
new
CPPTXShape
();
m_pShape
->
SetType
(
NSBaseShape
::
pptx
,
ShapeType_
);
}
#endif
#if defined(PPT_DEF)
if
(
ClassType
==
NSBaseShape
::
ppt
)
else
if
(
m_classType
==
NSBaseShape
::
ppt
)
{
m_pShape
=
CPPTShape
::
CreateByType
((
PPTShapes
::
ShapeType
)
ShapeType_
);
if
(
m_pShape
==
NULL
)
...
...
@@ -130,8 +131,6 @@ public:
m_dWidthLogic
=
ShapeSizeVML
;
m_dHeightLogic
=
ShapeSizeVML
;
}
#endif
}
~
CShape
()
...
...
@@ -139,34 +138,28 @@ public:
RELEASEOBJECT
(
m_pShape
);
}
virtual
void
ReCalculat
e
()
CBaseShape
*
getBaseShap
e
()
{
m_pShape
->
ReCalculate
()
;
return
m_pShape
;
}
void
setBaseShape
(
CBaseShape
*
pShape
)
{
if
(
pShape
==
NULL
)
return
;
//virtual std::wstring GetTextXml(CGeomShapeInfo& oGeomInfo, CMetricInfo& pInfo, double dStartTime, double dEndTime, CTheme* pTheme, CLayout* pLayout)
//{
// if (m_oText.IsEmptyText())
// return _T("");
// GetTextRect(oGeomInfo);
// return m_oText.ToString(oGeomInfo, pInfo, dStartTime, dEndTime, pTheme, pLayout);
//}
CPPTXShape
*
pptxShape
=
dynamic_cast
<
CPPTXShape
*>
(
pShape
);
CPPTShape
*
pptShape
=
dynamic_cast
<
CPPTShape
*>
(
pShape
);
//virtual std::wstring GetBrushXml()
//{
// if (!m_pShape->m_bConcentricFill)
// return _T("");
// return m_oBrush.ToString();
//}
if
(
pptxShape
)
m_classType
=
NSBaseShape
::
pptx
;
if
(
pptShape
)
m_classType
=
NSBaseShape
::
ppt
;
//virtual std::wstring GetPenXml()
//{
// return m_oPen.ToString();
//}
m_pShape
=
pShape
;
}
virtual
void
ReCalculate
()
{
m_pShape
->
ReCalculate
();
}
virtual
void
GetTextRect
(
CGeomShapeInfo
&
oInfo
)
{
// пока сделаем типо - заглушку
...
...
@@ -175,7 +168,8 @@ public:
bool
bIsFound
=
false
;
#ifdef PPT_DEF
if
(
m_classType
==
NSBaseShape
::
ppt
)
{
// не очень удобно мне пересчет ректов вести
// сделаю так, отдельным методом в ппт
double
dPercentLeft
=
0
;
...
...
@@ -206,10 +200,8 @@ public:
oInfo
.
m_dHeight
-=
(
m_dTextMarginY
+
m_dTextMarginBottom
);
bIsFound
=
true
;
#endif
#ifdef PPTX_DEF
if
(
!
bIsFound
)
}
if
(
m_classType
==
NSBaseShape
::
pptx
)
{
if
(
0
<
m_pShape
->
m_arTextRects
.
size
())
{
...
...
@@ -227,8 +219,6 @@ public:
bIsFound
=
true
;
}
#endif
if
(
oInfo
.
m_dWidth
<
0
)
oInfo
.
m_dWidth
=
1
;
...
...
@@ -249,7 +239,8 @@ public:
bool
bIsFound
=
false
;
#ifdef PPT_DEF
if
(
m_classType
==
NSBaseShape
::
ppt
)
{
// не очень удобно мне пересчет ректов вести
// сделаю так, отдельным методом в ппт
double
dPercentLeft
=
0
;
...
...
@@ -280,11 +271,10 @@ public:
dHeight
-=
(
m_dTextMarginY
+
m_dTextMarginBottom
);
bIsFound
=
true
;
#endif
#ifdef PPTX_DEF
if
(
!
bIsFound
&&
m_pShape
)
}
if
(
m_classType
==
NSBaseShape
::
pptx
&&
m_pShape
)
{
if
(
0
<
m_pShape
->
m_arTextRects
.
size
())
{
double
koef
=
(
std
::
max
)(
dWidth
,
dHeight
)
/
ShapeSize
;
...
...
@@ -301,13 +291,9 @@ public:
bIsFound
=
true
;
}
#endif
if
(
dWidth
<
0
)
dWidth
=
1
;
if
(
dHeight
<
0
)
dHeight
=
1
;
if
(
dWidth
<
0
)
dWidth
=
1
;
if
(
dHeight
<
0
)
dHeight
=
1
;
oInfo
.
left
=
dLeft
;
oInfo
.
top
=
dTop
;
...
...
@@ -315,29 +301,6 @@ public:
oInfo
.
bottom
=
dTop
+
dHeight
;
}
//virtual std::wstring ToXml(CGeomShapeInfo& oGeomInfo, CMetricInfo& pInfo, double dStartTime, double dEndTime, CTheme* pTheme, CLayout* pLayout)
//{
// std::wstring strImageTransform = _T("");
// oGeomInfo.m_dLimoX = m_lLimoX;
// oGeomInfo.m_dLimoY = m_lLimoY;
// m_pShape->m_oPath.SetCoordsize((LONG)m_dWidthLogic, (LONG)m_dHeightLogic);
//
// CBrush brush; //копии с уровня выше нужны
// CPen pen;
// std::wstring strDrawing = m_pShape->ToXML(oGeomInfo, pInfo, dStartTime, dEndTime, brush, pen);
// if (m_lDrawType & c_ShapeDrawType_Graphic)
// {
// strImageTransform += strDrawing;
// }
// if (m_lDrawType & c_ShapeDrawType_Text)
// {
// strImageTransform += GetTextXml(oGeomInfo, pInfo, dStartTime, dEndTime, pTheme, pLayout);
// }
// return strImageTransform;
//}
void
ToRenderer
(
IRenderer
*
pRenderer
,
CGeomShapeInfo
&
oGeomInfo
,
CMetricInfo
&
pInfo
,
double
dStartTime
,
double
dEndTime
)
{
...
...
@@ -373,7 +336,6 @@ public:
virtual
bool
LoadFromXML
(
XmlUtils
::
CXmlNode
&
root
)
{
#if defined(PPTX_DEF)
if
(
_T
(
"ooxml-shape"
)
==
root
.
GetName
())
{
if
(
m_pShape
!=
NULL
)
...
...
@@ -382,10 +344,7 @@ public:
//return m_pShape->LoadFromXML(xml);
return
((
CPPTXShape
*
)
m_pShape
)
->
LoadFromXML
(
root
);
}
#endif
#if defined(PPT_DEF)
if
(
_T
(
"shape"
)
==
root
.
GetName
())
else
if
(
_T
(
"shape"
)
==
root
.
GetName
())
{
if
(
m_pShape
!=
NULL
)
delete
m_pShape
;
...
...
@@ -397,7 +356,6 @@ public:
return
((
CPPTShape
*
)
m_pShape
)
->
LoadFromXML
(
root
);
}
#endif
return
false
;
}
...
...
@@ -468,6 +426,50 @@ public:
}
}
void
SetCoordPos
(
XmlUtils
::
CXmlNode
&
oNodePict
)
{
if
(
_T
(
"shape"
)
==
oNodePict
.
GetName
())
{
XmlUtils
::
CXmlNode
oNodeTemplate
;
if
(
oNodePict
.
GetNode
(
_T
(
"coordorigin"
),
oNodeTemplate
))
{
std
::
wstring
strCoordSize
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"val"
));
if
(
!
strCoordSize
.
empty
())
{
std
::
vector
<
std
::
wstring
>
oArray
;
boost
::
algorithm
::
split
(
oArray
,
strCoordSize
,
boost
::
algorithm
::
is_any_of
(
L","
),
boost
::
algorithm
::
token_compress_on
);
m_dXLogic
=
XmlUtils
::
GetInteger
(
oArray
[
0
]);
m_dYLogic
=
XmlUtils
::
GetInteger
(
oArray
[
1
]);
}
}
else
{
std
::
wstring
id
=
oNodePict
.
GetAttributeOrValue
(
_T
(
"type"
));
if
(
id
!=
_T
(
""
))
{
m_dXLogic
=
0
;
m_dYLogic
=
0
;
}
else
{
XmlUtils
::
CXmlNode
oNodeTemplate
;
if
(
oNodePict
.
GetNode
(
_T
(
"template"
),
oNodeTemplate
))
{
std
::
wstring
strCoordSize
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"coordorigin"
));
if
(
!
strCoordSize
.
empty
())
{
std
::
vector
<
std
::
wstring
>
oArray
;
boost
::
algorithm
::
split
(
oArray
,
strCoordSize
,
boost
::
algorithm
::
is_any_of
(
L","
),
boost
::
algorithm
::
token_compress_on
);
m_dXLogic
=
XmlUtils
::
GetInteger
(
oArray
[
0
]);
m_dYLogic
=
XmlUtils
::
GetInteger
(
oArray
[
1
]);
}
}
}
}
}
}
void
SetCoordSize
(
XmlUtils
::
CXmlNode
&
oNodePict
)
{
if
(
_T
(
"shape"
)
==
oNodePict
.
GetName
())
...
...
ASCOfficePPTXFile/Editor/Drawing/TextAttributesEx.cpp
View file @
a4ee30d0
...
...
@@ -104,19 +104,6 @@ namespace NSPresentationEditor
}
}
void
CTextAttributesEx
::
RecalcParagraphs
(
CTheme
*
pTheme
)
{
#ifdef PPT_DEF
RecalcParagraphsPPT
();
ApplyThemeStyle
(
pTheme
);
#else
size_t
nCount
=
m_arParagraphs
.
size
();
for
(
size_t
i
=
0
;
i
<
nCount
;
++
i
)
{
m_arParagraphs
[
i
].
CheckErrors
();
}
#endif
}
void
CTextAttributesEx
::
ApplyThemeStyle
(
CTheme
*
pTheme
)
{
if
(
NULL
!=
pTheme
)
...
...
ASCOfficePPTXFile/Editor/Drawing/TextAttributesEx.h
View file @
a4ee30d0
...
...
@@ -46,7 +46,6 @@ namespace NSPresentationEditor
{
public:
LONG
m_lTextMasterType
;
// only ppt property
public:
DWORD
m_lTextType
;
int
m_lStyleThemeIndex
;
...
...
@@ -77,7 +76,6 @@ namespace NSPresentationEditor
bool
m_bIsSlideFontRef
;
int
m_lFontRef
;
public:
CTextAttributesEx
()
:
m_oAttributes
(),
m_arParagraphs
(),
...
...
@@ -142,14 +140,11 @@ namespace NSPresentationEditor
m_arParagraphs
.
clear
();
}
public:
inline
void
NormalizeString
(
std
::
wstring
&
strText
)
{
strText
=
XmlUtils
::
EncodeXmlString
(
strText
);
}
void
RecalcParagraphs
(
CTheme
*
pTheme
=
NULL
);
void
RecalcParagraphsPPT
();
void
ApplyThemeStyle
(
CTheme
*
pTheme
=
NULL
);
...
...
ASCOfficePPTXFile/Editor/PresentationDrawingsDef.h
deleted
100644 → 0
View file @
e05194b2
/*
* (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
*
*/
// CASCPresentationEditor.h : Declaration of the CASCOfficeViewer
#pragma once
#ifdef PPT_DEF
#include "./Drawing/Shapes/BaseShape/PPTShape/Formula.cpp"
#include "./Drawing/Shapes/BaseShape/PPTShape/PPTShape.cpp"
#ifndef BASE_SHAPE
#define BASE_SHAPE
#endif
#endif
#ifdef PPTX_DEF
#include "./Drawing/Shapes/BaseShape/PPTXShape/Formula.cpp"
#include "./Drawing/Shapes/BaseShape/PPTXShape/PPTXShape.cpp"
#ifndef BASE_SHAPE
#define BASE_SHAPE
#endif
#include "./Drawing/Shapes/BaseShape/PPTShape/ppt2pptxshapeconverter.h"
#endif
#ifdef BASE_SHAPE
#include "./Drawing/Shapes/BaseShape/BaseShape.cpp"
#endif
ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.cpp
View file @
a4ee30d0
...
...
@@ -53,7 +53,8 @@ namespace PPTX
lpShapeElement
=
new
NSPresentationEditor
::
CShapeElement
(
NSBaseShape
::
pptx
,
(
int
)
_lspt
);
std
::
wstring
strAdjustValues
=
lpGeom
.
GetODString
();
lpShapeElement
->
m_oShape
.
m_pShape
->
LoadAdjustValuesList
(
strAdjustValues
);
lpShapeElement
->
m_oShape
.
getBaseShape
()
->
LoadAdjustValuesList
(
strAdjustValues
);
}
else
if
(
this
->
is
<
PPTX
::
Logic
::
CustGeom
>
())
{
...
...
@@ -70,19 +71,21 @@ namespace PPTX
LONG
lCoordSize
=
100000
;
lpShapeElement
->
m_oShape
.
m_pShape
->
SetWidthHeightLogic
(
dCoordSizeX
,
dCoordSizeY
);
lpShapeElement
->
m_oShape
.
m_pShape
->
ReCalculate
();
lpShapeElement
->
m_oShape
.
getBaseShape
()
->
SetWidthHeightLogic
(
dCoordSizeX
,
dCoordSizeY
);
lpShapeElement
->
m_oShape
.
getBaseShape
()
->
ReCalculate
();
pOOXToVMLRenderer
->
put_Width
((
double
)
lCoordSize
/
dCoordSizeX
);
pOOXToVMLRenderer
->
put_Height
((
double
)
lCoordSize
/
dCoordSizeY
);
CGeomShapeInfo
oInfo
;
oInfo
.
m_dLeft
=
0
;
oInfo
.
m_dTop
=
0
;
oInfo
.
m_dWidth
=
dCoordSizeX
;
oInfo
.
m_dHeight
=
dCoordSizeY
;
NSPresentationEditor
::
CPath
&
oPath
=
lpShapeElement
->
m_oShape
.
m_pShape
->
m_oPath
;
NSPresentationEditor
::
CPath
&
oPath
=
lpShapeElement
->
m_oShape
.
getBaseShape
()
->
m_oPath
;
COOXToVMLGeometry
*
pOOXToVMLGeometry
=
dynamic_cast
<
COOXToVMLGeometry
*>
(
pOOXToVMLRenderer
);
...
...
@@ -108,19 +111,19 @@ namespace PPTX
if
(
NULL
!=
pOOXToVMLGeometry
)
pOOXToVMLGeometry
->
ResultPath
(
&
strPath
);
if
(
lpShapeElement
->
m_oShape
.
m_pShape
->
m_arTextRects
.
size
()
<=
0
)
if
(
lpShapeElement
->
m_oShape
.
getBaseShape
()
->
m_arTextRects
.
size
()
<=
0
)
{
strRect
=
_T
(
"0,0,100000,100000"
);
}
else
{
Aggplus
::
RECT
&
txRect
=
lpShapeElement
->
m_oShape
.
m_pShape
->
m_arTextRects
[
0
];
Aggplus
::
RECT
&
txRect
=
lpShapeElement
->
m_oShape
.
getBaseShape
()
->
m_arTextRects
[
0
];
//double dkoefX = (double)lCoordSize / max(1, dCoordSizeX);
//double dkoefY = (double)lCoordSize / max(1, dCoordSizeY);
double
_dWidth
=
ShapeSize
;
double
_dHeight
=
ShapeSize
;
lpShapeElement
->
m_oShape
.
m_pShape
->
GetWidthHeightLogic
(
_dWidth
,
_dHeight
);
lpShapeElement
->
m_oShape
.
getBaseShape
()
->
GetWidthHeightLogic
(
_dWidth
,
_dHeight
);
double
dkoefX
=
(
double
)
lCoordSize
/
(
std
::
max
)(
1.
,
_dWidth
);
double
dkoefY
=
(
double
)
lCoordSize
/
(
std
::
max
)(
1.
,
_dHeight
);
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Path.h
View file @
a4ee30d0
...
...
@@ -30,8 +30,6 @@
*
*/
#pragma once
#ifndef PPTX_LOGIC_PATH_INCLUDE_H_
#define PPTX_LOGIC_PATH_INCLUDE_H_
#include "./../WrapperWritingElement.h"
#include "Rect.h"
...
...
@@ -177,5 +175,3 @@ namespace PPTX
};
}
// namespace Logic
}
// namespace PPTX
#endif // PPTX_LOGIC_PATH_INCLUDE_H_
\ No newline at end of file
ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro
View file @
a4ee30d0
...
...
@@ -49,8 +49,6 @@ INCLUDEPATH += \
..
/../../../
Common
/
ASCDocxFormat
/
Source
\
..
/../../../
DesktopEditor
/
xml
/
libxml2
/
include
SOURCES
+=
pptxformatlib
.
cpp
core_release
{
SOURCES
+=
\
pptxformatlib_logic
.
cpp
...
...
@@ -95,7 +93,12 @@ SOURCES += \
..
/../../
PPTXFormat
/
Folder
.
cpp
}
SOURCES
+=
\
SOURCES
+=
pptxformatlib
.
cpp
\
..
/../../
Editor
/
Drawing
/
Shapes
/
BaseShape
/
BaseShape
.
cpp
\
..
/../../
Editor
/
Drawing
/
Shapes
/
BaseShape
/
PPTShape
/
PptFormula
.
cpp
\
..
/../../
Editor
/
Drawing
/
Shapes
/
BaseShape
/
PPTShape
/
PptShape
.
cpp
\
..
/../../
Editor
/
Drawing
/
Shapes
/
BaseShape
/
PPTXShape
/
PptxFormula
.
cpp
\
..
/../../
Editor
/
Drawing
/
Shapes
/
BaseShape
/
PPTXShape
/
PptxShape
.
cpp
\
..
/../../
ASCOfficeDrawingConverter
.
cpp
\
..
/../../
ASCOfficePPTXFileRealization
.
cpp
\
..
/../../
Editor
/
BinaryFileReaderWriter
.
cpp
\
...
...
@@ -488,7 +491,6 @@ HEADERS += pptxformatlib.h \
..
/../../
Editor
/
imagemanager
.
h
\
..
/../../
Editor
/
PPTXWriter
.
h
\
..
/../../
Editor
/
WMFToImageConverter
.
h
\
..
/../../
Editor
/
PresentationDrawingsDef
.
h
\
..
/../../
Editor
/
DefaultNotesMaster
.
h
\
..
/../../
Editor
/
DefaultNotesTheme
.
h
\
..
/../../../
Common
/
DocxFormat
/
Source
/
Base
/
Nullable
.
h
\
...
...
ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj
View file @
a4ee30d0
...
...
@@ -45,7 +45,7 @@
Name=
"VCCLCompilerTool"
Optimization=
"0"
AdditionalIncludeDirectories=
""../../DesktopEditor/freetype-2.5.2/include";../../DesktopEditor/xml/build/vs2005"
PreprocessorDefinitions=
"WIN32;_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;
PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions=
"WIN32;_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild=
"true"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"3"
...
...
@@ -696,15 +696,59 @@
Name=
"Core"
>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\
baseshape.h
"
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\
BaseShape.cpp
"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\
PPTShape\ppts
hape.h"
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\
BaseS
hape.h"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PPTXShape.h"
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTShape\Ppt2PptxShapeConverter.h"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTShape\PptFormula.cpp"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTShape\PptFormula.h"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTShape\PptShape.cpp"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTShape\PptShape.h"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTShape\PptShapeEnum.h"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTXShape\Pptx2PptShapeConverter.h"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PptxFormula.cpp"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PptxFormula.h"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PptxShape.cpp"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PptxShape.h"
>
</File>
<File
RelativePath=
"..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PresetShapesHeader.h"
>
</File>
<File
...
...
X2tConverter/test/win32Test/X2tTest.vcproj
View file @
a4ee30d0
...
...
@@ -44,7 +44,7 @@
Name=
"VCCLCompilerTool"
Optimization=
"0"
AdditionalIncludeDirectories=
""../../../DesktopEditor/agg-2.4/include";../../../DesktopEditor/xml/build/vs2005;../../../DesktopEditor/xml/libxml2/include"
PreprocessorDefinitions=
"WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;
PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions=
"WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild=
"true"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"3"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment