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
2e8c83a6
Commit
2e8c83a6
authored
Mar 29, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormat, TxtFormat - chage convert from ooxml drawing
parent
e8574965
Changes
23
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
827 additions
and
979 deletions
+827
-979
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.cpp
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.cpp
+4
-1
ASCOfficeRtfFile/RtfFormatLib/Win32/RtfFormatLib.vcproj
ASCOfficeRtfFile/RtfFormatLib/Win32/RtfFormatLib.vcproj
+0
-4
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXColorReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXColorReader.h
+38
-42
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXColorSchemeReader.h
...RtfFile/RtfFormatLib/source/Reader/OOXColorSchemeReader.h
+15
-15
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
...le/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
+24
-100
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.h
...File/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.h
+6
-15
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXFontReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXFontReader.h
+29
-28
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXFontSchemeReader.h
...eRtfFile/RtfFormatLib/source/Reader/OOXFontSchemeReader.h
+12
-31
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
...RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
+337
-351
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphReader.h
...ceRtfFile/RtfFormatLib/source/Reader/OOXParagraphReader.h
+3
-2
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXPictureAnchorReader.h
...fFile/RtfFormatLib/source/Reader/OOXPictureAnchorReader.h
+2
-7
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXPictureInlineReader.h
...fFile/RtfFormatLib/source/Reader/OOXPictureInlineReader.h
+3
-7
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXReader.cpp
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXReader.cpp
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXRunReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXRunReader.h
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.cpp
...ficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.cpp
+275
-302
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.h
+14
-18
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTextItemReader.h
...iceRtfFile/RtfFormatLib/source/Reader/OOXTextItemReader.h
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXThemeReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXThemeReader.h
+4
-4
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXpPrReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXpPrReader.h
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXrPrReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXrPrReader.h
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXWriter.cpp
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXWriter.cpp
+1
-1
ASCOfficeTxtFile/TxtXmlFormatLib/Source/TxtFormat/TxtFile.cpp
...fficeTxtFile/TxtXmlFormatLib/Source/TxtFormat/TxtFile.cpp
+37
-31
ASCOfficeTxtFile/TxtXmlFormatLib/Source/TxtXmlFile.cpp
ASCOfficeTxtFile/TxtXmlFormatLib/Source/TxtXmlFile.cpp
+15
-12
No files found.
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.cpp
View file @
2e8c83a6
...
...
@@ -196,6 +196,8 @@ void NSPresentationEditor::CPPTXWriter::WriteContentTypes()
<Default Extension=
\"
xml
\"
ContentType=
\"
application/xml
\"
/>\
<Default Extension=
\"
gif
\"
ContentType=
\"
image/gif
\"
/>\
<Default Extension=
\"
emf
\"
ContentType=
\"
image/x-emf
\"
/>\
<Default Extension=
\"
xls
\"
ContentType=
\"
application/vnd.ms-excel
\"
/>\
<Default Extension=
\"
xlsx
\"
ContentType=
\"
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
\"
/>\
<Default Extension=
\"
bin
\"
ContentType=
\"
application/vnd.openxmlformats-officedocument.oleObject
\"
/>\
<Default Extension=
\"
jpg
\"
ContentType=
\"
application/octet-stream
\"
/>"
);
...
...
@@ -767,6 +769,7 @@ void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRe
void
NSPresentationEditor
::
CPPTXWriter
::
WriteLayout
(
CLayout
&
oLayout
,
int
nIndexLayout
,
int
nStartLayout
,
int
nIndexTheme
)
{
CStringWriter
oWriter
;
CRelsGenerator
oRels
(
&
m_oManager
);
oRels
.
StartLayout
(
nIndexTheme
);
...
...
ASCOfficeRtfFile/RtfFormatLib/Win32/RtfFormatLib.vcproj
View file @
2e8c83a6
...
...
@@ -388,10 +388,6 @@
RelativePath=
"..\source\Reader\OOXPictureAnchorReader.h"
>
</File>
<File
RelativePath=
"..\source\Reader\OOXPictureGraphicReader.h"
>
</File>
<File
RelativePath=
"..\source\Reader\OOXPictureInlineReader.h"
>
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXColorReader.h
View file @
2e8c83a6
...
...
@@ -34,56 +34,52 @@
#include "OOXReader.h"
#include "OOXReaderBasic.h"
#include "../../../../
Common/DocxFormat/Source/DocxFormat/Drawing/DrawingStyles
.h"
#include "../../../../
ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr
.h"
class
OOXColorReader
{
private:
PPTX
::
nsTheme
::
ClrScheme
*
m_ooxColorScheme
;
public:
OOXColorReader
()
{
m_ooxColorScheme
=
NULL
;
}
bool
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
CStyleColor
&
ooxColor
,
RtfColor
&
oOutputColor
)
OOXColorReader
(
PPTX
::
nsTheme
::
ClrScheme
*
ooxColorScheme
)
{
if
(
ooxColor
.
getType
()
==
OOX
::
Drawing
::
colorHsl
)
{
double
dHue
,
dSat
,
dLum
;
ooxColor
.
m_oHslClr
.
GetHSL
(
dHue
,
dSat
,
dLum
);
oOutputColor
.
SetHSL
(
dHue
,
dSat
,
dLum
);
return
true
;
m_ooxColorScheme
=
ooxColorScheme
;
}
else
if
(
ooxColor
.
getType
()
==
OOX
::
Drawing
::
colorPrst
)
bool
Parse
(
ReaderParameter
oParam
,
const
std
::
wstring
&
name
,
RtfColor
&
oOutputColor
)
{
oOutputColor
=
RtfColor
(
ooxColor
.
m_oPrstClr
.
m_oVal
.
Get_R
(),
ooxColor
.
m_oPrstClr
.
m_oVal
.
Get_G
(),
ooxColor
.
m_oPrstClr
.
m_oVal
.
Get_B
());
return
true
;
}
else
if
(
ooxColor
.
getType
()
==
OOX
::
Drawing
::
colorSheme
)
if
(
!
m_ooxColorScheme
)
return
false
;
std
::
map
<
std
::
wstring
,
PPTX
::
Logic
::
UniColor
>::
iterator
pFind
=
m_ooxColorScheme
->
Scheme
.
find
(
name
);
if
(
pFind
==
m_ooxColorScheme
->
Scheme
.
end
())
return
false
;
PPTX
::
Logic
::
UniColor
&
color
=
pFind
->
second
;
switch
(
color
.
getType
())
{
RtfColor
::
_ThemeColor
oTheme
;
if
(
true
==
RtfColor
::
GetThemeByOOX
(
ooxColor
.
m_oShemeClr
.
m_oVal
.
GetValue
(),
oTheme
))
return
oParam
.
oRtf
->
m_oColorTable
.
GetColor
(
oTheme
,
oOutputColor
);
return
false
;
}
else
if
(
ooxColor
.
getType
()
==
OOX
::
Drawing
::
colorSRgb
)
case
OOX
:
:
et_a_schemeClr
:
{
oOutputColor
=
RtfColor
(
ooxColor
.
m_oSrgbClr
.
m_oVal
.
Get_R
(),
ooxColor
.
m_oSrgbClr
.
m_oVal
.
Get_G
(),
ooxColor
.
m_oSrgbClr
.
m_oVal
.
Get_B
());
return
true
;
}
else
if
(
ooxColor
.
getType
()
==
OOX
::
Drawing
::
colorScRgb
)
NSCommon
::
smart_ptr
<
PPTX
::
Logic
::
SchemeClr
>
schemeColor
=
color
.
Color
.
smart_dynamic_cast
<
PPTX
::
Logic
::
SchemeClr
>
();
if
(
schemeColor
.
IsInit
())
{
unsigned
char
r
,
g
,
b
,
a
;
ooxColor
.
m_oScrgbClr
.
GetRGBA
(
r
,
g
,
b
,
a
);
oOutputColor
=
RtfColor
(
r
,
g
,
b
);
return
true
;
RtfColor
::
_ThemeColor
oTheme
;
if
(
true
==
RtfColor
::
GetThemeByOOX
(
(
SimpleTypes
::
EShemeColorVal
)
schemeColor
->
val
.
GetBYTECode
(),
oTheme
))
return
oParam
.
oRtf
->
m_oColorTable
.
GetColor
(
oTheme
,
oOutputColor
);
}
else
if
(
ooxColor
.
getType
()
==
OOX
::
Drawing
::
colorSys
)
}
break
;
case
OOX
:
:
et_a_prstClr
:
case
OOX
:
:
et_a_scrgbClr
:
case
OOX
:
:
et_a_srgbClr
:
case
OOX
:
:
et_a_sysClr
:
default:
{
//if (ooxColor.m_oSysClr.m_oLastClr)
//{
//}
unsigned
char
r
,
g
,
b
,
a
;
ooxColor
.
m_oSysClr
.
GetRGBA
(
r
,
g
,
b
,
a
);
oOutputColor
=
RtfColor
(
r
,
g
,
b
);
DWORD
rgba
=
color
.
GetRGBA
();
oOutputColor
.
SetRGB
(
rgba
>>
8
);
return
true
;
}
break
;
}
return
false
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXColorSchemeReader.h
View file @
2e8c83a6
...
...
@@ -36,9 +36,9 @@
class
OOXColorSchemeReader
{
private:
OOX
::
Drawing
::
CColo
rScheme
*
m_ooxColorScheme
;
PPTX
::
nsTheme
::
Cl
rScheme
*
m_ooxColorScheme
;
public:
OOXColorSchemeReader
(
OOX
::
Drawing
::
CColo
rScheme
*
ooxColorScheme
)
OOXColorSchemeReader
(
PPTX
::
nsTheme
::
Cl
rScheme
*
ooxColorScheme
)
{
m_ooxColorScheme
=
ooxColorScheme
;
}
...
...
@@ -48,53 +48,53 @@ public:
if
(
m_ooxColorScheme
==
NULL
)
return
false
;
RtfColor
oNewColor
;
OOXColorReader
oColorReader
;
OOXColorReader
oColorReader
(
m_ooxColorScheme
)
;
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oAccent1
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"accent1"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
caccentone
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oAccent2
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"accent2"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
caccenttwo
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oAccent3
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"accent3"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
caccentthree
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oAccent4
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"accent4"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
caccentfour
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oAccent5
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"accent5"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
caccentfive
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oAccent6
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"accent6"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
caccentsix
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oDk1
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"dk1"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
cmaindarkone
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oDk2
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"dk2"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
cmaindarktwo
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oLt1
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"lt1"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
cmainlightone
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oLt2
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"lt2"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
cmainlighttwo
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oHlink
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"hlink"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
chyperlink
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
oColorReader
.
Parse
(
oParam
,
m_ooxColorScheme
->
m_oFolHlink
,
oNewColor
);
oColorReader
.
Parse
(
oParam
,
L"folHlink"
,
oNewColor
);
oNewColor
.
m_eTheme
=
RtfColor
::
cfollowedhyperlink
;
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oNewColor
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
View file @
2e8c83a6
...
...
@@ -30,7 +30,6 @@
*
*/
#include "OOXPictureGraphicReader.h"
#include "OOXDrawingGraphicReader.h"
#include "OOXShapeReader.h"
...
...
@@ -41,114 +40,39 @@ int OOXGraphicReader::Parse( ReaderParameter oParam , RtfShapePtr & pOutput)
{
if
(
m_ooxGraphic
==
NULL
)
return
0
;
bool
bTryPicture
=
false
;
switch
(
m_ooxGraphic
->
m_eGraphicType
)
if
(
m_ooxGraphic
->
element
.
IsInit
())
{
case
OOX
:
:
Drawing
::
graphictypeShape
:
if
(
m_ooxGraphic
->
element
->
getType
()
==
OOX
::
et_p_ShapeTree
)
{
for
(
size_t
i
=
0
;
i
<
m_ooxGraphic
->
m_arrItems
.
size
();
i
++
)
{
if
(
m_ooxGraphic
->
m_arrItems
[
i
]
==
NULL
)
continue
;
if
(
m_ooxGraphic
->
m_arrItems
[
i
]
->
getType
()
==
OOX
::
et_w_Shape
)
{
OOXShapeReader
shapeReader
(
dynamic_cast
<
OOX
::
Logic
::
CShape
*>
(
m_ooxGraphic
->
m_arrItems
[
i
]));
OOXShapeReader
shapeReader
(
m_ooxGraphic
->
element
->
GetElem
().
operator
->
());
return
(
shapeReader
.
Parse
(
oParam
,
pOutput
)
?
1
:
0
);
}
}
}
break
;
case
OOX
:
:
Drawing
::
graphictypeGroupShape
:
{
for
(
size_t
i
=
0
;
i
<
m_ooxGraphic
->
m_arrItems
.
size
();
i
++
)
else
{
if
(
m_ooxGraphic
->
m_arrItems
[
i
]
==
NULL
)
continue
;
if
(
m_ooxGraphic
->
m_arrItems
[
i
]
->
getType
()
==
OOX
::
et_w_GroupShape
)
{
OOXShapeGroupReader
groupReader
(
dynamic_cast
<
OOX
::
Logic
::
CGroupShape
*>
(
m_ooxGraphic
->
m_arrItems
[
i
]));
OOXShapeGroupReader
groupReader
(
dynamic_cast
<
PPTX
::
Logic
::
SpTree
*>
(
m_ooxGraphic
->
element
->
GetElem
().
operator
->
()));
return
(
groupReader
.
Parse
(
oParam
,
pOutput
)
?
1
:
0
);
}
}
}
break
;
case
OOX
:
:
Drawing
::
graphictypePicture
:
case
OOX
:
:
Drawing
::
graphictypeLockedCanvas
:
case
OOX
:
:
Drawing
::
graphictypeChart
:
case
OOX
:
:
Drawing
::
graphictypeDiagram
:
{
//find picture or replacement picture
for
(
size_t
i
=
0
;
i
<
m_ooxGraphic
->
m_arrItems
.
size
();
i
++
)
{
if
(
m_ooxGraphic
->
m_arrItems
[
i
]
==
NULL
)
continue
;
if
(
m_ooxGraphic
->
m_arrItems
[
i
]
->
getType
()
==
OOX
::
et_pic_pic
)
if
(
m_ooxGraphic
->
olePic
.
IsInit
())
{
pOutput
->
m_nShapeType
=
75
;
OOX
::
Drawing
::
CPicture
*
picture
=
dynamic_cast
<
OOX
::
Drawing
::
CPicture
*>
(
m_ooxGraphic
->
m_arrItems
[
i
]);
OOXShapeReader
::
Parse
(
oParam
,
pOutput
,
&
picture
->
m_oBlipFill
);
// тут если false приходит - картинка-потеряшка
OOXShapeReader
::
Parse
(
oParam
,
pOutput
,
&
m_ooxGraphic
->
olePic
->
blipFill
);
// тут если false приходит - картинка-потеряшка
return
1
;
}
}
}
break
;
}
return
2
;
}
//OOX::Logic::CPicture*
OOX
::
Logic
::
CDrawing
*
OOXDrawingGraphicConverter
::
Convert
(
ReaderParameter
oParam
,
RtfShapePtr
pOutput
)
{
NSBinPptxRW
::
CDrawingConverter
drawingConverter
;
OOX
::
CTheme
*
pTheme
=
oParam
.
oDocx
->
GetTheme
();
if
(
pTheme
)
{
NSCommon
::
smart_ptr
<
PPTX
::
Theme
>
theme
(
new
PPTX
::
Theme
());
PPTX
::
FileMap
map
;
theme
->
read
(
pTheme
->
m_oReadPath
,
map
);
(
*
drawingConverter
.
m_pTheme
)
=
theme
.
smart_dynamic_cast
<
PPTX
::
WrapperFile
>
();
}
drawingConverter
.
SetRelsPath
(
oParam
.
oDocx
->
m_pDocument
->
m_oReadPath
.
GetPath
());
std
::
wstring
sXml
;
sXml
=
drawingConverter
.
ObjectToDrawingML
(
m_sXml
,
XMLWRITER_DOC_TYPE_DOCX
);
// sXml = drawingConverter.ObjectToVML(m_sXml);
if
(
sXml
.
empty
())
return
NULL
;
OOX
::
CPath
pathDrawingRels
(
drawingConverter
.
m_strCurrentRelsPath
);
if
(
m_ooxGraphicRels
)
{
m_ooxGraphicRels
->
Read
(
pathDrawingRels
,
pathDrawingRels
);
}
std
::
wstring
sBegin
(
L"<main xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas
\"
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:p=
\"
urn:schemas-microsoft-com:office:powerpoint
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:x=
\"
urn:schemas-microsoft-com:office:excel
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:ve=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:wp14=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing
\"
xmlns:w14=
\"
http://schemas.microsoft.com/office/word/2010/wordml
\"
xmlns:w15=
\"
http://schemas.microsoft.com/office/word/2012/wordml
\"
xmlns:wpg=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingGroup
\"
xmlns:wpi=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingInk
\"
xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
xmlns:wps=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingShape
\"
xmlns:a=
\"
http://schemas.openxmlformats.org/drawingml/2006/main
\"
xmlns:a14=
\"
http://schemas.microsoft.com/office/drawing/2010/main
\"
xmlns:pic=
\"
http://schemas.openxmlformats.org/drawingml/2006/picture
\"
xmlns:xdr=
\"
http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing
\"
>"
);
std
::
wstring
sEnd
(
L"</main>"
);
std
::
wstring
strXml
=
sBegin
+
sXml
+
sEnd
;
XmlUtils
::
CXmlLiteReader
oSubReader
;
if
(
oSubReader
.
FromString
(
strXml
)
==
false
)
return
NULL
;
oSubReader
.
ReadNextNode
();
int
nStylesDepth1
=
oSubReader
.
GetDepth
();
while
(
oSubReader
.
ReadNextSiblingNode
(
nStylesDepth1
)
)
if
(
m_ooxGraphic
->
smartArt
.
IsInit
())
{
std
::
wstring
sName
=
oSubReader
.
GetName
();
//if (sName == L"w:pict")
//{
// return new OOX::Logic::CPicture(oSubReader);
//}
if
(
sName
==
L"w:drawing"
)
m_ooxGraphic
->
smartArt
->
LoadDrawing
();
if
(
m_ooxGraphic
->
smartArt
->
m_diag
.
IsInit
())
{
return
new
OOX
::
Logic
::
CDrawing
(
oSubReader
);
OOXShapeGroupReader
groupReader
(
dynamic_cast
<
PPTX
::
Logic
::
SpTree
*>
(
m_ooxGraphic
->
smartArt
->
m_diag
.
GetPointer
()));
return
(
groupReader
.
Parse
(
oParam
,
pOutput
)
?
1
:
0
);
}
}
return
NULL
;
//return pPict;
//nullable_string spid;
//nullable<Table> table;
//nullable<ChartRec> chartRec;
return
0
;
}
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.h
View file @
2e8c83a6
...
...
@@ -40,25 +40,16 @@
#define PICTURE_BUFFER_SIZE 1024
class
OOX
DrawingGraphicConvert
er
class
OOX
GraphicRead
er
{
private:
std
::
wstring
m_sXml
;
PPTX
::
Logic
::
GraphicFrame
*
m_ooxGraphic
;
public:
OOX
::
IFileContainer
*
m_ooxGraphicRels
;
OOXDrawingGraphicConverter
(
std
::
wstring
sXml
)
{
m_sXml
=
sXml
;
m_ooxGraphicRels
=
new
OOX
::
IFileContainer
();
}
virtual
~
OOXDrawingGraphicConverter
()
OOXGraphicReader
(
PPTX
::
Logic
::
GraphicFrame
*
ooxGraphic
)
{
if
(
m_ooxGraphicRels
)
delete
m_ooxGraphicRels
;
m_ooxGraphicRels
=
NULL
;
m_ooxGraphic
=
ooxGraphic
;
}
//OOX::Logic::CPicture* Parse( ReaderParameter oParam , RtfShapePtr pOutput);
OOX
::
Logic
::
CDrawing
*
Convert
(
ReaderParameter
oParam
,
RtfShapePtr
pOutput
);
int
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
);
};
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXFontReader.h
View file @
2e8c83a6
...
...
@@ -175,12 +175,12 @@ private:
class
OOXFontReader3
{
private:
OOX
::
Drawing
::
C
TextFont
*
m_asciiFont
;
OOX
::
Drawing
::
C
TextFont
*
m_csFont
;
OOX
::
Drawing
::
C
TextFont
*
m_asianFont
;
PPTX
::
Logic
::
TextFont
*
m_asciiFont
;
PPTX
::
Logic
::
TextFont
*
m_csFont
;
PPTX
::
Logic
::
TextFont
*
m_asianFont
;
public:
OOXFontReader3
(
OOX
::
Drawing
::
CTextFont
*
asciiFont
,
OOX
::
Drawing
::
CTextFont
*
asianFont
,
OOX
::
Drawing
::
C
TextFont
*
csFont
)
OOXFontReader3
(
PPTX
::
Logic
::
TextFont
*
asciiFont
,
PPTX
::
Logic
::
TextFont
*
asianFont
,
PPTX
::
Logic
::
TextFont
*
csFont
)
{
m_asciiFont
=
asciiFont
;
m_asianFont
=
asianFont
;
...
...
@@ -192,9 +192,9 @@ public:
std
::
wstring
sAscii
,
sCs
,
sEastAsia
;
if
(
(
m_asciiFont
)
&&
(
m_asciiFont
->
m_oTypeFace
.
IsInit
()))
sAscii
=
m_asciiFont
->
m_oTypeFace
->
GetValue
()
;
if
(
(
m_csFont
)
&&
(
m_csFont
->
m_oTypeFace
.
IsInit
()))
sCs
=
m_csFont
->
m_oTypeFace
->
GetValue
()
;
if
(
(
m_asianFont
)
&&
(
m_asianFont
->
m_oTypeFace
.
IsInit
()))
sEastAsia
=
m_asianFont
->
m_oTypeFace
->
GetValue
()
;
if
(
m_asciiFont
)
sAscii
=
m_asciiFont
->
typeface
;
if
(
m_csFont
)
sCs
=
m_csFont
->
typeface
;
if
(
m_asianFont
)
sEastAsia
=
m_asianFont
->
typeface
;
std
::
wstring
sFont
;
std
::
wstring
sTempFont
;
...
...
@@ -215,27 +215,28 @@ public:
oCurFont
.
m_nID
=
nFont
;
oCurFont
.
m_sName
=
sFont
;
if
(
!
sAscii
.
empty
()
)
{
if
(
m_asciiFont
->
m_oPanose
.
IsInit
())
oCurFont
.
m_sPanose
=
m_asciiFont
->
m_oPanose
->
GetValue
();
oCurFont
.
m_nCharset
=
m_asciiFont
->
m_oCharset
.
GetValue
();
oCurFont
.
m_nPitch
=
m_asciiFont
->
m_oPitchFamily
.
GetValue
();
}
else
if
(
!
sCs
.
empty
()
)
{
if
(
m_csFont
->
m_oPanose
.
IsInit
())
oCurFont
.
m_sPanose
=
m_csFont
->
m_oPanose
->
GetValue
();
oCurFont
.
m_nCharset
=
m_csFont
->
m_oCharset
.
GetValue
();
oCurFont
.
m_nPitch
=
m_csFont
->
m_oPitchFamily
.
GetValue
();
}
else
if
(
!
sEastAsia
.
empty
()
)
{
if
(
m_asianFont
->
m_oPanose
.
IsInit
())
oCurFont
.
m_sPanose
=
m_asianFont
->
m_oPanose
->
GetValue
();
oCurFont
.
m_nCharset
=
m_asianFont
->
m_oCharset
.
GetValue
();
oCurFont
.
m_nPitch
=
m_asianFont
->
m_oPitchFamily
.
GetValue
();
}
//if( !sAscii.empty() )
//{
// if (m_asciiFont->m_oPanose.IsInit())
// oCurFont.m_sPanose = m_asciiFont->m_oPanose->GetValue();
// if (m_asciiFont->charset.IsInit())
// oCurFont.m_nCharset = m_asciiFont->charset.get();
// oCurFont.m_nPitch = m_asciiFont->m_oPitchFamily.GetValue();
//}
//else if( !sCs.empty() )
//{
// if (m_csFont->m_oPanose.IsInit())
// oCurFont.m_sPanose = m_csFont->m_oPanose->GetValue();
// oCurFont.m_nCharset = m_csFont->m_oCharset.GetValue();
// oCurFont.m_nPitch = m_csFont->m_oPitchFamily.GetValue();
//}
//else if( !sEastAsia.empty() )
//{
// if (m_asianFont->m_oPanose.IsInit())
// oCurFont.m_sPanose = m_asianFont->m_oPanose->GetValue();
// oCurFont.m_nCharset = m_asianFont->m_oCharset.GetValue();
// oCurFont.m_nPitch = m_asianFont->m_oPitchFamily.GetValue();
//}
oParam
.
oRtf
->
m_oFontTable
.
AddItem
(
oCurFont
);
}
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXFontSchemeReader.h
View file @
2e8c83a6
...
...
@@ -37,9 +37,9 @@
class
OOXFontSchemeReader
{
private:
OOX
::
Drawing
::
C
FontScheme
*
m_ooxFontScheme
;
PPTX
::
nsTheme
::
FontScheme
*
m_ooxFontScheme
;
public:
OOXFontSchemeReader
(
OOX
::
Drawing
::
C
FontScheme
*
ooxFontScheme
)
OOXFontSchemeReader
(
PPTX
::
nsTheme
::
FontScheme
*
ooxFontScheme
)
{
m_ooxFontScheme
=
ooxFontScheme
;
}
...
...
@@ -47,36 +47,17 @@ public:
{
if
(
m_ooxFontScheme
==
NULL
)
return
false
;
if
(
m_ooxFontScheme
->
m_oMajorFont
.
m_oLatin
.
m_oTypeFace
.
IsInit
())
{
oParam
.
oReader
->
m_smajorAscii
=
m_ooxFontScheme
->
m_oMajorFont
.
m_oLatin
.
m_oTypeFace
->
GetValue
();
oParam
.
oReader
->
m_smajorHAnsi
=
m_ooxFontScheme
->
m_oMajorFont
.
m_oLatin
.
m_oTypeFace
->
GetValue
();
}
if
(
m_ooxFontScheme
->
m_oMajorFont
.
m_oEa
.
m_oTypeFace
.
IsInit
())
{
oParam
.
oReader
->
m_smajorEastAsia
=
m_ooxFontScheme
->
m_oMajorFont
.
m_oEa
.
m_oTypeFace
->
GetValue
();
}
if
(
m_ooxFontScheme
->
m_oMajorFont
.
m_oCs
.
m_oTypeFace
.
IsInit
())
{
oParam
.
oReader
->
m_smajorBidi
=
m_ooxFontScheme
->
m_oMajorFont
.
m_oCs
.
m_oTypeFace
->
GetValue
();
}
//for (long i=0 ; i < m_ooxFontScheme->m_oMajorFont.m_arrFont.size(); i++)
//{
//}
oParam
.
oReader
->
m_smajorAscii
=
m_ooxFontScheme
->
majorFont
.
latin
.
typeface
;
oParam
.
oReader
->
m_smajorHAnsi
=
m_ooxFontScheme
->
majorFont
.
latin
.
typeface
;
if
(
m_ooxFontScheme
->
m_oMinorFont
.
m_oLatin
.
m_oTypeFace
.
IsInit
())
{
oParam
.
oReader
->
m_sminorAscii
=
m_ooxFontScheme
->
m_oMinorFont
.
m_oLatin
.
m_oTypeFace
->
GetValue
();
oParam
.
oReader
->
m_sminorHAnsi
=
m_ooxFontScheme
->
m_oMinorFont
.
m_oLatin
.
m_oTypeFace
->
GetValue
();
}
if
(
m_ooxFontScheme
->
m_oMinorFont
.
m_oEa
.
m_oTypeFace
.
IsInit
())
{
oParam
.
oReader
->
m_sminorEastAsia
=
m_ooxFontScheme
->
m_oMinorFont
.
m_oEa
.
m_oTypeFace
->
GetValue
();
}
if
(
m_ooxFontScheme
->
m_oMinorFont
.
m_oCs
.
m_oTypeFace
.
IsInit
())
{
oParam
.
oReader
->
m_sminorBidi
=
m_ooxFontScheme
->
m_oMinorFont
.
m_oCs
.
m_oTypeFace
->
GetValue
();
}
oParam
.
oReader
->
m_smajorEastAsia
=
m_ooxFontScheme
->
majorFont
.
ea
.
typeface
;
oParam
.
oReader
->
m_smajorBidi
=
m_ooxFontScheme
->
majorFont
.
cs
.
typeface
;
oParam
.
oReader
->
m_sminorAscii
=
m_ooxFontScheme
->
minorFont
.
latin
.
typeface
;
oParam
.
oReader
->
m_sminorHAnsi
=
m_ooxFontScheme
->
minorFont
.
latin
.
typeface
;
oParam
.
oReader
->
m_sminorEastAsia
=
m_ooxFontScheme
->
minorFont
.
ea
.
typeface
;
oParam
.
oReader
->
m_sminorBidi
=
m_ooxFontScheme
->
minorFont
.
cs
.
typeface
;
//for (long i=0 ; i < m_ooxFontScheme->m_oMinorFont.m_arrFont.size(); i++)
//{
//}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
View file @
2e8c83a6
This diff is collapsed.
Click to expand it.
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphReader.h
View file @
2e8c83a6
...
...
@@ -40,7 +40,7 @@
class
OOXParagraphReader
{
private:
OOX
::
Drawing
::
CParagraph
*
m_drawingParagraph
;
PPTX
::
Logic
::
Paragraph
*
m_drawingParagraph
;
OOX
::
Logic
::
CParagraph
*
m_ooxParagraph
;
OOX
::
WritingElementWithChilds
<
OOX
::
WritingElement
>
*
m_ooxElement
;
public:
...
...
@@ -54,7 +54,7 @@ public:
m_oCharProperty
.
SetDefault
();
}
OOXParagraphReader
(
OOX
::
Drawing
::
C
Paragraph
*
ooxParagraph
)
OOXParagraphReader
(
PPTX
::
Logic
::
Paragraph
*
ooxParagraph
)
{
m_ooxElement
=
NULL
;
m_ooxParagraph
=
NULL
;
...
...
@@ -70,4 +70,5 @@ public:
}
bool
Parse
(
ReaderParameter
oParam
,
RtfParagraph
&
oOutputParagraph
,
CcnfStyle
oConditionalTableStyle
);
bool
Parse2
(
ReaderParameter
oParam
,
RtfParagraph
&
oOutputParagraph
,
CcnfStyle
oConditionalTableStyle
,
RtfStylePtr
poStyle
);
bool
Parse3
(
ReaderParameter
oParam
,
RtfParagraph
&
oOutputParagraph
,
CcnfStyle
oConditionalTableStyle
,
RtfStylePtr
poStyle
,
OOX
::
WritingElement
*
m_ooxElement
);
};
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXPictureAnchorReader.h
View file @
2e8c83a6
...
...
@@ -31,7 +31,6 @@
*/
#pragma once
#include "OOXDrawingGraphicReader.h"
#include "OOXPictureGraphicReader.h"
#include "OOXReaderBasic.h"
class
OOXDrawingAnchorReader
...
...
@@ -297,13 +296,9 @@ public:
if
(
m_ooxAnchor
->
m_oWrapTopAndBottom
.
IsInit
())
pOutput
->
m_nWrapType
=
1
;
int
result
=
0
;
if
(
m_ooxAnchor
->
m_oGraphic
.
IsInit
()
)
{
OOXGraphicReader
oGraphicReader
(
m_ooxAnchor
->
m_oGraphic
.
GetPointer
());
OOXGraphicReader
oGraphicReader
(
&
m_ooxAnchor
->
m_oGraphic
);
result
=
oGraphicReader
.
Parse
(
oParam
,
pOutput
);
}
int
result
=
oGraphicReader
.
Parse
(
oParam
,
pOutput
);
if
(
PROP_DEF
==
pOutput
->
m_nBottom
&&
pOutput
->
m_nTop
!=
PROP_DEF
)
{
pOutput
->
m_nBottom
=
pOutput
->
m_nTop
+
nHeight
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXPictureInlineReader.h
View file @
2e8c83a6
...
...
@@ -30,7 +30,7 @@
*
*/
#pragma once
#include "OOX
Picture
GraphicReader.h"
#include "OOX
Drawing
GraphicReader.h"
class
OOXDrawingInlineReader
{
...
...
@@ -78,13 +78,9 @@ public:
}
}
int
result
=
0
;
if
(
m_ooxInline
->
m_oGraphic
.
IsInit
())
{
OOXGraphicReader
oGraphicReader
(
m_ooxInline
->
m_oGraphic
.
GetPointer
());
OOXGraphicReader
oGraphicReader
(
&
m_ooxInline
->
m_oGraphic
);
result
=
oGraphicReader
.
Parse
(
oParam
,
pOutput
);
}
int
result
=
oGraphicReader
.
Parse
(
oParam
,
pOutput
);
return
result
;
}
};
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXReader.cpp
View file @
2e8c83a6
...
...
@@ -73,7 +73,7 @@ bool OOXReader::Parse()
oFontTableReader
.
Parse
(
oReaderParameter
);
}
OOX
::
C
Theme
*
theme
=
inputDocxFile
.
GetTheme
();
PPTX
::
Theme
*
theme
=
inputDocxFile
.
GetTheme
();
if
(
theme
)
{
OOXThemeReader
oThemeReader
(
theme
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXRunReader.h
View file @
2e8c83a6
...
...
@@ -44,7 +44,7 @@
class
OOXRunReader
{
private:
OOX
::
Drawing
::
C
Run
*
m_drawingRun
;
PPTX
::
Logic
::
Run
*
m_drawingRun
;
OOX
::
Logic
::
CRun
*
m_ooxRun
;
public:
RtfCharProperty
m_oCharProperty
;
...
...
@@ -55,7 +55,7 @@ public:
m_ooxRun
=
ooxRun
;
m_oCharProperty
.
SetDefault
();
}
OOXRunReader
(
OOX
::
Drawing
::
C
Run
*
ooxRun
)
OOXRunReader
(
PPTX
::
Logic
::
Run
*
ooxRun
)
{
m_drawingRun
=
ooxRun
;
m_ooxRun
=
NULL
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.cpp
View file @
2e8c83a6
This diff is collapsed.
Click to expand it.
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.h
View file @
2e8c83a6
...
...
@@ -30,14 +30,12 @@
*
*/
#pragma once
#include "OOXPictureGraphicReader.h"
#include "OOXReaderBasic.h"
#include "../RtfDocument.h"
#include "../RtfShape.h"
#include "../../../../Common/DocxFormat/Source/DocxFormat/Logic/Vml.h"
#include "../../../../Common/DocxFormat/Source/DocxFormat/Logic/Shape.h"
bool
ParseVmlStyle
(
RtfShapePtr
pShape
,
SimpleTypes
::
Vml
::
CCssProperty
*
prop
);
...
...
@@ -52,7 +50,7 @@ public:
m_arrElement
=
vmlElem
;
}
OOXShapeReader
(
OOX
::
WritingElementWithChilds
<
OOX
::
WritingElement
>
*
elem
);
OOXShapeReader
(
OOX
::
Logic
::
CShape
*
ooxShape
)
OOXShapeReader
(
OOX
::
WritingElement
*
ooxShape
)
{
m_ooxShape
=
ooxShape
;
m_vmlElement
=
NULL
;
...
...
@@ -67,26 +65,24 @@ public:
void
ParseAdjustment
(
RtfShape
&
oShape
,
std
::
wstring
sAdjustment
);
static
bool
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CBlipFillProperties
*
oox_bitmap_fill
);
static
bool
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
PPTX
::
Logic
::
BlipFill
*
oox_bitmap_fill
);
private:
void
Parse
(
ReaderParameter
oParam
,
PPTX
::
Logic
::
ColorBase
*
oox_color
,
unsigned
int
&
nColor
,
_CP_OPT
(
double
)
&
opacity
);
void
Parse
(
ReaderParameter
oParam
,
PPTX
::
Logic
::
SolidFill
*
oox_solid_fill
,
unsigned
int
&
nColor
,
_CP_OPT
(
double
)
&
opacity
);
bool
Parse
(
ReaderParameter
oParam
,
int
indexSchemeColor
,
BYTE
&
ucA
,
BYTE
&
ucG
,
BYTE
&
ucB
,
BYTE
&
ucR
);
void
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
CColor
*
oox_color
,
unsigned
int
&
nColor
,
_CP_OPT
(
double
)
&
opacity
);
void
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
CSchemeColor
*
oox_ShemeClr
,
unsigned
int
&
nColor
,
_CP_OPT
(
double
)
&
opacity
);
void
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
Colors
::
CColorTransform
*
oox_ScrgbClr
,
unsigned
int
&
nColor
,
_CP_OPT
(
double
)
&
opacity
);
void
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
CSolidColorFillProperties
*
oox_solid_fill
,
unsigned
int
&
nColor
,
_CP_OPT
(
double
)
&
opacity
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
PPTX
::
Logic
::
StyleRef
*
style_ref
,
int
type
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
PPTX
::
Logic
::
Ln
*
oox_line_prop
,
std
::
wstring
*
change_sheme_color
=
NULL
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CStyleMatrixReference
*
style_matrix_ref
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CLineProperties
*
oox_line_prop
,
std
::
wstring
*
change_sheme_color
=
NULL
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
PPTX
::
Logic
::
UniFill
*
oox_fill
,
std
::
wstring
*
change_sheme_color
=
NULL
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CGradientFillProperties
*
oox_grad_fill
,
std
::
wstring
*
change_sheme_color
=
NULL
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CPatternFillProperties
*
oox_pattern_fill
,
std
::
wstring
*
change_sheme_color
=
NULL
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CSolidColorFillProperties
*
oox_solid_fill
,
std
::
wstring
*
change_sheme_color
=
NULL
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
PPTX
::
Logic
::
GradFill
*
oox_grad_fill
,
std
::
wstring
*
change_sheme_color
=
NULL
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
PPTX
::
Logic
::
PattFill
*
oox_pattern_fill
,
std
::
wstring
*
change_sheme_color
=
NULL
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
PPTX
::
Logic
::
SolidFill
*
oox_solid_fill
,
std
::
wstring
*
change_sheme_color
=
NULL
);
//---------------------------------------------------------------------------
OOX
::
Vml
::
CVmlCommonElements
*
m_vmlElement
;
OOX
::
WritingElementWithChilds
<
OOX
::
WritingElement
>
*
m_arrElement
;
OOX
::
Logic
::
CShape
*
m_ooxShape
;
OOX
::
WritingElement
*
m_ooxShape
;
void
ParseVmlPath
(
RtfShapePtr
&
pShape
,
const
std
::
wstring
&
custom_path
);
bool
ParseVmlStyles
(
RtfShapePtr
&
pShape
,
std
::
vector
<
SimpleTypes
::
Vml
::
CCssPropertyPtr
>
&
props
)
...
...
@@ -104,14 +100,14 @@ class OOXShapeGroupReader
{
private:
OOX
::
Vml
::
CGroup
*
m_vmlGroup
;
OOX
::
Logic
::
CGroupShape
*
m_ooxGroup
;
PPTX
::
Logic
::
SpTree
*
m_ooxGroup
;
public:
OOXShapeGroupReader
(
OOX
::
Vml
::
CGroup
*
vmlGroup
)
{
m_ooxGroup
=
NULL
;
m_vmlGroup
=
vmlGroup
;
}
OOXShapeGroupReader
(
OOX
::
Logic
::
CGroupShap
e
*
ooxGroup
)
OOXShapeGroupReader
(
PPTX
::
Logic
::
SpTre
e
*
ooxGroup
)
{
m_vmlGroup
=
NULL
;
m_ooxGroup
=
ooxGroup
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTextItemReader.h
View file @
2e8c83a6
...
...
@@ -55,7 +55,7 @@ public:
{
case
OOX
:
:
et_a_p
:
{
OOX
::
Drawing
::
CParagraph
*
pParagraph
=
dynamic_cast
<
OOX
::
Drawing
::
C
Paragraph
*>
(
ooxElement
);
PPTX
::
Logic
::
Paragraph
*
pParagraph
=
dynamic_cast
<
PPTX
::
Logic
::
Paragraph
*>
(
ooxElement
);
OOXParagraphReader
m_oParagraphReader
(
pParagraph
);
RtfParagraphPtr
oNewParagraph
(
new
RtfParagraph
()
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXThemeReader.h
View file @
2e8c83a6
...
...
@@ -37,10 +37,10 @@
class
OOXThemeReader
{
private:
OOX
::
C
Theme
*
m_ooxTheme
;
PPTX
::
Theme
*
m_ooxTheme
;
public:
OOXThemeReader
(
OOX
::
C
Theme
*
ooxTheme
)
OOXThemeReader
(
PPTX
::
Theme
*
ooxTheme
)
{
m_ooxTheme
=
ooxTheme
;
}
...
...
@@ -49,11 +49,11 @@ public:
if
(
m_ooxTheme
==
NULL
)
return
false
;
{
OOXColorSchemeReader
oColorSchemeReader
(
&
m_ooxTheme
->
m_oThemeElements
.
m_oC
lrScheme
);
OOXColorSchemeReader
oColorSchemeReader
(
&
m_ooxTheme
->
themeElements
.
c
lrScheme
);
oColorSchemeReader
.
Parse
(
oParam
);
}
{
OOXFontSchemeReader
oFontSchemeReader
(
&
m_ooxTheme
->
m_oThemeElements
.
m_oF
ontScheme
);
OOXFontSchemeReader
oFontSchemeReader
(
&
m_ooxTheme
->
themeElements
.
f
ontScheme
);
oFontSchemeReader
.
Parse
(
oParam
);
}
return
true
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXpPrReader.h
View file @
2e8c83a6
...
...
@@ -46,7 +46,7 @@ class OOXpPrReader
private:
bool
ParseDrawing
(
ReaderParameter
oParam
,
RtfParagraphProperty
&
oOutputProperty
);
OOX
::
Drawing
::
CParagraphProperty
*
m_drawingParaProps
;
PPTX
::
Logic
::
TextParagraphPr
*
m_drawingParaProps
;
OOX
::
Logic
::
CParagraphProperty
*
m_ooxParaProps
;
public:
bool
m_bDefStyle
;
...
...
@@ -57,7 +57,7 @@ public:
m_ooxParaProps
=
ooxParaProps
;
m_drawingParaProps
=
NULL
;
}
OOXpPrReader
(
OOX
::
Drawing
::
CParagraphProperty
*
ooxParaProps
)
OOXpPrReader
(
PPTX
::
Logic
::
TextParagraphPr
*
ooxParaProps
)
{
m_bDefStyle
=
true
;
m_ooxParaProps
=
NULL
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXrPrReader.h
View file @
2e8c83a6
...
...
@@ -45,7 +45,7 @@ class OOXrPrReader
private:
bool
ParseDrawing
(
ReaderParameter
oParam
,
RtfCharProperty
&
oOutputProperty
);
OOX
::
Drawing
::
CRunProperty
*
m_drawingRunProps
;
PPTX
::
Logic
::
RunProperties
*
m_drawingRunProps
;
OOX
::
Logic
::
CRunProperty
*
m_ooxRunProps
;
public:
bool
m_bDefStyle
;
...
...
@@ -56,7 +56,7 @@ public:
m_ooxRunProps
=
ooxRunProps
;
m_drawingRunProps
=
NULL
;
}
OOXrPrReader
(
OOX
::
Drawing
::
CRunProperty
*
ooxRunProps
)
OOXrPrReader
(
PPTX
::
Logic
::
RunProperties
*
ooxRunProps
)
{
m_bDefStyle
=
true
;
m_ooxRunProps
=
NULL
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXWriter.cpp
View file @
2e8c83a6
...
...
@@ -146,7 +146,7 @@ bool OOXWriter::SaveByItemEnd()
if
(
m_poDocPropsApp
)
{
((
OOX
::
CApp
*
)
m_poDocPropsApp
)
->
SetApplication
(
L"OnlyOffice"
);
((
OOX
::
CApp
*
)
m_poDocPropsApp
)
->
SetAppVersion
(
L"
3.0000
"
);
((
OOX
::
CApp
*
)
m_poDocPropsApp
)
->
SetAppVersion
(
L"
4.3
"
);
((
OOX
::
CApp
*
)
m_poDocPropsApp
)
->
write
(
pathDocProps
+
FILE_SEPARATOR_STR
+
L"app.xml"
,
pathDocProps
.
GetDirectory
(),
oContentTypes
);
...
...
ASCOfficeTxtFile/TxtXmlFormatLib/Source/TxtFormat/TxtFile.cpp
View file @
2e8c83a6
...
...
@@ -49,16 +49,16 @@ const int TxtFile::getLinesCount()
const
std
::
list
<
std
::
string
>
TxtFile
::
readAnsiOrCodePage
()
// == readUtf8withoutPref также
{
std
::
list
<
std
::
string
>
result
;
CFile
file_binary
;
NSFile
::
CFileBinary
file_binary
;
if
(
file_binary
.
OpenFile
(
m_path
)
!=
S_OK
)
return
result
;
long
file_size
=
file_binary
.
GetFileSize
();
DWORD
file_size
=
file_binary
.
GetFileSize
();
char
*
file_data
=
new
char
[
file_size
];
if
(
file_data
==
NULL
)
return
result
;
file_binary
.
ReadFile
((
BYTE
*
)
file_data
,
file_size
);
file_binary
.
ReadFile
((
BYTE
*
)
file_data
,
file_size
,
file_size
);
long
start_pos
=
0
;
...
...
@@ -116,16 +116,16 @@ const std::list<std::wstring> TxtFile::readUnicodeFromBytes(char *file_data, lon
const
std
::
list
<
std
::
wstring
>
TxtFile
::
readUnicode
()
{
std
::
list
<
std
::
wstring
>
result
;
CFile
file_binary
;
NSFile
::
CFileBinary
file_binary
;
if
(
file_binary
.
OpenFile
(
m_path
)
!=
S_OK
)
return
result
;
long
file_size
=
file_binary
.
GetFileSize
();
DWORD
file_size
=
file_binary
.
GetFileSize
();
char
*
file_data
=
new
char
[
file_size
];
if
(
file_data
==
NULL
)
return
result
;
file_binary
.
ReadFile
((
BYTE
*
)
file_data
,
file_size
);
file_binary
.
ReadFile
((
BYTE
*
)
file_data
,
file_size
,
file_size
);
return
readUnicodeFromBytes
(
file_data
,
file_size
);
}
...
...
@@ -133,16 +133,16 @@ const std::list<std::wstring> TxtFile::readUnicode()
const
std
::
list
<
std
::
wstring
>
TxtFile
::
readBigEndian
()
{
std
::
list
<
std
::
wstring
>
result
;
CFile
file_binary
;
NSFile
::
CFileBinary
file_binary
;
if
(
file_binary
.
OpenFile
(
m_path
)
!=
S_OK
)
return
result
;
long
file_size
=
file_binary
.
GetFileSize
();
DWORD
file_size
=
file_binary
.
GetFileSize
();
char
*
file_data
=
new
char
[
file_size
];
if
(
file_data
==
NULL
)
return
result
;
file_binary
.
ReadFile
((
BYTE
*
)
file_data
,
file_size
);
file_binary
.
ReadFile
((
BYTE
*
)
file_data
,
file_size
,
file_size
);
//swap bytes
for
(
long
i
=
0
;
i
<
file_size
;
i
+=
2
)
...
...
@@ -158,16 +158,16 @@ const std::list<std::wstring> TxtFile::readBigEndian()
const
std
::
list
<
std
::
string
>
TxtFile
::
readUtf8
()
{
std
::
list
<
std
::
string
>
result
;
CFile
file_binary
;
NSFile
::
CFileBinary
file_binary
;
if
(
file_binary
.
OpenFile
(
m_path
)
!=
S_OK
)
return
result
;
long
file_size
=
file_binary
.
GetFileSize
();
DWORD
file_size
=
file_binary
.
GetFileSize
();
char
*
file_data
=
new
char
[
file_size
];
if
(
file_data
==
NULL
)
return
result
;
file_binary
.
ReadFile
((
BYTE
*
)
file_data
,
file_size
);
file_binary
.
ReadFile
((
BYTE
*
)
file_data
,
file_size
,
file_size
);
long
start_pos
=
3
;
//skip header
...
...
@@ -197,13 +197,13 @@ const std::list<std::string> TxtFile::readUtf8()
void
TxtFile
::
writeAnsiOrCodePage
(
const
std
::
list
<
std
::
string
>&
content
)
// === writeUtf8withoutPref также
{
CFile
file
;
if
(
file
.
CreateFile
(
m_path
)
==
S_OK
)
NSFile
::
CFileBinary
file
;
if
(
file
.
CreateFile
W
(
m_path
)
==
S_OK
)
{
BYTE
endLine
[
2
]
=
{
0x0d
,
0x0a
};
for
(
std
::
list
<
std
::
string
>::
const_iterator
iter
=
content
.
begin
();
iter
!=
content
.
end
();
++
iter
)
{
file
.
WriteFile
((
void
*
)(
*
iter
).
c_str
(),
(
*
iter
).
length
());
file
.
WriteFile
((
BYTE
*
)(
*
iter
).
c_str
(),
(
*
iter
).
length
());
file
.
WriteFile
(
endLine
,
2
);
m_linesCount
++
;
...
...
@@ -213,8 +213,8 @@ void TxtFile::writeAnsiOrCodePage(const std::list<std::string>& content) // ===
void
TxtFile
::
writeUnicode
(
const
std
::
list
<
std
::
wstring
>&
content
)
{
CFile
file
;
if
(
file
.
CreateFile
(
m_path
)
==
S_OK
)
NSFile
::
CFileBinary
file
;
if
(
file
.
CreateFile
W
(
m_path
)
==
S_OK
)
{
BYTE
Header
[
2
]
=
{
0xff
,
0xfe
};
BYTE
EndLine
[
4
]
=
{
0x0d
,
0x00
,
0x0a
,
0x00
};
...
...
@@ -228,7 +228,7 @@ void TxtFile::writeUnicode(const std::list<std::wstring>& content)
if
(
sizeof
(
wchar_t
)
==
2
)
{
file
.
WriteFile
((
void
*
)
data
,
size
<<
1
);
file
.
WriteFile
((
BYTE
*
)
data
,
size
<<
1
);
}
else
{
...
...
@@ -243,8 +243,8 @@ void TxtFile::writeUnicode(const std::list<std::wstring>& content)
void
TxtFile
::
writeBigEndian
(
const
std
::
list
<
std
::
wstring
>&
content
)
{
CFile
file
;
if
(
file
.
CreateFile
(
m_path
)
==
S_OK
)
NSFile
::
CFileBinary
file
;
if
(
file
.
CreateFile
W
(
m_path
)
==
S_OK
)
{
BYTE
Header
[
2
]
=
{
0xfe
,
0xff
};
BYTE
EndLine
[
4
]
=
{
0x00
,
0x0d
,
0x00
,
0x0a
};
...
...
@@ -264,7 +264,7 @@ void TxtFile::writeBigEndian(const std::list<std::wstring>& content)
data
[
i
]
=
data
[
i
+
1
];
data
[
i
+
1
]
=
v
;
}
file
.
WriteFile
((
void
*
)(
*
iter
).
c_str
(),
size
<<
1
);
file
.
WriteFile
((
BYTE
*
)(
*
iter
).
c_str
(),
size
<<
1
);
}
else
{
...
...
@@ -279,8 +279,8 @@ void TxtFile::writeBigEndian(const std::list<std::wstring>& content)
void
TxtFile
::
writeUtf8
(
const
std
::
list
<
std
::
string
>&
content
)
{
CFile
file
;
if
(
file
.
CreateFile
(
m_path
)
==
S_OK
)
NSFile
::
CFileBinary
file
;
if
(
file
.
CreateFile
W
(
m_path
)
==
S_OK
)
{
BYTE
Header
[
3
]
=
{
0xef
,
0xbb
,
0xbf
};
BYTE
EndLine
[
2
]
=
{
0x0d
,
0x0a
};
...
...
@@ -289,8 +289,8 @@ void TxtFile::writeUtf8(const std::list<std::string>& content)
for
(
std
::
list
<
std
::
string
>::
const_iterator
iter
=
content
.
begin
();
iter
!=
content
.
end
();
++
iter
)
{
file
.
WriteFile
((
void
*
)(
*
iter
).
c_str
(),
(
*
iter
).
length
());
file
.
WriteFile
((
void
*
)
EndLine
,
2
);
file
.
WriteFile
((
BYTE
*
)(
*
iter
).
c_str
(),
(
*
iter
).
length
());
file
.
WriteFile
((
BYTE
*
)
EndLine
,
2
);
m_linesCount
++
;
}
...
...
@@ -299,12 +299,14 @@ void TxtFile::writeUtf8(const std::list<std::string>& content)
const
bool
TxtFile
::
isUnicode
()
{
CFile
file
;
NSFile
::
CFileBinary
file
;
if
(
file
.
OpenFile
(
m_path
)
!=
S_OK
)
return
false
;
DWORD
dwRead
;
BYTE
data
[
2
];
file
.
ReadFile
(
data
,
2
);
file
.
ReadFile
(
data
,
2
,
dwRead
);
file
.
CloseFile
();
if
((
data
[
0
]
==
0xff
)
&&
(
data
[
1
]
==
0xfe
))
return
true
;
...
...
@@ -314,12 +316,14 @@ const bool TxtFile::isUnicode()
const
bool
TxtFile
::
isBigEndian
()
{
CFile
file
;
NSFile
::
CFileBinary
file
;
if
(
file
.
OpenFile
(
m_path
)
!=
S_OK
)
return
false
;
DWORD
dwRead
;
BYTE
data
[
2
];
file
.
ReadFile
(
data
,
2
);
file
.
ReadFile
(
data
,
2
,
dwRead
);
file
.
CloseFile
();
if
((
data
[
0
]
==
0xfe
)
&&
(
data
[
1
]
==
0xff
))
return
true
;
...
...
@@ -329,12 +333,14 @@ const bool TxtFile::isBigEndian()
const
bool
TxtFile
::
isUtf8
()
{
CFile
file
;
NSFile
::
CFileBinary
file
;
if
(
file
.
OpenFile
(
m_path
)
!=
S_OK
)
return
false
;
DWORD
dwRead
;
BYTE
data
[
3
];
file
.
ReadFile
(
data
,
3
);
file
.
ReadFile
(
data
,
3
,
dwRead
);
file
.
CloseFile
();
if
((
data
[
0
]
==
0xef
)
&&
(
data
[
1
]
==
0xbb
)
&&
(
data
[
2
]
==
0xbf
))
return
true
;
...
...
ASCOfficeTxtFile/TxtXmlFormatLib/Source/TxtXmlFile.cpp
View file @
2e8c83a6
...
...
@@ -50,7 +50,6 @@ namespace NSBinPptxRW
#include "../../../Common/DocxFormat/Source/SystemUtility/File.h"
#include "../../../DesktopEditor/common/Path.h"
#include "../../../ASCOfficeDocxFile2/DocWrapper/FontProcessor.h"
#include "../../../ASCOfficeDocxFile2/BinReader/FileWriter.h"
...
...
@@ -211,7 +210,7 @@ void CTxtXmlFile::CreateDocxEmpty(const std::wstring & _strDirectory, Writers::F
//default files
pDocxWriter
->
m_o
Default
Theme
.
Write
(
pathTheme
.
GetPath
());
pDocxWriter
->
m_oTheme
.
Write
(
pathTheme
.
GetPath
());
OOX
::
CContentTypes
oContentTypes
;
//docProps
...
...
@@ -224,7 +223,7 @@ void CTxtXmlFile::CreateDocxEmpty(const std::wstring & _strDirectory, Writers::F
if
(
pApp
)
{
pApp
->
SetApplication
(
_T
(
"OnlyOffice"
));
pApp
->
SetAppVersion
(
_T
(
"
3.0
000"
));
pApp
->
SetAppVersion
(
_T
(
"
4.3
000"
));
pApp
->
SetDocSecurity
(
0
);
pApp
->
SetScaleCrop
(
false
);
pApp
->
SetLinksUpToDate
(
false
);
...
...
@@ -243,20 +242,24 @@ void CTxtXmlFile::CreateDocxEmpty(const std::wstring & _strDirectory, Writers::F
delete
pCore
;
}
/////////////////////////////////////////////////////////////////////////////////////
pDocxWriter
->
m_oCommentsWriter
.
Write
();
pDocxWriter
->
m_oChartWriter
.
Write
();
pDocxWriter
->
m_oTheme
.
Write
(
strDirectory
);
pDocxWriter
->
m_oStylesWriter
.
Write
();
pDocxWriter
->
m_oNumberingWriter
.
Write
();
pDocxWriter
->
m_oFontTableWriter
.
Write
();
pDocxWriter
->
m_oHeaderFooterWriter
.
Write
();
//Setting пишем после HeaderFooter, чтобы заполнить evenAndOddHeaders
pDocxWriter
->
m_oSettingWriter
.
Write
();
pDocxWriter
->
m_oWebSettingsWriter
.
Write
();
//Document пишем после HeaderFooter, чтобы заполнить sectPr
pDocxWriter
->
m_oDocumentWriter
.
Write
();
//Rels и ContentTypes пишем в конце
pDocxWriter
->
m_oDocumentRelsWriter
.
Write
();
pDocxWriter
->
m_oContentTypesWriter
.
Write
();
oContentTypes
.
Registration
(
L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"
,
OOX
::
CPath
(
L"/word"
),
OOX
::
CPath
(
L"document.xml"
));
oContentTypes
.
Registration
(
L"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"
,
OOX
::
CPath
(
L"/word"
),
OOX
::
CPath
(
L"styles.xml"
));
oContentTypes
.
Registration
(
L"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"
,
OOX
::
CPath
(
L"/word"
),
OOX
::
CPath
(
L"settings.xml"
));
oContentTypes
.
Registration
(
L"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"
,
OOX
::
CPath
(
L"/word"
),
OOX
::
CPath
(
L"webSettings.xml"
));
oContentTypes
.
Registration
(
L"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"
,
OOX
::
CPath
(
L"/word"
),
OOX
::
CPath
(
L"fontTable.xml"
));
oContentTypes
.
Registration
(
L"application/vnd.openxmlformats-officedocument.theme+xml"
,
OOX
::
CPath
(
L"/word/theme"
),
OOX
::
CPath
(
L"theme1.xml"
));
oContentTypes
.
Write
(
strDirectory
);
}
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