nRetValue was a reference, nRetValue->rRetValue

Change-Id: I0516bc22274a3bdba54246613c9925d3f2a67c44
This commit is contained in:
Caolán McNamara
2014-01-29 10:00:29 +00:00
parent 951a9aa2f0
commit 19aa235feb

View File

@@ -5354,10 +5354,10 @@ sal_Bool PPTPortionObj::HasTabulator()
return bRetValue; return bRetValue;
} }
sal_Bool PPTPortionObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sal_uInt32 nDestinationInstance ) const sal_Bool PPTPortionObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, sal_uInt32 nDestinationInstance ) const
{ {
sal_uInt32 nMask = 1 << nAttr; sal_uInt32 nMask = 1 << nAttr;
nRetValue = 0; rRetValue = 0;
sal_uInt32 bIsHardAttribute = ( ( pCharSet->mnAttrSet & nMask ) != 0 ) ? 1 : 0; sal_uInt32 bIsHardAttribute = ( ( pCharSet->mnAttrSet & nMask ) != 0 ) ? 1 : 0;
@@ -5371,22 +5371,22 @@ sal_Bool PPTPortionObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sal_
case PPT_CharAttr_Shadow : case PPT_CharAttr_Shadow :
case PPT_CharAttr_Strikeout : case PPT_CharAttr_Strikeout :
case PPT_CharAttr_Embossed : case PPT_CharAttr_Embossed :
nRetValue = ( pCharSet->mnFlags & nMask ) ? 1 : 0; rRetValue = ( pCharSet->mnFlags & nMask ) ? 1 : 0;
break; break;
case PPT_CharAttr_Font : case PPT_CharAttr_Font :
nRetValue = pCharSet->mnFont; rRetValue = pCharSet->mnFont;
break; break;
case PPT_CharAttr_AsianOrComplexFont : case PPT_CharAttr_AsianOrComplexFont :
nRetValue = pCharSet->mnAsianOrComplexFont; rRetValue = pCharSet->mnAsianOrComplexFont;
break; break;
case PPT_CharAttr_FontHeight : case PPT_CharAttr_FontHeight :
nRetValue = pCharSet->mnFontHeight; rRetValue = pCharSet->mnFontHeight;
break; break;
case PPT_CharAttr_FontColor : case PPT_CharAttr_FontColor :
nRetValue = pCharSet->mnColor; rRetValue = pCharSet->mnColor;
break; break;
case PPT_CharAttr_Escapement : case PPT_CharAttr_Escapement :
nRetValue = pCharSet->mnEscapement; rRetValue = pCharSet->mnEscapement;
break; break;
default : default :
OSL_FAIL( "SJ:PPTPortionObj::GetAttrib ( hard attribute does not exist )" ); OSL_FAIL( "SJ:PPTPortionObj::GetAttrib ( hard attribute does not exist )" );
@@ -5410,47 +5410,47 @@ sal_Bool PPTPortionObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sal_
case PPT_CharAttr_Strikeout : case PPT_CharAttr_Strikeout :
case PPT_CharAttr_Embossed : case PPT_CharAttr_Embossed :
{ {
nRetValue = ( rCharLevel.mnFlags & nMask ) ? 1 : 0; rRetValue = ( rCharLevel.mnFlags & nMask ) ? 1 : 0;
if ( pCharLevel ) if ( pCharLevel )
{ {
sal_uInt32 nTmp = ( pCharLevel->mnFlags & nMask ) ? 1 : 0; sal_uInt32 nTmp = ( pCharLevel->mnFlags & nMask ) ? 1 : 0;
if ( nRetValue != nTmp ) if ( rRetValue != nTmp )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
} }
break; break;
case PPT_CharAttr_Font : case PPT_CharAttr_Font :
{ {
nRetValue = rCharLevel.mnFont; rRetValue = rCharLevel.mnFont;
if ( pCharLevel && ( nRetValue != pCharLevel->mnFont ) ) if ( pCharLevel && ( rRetValue != pCharLevel->mnFont ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_CharAttr_AsianOrComplexFont : case PPT_CharAttr_AsianOrComplexFont :
{ {
nRetValue = rCharLevel.mnAsianOrComplexFont; rRetValue = rCharLevel.mnAsianOrComplexFont;
if ( pCharLevel && ( nRetValue != pCharLevel->mnAsianOrComplexFont ) ) if ( pCharLevel && ( rRetValue != pCharLevel->mnAsianOrComplexFont ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_CharAttr_FontHeight : case PPT_CharAttr_FontHeight :
{ {
nRetValue = rCharLevel.mnFontHeight; rRetValue = rCharLevel.mnFontHeight;
if ( pCharLevel && ( nRetValue != pCharLevel->mnFontHeight ) ) if ( pCharLevel && ( rRetValue != pCharLevel->mnFontHeight ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_CharAttr_FontColor : case PPT_CharAttr_FontColor :
{ {
nRetValue = rCharLevel.mnFontColor; rRetValue = rCharLevel.mnFontColor;
if ( pCharLevel && ( nRetValue != pCharLevel->mnFontColor ) ) if ( pCharLevel && ( rRetValue != pCharLevel->mnFontColor ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_CharAttr_Escapement : case PPT_CharAttr_Escapement :
{ {
nRetValue = rCharLevel.mnEscapement; rRetValue = rCharLevel.mnEscapement;
if ( pCharLevel && ( nRetValue != pCharLevel->mnEscapement ) ) if ( pCharLevel && ( rRetValue != pCharLevel->mnEscapement ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
@@ -5775,10 +5775,10 @@ void PPTParagraphObj::UpdateBulletRelSize( sal_uInt32& nBulletRelSize ) const
} }
} }
sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sal_uInt32 nDestinationInstance ) sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, sal_uInt32 nDestinationInstance )
{ {
sal_uInt32 nMask = 1 << nAttr; sal_uInt32 nMask = 1 << nAttr;
nRetValue = 0; rRetValue = 0;
if ( nAttr > 21 ) if ( nAttr > 21 )
{ {
@@ -5799,20 +5799,20 @@ sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sa
bHardBulletColor = ( mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[ pParaSet->mnDepth ].mnBuFlags bHardBulletColor = ( mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[ pParaSet->mnDepth ].mnBuFlags
& ( 1 << PPT_ParaAttr_BuHardColor ) ) != 0; & ( 1 << PPT_ParaAttr_BuHardColor ) ) != 0;
if ( bHardBulletColor ) if ( bHardBulletColor )
nRetValue = pParaSet->mnBulletColor; rRetValue = pParaSet->mnBulletColor;
else else
{ {
nRetValue = PPT_COLSCHEME_TEXT_UND_ZEILEN; rRetValue = PPT_COLSCHEME_TEXT_UND_ZEILEN;
if ((nDestinationInstance != 0xffffffff) && !m_PortionList.empty()) if ((nDestinationInstance != 0xffffffff) && !m_PortionList.empty())
{ {
PPTPortionObj const& rPortion = m_PortionList.front(); PPTPortionObj const& rPortion = m_PortionList.front();
if (rPortion.pCharSet->mnAttrSet & (1 << PPT_CharAttr_FontColor)) if (rPortion.pCharSet->mnAttrSet & (1 << PPT_CharAttr_FontColor))
{ {
nRetValue = rPortion.pCharSet->mnColor; rRetValue = rPortion.pCharSet->mnColor;
} }
else else
{ {
nRetValue = mrStyleSheet.mpCharSheet[ nDestinationInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontColor; rRetValue = mrStyleSheet.mpCharSheet[ nDestinationInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontColor;
} }
} }
} }
@@ -5826,27 +5826,27 @@ sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sa
bHardBuFont = ( mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[ pParaSet->mnDepth ].mnBuFlags bHardBuFont = ( mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[ pParaSet->mnDepth ].mnBuFlags
& ( 1 << PPT_ParaAttr_BuHardFont ) ) != 0; & ( 1 << PPT_ParaAttr_BuHardFont ) ) != 0;
if ( bHardBuFont ) if ( bHardBuFont )
nRetValue = pParaSet->mpArry[ PPT_ParaAttr_BulletFont ]; rRetValue = pParaSet->mpArry[ PPT_ParaAttr_BulletFont ];
else else
{ {
// it is the font used which assigned to the first character of the following text // it is the font used which assigned to the first character of the following text
nRetValue = 0; rRetValue = 0;
if ((nDestinationInstance != 0xffffffff) && !m_PortionList.empty()) if ((nDestinationInstance != 0xffffffff) && !m_PortionList.empty())
{ {
PPTPortionObj const& rPortion = m_PortionList.front(); PPTPortionObj const& rPortion = m_PortionList.front();
if (rPortion.pCharSet->mnAttrSet & ( 1 << PPT_CharAttr_Font ) ) if (rPortion.pCharSet->mnAttrSet & ( 1 << PPT_CharAttr_Font ) )
{ {
nRetValue = rPortion.pCharSet->mnFont; rRetValue = rPortion.pCharSet->mnFont;
} }
else else
{ {
nRetValue = mrStyleSheet.mpCharSheet[ nDestinationInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFont; rRetValue = mrStyleSheet.mpCharSheet[ nDestinationInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFont;
} }
} }
} }
} }
else else
nRetValue = pParaSet->mpArry[ nAttr ]; rRetValue = pParaSet->mpArry[ nAttr ];
} }
else else
{ {
@@ -5862,10 +5862,10 @@ sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sa
{ {
case PPT_ParaAttr_BulletOn : case PPT_ParaAttr_BulletOn :
{ {
nRetValue = rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BulletOn ); rRetValue = rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BulletOn );
if ( pParaLevel ) if ( pParaLevel )
{ {
if ( nRetValue != ( (sal_uInt32)pParaLevel->mnBuFlags & ( 1 << PPT_ParaAttr_BulletOn ) ) ) if ( rRetValue != ( (sal_uInt32)pParaLevel->mnBuFlags & ( 1 << PPT_ParaAttr_BulletOn ) ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
} }
@@ -5877,8 +5877,8 @@ sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sa
break; break;
case PPT_ParaAttr_BulletChar : case PPT_ParaAttr_BulletChar :
{ {
nRetValue = rParaLevel.mnBulletChar; rRetValue = rParaLevel.mnBulletChar;
if ( pParaLevel && ( nRetValue != pParaLevel->mnBulletChar ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnBulletChar ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
@@ -5891,8 +5891,8 @@ sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sa
bHardBuFont = ( rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BuHardFont ) ) != 0; bHardBuFont = ( rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BuHardFont ) ) != 0;
if ( bHardBuFont ) if ( bHardBuFont )
{ {
nRetValue = rParaLevel.mnBulletFont; rRetValue = rParaLevel.mnBulletFont;
if ( pParaLevel && ( nRetValue != pParaLevel->mnBulletFont ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnBulletFont ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
else else
@@ -5901,11 +5901,11 @@ sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sa
{ {
PPTPortionObj const& rPortion = m_PortionList.front(); PPTPortionObj const& rPortion = m_PortionList.front();
bIsHardAttribute = rPortion.GetAttrib( bIsHardAttribute = rPortion.GetAttrib(
PPT_CharAttr_Font, nRetValue, nDestinationInstance); PPT_CharAttr_Font, rRetValue, nDestinationInstance);
} }
else else
{ {
nRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFont; rRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFont;
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
} }
@@ -5913,8 +5913,8 @@ sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sa
break; break;
case PPT_ParaAttr_BulletHeight : case PPT_ParaAttr_BulletHeight :
{ {
nRetValue = rParaLevel.mnBulletHeight; rRetValue = rParaLevel.mnBulletHeight;
if ( pParaLevel && ( nRetValue != pParaLevel->mnBulletHeight ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnBulletHeight ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
@@ -5927,8 +5927,8 @@ sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sa
bHardBulletColor = ( rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BuHardColor ) ) != 0; bHardBulletColor = ( rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BuHardColor ) ) != 0;
if ( bHardBulletColor ) if ( bHardBulletColor )
{ {
nRetValue = rParaLevel.mnBulletColor; rRetValue = rParaLevel.mnBulletColor;
if ( pParaLevel && ( nRetValue != pParaLevel->mnBulletColor ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnBulletColor ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
else else
@@ -5939,19 +5939,19 @@ sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sa
if (rPortion.mbIsHyperlink ) if (rPortion.mbIsHyperlink )
{ {
if( rPortion.mbHardHylinkOrigColor ) if( rPortion.mbHardHylinkOrigColor )
nRetValue = rPortion.mnHylinkOrigColor; rRetValue = rPortion.mnHylinkOrigColor;
else else
nRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontColor; rRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontColor;
bIsHardAttribute = sal_True; bIsHardAttribute = sal_True;
} }
else else
{ {
bIsHardAttribute = rPortion.GetAttrib( PPT_CharAttr_FontColor, nRetValue, nDestinationInstance ); bIsHardAttribute = rPortion.GetAttrib( PPT_CharAttr_FontColor, rRetValue, nDestinationInstance );
} }
} }
else else
{ {
nRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontColor; rRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontColor;
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
} }
@@ -5959,78 +5959,78 @@ sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sa
break; break;
case PPT_ParaAttr_Adjust : case PPT_ParaAttr_Adjust :
{ {
nRetValue = rParaLevel.mnAdjust; rRetValue = rParaLevel.mnAdjust;
if ( pParaLevel && ( nRetValue != pParaLevel->mnAdjust ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnAdjust ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_ParaAttr_LineFeed : case PPT_ParaAttr_LineFeed :
{ {
nRetValue = rParaLevel.mnLineFeed; rRetValue = rParaLevel.mnLineFeed;
if ( pParaLevel && ( nRetValue != pParaLevel->mnLineFeed ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnLineFeed ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_ParaAttr_UpperDist : case PPT_ParaAttr_UpperDist :
{ {
nRetValue = rParaLevel.mnUpperDist; rRetValue = rParaLevel.mnUpperDist;
if ( pParaLevel && ( nRetValue != pParaLevel->mnUpperDist ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnUpperDist ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_ParaAttr_LowerDist : case PPT_ParaAttr_LowerDist :
{ {
nRetValue = rParaLevel.mnLowerDist; rRetValue = rParaLevel.mnLowerDist;
if ( pParaLevel && ( nRetValue != pParaLevel->mnLowerDist ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnLowerDist ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_ParaAttr_TextOfs : case PPT_ParaAttr_TextOfs :
{ {
nRetValue = rParaLevel.mnTextOfs; rRetValue = rParaLevel.mnTextOfs;
if ( pParaLevel && ( nRetValue != pParaLevel->mnTextOfs ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnTextOfs ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_ParaAttr_BulletOfs : case PPT_ParaAttr_BulletOfs :
{ {
nRetValue = rParaLevel.mnBulletOfs; rRetValue = rParaLevel.mnBulletOfs;
if ( pParaLevel && ( nRetValue != pParaLevel->mnBulletOfs ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnBulletOfs ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_ParaAttr_DefaultTab : case PPT_ParaAttr_DefaultTab :
{ {
nRetValue = rParaLevel.mnDefaultTab; rRetValue = rParaLevel.mnDefaultTab;
if ( pParaLevel && ( nRetValue != pParaLevel->mnDefaultTab ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnDefaultTab ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_ParaAttr_AsianLB_1 : case PPT_ParaAttr_AsianLB_1 :
{ {
nRetValue = rParaLevel.mnAsianLineBreak & 1; rRetValue = rParaLevel.mnAsianLineBreak & 1;
if ( pParaLevel && ( nRetValue != ( (sal_uInt32)pParaLevel->mnAsianLineBreak & 1 ) ) ) if ( pParaLevel && ( rRetValue != ( (sal_uInt32)pParaLevel->mnAsianLineBreak & 1 ) ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_ParaAttr_AsianLB_2 : case PPT_ParaAttr_AsianLB_2 :
{ {
nRetValue = ( rParaLevel.mnAsianLineBreak >> 1 ) & 1; rRetValue = ( rParaLevel.mnAsianLineBreak >> 1 ) & 1;
if ( pParaLevel && ( nRetValue != ( ( (sal_uInt32)pParaLevel->mnAsianLineBreak >> 1 ) & 1 ) ) ) if ( pParaLevel && ( rRetValue != ( ( (sal_uInt32)pParaLevel->mnAsianLineBreak >> 1 ) & 1 ) ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_ParaAttr_AsianLB_3 : case PPT_ParaAttr_AsianLB_3 :
{ {
nRetValue = ( rParaLevel.mnAsianLineBreak >> 2 ) & 1; rRetValue = ( rParaLevel.mnAsianLineBreak >> 2 ) & 1;
if ( pParaLevel && ( nRetValue != ( ( (sal_uInt32)pParaLevel->mnAsianLineBreak >> 2 ) & 1 ) ) ) if ( pParaLevel && ( rRetValue != ( ( (sal_uInt32)pParaLevel->mnAsianLineBreak >> 2 ) & 1 ) ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;
case PPT_ParaAttr_BiDi : case PPT_ParaAttr_BiDi :
{ {
nRetValue = rParaLevel.mnBiDi; rRetValue = rParaLevel.mnBiDi;
if ( pParaLevel && ( nRetValue != pParaLevel->mnBiDi ) ) if ( pParaLevel && ( rRetValue != pParaLevel->mnBiDi ) )
bIsHardAttribute = 1; bIsHardAttribute = 1;
} }
break; break;