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
ea5ebe72
Commit
ea5ebe72
authored
Dec 15, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocFormatReader - another ole objects(pictureId)
parent
50224310
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
831 additions
and
1083 deletions
+831
-1083
ASCOfficeDocFile/Common/FormatUtils.h
ASCOfficeDocFile/Common/FormatUtils.h
+2
-30
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
+47
-46
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.h
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.h
+2
-2
ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeContainer.h
...ceDocFile/DocDocxConverter/OfficeDrawing/ShapeContainer.h
+14
-0
ASCOfficeDocFile/DocDocxConverter/OleObject.h
ASCOfficeDocFile/DocDocxConverter/OleObject.h
+10
-268
ASCOfficeDocFile/DocDocxConverter/Tbkd.h
ASCOfficeDocFile/DocDocxConverter/Tbkd.h
+2
-2
ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp
ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp
+742
-726
ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.h
ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.h
+1
-1
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
+1
-1
ASCOfficeDocFile/DocDocxConverter/WordDocument.h
ASCOfficeDocFile/DocDocxConverter/WordDocument.h
+1
-1
ASCOfficeDocFile/DocFormatLib/Win32/DocFormatLib.vcproj
ASCOfficeDocFile/DocFormatLib/Win32/DocFormatLib.vcproj
+4
-0
ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro
ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro
+4
-5
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
+1
-1
No files found.
ASCOfficeDocFile/Common/FormatUtils.h
View file @
ea5ebe72
...
@@ -766,18 +766,11 @@ namespace DocFormatUtils
...
@@ -766,18 +766,11 @@ namespace DocFormatUtils
static
inline
std
::
wstring
IntToWideString
(
int
value
)
static
inline
std
::
wstring
IntToWideString
(
int
value
)
{
{
#if defined(_WIN32) || defined (_WIN64)
wchar_t
buff
[
33
]
=
{};
_itow
(
value
,
buff
,
10
);
return
std
::
wstring
(
buff
);
#else
return
(
std
::
to_wstring
(
value
));
return
(
std
::
to_wstring
(
value
));
#endif
}
}
static
inline
std
::
wstring
DoubleToWideString
(
double
value
)
static
inline
std
::
wstring
DoubleToWideString
(
double
value
)
{
{
std
::
wstringstream
src
;
std
::
wstringstream
src
;
src
<<
value
;
src
<<
value
;
return
std
::
wstring
(
src
.
str
());
return
std
::
wstring
(
src
.
str
());
...
@@ -785,8 +778,7 @@ namespace DocFormatUtils
...
@@ -785,8 +778,7 @@ namespace DocFormatUtils
static
inline
std
::
string
DoubleToString
(
double
value
)
static
inline
std
::
string
DoubleToString
(
double
value
)
{
{
std
::
stringstream
src
;
std
::
stringstream
src
;
src
<<
value
;
src
<<
value
;
return
std
::
string
(
src
.
str
());
return
std
::
string
(
src
.
str
());
...
@@ -813,36 +805,16 @@ namespace DocFormatUtils
...
@@ -813,36 +805,16 @@ namespace DocFormatUtils
static
inline
std
::
wstring
IntToFormattedWideString
(
int
value
,
const
wchar_t
*
format
)
static
inline
std
::
wstring
IntToFormattedWideString
(
int
value
,
const
wchar_t
*
format
)
{
{
// const int size = 33;
// wchar_t strValue[size] = L"\0";
if
(
format
==
NULL
)
return
L""
;
if
(
format
==
NULL
)
return
L""
;
// swprintf_s( strValue, size, format, value );
//// }
// CString format_str;
// format_str.Format(format , value);
std
::
wstringstream
sstream
;
std
::
wstringstream
sstream
;
sstream
<<
boost
::
wformat
(
format
)
%
value
;
sstream
<<
boost
::
wformat
(
format
)
%
value
;
return
sstream
.
str
();
return
sstream
.
str
();
//return string2std_string( format_str );
}
}
static
inline
std
::
wstring
DoubleToFormattedWideString
(
double
value
,
wchar_t
*
format
)
static
inline
std
::
wstring
DoubleToFormattedWideString
(
double
value
,
wchar_t
*
format
)
{
{
if
(
format
==
NULL
)
return
L""
;
if
(
format
==
NULL
)
return
L""
;
//std::wstring wstr;
//if ( format != NULL )
//{
// CString strValue;
// strValue.Format(format, value);
// wstr = string2std_string( strValue );
//}
//return wstr;
std
::
wstringstream
sstream
;
std
::
wstringstream
sstream
;
sstream
<<
boost
::
wformat
(
format
)
%
value
;
sstream
<<
boost
::
wformat
(
format
)
%
value
;
return
sstream
.
str
();
return
sstream
.
str
();
...
...
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
View file @
ea5ebe72
...
@@ -81,12 +81,8 @@ namespace DocFileFormat
...
@@ -81,12 +81,8 @@ namespace DocFileFormat
RELEASEOBJECT
(
m_pXmlWriter
);
RELEASEOBJECT
(
m_pXmlWriter
);
}
}
}
}
}
namespace
DocFileFormat
{
// Looks into the section table to find out if this CP is the end & current of a sections
// Looks into the section table to find out if this CP is the end & current of a sections
int
DocumentMapping
::
getCurrentSection
(
int
cp
)
int
DocumentMapping
::
getCurrentSection
(
int
cp
)
{
{
//if cp is the last char of a section, the next section will start at cp +1
//if cp is the last char of a section, the next section will start at cp +1
...
@@ -198,7 +194,7 @@ namespace DocFileFormat
...
@@ -198,7 +194,7 @@ namespace DocFileFormat
// start paragraph
// start paragraph
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:p"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:p"
),
true
);
writeParagraphRsid
(
papx
);
writeParagraphRsid
(
papx
);
// ----------- check for section properties
// ----------- check for section properties
...
@@ -339,7 +335,7 @@ namespace DocFileFormat
...
@@ -339,7 +335,7 @@ namespace DocFileFormat
}
}
}
}
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
,
FALSE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
,
false
);
}
}
// Writes a run with the given characters and CHPX
// Writes a run with the given characters and CHPX
...
@@ -356,23 +352,23 @@ namespace DocFileFormat
...
@@ -356,23 +352,23 @@ namespace DocFileFormat
if
(
Deleted
==
rev
.
Type
)
if
(
Deleted
==
rev
.
Type
)
{
{
//If it's a deleted run
//If it's a deleted run
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:del"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:del"
),
true
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:author"
),
_T
(
"[b2x: could not retrieve author]"
));
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:author"
),
_T
(
"[b2x: could not retrieve author]"
));
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:date"
),
_T
(
"[b2x: could not retrieve date]"
));
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:date"
),
_T
(
"[b2x: could not retrieve date]"
));
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
,
FALSE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
,
false
);
}
}
else
if
(
rev
.
Type
==
Inserted
)
else
if
(
rev
.
Type
==
Inserted
)
{
{
WideString
*
author
=
dynamic_cast
<
WideString
*>
(
m_document
->
RevisionAuthorTable
->
operator
[](
rev
.
Isbt
));
WideString
*
author
=
dynamic_cast
<
WideString
*>
(
m_document
->
RevisionAuthorTable
->
operator
[](
rev
.
Isbt
));
//if it's a inserted run
//if it's a inserted run
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:ins"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:ins"
),
true
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:author"
),
FormatUtils
::
XmlEncode
(
*
author
).
c_str
());
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:author"
),
FormatUtils
::
XmlEncode
(
*
author
).
c_str
());
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
,
FALSE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
,
false
);
//rev.Dttm.Convert(new DateMapping(m_pXmlWriter));
//rev.Dttm.Convert(new DateMapping(m_pXmlWriter));
}
}
//start run
//start run
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:r"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:r"
),
true
);
//append rsids
//append rsids
if
(
0
!=
rev
.
Rsid
)
if
(
0
!=
rev
.
Rsid
)
...
@@ -396,7 +392,7 @@ namespace DocFileFormat
...
@@ -396,7 +392,7 @@ namespace DocFileFormat
m_context
->
AddRsid
(
rsidProp
);
m_context
->
AddRsid
(
rsidProp
);
}
}
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
,
FALSE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
,
false
);
/// <w:rPr>
/// <w:rPr>
CharacterPropertiesMapping
*
rPr
=
new
CharacterPropertiesMapping
(
m_pXmlWriter
,
m_document
,
&
rev
,
_lastValidPapx
,
false
);
CharacterPropertiesMapping
*
rPr
=
new
CharacterPropertiesMapping
(
m_pXmlWriter
,
m_document
,
&
rev
,
_lastValidPapx
,
false
);
...
@@ -564,9 +560,9 @@ namespace DocFileFormat
...
@@ -564,9 +560,9 @@ namespace DocFileFormat
if
(
bFORM
)
if
(
bFORM
)
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:fldChar"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:fldChar"
),
true
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:fldCharType"
),
_T
(
"begin"
)
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:fldCharType"
),
_T
(
"begin"
)
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
,
FALSE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
,
false
);
int
cpPic
=
searchNextTextMark
(
m_document
->
Text
,
cpFieldStart
,
TextMark
::
Picture
);
int
cpPic
=
searchNextTextMark
(
m_document
->
Text
,
cpFieldStart
,
TextMark
::
Picture
);
...
@@ -589,9 +585,9 @@ namespace DocFileFormat
...
@@ -589,9 +585,9 @@ namespace DocFileFormat
&&
&&
(
(
bEMBED
||
bLINK
)
&&
bChart
)
)
(
(
bEMBED
||
bLINK
)
&&
bChart
)
)
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:fldChar"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:fldChar"
),
true
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:fldCharType"
),
_T
(
"begin"
)
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:fldCharType"
),
_T
(
"begin"
)
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
,
FALSE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
,
false
);
int
cpPic
=
searchNextTextMark
(
m_document
->
Text
,
cpFieldStart
,
TextMark
::
Picture
);
int
cpPic
=
searchNextTextMark
(
m_document
->
Text
,
cpFieldStart
,
TextMark
::
Picture
);
...
@@ -608,9 +604,9 @@ namespace DocFileFormat
...
@@ -608,9 +604,9 @@ namespace DocFileFormat
if
((
search
(
f
.
begin
(),
f
.
end
(),
TOC
.
begin
(),
TOC
.
end
())
!=
f
.
end
())
||
bPAGE
)
if
((
search
(
f
.
begin
(),
f
.
end
(),
TOC
.
begin
(),
TOC
.
end
())
!=
f
.
end
())
||
bPAGE
)
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:fldChar"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:fldChar"
),
true
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:fldCharType"
),
_T
(
"begin"
)
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:fldCharType"
),
_T
(
"begin"
)
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
);
_writeInstrText
=
true
;
_writeInstrText
=
true
;
_fldCharCounter
++
;
_fldCharCounter
++
;
...
@@ -638,9 +634,9 @@ namespace DocFileFormat
...
@@ -638,9 +634,9 @@ namespace DocFileFormat
//if (_writeInstrText == true)
//if (_writeInstrText == true)
//{
//{
// m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ),
TRUE
);
// m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ),
true
);
// m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "separate" ) );
// m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "separate" ) );
// m_pXmlWriter->WriteNodeEnd( _T( "" ),
TRUE
);
// m_pXmlWriter->WriteNodeEnd( _T( "" ),
true
);
//}
//}
_writeInstrText
=
false
;
_writeInstrText
=
false
;
...
@@ -678,10 +674,10 @@ namespace DocFileFormat
...
@@ -678,10 +674,10 @@ namespace DocFileFormat
{
{
OleObject
ole
(
chpxObj
,
m_document
->
GetStorage
(),
m_document
->
bOlderVersion
);
OleObject
ole
(
chpxObj
,
m_document
->
GetStorage
(),
m_document
->
bOlderVersion
);
OleWriter
.
WriteNodeBegin
(
_T
(
"w:object"
),
TRUE
);
OleWriter
.
WriteNodeBegin
(
_T
(
"w:object"
),
true
);
OleWriter
.
WriteAttribute
(
_T
(
"w:dxaOrig"
),
FormatUtils
::
IntToWideString
(
(
ole
.
pictureDesciptor
.
dxaGoal
+
ole
.
pictureDesciptor
.
dxaOrigin
)
).
c_str
()
);
OleWriter
.
WriteAttribute
(
_T
(
"w:dxaOrig"
),
FormatUtils
::
IntToWideString
(
(
ole
.
pictureDesciptor
.
dxaGoal
+
ole
.
pictureDesciptor
.
dxaOrigin
)
).
c_str
()
);
OleWriter
.
WriteAttribute
(
_T
(
"w:dyaOrig"
),
FormatUtils
::
IntToWideString
(
(
ole
.
pictureDesciptor
.
dyaGoal
+
ole
.
pictureDesciptor
.
dyaOrigin
)
).
c_str
()
);
OleWriter
.
WriteAttribute
(
_T
(
"w:dyaOrig"
),
FormatUtils
::
IntToWideString
(
(
ole
.
pictureDesciptor
.
dyaGoal
+
ole
.
pictureDesciptor
.
dyaOrigin
)
).
c_str
()
);
OleWriter
.
WriteNodeEnd
(
_T
(
""
),
TRUE
,
FALSE
);
OleWriter
.
WriteNodeEnd
(
_T
(
""
),
true
,
false
);
ole
.
pictureDesciptor
.
Convert
(
&
oVmlMapper
);
ole
.
pictureDesciptor
.
Convert
(
&
oVmlMapper
);
OleObjectMapping
oleObjectMapping
(
&
OleWriter
,
m_context
,
&
ole
.
pictureDesciptor
,
_caller
,
oVmlMapper
.
GetShapeId
()
);
OleObjectMapping
oleObjectMapping
(
&
OleWriter
,
m_context
,
&
ole
.
pictureDesciptor
,
_caller
,
oVmlMapper
.
GetShapeId
()
);
...
@@ -692,10 +688,10 @@ namespace DocFileFormat
...
@@ -692,10 +688,10 @@ namespace DocFileFormat
{
{
PictureDescriptor
pic
(
chpxObj
,
m_document
->
DataStream
,
0x7fffffff
,
m_document
->
bOlderVersion
);
PictureDescriptor
pic
(
chpxObj
,
m_document
->
DataStream
,
0x7fffffff
,
m_document
->
bOlderVersion
);
OleWriter
.
WriteNodeBegin
(
_T
(
"w:object"
),
TRUE
);
OleWriter
.
WriteNodeBegin
(
_T
(
"w:object"
),
true
);
OleWriter
.
WriteAttribute
(
_T
(
"w:dxaOrig"
),
FormatUtils
::
IntToWideString
(
(
pic
.
dxaGoal
+
pic
.
dxaOrigin
)
).
c_str
()
);
OleWriter
.
WriteAttribute
(
_T
(
"w:dxaOrig"
),
FormatUtils
::
IntToWideString
(
(
pic
.
dxaGoal
+
pic
.
dxaOrigin
)
).
c_str
()
);
OleWriter
.
WriteAttribute
(
_T
(
"w:dyaOrig"
),
FormatUtils
::
IntToWideString
(
(
pic
.
dyaGoal
+
pic
.
dyaOrigin
)
).
c_str
()
);
OleWriter
.
WriteAttribute
(
_T
(
"w:dyaOrig"
),
FormatUtils
::
IntToWideString
(
(
pic
.
dyaGoal
+
pic
.
dyaOrigin
)
).
c_str
()
);
OleWriter
.
WriteNodeEnd
(
_T
(
""
),
TRUE
,
FALSE
);
OleWriter
.
WriteNodeEnd
(
_T
(
""
),
true
,
false
);
pic
.
Convert
(
&
oVmlMapper
);
pic
.
Convert
(
&
oVmlMapper
);
RELEASEOBJECT
(
chpxs
);
RELEASEOBJECT
(
chpxs
);
...
@@ -741,9 +737,9 @@ namespace DocFileFormat
...
@@ -741,9 +737,9 @@ namespace DocFileFormat
}
}
else
else
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:fldChar"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:fldChar"
),
true
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:fldCharType"
),
_T
(
"begin"
)
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:fldCharType"
),
_T
(
"begin"
)
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
);
_writeInstrText
=
true
;
_writeInstrText
=
true
;
_fldCharCounter
++
;
_fldCharCounter
++
;
...
@@ -787,10 +783,10 @@ namespace DocFileFormat
...
@@ -787,10 +783,10 @@ namespace DocFileFormat
{
{
Symbol
s
=
getSymbol
(
chpx
);
Symbol
s
=
getSymbol
(
chpx
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:sym"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:sym"
),
true
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:font"
),
FormatUtils
::
XmlEncode
(
s
.
FontName
).
c_str
());
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:font"
),
FormatUtils
::
XmlEncode
(
s
.
FontName
).
c_str
());
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:char"
),
FormatUtils
::
XmlEncode
(
s
.
HexValue
).
c_str
());
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:char"
),
FormatUtils
::
XmlEncode
(
s
.
HexValue
).
c_str
());
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
);
}
}
else
if
((
TextMark
::
DrawnObject
==
code
)
&&
fSpec
)
else
if
((
TextMark
::
DrawnObject
==
code
)
&&
fSpec
)
{
{
...
@@ -807,20 +803,25 @@ namespace DocFileFormat
...
@@ -807,20 +803,25 @@ namespace DocFileFormat
if
(
pSpa
)
if
(
pSpa
)
{
{
PictureDescriptor
pictDiscr
(
chpx
,
m_document
->
WordDocumentStream
,
0x7fffffff
,
m_document
->
bOlderVersion
);
ShapeContainer
*
pShape
=
m_document
->
GetOfficeArt
()
->
GetShapeContainer
(
pSpa
->
GetShapeID
());
ShapeContainer
*
pShape
=
m_document
->
GetOfficeArt
()
->
GetShapeContainer
(
pSpa
->
GetShapeID
());
if
(
pShape
)
if
(
pShape
)
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:pict"
));
bool
bOLE
=
pShape
->
isOLE
();
VMLShapeMapping
oVmlWriter
(
m_context
,
m_pXmlWriter
,
pSpa
,
NULL
,
_caller
);
VMLShapeMapping
oVmlWriter
(
m_context
,
m_pXmlWriter
,
pSpa
,
&
pictDiscr
,
_caller
);
m_pXmlWriter
->
WriteNodeBegin
(
L"w:pict"
);
pShape
->
Convert
(
&
oVmlWriter
);
pShape
->
Convert
(
&
oVmlWriter
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
"w:pict"
)
);
m_pXmlWriter
->
WriteNodeEnd
(
L"w:pict"
);
}
}
if
(
!
pSpa
->
primitives
.
empty
())
if
(
!
pSpa
->
primitives
.
empty
())
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:pict"
));
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:pict"
));
VMLShapeMapping
oVmlWriter
(
m_context
,
m_pXmlWriter
,
pSpa
,
NULL
,
_caller
);
VMLShapeMapping
oVmlWriter
(
m_context
,
m_pXmlWriter
,
pSpa
,
&
pictDiscr
,
_caller
);
pSpa
->
primitives
.
Convert
(
&
oVmlWriter
);
pSpa
->
primitives
.
Convert
(
&
oVmlWriter
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
"w:pict"
));
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
"w:pict"
));
}
}
...
@@ -897,40 +898,40 @@ namespace DocFileFormat
...
@@ -897,40 +898,40 @@ namespace DocFileFormat
{
{
if
((
m_document
->
FootnoteReferenceCharactersPlex
!=
NULL
)
&&
(
m_document
->
FootnoteReferenceCharactersPlex
->
IsCpExists
(
cp
)))
if
((
m_document
->
FootnoteReferenceCharactersPlex
!=
NULL
)
&&
(
m_document
->
FootnoteReferenceCharactersPlex
->
IsCpExists
(
cp
)))
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:footnoteReference"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:footnoteReference"
),
true
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:id"
),
FormatUtils
::
IntToWideString
(
_footnoteNr
++
).
c_str
()
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:id"
),
FormatUtils
::
IntToWideString
(
_footnoteNr
++
).
c_str
()
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
);
}
}
else
if
((
m_document
->
IndividualFootnotesPlex
!=
NULL
)
&&
(
m_document
->
IndividualFootnotesPlex
->
IsCpExists
(
cp
-
m_document
->
FIB
->
m_RgLw97
.
ccpText
)))
else
if
((
m_document
->
IndividualFootnotesPlex
!=
NULL
)
&&
(
m_document
->
IndividualFootnotesPlex
->
IsCpExists
(
cp
-
m_document
->
FIB
->
m_RgLw97
.
ccpText
)))
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:footnoteRef"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:footnoteRef"
),
true
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
);
}
}
else
if
((
m_document
->
EndnoteReferenceCharactersPlex
!=
NULL
)
&&
(
m_document
->
EndnoteReferenceCharactersPlex
->
IsCpExists
(
cp
)))
else
if
((
m_document
->
EndnoteReferenceCharactersPlex
!=
NULL
)
&&
(
m_document
->
EndnoteReferenceCharactersPlex
->
IsCpExists
(
cp
)))
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:endnoteReference"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:endnoteReference"
),
true
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:id"
),
FormatUtils
::
IntToWideString
(
_endnoteNr
++
).
c_str
()
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:id"
),
FormatUtils
::
IntToWideString
(
_endnoteNr
++
).
c_str
()
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
);
}
}
else
if
((
m_document
->
IndividualEndnotesPlex
!=
NULL
)
&&
else
if
((
m_document
->
IndividualEndnotesPlex
!=
NULL
)
&&
(
m_document
->
IndividualEndnotesPlex
->
IsCpExists
(
cp
-
m_document
->
FIB
->
m_RgLw97
.
ccpAtn
-
m_document
->
FIB
->
m_RgLw97
.
ccpHdr
-
m_document
->
FIB
->
m_RgLw97
.
ccpFtn
-
m_document
->
FIB
->
m_RgLw97
.
ccpText
)))
(
m_document
->
IndividualEndnotesPlex
->
IsCpExists
(
cp
-
m_document
->
FIB
->
m_RgLw97
.
ccpAtn
-
m_document
->
FIB
->
m_RgLw97
.
ccpHdr
-
m_document
->
FIB
->
m_RgLw97
.
ccpFtn
-
m_document
->
FIB
->
m_RgLw97
.
ccpText
)))
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:endnoteRef"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:endnoteRef"
),
true
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
);
}
}
}
}
else
if
(
TextMark
::
AnnotationReference
==
code
)
else
if
(
TextMark
::
AnnotationReference
==
code
)
{
{
if
(
typeid
(
*
this
)
!=
typeid
(
CommentsMapping
))
if
(
typeid
(
*
this
)
!=
typeid
(
CommentsMapping
))
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:commentReference"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:commentReference"
),
true
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:id"
),
FormatUtils
::
IntToWideString
(
_commentNr
).
c_str
()
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:id"
),
FormatUtils
::
IntToWideString
(
_commentNr
).
c_str
()
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
);
}
}
else
else
{
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:annotationRef"
),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:annotationRef"
),
true
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
);
}
}
_commentNr
++
;
_commentNr
++
;
...
@@ -976,12 +977,12 @@ namespace DocFileFormat
...
@@ -976,12 +977,12 @@ namespace DocFileFormat
{
{
std
::
wstring
str
=
(
std
::
wstring
(
_T
(
"w:"
)
)
+
textType
);
std
::
wstring
str
=
(
std
::
wstring
(
_T
(
"w:"
)
)
+
textType
);
m_pXmlWriter
->
WriteNodeBegin
(
str
.
c_str
(),
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
str
.
c_str
(),
true
);
if
(
preserve_space
)
if
(
preserve_space
)
{
{
m_pXmlWriter
->
WriteAttribute
(
_T
(
"xml:space"
),
_T
(
"preserve"
)
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"xml:space"
),
_T
(
"preserve"
)
);
}
}
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
,
FALSE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
true
,
false
);
}
}
void
DocumentMapping
::
writeTextEnd
(
const
std
::
wstring
&
textType
)
void
DocumentMapping
::
writeTextEnd
(
const
std
::
wstring
&
textType
)
...
...
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.h
View file @
ea5ebe72
...
@@ -125,9 +125,9 @@ namespace DocFileFormat
...
@@ -125,9 +125,9 @@ namespace DocFileFormat
int
searchNextTextMark
(
std
::
vector
<
wchar_t
>*
chars
,
int
initialCp
,
wchar_t
mark
);
int
searchNextTextMark
(
std
::
vector
<
wchar_t
>*
chars
,
int
initialCp
,
wchar_t
mark
);
private:
private:
Symbol
getSymbol
(
const
CharacterPropertyExceptions
*
chpx
);
Symbol
getSymbol
(
const
CharacterPropertyExceptions
*
chpx
);
bool
m_bInternalXmlWriter
;
bool
m_bInternalXmlWriter
;
protected:
protected:
WordDocument
*
m_document
;
WordDocument
*
m_document
;
...
...
ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeContainer.h
View file @
ea5ebe72
...
@@ -83,6 +83,20 @@ namespace DocFileFormat
...
@@ -83,6 +83,20 @@ namespace DocFileFormat
}
}
return
false
;
return
false
;
}
}
bool
isOLE
()
{
int
ret
=
0
;
for
(
std
::
vector
<
Record
*>::
const_iterator
iter
=
this
->
Children
.
begin
();
iter
!=
this
->
Children
.
end
();
iter
++
)
{
Shape
*
sh
=
dynamic_cast
<
Shape
*>
(
*
iter
);
if
(
sh
)
{
return
sh
->
fOleShape
;
}
}
return
false
;
}
virtual
~
ShapeContainer
()
virtual
~
ShapeContainer
()
{
{
}
}
...
...
ASCOfficeDocFile/DocDocxConverter/OleObject.h
View file @
ea5ebe72
...
@@ -68,276 +68,18 @@ namespace DocFileFormat
...
@@ -68,276 +68,18 @@ namespace DocFileFormat
PictureDescriptor
pictureDesciptor
;
PictureDescriptor
pictureDesciptor
;
OleObject
(
const
CharacterPropertyExceptions
*
chpx
,
StructuredStorageReader
*
docStorage
,
bool
bOlderVersion_
)
OleObject
(
const
CharacterPropertyExceptions
*
chpx
,
StructuredStorageReader
*
docStorage
,
bool
bOlderVersion_
);
:
bLinked
(
false
),
updateMode
(
NoLink
),
bOlderVersion
(
bOlderVersion_
)
virtual
~
OleObject
()
{}
{
isEquation
=
isEmbedded
=
false
;
oleStorage
=
docStorage
->
GetStorage
();
if
(
(
chpx
!=
NULL
)
&&
(
docStorage
!=
NULL
)
)
{
HRESULT
res
=
S_OK
;
POLE
::
Stream
*
ObjectPoolStorage
=
new
POLE
::
Stream
(
oleStorage
,
"ObjectPool"
);
if
(
ObjectPoolStorage
)
{
ObjectId
=
getOleEntryName
(
chpx
);
std
::
string
sObjectId
(
ObjectId
.
begin
(),
ObjectId
.
end
()
);
{
std
::
string
name
=
"ObjectPool/"
+
sObjectId
+
"/"
;
processOleStream
(
name
+
"Ole"
);
if
(
bLinked
)
{
processLinkInfoStream
(
name
+
"LinkInfo"
);
}
else
{
processCompObjStream
(
name
+
"CompObj"
);
}
processPICStream
(
name
+
"PIC"
);
processEquationNativeStream
(
name
+
"Equation Native"
);
}
delete
ObjectPoolStorage
;
}
}
}
virtual
~
OleObject
()
{
}
private:
private:
POLE
::
Storage
*
oleStorage
;
POLE
::
Storage
*
oleStorage
;
void
processLinkInfoStream
(
const
std
::
string
&
linkStream
)
void
processLinkInfoStream
(
const
std
::
string
&
linkStream
);
{
void
processEquationNativeStream
(
const
std
::
string
&
eqStream
);
try
void
processPICStream
(
const
std
::
string
&
picStream
);
{
void
processCompObjStream
(
const
std
::
string
&
compStream
);
POLE
::
Stream
*
pLinkStream
=
NULL
;
void
processOleStream
(
const
std
::
string
&
oleStreamName
);
HRESULT
res
=
S_OK
;
std
::
wstring
getOleEntryName
(
const
CharacterPropertyExceptions
*
chpx
);
pLinkStream
=
//oleStorage->stream(linkStream);
};
new
POLE
::
Stream
(
oleStorage
,
linkStream
);
if
(
pLinkStream
)
{
VirtualStreamReader
reader
(
pLinkStream
,
0
,
false
);
//there are two versions of the Link string, one contains ANSI characters, the other contains
//unicode characters.
//Both strings seem not to be standardized:
//The length prefix is a character count EXCLUDING the terminating zero
//Read the ANSI version
short
cch
=
reader
.
ReadInt16
();
unsigned
char
*
str
=
reader
.
ReadBytes
(
cch
,
true
);
FormatUtils
::
GetSTLCollectionFromBytes
<
std
::
wstring
>
(
&
this
->
Link
,
str
,
cch
,
ENCODING_WINDOWS_1250
);
RELEASEARRAYOBJECTS
(
str
);
//skip the terminating zero of the ANSI string
//even if the characters are ANSI chars, the terminating zero has 2 bytes
reader
.
ReadBytes
(
2
,
false
);
//skip the next 4 bytes (flags?)
reader
.
ReadBytes
(
4
,
false
);
//Read the Unicode version
this
->
Link
.
clear
();
cch
=
reader
.
ReadInt16
();
str
=
reader
.
ReadBytes
(
(
cch
*
2
),
true
);
FormatUtils
::
GetSTLCollectionFromBytes
<
std
::
wstring
>
(
&
this
->
Link
,
str
,
(
cch
*
2
),
ENCODING_UTF16
);
RELEASEARRAYOBJECTS
(
str
);
//skip the terminating zero of the Unicode string
reader
.
ReadBytes
(
2
,
false
);
delete
pLinkStream
;
}
}
catch
(...)
{
}
}
void
processEquationNativeStream
(
const
std
::
string
&
eqStream
)
{
try
{
POLE
::
Stream
*
pCompStream
=
NULL
;
HRESULT
res
=
S_OK
;
pCompStream
=
new
POLE
::
Stream
(
oleStorage
,
eqStream
);
if
(
pCompStream
)
{
VirtualStreamReader
reader
(
pCompStream
,
0
,
false
);
int
sz
=
reader
.
GetSize
();
unsigned
char
*
Buffer
=
reader
.
ReadBytes
(
sz
,
true
);
if
(
Buffer
&&
sz
>
0
)
{
isEquation
=
true
;
delete
[]
Buffer
;
}
delete
pCompStream
;
}
}
catch
(...)
{
}
}
void
processPICStream
(
const
std
::
string
&
picStream
)
{
try
{
HRESULT
res
=
S_OK
;
POLE
::
Stream
*
pPICStream
=
new
POLE
::
Stream
(
oleStorage
,
picStream
);
if
(
pPICStream
)
{
VirtualStreamReader
reader
(
pPICStream
,
0
,
false
);
int
sz
=
reader
.
GetSize
();
int
cbHeader
=
reader
.
ReadUInt32
();
reader
.
ReadBytes
(
4
,
false
);
int
x
=
reader
.
ReadUInt32
();
int
y
=
reader
.
ReadUInt32
();
pictureDesciptor
.
dyaGoal
=
reader
.
ReadUInt32
();
pictureDesciptor
.
dxaGoal
=
reader
.
ReadUInt32
();
reader
.
ReadBytes
(
20
,
false
);
pictureDesciptor
.
mx
=
reader
.
ReadUInt32
();
pictureDesciptor
.
my
=
reader
.
ReadUInt32
();
}
}
catch
(...)
{
}
}
void
processCompObjStream
(
const
std
::
string
&
compStream
)
{
try
{
HRESULT
res
=
S_OK
;
POLE
::
Stream
*
pCompStream
=
new
POLE
::
Stream
(
oleStorage
,
compStream
);
if
(
pCompStream
)
{
VirtualStreamReader
reader
(
pCompStream
,
0
,
false
);
//skip the CompObjHeader
reader
.
ReadBytes
(
28
,
false
);
int
sz_obj
=
reader
.
GetSize
()
-
reader
.
GetPosition
();
if
(
sz_obj
>
4
)
{
UserType
=
reader
.
ReadLengthPrefixedAnsiString
(
sz_obj
);
sz_obj
=
reader
.
GetSize
()
-
reader
.
GetPosition
();
if
(
sz_obj
>
4
)
ClipboardFormat
=
reader
.
ReadLengthPrefixedAnsiString
(
sz_obj
);
sz_obj
=
reader
.
GetSize
()
-
reader
.
GetPosition
();
if
(
sz_obj
>
4
)
Program
=
reader
.
ReadLengthPrefixedAnsiString
(
sz_obj
);
}
delete
pCompStream
;
}
}
catch
(...)
{
}
}
void
processOleStream
(
const
std
::
string
&
oleStreamName
)
{
try
{
POLE
::
Stream
*
pOleStream
;
HRESULT
res
=
S_OK
;
pOleStream
=
new
POLE
::
Stream
(
oleStorage
,
oleStreamName
);
if
(
pOleStream
)
{
VirtualStreamReader
reader
(
pOleStream
,
0
,
false
);
//skip version
reader
.
ReadBytes
(
4
,
false
);
//read the embedded/linked flag
int
flag
=
reader
.
ReadInt32
();
bLinked
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x1
);
//Link update option
this
->
updateMode
=
(
LinkUpdateOption
)
reader
.
ReadInt32
();
switch
(
this
->
updateMode
)
{
case
NoLink
:
{
this
->
UpdateMode
=
_T
(
"NoLink"
);
}
break
;
case
Always
:
{
this
->
UpdateMode
=
_T
(
"Always"
);
}
break
;
case
OnCall
:
{
this
->
UpdateMode
=
_T
(
"OnCall"
);
}
break
;
}
delete
pOleStream
;
}
}
catch
(...)
{
}
}
std
::
wstring
getOleEntryName
(
const
CharacterPropertyExceptions
*
chpx
)
{
std
::
wstring
ret
;
if
(
chpx
!=
NULL
)
{
for
(
std
::
list
<
SinglePropertyModifier
>::
const_iterator
iter
=
chpx
->
grpprl
->
begin
();
iter
!=
chpx
->
grpprl
->
end
();
iter
++
)
{
if
(
iter
->
OpCode
==
sprmCPicLocation
||
iter
->
OpCode
==
sprmOldCPicLocation
)
{
ret
=
(
_T
(
"_"
)
+
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToUInt32
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
)
);
break
;
}
}
}
return
ret
;
}
};
}
}
ASCOfficeDocFile/DocDocxConverter/Tbkd.h
View file @
ea5ebe72
...
@@ -96,6 +96,8 @@ namespace DocFileFormat
...
@@ -96,6 +96,8 @@ namespace DocFileFormat
{
{
friend
class
TextboxMapping
;
friend
class
TextboxMapping
;
public:
public:
static
const
int
STRUCTURE_SIZE
=
22
;
struct
FTXBXSReusable
struct
FTXBXSReusable
{
{
int
iNextReuse
;
int
iNextReuse
;
...
@@ -108,8 +110,6 @@ namespace DocFileFormat
...
@@ -108,8 +110,6 @@ namespace DocFileFormat
int
cTxbxEdit
;
// This value MUST be zero and MUST be ignored.
int
cTxbxEdit
;
// This value MUST be zero and MUST be ignored.
};
};
static
const
int
STRUCTURE_SIZE
=
22
;
FTXBXS
()
FTXBXS
()
{
{
...
...
ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp
View file @
ea5ebe72
...
@@ -69,7 +69,7 @@ namespace DocFileFormat
...
@@ -69,7 +69,7 @@ namespace DocFileFormat
m_pCaller
=
pCaller
;
m_pCaller
=
pCaller
;
m_pBlipStore
=
NULL
;
m_pBlipStore
=
NULL
;
m_c
tx
=
pConv
;
m_c
ontext
=
pConv
;
m_pict
=
pPicture
;
m_pict
=
pPicture
;
m_nImageId
=
0
;
m_nImageId
=
0
;
...
@@ -81,9 +81,9 @@ namespace DocFileFormat
...
@@ -81,9 +81,9 @@ namespace DocFileFormat
m_textpath
=
XMLTools
::
XMLElement
<
wchar_t
>
(
L"v:textpath"
);
m_textpath
=
XMLTools
::
XMLElement
<
wchar_t
>
(
L"v:textpath"
);
Record
*
recBs
=
NULL
;
Record
*
recBs
=
NULL
;
if
((
m_c
tx
)
&&
(
m_ctx
->
_doc
))
if
((
m_c
ontext
)
&&
(
m_context
->
_doc
))
{
{
OfficeArtContent
*
officeArt
=
m_c
tx
->
_doc
->
GetOfficeArt
();
OfficeArtContent
*
officeArt
=
m_c
ontext
->
_doc
->
GetOfficeArt
();
if
(
officeArt
)
if
(
officeArt
)
{
{
const
DrawingGroup
*
group
=
officeArt
->
GetDrawingGroup
();
const
DrawingGroup
*
group
=
officeArt
->
GetDrawingGroup
();
...
@@ -182,7 +182,7 @@ namespace DocFileFormat
...
@@ -182,7 +182,7 @@ namespace DocFileFormat
ShapeContainer
*
pChildShape
=
static_cast
<
ShapeContainer
*>
(
container
->
Children
[
i
]);
ShapeContainer
*
pChildShape
=
static_cast
<
ShapeContainer
*>
(
container
->
Children
[
i
]);
if
(
pChildShape
)
if
(
pChildShape
)
{
{
VMLShapeMapping
vmlShapeMapping
(
m_c
tx
,
m_pXmlWriter
,
m_pSpa
,
NULL
,
m_pCaller
);
VMLShapeMapping
vmlShapeMapping
(
m_c
ontext
,
m_pXmlWriter
,
m_pSpa
,
NULL
,
m_pCaller
);
pChildShape
->
Convert
(
&
vmlShapeMapping
);
pChildShape
->
Convert
(
&
vmlShapeMapping
);
}
}
}
}
...
@@ -215,806 +215,826 @@ namespace DocFileFormat
...
@@ -215,806 +215,826 @@ namespace DocFileFormat
/// Converts a single shape
/// Converts a single shape
void
VMLShapeMapping
::
WriteShape
(
const
ShapeContainer
*
pContainer
)
void
VMLShapeMapping
::
WriteShape
(
const
ShapeContainer
*
pContainer
)
{
{
if
((
NULL
!=
pContainer
)
&&
(
!
pContainer
->
Children
.
empty
()))
if
((
NULL
==
pContainer
)
||
(
pContainer
->
Children
.
empty
()))
return
;
{
Shape
*
pShape
=
static_cast
<
Shape
*>
(
pContainer
->
Children
[
0
]);
if
(
pShape
)
{
bool
freeform
=
true
;
std
::
list
<
OptionEntry
>
options
=
pContainer
->
ExtractOptions
();
Shape
*
pShape
=
static_cast
<
Shape
*>
(
pContainer
->
Children
[
0
]);
ChildAnchor
*
pAnchor
=
pContainer
->
FirstChildWithType
<
ChildAnchor
>
();
if
(
!
pShape
)
return
;
ClientAnchor
*
clientAnchor
=
pContainer
->
FirstChildWithType
<
ClientAnchor
>
();
int
indexOLE
=
-
1
;
bool
freeform
=
true
;
std
::
wstring
sShapeId
;
WriteBeginShapeNode
(
pShape
);
std
::
list
<
OptionEntry
>
options
=
pContainer
->
ExtractOptions
();
ChildAnchor
*
pAnchor
=
pContainer
->
FirstChildWithType
<
ChildAnchor
>
();
ClientAnchor
*
clientAnchor
=
pContainer
->
FirstChildWithType
<
ClientAnchor
>
();
m_pXmlWriter
->
WriteAttribute
(
L"id"
,
GetShapeID
(
pShape
).
c_str
()
);
WriteBeginShapeNode
(
pShape
);
if
(
pShape
->
GetShapeType
()
&&
!
pShape
->
fBackground
)
sShapeId
=
GetShapeID
(
pShape
);
{
m_pXmlWriter
->
WriteAttribute
(
L"id"
,
sShapeId
);
freeform
=
false
;
m_pXmlWriter
->
WriteAttribute
(
L"type"
,
(
std
::
wstring
(
L"#"
)
+
VMLShapeTypeMapping
::
GenerateTypeId
(
pShape
->
GetShapeType
())).
c_str
());
}
m_pXmlWriter
->
WriteAttribute
(
L"style"
,
FormatUtils
::
XmlEncode
(
buildStyle
(
pShape
,
pAnchor
,
options
,
pContainer
->
Index
)).
c_str
());
if
(
!
pShape
->
fBackground
)
{
if
(
pShape
->
GetShapeType
())
{
freeform
=
false
;
m_pXmlWriter
->
WriteAttribute
(
L"type"
,
(
std
::
wstring
(
L"#"
)
+
VMLShapeTypeMapping
::
GenerateTypeId
(
pShape
->
GetShapeType
())).
c_str
());
if
(
pShape
->
is
<
LineType
>
())
m_pXmlWriter
->
WriteAttribute
(
L"style"
,
FormatUtils
::
XmlEncode
(
buildStyle
(
pShape
,
pAnchor
,
options
,
pContainer
->
Index
)).
c_str
());
{
}
//append "from" and "to" attributes
m_pXmlWriter
->
WriteAttribute
(
L"from"
,
GetLineFrom
(
pAnchor
).
c_str
());
m_pXmlWriter
->
WriteAttribute
(
L"to"
,
GetLineTo
(
pAnchor
).
c_str
());
}
if
(
m_isBullete
)
if
(
pShape
->
is
<
LineType
>
())
{
{
m_pXmlWriter
->
WriteAttribute
(
L"o:bullet"
,
L"t"
);
//append "from" and "to" attributes
}
m_pXmlWriter
->
WriteAttribute
(
L"from"
,
GetLineFrom
(
pAnchor
).
c_str
());
m_pXmlWriter
->
WriteAttribute
(
L"to"
,
GetLineTo
(
pAnchor
).
c_str
());
}
if
(
m_isBullete
)
EmuValue
ShadowOffsetX
;
{
EmuValue
ShadowOffsetY
;
m_pXmlWriter
->
WriteAttribute
(
L"o:bullet"
,
L"t"
);
EmuValue
SecondShadowOffsetX
;
}
EmuValue
SecondShadowOffsetY
;
}
EmuValue
ViewPointX
;
EmuValue
ViewPointY
;
EmuValue
ViewPointZ
;
double
viewPointOriginX
=
0
;
double
viewPointOriginY
=
0
;
double
ShadowOriginX
=
0
;
double
ShadowOriginY
=
0
;
unsigned
int
xCoord
=
0
;
unsigned
int
yCoord
=
0
;
bool
stroked
=
true
;
bool
filled
=
true
;
bool
hasTextbox
=
false
;
bool
layoutInCell
=
true
;
//anmeldebogenfos.doc
int
ndxTextLeft
=
-
1
;
int
ndyTextTop
=
-
1
;
int
ndxTextRight
=
-
1
;
int
ndyTextBottom
=
-
1
;
bool
bHavePath
=
false
;
EmuValue
ShadowOffsetX
;
int
nAdjValues
=
0
;
EmuValue
ShadowOffsetY
;
int
nLTxID
=
-
1
;
EmuValue
SecondShadowOffsetX
;
EmuValue
SecondShadowOffsetY
;
EmuValue
ViewPointX
;
EmuValue
ViewPointY
;
EmuValue
ViewPointZ
;
double
viewPointOriginX
=
0
;
double
viewPointOriginY
=
0
;
double
ShadowOriginX
=
0
;
double
ShadowOriginY
=
0
;
unsigned
int
xCoord
=
0
;
unsigned
int
yCoord
=
0
;
bool
stroked
=
true
;
bool
filled
=
true
;
bool
hasTextbox
=
false
;
bool
layoutInCell
=
true
;
//anmeldebogenfos.doc
int
ndxTextLeft
=
-
1
;
int
ndyTextTop
=
-
1
;
int
ndxTextRight
=
-
1
;
int
ndyTextBottom
=
-
1
;
std
::
wstring
sTextboxStyle
;
bool
bHavePath
=
false
;
int
nAdjValues
=
0
;
std
::
wstring
adjValues
[
8
];
int
nLTxID
=
-
1
;
ShadowStyleBooleanProperties
shadowBoolean
(
0
);
std
::
vector
<
std
::
wstring
>
arrInscribe
;
std
::
list
<
OptionEntry
>::
const_iterator
end
=
options
.
end
();
std
::
wstring
sTextboxStyle
;
for
(
std
::
list
<
OptionEntry
>::
const_iterator
iter
=
options
.
begin
();
iter
!=
end
;
++
iter
)
std
::
wstring
adjValues
[
8
];
ShadowStyleBooleanProperties
shadowBoolean
(
0
);
std
::
vector
<
std
::
wstring
>
arrInscribe
;
std
::
list
<
OptionEntry
>::
const_iterator
end
=
options
.
end
();
for
(
std
::
list
<
OptionEntry
>::
const_iterator
iter
=
options
.
begin
();
iter
!=
end
;
++
iter
)
{
switch
(
iter
->
pid
)
{
//BOOLEANS
case
geometryBooleans
:
{
{
switch
(
iter
->
pid
)
GeometryBooleanProperties
booleans
(
iter
->
op
);
if
(
booleans
.
fUsefLineOK
&&
!
booleans
.
fLineOK
)
{
{
//BOOLEANS
stroked
=
false
;
case
geometryBooleans
:
}
{
GeometryBooleanProperties
booleans
(
iter
->
op
);
if
(
booleans
.
fUsefLineOK
&&
!
booleans
.
fLineOK
)
{
stroked
=
false
;
}
if
(
booleans
.
fUsefFillOK
&&
!
booleans
.
fFillOK
)
{
filled
=
false
;
}
}
break
;
case
fillStyleBooleanProperties
:
{
FillStyleBooleanProperties
booleans
(
iter
->
op
);
if
(
booleans
.
fUsefFilled
&&
!
booleans
.
fFilled
)
{
filled
=
false
;
}
}
break
;
case
lineStyleBooleans
:
{
LineStyleBooleanProperties
booleans
(
iter
->
op
);
if
(
booleans
.
fUsefLine
&&
!
booleans
.
fLine
)
{
stroked
=
false
;
}
}
break
;
case
protectionBooleans
:
{
ProtectionBooleanProperties
booleans
(
iter
->
op
);
}
break
;
case
diagramBooleans
:
{
DiagramBooleanProperties
booleans
(
iter
->
op
);
}
break
;
case
groupShapeBooleans
:
{
GroupShapeBooleanProperties
booleans
(
iter
->
op
);
if
(
booleans
.
fUsefLayoutInCell
)
{
layoutInCell
=
booleans
.
fLayoutInCell
;
}
}
break
;
// GEOMETRY
case
adjustValue
:
{
adjValues
[
0
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
1
);
}
break
;
case
adjust2Value
:
{
adjValues
[
1
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
2
);
}
break
;
case
adjust3Value
:
{
adjValues
[
2
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
3
);
}
break
;
case
adjust4Value
:
{
adjValues
[
3
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
4
);
}
break
;
case
adjust5Value
:
{
adjValues
[
4
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
5
);
}
break
;
case
adjust6Value
:
{
adjValues
[
5
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
6
);
}
break
;
case
adjust7Value
:
{
adjValues
[
6
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
7
);
}
break
;
case
adjust8Value
:
{
adjValues
[
7
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
8
);
}
break
;
case
pWrapPolygonVertices
:
{
std
::
wstring
wrapCoords
=
getWrapCoords
(
*
iter
);
if
(
!
wrapCoords
.
empty
())
{
m_pXmlWriter
->
WriteAttribute
(
L"wrapcoords"
,
wrapCoords
.
c_str
()
);
}
}
break
;
case
geoRight
:
{
xCoord
=
iter
->
op
;
}
break
;
case
geoBottom
:
{
yCoord
=
iter
->
op
;
}
break
;
case
pGuides
:
{
}
break
;
case
pInscribe
:
{
arrInscribe
=
GetTextRectangles
(
*
iter
);
}
break
;
// OUTLINE
case
lineColor
:
{
RGBColor
lineColor
((
int
)
iter
->
op
,
RedFirst
);
m_pXmlWriter
->
WriteAttribute
(
L"strokecolor"
,
(
std
::
wstring
(
L"#"
)
+
lineColor
.
SixDigitHexCode
).
c_str
());
}
break
;
case
lineWidth
:
{
if
(
iter
->
op
>
0
)
{
EmuValue
eLineWidth
((
int
)
iter
->
op
);
m_pXmlWriter
->
WriteAttribute
(
L"strokeweight"
,
FormatUtils
::
DoubleToWideString
(
eLineWidth
.
ToPoints
())
+
L"pt"
);
}
}
break
;
case
lineDashing
:
{
appendValueAttribute
(
&
m_stroke
,
L"dashstyle"
,
FormatUtils
::
MapValueToWideString
(
iter
->
op
,
&
Global
::
DashStyleMap
[
0
][
0
],
11
,
16
).
c_str
()
);
}
break
;
case
lineStyle
:
{
appendValueAttribute
(
&
m_stroke
,
L"linestyle"
,
getLineStyle
(
iter
->
op
).
c_str
());
}
break
;
case
lineEndArrowhead
:
{
appendValueAttribute
(
&
m_stroke
,
L"endarrow"
,
getArrowStyle
(
iter
->
op
).
c_str
());
}
break
;
case
lineEndArrowLength
:
{
appendValueAttribute
(
&
m_stroke
,
L"endarrowlength"
,
getArrowLength
(
iter
->
op
).
c_str
());
}
break
;
case
lineEndArrowWidth
:
{
appendValueAttribute
(
&
m_stroke
,
L"endarrowwidth"
,
getArrowWidth
(
iter
->
op
).
c_str
());
}
break
;
case
lineStartArrowhead
:
{
appendValueAttribute
(
&
m_stroke
,
L"startarrow"
,
getArrowStyle
(
iter
->
op
).
c_str
());
}
break
;
case
lineStartArrowLength
:
{
appendValueAttribute
(
&
m_stroke
,
L"startarrowlength"
,
getArrowLength
(
iter
->
op
).
c_str
());
}
break
;
case
lineStartArrowWidth
:
{
appendValueAttribute
(
&
m_stroke
,
L"startarrowwidth"
,
getArrowWidth
(
iter
->
op
).
c_str
());
}
break
;
// FILL
case
fillColor
:
{
RGBColor
fillColor
((
int
)
iter
->
op
,
RedFirst
);
m_pXmlWriter
->
WriteAttribute
(
L"fillcolor"
,
(
std
::
wstring
(
L"#"
)
+
fillColor
.
SixDigitHexCode
).
c_str
());
}
break
;
case
fillBackColor
:
{
RGBColor
fillBackColor
(
(
int
)
iter
->
op
,
RedFirst
);
appendValueAttribute
(
&
m_fill
,
L"color2"
,
(
std
::
wstring
(
L"#"
)
+
fillBackColor
.
SixDigitHexCode
).
c_str
());
}
break
;
case
fillAngle
:
{
FixedPointNumber
fllAngl
(
iter
->
op
);
appendValueAttribute
(
&
m_fill
,
L"angle"
,
FormatUtils
::
DoubleToWideString
(
fllAngl
.
ToAngle
()
).
c_str
());
}
break
;
case
fillShadeType
:
{
appendValueAttribute
(
&
m_fill
,
L"method"
,
getFillMethod
(
iter
->
op
).
c_str
());
}
break
;
case
fillShadeColors
:
{
appendValueAttribute
(
&
m_fill
,
L"colors"
,
getFillColorString
(
iter
->
opComplex
,
iter
->
op
).
c_str
());
}
break
;
case
fillFocus
:
{
appendValueAttribute
(
&
m_fill
,
L"focus"
,
(
FormatUtils
::
IntToWideString
(
iter
->
op
)
+
L"%"
).
c_str
());
}
break
;
case
fillType
:
{
appendValueAttribute
(
&
m_fill
,
L"type"
,
getFillType
(
iter
->
op
).
c_str
());
}
break
;
case
fillBlip
:
{
BlipStoreEntry
*
pFillBlip
=
NULL
;
if
((
m_pict
!=
NULL
)
&&
(
m_pict
->
blipStoreEntry
!=
NULL
))
{
// Word Art Texture
//fillBlip = this->_pict->BlipStoreEntry;
}
else
if
(
(
m_pBlipStore
!=
NULL
)
&&
(
(
iter
->
op
-
1
)
<
m_pBlipStore
->
Children
.
size
()
)
)
{
pFillBlip
=
static_cast
<
BlipStoreEntry
*>
(
m_pBlipStore
->
Children
[
iter
->
op
-
1
]);
}
if
(
(
pFillBlip
!=
NULL
)
&&
copyPicture
(
pFillBlip
)
)
{
appendValueAttribute
(
&
m_fill
,
L"r:id"
,
std
::
wstring
((
L"rId"
)
+
FormatUtils
::
IntToWideString
(
m_nImageId
)
).
c_str
());
}
}
break
;
case
fillOpacity
:
{
appendValueAttribute
(
&
m_fill
,
L"opacity"
,
(
FormatUtils
::
IntToWideString
(
iter
->
op
)
+
L"f"
).
c_str
());
}
break
;
case
fillBackOpacity
:
{
appendValueAttribute
(
&
m_fill
,
L"opacity2"
,
(
FormatUtils
::
IntToWideString
(
iter
->
op
)
+
L"f"
).
c_str
());
}
break
;
// SHADOW
case
shadowType
:
{
appendValueAttribute
(
&
m_shadow
,
L"type"
,
getShadowType
(
iter
->
op
).
c_str
());
}
break
;
case
shadowColor
:
{
RGBColor
shadowColor
((
int
)
iter
->
op
,
RedFirst
);
appendValueAttribute
(
&
m_shadow
,
L"color"
,
(
std
::
wstring
(
L"#"
)
+
shadowColor
.
SixDigitHexCode
).
c_str
());
}
break
;
case
shadowOffsetX
:
{
ShadowOffsetX
=
EmuValue
(
(
int
)
iter
->
op
);
}
break
;
case
shadowSecondOffsetX
:
{
SecondShadowOffsetX
=
EmuValue
(
(
int
)
iter
->
op
);
}
break
;
case
shadowOffsetY
:
{
ShadowOffsetY
=
EmuValue
(
(
int
)
iter
->
op
);
}
break
;
case
shadowSecondOffsetY
:
{
SecondShadowOffsetY
=
EmuValue
(
(
int
)
iter
->
op
);
}
break
;
case
shadowOriginX
:
{
ShadowOriginX
=
(
iter
->
op
/
pow
(
(
double
)
2
,
(
double
)
16
)
);
}
break
;
case
shadowOriginY
:
{
ShadowOriginY
=
(
iter
->
op
/
pow
(
(
double
)
2
,
(
double
)
16
));
}
break
;
case
shadowOpacity
:
{
double
shadowOpa
=
(
iter
->
op
/
pow
(
(
double
)
2
,
(
double
)
16
));
appendValueAttribute
(
&
m_shadow
,
L"opacity"
,
FormatUtils
::
DoubleToFormattedWideString
(
shadowOpa
,
L"%.2f"
).
c_str
());
}
break
;
case
shadowStyleBooleanProperties
:
{
shadowBoolean
=
ShadowStyleBooleanProperties
(
iter
->
op
);
}
break
;
// PICTURE
case
Pib
:
{
int
index
=
(
int
)(
iter
->
op
-
1
);
if
((
m_pBlipStore
!=
NULL
)
&&
(
index
<
(
int
)
m_pBlipStore
->
Children
.
size
()))
{
BlipStoreEntry
*
oBlip
=
static_cast
<
BlipStoreEntry
*>
(
m_pBlipStore
->
Children
[
index
]);
if
(
copyPicture
(
oBlip
))
{
appendValueAttribute
(
&
m_imagedata
,
L"r:id"
,
(
std
::
wstring
(
L"rId"
)
+
FormatUtils
::
IntToWideString
(
m_nImageId
)
).
c_str
());
}
}
}
break
;
case
pibName
:
{
std
::
wstring
name
;
FormatUtils
::
GetSTLCollectionFromBytes
<
std
::
wstring
>
(
&
name
,
iter
->
opComplex
,
iter
->
op
,
ENCODING_UTF16
);
if
(
!
name
.
empty
())
appendValueAttribute
(
&
m_imagedata
,
L"o:title"
,
FormatUtils
::
XmlEncode
(
name
).
c_str
());
}
break
;
// 3D STYLE
case
f3D
:
case
threeDStyleBooleanProperties
:
case
threeDObjectBooleanProperties
:
break
;
case
c3DExtrudeBackward
:
{
EmuValue
backwardValue
(
(
int
)
iter
->
op
);
std
::
wstring
depth
=
FormatUtils
::
DoubleToWideString
(
backwardValue
.
ToPoints
()
)
+
L"pt"
;
appendValueAttribute
(
&
m_3dstyle
,
L"backdepth"
,
depth
.
c_str
());
}
break
;
case
c3DAmbientIntensity
:
{
std
::
wstring
intens
=
FormatUtils
::
IntToWideString
((
int
)
iter
->
op
)
+
L"f"
;
appendValueAttribute
(
&
m_3dstyle
,
L"brightness"
,
intens
.
c_str
());
}
break
;
case
c3DSpecularAmt
:
{
std
::
wstring
amt
=
FormatUtils
::
IntToWideString
((
int
)
iter
->
op
)
+
L"f"
;
appendValueAttribute
(
&
m_3dstyle
,
L"specularity"
,
amt
.
c_str
());
}
break
;
case
c3DDiffuseAmt
:
{
std
::
wstring
amt
=
FormatUtils
::
IntToWideString
((
int
)
iter
->
op
)
+
L"f"
;
appendValueAttribute
(
&
m_3dstyle
,
L"diffusity"
,
amt
.
c_str
());
}
break
;
case
c3DKeyIntensity
:
{
std
::
wstring
amt
=
FormatUtils
::
IntToWideString
((
int
)
iter
->
op
);
appendValueAttribute
(
&
m_3dstyle
,
L"lightlevel"
,
amt
.
c_str
());
}
break
;
case
c3DExtrusionColor
:
{
std
::
wstring
color
=
FormatUtils
::
IntToFormattedWideString
(
iter
->
op
,
L"#%06x"
);
appendValueAttribute
(
&
m_3dstyle
,
L"color"
,
color
.
c_str
());
}
break
;
case
c3DSkewAngle
:
{
FixedPointNumber
skewAngle
(
iter
->
op
);
appendValueAttribute
(
&
m_3dstyle
,
L"skewangle"
,
FormatUtils
::
DoubleToWideString
(
skewAngle
.
ToAngle
()
).
c_str
());
}
break
;
case
c3DXViewpoint
:
{
ViewPointX
=
EmuValue
(
FixedPointNumber
(
iter
->
op
).
Integral
);
}
break
;
case
c3DYViewpoint
:
{
ViewPointY
=
EmuValue
(
FixedPointNumber
(
iter
->
op
).
Integral
);
}
break
;
case
c3DZViewpoint
:
{
ViewPointZ
=
EmuValue
(
FixedPointNumber
(
iter
->
op
).
Integral
);
}
break
;
case
c3DOriginX
:
{
FixedPointNumber
dOriginX
(
iter
->
op
);
viewPointOriginX
=
(
dOriginX
.
Integral
/
65536.0
);
}
break
;
case
c3DOriginY
:
{
FixedPointNumber
dOriginY
(
iter
->
op
);
viewPointOriginY
=
(
dOriginY
.
Integral
/
65536.0
);
}
break
;
// TEXTBOX
case
lTxid
:
{
hasTextbox
=
true
;
nLTxID
=
(((
iter
->
op
)
>>
16
)
&
0xFFFF
);
}
break
;
case
dxTextLeft
:
{
ndxTextLeft
=
(
int
)
iter
->
op
;
break
;}
case
dyTextTop
:
{
ndyTextTop
=
(
int
)
iter
->
op
;
break
;}
case
dxTextRight
:
{
ndxTextRight
=
(
int
)
iter
->
op
;
break
;}
case
dyTextBottom
:
{
ndyTextBottom
=
(
int
)
iter
->
op
;
break
;}
case
txflTextFlow
:
{
switch
(
iter
->
op
)
{
case
0
:
case
4
:
//обычный
break
;
case
1
:
case
5
:
//верт (склони голову направо)
appendStyleProperty
(
&
sTextboxStyle
,
L"layout-flow"
,
L"vertical"
);
break
;
case
2
:
//верт (склони голову налево)
appendStyleProperty
(
&
sTextboxStyle
,
L"layout-flow"
,
L"vertical"
);
appendStyleProperty
(
&
sTextboxStyle
,
L"mso-layout-flow-alt"
,
L"bottom-to-top"
);
break
;
}
}
break
;
// Word Art
case
gtextUNICODE
:
{
std
::
wstring
text
=
NSStringExt
::
CConverter
::
GetUnicodeFromUTF16
((
unsigned
short
*
)
iter
->
opComplex
,
(
iter
->
op
)
/
2
);
text
=
FormatUtils
::
XmlEncode
(
text
);
if
(
0
<=
text
.
find
(
L"
\n
"
))
{
m_textpath
.
AppendText
(
text
.
c_str
());
}
text
=
ReplaceString
(
text
,
L"
\n
"
,
L"
"
);
appendValueAttribute
(
&
m_textpath
,
L"string"
,
text
.
c_str
());
}
break
;
case
gtextFont
:
{
std
::
wstring
font
=
NSStringExt
::
CConverter
::
GetUnicodeFromUTF16
((
unsigned
short
*
)
iter
->
opComplex
,
(
iter
->
op
)
/
2
);
int
i
=
font
.
size
();
while
(
i
>
0
)
{
if
(
font
[
i
-
1
]
!=
0
)
break
;
i
--
;
}
if
(
i
<
font
.
size
())
font
.
erase
(
font
.
begin
()
+
i
,
font
.
end
());
font
=
std
::
wstring
(
L"
\"
"
)
+
font
+
std
::
wstring
(
L"
\"
"
);
appendStyleProperty
(
&
m_textPathStyle
,
L"font-family"
,
font
);
}
break
;
case
gtextSize
:
{
std
::
wstring
fontSize
=
FormatUtils
::
IntToWideString
(
iter
->
op
/
65535
);
appendStyleProperty
(
&
m_textPathStyle
,
L"font-size"
,
fontSize
+
L"pt"
);
}
break
;
case
gtextSpacing
:
{
std
::
wstring
spacing
=
FormatUtils
::
IntToWideString
(
iter
->
op
);
appendStyleProperty
(
&
m_textPathStyle
,
L"v-text-spacing"
,
spacing
+
L"f"
);
}
break
;
case
geometryTextBooleanProperties
:
{
GeometryTextBooleanProperties
props
(
iter
->
op
);
if
(
props
.
fUsegtextFBestFit
&&
props
.
gtextFBestFit
)
{
appendValueAttribute
(
&
m_textpath
,
L"fitshape"
,
L"t"
);
}
if
(
props
.
fUsegtextFShrinkFit
&&
props
.
gtextFShrinkFit
)
{
appendValueAttribute
(
&
m_textpath
,
L"trim"
,
L"t"
);
}
if
(
props
.
fUsegtextFVertical
&&
props
.
gtextFVertical
)
{
appendStyleProperty
(
&
m_textPathStyle
,
L"v-rotate-letters"
,
L"t"
);
//_twistDimension = true;
}
if
(
props
.
fUsegtextFKern
&&
props
.
gtextFKern
)
{
appendStyleProperty
(
&
m_textPathStyle
,
L"v-text-kern"
,
L"t"
);
}
if
(
props
.
fUsegtextFItalic
&&
props
.
gtextFItalic
)
{
appendStyleProperty
(
&
m_textPathStyle
,
L"font-style"
,
L"italic"
);
}
if
(
props
.
fUsegtextFBold
&&
props
.
gtextFBold
)
{
appendStyleProperty
(
&
m_textPathStyle
,
L"font-weight"
,
L"bold"
);
}
}
break
;
// PATH
case
shapePath
:
{
bHavePath
=
true
;
std
::
wstring
path
=
ParsePath
(
options
);
if
(
false
==
path
.
empty
())
if
(
booleans
.
fUsefFillOK
&&
!
booleans
.
fFillOK
)
m_pXmlWriter
->
WriteAttribute
(
L"path"
,
path
.
c_str
());
{
}
break
;
filled
=
false
;
default:
{
int
val
=
iter
->
op
;
}
break
;
}
}
}
}
break
;
if
(
false
==
bHavePath
)
// фигура может быть задана только наборами вершин и индексов
case
fillStyleBooleanProperties
:
{
{
std
::
wstring
path
=
ParsePath
(
options
);
FillStyleBooleanProperties
booleans
(
iter
->
op
);
if
(
booleans
.
fUsefFilled
&&
!
booleans
.
fFilled
)
if
(
false
==
path
.
empty
())
{
m_pXmlWriter
->
WriteAttribute
(
L"path"
,
path
.
c_str
());
filled
=
false
;
}
}
break
;
case
lineStyleBooleans
:
{
LineStyleBooleanProperties
booleans
(
iter
->
op
);
if
(
booleans
.
fUsefLine
&&
!
booleans
.
fLine
)
{
stroked
=
false
;
}
}
}
break
;
if
(
!
filled
)
case
protectionBooleans
:
{
{
m_pXmlWriter
->
WriteAttribute
(
L"filled"
,
L"f"
);
ProtectionBooleanProperties
booleans
(
iter
->
op
);
}
}
break
;
if
(
!
stroked
)
case
diagramBooleans
:
{
{
m_pXmlWriter
->
WriteAttribute
(
L"stroked"
,
L"f"
);
DiagramBooleanProperties
booleans
(
iter
->
op
);
}
}
break
;
if
(
!
layoutInCell
)
case
groupShapeBooleans
:
{
{
m_pXmlWriter
->
WriteAttribute
(
L"o:allowincell"
,
L"f"
);
GroupShapeBooleanProperties
booleans
(
iter
->
op
);
if
(
booleans
.
fUsefLayoutInCell
)
{
layoutInCell
=
booleans
.
fLayoutInCell
;
}
}
}
break
;
if
(
(
xCoord
>
0
)
&&
(
yCoord
>
0
)
)
// GEOMETRY
case
adjustValue
:
{
{
m_pXmlWriter
->
WriteAttribute
(
L"coordsize"
,
(
FormatUtils
::
IntToWideString
(
xCoord
)
+
L","
+
FormatUtils
::
IntToWideString
(
yCoord
)
).
c_str
()
);
adjValues
[
0
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
1
);
}
}
break
;
int
nCode
=
0
;
case
adjust2Value
:
if
(
pShape
->
GetShapeType
())
{
{
nCode
=
pShape
->
GetShapeType
()
->
GetTypeCode
();
adjValues
[
1
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
2
);
}
}
break
;
if
(
DocFileFormat
::
msosptRoundRectangle
==
nCode
)
case
adjust3Value
:
{
adjValues
[
2
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
3
);
}
break
;
case
adjust4Value
:
{
{
if
(
nAdjValues
)
adjValues
[
3
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
4
);
}
break
;
case
adjust5Value
:
{
adjValues
[
4
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
5
);
}
break
;
case
adjust6Value
:
{
adjValues
[
5
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
6
);
}
break
;
case
adjust7Value
:
{
adjValues
[
6
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
7
);
}
break
;
case
adjust8Value
:
{
adjValues
[
7
]
=
FormatUtils
::
IntToWideString
(
(
int
)
iter
->
op
);
nAdjValues
=
(
std
::
max
)(
nAdjValues
,
8
);
}
break
;
case
pWrapPolygonVertices
:
{
std
::
wstring
wrapCoords
=
getWrapCoords
(
*
iter
);
if
(
!
wrapCoords
.
empty
())
{
{
m_pXmlWriter
->
WriteAttribute
(
L"arcsize"
,
adjValues
[
0
].
c_str
()
);
m_pXmlWriter
->
WriteAttribute
(
L"wrapcoords"
,
wrapCoords
.
c_str
()
);
}
}
}
}
break
;
else
case
geoRight
:
{
{
if
(
nAdjValues
)
xCoord
=
iter
->
op
;
}
break
;
case
geoBottom
:
{
yCoord
=
iter
->
op
;
}
break
;
case
pGuides
:
{
}
break
;
case
pInscribe
:
{
arrInscribe
=
GetTextRectangles
(
*
iter
);
}
break
;
// OUTLINE
case
lineColor
:
{
RGBColor
lineColor
((
int
)
iter
->
op
,
RedFirst
);
if
(
!
pShape
->
fBackground
)
m_pXmlWriter
->
WriteAttribute
(
L"strokecolor"
,
(
std
::
wstring
(
L"#"
)
+
lineColor
.
SixDigitHexCode
).
c_str
());
}
break
;
case
lineWidth
:
{
if
(
iter
->
op
>
0
)
{
{
std
::
wstring
adjTag
=
adjValues
[
0
];
EmuValue
eLineWidth
((
int
)
iter
->
op
);
m_pXmlWriter
->
WriteAttribute
(
L"strokeweight"
,
FormatUtils
::
DoubleToWideString
(
eLineWidth
.
ToPoints
())
+
L"pt"
);
for
(
int
i
=
1
;
i
<
nAdjValues
;
++
i
)
adjTag
+=
std
::
wstring
(
L","
)
+
adjValues
[
i
];
m_pXmlWriter
->
WriteAttribute
(
L"adj"
,
adjTag
.
c_str
());
}
}
}
}
break
;
case
lineDashing
:
m_pXmlWriter
->
WriteNodeEnd
(
L""
,
true
,
false
);
{
appendValueAttribute
(
&
m_stroke
,
L"dashstyle"
,
FormatUtils
::
MapValueToWideString
(
iter
->
op
,
&
Global
::
DashStyleMap
[
0
][
0
],
11
,
16
).
c_str
()
);
}
break
;
case
lineStyle
:
{
appendValueAttribute
(
&
m_stroke
,
L"linestyle"
,
getLineStyle
(
iter
->
op
).
c_str
());
}
break
;
case
lineEndArrowhead
:
{
appendValueAttribute
(
&
m_stroke
,
L"endarrow"
,
getArrowStyle
(
iter
->
op
).
c_str
());
}
break
;
case
lineEndArrowLength
:
{
appendValueAttribute
(
&
m_stroke
,
L"endarrowlength"
,
getArrowLength
(
iter
->
op
).
c_str
());
}
break
;
case
lineEndArrowWidth
:
{
appendValueAttribute
(
&
m_stroke
,
L"endarrowwidth"
,
getArrowWidth
(
iter
->
op
).
c_str
());
}
break
;
case
lineStartArrowhead
:
{
appendValueAttribute
(
&
m_stroke
,
L"startarrow"
,
getArrowStyle
(
iter
->
op
).
c_str
());
}
break
;
case
lineStartArrowLength
:
{
appendValueAttribute
(
&
m_stroke
,
L"startarrowlength"
,
getArrowLength
(
iter
->
op
).
c_str
());
}
break
;
case
lineStartArrowWidth
:
{
appendValueAttribute
(
&
m_stroke
,
L"startarrowwidth"
,
getArrowWidth
(
iter
->
op
).
c_str
());
}
break
;
// FILL
case
fillColor
:
{
RGBColor
fillColor
((
int
)
iter
->
op
,
RedFirst
);
m_pXmlWriter
->
WriteAttribute
(
L"fillcolor"
,
(
std
::
wstring
(
L"#"
)
+
fillColor
.
SixDigitHexCode
).
c_str
());
}
break
;
case
fillBackColor
:
{
RGBColor
fillBackColor
(
(
int
)
iter
->
op
,
RedFirst
);
appendValueAttribute
(
&
m_fill
,
L"color2"
,
(
std
::
wstring
(
L"#"
)
+
fillBackColor
.
SixDigitHexCode
).
c_str
());
}
break
;
case
fillAngle
:
{
FixedPointNumber
fllAngl
(
iter
->
op
);
appendValueAttribute
(
&
m_fill
,
L"angle"
,
FormatUtils
::
DoubleToWideString
(
fllAngl
.
ToAngle
()
).
c_str
());
}
break
;
case
fillShadeType
:
{
appendValueAttribute
(
&
m_fill
,
L"method"
,
getFillMethod
(
iter
->
op
).
c_str
());
}
break
;
case
fillShadeColors
:
{
appendValueAttribute
(
&
m_fill
,
L"colors"
,
getFillColorString
(
iter
->
opComplex
,
iter
->
op
).
c_str
());
}
break
;
case
fillFocus
:
{
appendValueAttribute
(
&
m_fill
,
L"focus"
,
(
FormatUtils
::
IntToWideString
(
iter
->
op
)
+
L"%"
).
c_str
());
}
break
;
case
fillType
:
{
appendValueAttribute
(
&
m_fill
,
L"type"
,
getFillType
(
iter
->
op
).
c_str
());
}
break
;
case
fillBlip
:
{
BlipStoreEntry
*
pFillBlip
=
NULL
;
//build shadow offsets
if
((
m_pict
!=
NULL
)
&&
(
m_pict
->
blipStoreEntry
!=
NULL
))
std
::
wstring
offset
;
{
// Word Art Texture
//fillBlip = this->_pict->BlipStoreEntry;
}
else
if
(
(
m_pBlipStore
!=
NULL
)
&&
(
(
iter
->
op
-
1
)
<
m_pBlipStore
->
Children
.
size
()
)
)
{
pFillBlip
=
static_cast
<
BlipStoreEntry
*>
(
m_pBlipStore
->
Children
[
iter
->
op
-
1
]);
}
if
(
ShadowOffsetX
!=
0
)
if
(
(
pFillBlip
!=
NULL
)
&&
copyPicture
(
pFillBlip
)
)
{
appendValueAttribute
(
&
m_fill
,
L"r:id"
,
std
::
wstring
((
L"rId"
)
+
FormatUtils
::
IntToWideString
(
m_nImageId
)
).
c_str
());
}
}
break
;
case
fillOpacity
:
{
{
offset
+=
FormatUtils
::
DoubleToWideString
(
ShadowOffsetX
.
ToPoints
()
);
appendValueAttribute
(
&
m_fill
,
L"opacity"
,
(
FormatUtils
::
IntToWideString
(
iter
->
op
)
+
L"f"
).
c_str
());
offset
+=
L"pt"
;
}
}
if
(
ShadowOffsetY
!=
0
)
break
;
case
fillBackOpacity
:
{
{
offset
+=
L","
;
appendValueAttribute
(
&
m_fill
,
L"opacity2"
,
(
FormatUtils
::
IntToWideString
(
iter
->
op
)
+
L"f"
).
c_str
());
offset
+=
FormatUtils
::
DoubleToWideString
(
ShadowOffsetY
.
ToPoints
()
);
}
break
;
offset
+=
L"pt"
;
// SHADOW
}
case
shadowType
:
if
(
!
offset
.
empty
()
)
{
{
appendValueAttribute
(
&
m_shadow
,
L"
offset"
,
offset
.
c_str
());
appendValueAttribute
(
&
m_shadow
,
L"
type"
,
getShadowType
(
iter
->
op
)
.
c_str
());
}
}
break
;
std
::
wstring
offset2
;
case
shadowColor
:
{
RGBColor
shadowColor
((
int
)
iter
->
op
,
RedFirst
);
appendValueAttribute
(
&
m_shadow
,
L"color"
,
(
std
::
wstring
(
L"#"
)
+
shadowColor
.
SixDigitHexCode
).
c_str
());
}
break
;
case
shadowOffsetX
:
{
ShadowOffsetX
=
EmuValue
(
(
int
)
iter
->
op
);
}
break
;
case
shadowSecondOffsetX
:
{
SecondShadowOffsetX
=
EmuValue
(
(
int
)
iter
->
op
);
}
break
;
case
shadowOffsetY
:
{
ShadowOffsetY
=
EmuValue
(
(
int
)
iter
->
op
);
}
break
;
case
shadowSecondOffsetY
:
{
SecondShadowOffsetY
=
EmuValue
(
(
int
)
iter
->
op
);
}
break
;
case
shadowOriginX
:
{
ShadowOriginX
=
(
iter
->
op
/
pow
(
(
double
)
2
,
(
double
)
16
)
);
}
break
;
case
shadowOriginY
:
{
ShadowOriginY
=
(
iter
->
op
/
pow
(
(
double
)
2
,
(
double
)
16
));
}
break
;
case
shadowOpacity
:
{
double
shadowOpa
=
(
iter
->
op
/
pow
(
(
double
)
2
,
(
double
)
16
));
if
(
SecondShadowOffsetX
!=
0
)
appendValueAttribute
(
&
m_shadow
,
L"opacity"
,
FormatUtils
::
DoubleToFormattedWideString
(
shadowOpa
,
L"%.2f"
).
c_str
());
}
break
;
case
shadowStyleBooleanProperties
:
{
{
offset2
+=
FormatUtils
::
DoubleToWideString
(
SecondShadowOffsetX
.
ToPoints
()
);
shadowBoolean
=
ShadowStyleBooleanProperties
(
iter
->
op
);
offset2
+=
L"pt"
;
}
break
;
}
// OLE
case
pictureId
:
{
indexOLE
=
iter
->
op
;
}
break
;
// PICTURE
case
Pib
:
{
int
index
=
(
int
)(
iter
->
op
-
1
);
if
(
SecondShadowOffsetY
!=
0
)
if
((
m_pBlipStore
!=
NULL
)
&&
(
index
<
(
int
)
m_pBlipStore
->
Children
.
size
()))
{
BlipStoreEntry
*
oBlip
=
static_cast
<
BlipStoreEntry
*>
(
m_pBlipStore
->
Children
[
index
]);
if
(
copyPicture
(
oBlip
))
{
appendValueAttribute
(
&
m_imagedata
,
L"r:id"
,
(
std
::
wstring
(
L"rId"
)
+
FormatUtils
::
IntToWideString
(
m_nImageId
)
).
c_str
());
}
}
}
break
;
case
pibName
:
{
{
offset2
+=
L","
;
std
::
wstring
name
;
offset2
+=
FormatUtils
::
DoubleToWideString
(
SecondShadowOffsetY
.
ToPoints
());
FormatUtils
::
GetSTLCollectionFromBytes
<
std
::
wstring
>
(
&
name
,
iter
->
opComplex
,
iter
->
op
,
ENCODING_UTF16
);
offset2
+=
L"pt"
;
if
(
!
name
.
empty
())
}
appendValueAttribute
(
&
m_imagedata
,
L"o:title"
,
FormatUtils
::
XmlEncode
(
name
).
c_str
());
}
break
;
// 3D STYLE
case
f3D
:
case
threeDStyleBooleanProperties
:
case
threeDObjectBooleanProperties
:
break
;
if
(
!
offset2
.
empty
())
case
c3DExtrudeBackward
:
{
{
appendValueAttribute
(
&
m_shadow
,
L"offset2"
,
offset2
.
c_str
());
EmuValue
backwardValue
(
(
int
)
iter
->
op
);
}
std
::
wstring
depth
=
FormatUtils
::
DoubleToWideString
(
backwardValue
.
ToPoints
()
)
+
L"pt"
;
appendValueAttribute
(
&
m_3dstyle
,
L"backdepth"
,
depth
.
c_str
());
}
break
;
case
c3DAmbientIntensity
:
{
std
::
wstring
intens
=
FormatUtils
::
IntToWideString
((
int
)
iter
->
op
)
+
L"f"
;
appendValueAttribute
(
&
m_3dstyle
,
L"brightness"
,
intens
.
c_str
());
}
break
;
case
c3DSpecularAmt
:
{
std
::
wstring
amt
=
FormatUtils
::
IntToWideString
((
int
)
iter
->
op
)
+
L"f"
;
appendValueAttribute
(
&
m_3dstyle
,
L"specularity"
,
amt
.
c_str
());
}
break
;
case
c3DDiffuseAmt
:
{
std
::
wstring
amt
=
FormatUtils
::
IntToWideString
((
int
)
iter
->
op
)
+
L"f"
;
appendValueAttribute
(
&
m_3dstyle
,
L"diffusity"
,
amt
.
c_str
());
}
break
;
case
c3DKeyIntensity
:
{
std
::
wstring
amt
=
FormatUtils
::
IntToWideString
((
int
)
iter
->
op
);
appendValueAttribute
(
&
m_3dstyle
,
L"lightlevel"
,
amt
.
c_str
());
}
break
;
case
c3DExtrusionColor
:
{
std
::
wstring
color
=
FormatUtils
::
IntToFormattedWideString
(
iter
->
op
,
L"#%06x"
);
appendValueAttribute
(
&
m_3dstyle
,
L"color"
,
color
.
c_str
());
}
break
;
case
c3DSkewAngle
:
{
FixedPointNumber
skewAngle
(
iter
->
op
);
appendValueAttribute
(
&
m_3dstyle
,
L"skewangle"
,
FormatUtils
::
DoubleToWideString
(
skewAngle
.
ToAngle
()
).
c_str
());
}
break
;
case
c3DXViewpoint
:
{
ViewPointX
=
EmuValue
(
FixedPointNumber
(
iter
->
op
).
Integral
);
}
break
;
case
c3DYViewpoint
:
{
ViewPointY
=
EmuValue
(
FixedPointNumber
(
iter
->
op
).
Integral
);
}
break
;
case
c3DZViewpoint
:
{
ViewPointZ
=
EmuValue
(
FixedPointNumber
(
iter
->
op
).
Integral
);
}
break
;
case
c3DOriginX
:
{
FixedPointNumber
dOriginX
(
iter
->
op
);
viewPointOriginX
=
(
dOriginX
.
Integral
/
65536.0
);
}
break
;
case
c3DOriginY
:
{
FixedPointNumber
dOriginY
(
iter
->
op
);
viewPointOriginY
=
(
dOriginY
.
Integral
/
65536.0
);
}
break
;
// TEXTBOX
case
lTxid
:
{
hasTextbox
=
true
;
nLTxID
=
(((
iter
->
op
)
>>
16
)
&
0xFFFF
);
}
break
;
case
dxTextLeft
:
{
ndxTextLeft
=
(
int
)
iter
->
op
;
break
;}
case
dyTextTop
:
{
ndyTextTop
=
(
int
)
iter
->
op
;
break
;}
case
dxTextRight
:
{
ndxTextRight
=
(
int
)
iter
->
op
;
break
;}
case
dyTextBottom
:
{
ndyTextBottom
=
(
int
)
iter
->
op
;
break
;}
case
txflTextFlow
:
{
switch
(
iter
->
op
)
{
case
0
:
case
4
:
//обычный
break
;
case
1
:
case
5
:
//верт (склони голову направо)
appendStyleProperty
(
&
sTextboxStyle
,
L"layout-flow"
,
L"vertical"
);
break
;
case
2
:
//верт (склони голову налево)
appendStyleProperty
(
&
sTextboxStyle
,
L"layout-flow"
,
L"vertical"
);
appendStyleProperty
(
&
sTextboxStyle
,
L"mso-layout-flow-alt"
,
L"bottom-to-top"
);
break
;
}
}
break
;
// Word Art
case
gtextUNICODE
:
{
std
::
wstring
text
=
NSStringExt
::
CConverter
::
GetUnicodeFromUTF16
((
unsigned
short
*
)
iter
->
opComplex
,
(
iter
->
op
)
/
2
);
text
=
FormatUtils
::
XmlEncode
(
text
);
//build shadow origin
if
(
0
<=
text
.
find
(
L"
\n
"
))
if
(
(
ShadowOriginX
!=
0
)
&&
(
ShadowOriginY
!=
0
)
)
{
m_textpath
.
AppendText
(
text
.
c_str
());
}
text
=
ReplaceString
(
text
,
L"
\n
"
,
L"
"
);
appendValueAttribute
(
&
m_textpath
,
L"string"
,
text
.
c_str
());
}
break
;
case
gtextFont
:
{
{
appendValueAttribute
(
&
m_shadow
,
L"origin"
,
(
FormatUtils
::
DoubleToWideString
(
shadowOriginX
)
+
std
::
wstring
(
L","
)
+
FormatUtils
::
DoubleToWideString
(
shadowOriginY
)).
c_str
());
std
::
wstring
font
=
NSStringExt
::
CConverter
::
GetUnicodeFromUTF16
((
unsigned
short
*
)
iter
->
opComplex
,
(
iter
->
op
)
/
2
);
}
int
i
=
font
.
size
();
while
(
i
>
0
)
{
if
(
font
[
i
-
1
]
!=
0
)
break
;
i
--
;
}
if
(
i
<
font
.
size
())
font
.
erase
(
font
.
begin
()
+
i
,
font
.
end
());
// write shadow
font
=
std
::
wstring
(
L"
\"
"
)
+
font
+
std
::
wstring
(
L"
\"
"
);
if
(
m_shadow
.
GetAttributeCount
()
>
0
)
appendStyleProperty
(
&
m_textPathStyle
,
L"font-family"
,
font
);
}
break
;
case
gtextSize
:
{
std
::
wstring
fontSize
=
FormatUtils
::
IntToWideString
(
iter
->
op
/
65535
);
appendStyleProperty
(
&
m_textPathStyle
,
L"font-size"
,
fontSize
+
L"pt"
);
}
break
;
case
gtextSpacing
:
{
std
::
wstring
spacing
=
FormatUtils
::
IntToWideString
(
iter
->
op
);
appendStyleProperty
(
&
m_textPathStyle
,
L"v-text-spacing"
,
spacing
+
L"f"
);
}
break
;
case
geometryTextBooleanProperties
:
{
{
if
(
shadowBoolean
.
fShadow
)
GeometryTextBooleanProperties
props
(
iter
->
op
);
if
(
props
.
fUsegtextFBestFit
&&
props
.
gtextFBestFit
)
{
appendValueAttribute
(
&
m_textpath
,
L"fitshape"
,
L"t"
);
}
if
(
props
.
fUsegtextFShrinkFit
&&
props
.
gtextFShrinkFit
)
{
appendValueAttribute
(
&
m_textpath
,
L"trim"
,
L"t"
);
}
if
(
props
.
fUsegtextFVertical
&&
props
.
gtextFVertical
)
{
appendStyleProperty
(
&
m_textPathStyle
,
L"v-rotate-letters"
,
L"t"
);
//_twistDimension = true;
}
if
(
props
.
fUsegtextFKern
&&
props
.
gtextFKern
)
{
{
append
ValueAttribute
(
&
m_shadow
,
L"on"
,
L"t"
);
append
StyleProperty
(
&
m_textPathStyle
,
L"v-text-kern"
,
L"t"
);
}
}
if
(
props
.
fUsegtextFItalic
&&
props
.
gtextFItalic
)
{
appendStyleProperty
(
&
m_textPathStyle
,
L"font-style"
,
L"italic"
);
}
if
(
props
.
fUsegtextFBold
&&
props
.
gtextFBold
)
{
appendStyleProperty
(
&
m_textPathStyle
,
L"font-weight"
,
L"bold"
);
}
}
break
;
// PATH
case
shapePath
:
{
bHavePath
=
true
;
m_pXmlWriter
->
WriteString
(
m_shadow
.
GetXMLString
().
c_str
());
std
::
wstring
path
=
ParsePath
(
options
);
}
//write 3d style
if
(
false
==
path
.
empty
())
if
(
m_3dstyle
.
GetAttributeCount
()
>
0
)
m_pXmlWriter
->
WriteAttribute
(
L"path"
,
path
.
c_str
());
}
break
;
default:
{
{
appendValueAttribute
(
&
m_3dstyle
,
L"v:ext"
,
L"view"
);
int
val
=
iter
->
op
;
appendValueAttribute
(
&
m_3dstyle
,
L"on"
,
L"t"
);
}
break
;
}
}
//write the viewpoint
if
(
false
==
bHavePath
)
// фигура может быть задана только наборами вершин и индексов
if
(
(
ViewPointX
!=
0
)
||
(
ViewPointY
!=
0
)
||
(
ViewPointZ
!=
0
)
)
{
{
std
::
wstring
path
=
ParsePath
(
options
);
std
::
wstring
viewPoint
;
if
(
ViewPointX
!=
0
)
if
(
false
==
path
.
empty
())
{
m_pXmlWriter
->
WriteAttribute
(
L"path"
,
path
.
c_str
());
viewPoint
+=
FormatUtils
::
IntToWideString
(
ViewPointX
)
+
L"pt"
;
}
}
viewPoint
+=
L","
;
if
(
ViewPointY
!=
0
)
{
viewPoint
+=
FormatUtils
::
IntToWideString
(
ViewPointY
)
+
L"pt"
;
}
viewPoint
+=
L","
;
if
(
ViewPointZ
!=
0
)
{
viewPoint
+=
FormatUtils
::
IntToWideString
(
ViewPointZ
)
+
L"pt"
;
}
appendValueAttribute
(
&
m_3dstyle
,
L"viewpoint"
,
viewPoint
.
c_str
());
if
(
!
filled
)
}
{
// write the viewpointorigin
m_pXmlWriter
->
WriteAttribute
(
L"filled"
,
L"f"
);
if
(
(
viewPointOriginX
!=
0
)
||
(
viewPointOriginY
!=
0
)
)
}
{
std
::
wstring
viewPointOrigin
;
if
(
viewPointOriginX
!=
0
)
if
(
!
stroked
)
{
{
viewPointOrigin
+=
FormatUtils
::
DoubleToFormattedWideString
(
viewPointOriginX
,
L"%.2
f"
);
m_pXmlWriter
->
WriteAttribute
(
L"stroked"
,
L"
f"
);
}
}
if
(
viewPointOriginY
!=
0
)
if
(
!
layoutInCell
)
{
{
viewPointOrigin
+=
L","
;
m_pXmlWriter
->
WriteAttribute
(
L"o:allowincell"
,
L"f"
);
viewPointOrigin
+=
FormatUtils
::
DoubleToFormattedWideString
(
viewPointOriginY
,
L"%.2f"
);
}
}
appendValueAttribute
(
&
m_3dstyle
,
L"viewpointorigin"
,
viewPointOrigin
.
c_str
());
if
(
(
xCoord
>
0
)
&&
(
yCoord
>
0
)
)
}
{
m_pXmlWriter
->
WriteAttribute
(
L"coordsize"
,
(
FormatUtils
::
IntToWideString
(
xCoord
)
+
L","
+
FormatUtils
::
IntToWideString
(
yCoord
)
).
c_str
()
);
}
m_pXmlWriter
->
WriteString
(
m_3dstyle
.
GetXMLString
().
c_str
());
int
nCode
=
0
;
}
if
(
pShape
->
GetShapeType
())
// write wrap
{
if
(
m_pSpa
)
nCode
=
pShape
->
GetShapeType
()
->
GetTypeCode
();
{
}
std
::
wstring
wrap
=
getWrapType
(
m_pSpa
);
if
(
wrap
!=
L"through"
)
if
(
DocFileFormat
::
msosptRoundRectangle
==
nCode
)
{
{
m_pXmlWriter
->
WriteNodeBegin
(
L"w10:wrap"
,
true
);
if
(
nAdjValues
)
m_pXmlWriter
->
WriteAttribute
(
L"type"
,
wrap
.
c_str
()
);
{
m_pXmlWriter
->
WriteNodeEnd
(
L"w10:wrap"
,
true
);
m_pXmlWriter
->
WriteAttribute
(
L"arcsize"
,
adjValues
[
0
].
c_str
());
}
}
}
}
// write stroke
else
if
(
m_stroke
.
GetAttributeCount
())
{
if
(
nAdjValues
)
{
std
::
wstring
adjTag
=
adjValues
[
0
];
for
(
int
i
=
1
;
i
<
nAdjValues
;
++
i
)
adjTag
+=
std
::
wstring
(
L","
)
+
adjValues
[
i
];
m_pXmlWriter
->
WriteAttribute
(
L"adj"
,
adjTag
.
c_str
());
}
}
m_pXmlWriter
->
WriteNodeEnd
(
L""
,
true
,
false
);
//build shadow offsets
std
::
wstring
offset
;
if
(
ShadowOffsetX
!=
0
)
{
offset
+=
FormatUtils
::
DoubleToWideString
(
ShadowOffsetX
.
ToPoints
()
);
offset
+=
L"pt"
;
}
if
(
ShadowOffsetY
!=
0
)
{
offset
+=
L","
;
offset
+=
FormatUtils
::
DoubleToWideString
(
ShadowOffsetY
.
ToPoints
()
);
offset
+=
L"pt"
;
}
if
(
!
offset
.
empty
()
)
{
appendValueAttribute
(
&
m_shadow
,
L"offset"
,
offset
.
c_str
());
}
std
::
wstring
offset2
;
if
(
SecondShadowOffsetX
!=
0
)
{
offset2
+=
FormatUtils
::
DoubleToWideString
(
SecondShadowOffsetX
.
ToPoints
()
);
offset2
+=
L"pt"
;
}
if
(
SecondShadowOffsetY
!=
0
)
{
offset2
+=
L","
;
offset2
+=
FormatUtils
::
DoubleToWideString
(
SecondShadowOffsetY
.
ToPoints
());
offset2
+=
L"pt"
;
}
if
(
!
offset2
.
empty
())
{
appendValueAttribute
(
&
m_shadow
,
L"offset2"
,
offset2
.
c_str
());
}
//build shadow origin
if
(
(
ShadowOriginX
!=
0
)
&&
(
ShadowOriginY
!=
0
)
)
{
appendValueAttribute
(
&
m_shadow
,
L"origin"
,
(
FormatUtils
::
DoubleToWideString
(
shadowOriginX
)
+
std
::
wstring
(
L","
)
+
FormatUtils
::
DoubleToWideString
(
shadowOriginY
)).
c_str
());
}
// write shadow
if
(
m_shadow
.
GetAttributeCount
()
>
0
)
{
if
(
shadowBoolean
.
fShadow
)
{
appendValueAttribute
(
&
m_shadow
,
L"on"
,
L"t"
);
}
m_pXmlWriter
->
WriteString
(
m_shadow
.
GetXMLString
().
c_str
());
}
//write 3d style
if
(
m_3dstyle
.
GetAttributeCount
()
>
0
)
{
appendValueAttribute
(
&
m_3dstyle
,
L"v:ext"
,
L"view"
);
appendValueAttribute
(
&
m_3dstyle
,
L"on"
,
L"t"
);
//write the viewpoint
if
(
(
ViewPointX
!=
0
)
||
(
ViewPointY
!=
0
)
||
(
ViewPointZ
!=
0
)
)
{
std
::
wstring
viewPoint
;
if
(
ViewPointX
!=
0
)
{
{
m_pXmlWriter
->
WriteString
(
m_stroke
.
GetXMLString
().
c_str
())
;
viewPoint
+=
FormatUtils
::
IntToWideString
(
ViewPointX
)
+
L"pt"
;
}
}
// write fill
viewPoint
+=
L","
;
if
(
m_fill
.
GetAttributeCount
()
)
if
(
ViewPointY
!=
0
)
{
{
m_pXmlWriter
->
WriteString
(
m_fill
.
GetXMLString
().
c_str
())
;
viewPoint
+=
FormatUtils
::
IntToWideString
(
ViewPointY
)
+
L"pt"
;
}
}
// text path
viewPoint
+=
L","
;
if
(
m_textpath
.
GetAttributeCount
()
)
if
(
ViewPointZ
!=
0
)
{
{
appendValueAttribute
(
&
m_textpath
,
L"style"
,
FormatUtils
::
XmlEncode
(
m_textPathStyle
).
c_str
());
viewPoint
+=
FormatUtils
::
IntToWideString
(
ViewPointZ
)
+
L"pt"
;
m_pXmlWriter
->
WriteString
(
m_textpath
.
GetXMLString
().
c_str
());
}
}
// write imagedata
if
(
m_imagedata
.
GetAttributeCount
())
appendValueAttribute
(
&
m_3dstyle
,
L"viewpoint"
,
viewPoint
.
c_str
());
}
// write the viewpointorigin
if
(
(
viewPointOriginX
!=
0
)
||
(
viewPointOriginY
!=
0
)
)
{
std
::
wstring
viewPointOrigin
;
if
(
viewPointOriginX
!=
0
)
{
{
m_pXmlWriter
->
WriteString
(
m_imagedata
.
GetXMLString
().
c_str
()
);
viewPointOrigin
+=
FormatUtils
::
DoubleToFormattedWideString
(
viewPointOriginX
,
L"%.2f"
);
}
}
if
(
freeform
)
if
(
viewPointOriginY
!=
0
)
{
{
if
(
arrInscribe
.
size
())
viewPointOrigin
+=
L","
;
{
viewPointOrigin
+=
FormatUtils
::
DoubleToFormattedWideString
(
viewPointOriginY
,
L"%.2f"
);
m_pXmlWriter
->
WriteNodeBegin
(
L"v:path"
,
true
);
m_pXmlWriter
->
WriteAttribute
(
L"textboxrect"
,
arrInscribe
[
0
]);
m_pXmlWriter
->
WriteNodeEnd
(
L""
,
true
);
}
}
}
// TEXTBOX
OfficeArtClientTextbox
*
pTextBox
=
pContainer
->
FirstChildWithType
<
OfficeArtClientTextbox
>
();
if
(
pTextBox
)
{
// Word text box
//Word appends a OfficeArtClientTextbox record to the container.
appendValueAttribute
(
&
m_3dstyle
,
L"viewpointorigin"
,
viewPointOrigin
.
c_str
());
//This record stores the index of the textbox.
}
int
nIndex
=
pTextBox
->
GetIndex
(
);
m_pXmlWriter
->
WriteString
(
m_3dstyle
.
GetXMLString
().
c_str
()
);
if
(
nIndex
)
}
{
// write wrap
TextboxMapping
textboxMapping
(
m_ctx
,
nIndex
-
1
,
m_pXmlWriter
,
m_pCaller
);
if
(
m_pSpa
)
textboxMapping
.
SetInset
(
ndxTextLeft
,
ndyTextTop
,
ndxTextRight
,
ndyTextBottom
);
{
textboxMapping
.
SetTextboxStyle
(
sTextboxStyle
);
std
::
wstring
wrap
=
getWrapType
(
m_pSpa
);
m_ctx
->
_doc
->
Convert
(
&
textboxMapping
);
if
(
wrap
!=
L"through"
)
}
{
}
m_pXmlWriter
->
WriteNodeBegin
(
L"w10:wrap"
,
true
);
else
if
(
hasTextbox
)
m_pXmlWriter
->
WriteAttribute
(
L"type"
,
wrap
.
c_str
()
);
{
m_pXmlWriter
->
WriteNodeEnd
(
L"w10:wrap"
,
true
);
//Open Office textbox
}
}
// write fill
if
(
m_fill
.
GetAttributeCount
())
{
m_pXmlWriter
->
WriteString
(
m_fill
.
GetXMLString
().
c_str
());
}
// write imagedata
if
(
m_imagedata
.
GetAttributeCount
())
{
m_pXmlWriter
->
WriteString
(
m_imagedata
.
GetXMLString
().
c_str
());
}
if
(
pShape
->
fBackground
)
{
WriteEndShapeNode
(
pShape
);
return
;
}
// write stroke
if
(
m_stroke
.
GetAttributeCount
())
{
m_pXmlWriter
->
WriteString
(
m_stroke
.
GetXMLString
().
c_str
());
}
// text path
if
(
m_textpath
.
GetAttributeCount
())
{
appendValueAttribute
(
&
m_textpath
,
L"style"
,
FormatUtils
::
XmlEncode
(
m_textPathStyle
).
c_str
());
m_pXmlWriter
->
WriteString
(
m_textpath
.
GetXMLString
().
c_str
());
}
if
(
freeform
)
{
if
(
arrInscribe
.
size
())
{
m_pXmlWriter
->
WriteNodeBegin
(
L"v:path"
,
true
);
m_pXmlWriter
->
WriteAttribute
(
L"textboxrect"
,
arrInscribe
[
0
]);
m_pXmlWriter
->
WriteNodeEnd
(
L""
,
true
);
}
}
// TEXTBOX
OfficeArtClientTextbox
*
pTextBox
=
pContainer
->
FirstChildWithType
<
OfficeArtClientTextbox
>
();
if
(
pTextBox
)
{
// Word text box
//Open Office doesn't append a OfficeArtClientTextbox record to the container.
//Word appends a OfficeArtClientTextbox record to the container.
//We don't know how Word gets the relation to the text, but we assume that the first textbox in the document
//This record stores the index of the textbox.
//get the index 0, the second textbox gets the index 1 (and so on).
if
(
-
1
!=
nLTxID
)
int
nIndex
=
pTextBox
->
GetIndex
();
{
if
(
nIndex
)
TextboxMapping
textboxMapping
(
m_ctx
,
nLTxID
-
1
,
m_pXmlWriter
,
m_pCaller
);
{
textboxMapping
.
SetInset
(
ndxTextLeft
,
ndyTextTop
,
ndxTextRight
,
ndyTextBottom
);
TextboxMapping
textboxMapping
(
m_context
,
nIndex
-
1
,
m_pXmlWriter
,
m_pCaller
);
m_ctx
->
_doc
->
Convert
(
&
textboxMapping
);
textboxMapping
.
SetInset
(
ndxTextLeft
,
ndyTextTop
,
ndxTextRight
,
ndyTextBottom
);
}
textboxMapping
.
SetTextboxStyle
(
sTextboxStyle
);
else
{
TextboxMapping
textboxMapping
(
m_ctx
,
m_pXmlWriter
,
m_pCaller
);
textboxMapping
.
SetInset
(
ndxTextLeft
,
ndyTextTop
,
ndxTextRight
,
ndyTextBottom
);
m_ctx
->
_doc
->
Convert
(
&
textboxMapping
);
}
}
WriteEndShapeNode
(
pShape
);
m_context
->
_doc
->
Convert
(
&
textboxMapping
);
//ShapeType
if
(
NULL
!=
pShape
->
GetShapeType
()
&&
!
pShape
->
fBackground
/* && !m_isInlineShape*/
)
//bullete only???
{
VMLShapeTypeMapping
oXmlMapper
(
m_pXmlWriter
);
pShape
->
GetShapeType
()
->
Convert
(
&
oXmlMapper
);
}
}
}
}
}
else
if
(
hasTextbox
)
{
//Open Office textbox
//Open Office doesn't append a OfficeArtClientTextbox record to the container.
//We don't know how Word gets the relation to the text, but we assume that the first textbox in the document
//get the index 0, the second textbox gets the index 1 (and so on).
if
(
-
1
!=
nLTxID
)
{
TextboxMapping
textboxMapping
(
m_context
,
nLTxID
-
1
,
m_pXmlWriter
,
m_pCaller
);
textboxMapping
.
SetInset
(
ndxTextLeft
,
ndyTextTop
,
ndxTextRight
,
ndyTextBottom
);
m_context
->
_doc
->
Convert
(
&
textboxMapping
);
}
else
{
TextboxMapping
textboxMapping
(
m_context
,
m_pXmlWriter
,
m_pCaller
);
textboxMapping
.
SetInset
(
ndxTextLeft
,
ndyTextTop
,
ndxTextRight
,
ndyTextBottom
);
m_context
->
_doc
->
Convert
(
&
textboxMapping
);
}
}
// OLE
if
(
indexOLE
>=
0
&&
pShape
->
fOleShape
)
{
TextboxMapping
textboxMapping
(
m_context
,
0
,
m_pXmlWriter
,
m_pCaller
);
m_context
->
_doc
->
Convert
(
&
textboxMapping
);
}
WriteEndShapeNode
(
pShape
);
//ShapeType
if
(
NULL
!=
pShape
->
GetShapeType
()
/* && !m_isInlineShape*/
)
//bullete only???
{
VMLShapeTypeMapping
oXmlMapper
(
m_pXmlWriter
);
pShape
->
GetShapeType
()
->
Convert
(
&
oXmlMapper
);
}
}
}
//
//
...
@@ -1028,22 +1048,18 @@ namespace DocFileFormat
...
@@ -1028,22 +1048,18 @@ namespace DocFileFormat
}
}
else
if
(
pShape
->
is
<
OvalType
>
())
else
if
(
pShape
->
is
<
OvalType
>
())
{
{
//OVAL
m_pXmlWriter
->
WriteNodeBegin
(
L"v:oval"
,
true
);
m_pXmlWriter
->
WriteNodeBegin
(
L"v:oval"
,
true
);
}
}
else
if
(
pShape
->
is
<
RoundedRectangleType
>
())
else
if
(
pShape
->
is
<
RoundedRectangleType
>
())
{
{
//ROUNDED RECT
m_pXmlWriter
->
WriteNodeBegin
(
L"v:roundrect"
,
true
);
m_pXmlWriter
->
WriteNodeBegin
(
L"v:roundrect"
,
true
);
}
}
else
if
(
pShape
->
is
<
RectangleType
>
())
else
if
(
pShape
->
is
<
RectangleType
>
())
{
{
//RECT
m_pXmlWriter
->
WriteNodeBegin
(
L"v:rect"
,
true
);
m_pXmlWriter
->
WriteNodeBegin
(
L"v:rect"
,
true
);
}
}
else
if
(
pShape
->
is
<
LineType
>
())
else
if
(
pShape
->
is
<
LineType
>
())
{
{
//LINE
m_pXmlWriter
->
WriteNodeBegin
(
L"v:line"
,
true
);
m_pXmlWriter
->
WriteNodeBegin
(
L"v:line"
,
true
);
}
}
else
else
...
@@ -1192,7 +1208,7 @@ namespace DocFileFormat
...
@@ -1192,7 +1208,7 @@ namespace DocFileFormat
//write the blip
//write the blip
if
(
oBlip
)
if
(
oBlip
)
{
{
VirtualStreamReader
reader
(
m_c
tx
->
_doc
->
WordDocumentStream
,
oBlip
->
foDelay
,
m_ctx
->
_doc
->
FIB
->
m_bOlderVersion
);
VirtualStreamReader
reader
(
m_c
ontext
->
_doc
->
WordDocumentStream
,
oBlip
->
foDelay
,
m_context
->
_doc
->
FIB
->
m_bOlderVersion
);
switch
(
oBlip
->
btWin32
)
switch
(
oBlip
->
btWin32
)
{
{
...
@@ -1210,7 +1226,7 @@ namespace DocFileFormat
...
@@ -1210,7 +1226,7 @@ namespace DocFileFormat
decompressedSize
=
metaBlip
->
Decompress
(
&
decompressed
);
decompressedSize
=
metaBlip
->
Decompress
(
&
decompressed
);
if
(
0
!=
decompressedSize
&&
NULL
!=
decompressed
)
if
(
0
!=
decompressedSize
&&
NULL
!=
decompressed
)
{
{
m_c
tx
->
_docx
->
ImagesList
.
push_back
(
ImageFileStructure
(
GetTargetExt
(
oBlip
->
btWin32
),
std
::
vector
<
unsigned
char
>
(
decompressed
,
(
decompressed
+
decompressedSize
))));
m_c
ontext
->
_docx
->
ImagesList
.
push_back
(
ImageFileStructure
(
GetTargetExt
(
oBlip
->
btWin32
),
std
::
vector
<
unsigned
char
>
(
decompressed
,
(
decompressed
+
decompressedSize
))));
RELEASEARRAYOBJECTS
(
decompressed
);
RELEASEARRAYOBJECTS
(
decompressed
);
}
}
...
@@ -1229,7 +1245,7 @@ namespace DocFileFormat
...
@@ -1229,7 +1245,7 @@ namespace DocFileFormat
BitmapBlip
*
bitBlip
=
static_cast
<
BitmapBlip
*>
(
RecordFactory
::
ReadRecord
(
&
reader
,
0
));
BitmapBlip
*
bitBlip
=
static_cast
<
BitmapBlip
*>
(
RecordFactory
::
ReadRecord
(
&
reader
,
0
));
if
((
bitBlip
)
&&
(
bitBlip
->
m_pvBits
))
if
((
bitBlip
)
&&
(
bitBlip
->
m_pvBits
))
{
{
m_c
tx
->
_docx
->
ImagesList
.
push_back
(
ImageFileStructure
(
GetTargetExt
(
oBlip
->
btWin32
),
m_c
ontext
->
_docx
->
ImagesList
.
push_back
(
ImageFileStructure
(
GetTargetExt
(
oBlip
->
btWin32
),
std
::
vector
<
unsigned
char
>
(
bitBlip
->
m_pvBits
,
(
bitBlip
->
m_pvBits
+
bitBlip
->
pvBitsSize
)),
oBlip
->
btWin32
));
std
::
vector
<
unsigned
char
>
(
bitBlip
->
m_pvBits
,
(
bitBlip
->
m_pvBits
+
bitBlip
->
pvBitsSize
)),
oBlip
->
btWin32
));
RELEASEOBJECT
(
bitBlip
);
RELEASEOBJECT
(
bitBlip
);
}
}
...
@@ -1244,7 +1260,7 @@ namespace DocFileFormat
...
@@ -1244,7 +1260,7 @@ namespace DocFileFormat
break
;
break
;
}
}
m_nImageId
=
m_c
tx
->
_docx
->
RegisterImage
(
m_pCaller
,
oBlip
->
btWin32
);
m_nImageId
=
m_c
ontext
->
_docx
->
RegisterImage
(
m_pCaller
,
oBlip
->
btWin32
);
result
=
true
;
result
=
true
;
}
}
...
@@ -1957,9 +1973,9 @@ namespace DocFileFormat
...
@@ -1957,9 +1973,9 @@ namespace DocFileFormat
if
(
-
1
!=
nLTxID
)
if
(
-
1
!=
nLTxID
)
{
{
TextboxMapping
textboxMapping
(
m_c
tx
,
nLTxID
-
1
,
m_pXmlWriter
,
m_pCaller
);
TextboxMapping
textboxMapping
(
m_c
ontext
,
nLTxID
-
1
,
m_pXmlWriter
,
m_pCaller
);
//textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom);
//textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom);
m_c
tx
->
_doc
->
Convert
(
&
textboxMapping
);
m_c
ontext
->
_doc
->
Convert
(
&
textboxMapping
);
}
}
}
}
...
...
ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.h
View file @
ea5ebe72
...
@@ -129,7 +129,7 @@ namespace DocFileFormat
...
@@ -129,7 +129,7 @@ namespace DocFileFormat
BlipStoreContainer
*
m_pBlipStore
;
BlipStoreContainer
*
m_pBlipStore
;
int
m_nImageId
;
int
m_nImageId
;
std
::
wstring
m_textPathStyle
;
std
::
wstring
m_textPathStyle
;
ConversionContext
*
m_c
tx
;
ConversionContext
*
m_c
ontext
;
PictureDescriptor
*
m_pict
;
PictureDescriptor
*
m_pict
;
XMLTools
::
XMLElement
<
wchar_t
>
m_fill
;
XMLTools
::
XMLElement
<
wchar_t
>
m_fill
;
...
...
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
View file @
ea5ebe72
...
@@ -268,7 +268,7 @@ namespace DocFileFormat
...
@@ -268,7 +268,7 @@ namespace DocFileFormat
OfficeDrawingPlex
=
new
Plex
<
Spa
>
(
Spa
::
GetSize
(
bOlderVersion
),
TableStream
,
FIB
->
m_FibWord97
.
fcPlcSpaMom
,
FIB
->
m_FibWord97
.
lcbPlcSpaMom
,
bOlderVersion
);
OfficeDrawingPlex
=
new
Plex
<
Spa
>
(
Spa
::
GetSize
(
bOlderVersion
),
TableStream
,
FIB
->
m_FibWord97
.
fcPlcSpaMom
,
FIB
->
m_FibWord97
.
lcbPlcSpaMom
,
bOlderVersion
);
OfficeDrawingPlexHeader
=
new
Plex
<
Spa
>
(
Spa
::
GetSize
(
bOlderVersion
),
TableStream
,
FIB
->
m_FibWord97
.
fcPlcSpaHdr
,
FIB
->
m_FibWord97
.
lcbPlcSpaHdr
,
bOlderVersion
);
OfficeDrawingPlexHeader
=
new
Plex
<
Spa
>
(
Spa
::
GetSize
(
bOlderVersion
),
TableStream
,
FIB
->
m_FibWord97
.
fcPlcSpaHdr
,
FIB
->
m_FibWord97
.
lcbPlcSpaHdr
,
bOlderVersion
);
TextboxIndividualPlex
=
new
Plex
<
EmptyStructure
>
(
EmptyStructure
::
STRUCTURE_SIZE
,
TableStream
,
FIB
->
m_FibWord97
.
fcPlcftxbxTxt
,
FIB
->
m_FibWord97
.
lcbPlcftxbxTxt
,
bOlderVersion
);
TextboxIndividualPlex
=
new
Plex
<
FTXBXS
>
(
FTXBXS
::
STRUCTURE_SIZE
,
TableStream
,
FIB
->
m_FibWord97
.
fcPlcftxbxTxt
,
FIB
->
m_FibWord97
.
lcbPlcftxbxTxt
,
bOlderVersion
);
SectionPlex
=
new
Plex
<
SectionDescriptor
>
(
SectionDescriptor
::
STRUCTURE_SIZE
,
TableStream
,
FIB
->
m_FibWord97
.
fcPlcfSed
,
FIB
->
m_FibWord97
.
lcbPlcfSed
,
bOlderVersion
);
SectionPlex
=
new
Plex
<
SectionDescriptor
>
(
SectionDescriptor
::
STRUCTURE_SIZE
,
TableStream
,
FIB
->
m_FibWord97
.
fcPlcfSed
,
FIB
->
m_FibWord97
.
lcbPlcfSed
,
bOlderVersion
);
BookmarkStartPlex
=
new
Plex
<
BookmarkFirst
>
(
BookmarkFirst
::
STRUCTURE_SIZE
,
TableStream
,
FIB
->
m_FibWord97
.
fcPlcfBkf
,
FIB
->
m_FibWord97
.
lcbPlcfBkf
,
bOlderVersion
);
BookmarkStartPlex
=
new
Plex
<
BookmarkFirst
>
(
BookmarkFirst
::
STRUCTURE_SIZE
,
TableStream
,
FIB
->
m_FibWord97
.
fcPlcfBkf
,
FIB
->
m_FibWord97
.
lcbPlcfBkf
,
bOlderVersion
);
...
...
ASCOfficeDocFile/DocDocxConverter/WordDocument.h
View file @
ea5ebe72
...
@@ -187,7 +187,7 @@ namespace DocFileFormat
...
@@ -187,7 +187,7 @@ namespace DocFileFormat
Plex
<
EmptyStructure
>
*
HeaderStoriesPlex
;
//A plex of the header document
Plex
<
EmptyStructure
>
*
HeaderStoriesPlex
;
//A plex of the header document
Plex
<
EmptyStructure
>
*
IndividualCommentsPlex
;
// A plex with all ATRDPre10 structs
Plex
<
EmptyStructure
>
*
IndividualCommentsPlex
;
// A plex with all ATRDPre10 structs
Plex
<
EmptyStructure
>
*
TextboxIndividualPlex
;
Plex
<
FTXBXS
>
*
TextboxIndividualPlex
;
Plex
<
Tbkd
>
*
TextboxBreakPlex
;
// Describes the breaks inside the textbox subdocument
Plex
<
Tbkd
>
*
TextboxBreakPlex
;
// Describes the breaks inside the textbox subdocument
Plex
<
Tbkd
>
*
TextboxBreakPlexHeader
;
// Describes the breaks inside the header textbox subdocument
Plex
<
Tbkd
>
*
TextboxBreakPlexHeader
;
// Describes the breaks inside the header textbox subdocument
...
...
ASCOfficeDocFile/DocFormatLib/Win32/DocFormatLib.vcproj
View file @
ea5ebe72
...
@@ -555,6 +555,10 @@
...
@@ -555,6 +555,10 @@
RelativePath=
"..\..\DocDocxConverter\OfficeArtContent.h"
RelativePath=
"..\..\DocDocxConverter\OfficeArtContent.h"
>
>
</File>
</File>
<File
RelativePath=
"..\..\DocDocxConverter\OleObject.cpp"
>
</File>
<File
<File
RelativePath=
"..\..\DocDocxConverter\OleObject.h"
RelativePath=
"..\..\DocDocxConverter\OleObject.h"
>
>
...
...
ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro
View file @
ea5ebe72
...
@@ -98,7 +98,10 @@ SOURCES += \
...
@@ -98,7 +98,10 @@ SOURCES += \
..
/
source
/
Oox2OdfConverter
/
ConverterChart
.
cpp
\
..
/
source
/
Oox2OdfConverter
/
ConverterChart
.
cpp
\
..
/
source
/
Oox2OdfConverter
/
ConvertVml
.
cpp
\
..
/
source
/
Oox2OdfConverter
/
ConvertVml
.
cpp
\
..
/
source
/
Oox2OdfConverter
/
DocxConverter
.
cpp
\
..
/
source
/
Oox2OdfConverter
/
DocxConverter
.
cpp
\
..
/
source
/
Oox2OdfConverter
/
XlsxConverter
.
cpp
..
/
source
/
Oox2OdfConverter
/
XlsxConverter
.
cpp
\
..
/
source
/
OdfFormat
/
odf_settings_context
.
cpp
\
..
/
source
/
OdfFormat
/
office_settings
.
cpp
\
..
/
source
/
OdfFormat
/
mediaitems_utils
.
cpp
}
}
...
@@ -183,7 +186,3 @@ HEADERS += \
...
@@ -183,7 +186,3 @@ HEADERS += \
..
/
source
/
OdfFormat
/
Shapes
/
oox_shapeWordArt
.
h
\
..
/
source
/
OdfFormat
/
Shapes
/
oox_shapeWordArt
.
h
\
..
/
source
/
OdfFormat
/
odf_settings_context
.
h
\
..
/
source
/
OdfFormat
/
odf_settings_context
.
h
\
..
/
source
/
OdfFormat
/
office_settings
.
h
..
/
source
/
OdfFormat
/
office_settings
.
h
SOURCES
+=
\
..
/
source
/
OdfFormat
/
odf_settings_context
.
cpp
\
..
/
source
/
OdfFormat
/
office_settings
.
cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
View file @
ea5ebe72
...
@@ -1218,7 +1218,7 @@ CString RtfStyle::RenderToOOXBegin(RenderParameter oRenderParameter)
...
@@ -1218,7 +1218,7 @@ CString RtfStyle::RenderToOOXBegin(RenderParameter oRenderParameter)
if
(
PROP_DEF
!=
m_bPersonal
)
sResult
+=
L"<w:personal w:val=
\"
true
\"
/>"
;
if
(
PROP_DEF
!=
m_bPersonal
)
sResult
+=
L"<w:personal w:val=
\"
true
\"
/>"
;
if
(
PROP_DEF
!=
m_bCompose
)
sResult
+=
L"<w:personalCompose w:val=
\"
true
\"
/>"
;
if
(
PROP_DEF
!=
m_bCompose
)
sResult
+=
L"<w:personalCompose w:val=
\"
true
\"
/>"
;
if
(
PROP_DEF
!=
m_bReply
)
sResult
+=
L"<w:personalReply w:val=
\"
true
\"
/>"
;
if
(
PROP_DEF
!=
m_bReply
)
sResult
+=
L"<w:personalReply w:val=
\"
true
\"
/>"
;
if
(
PROP_DEF
==
m_nSemiHidden
)
sResult
+=
L"<w:semiHidden/>"
;
if
(
1
==
m_nSemiHidden
)
sResult
+=
L"<w:semiHidden/>"
;
if
(
PROP_DEF
!=
m_bQFormat
)
sResult
+=
L"<w:qformat/>"
;
if
(
PROP_DEF
!=
m_bQFormat
)
sResult
+=
L"<w:qformat/>"
;
if
(
PROP_DEF
!=
m_nPriority
)
sResult
.
AppendFormat
(
L"<w:uiPriority w:val=
\"
%d
\"
/>"
,
m_nPriority
);
if
(
PROP_DEF
!=
m_nPriority
)
sResult
.
AppendFormat
(
L"<w:uiPriority w:val=
\"
%d
\"
/>"
,
m_nPriority
);
if
(
PROP_DEF
!=
m_bUnhiddenWhenUse
)
sResult
+=
L"<w:unhideWhenUsed/>"
;
if
(
PROP_DEF
!=
m_bUnhiddenWhenUse
)
sResult
+=
L"<w:unhideWhenUsed/>"
;
...
...
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