Commit f394e3ac authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander Trofimov

ошибка в возвращаемом значении LoadFontByName

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59197 954022d7-b5bf-4e40-9824-e11837661b57
parent babdc998
...@@ -4017,11 +4017,11 @@ private: ...@@ -4017,11 +4017,11 @@ private:
#endif #endif
BOOL bNeedFindByParams = FALSE; BOOL bNeedFindByParams = FALSE;
if ( S_OK == m_pFontManager->LoadFontByName( bsFontName, 1, 0, 0, 0 ) ) #ifdef DESKTOP_EDITOR_GRAPHICS
if ( TRUE == m_pFontManager->LoadFontByName( bsFontName, 1, 0, 0, 0 ) )
{ {
unsigned long ulBit = 0; unsigned long ulBit = 0;
unsigned int unIndex = 0; unsigned int unIndex = 0;
#ifdef DESKTOP_EDITOR_GRAPHICS
//todo //todo
//if ( UNKNOWN_CHARSET != pFont->unCharSet ) //if ( UNKNOWN_CHARSET != pFont->unCharSet )
//{ //{
...@@ -4032,6 +4032,10 @@ private: ...@@ -4032,6 +4032,10 @@ private:
// bNeedFindByParams = TRUE; // bNeedFindByParams = TRUE;
//} //}
#else #else
if ( S_OK == m_pFontManager->LoadFontByName( bsFontName, 1, 0, 0, 0 ) )
{
unsigned long ulBit = 0;
unsigned int unIndex = 0;
if ( UNKNOWN_CHARSET != pFont->unCharSet ) if ( UNKNOWN_CHARSET != pFont->unCharSet )
{ {
GetCodePageByCharset( pFont->unCharSet, &ulBit, &unIndex ); GetCodePageByCharset( pFont->unCharSet, &ulBit, &unIndex );
...@@ -4056,9 +4060,10 @@ private: ...@@ -4056,9 +4060,10 @@ private:
*oFontSelectFormat.usWeight = pFont->ushWeight; *oFontSelectFormat.usWeight = pFont->ushWeight;
CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat); CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat);
if ( NULL != pFontInfo)
{
long lStyle = ( pFontInfo->m_bBold ? 1 : 0 ) + ( pFontInfo->m_bItalic ? 2 : 0 ); long lStyle = ( pFontInfo->m_bBold ? 1 : 0 ) + ( pFontInfo->m_bItalic ? 2 : 0 );
if ( NULL != pFontInfo && S_OK == m_pFontManager->LoadFontByName( pFontInfo->m_wsFontName, 11, lStyle, 96, 96 ) ) if ( TRUE == m_pFontManager->LoadFontByName( pFontInfo->m_wsFontName, 11, lStyle, 96, 96 ) )
{ {
free( pFont->sFaceName ); free( pFont->sFaceName );
std::string sNewName = unicode_to_ascii( pFontInfo->m_wsFontName.c_str()); std::string sNewName = unicode_to_ascii( pFontInfo->m_wsFontName.c_str());
...@@ -4073,6 +4078,7 @@ private: ...@@ -4073,6 +4078,7 @@ private:
} }
} }
} }
}
#else #else
USES_CONVERSION; USES_CONVERSION;
::SysFreeString( bsFontName ); ::SysFreeString( bsFontName );
......
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