int CconvCdDedDispProp::fromOuPropertiesText( CdDedDispProp* pCdDedDispProp , const OuPropertiesText::IfNodeContainerConst* pCNodeContainer , OuPropertiesText::ErrorInfo::COuErrorInfoContainer* pCOuErrorInfoContainer ) { int iRv = 0 ; CdDedDispProp aCdDedDispProp ; // -------------------------------- //1.JikokuhyouFont // 数が足りない場合、指定のない要素は設定をしません。 for ( int idx = 0 ; iRv >= 0 && idx < CentDedRessyasyubetsu::JIKOKUHYOUFONT_COUNT ; idx ++ ) { Ou< const OuPropertiesText::CNode > pNode = pCNodeContainer->getInName( nameJikokuhyouFont , idx ) ; Ou< const OuPropertiesText::CPropertyString > pPropertyString = dynamic_castOu< const OuPropertiesText::CPropertyString >( pNode ) ; if ( pPropertyString != NULL ) { wstring strValue = pPropertyString->getValue() ; CdFontProp aCdFontProp ; int iResult = CdFontProp_from_string( &aCdFontProp , strValue ) ; if ( iResult < 0 ){ COuErrorInfo aCOuErrorInfo( ERRREASON_InvalidValue() ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Name() , nameJikokuhyouFont ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Value() , strValue ) ; iRv = -12 ; // JikokuhyouFont の内容が不正です。 } else { aCdDedDispProp.setJikokuhyouFont( idx , aCdFontProp ) ; } } } //JikokuhyouVFont { wstring strValue = pCNodeContainer->getValue( nameJikokuhyouVFont ) ; if ( strValue.length() > 0 ) { CdFontProp aCdFontProp ; int iResult = CdFontProp_from_string( &aCdFontProp , strValue ) ; if ( iResult < 0 ){ COuErrorInfo aCOuErrorInfo( ERRREASON_InvalidValue() ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Name() , nameJikokuhyouVFont ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Value() , strValue ) ; iRv = -13 ; // JikokuhyouVFont の内容が不正です。 } else { aCdDedDispProp.setJikokuhyouVFont( aCdFontProp ) ; } } } //2.DiaEkimeiFont if ( iRv >= 0 ){ wstring strValue = pCNodeContainer->getValue( nameDiaEkimeiFont ) ; CdFontProp aCdFontProp ; int iResult = CdFontProp_from_string( &aCdFontProp , strValue ) ; if ( iResult < 0 ){ COuErrorInfo aCOuErrorInfo( ERRREASON_InvalidValue() ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Name() , nameDiaEkimeiFont ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Value() , strValue ) ; iRv = -22 ; // DiaEkimeiFont の内容が不正です。 } else { aCdDedDispProp.setDiaEkimeiFont( aCdFontProp ) ; } } //3.DiaJikokuFont if ( iRv >= 0 ){ wstring strValue = pCNodeContainer->getValue( nameDiaJikokuFont ) ; CdFontProp aCdFontProp ; int iResult = CdFontProp_from_string( &aCdFontProp , strValue ) ; if ( iResult < 0 ){ COuErrorInfo aCOuErrorInfo( ERRREASON_InvalidValue() ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Name() , nameDiaJikokuFont ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Value() , strValue ) ; iRv = -32 ; // DiaJikokuFont の内容が不正です。 } else { aCdDedDispProp.setDiaJikokuFont( aCdFontProp ) ; } } //4.DiaRessyaFont if ( iRv >= 0 ){ wstring strValue = pCNodeContainer->getValue( nameDiaRessyaFont ) ; // この属性は、あとから追加したため、空の場合でもエラーにはしません if ( !strValue.empty() ){ CdFontProp aCdFontProp ; int iResult = CdFontProp_from_string( &aCdFontProp , strValue ) ; if ( iResult < 0 ){ COuErrorInfo aCOuErrorInfo( ERRREASON_InvalidValue() ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Name() , nameDiaRessyaFont ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Value() , strValue ) ; iRv = -32 ; // DiaRessyaFont の内容が不正です。 } else { aCdDedDispProp.setDiaRessyaFont( aCdFontProp ) ; } } } //5.CommentFont if ( iRv >= 0 ){ wstring strValue = pCNodeContainer->getValue( nameCommentFont ) ; CdFontProp aCdFontProp ; int iResult = CdFontProp_from_string( &aCdFontProp , strValue ) ; if ( iResult < 0 ){ COuErrorInfo aCOuErrorInfo( ERRREASON_InvalidValue() ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Name() , nameCommentFont ) ; aCOuErrorInfo.getProp()->setValue( ERRPROP_Value() , strValue ) ; iRv = -32 ; // CommentFont の内容が不正です。 } else { aCdDedDispProp.setViewCommentFont( aCdFontProp ) ; } } //6.DiaMojiColor if ( iRv >= 0 ) { wstring strValue = pCNodeContainer->getValue( nameDiaMojiColor ) ; aCdDedDispProp.setDiaMojiColor( CdColorProp_from_string( strValue ) ) ; } //7.DiaHaikeiColor if ( iRv >= 0 ) { wstring strValue = pCNodeContainer->getValue( nameDiaHaikeiColor ) ; aCdDedDispProp.setDiaHaikeiColor( CdColorProp_from_string( strValue ) ) ; } //8.DiaRessyaColor if ( iRv >= 0 ) { wstring strValue = pCNodeContainer->getValue( nameDiaRessyaColor ) ; aCdDedDispProp.setDiaRessyaColor( CdColorProp_from_string( strValue ) ) ; } //9.DiaJikuColor if ( iRv >= 0 ) { wstring strValue = pCNodeContainer->getValue( nameDiaJikuColor ) ; aCdDedDispProp.setDiaJikuColor( CdColorProp_from_string( strValue ) ) ; } //10.EkimeiLength if ( iRv >= 0 ){ wstring strValue = pCNodeContainer->getValue( nameEkimeiLength ) ; if ( !strValue.empty() ){ int iValue = intOf( strValue ) ; if ( iValue > 0 ){ aCdDedDispProp.setEkimeiLength( iValue ) ; } } } //11.EkimeiLength if ( iRv >= 0 ) { wstring strValue = pCNodeContainer->getValue( nameJikokuhyouRessyaWidth ) ; if ( !strValue.empty() ) { int iValue = intOf( strValue ) ; if ( iValue > 0 ) { aCdDedDispProp.setJikokuhyouRessyaWidth( iValue ) ; } } } // -------------------------------- if ( iRv >= 0 ){ *pCdDedDispProp = aCdDedDispProp ; } return ( iRv ) ; }