diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-07-22 15:56:02 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-07-22 22:08:26 -0400 |
commit | dbf2ca3d9c034866546f40c13c5b2c7020e35725 (patch) | |
tree | bcd98f44e639ef53093c76dcead8e61f1a6f924d /sfx2/source | |
parent | b49b655394facab29aa41281730bc013ee5de144 (diff) |
Adjusted for GetOptions() return type change.
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/bastyp/frmhtml.cxx | 32 | ||||
-rw-r--r-- | sfx2/source/bastyp/sfxhtml.cxx | 38 |
2 files changed, 34 insertions, 36 deletions
diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx index 19c11b525dab..75cd28be416f 100644 --- a/sfx2/source/bastyp/frmhtml.cxx +++ b/sfx2/source/bastyp/frmhtml.cxx @@ -65,7 +65,8 @@ static HTMLOptionEnum const aScollingTable[] = { 0, 0 } }; -void SfxFrameHTMLParser::ParseFrameOptions( SfxFrameDescriptor *pFrame, const HTMLOptions *pOptions, const String& rBaseURL ) +void SfxFrameHTMLParser::ParseFrameOptions( + SfxFrameDescriptor *pFrame, const HTMLOptions& rOptions, const String& rBaseURL ) { // Get and set the options Size aMargin( pFrame->GetMargin() ); @@ -77,16 +78,15 @@ void SfxFrameHTMLParser::ParseFrameOptions( SfxFrameDescriptor *pFrame, const HT // We will not mimic that bug ! sal_Bool bMarginWidth = sal_False, bMarginHeight = sal_False; - sal_uInt16 nArrLen = pOptions->Count(); - for ( sal_uInt16 i=0; i<nArrLen; i++ ) + for (size_t i = 0, n = rOptions.size(); i < n; ++i) { - const HTMLOption *pOption = (*pOptions)[i]; - switch( pOption->GetToken() ) + const HTMLOption& aOption = rOptions[i]; + switch( aOption.GetToken() ) { case HTML_O_BORDERCOLOR: { Color aColor; - pOption->GetColor( aColor ); + aOption.GetColor( aColor ); pFrame->SetWallpaper( Wallpaper( aColor ) ); break; } @@ -94,20 +94,20 @@ void SfxFrameHTMLParser::ParseFrameOptions( SfxFrameDescriptor *pFrame, const HT pFrame->SetURL( String( INetURLObject::GetAbsURL( - rBaseURL, pOption->GetString())) ); + rBaseURL, aOption.GetString())) ); break; case HTML_O_NAME: - pFrame->SetName( pOption->GetString() ); + pFrame->SetName( aOption.GetString() ); break; case HTML_O_MARGINWIDTH: - aMargin.Width() = pOption->GetNumber(); + aMargin.Width() = aOption.GetNumber(); if( !bMarginHeight ) aMargin.Height() = 0; bMarginWidth = sal_True; break; case HTML_O_MARGINHEIGHT: - aMargin.Height() = pOption->GetNumber(); + aMargin.Height() = aOption.GetNumber(); if( !bMarginWidth ) aMargin.Width() = 0; @@ -115,12 +115,12 @@ void SfxFrameHTMLParser::ParseFrameOptions( SfxFrameDescriptor *pFrame, const HT break; case HTML_O_SCROLLING: pFrame->SetScrollingMode( - (ScrollingMode)pOption->GetEnum( aScollingTable, + (ScrollingMode)aOption.GetEnum( aScollingTable, ScrollingAuto ) ); break; case HTML_O_FRAMEBORDER: { - String aStr = pOption->GetString(); + String aStr = aOption.GetString(); sal_Bool bBorder = sal_True; if ( aStr.EqualsIgnoreCaseAscii("NO") || aStr.EqualsIgnoreCaseAscii("0") ) @@ -132,19 +132,19 @@ void SfxFrameHTMLParser::ParseFrameOptions( SfxFrameDescriptor *pFrame, const HT pFrame->SetResizable( sal_False ); break; default: - if ( pOption->GetTokenString().EqualsIgnoreCaseAscii( + if ( aOption.GetTokenString().EqualsIgnoreCaseAscii( HTML_O_READONLY ) ) { - String aStr = pOption->GetString(); + String aStr = aOption.GetString(); sal_Bool bReadonly = sal_True; if ( aStr.EqualsIgnoreCaseAscii("FALSE") ) bReadonly = sal_False; pFrame->SetReadOnly( bReadonly ); } - else if ( pOption->GetTokenString().EqualsIgnoreCaseAscii( + else if ( aOption.GetTokenString().EqualsIgnoreCaseAscii( HTML_O_EDIT ) ) { - String aStr = pOption->GetString(); + String aStr = aOption.GetString(); sal_Bool bEdit = sal_True; if ( aStr.EqualsIgnoreCaseAscii("FALSE") ) bEdit = sal_False; diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index ede1f873d6bc..bc33faba52db 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -96,21 +96,20 @@ SfxHTMLParser::~SfxHTMLParser() delete pDLMedium; } -sal_Bool SfxHTMLParser::ParseMapOptions(ImageMap * pImageMap, - const HTMLOptions * pOptions) +bool SfxHTMLParser::ParseMapOptions( + ImageMap* pImageMap, const HTMLOptions& rOptions) { DBG_ASSERT( pImageMap, "ParseMapOptions: No Image-Map" ); - DBG_ASSERT( pOptions, "ParseMapOptions: No Options" ); String aName; - for( sal_uInt16 i=pOptions->Count(); i; ) + for (size_t i = rOptions.size(); i; ) { - const HTMLOption *pOption = (*pOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& aOption = rOptions[--i]; + switch( aOption.GetToken() ) { case HTML_O_NAME: - aName = pOption->GetString(); + aName = aOption.GetString(); break; } } @@ -121,13 +120,12 @@ sal_Bool SfxHTMLParser::ParseMapOptions(ImageMap * pImageMap, return aName.Len() > 0; } -sal_Bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& rBaseURL, - const HTMLOptions * pOptions, +bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& rBaseURL, + const HTMLOptions& rOptions, sal_uInt16 nEventMouseOver, sal_uInt16 nEventMouseOut ) { DBG_ASSERT( pImageMap, "ParseAreaOptions: no Image-Map" ); - DBG_ASSERT( pOptions, "ParseAreaOptions: no Options" ); sal_uInt16 nShape = IMAP_OBJ_RECTANGLE; SvULongs aCoords; @@ -135,33 +133,33 @@ sal_Bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& rBa sal_Bool bNoHRef = sal_False; SvxMacroTableDtor aMacroTbl; - for( sal_uInt16 i=pOptions->Count(); i; ) + for (size_t i = rOptions.size(); i; ) { sal_uInt16 nEvent = 0; ScriptType eScrpType = STARBASIC; - const HTMLOption *pOption = (*pOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_NAME: - aName = pOption->GetString(); + aName = rOption.GetString(); break; case HTML_O_SHAPE: - pOption->GetEnum( nShape, aAreaShapeOptEnums ); + rOption.GetEnum( nShape, aAreaShapeOptEnums ); break; case HTML_O_COORDS: - pOption->GetNumbers( aCoords, sal_True ); + rOption.GetNumbers( aCoords, sal_True ); break; case HTML_O_HREF: - aHRef = INetURLObject::GetAbsURL( rBaseURL, pOption->GetString() ); + aHRef = INetURLObject::GetAbsURL( rBaseURL, rOption.GetString() ); break; case HTML_O_NOHREF: bNoHRef = sal_True; break; case HTML_O_ALT: - aAlt = pOption->GetString(); + aAlt = rOption.GetString(); break; case HTML_O_TARGET: - aTarget = pOption->GetString(); + aTarget = rOption.GetString(); break; case HTML_O_ONMOUSEOVER: @@ -178,7 +176,7 @@ sal_Bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& rBa IMAPOBJ_SETEVENT: if( nEvent ) { - String sTmp( pOption->GetString() ); + String sTmp( rOption.GetString() ); if( sTmp.Len() ) { sTmp.ConvertLineEnd(); |