Commit 231a3b7b authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

исправление багов в Rtf->docx

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62536 954022d7-b5bf-4e40-9824-e11837661b57
parent 6a122d93
......@@ -153,7 +153,7 @@ namespace MathEquation
m_oStream.WriteBOOL(true);
}
CString sFontName;
//sFontName.Format(_T("%S"), pFont->sName.c_str());
//sFontName.Format(_T("%lS"), pFont->sName.c_str());
sFontName.Insert(0, _T("Cambria Math"));
if (sFontName)
{
......
......@@ -586,19 +586,26 @@ public:
class RtfFontTableReader: public RtfAbstractReader
{
private:
RtfFont m_oFont;
typedef enum { is_normal, is_panose, is_altname } InternalState;
int m_nKeepGlobalCodepage;
RtfFont m_oFont;
InternalState m_eInternalState;
public:
RtfFontTableReader()
{
m_bUseGlobalCodepage = true;
m_nKeepGlobalCodepage = -1;
m_eInternalState = is_normal;
m_oFont.SetDefaultOOX();
}
bool ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CString sCommand, bool hasParameter, int parameter)
{
if (m_nKeepGlobalCodepage < 0)//для корректного отображения названий шрифта нужно использовать данные самого шрифта
m_nKeepGlobalCodepage = oDocument.m_oProperty.m_nAnsiCodePage;
if( _T("fonttbl") == sCommand )
;
else if( _T("flomajor") == sCommand )
......@@ -648,12 +655,16 @@ public:
else if( _T("fcharset") == sCommand )
{
if( true == hasParameter )
{
m_oFont.m_nCharset = parameter;
}
}
else if( _T("cpg") == sCommand )
{
if( true == hasParameter )
m_oFont.m_nCodePage = parameter;
{
oDocument.m_oProperty.m_nAnsiCodePage = m_oFont.m_nCodePage = parameter;
}
}
else if( _T("fprq") == sCommand )
{
......@@ -688,10 +699,12 @@ public:
m_oFont.m_sName += sText;
}
}
oDocument.m_oProperty.m_nAnsiCodePage = m_nKeepGlobalCodepage;
}
void PopState(RtfDocument& oDocument, RtfReader& oReader)
{
RtfAbstractReader::PopState( oDocument, oReader );
if( is_panose == m_eInternalState )
m_eInternalState = is_normal;
if( is_altname == m_eInternalState )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment