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
0a7bcfdd
Commit
0a7bcfdd
authored
Aug 26, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormat - fix bugs, small refactoring
parent
d516cb2b
Changes
31
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
1210 additions
and
1209 deletions
+1210
-1209
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/CustomGeomShape.h
...ditor/Drawing/Shapes/BaseShape/PPTShape/CustomGeomShape.h
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Basic.h
ASCOfficeRtfFile/RtfFormatLib/source/Basic.h
+2
-1
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
+12
-12
ASCOfficeRtfFile/RtfFormatLib/source/IdGenerator.h
ASCOfficeRtfFile/RtfFormatLib/source/IdGenerator.h
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/RtfBookmark.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfBookmark.cpp
+40
-29
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.cpp
+6
-3
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.h
+123
-123
ASCOfficeRtfFile/RtfFormatLib/source/RtfGlobalTables.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfGlobalTables.cpp
+13
-8
ASCOfficeRtfFile/RtfFormatLib/source/RtfGlobalTables.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfGlobalTables.h
+31
-25
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.cpp
+9
-9
ASCOfficeRtfFile/RtfFormatLib/source/RtfOldList.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfOldList.cpp
+21
-17
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.cpp
+18
-17
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.h
+14
-12
ASCOfficeRtfFile/RtfFormatLib/source/RtfPicture.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfPicture.cpp
+43
-44
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
+682
-729
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.h
+53
-45
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.h
+2
-3
ASCOfficeRtfFile/RtfFormatLib/source/RtfTable.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfTable.h
+20
-16
ASCOfficeRtfFile/RtfFormatLib/source/RtfTableCell.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfTableCell.h
+14
-13
ASCOfficeRtfFile/RtfFormatLib/source/RtfTableRow.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfTableRow.h
+9
-10
ASCOfficeRtfFile/RtfFormatLib/source/RtfWriter.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfWriter.cpp
+22
-19
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXDocumentWriter.cpp
...eRtfFile/RtfFormatLib/source/Writer/OOXDocumentWriter.cpp
+22
-21
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXFontTableWriter.h
...ceRtfFile/RtfFormatLib/source/Writer/OOXFontTableWriter.h
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXFootnoteWriter.h
...iceRtfFile/RtfFormatLib/source/Writer/OOXFootnoteWriter.h
+34
-33
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXNumberingWriter.h
...ceRtfFile/RtfFormatLib/source/Writer/OOXNumberingWriter.h
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXRelsWriter.h
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXRelsWriter.h
+5
-5
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXSettingsWriter.h
...iceRtfFile/RtfFormatLib/source/Writer/OOXSettingsWriter.h
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXStylesWriter.h
...fficeRtfFile/RtfFormatLib/source/Writer/OOXStylesWriter.h
+1
-1
Common/DocxFormat/Source/DocxFormat/Drawing/Drawing.h
Common/DocxFormat/Source/DocxFormat/Drawing/Drawing.h
+2
-2
Common/DocxFormat/Source/DocxFormat/Logic/Pict.h
Common/DocxFormat/Source/DocxFormat/Logic/Pict.h
+3
-3
Common/DocxFormat/Source/DocxFormat/Logic/RunProperty.cpp
Common/DocxFormat/Source/DocxFormat/Logic/RunProperty.cpp
+2
-2
No files found.
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/CustomGeomShape.h
View file @
0a7bcfdd
...
...
@@ -118,7 +118,7 @@ namespace NSCustomVML
m_nCount
=
value
;
break
;
}
return
std
::
max
(
1
,
repeate
);
return
(
std
::
max
)
(
1
,
repeate
);
}
void
Read
(
POLE
::
Stream
*
pStream
)
{
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Basic.h
View file @
0a7bcfdd
...
...
@@ -241,7 +241,8 @@ public:
CString
sResult
;
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
.
Append
(
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
)
);
sResult
+=
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
);
if
(
TYPE_RTF_PARAGRAPH
==
m_aArray
[
i
]
->
GetType
()
&&
i
!=
(
int
)
m_aArray
.
size
()
-
1
)
{
sResult
+=
_T
(
"
\\
par"
)
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
View file @
0a7bcfdd
...
...
@@ -818,15 +818,15 @@ class PictureReader: public RtfAbstractReader
CString
ToString
()
{
CString
sResult
;
sResult
.
Append
(
ByteToString
(
(
BYTE
*
)
&
Key
,
4
,
true
)
);
sResult
.
Append
(
ByteToString
(
(
BYTE
*
)
&
Handle
,
2
,
true
)
);
sResult
.
Append
(
ByteToString
(
(
BYTE
*
)
&
Left
,
2
,
true
)
);
sResult
.
Append
(
ByteToString
(
(
BYTE
*
)
&
Top
,
2
,
true
)
);
sResult
.
Append
(
ByteToString
(
(
BYTE
*
)
&
Right
,
2
,
true
)
);
sResult
.
Append
(
ByteToString
(
(
BYTE
*
)
&
Bottom
,
2
,
true
)
);
sResult
.
Append
(
ByteToString
(
(
BYTE
*
)
&
Inch
,
2
,
true
)
);
sResult
.
Append
(
ByteToString
(
(
BYTE
*
)
&
Reserved
,
4
,
true
)
);
sResult
.
Append
(
ByteToString
(
(
BYTE
*
)
&
Checksum
,
2
,
true
)
);
sResult
+=
ByteToString
(
(
BYTE
*
)
&
Key
,
4
,
true
);
sResult
+=
ByteToString
(
(
BYTE
*
)
&
Handle
,
2
,
true
);
sResult
+=
ByteToString
(
(
BYTE
*
)
&
Left
,
2
,
true
);
sResult
+=
ByteToString
(
(
BYTE
*
)
&
Top
,
2
,
true
);
sResult
+=
ByteToString
(
(
BYTE
*
)
&
Right
,
2
,
true
);
sResult
+=
ByteToString
(
(
BYTE
*
)
&
Bottom
,
2
,
true
);
sResult
+=
ByteToString
(
(
BYTE
*
)
&
Inch
,
2
,
true
);
sResult
+=
ByteToString
(
(
BYTE
*
)
&
Reserved
,
4
,
true
);
sResult
+=
ByteToString
(
(
BYTE
*
)
&
Checksum
,
2
,
true
);
return
sResult
;
}
CString
ByteToString
(
BYTE
*
pbData
,
int
nSize
,
bool
bLittleEnd
=
true
)
...
...
@@ -971,7 +971,7 @@ class ShapeReader : public RtfAbstractReader
{
CString
sValue
;
sValue
=
oText
;
m_sPropValue
.
Append
(
sValue
)
;
m_sPropValue
+=
sValue
;
}
};
private:
...
...
@@ -1490,7 +1490,7 @@ public:
}
void
ExecuteText
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
CString
sText
)
{
m_oBookmarkStart
.
m_sName
.
Append
(
sText
)
;
m_oBookmarkStart
.
m_sName
+=
sText
;
}
};
...
...
@@ -1503,7 +1503,7 @@ public:
}
void
ExecuteText
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
CString
sText
)
{
m_oBookmarkEnd
.
m_sName
.
Append
(
sText
)
;
m_oBookmarkEnd
.
m_sName
+=
sText
;
}
};
...
...
ASCOfficeRtfFile/RtfFormatLib/source/IdGenerator.h
View file @
0a7bcfdd
...
...
@@ -137,7 +137,7 @@ public:
sId
.
AppendFormat
(
_T
(
"%d"
),
m_nOleId
++
);
CString
sResult
=
_T
(
"_1330071130"
);
sResult
=
sResult
.
Left
(
sResult
.
GetLength
()
-
sId
.
GetLength
()
);
sResult
.
Append
(
sId
)
;
sResult
+=
sId
;
return
sResult
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfBookmark.cpp
View file @
0a7bcfdd
...
...
@@ -40,15 +40,16 @@
CString
RtfBookmarkStart
::
RenderToRtf
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
//ATLASSERT( false == m_sName.IsEmpty() );
sResult
.
Append
(
_T
(
"{
\\
*
\\
bkmkstart"
)
);
sResult
+=
_T
(
"{
\\
*
\\
bkmkstart"
);
if
(
PROP_DEF
!=
nFirstColumn
)
sResult
.
AppendFormat
(
_T
(
"
\\
bkmkcolf%d"
),
nFirstColumn
);
if
(
PROP_DEF
!=
nLastColumn
)
sResult
.
AppendFormat
(
_T
(
"
\\
bkmkcoll%d"
),
nLastColumn
);
sResult
.
Append
(
_T
(
" "
));
sResult
.
Append
(
RtfChar
::
renderRtfText
(
m_sName
,
oRenderParameter
.
poDocument
,
NULL
)
);
sResult
.
Append
(
_T
(
"}"
));
sResult
+=
_T
(
" "
);
sResult
+=
RtfChar
::
renderRtfText
(
m_sName
,
oRenderParameter
.
poDocument
,
NULL
);
sResult
+=
_T
(
"}"
);
return
sResult
;
}
CString
RtfBookmarkStart
::
RenderToOOX
(
RenderParameter
oRenderParameter
)
...
...
@@ -82,18 +83,19 @@ CString RtfBookmarkStart::RenderToOOX(RenderParameter oRenderParameter)
CString
RtfBookmarkEnd
::
RenderToRtf
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
//ATLASSERT( false == m_sName.IsEmpty() );
sResult
.
Append
(
_T
(
"{
\\
*
\\
bkmkend"
));
sResult
.
Append
(
_T
(
" "
));
sResult
.
Append
(
RtfChar
::
renderRtfText
(
m_sName
,
oRenderParameter
.
poDocument
,
NULL
)
);
sResult
.
Append
(
_T
(
"}"
));
sResult
+=
_T
(
"{
\\
*
\\
bkmkend"
);
sResult
+=
_T
(
" "
);
sResult
+=
RtfChar
::
renderRtfText
(
m_sName
,
oRenderParameter
.
poDocument
,
NULL
);
sResult
+=
_T
(
"}"
);
return
sResult
;
}
CString
RtfBookmarkEnd
::
RenderToOOX
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
//ATLASSERT( false == m_sName.IsEmpty() );
sResult
.
Append
(
_T
(
"<w:bookmarkEnd"
)
);
sResult
+=
_T
(
"<w:bookmarkEnd"
);
OOXWriter
*
poOOXWriter
=
static_cast
<
OOXWriter
*>
(
oRenderParameter
.
poWriter
);
RtfDocument
*
poDocument
=
static_cast
<
RtfDocument
*>
(
oRenderParameter
.
poDocument
);
...
...
@@ -108,22 +110,27 @@ CString RtfBookmarkEnd::RenderToOOX(RenderParameter oRenderParameter)
poOOXWriter
->
m_aBookmarksId
[
m_sName
]
=
nID
;
}
sResult
.
AppendFormat
(
_T
(
" w:id =
\"
%d
\"
"
),
nID
);
sResult
.
Append
(
_T
(
"/>"
)
);
sResult
+=
_T
(
"/>"
);
return
sResult
;
}
CString
RtfFootnote
::
RenderToRtf
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
sResult
.
Append
(
_T
(
"{"
));
sResult
.
Append
(
m_oCharProp
.
RenderToRtf
(
oRenderParameter
)
);
sResult
.
Append
(
_T
(
"
\\
chftn"
));
sResult
.
Append
(
_T
(
"{
\\
footnote"
));
sResult
+=
_T
(
"{"
);
sResult
+=
m_oCharProp
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
_T
(
"
\\
chftn"
);
sResult
+=
_T
(
"{
\\
footnote"
);
if
(
true
==
m_bEndNote
)
sResult
.
Append
(
_T
(
"
\\
ftnalt"
));
sResult
+=
_T
(
"
\\
ftnalt"
);
for
(
int
i
=
0
;
i
<
m_oContent
->
GetCount
();
i
++
)
sResult
.
Append
(
m_oContent
->
RenderToRtf
(
oRenderParameter
)
);
sResult
.
Append
(
_T
(
"}"
));
sResult
.
Append
(
_T
(
"}"
));
sResult
+=
m_oContent
->
RenderToRtf
(
oRenderParameter
);
sResult
+=
_T
(
"}"
);
sResult
+=
_T
(
"}"
);
return
sResult
;
}
CString
RtfFootnote
::
RenderToOOX
(
RenderParameter
oRenderParameter
)
...
...
@@ -139,16 +146,18 @@ CString RtfFootnote::RenderToOOX(RenderParameter oRenderParameter)
oNewParameter
.
nType
=
RENDER_TO_OOX_PARAM_UNKNOWN
;
oNewParameter
.
poRels
=
poEndnoteWriter
->
m_oRelsWriter
.
get
();
poEndnoteWriter
->
AddEndnote
(
_T
(
""
),
nID
,
m_oContent
->
RenderToOOX
(
oNewParameter
)
);
sResult
.
Append
(
_T
(
"<w:r>"
)
);
sResult
+=
_T
(
"<w:r>"
);
CString
srPr
=
m_oCharProp
.
RenderToOOX
(
oRenderParameter
);
if
(
false
==
srPr
.
IsEmpty
()
)
{
sResult
.
Append
(
_T
(
"<w:rPr>"
)
);
sResult
+=
_T
(
"<w:rPr>"
);
sResult
+=
srPr
;
sResult
.
Append
(
_T
(
"</w:rPr>"
)
);
sResult
+=
_T
(
"</w:rPr>"
);
}
sResult
.
AppendFormat
(
_T
(
"<w:endnoteReference w:id=
\"
%d
\"
/>"
),
nID
);
sResult
.
Append
(
_T
(
"</w:r>"
)
);
sResult
+=
_T
(
"</w:r>"
);
}
else
{
...
...
@@ -158,16 +167,18 @@ CString RtfFootnote::RenderToOOX(RenderParameter oRenderParameter)
oNewParameter
.
nType
=
RENDER_TO_OOX_PARAM_UNKNOWN
;
oNewParameter
.
poRels
=
poFootnoteWriter
->
m_oRelsWriter
.
get
();
poFootnoteWriter
->
AddFootnote
(
_T
(
""
),
nID
,
m_oContent
->
RenderToOOX
(
oNewParameter
)
);
sResult
.
Append
(
_T
(
"<w:r>"
)
);
sResult
+=
_T
(
"<w:r>"
);
CString
srPr
=
m_oCharProp
.
RenderToOOX
(
oRenderParameter
);
if
(
false
==
srPr
.
IsEmpty
()
)
{
sResult
.
Append
(
_T
(
"<w:rPr>"
)
);
sResult
+=
_T
(
"<w:rPr>"
);
sResult
+=
srPr
;
sResult
.
Append
(
_T
(
"</w:rPr>"
)
);
sResult
+=
_T
(
"</w:rPr>"
);
}
sResult
.
AppendFormat
(
_T
(
"<w:footnoteReference w:id=
\"
%d
\"
/>"
),
nID
);
sResult
.
Append
(
_T
(
"</w:r>"
)
);
sResult
+=
_T
(
"</w:r>"
);
}
return
sResult
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.cpp
View file @
0a7bcfdd
...
...
@@ -84,7 +84,10 @@ CString RtfChar::renderRtfText( CString& sText, void* poDocument, RtfCharPropert
CString
sTextBack
=
RtfUtility
::
convert_string
(
ansiStr
.
begin
(),
ansiStr
.
end
(),
nCodePage
);
//обратное преобразование чтобы понять какие символы свонвертировались неправильно
for
(
int
i
=
0
;
i
<
sText
.
GetLength
()
&&
i
<
sTextBack
.
GetLength
()
;
i
++
)
while
(
sTextBack
.
GetLength
()
<
sText
.
GetLength
())
sTextBack
+=
L"-"
;
for
(
int
i
=
0
;
i
<
sText
.
GetLength
()
;
i
++
)
{
bool
bWriteUnicode
=
true
;
...
...
@@ -126,9 +129,9 @@ CString RtfChar::renderRtfText( CString& sText, void* poDocument, RtfCharPropert
{
sResult
.
AppendFormat
(
_T
(
"
\\
u%d*"
),
nUnicode
);
}
else
if
(
0x8000
<
nUnicode
&&
nUnicode
<=
0xffff
)
{
sResult
.
AppendFormat
(
_T
(
"
\\
u%d*"
),
nUnicode
-
0x10000
);
sResult
.
AppendFormat
(
_T
(
"
\\
u%d*"
),
nUnicode
-
0x10000
);
//??? font alt name china ALL FONTS NEW.docx (Mekanik LET)
}
else
{
sResult
.
Append
(
_T
(
"
\\
u9633*"
)
);
sResult
+=
_T
(
"
\\
u9633*"
);
}
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.h
View file @
0a7bcfdd
This diff is collapsed.
Click to expand it.
ASCOfficeRtfFile/RtfFormatLib/source/RtfGlobalTables.cpp
View file @
0a7bcfdd
...
...
@@ -50,7 +50,7 @@ CString RtfFontTable::RenderToRtf(RenderParameter oRenderParameter)
CString
sResult
;
if
(
m_aArray
.
size
()
>
0
)
{
sResult
.
Append
(
_T
(
"{
\\
fonttbl"
)
);
sResult
+=
_T
(
"{
\\
fonttbl"
);
RenderParameter
oNewParameter
=
oRenderParameter
;
oNewParameter
.
nType
=
RENDER_TO_RTF_PARAM_FONT_TBL
;
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
...
...
@@ -71,39 +71,44 @@ CString RtfListTable::RenderToOOX(RenderParameter oRenderParameter)
for
(
int
i
=
0
;
i
<
(
int
)
m_aPictureList
.
GetCount
();
i
++
)
{
sResult
.
AppendFormat
(
_T
(
"<w:numPicBullet w:numPicBulletId=
\"
%d
\"
>"
),
i
);
sResult
.
Append
(
m_aPictureList
[
i
]
->
RenderToOOX
(
oNewParam
)
);
sResult
.
Append
(
_T
(
"</w:numPicBullet>"
)
);
sResult
+=
m_aPictureList
[
i
]
->
RenderToOOX
(
oNewParam
);
sResult
+=
_T
(
"</w:numPicBullet>"
);
}
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
sResult
.
Append
(
m_aArray
[
i
].
RenderToOOX
(
oRenderParameter
)
);
sResult
+=
m_aArray
[
i
].
RenderToOOX
(
oRenderParameter
);
}
else
{
RenderParameter
oNewParam
=
oRenderParameter
;
oNewParam
.
nType
=
RENDER_TO_OOX_PARAM_OLDLIST_ABS
;
RtfDocument
*
poDocument
=
static_cast
<
RtfDocument
*>
(
oRenderParameter
.
poDocument
);
for
(
int
i
=
0
;
i
<
(
int
)
poDocument
->
m_aOldLists
.
size
();
i
++
)
sResult
.
Append
(
poDocument
->
m_aOldLists
[
i
]
->
RenderToOOX
(
oNewParam
)
);
{
sResult
+=
poDocument
->
m_aOldLists
[
i
]
->
RenderToOOX
(
oNewParam
);
}
}
return
sResult
;
}
CString
RtfListOverrideTable
::
RenderToOOX
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
if
(
m_aArray
.
size
()
>
0
)
if
(
!
m_aArray
.
empty
()
)
{
RenderParameter
oNewParam
=
oRenderParameter
;
oNewParam
.
nType
=
RENDER_TO_OOX_PARAM_UNKNOWN
;
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
sResult
.
Append
(
m_aArray
[
i
].
RenderToOOX
(
oNewParam
)
);
sResult
+=
m_aArray
[
i
].
RenderToOOX
(
oNewParam
);
}
else
{
RenderParameter
oNewParam
=
oRenderParameter
;
oNewParam
.
nType
=
RENDER_TO_OOX_PARAM_OLDLIST_OVR
;
RtfDocument
*
poDocument
=
static_cast
<
RtfDocument
*>
(
oRenderParameter
.
poDocument
);
for
(
int
i
=
0
;
i
<
(
int
)
poDocument
->
m_aOldLists
.
size
();
i
++
)
sResult
.
Append
(
poDocument
->
m_aOldLists
[
i
]
->
RenderToOOX
(
oNewParam
)
);
sResult
+=
poDocument
->
m_aOldLists
[
i
]
->
RenderToOOX
(
oNewParam
);
}
return
sResult
;
}
ASCOfficeRtfFile/RtfFormatLib/source/RtfGlobalTables.h
View file @
0a7bcfdd
...
...
@@ -65,10 +65,10 @@ public:
CString
RenderToOOX
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
if
(
m_aArray
.
size
()
>
0
)
if
(
!
m_aArray
.
empty
()
)
{
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
sResult
.
Append
(
m_aArray
[
i
].
RenderToOOX
(
oRenderParameter
)
);
sResult
+=
m_aArray
[
i
].
RenderToOOX
(
oRenderParameter
);
}
return
sResult
;
...
...
@@ -143,14 +143,16 @@ public:
CString
sResult
;
if
(
m_aArray
.
size
()
>
0
)
{
sResult
.
Append
(
_T
(
"{
\\
colortbl;"
)
);
sResult
+=
_T
(
"{
\\
colortbl;"
);
RenderParameter
oNewParameter
=
oRenderParameter
;
oNewParameter
.
nType
=
RENDER_TO_RTF_PARAM_COLOR_TBL
;
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
+=
m_aArray
[
i
].
RenderToRtf
(
oNewParameter
);
}
sResult
.
Append
(
_T
(
"}"
));
sResult
+=
_T
(
"}"
);
}
return
sResult
;
}
...
...
@@ -243,13 +245,15 @@ public:
CString
sResult
;
if
(
m_aArray
.
size
()
>
0
)
{
sResult
.
Append
(
_T
(
"{
\\
stylesheet"
));
sResult
+=
_T
(
"{
\\
stylesheet"
);
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
CString
str
=
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
);
sResult
.
AppendFormat
(
_T
(
"%ls
\n\n
"
),
str
.
GetBuffer
());
}
sResult
.
Append
(
_T
(
"}"
));
sResult
+=
_T
(
"}"
);
}
return
sResult
;
}
...
...
@@ -257,7 +261,9 @@ public:
{
CString
sResult
;
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
sResult
.
Append
(
m_aArray
[
i
]
->
RenderToOOX
(
oRenderParameter
));
{
sResult
+=
m_aArray
[
i
]
->
RenderToOOX
(
oRenderParameter
);
}
return
sResult
;
}
};
...
...
@@ -293,7 +299,7 @@ public:
// CString sResult;
// if( m_aArray.size() > 0 )
// {
// sResult
.Append(
_T("{\\*\\latentstyles"));
// sResult
+=
_T("{\\*\\latentstyles"));
// if( PROP_DEF != m_nCount )
// sResult.AppendFormat(_T("\\lsdstimax%d"),m_nCount);
// if( PROP_DEF != m_nLocked )
...
...
@@ -306,11 +312,11 @@ public:
// sResult.AppendFormat(_T("\\lsdqformatdef%d"),m_nQFormat);
// if( PROP_DEF != m_nPriority )
// sResult.AppendFormat(_T("\\lsdprioritydef%d"),m_nPriority);
// sResult
.Append(
_T("{\\lsdlockedexcept "));
// sResult
+=
_T("{\\lsdlockedexcept "));
// for( int i = 0; i < (int)m_aArray.size(); i++ )
// sResult
.Append(
m_aArray[i].RenderToRtf( oRenderParameter ));
// sResult
.Append(_T("}")
);
// sResult
.Append(_T("}")
);
// sResult
+=
m_aArray[i].RenderToRtf( oRenderParameter ));
// sResult
+= _T("}"
);
// sResult
+= _T("}"
);
// }
// return sResult;
// }
...
...
@@ -372,23 +378,23 @@ public:
CString
sResult
;
if
(
m_aArray
.
size
()
>
0
)
{
sResult
.
Append
(
_T
(
"{
\\
*
\\
listtable "
)
);
sResult
+=
_T
(
"{
\\
*
\\
listtable "
);
if
(
m_aPictureList
.
GetCount
()
>
0
)
{
sResult
.
Append
(
_T
(
"{
\\
*
\\
listpicture"
)
);
sResult
+=
_T
(
"{
\\
*
\\
listpicture"
);
for
(
int
i
=
0
;
i
<
(
int
)
m_aPictureList
.
GetCount
();
i
++
)
{
sResult
.
Append
(
m_aPictureList
[
i
]
->
RenderToRtf
(
oRenderParameter
)
);
sResult
+=
m_aPictureList
[
i
]
->
RenderToRtf
(
oRenderParameter
);
}
sResult
.
Append
(
_T
(
"}"
)
);
sResult
+=
_T
(
"}"
);
}
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
.
Append
(
_T
(
"{"
)
);
sResult
.
Append
(
m_aArray
[
i
].
RenderToRtf
(
oRenderParameter
)
);
sResult
.
Append
(
_T
(
"}"
)
);
sResult
+=
_T
(
"{"
);
sResult
+=
m_aArray
[
i
].
RenderToRtf
(
oRenderParameter
);
sResult
+=
_T
(
"}"
);
}
sResult
.
Append
(
_T
(
"}"
)
);
sResult
+=
_T
(
"}"
);
}
return
sResult
;
}
...
...
@@ -412,14 +418,14 @@ public:
CString
sResult
;
if
(
m_aArray
.
size
()
>
0
)
{
sResult
.
Append
(
_T
(
"{
\\
*
\\
listoverridetable"
)
);
sResult
+=
_T
(
"{
\\
*
\\
listoverridetable"
);
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
.
Append
(
_T
(
"{"
)
);
sResult
.
Append
(
m_aArray
[
i
].
RenderToRtf
(
oRenderParameter
)
);
sResult
.
Append
(
_T
(
"}"
)
);
sResult
+=
_T
(
"{"
);
sResult
+=
m_aArray
[
i
].
RenderToRtf
(
oRenderParameter
);
sResult
+=
_T
(
"}"
);
}
sResult
.
Append
(
_T
(
"}"
)
);
sResult
+=
_T
(
"}"
);
}
return
sResult
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.cpp
View file @
0a7bcfdd
...
...
@@ -107,7 +107,7 @@ CString RtfMath::RenderToRtf(RenderParameter oRenderParameter)
oNewParameter
.
nType
=
RENDER_TO_RTF_PARAM_UNKNOWN
;
for
(
int
i
=
0
;
i
<
m_oVal
.
GetCount
();
i
++
)
{
sVal
.
Append
(
_T
(
" "
)
+
m_oVal
[
i
]
->
RenderToRtf
(
oNewParameter
)
);
sVal
+=
_T
(
" "
)
+
m_oVal
[
i
]
->
RenderToRtf
(
oNewParameter
);
}
}
if
(
!
sVal
.
IsEmpty
())
...
...
@@ -118,7 +118,7 @@ CString RtfMath::RenderToRtf(RenderParameter oRenderParameter)
{
oNewParameter
.
nType
=
RENDER_TO_RTF_PARAM_NESTED
;
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
sResult
.
Append
(
m_aArray
[
i
]
->
RenderToRtf
(
oNewParameter
)
);
sResult
+=
m_aArray
[
i
]
->
RenderToRtf
(
oNewParameter
);
}
sResult
+=
_T
(
"}"
);
...
...
@@ -160,7 +160,7 @@ CString RtfMath::RenderToOOX(RenderParameter oRenderParameter)
}
}
sResult
.
Append
(
_T
(
"<"
)
);
sResult
+=
_T
(
"<"
);
sResult
+=
m_sOOXName
;
if
(
false
==
sVal
.
IsEmpty
()
)
...
...
@@ -170,23 +170,23 @@ CString RtfMath::RenderToOOX(RenderParameter oRenderParameter)
if
(
sVal
==
L"on"
)
sVal
=
L"1"
;
else
sVal
=
L"0"
;
}
sResult
.
Append
(
_T
(
" m:val=
\"
"
)
);
sResult
+=
_T
(
" m:val=
\"
"
);
sResult
+=
sVal
;
sResult
.
Append
(
_T
(
"
\"
"
)
);
sResult
+=
_T
(
"
\"
"
);
}
sResult
.
Append
(
_T
(
">"
)
);
sResult
+=
_T
(
">"
);
sResult
+=
sProp
;
sResult
+=
sContent
;
sResult
.
Append
(
_T
(
"</"
)
);
sResult
+=
_T
(
"</"
);
sResult
+=
m_sOOXName
;
sResult
.
Append
(
_T
(
">"
)
);
sResult
+=
_T
(
">"
);
//альтернативная картинка
// if( NULL != m_oPicture )
// sResult
.Append( m_oPicture->RenderToOOX(oRenderParameter)
);
// sResult
+= m_oPicture->RenderToOOX(oRenderParameter
);
return
sResult
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfOldList.cpp
View file @
0a7bcfdd
...
...
@@ -36,7 +36,7 @@ CString RtfOldList::RenderToRtf(RenderParameter oRenderParameter)
{
CString
sResult
;
if
(
NULL
!=
m_oText
)
sResult
.
Append
(
m_oText
->
RenderToRtf
(
oRenderParameter
)
);
sResult
+=
m_oText
->
RenderToRtf
(
oRenderParameter
);
return
sResult
;
}
CString
RtfOldList
::
RenderToOOX
(
RenderParameter
oRenderParameter
)
...
...
@@ -46,8 +46,8 @@ CString RtfOldList::RenderToOOX(RenderParameter oRenderParameter)
{
//сохраняем как список
if
(
RENDER_TO_OOX_PARAM_OLDLIST_ABS
==
oRenderParameter
.
nType
)
{
CString
sCharProp
=
m_oLevelText
->
m_oProperty
.
m_oCharProperty
.
RenderToOOX
(
oRenderParameter
);
CString
sParProp
=
m_oLevelText
->
m_oProperty
.
RenderToOOX
(
oRenderParameter
);
CString
sCharProp
=
m_oLevelText
->
m_oProperty
.
m_oCharProperty
.
RenderToOOX
(
oRenderParameter
);
CString
sParProp
=
m_oLevelText
->
m_oProperty
.
RenderToOOX
(
oRenderParameter
);
RenderParameter
oNewParameter
=
oRenderParameter
;
oNewParameter
.
nType
=
RENDER_TO_OOX_PARAM_PLAIN
;
...
...
@@ -59,33 +59,37 @@ CString RtfOldList::RenderToOOX(RenderParameter oRenderParameter)
sResult
+=
_T
(
"<w:numFmt w:val=
\"
bullet
\"
/>"
);
if
(
!
sText
.
IsEmpty
()
)
sResult
.
AppendFormat
(
_T
(
"<w:lvlText w:val=
\"
%ls
\"
/>"
),
Utils
::
PrepareToXML
(
sText
).
GetBuffer
()
);
sResult
+=
_T
(
"<w:lvlText w:val=
\"
"
)
+
Utils
::
PrepareToXML
(
sText
)
+
_T
(
"
\"
/>"
);
else
{
sResult
.
Append
(
_T
(
"<w:lvlText w:val=
\"
"
)
);
sResult
+=
_T
(
"<w:lvlText w:val=
\"
"
);
sResult
.
AppendChar
(
0xf0b7
);
sResult
.
Append
(
_T
(
"
\"
/>"
)
);
sResult
+=
_T
(
"
\"
/>"
);
}
if
(
false
==
sParProp
.
IsEmpty
()
)
sResult
.
AppendFormat
(
_T
(
"<w:pPr>%ls</w:pPr>"
),
sParProp
.
GetBuffer
()
);
if
(
false
==
sCharProp
.
IsEmpty
()
)
sResult
.
AppendFormat
(
_T
(
"<w:rPr>%ls</w:rPr>"
),
sCharProp
.
GetBuffer
()
);
if
(
!
sParProp
.
IsEmpty
()
)
sResult
+=
_T
(
"<w:pPr>"
)
+
sParProp
+
_T
(
"</w:pPr>"
);
if
(
!
sCharProp
.
IsEmpty
()
)
sResult
+=
_T
(
"<w:rPr>"
)
+
sCharProp
+
_T
(
"</w:rPr>"
);
if
(
lj_none
!=
m_eLevelJust
)
{
switch
(
m_eLevelJust
)
{
case
lj_left
:
sResult
.
Append
(
_T
(
"<w:lvlJc w:val=
\"
left
\"
/>"
));
break
;
case
lj_center
:
sResult
.
Append
(
_T
(
"<w:lvlJc w:val=
\"
center
\"
/>"
));
break
;
case
lj_right
:
sResult
.
Append
(
_T
(
"<w:lvlJc w:val=
\"
right
\"
/>"
));
break
;
case
lj_left
:
sResult
+=
_T
(
"<w:lvlJc w:val=
\"
left
\"
/>"
);
break
;
case
lj_center
:
sResult
+=
_T
(
"<w:lvlJc w:val=
\"
center
\"
/>"
);
break
;
case
lj_right
:
sResult
+=
_T
(
"<w:lvlJc w:val=
\"
right
\"
/>"
);
break
;
}
}
else
sResult
.
Append
(
_T
(
"<w:lvlJc w:val=
\"
left
\"
/>"
));
sResult
.
Append
(
_T
(
"</w:lvl>"
));
sResult
.
Append
(
_T
(
"</w:abstractNum>"
)
);
sResult
+=
_T
(
"<w:lvlJc w:val=
\"
left
\"
/>"
);
sResult
+=
_T
(
"</w:lvl>"
);
sResult
+=
_T
(
"</w:abstractNum>"
);
}
else
if
(
RENDER_TO_OOX_PARAM_OLDLIST_OVR
==
oRenderParameter
.
nType
)
sResult
.
AppendFormat
(
_T
(
"<w:num w:numId=
\"
%d
\"
><w:abstractNumId w:val=
\"
%d
\"
/></w:num>"
),
m_nLs
,
m_nLs
);
sResult
.
AppendFormat
(
_T
(
"<w:num w:numId=
\"
%d
\"
><w:abstractNumId w:val=
\"
%d
\"
/></w:num>"
),
m_nLs
,
m_nLs
);
else
{
if
(
PROP_DEF
!=
m_nLs
&&
PROP_DEF
!=
m_nIlvl
)
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.cpp
View file @
0a7bcfdd
...
...
@@ -43,23 +43,23 @@ CString RtfOle::RenderToOOX(RenderParameter oRenderParameter)
CString
sResult
;
if
(
RENDER_TO_OOX_PARAM_OLE_ONLY
==
oRenderParameter
.
nType
)
{
sResult
.
Append
(
RenderToOOXOnlyOle
(
oRenderParameter
)
);
sResult
+=
RenderToOOXOnlyOle
(
oRenderParameter
);
}
else
{
sResult
.
Append
(
_T
(
"<w:r>"
)
);
sResult
+=
_T
(
"<w:r>"
);
sResult
.
AppendFormat
(
_T
(
"<w:object w:dxaOrig=
\"
%d
\"
w:dyaOrig=
\"
%d
\"
>"
),
m_nWidth
,
m_nHeight
);
RenderParameter
oNewRenderParameter
=
oRenderParameter
;
oNewRenderParameter
.
nType
=
RENDER_TO_OOX_PARAM_SHAPE_WSHAPE2
;
m_oResultPic
->
m_bIsOle
=
true
;
sResult
.
Append
(
m_oResultPic
->
RenderToOOX
(
oNewRenderParameter
)
);
sResult
+=
m_oResultPic
->
RenderToOOX
(
oNewRenderParameter
);
oNewRenderParameter
.
nValue
=
m_oResultPic
->
m_nID
;
sResult
.
Append
(
RenderToOOXOnlyOle
(
oNewRenderParameter
)
);
sResult
+=
RenderToOOXOnlyOle
(
oNewRenderParameter
);
sResult
.
Append
(
_T
(
"</w:object>"
)
);
sResult
.
Append
(
_T
(
"</w:r>"
)
);
sResult
+=
_T
(
"</w:object>"
);
sResult
+=
_T
(
"</w:r>"
);
}
return
sResult
;
}
...
...
@@ -71,22 +71,23 @@ CString RtfOle::RenderToOOXOnlyOle(RenderParameter oRenderParameter)
OOXRelsWriter
*
poRelsWriter
=
static_cast
<
OOXRelsWriter
*>
(
oRenderParameter
.
poRels
);
RtfDocument
*
poDocument
=
static_cast
<
RtfDocument
*>
(
oRenderParameter
.
poDocument
);
sResult
.
Append
(
_T
(
"<o:OLEObject"
)
);
sResult
+=
_T
(
"<o:OLEObject"
);
switch
(
m_eOleType
)
{
case
ot_link
:
sResult
.
Append
(
_T
(
" Type=
\"
Link
\"
"
)
);
break
;
default:
sResult
.
Append
(
_T
(
" Type=
\"
Embed
\"
"
)
);
break
;
case
ot_link
:
sResult
+=
_T
(
" Type=
\"
Link
\"
"
);
break
;
default:
sResult
+=
_T
(
" Type=
\"
Embed
\"
"
);
break
;
}
sResult
.
AppendFormat
(
_T
(
" ProgID=
\"
%ls
\"
"
),
m_sOleClass
.
GetBuffer
()
);
sResult
+=
_T
(
" ProgID=
\"
"
)
+
m_sOleClass
+
_T
(
"
\"
"
);
sResult
.
AppendFormat
(
_T
(
" ShapeID=
\"
_x0000_s%d
\"
"
),
poDocument
->
GetShapeId
(
oRenderParameter
.
nValue
)
);
sResult
.
Append
(
_T
(
" DrawAspect=
\"
Content
\"
"
)
);
sResult
.
AppendFormat
(
_T
(
" ObjectID=
\"
%ls
\"
"
),
poDocument
->
m_oIdGenerator
.
Generate_OleId
().
GetBuffer
()
);
sResult
+=
_T
(
" DrawAspect=
\"
Content
\"
"
);
sResult
+=
_T
(
" ObjectID=
\"
"
)
+
poDocument
->
m_oIdGenerator
.
Generate_OleId
()
+
_T
(
"
\"
"
);
CString
sExtension
=
_T
(
"bin"
);
CString
sMime
=
_T
(
"application/vnd.openxmlformats-officedocument.oleObject"
);
CString
sExtension
=
_T
(
"bin"
);
CString
sMime
=
_T
(
"application/vnd.openxmlformats-officedocument.oleObject"
);
CString
sFilenameRels
;
sFilenameRels
.
AppendFormat
(
_T
(
"oleObject%d.%ls"
),
poDocument
->
m_oIdGenerator
.
Generate_OleIndex
(),
sExtension
.
GetBuffer
());
sFilenameRels
.
AppendFormat
(
_T
(
"oleObject%d."
),
poDocument
->
m_oIdGenerator
.
Generate_OleIndex
());
sFilenameRels
+=
sExtension
;
CString
sFilenameFull
=
poOOXWriter
->
m_sTargetFolder
+
FILE_SEPARATOR_STR
+
_T
(
"word"
)
+
FILE_SEPARATOR_STR
+
_T
(
"embeddings"
);
...
...
@@ -99,8 +100,8 @@ CString RtfOle::RenderToOOXOnlyOle(RenderParameter oRenderParameter)
poOOXWriter
->
m_oContentTypes
.
AddExtension
(
sMime
,
sExtension
);
CString
srId
=
poRelsWriter
->
AddRelationship
(
_T
(
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"
),
sFilenameRels
);
sResult
.
AppendFormat
(
_T
(
" r:id=
\"
%ls
\"
"
),
srId
.
GetBuffer
()
);
sResult
.
Append
(
_T
(
"/>"
)
);
sResult
+=
_T
(
" r:id=
\"
"
)
+
srId
+
_T
(
"
\"
"
);
sResult
+=
_T
(
"/>"
);
return
sResult
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.h
View file @
0a7bcfdd
...
...
@@ -65,36 +65,38 @@ public:
}
CString
RenderToRtf
(
RenderParameter
oRenderParameter
)
{
if
(
false
==
IsValid
()
)
return
_T
(
""
);
CString
sResult
;
sResult
.
Append
(
_T
(
"{
\\
object"
)
);
if
(
!
IsValid
()
)
return
_T
(
""
);
CString
sResult
=
_T
(
"{
\\
object"
)
;
if
(
PROP_DEF
!=
m_eOleType
)
{
switch
(
m_eOleType
)
{
case
ot_emb
:
sResult
.
Append
(
_T
(
"
\\
objemb"
)
);
break
;
case
ot_link
:
sResult
.
Append
(
_T
(
"
\\
objlink"
)
);
break
;
case
ot_emb
:
sResult
+=
_T
(
"
\\
objemb"
);
break
;
case
ot_link
:
sResult
+=
_T
(
"
\\
objlink"
);
break
;
}
}
RENDER_RTF_INT
(
m_nWidth
,
sResult
,
_T
(
"objw"
)
);
RENDER_RTF_INT
(
m_nHeight
,
sResult
,
_T
(
"objh"
)
);
if
(
_T
(
""
)
!=
m_sOleClass
)
sResult
.
AppendFormat
(
_T
(
"{
\\
*
\\
objclass %ls}"
),
m_sOleClass
.
GetBuffer
()
);
if
(
_T
(
""
)
!=
m_sOleFilename
)
if
(
!
m_sOleClass
.
IsEmpty
()
)
sResult
+=
_T
(
"{
\\
*
\\
objclass "
)
+
m_sOleClass
+
_T
(
"}"
);
if
(
!
m_sOleFilename
.
IsEmpty
()
)
{
CString
str
=
RtfUtility
::
RtfInternalEncoder
::
Encode
(
m_sOleFilename
);
sResult
.
AppendFormat
(
_T
(
"{
\\
*
\\
objdata %ls}"
),
str
.
GetBuffer
()
);
sResult
+=
_T
(
"{
\\
*
\\
objdata "
)
+
str
+
_T
(
"}"
);
}
if
(
NULL
!=
m_oResultPic
)
{
CString
str
=
m_oResultPic
->
RenderToRtf
(
oRenderParameter
);
sResult
.
AppendFormat
(
_T
(
"{
\\
result
\\
pard
\\
plain%ls}"
),
str
.
GetBuffer
()
);
sResult
+=
_T
(
"{
\\
result
\\
pard
\\
plain"
)
+
str
+
_T
(
"}"
);
}
sResult
.
Append
(
_T
(
"}"
)
);
sResult
+=
_T
(
"}"
);
return
sResult
;
}
CString
RenderToOOX
(
RenderParameter
oRenderParameter
);
void
SetFilename
(
CString
sFilename
)
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfPicture.cpp
View file @
0a7bcfdd
...
...
@@ -36,30 +36,30 @@
CString
RtfPicture
::
GenerateWMF
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
sResult
.
Append
(
_T
(
"{
\\
pict"
)
);
sResult
+=
_T
(
"{
\\
pict"
);
//if(-1 != m_nShapeId)
// sResult.AppendFormat(_T("{\\*\\picprop\\shplid%d%ls}"), m_nShapeId, m_oShapeProp.RenderToRtf( oRenderParameter ) );
//else
// sResult.AppendFormat(_T("{\\*\\picprop%ls}"), m_oShapeProp.RenderToRtf( oRenderParameter ) );
////"наши" wmf не растягиваются
RENDER_RTF_INT
(
100
,
sResult
,
_T
(
"picscalex"
)
)
RENDER_RTF_INT
(
100
,
sResult
,
_T
(
"picscaley"
)
)
RENDER_RTF_INT
(
100
,
sResult
,
_T
(
"picscaley"
)
)
//RENDER_RTF_INT( (int)m_dScaleX, sResult, _T("picscalex") )
//RENDER_RTF_INT( (int)m_dScaleY, sResult, _T("picscaley") )
RENDER_RTF_INT
(
m_nCropL
,
sResult
,
_T
(
"piccropl"
)
)
RENDER_RTF_INT
(
m_nCropT
,
sResult
,
_T
(
"piccropt"
)
)
RENDER_RTF_INT
(
m_nCropR
,
sResult
,
_T
(
"piccropr"
)
)
RENDER_RTF_INT
(
m_nCropB
,
sResult
,
_T
(
"piccropb"
)
)
//RENDER_RTF_INT( (int)m_dScaleX, sResult, _T("picscalex") )
//RENDER_RTF_INT( (int)m_dScaleY, sResult, _T("picscaley") )
RENDER_RTF_INT
(
m_nCropL
,
sResult
,
_T
(
"piccropl"
)
)
RENDER_RTF_INT
(
m_nCropT
,
sResult
,
_T
(
"piccropt"
)
)
RENDER_RTF_INT
(
m_nCropR
,
sResult
,
_T
(
"piccropr"
)
)
RENDER_RTF_INT
(
m_nCropB
,
sResult
,
_T
(
"piccropb"
)
)
RENDER_RTF_INT
(
m_nWidth
,
sResult
,
_T
(
"picw"
)
)
RENDER_RTF_INT
(
m_nHeight
,
sResult
,
_T
(
"pich"
)
)
RENDER_RTF_INT
(
m_nWidthGoal
,
sResult
,
_T
(
"picwgoal"
)
)
RENDER_RTF_INT
(
m_nHeightGoal
,
sResult
,
_T
(
"pichgoal"
)
)
RENDER_RTF_INT
(
m_nWidth
,
sResult
,
_T
(
"picw"
)
)
RENDER_RTF_INT
(
m_nHeight
,
sResult
,
_T
(
"pich"
)
)
RENDER_RTF_INT
(
m_nWidthGoal
,
sResult
,
_T
(
"picwgoal"
)
)
RENDER_RTF_INT
(
m_nHeightGoal
,
sResult
,
_T
(
"pichgoal"
)
)
sResult
.
Append
(
_T
(
"
\\
wmetafile8"
)
);
sResult
+=
_T
(
"
\\
wmetafile8"
);
sResult
.
Append
(
_T
(
" "
)
);
sResult
+=
_T
(
" "
);
//сохраняем в темповую директорию и загружаем файл как текст
RtfWriter
*
poWriter
=
static_cast
<
RtfWriter
*>
(
oRenderParameter
.
poWriter
);
...
...
@@ -72,50 +72,49 @@ CString RtfPicture::GenerateWMF(RenderParameter oRenderParameter)
// if( true == SavePicture( piTempPict, sTempFile, IMAGEFORMAT_WMF ) )
// {
// m_aTempFiles.push_back( sTempFile );
// sResult
.Append( RtfInternalEncoder::Encode( sTempFile )
);
// sResult
+= RtfInternalEncoder::Encode( sTempFile
);
// }
//}
//RELEASEINTERFACE( piTempPict );
sResult
.
Append
(
_T
(
"}"
)
);
sResult
+=
_T
(
"}"
);
return
sResult
;
}
CString
RtfPicture
::
RenderToRtf
(
RenderParameter
oRenderParameter
)
{
if
(
false
==
IsValid
()
)
return
_T
(
""
);
CString
sResult
;
if
(
!
IsValid
()
)
return
_T
(
""
);
CString
sResult
=
_T
(
"{
\\
pict"
)
;
sResult
.
Append
(
_T
(
"{
\\
pict"
));
//if(-1 != m_nShapeId)
// sResult.AppendFormat(_T("{\\*\\picprop\\shplid%d%ls}"), m_nShapeId, m_oShapeProp.RenderToRtf( oRenderParameter ) );
//else
// sResult.AppendFormat(_T("{\\*\\picprop%ls}"), m_oShapeProp.RenderToRtf( oRenderParameter ) );
RENDER_RTF_INT
(
(
int
)
m_dScaleX
,
sResult
,
_T
(
"picscalex"
)
)
RENDER_RTF_INT
(
(
int
)
m_dScaleY
,
sResult
,
_T
(
"picscaley"
)
)
RENDER_RTF_INT
(
m_nCropL
,
sResult
,
_T
(
"piccropl"
)
)
RENDER_RTF_INT
(
m_nCropT
,
sResult
,
_T
(
"piccropt"
)
)
RENDER_RTF_INT
(
m_nCropR
,
sResult
,
_T
(
"piccropr"
)
)
RENDER_RTF_INT
(
m_nCropB
,
sResult
,
_T
(
"piccropb"
)
)
RENDER_RTF_INT
(
m_nWidth
,
sResult
,
_T
(
"picw"
)
)
RENDER_RTF_INT
(
m_nHeight
,
sResult
,
_T
(
"pich"
)
)
RENDER_RTF_INT
(
m_nWidthGoal
,
sResult
,
_T
(
"picwgoal"
)
)
RENDER_RTF_INT
(
m_nHeightGoal
,
sResult
,
_T
(
"pichgoal"
)
)
switch
(
eDataType
)
{
case
dt_emf
:
sResult
.
Append
(
_T
(
"
\\
emfblip"
));
break
;
case
dt_wmf
:
sResult
.
Append
(
_T
(
"
\\
wmetafile8"
));
break
;
case
dt_png
:
sResult
.
Append
(
_T
(
"
\\
pngblip"
));
break
;
case
dt_jpg
:
sResult
.
Append
(
_T
(
"
\\
jpegblip"
));
break
;
//case dt_bmp: sResult.Append(_T("wbitmap8"));
break;
}
sResult
.
Append
(
_T
(
" "
)
);
sResult
.
Append
(
RtfUtility
::
RtfInternalEncoder
::
Encode
(
m_sPicFilename
)
);
sResult
.
Append
(
_T
(
"}"
)
);
RENDER_RTF_INT
(
(
int
)
m_dScaleY
,
sResult
,
_T
(
"picscaley"
)
)
RENDER_RTF_INT
(
m_nCropL
,
sResult
,
_T
(
"piccropl"
)
)
RENDER_RTF_INT
(
m_nCropT
,
sResult
,
_T
(
"piccropt"
)
)
RENDER_RTF_INT
(
m_nCropR
,
sResult
,
_T
(
"piccropr"
)
)
RENDER_RTF_INT
(
m_nCropB
,
sResult
,
_T
(
"piccropb"
)
)
RENDER_RTF_INT
(
m_nWidth
,
sResult
,
_T
(
"picw"
)
)
RENDER_RTF_INT
(
m_nHeight
,
sResult
,
_T
(
"pich"
)
)
RENDER_RTF_INT
(
m_nWidthGoal
,
sResult
,
_T
(
"picwgoal"
)
)
RENDER_RTF_INT
(
m_nHeightGoal
,
sResult
,
_T
(
"pichgoal"
)
)
switch
(
eDataType
)
{
case
dt_emf
:
sResult
+=
_T
(
"
\\
emfblip"
);
break
;
case
dt_wmf
:
sResult
+=
_T
(
"
\\
wmetafile8"
);
break
;
case
dt_png
:
sResult
+=
_T
(
"
\\
pngblip"
);
break
;
case
dt_jpg
:
sResult
+=
_T
(
"
\\
jpegblip"
);
break
;
//case dt_bmp: sResult += _T("wbitmap8");
break;
}
sResult
+=
_T
(
" "
);
sResult
+=
RtfUtility
::
RtfInternalEncoder
::
Encode
(
m_sPicFilename
);
sResult
+=
_T
(
"}"
);
return
sResult
;
}
CString
RtfPicture
::
RenderToOOX
(
RenderParameter
oRenderParameter
)
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
View file @
0a7bcfdd
This source diff could not be displayed because it is too large. You can
view the blob
instead.
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.h
View file @
0a7bcfdd
...
...
@@ -60,63 +60,63 @@
#define RENDER_OOX_BOOL( prop, sResult, sName)\
if
(
0
==
prop
)
\
{
\
sResult
.
Append
(
_T
(
"<"
)
);
\
sResult
.
Append
(
sName
)
;
\
sResult
+=
_T
(
"<"
);
\
sResult
+=
sName
;
\
sResult
.
AppendFormat
(
_T
(
" w:val=
\"
false
\"
/>"
));
\
}
\
else
if
(
PROP_DEF
!=
prop
)
\
{
\
sResult
.
Append
(
_T
(
"<"
)
);
\
sResult
.
Append
(
sName
)
;
\
sResult
+=
_T
(
"<"
);
\
sResult
+=
sName
;
\
sResult
.
AppendFormat
(
_T
(
" w:val=
\"
true
\"
/>"
));
\
}
#define RENDER_OOX_INT( prop, sResult, sName)\
if
(
PROP_DEF
!=
prop
)
\
{
\
sResult
.
Append
(
_T
(
"<"
)
);
\
sResult
.
Append
(
sName
)
;
\
sResult
+=
_T
(
"<"
);
\
sResult
+=
sName
;
\
sResult
.
AppendFormat
(
_T
(
" w:val=
\"
%d
\"
/>"
),
prop
);
\
}
#define RENDER_OOX_INT_ATTRIBUTE( prop, sResult, sName)\
if
(
PROP_DEF
!=
prop
)
\
{
\
sResult
.
Append
(
_T
(
" "
)
);
\
sResult
.
Append
(
sName
)
;
\
sResult
+=
_T
(
" "
);
\
sResult
+=
sName
;
\
sResult
.
AppendFormat
(
_T
(
"=
\"
%d
\"
"
),
prop
);
\
}
#define RENDER_OOX_BOOL_ATTRIBUTE( prop, sResult, sName)\
if
(
0
==
prop
)
\
{
\
sResult
.
Append
(
_T
(
" "
)
);
\
sResult
.
Append
(
sName
)
;
\
sResult
.
AppendFormat
(
_T
(
"=
\"
0
\"
"
)
);
\
sResult
+=
_T
(
" "
);
\
sResult
+=
sName
;
\
sResult
+=
_T
(
"=
\"
0
\"
"
);
\
}
\
else
if
(
PROP_DEF
!=
prop
)
\
{
\
sResult
.
Append
(
_T
(
" "
)
);
\
sResult
.
Append
(
sName
)
;
\
sResult
.
AppendFormat
(
_T
(
"=
\"
1
\"
"
)
);
\
sResult
+=
_T
(
" "
);
\
sResult
+=
sName
;
\
sResult
+=
_T
(
"=
\"
1
\"
"
);
\
}
#define RENDER_RTF_BOOL( prop, sResult, sName)\
if
(
0
==
prop
)
\
{
\
sResult
.
Append
(
_T
(
"
\\
"
)
);
\
sResult
.
Append
(
sName
)
;
\
sResult
.
Append
(
_T
(
"0"
)
);
\
sResult
+=
_T
(
"
\\
"
);
\
sResult
+=
sName
;
\
sResult
+=
_T
(
"0"
);
\
}
\
else
if
(
PROP_DEF
!=
prop
)
\
{
\
sResult
.
Append
(
_T
(
"
\\
"
)
);
\
sResult
.
Append
(
sName
)
;
\
sResult
+=
_T
(
"
\\
"
);
\
sResult
+=
sName
;
\
}
#define RENDER_RTF_INT( prop, sResult, sName)\
if
(
PROP_DEF
!=
prop
)
\
{
\
sResult
.
Append
(
_T
(
"
\\
"
)
);
\
sResult
.
Append
(
sName
)
;
\
sResult
+=
_T
(
"
\\
"
);
\
sResult
+=
sName
;
\
sResult
.
AppendFormat
(
_T
(
"%d"
),
prop
);
\
}
...
...
@@ -130,15 +130,15 @@ public:
typedef
enum
{
ff_none
,
ff_fnil
,
ff_froman
,
ff_fswiss
,
ff_fmodern
,
ff_fscript
,
ff_fdecor
,
ff_ftech
,
ff_fbidi
}
FontFamily
;
FontTheme
m_eFontTheme
;
FontFamily
m_eFontFamily
;
CString
m_sPanose
;
int
m_nID
;
CString
m_sName
;
CString
m_sAltName
;
int
m_nCharset
;
int
m_nCodePage
;
int
m_nPitch
;
FontTheme
m_eFontTheme
;
FontFamily
m_eFontFamily
;
CString
m_sPanose
;
int
m_nID
;
CString
m_sName
;
CString
m_sAltName
;
int
m_nCharset
;
int
m_nCodePage
;
int
m_nPitch
;
RtfFont
()
{
...
...
@@ -1029,17 +1029,23 @@ public:
{
CString
sResult
;
for
(
int
i
=
0
;
i
<
(
int
)
m_aTabs
.
size
();
i
++
)
sResult
.
Append
(
m_aTabs
[
i
].
RenderToRtf
(
oRenderParameter
)
);
{
sResult
+=
m_aTabs
[
i
].
RenderToRtf
(
oRenderParameter
);
}
return
sResult
;
}
CString
RenderToOOX
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
CString
sTabs
;
CString
sTabs
;
for
(
int
i
=
0
;
i
<
(
int
)
m_aTabs
.
size
();
i
++
)
sTabs
.
Append
(
m_aTabs
[
i
].
RenderToOOX
(
oRenderParameter
)
);
if
(
false
==
sTabs
.
IsEmpty
()
)
sResult
.
AppendFormat
(
_T
(
"<w:tabs>%ls</w:tabs>"
),
sTabs
.
GetBuffer
()
);
{
sTabs
+=
m_aTabs
[
i
].
RenderToOOX
(
oRenderParameter
);
}
CString
sResult
;
if
(
!
sTabs
.
IsEmpty
()
)
sResult
+=
_T
(
"<w:tabs>"
)
+
sTabs
+
_T
(
"</w:tabs>"
);
return
sResult
;
}
};
...
...
@@ -1245,12 +1251,12 @@ public:
std
::
string
sBullet
=
cBullet
;
std
::
wstring
swBullet
(
sBullet
.
begin
(),
sBullet
.
end
());
sResult
.
Append
(
swBullet
.
c_str
()
);
sResult
+=
swBullet
.
c_str
(
);
//CString sOOXNumber = GetLevelTextOOX();
//for( int i = 0; i < sOOXNumber.GetLength(); i++ )
// if( sOOXNumber[i] == '%' && i != sOOXNumber.GetLength() - 1 )
// {
// sResult
.Append( swBullet )
;
// sResult
+= swBullet
;
// i++;
// }
// else
...
...
@@ -1623,13 +1629,15 @@ public:
{
if
(
PROP_DEF
!=
m_aOverrideLevels
[
i
].
m_nLevelIndex
)
{
sResult
.
Append
(
_T
(
"{
\\
lfolevel"
)
);
sResult
+=
_T
(
"{
\\
lfolevel"
);
if
(
PROP_DEF
!=
m_aOverrideLevels
[
i
].
m_nLevelIndex
)
sResult
.
AppendFormat
(
_T
(
"
\\
listoverrideformat%d"
),
m_aOverrideLevels
[
i
].
m_nLevelIndex
);
if
(
PROP_DEF
!=
m_aOverrideLevels
[
i
].
m_nStart
)
sResult
.
AppendFormat
(
_T
(
"
\\
listoverridestartat%d"
),
m_aOverrideLevels
[
i
].
m_nStart
);
sResult
.
Append
(
m_aOverrideLevels
[
i
].
m_oLevel
.
RenderToRtf
(
oRenderParameter
)
);
sResult
.
Append
(
_T
(
"}"
)
);
sResult
+=
m_aOverrideLevels
[
i
].
m_oLevel
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
_T
(
"}"
);
}
}
return
sResult
;
...
...
@@ -1645,8 +1653,8 @@ public:
sResult
.
AppendFormat
(
_T
(
"<w:lvlOverride w:ilvl=
\"
%d
\"
>"
),
OverrideLevel
.
m_nLevelIndex
);
if
(
PROP_DEF
!=
OverrideLevel
.
m_nStart
)
sResult
.
AppendFormat
(
_T
(
"<w:startOverride w:val=
\"
%d
\"
/>"
),
OverrideLevel
.
m_nStart
);
sResult
.
Append
(
OverrideLevel
.
m_oLevel
.
RenderToOOX2
(
oRenderParameter
,
OverrideLevel
.
m_nLevelIndex
)
);
sResult
.
Append
(
_T
(
"</w:lvlOverride>"
)
);
sResult
+=
OverrideLevel
.
m_oLevel
.
RenderToOOX2
(
oRenderParameter
,
OverrideLevel
.
m_nLevelIndex
);
sResult
+=
_T
(
"</w:lvlOverride>"
);
}
}
return
sResult
;
...
...
@@ -2861,8 +2869,8 @@ public:
//public: CString RenderToRtf(RenderParameter oRenderParameter)
// {
// CString sResult;
// sResult
.Append( m_oRowProperty.RenderToRtf( oRenderParameter )
);
// sResult
.Append(_T(" {")+RtfParagraphProperty::RenderToRtf( oRenderParameter )+_T(" }")
);
// sResult
+= m_oRowProperty.RenderToRtf( oRenderParameter
);
// sResult
+= _T(" {") + RtfParagraphProperty::RenderToRtf( oRenderParameter )+_T(" }"
);
// return sResult;
// }
//};
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.h
View file @
0a7bcfdd
...
...
@@ -646,15 +646,14 @@ public:
CString
RenderToRtf
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
sResult
.
Append
(
m_oProperty
.
RenderToRtf
(
oRenderParameter
)
);
CString
sResult
=
m_oProperty
.
RenderToRtf
(
oRenderParameter
);
if
(
RENDER_TO_RTF_PARAM_NO_SECT
!=
oRenderParameter
.
nType
)
sResult
.
Append
(
_T
(
"
\\
sectd"
));
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
+=
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
);
}
return
sResult
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfTable.h
View file @
0a7bcfdd
...
...
@@ -59,29 +59,33 @@ public:
CString
RenderToOOX
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
sResult
.
Append
(
_T
(
"<w:tbl>"
)
);
sResult
.
Append
(
m_oProperty
.
RenderToOOX
(
oRenderParameter
));
sResult
.
Append
(
_T
(
"<w:tblGrid>"
));
for
(
int
i
=
0
;
i
<
(
int
)
m_aTableGrid
.
size
();
i
++
)
sResult
.
AppendFormat
(
_T
(
"<w:gridCol w:w=
\"
%d
\"
/>"
),
m_aTableGrid
[
i
]);
sResult
.
Append
(
_T
(
"</w:tblGrid>"
));
CString
sResult
=
_T
(
"<w:tbl>"
);
sResult
+=
m_oProperty
.
RenderToOOX
(
oRenderParameter
);
sResult
+=
_T
(
"<w:tblGrid>"
);
for
(
int
i
=
0
;
i
<
(
int
)
m_aTableGrid
.
size
();
i
++
)
{
sResult
.
AppendFormat
(
_T
(
"<w:gridCol w:w=
\"
%d
\"
/>"
),
m_aTableGrid
[
i
]);
}
sResult
+=
_T
(
"</w:tblGrid>"
);
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
.
Append
(
m_aArray
[
i
]
->
RenderToOOX
(
oRenderParameter
)
);
}
sResult
.
Append
(
_T
(
"</w:tbl>"
)
);
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
+=
m_aArray
[
i
]
->
RenderToOOX
(
oRenderParameter
);
}
sResult
+=
_T
(
"</w:tbl>"
);
return
sResult
;
}
CString
RenderToRtf
(
RenderParameter
oRenderParameter
)
{
CString
result
;
result
.
Append
(
_T
(
"
\n
"
));
result
+=
_T
(
"
\n
"
);
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
result
.
Append
(
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
)
);
result
.
Append
(
_T
(
"
\n
"
));
{
result
+=
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
);
}
result
+=
_T
(
"
\n
"
);
return
result
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfTableCell.h
View file @
0a7bcfdd
...
...
@@ -55,43 +55,44 @@ public:
{
if
(
m_aArray
[
i
]
->
GetType
()
==
TYPE_RTF_PARAGRAPH
)
{
result
.
Append
(
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
)
);
result
+=
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
);
if
(
i
!=
m_aArray
.
size
()
-
1
)
result
.
Append
(
_T
(
"
\\
par"
)
);
result
+=
_T
(
"
\\
par"
);
}
else
{
RenderParameter
oNewParameter
=
oRenderParameter
;
oNewParameter
.
nType
=
RENDER_TO_RTF_PARAM_NESTED
;
result
.
Append
(
m_aArray
[
i
]
->
RenderToRtf
(
oNewParameter
)
);
result
+=
m_aArray
[
i
]
->
RenderToRtf
(
oNewParameter
);
}
}
if
(
RENDER_TO_RTF_PARAM_NESTED
!=
oRenderParameter
.
nType
)
result
.
Append
(
_T
(
"
\\
cell"
)
);
result
+=
_T
(
"
\\
cell"
);
else
result
.
Append
(
_T
(
"
\\
nestcell{
\\
nonesttables }"
)
);
//todo как бы вернуть
result
+=
_T
(
"
\\
nestcell{
\\
nonesttables }"
);
//todo как бы вернуть
return
result
;
}
CString
RenderToOOX
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
sResult
.
Append
(
_T
(
"<w:tc>"
));
CString
sResult
=
_T
(
"<w:tc>"
);
CString
sProp
=
m_oProperty
.
RenderToOOX
(
oRenderParameter
);
if
(
_T
(
""
)
!=
sProp
)
if
(
!
sProp
.
IsEmpty
()
)
{
sResult
.
Append
(
_T
(
"<w:tcPr>"
)
);
sResult
.
Append
(
sProp
)
;
sResult
.
Append
(
_T
(
"</w:tcPr>"
)
);
sResult
+=
_T
(
"<w:tcPr>"
);
sResult
+=
sProp
;
sResult
+=
_T
(
"</w:tcPr>"
);
}
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
.
Append
(
m_aArray
[
i
]
->
RenderToOOX
(
oRenderParameter
)
);
sResult
+=
m_aArray
[
i
]
->
RenderToOOX
(
oRenderParameter
);
}
sResult
.
Append
(
_T
(
"</w:tc>"
)
);
sResult
+=
_T
(
"</w:tc>"
);
return
sResult
;
}
};
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfTableRow.h
View file @
0a7bcfdd
...
...
@@ -48,26 +48,26 @@ public:
CString
RenderToRtf
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
sResult
.
Append
(
_T
(
"
\n
"
)
);
sResult
+=
_T
(
"
\n
"
);
if
(
RENDER_TO_RTF_PARAM_NESTED
==
oRenderParameter
.
nType
)
{
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
.
Append
(
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
)
);
sResult
+=
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
);
}
sResult
.
Append
(
_T
(
"{
\\
*
\\
nesttableprops"
)
);
sResult
.
Append
(
m_oProperty
.
RenderToRtf
(
oRenderParameter
)
);
sResult
.
Append
(
_T
(
"
\\
nestrow}{
\\
nonesttables
\\
par}"
)
);
sResult
+=
_T
(
"{
\\
*
\\
nesttableprops"
);
sResult
+=
m_oProperty
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
_T
(
"
\\
nestrow}{
\\
nonesttables
\\
par}"
);
}
else
{
sResult
.
Append
(
m_oProperty
.
RenderToRtf
(
oRenderParameter
)
);
sResult
+=
m_oProperty
.
RenderToRtf
(
oRenderParameter
);
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
.
Append
(
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
)
);
sResult
+=
m_aArray
[
i
]
->
RenderToRtf
(
oRenderParameter
);
}
sResult
.
Append
(
_T
(
"
\\
row"
)
);
sResult
+=
_T
(
"
\\
row"
);
}
return
sResult
;
}
...
...
@@ -81,8 +81,7 @@ public:
CString
sRowProp
=
m_oProperty
.
RenderToOOX
(
oNewParam
);
if
(
false
==
sRowProp
.
IsEmpty
()
)
{
CString
sXml
;
sXml
.
Format
(
_T
(
"<w:trPr>%ls</w:trPr>"
),
sRowProp
);
CString
sXml
=
_T
(
"<w:trPr>"
)
+
sRowProp
+
_T
(
"</w:trPr>"
);
oXmlWriter
.
WriteString
(
sXml
);
}
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfWriter.cpp
View file @
0a7bcfdd
...
...
@@ -149,7 +149,7 @@ bool RtfWriter::SaveByItem()
sRtf
=
m_oDocument
[
0
]
->
operator
[](
0
)
->
RenderToRtf
(
oNewParam
);
if
(
TYPE_RTF_PARAGRAPH
==
m_oDocument
[
0
]
->
operator
[](
0
)
->
GetType
()
&&
!
(
m_oDocument
[
0
]
->
GetCount
()
==
0
&&
m_oDocument
.
GetCount
()
>
1
)
)
//для последнего параграфа секции не пишем \par
{
sRtf
.
Append
(
_T
(
"
\\
par"
)
);
sRtf
+=
_T
(
"
\\
par"
);
//oNewParam.nValue = RENDER_TO_RTF_PARAM_NO_PAR;
}
RtfUtility
::
RtfInternalEncoder
::
Decode
(
sRtf
,
*
m_oCurTempFileWriter
);
...
...
@@ -276,48 +276,51 @@ CString RtfWriter::CreateRtfStart()
oRenderParameter
.
nType
=
RENDER_TO_RTF_PARAM_UNKNOWN
;
CString
sResult
;
sResult
.
Append
(
_T
(
"{
\\
rtf1
\\
ulc1"
)
);
sResult
.
Append
(
m_oDocument
.
m_oProperty
.
RenderToRtf
(
oRenderParameter
)
);
sResult
.
Append
(
m_oDocument
.
m_oFontTable
.
RenderToRtf
(
oRenderParameter
)
);
sResult
.
Append
(
m_oDocument
.
m_oColorTable
.
RenderToRtf
(
oRenderParameter
)
);
sResult
+=
_T
(
"{
\\
rtf1
\\
ulc1"
);
sResult
+=
m_oDocument
.
m_oProperty
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oDocument
.
m_oFontTable
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oDocument
.
m_oColorTable
.
RenderToRtf
(
oRenderParameter
);
//CString sDefCharProp = m_oDocument.m_oDefaultCharProp.RenderToRtf( oRenderParameter );
//if( false == sDefCharProp.IsEmpty() )
// sResult.AppendFormat( _T("{\\*\\defchp %ls}"), sDefCharProp);
//CString sDefParProp = m_oDocument.m_oDefaultParagraphProp.RenderToRtf( oRenderParameter );
//if( false == sDefParProp.IsEmpty() )
// sResult.AppendFormat( _T("{\\*\\defpap %ls}"),sDefParProp );
//sResult.Append( m_oDocument.m_oStyleTable.RenderToRtf( oRenderParameter ) );
sResult
.
Append
(
m_oDocument
.
m_oListTabel
.
RenderToRtf
(
oRenderParameter
)
);
sResult
.
Append
(
m_oDocument
.
m_oListOverrideTabel
.
RenderToRtf
(
oRenderParameter
)
);
sResult
.
Append
(
m_oDocument
.
m_oInformation
.
RenderToRtf
(
oRenderParameter
)
);
sResult
.
Append
(
_T
(
"
\\
fet2"
)
);
//0 Footnotes only or nothing at all (the default). 1 Endnotes only. 2 Both footnotes and endnotes
//sResult += m_oDocument.m_oStyleTable.RenderToRtf( oRenderParameter ) );
sResult
+=
m_oDocument
.
m_oListTabel
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oDocument
.
m_oListOverrideTabel
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oDocument
.
m_oInformation
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
_T
(
"
\\
fet2"
);
//0 Footnotes only or nothing at all (the default). 1 Endnotes only. 2 Both footnotes and endnotes
CString
sFootnote
;
if
(
NULL
!=
m_oDocument
.
m_oFootnoteSep
)
{
sFootnote
=
m_oDocument
.
m_oFootnoteSep
->
RenderToRtf
(
oRenderParameter
);
if
(
_T
(
""
)
!=
sFootnote
)
sResult
.
AppendFormat
(
_T
(
"{
\\
*
\\
ftnsep %ls}"
),
sFootnote
.
GetBuffer
()
);
if
(
!
sFootnote
.
IsEmpty
()
)
sResult
+=
_T
(
"{
\\
*
\\
ftnsep "
)
+
sFootnote
+
_T
(
"}"
);
}
if
(
NULL
!=
m_oDocument
.
m_oFootnoteCon
)
{
sFootnote
=
m_oDocument
.
m_oFootnoteCon
->
RenderToRtf
(
oRenderParameter
);
if
(
_T
(
""
)
!=
sFootnote
)
sResult
.
AppendFormat
(
_T
(
"{
\\
*
\\
ftnsepc %ls}"
),
sFootnote
.
GetBuffer
()
);
if
(
!
sFootnote
.
IsEmpty
()
)
sResult
+=
_T
(
"{
\\
*
\\
ftnsepc "
)
+
sFootnote
+
_T
(
"}"
);
}
if
(
NULL
!=
m_oDocument
.
m_oEndnoteSep
)
{
sFootnote
=
m_oDocument
.
m_oEndnoteSep
->
RenderToRtf
(
oRenderParameter
);
if
(
_T
(
""
)
!=
sFootnote
)
sResult
.
AppendFormat
(
_T
(
"{
\\
*
\\
aftnsep %ls}"
),
sFootnote
.
GetBuffer
()
);
if
(
!
sFootnote
.
IsEmpty
()
)
sResult
+=
_T
(
"{
\\
*
\\
aftnsep "
)
+
sFootnote
+
_T
(
"}"
);
}
if
(
NULL
!=
m_oDocument
.
m_oEndnoteCon
)
{
sFootnote
=
m_oDocument
.
m_oEndnoteCon
->
RenderToRtf
(
oRenderParameter
);
if
(
_T
(
""
)
!=
sFootnote
)
sResult
.
AppendFormat
(
_T
(
"{
\\
*
\\
aftnsepc %ls}"
),
sFootnote
.
GetBuffer
()
);
if
(
!
sFootnote
.
IsEmpty
()
)
sResult
+=
_T
(
"{
\\
*
\\
aftnsepc "
)
+
sFootnote
+
_T
(
"}"
);
}
sResult
.
Append
(
_T
(
"
\n\n
"
)
);
sResult
+=
_T
(
"
\n\n
"
);
return
sResult
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXDocumentWriter.cpp
View file @
0a7bcfdd
...
...
@@ -56,18 +56,18 @@ CString OOXDocumentWriter::CreateXmlStart()
//пишем document.xml
CString
sResult
=
_T
(
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>
\n
"
);
sResult
.
Append
(
_T
(
"<w:document"
)
);
sResult
.
Append
(
_T
(
" xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
"
)
);
sResult
.
Append
(
_T
(
" xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
"
)
);
sResult
.
Append
(
_T
(
" xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
"
)
);
sResult
.
Append
(
_T
(
" xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
"
)
);
sResult
.
Append
(
_T
(
" xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
"
)
);
sResult
.
Append
(
_T
(
" xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
"
)
);
sResult
.
Append
(
_T
(
" xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
"
)
);
sResult
.
Append
(
_T
(
" xmlns:a=
\"
http://schemas.openxmlformats.org/drawingml/2006/main
\"
"
)
);
sResult
.
Append
(
_T
(
">"
)
);
sResult
+=
_T
(
"<w:document"
);
sResult
+=
_T
(
" xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
"
);
sResult
+=
_T
(
" xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
"
);
sResult
+=
_T
(
" xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
"
);
sResult
+=
_T
(
" xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
"
);
sResult
+=
_T
(
" xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
"
);
sResult
+=
_T
(
" xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
"
);
sResult
+=
_T
(
" xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
"
);
sResult
+=
_T
(
" xmlns:a=
\"
http://schemas.openxmlformats.org/drawingml/2006/main
\"
"
);
sResult
+=
_T
(
">"
);
sResult
.
Append
(
_T
(
"<w:body>"
)
);
sResult
+=
_T
(
"<w:body>"
);
return
sResult
;
}
CString
OOXDocumentWriter
::
CreateXmlEnd
(
)
...
...
@@ -76,13 +76,14 @@ CString OOXDocumentWriter::CreateXmlEnd( )
//пишем все кроме document.xml
RenderParameter
oNewParam
;
oNewParam
.
poDocument
=
&
m_oDocument
;
oNewParam
.
poWriter
=
&
m_oWriter
;
oNewParam
.
poRels
=
&
m_oWriter
.
m_oDocRels
;
oNewParam
.
nType
=
RENDER_TO_OOX_PARAM_UNKNOWN
;
oNewParam
.
poDocument
=
&
m_oDocument
;
oNewParam
.
poWriter
=
&
m_oWriter
;
oNewParam
.
poRels
=
&
m_oWriter
.
m_oDocRels
;
oNewParam
.
nType
=
RENDER_TO_OOX_PARAM_UNKNOWN
;
OOXEndnoteWriter
*
poEndnoteWriter
=
static_cast
<
OOXEndnoteWriter
*>
(
m_oWriter
.
m_poEndnoteWriter
);
OOXFootnoteWriter
*
poFootnoteWriter
=
static_cast
<
OOXFootnoteWriter
*>
(
m_oWriter
.
m_poFootnoteWriter
);
OOXEndnoteWriter
*
poEndnoteWriter
=
static_cast
<
OOXEndnoteWriter
*>
(
m_oWriter
.
m_poEndnoteWriter
);
OOXFootnoteWriter
*
poFootnoteWriter
=
static_cast
<
OOXFootnoteWriter
*>
(
m_oWriter
.
m_poFootnoteWriter
);
if
(
NULL
!=
m_oDocument
.
m_oFootnoteCon
)
{
oNewParam
.
poRels
=
poFootnoteWriter
->
m_oRelsWriter
.
get
();
...
...
@@ -154,7 +155,7 @@ CString OOXDocumentWriter::CreateXmlEnd( )
sStyles
+=
sTempParaDef
;
sStyles
+=
_T
(
"</w:pPr></w:pPrDefault>"
);
}
sStyles
.
Append
(
_T
(
"</w:docDefaults>"
)
);
sStyles
+=
_T
(
"</w:docDefaults>"
);
}
sStyles
+=
m_oDocument
.
m_oStyleTable
.
RenderToOOX
(
oNewParam
);
...
...
@@ -178,10 +179,10 @@ CString OOXDocumentWriter::CreateXmlEnd( )
oNewParam
.
poWriter
=
&
m_oWriter
;
oNewParam
.
poRels
=
&
m_oWriter
.
m_oDocRels
;
oNewParam
.
nType
=
RENDER_TO_OOX_PARAM_UNKNOWN
;
sResult
.
Append
(
m_oDocument
[
0
]
->
m_oProperty
.
RenderToOOX
(
oNewParam
)
);
sResult
+=
m_oDocument
[
0
]
->
m_oProperty
.
RenderToOOX
(
oNewParam
);
sResult
.
Append
(
_T
(
"</w:body>"
)
);
sResult
.
Append
(
_T
(
"</w:document>"
)
);
sResult
+=
_T
(
"</w:body>"
);
sResult
+=
_T
(
"</w:document>"
);
return
sResult
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXFontTableWriter.h
View file @
0a7bcfdd
...
...
@@ -45,7 +45,7 @@ public:
void
AddContent
(
CString
sText
)
{
m_sFileXml
.
Append
(
sText
)
;
m_sFileXml
+=
sText
;
}
bool
Save
(
CString
sFolder
)
{
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXFootnoteWriter.h
View file @
0a7bcfdd
...
...
@@ -45,38 +45,38 @@ public:
void
AddFootnoteBegin
(
CString
sType
,
int
nID
,
CString
sText
)
{
CString
sFootnote
;
sFootnote
.
Append
(
_T
(
"<w:footnote"
)
);
sFootnote
+=
_T
(
"<w:footnote"
);
if
(
false
==
sType
.
IsEmpty
()
)
{
sFootnote
.
Append
(
_T
(
" w:type=
\"
"
)
);
sFootnote
+=
_T
(
" w:type=
\"
"
);
sFootnote
+=
sType
;
sFootnote
.
Append
(
_T
(
"
\"
"
)
);
sFootnote
+=
_T
(
"
\"
"
);
}
if
(
PROP_DEF
!=
nID
)
sFootnote
.
AppendFormat
(
_T
(
" w:id=
\"
%d
\"
"
),
nID
);
sFootnote
.
Append
(
_T
(
">"
)
);
sFootnote
.
Append
(
sText
)
;
sFootnote
.
Append
(
_T
(
"</w:footnote>"
)
);
sFootnote
+=
_T
(
">"
);
sFootnote
+=
sText
;
sFootnote
+=
_T
(
"</w:footnote>"
);
m_sFootnotes
.
Insert
(
0
,
sFootnote
);
}
void
AddFootnote
(
CString
sType
,
int
nID
,
CString
sText
)
{
m_sFootnotes
.
Append
(
_T
(
"<w:footnote"
)
);
if
(
false
==
sType
.
IsEmpty
()
)
m_sFootnotes
+=
_T
(
"<w:footnote"
);
if
(
!
sType
.
IsEmpty
()
)
{
m_sFootnotes
.
Append
(
_T
(
" w:type=
\"
"
)
);
m_sFootnotes
+=
_T
(
" w:type=
\"
"
);
m_sFootnotes
+=
sType
;
m_sFootnotes
.
Append
(
_T
(
"
\"
"
)
);
m_sFootnotes
+=
_T
(
"
\"
"
);
}
if
(
PROP_DEF
!=
nID
)
{
m_sFootnotes
.
AppendFormat
(
_T
(
" w:id=
\"
%d
\"
"
),
nID
);
}
m_sFootnotes
.
Append
(
_T
(
">"
)
);
m_sFootnotes
.
Append
(
sText
)
;
m_sFootnotes
.
Append
(
_T
(
"</w:footnote>"
)
);
m_sFootnotes
+=
_T
(
">"
);
m_sFootnotes
+=
sText
;
m_sFootnotes
+=
_T
(
"</w:footnote>"
);
}
bool
Save
(
CString
sFolder
)
{
...
...
@@ -106,11 +106,11 @@ private:
CString
CreateXml
()
{
CString
sResult
;
sResult
.
Append
(
_T
(
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>"
)
);
sResult
+=
_T
(
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>"
);
sResult
.
AppendChar
(
'\n'
);
sResult
.
Append
(
_T
(
"<w:footnotes xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingCanvas
\"
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:wp14=
\"
http://schemas.microsoft.com/office/word/2008/9/16/wordprocessingDrawing
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:w14=
\"
http://schemas.microsoft.com/office/word/2009/2/wordml
\"
xmlns:wpg=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingGroup
\"
xmlns:wpi=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingInk
\"
xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
xmlns:wps=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingShape
\"
>"
)
);
sResult
.
Append
(
m_sFootnotes
)
;
sResult
.
Append
(
_T
(
"</w:footnotes>"
)
);
sResult
+=
_T
(
"<w:footnotes xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingCanvas
\"
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:wp14=
\"
http://schemas.microsoft.com/office/word/2008/9/16/wordprocessingDrawing
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:w14=
\"
http://schemas.microsoft.com/office/word/2009/2/wordml
\"
xmlns:wpg=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingGroup
\"
xmlns:wpi=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingInk
\"
xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
xmlns:wps=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingShape
\"
>"
);
sResult
+=
m_sFootnotes
;
sResult
+=
_T
(
"</w:footnotes>"
);
return
sResult
;
}
...
...
@@ -127,36 +127,36 @@ public:
void
AddEndnoteBegin
(
CString
sType
,
int
nID
,
CString
sText
)
{
CString
sEndnote
;
sEndnote
.
Append
(
_T
(
"<w:endnote"
)
);
sEndnote
+=
_T
(
"<w:endnote"
);
if
(
false
==
sType
.
IsEmpty
()
)
{
sEndnote
.
Append
(
_T
(
" w:type=
\"
"
)
);
sEndnote
+=
_T
(
" w:type=
\"
"
);
sEndnote
+=
sType
;
sEndnote
.
Append
(
_T
(
"
\"
"
)
);
sEndnote
+=
_T
(
"
\"
"
);
}
if
(
-
2
!=
nID
)
sEndnote
.
AppendFormat
(
_T
(
" w:id=
\"
%d
\"
"
),
nID
);
sEndnote
.
Append
(
_T
(
">"
)
);
sEndnote
.
Append
(
sText
)
;
sEndnote
.
Append
(
_T
(
"</w:endnote>"
)
);
sEndnote
+=
_T
(
">"
);
sEndnote
+=
sText
;
sEndnote
+=
_T
(
"</w:endnote>"
);
m_sEndnotes
.
Insert
(
0
,
sEndnote
);
}
void
AddEndnote
(
CString
sType
,
int
nID
,
CString
sText
)
{
m_sEndnotes
.
Append
(
_T
(
"<w:endnote"
)
);
m_sEndnotes
+=
_T
(
"<w:endnote"
);
if
(
false
==
sType
.
IsEmpty
()
)
{
m_sEndnotes
.
Append
(
_T
(
" w:type=
\"
"
)
);
m_sEndnotes
+=
_T
(
" w:type=
\"
"
);
m_sEndnotes
+=
sType
;
m_sEndnotes
.
Append
(
_T
(
"
\"
"
)
);
m_sEndnotes
+=
_T
(
"
\"
"
);
}
if
(
-
2
!=
nID
)
m_sEndnotes
.
AppendFormat
(
_T
(
" w:id=
\"
%d
\"
"
),
nID
);
m_sEndnotes
.
Append
(
_T
(
">"
)
);
m_sEndnotes
.
Append
(
sText
)
;
m_sEndnotes
.
Append
(
_T
(
"</w:endnote>"
)
);
m_sEndnotes
+=
_T
(
">"
);
m_sEndnotes
+=
sText
;
m_sEndnotes
+=
_T
(
"</w:endnote>"
);
}
bool
Save
(
CString
sFolder
)
{
...
...
@@ -182,10 +182,11 @@ private:
std
::
string
CreateXml
()
{
std
::
wstring
sResult
;
sResult
.
append
(
_T
(
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>"
)
);
sResult
.
append
(
_T
(
"<w:endnotes xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingCanvas
\"
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:wp14=
\"
http://schemas.microsoft.com/office/word/2008/9/16/wordprocessingDrawing
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:w14=
\"
http://schemas.microsoft.com/office/word/2009/2/wordml
\"
xmlns:wpg=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingGroup
\"
xmlns:wpi=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingInk
\"
xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
xmlns:wps=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingShape
\"
>"
)
);
sResult
.
append
(
m_sEndnotes
.
GetBuffer
()
);
sResult
.
append
(
_T
(
"</w:endnotes>"
)
);
sResult
+=
_T
(
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>"
);
sResult
+=
_T
(
"<w:endnotes xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingCanvas
\"
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:wp14=
\"
http://schemas.microsoft.com/office/word/2008/9/16/wordprocessingDrawing
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:w14=
\"
http://schemas.microsoft.com/office/word/2009/2/wordml
\"
xmlns:wpg=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingGroup
\"
xmlns:wpi=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingInk
\"
xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
xmlns:wps=
\"
http://schemas.microsoft.com/office/word/2008/6/28/wordprocessingShape
\"
>"
);
sResult
+=
m_sEndnotes
;
sResult
+=
_T
(
"</w:endnotes>"
);
return
NSFile
::
CUtf8Converter
::
GetUtf8StringFromUnicode
(
sResult
);
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXNumberingWriter.h
View file @
0a7bcfdd
...
...
@@ -42,11 +42,11 @@ public:
{
m_oRelsWriter
=
OOXRelsWriterPtr
(
new
OOXRelsWriter
(
_T
(
"numbering.xml"
),
oDocument
)
);
oWriter
.
m_oCustomRelsWriter
.
push_back
(
m_oRelsWriter
);
//m_sFileXml
.Append( oDocument.RenderToOOX(&oWriter,&oDocument,"numbering.xml","")
);
//m_sFileXml
+= oDocument.RenderToOOX(&oWriter,&oDocument,"numbering.xml",""
);
}
void
AddNumbering
(
CString
sText
)
{
m_sFileXml
.
Append
(
sText
)
;
m_sFileXml
+=
sText
;
}
bool
Save
(
CString
sFolder
)
{
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXRelsWriter.h
View file @
0a7bcfdd
...
...
@@ -64,18 +64,18 @@ public:
CString
CreateXml
()
{
CString
sResult
;
sResult
.
Append
(
_T
(
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>"
)
);
sResult
+=
_T
(
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>"
);
sResult
.
AppendChar
(
'\n'
);
sResult
.
Append
(
_T
(
"<Relationships xmlns=
\"
http://schemas.openxmlformats.org/package/2006/relationships
\"
>"
)
);
sResult
+=
_T
(
"<Relationships xmlns=
\"
http://schemas.openxmlformats.org/package/2006/relationships
\"
>"
);
for
(
int
i
=
0
;
i
<
(
int
)
m_aTargets
.
size
();
i
++
)
{
sResult
.
AppendFormat
(
_T
(
"<Relationship Id=
\"
%ls
\"
Type=
\"
%ls
\"
Target=
\"
%ls
\"
"
),
m_aIDs
[
i
].
GetBuffer
(),
m_aTypes
[
i
].
GetBuffer
(),
m_aTargets
[
i
].
GetBuffer
());
if
(
false
==
m_aModes
[
i
]
)
sResult
.
Append
(
_T
(
" TargetMode=
\"
External
\"
"
)
);
sResult
.
Append
(
_T
(
"/>"
)
);
sResult
+=
_T
(
" TargetMode=
\"
External
\"
"
);
sResult
+=
_T
(
"/>"
);
}
sResult
.
Append
(
_T
(
"</Relationships>"
)
);
sResult
+=
_T
(
"</Relationships>"
);
return
sResult
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXSettingsWriter.h
View file @
0a7bcfdd
...
...
@@ -58,7 +58,7 @@ public:
}
void
AddContent
(
CString
sText
)
{
m_sFileXml
.
Append
(
sText
)
;
m_sFileXml
+=
sText
;
}
bool
Save
(
CString
sFolder
)
{
...
...
@@ -82,7 +82,7 @@ public:
// TRUE == oXmlReader1.ReadRootNode( _T("w:settings") ) && TRUE == oXmlReader2.ReadRootNode( _T("w:settings") ) )
// {
// sXml = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>");
// //sXml
.Append( RtfUtility::MergeXml( oXmlReader1, oXmlReader2 )
);
// //sXml
+= RtfUtility::MergeXml( oXmlReader1, oXmlReader2
);
// }
//}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXStylesWriter.h
View file @
0a7bcfdd
...
...
@@ -48,7 +48,7 @@ public:
}
void
AddContent
(
CString
sText
)
{
m_sFileXml
.
Append
(
sText
)
;
m_sFileXml
+=
sText
;
}
bool
Save
(
CString
sFolder
)
{
...
...
Common/DocxFormat/Source/DocxFormat/Drawing/Drawing.h
View file @
0a7bcfdd
...
...
@@ -1051,8 +1051,8 @@ namespace OOX
if
(
_T
(
"mc:Fallback"
)
==
sName
||
_T
(
"mc:Choice"
)
==
sName
)
{
CString
strXml
=
_T
(
"<root xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas
\"
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:wp14=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:w14=
\"
http://schemas.microsoft.com/office/word/2010/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
\"
>"
);
strXml
.
Append
(
oReader
.
GetOuterXml
()
);
strXml
.
Append
(
_T
(
"</root>"
)
);
strXml
+=
oReader
.
GetOuterXml
(
);
strXml
+=
_T
(
"</root>"
);
XmlUtils
::
CXmlLiteReader
oSubReader
;
...
...
Common/DocxFormat/Source/DocxFormat/Logic/Pict.h
View file @
0a7bcfdd
...
...
@@ -457,9 +457,9 @@ namespace OOX
//альтернатива pptx
CString
sXml
;
//??? + ole наверно что то (лень ...)
sXml
.
Append
(
_T
(
"<root xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas
\"
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:wp14=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:w14=
\"
http://schemas.microsoft.com/office/word/2010/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
\"
>"
)
);
sXml
.
Append
(
m_sXml
.
get
()
);
sXml
.
Append
(
_T
(
"</root>"
)
);
sXml
+=
_T
(
"<root xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas
\"
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:wp14=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:w14=
\"
http://schemas.microsoft.com/office/word/2010/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
\"
>"
);
sXml
+=
m_sXml
.
get
(
);
sXml
+=
_T
(
"</root>"
);
XmlUtils
::
CXmlLiteReader
oSubReader
;
oSubReader
.
FromString
(
sXml
);
...
...
Common/DocxFormat/Source/DocxFormat/Logic/RunProperty.cpp
View file @
0a7bcfdd
...
...
@@ -256,8 +256,8 @@ namespace OOX
m_sTextFill
=
oReader
.
GetOuterXml
();
CString
strXml
=
_T
(
"<xml xmlns:wps=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingShape
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
>"
);
strXml
.
Append
(
m_sTextFill
.
get
()
);
strXml
.
Append
(
_T
(
"</xml>"
)
);
strXml
+=
m_sTextFill
.
get
(
);
strXml
+=
_T
(
"</xml>"
);
XmlUtils
::
CXmlLiteReader
oSubReader
;
//нам нужны xml и сами объекты
bool
result
=
oSubReader
.
FromString
(
strXml
);
...
...
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