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
9c49255b
Commit
9c49255b
authored
Apr 18, 2016
by
ElenaSubbotina
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormatReader - конвертация OleFormat1 -> OleFormat2
parent
e1e23f7e
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
662 additions
and
268 deletions
+662
-268
ASCOfficeRtfFile/RtfFormatLib/Win32/RtfFormatLib.vcproj
ASCOfficeRtfFile/RtfFormatLib/Win32/RtfFormatLib.vcproj
+4
-0
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
+43
-20
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
+220
-217
ASCOfficeRtfFile/RtfFormatLib/source/Ole1FormatReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Ole1FormatReader.h
+299
-0
ASCOfficeRtfFile/RtfFormatLib/source/RtfLex.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfLex.h
+7
-0
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.h
+20
-8
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.cpp
+29
-0
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.h
+31
-15
ASCOfficeRtfFile/RtfFormatLib/source/RtfReader.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfReader.cpp
+7
-7
ASCOfficeRtfFile/RtfFormatLib/source/Utils.h
ASCOfficeRtfFile/RtfFormatLib/source/Utils.h
+2
-1
No files found.
ASCOfficeRtfFile/RtfFormatLib/Win32/RtfFormatLib.vcproj
View file @
9c49255b
...
...
@@ -639,6 +639,10 @@
RelativePath=
"..\source\IdGenerator.h"
>
</File>
<File
RelativePath=
"..\source\Ole1FormatReader.h"
>
</File>
<File
RelativePath=
"..\source\RtfDefine.h"
>
...
...
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
View file @
9c49255b
#include "DestinationCommand.h"
#include "RtfOle.h"
#include "Ole1FormatReader.h"
#include "ConvertationManager.h"
HRESULT
ConvertOle1ToOle2
(
BYTE
*
pData
,
int
nSize
,
std
::
wstring
sOle2Name
)
{
HRESULT
hr
=
S_FALSE
;
Ole1FormatReader
ole1Reader
(
pData
,
nSize
);
NSFile
::
CFileBinary
file
;
file
.
CreateFileW
(
sOle2Name
);
file
.
WriteFile
(
ole1Reader
.
NativeData
,
ole1Reader
.
NativeDataSize
);
file
.
CloseFile
();
return
S_FALSE
;
}
bool
ShapeReader
::
ExecuteCommand
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
CString
sCommand
,
bool
hasParameter
,
int
parameter
)
{
if
(
_T
(
"shp"
)
==
sCommand
)
...
...
@@ -250,37 +264,46 @@ bool OleReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CStrin
if
(
0
!=
nSize
&&
pData
)
{
HRESULT
hRes
=
S_FALSE
;
//обекь для конвертации Ole1 в Ole2
//RtfOle1ToOle2Stream oStream;
//todooo тут был чисто микрософтовский вариант - переделать !!!
//oStream.lpstbl = new OLESTREAMVTBL();
//oStream.lpstbl->Get = &OleGet1;
//oStream.lpstbl->Put = &OlePut1;
//oStream.pBuffer = pData;
//oStream.nBufferSize = nSize;
//oStream.nCurPos = 0;
//конвертация Ole1 в Ole2
#if 0//defined(_WIN32) || defined(_WIN64)
RtfOle1ToOle2Stream oStream;
oStream.lpstbl = new OLESTREAMVTBL();
oStream.lpstbl->Get = &OleGet1;
oStream.lpstbl->Put = &OlePut1;
oStream.pBuffer = pData;
oStream.nBufferSize = nSize;
oStream.nCurPos = 0;
CString sOleStorageName = Utils::CreateTempFile( oReader.m_sTempFolder );
NSFile
::
CFileBinary
file
;
file
.
CreateFileW
(
sOleStorageName
.
GetBuffer
());
file
.
WriteFile
(
pData
,
nSize
);
file
.
CloseFile
();
IStorage* piMSStorage = NULL;
if( SUCCEEDED( StgCreateDocfile( sOleStorageName, STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE | STGM_TRANSACTED/* | STGM_DELETEONRELEASE*/, NULL, &piMSStorage) ) )
{
hRes = OleConvertOLESTREAMToIStorage( &oStream, piMSStorage, NULL );
piMSStorage->Commit( STGC_DEFAULT );
RELEASEINTERFACE( piMSStorage );
}
delete oStream.lpstbl;
#else
std
::
wstring
sOleStorageName
=
FileSystem
::
Directory
::
CreateTempFileWithUniqueName
(
oReader
.
m_sTempFolder
,
_T
(
"img"
));
hRes
=
ConvertOle1ToOle2
(
pData
,
nSize
,
sOleStorageName
);
POLE
::
Storage
*
piRootStorage
=
new
POLE
::
Storage
(
string2std_string
(
sOleStorageName
).
c_str
());
#endif
delete
[]
pData
;
POLE
::
Storage
*
piRootStorage
=
new
POLE
::
Storage
(
sOleStorageName
.
c_str
());
if
(
piRootStorage
)
{
//hRes = OleConvertOLESTREAMToIStorage( &oStream, piRootStorage, NULL );
m_oOle
.
SetFilename
(
sOleStorageName
);
m_oOle
.
SetFilename
(
sOleStorageName
.
c_str
()
);
m_oOle
.
SetOle
(
piRootStorage
);
//RELEASEOBJECT( piRootStorage );
hRes
=
S_OK
;
}
//delete oStream.lpstbl;
delete
[]
pData
;
if
(
hRes
!=
S_OK
)
Utils
::
RemoveDirOrFile
(
sOleStorageName
);
Utils
::
RemoveDirOrFile
(
sOleStorageName
.
c_str
()
);
}
}
else
if
(
_T
(
"result"
)
==
sCommand
)
...
...
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
View file @
9c49255b
This diff is collapsed.
Click to expand it.
ASCOfficeRtfFile/RtfFormatLib/source/Ole1FormatReader.h
0 → 100644
View file @
9c49255b
#
pragma
once
class
CDataStream
{
public:
CDataStream
()
:
pBuffer
(
NULL
)
{
}
CDataStream
(
BYTE
*
pBuf
,
unsigned
int
unSize
)
{
SetStream
(
pBuf
,
unSize
);
}
~
CDataStream
()
{
}
void
SetStream
(
BYTE
*
pBuf
,
unsigned
int
unSize
)
{
pBuffer
=
pBuf
;
pCur
=
pBuf
;
pEnd
=
pBuf
+
unSize
+
1
;
};
BYTE
*
GetCurPtr
()
{
return
pCur
;
}
unsigned
char
ReadUChar
()
{
if
(
pCur
+
1
>=
pEnd
)
return
0
;
unsigned
char
unResult
=
pCur
[
0
];
pCur
++
;
return
unResult
;
};
unsigned
short
ReadUShort
()
{
if
(
pCur
+
2
>=
pEnd
)
return
0
;
unsigned
short
ushResult
=
(
pCur
[
0
])
|
((
pCur
[
1
])
<<
8
);
pCur
+=
2
;
return
ushResult
;
};
unsigned
int
ReadULong
()
{
if
(
pCur
+
4
>=
pEnd
)
return
0
;
unsigned
int
unResult
=
(
unsigned
int
)((
pCur
[
0
]
<<
0
)
|
((
pCur
[
1
])
<<
8
)
|
((
pCur
[
2
])
<<
16
)
|
((
pCur
[
3
])
<<
24
));
pCur
+=
4
;
return
unResult
;
};
double
ReadDouble
()
{
if
(
pCur
+
4
>=
pEnd
)
return
0
;
float
output
;
*
((
unsigned
char
*
)(
&
output
)
+
0
)
=
pCur
[
0
];
*
((
unsigned
char
*
)(
&
output
)
+
1
)
=
pCur
[
1
];
*
((
unsigned
char
*
)(
&
output
)
+
2
)
=
pCur
[
2
];
*
((
unsigned
char
*
)(
&
output
)
+
3
)
=
pCur
[
3
];
pCur
+=
4
;
return
output
;
int
lIntValue
=
(
int
)((
pCur
[
0
]
<<
16
)
|
((
pCur
[
1
])
<<
8
)
|
((
pCur
[
2
])
<<
0
));
int
lFracValue
=
(
int
)(
pCur
[
3
]);
pCur
+=
4
;
return
(
double
)(
lIntValue
+
(
lFracValue
/
16.0
));
};
char
ReadChar
()
{
return
(
char
)
ReadUChar
();
};
short
ReadShort
()
{
return
(
short
)
ReadUShort
();
};
int
ReadLong
()
{
return
(
int
)
ReadULong
();
};
void
ReadBytes
(
char
*
pBuffer
,
unsigned
int
ulSize
)
{
size_t
ulRemainSize
=
(
pEnd
-
pCur
);
size_t
ulFinalSize
=
(
ulRemainSize
>
ulSize
?
ulSize
:
ulRemainSize
);
for
(
size_t
ulIndex
=
0
;
ulIndex
<
ulFinalSize
;
ulIndex
++
)
{
pBuffer
[
ulIndex
]
=
ReadChar
();
}
};
void
ReadBytes
(
unsigned
char
*
pBuffer
,
unsigned
int
ulSize
)
{
size_t
ulRemainSize
=
(
pEnd
-
pCur
);
size_t
ulFinalSize
=
(
ulRemainSize
>
ulSize
?
ulSize
:
ulRemainSize
);
for
(
size_t
ulIndex
=
0
;
ulIndex
<
ulFinalSize
;
ulIndex
++
)
{
pBuffer
[
ulIndex
]
=
ReadChar
();
}
};
void
ReadBytes
(
unsigned
short
*
pBuffer
,
unsigned
int
ulSize
)
{
size_t
ulRemainSize
=
(
pEnd
-
pCur
)
/
2
;
size_t
ulFinalSize
=
(
ulRemainSize
>
ulSize
?
ulSize
:
ulRemainSize
);
for
(
size_t
ulIndex
=
0
;
ulIndex
<
ulFinalSize
;
ulIndex
++
)
{
pBuffer
[
ulIndex
]
=
ReadUShort
();
}
}
void
ReadBytes
(
short
*
pBuffer
,
unsigned
int
ulSize
)
{
size_t
ulRemainSize
=
(
pEnd
-
pCur
)
/
2
;
size_t
ulFinalSize
=
(
ulRemainSize
>
ulSize
?
ulSize
:
ulRemainSize
);
for
(
size_t
ulIndex
=
0
;
ulIndex
<
ulFinalSize
;
ulIndex
++
)
{
pBuffer
[
ulIndex
]
=
ReadShort
();
}
}
void
ReadBytes
(
unsigned
int
*
pBuffer
,
unsigned
int
ulSize
)
{
size_t
ulRemainSize
=
(
pEnd
-
pCur
)
/
4
;
size_t
ulFinalSize
=
(
ulRemainSize
>
ulSize
?
ulSize
:
ulRemainSize
);
for
(
size_t
ulIndex
=
0
;
ulIndex
<
ulFinalSize
;
ulIndex
++
)
{
pBuffer
[
ulIndex
]
=
ReadULong
();
}
}
CDataStream
&
operator
>>
(
unsigned
char
&
nValue
)
{
nValue
=
ReadUChar
();
return
*
this
;
}
CDataStream
&
operator
>>
(
unsigned
short
&
nValue
)
{
nValue
=
ReadUShort
();
return
*
this
;
}
CDataStream
&
operator
>>
(
unsigned
int
&
nValue
)
{
nValue
=
ReadULong
();
return
*
this
;
}
CDataStream
&
operator
>>
(
unsigned
long
&
nValue
)
{
nValue
=
ReadULong
();
return
*
this
;
}
CDataStream
&
operator
>>
(
double
&
dValue
)
{
dValue
=
ReadDouble
();
return
*
this
;
}
CDataStream
&
operator
>>
(
char
&
nValue
)
{
nValue
=
ReadChar
();
return
*
this
;
}
CDataStream
&
operator
>>
(
bool
&
nValue
)
{
nValue
=
!!
ReadChar
();
return
*
this
;
}
CDataStream
&
operator
>>
(
short
&
nValue
)
{
nValue
=
ReadShort
();
return
*
this
;
}
CDataStream
&
operator
>>
(
int
&
nValue
)
{
nValue
=
ReadLong
();
return
*
this
;
}
CDataStream
&
operator
>>
(
long
&
nValue
)
{
nValue
=
ReadLong
();
return
*
this
;
}
bool
IsValid
()
const
{
if
(
NULL
==
pBuffer
)
return
false
;
return
true
;
}
bool
IsEof
()
const
{
if
(
pCur
>=
pEnd
)
return
true
;
return
false
;
}
unsigned
int
Tell
()
{
return
(
unsigned
int
)(
pCur
-
pBuffer
);
}
void
Skip
(
unsigned
int
ulSkip
)
{
pCur
+=
ulSkip
;
}
void
SeekBack
(
unsigned
int
ulSkipBack
)
{
pCur
-=
ulSkipBack
;
}
void
SeekToStart
()
{
pCur
=
pBuffer
;
}
unsigned
int
CanRead
()
{
return
(
unsigned
int
)(
pEnd
-
pCur
);
}
private:
BYTE
*
pBuffer
;
BYTE
*
pCur
;
BYTE
*
pEnd
;
};
struct
LengthPrefixedAnsiString
{
_UINT32
size
;
std
::
string
val
;
};
CDataStream
&
operator
>>
(
CDataStream
&
strm
,
LengthPrefixedAnsiString
&
str
)
{
strm
>>
str
.
size
;
char
*
s
=
new
char
[
str
.
size
];
strm
.
ReadBytes
(
s
,
str
.
size
);
str
.
val
=
std
::
string
(
s
,
str
.
size
);
delete
[]
s
;
return
strm
;
}
struct
ObjectHeader
{
_UINT32
OLEVersion
;
_UINT32
FormatID
;
LengthPrefixedAnsiString
ClassName
;
_UINT32
Width
;
_UINT32
Height
;
};
class
Ole1FormatReader
{
public:
Ole1FormatReader
(
BYTE
*
pData
,
int
Size
)
{
if
(
!
pData
||
Size
<
8
)
return
;
CDataStream
stream
(
pData
,
Size
);
stream
>>
Header
.
OLEVersion
>>
Header
.
FormatID
;
if
(
Header
.
OLEVersion
&
0x00000500
)
{
stream
>>
Header
.
ClassName
;
}
stream
>>
Header
.
Width
>>
Header
.
Height
;
stream
>>
NativeDataSize
;
NativeData
=
stream
.
GetCurPtr
();
stream
.
Skip
(
NativeDataSize
);
int
sz
=
stream
.
CanRead
();
/// далее графическое представление
}
ObjectHeader
Header
;
_UINT32
NativeDataSize
;
BYTE
*
NativeData
;
//PresentationObjectHeader PresentationHeader;
};
ASCOfficeRtfFile/RtfFormatLib/source/RtfLex.h
View file @
9c49255b
...
...
@@ -139,6 +139,13 @@ public:
void
SetSource
(
std
::
wstring
sPath
)
{
m_oStream
.
SetSource
(
sPath
);
if
(
m_oStream
.
getSize
()
>
m_nReadBufSize
)
{
m_nReadBufSize
=
m_oStream
.
getSize
()
;
if
(
m_caReadBuffer
)
delete
[]
m_caReadBuffer
;
m_caReadBuffer
=
new
char
[
m_nReadBufSize
];
}
}
void
CloseSource
()
{
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.h
View file @
9c49255b
...
...
@@ -113,28 +113,40 @@ public:
CString
RenderToOOX
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
#ifdef RTF_MATH_OOX
//
#ifdef RTF_MATH_OOX
RenderParameter
oNewParam
=
oRenderParameter
;
sResult
.
AppendFormat
(
_T
(
"<%ls"
),
m_sOOXName
);
sResult
.
Append
(
_T
(
"<"
)
);
sResult
+=
m_sOOXName
;
oNewParam
.
nType
=
RENDER_TO_OOX_PARAM_MATH
;
CString
sVal
=
m_oVal
.
RenderToOOX
(
oNewParam
);
if
(
false
==
sVal
.
IsEmpty
()
)
sResult
.
AppendFormat
(
_T
(
" w:val=
\"
%ls
\"
"
),
sVal
);
{
sResult
.
Append
(
_T
(
" w:val=
\"
"
)
);
sResult
+=
sVal
;
sResult
.
Append
(
_T
(
"
\"
"
)
);
}
sResult
.
Append
(
_T
(
">"
)
);
oNewParam
.
nType
=
RENDER_TO_OOX_PARAM_TEXT
;
sResult
.
Append
(
oProperty
.
RenderToOOX
(
oNewParam
)
);
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
.
Append
(
m_aArray
[
i
]
->
RenderToOOX
(
oNewParam
));
}
sResult
.
AppendFormat
(
_T
(
"</%ls>"
),
m_sOOXName
);
sResult
.
Append
(
_T
(
"</"
)
);
sResult
+=
m_sOOXName
;
sResult
.
Append
(
_T
(
">"
));
#else
//
#else
if
(
NULL
!=
m_oPicture
)
sResult
.
Append
(
m_oPicture
->
RenderToOOX
(
oRenderParameter
)
);
//
if( NULL != m_oPicture )
//
sResult.Append( m_oPicture->RenderToOOX(oRenderParameter) );
#endif
//
#endif
return
sResult
;
}
};
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.cpp
View file @
9c49255b
...
...
@@ -18,6 +18,7 @@ CString RtfOle::RenderToOOX(RenderParameter oRenderParameter)
{
sResult
.
Append
(
_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
;
...
...
@@ -71,3 +72,31 @@ CString RtfOle::RenderToOOXOnlyOle(RenderParameter oRenderParameter)
sResult
.
Append
(
_T
(
"/>"
)
);
return
sResult
;
}
#if defined(_WIN32) || defined(_WIN64)
DWORD
CALLBACK
OlePut1
(
LPOLESTREAM
oStream
,
const
void
FAR
*
pTarget
,
DWORD
dwRead
)
{
return
0
;
}
DWORD
CALLBACK
OleGet2
(
LPOLESTREAM
oStream
,
void
FAR
*
pTarget
,
DWORD
dwRead
)
{
return
0
;
}
DWORD
CALLBACK
OleGet1
(
LPOLESTREAM
oStream
,
void
FAR
*
pTarget
,
DWORD
dwRead
)
{
RtfOle1ToOle2Stream
*
piStream
=
static_cast
<
RtfOle1ToOle2Stream
*>
(
oStream
);
if
(
piStream
->
nCurPos
+
(
int
)
dwRead
>
piStream
->
nBufferSize
)
return
0
;
memcpy
(
pTarget
,
(
piStream
->
pBuffer
+
piStream
->
nCurPos
)
,
dwRead
);
piStream
->
nCurPos
+=
dwRead
;
return
dwRead
;
}
DWORD
CALLBACK
OlePut2
(
LPOLESTREAM
oStream
,
const
void
FAR
*
pTarget
,
DWORD
dwWrite
)
{
RtfOle2ToOle1Stream
*
piStream
=
static_cast
<
RtfOle2ToOle1Stream
*>
(
oStream
);
BYTE
*
pSource
=
(
BYTE
*
)
pTarget
;
for
(
int
i
=
0
;
i
<
(
int
)
dwWrite
;
i
++
)
piStream
->
aBuffer
.
push_back
(
pSource
[
i
]
);
return
dwWrite
;
}
#endif
\ No newline at end of file
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.h
View file @
9c49255b
...
...
@@ -74,7 +74,7 @@ public:
{
if
(
piOle
==
NULL
)
return
;
m_piStorage
=
new
POLE
::
Storage
(
*
piOle
)
;
m_piStorage
=
piOle
;
}
void
SetDefault
()
{
...
...
@@ -95,18 +95,34 @@ private:
};
typedef
boost
::
shared_ptr
<
RtfOle
>
RtfOlePtr
;
struct
RtfOle1ToOle2Stream
:
POLE
::
Stream
{
BYTE
*
pBuffer
;
long
nBufferSize
;
long
nCurPos
;
};
struct
RtfOle2ToOle1Stream
:
POLE
::
Stream
{
std
::
vector
<
BYTE
>
aBuffer
;
};
//DWORD CALLBACK OleGet1(POLE::Stream* oStream, void FAR* pTarget, DWORD dwRead);;
//DWORD CALLBACK OlePut1(POLE::Stream*, const void FAR*, DWORD);
//DWORD CALLBACK OleGet2(POLE::Stream* oStream, void FAR* pTarget, DWORD dwRead);;
//DWORD CALLBACK OlePut2(POLE::Stream*, const void FAR*, DWORD);
#if defined (_WIN32) || defined (_WIN64)
struct
RtfOle1ToOle2Stream
:
OLESTREAM
{
BYTE
*
pBuffer
;
long
nBufferSize
;
long
nCurPos
;
};
struct
RtfOle2ToOle1Stream
:
OLESTREAM
{
std
::
vector
<
BYTE
>
aBuffer
;
};
DWORD
CALLBACK
OleGet1
(
LPOLESTREAM
oStream
,
void
FAR
*
pTarget
,
DWORD
dwRead
);;
DWORD
CALLBACK
OlePut1
(
LPOLESTREAM
,
const
void
FAR
*
,
DWORD
);
DWORD
CALLBACK
OleGet2
(
LPOLESTREAM
oStream
,
void
FAR
*
pTarget
,
DWORD
dwRead
);;
DWORD
CALLBACK
OlePut2
(
LPOLESTREAM
,
const
void
FAR
*
,
DWORD
);
#else
struct
RtfOle1ToOle2Stream
:
POLE
::
Stream
{
BYTE
*
pBuffer
;
long
nBufferSize
;
long
nCurPos
;
};
struct
RtfOle2ToOle1Stream
:
POLE
::
Stream
{
std
::
vector
<
BYTE
>
aBuffer
;
};
#endif
\ No newline at end of file
ASCOfficeRtfFile/RtfFormatLib/source/RtfReader.cpp
View file @
9c49255b
...
...
@@ -21,13 +21,13 @@ bool RtfReader::Load()
void
RtfReader
::
PushState
()
{
ReaderStatePtr
psaveNew
=
ReaderStatePtr
(
new
ReaderState
());
psaveNew
->
m_nUD
=
m_oState
->
m_nUD
;
psaveNew
->
m_oCharProp
=
m_oState
->
m_oCharProp
;
psaveNew
->
m_oParagraphProp
=
m_oState
->
m_oParagraphProp
;
psaveNew
->
m_oRowProperty
=
m_oState
->
m_oRowProperty
;
psaveNew
->
m_oCellProperty
=
m_oState
->
m_oCellProperty
;
psaveNew
->
m_oCurOldList
=
m_oState
->
m_oCurOldList
;
//psaveNew -> m_oSectionProp
= m_oState->m_oSectionProp;
psaveNew
->
m_nUD
=
m_oState
->
m_nUD
;
psaveNew
->
m_oCharProp
=
m_oState
->
m_oCharProp
;
psaveNew
->
m_oParagraphProp
=
m_oState
->
m_oParagraphProp
;
psaveNew
->
m_oRowProperty
=
m_oState
->
m_oRowProperty
;
psaveNew
->
m_oCellProperty
=
m_oState
->
m_oCellProperty
;
psaveNew
->
m_oCurOldList
=
m_oState
->
m_oCurOldList
;
//psaveNew -> m_oSectionProp
= m_oState->m_oSectionProp;
psaveNew
->
psave
=
m_oState
;
m_oState
=
psaveNew
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Utils.h
View file @
9c49255b
...
...
@@ -601,7 +601,8 @@ public:
{
CString
sResult
=
sText
;
//обрезавем лишние пробелы
sResult
.
Trim
();
//sResult.Trim();
//удаляем дублирующие пробелы
while
(
sResult
.
Replace
(
_T
(
" "
),
_T
(
" "
)
)
>
0
)
;
...
...
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