Adjusted for GetOptions() return type change.

This commit is contained in:
Kohei Yoshida 2011-07-22 15:56:02 -04:00
parent b49b655394
commit dbf2ca3d9c
4 changed files with 39 additions and 42 deletions

View file

@ -52,7 +52,7 @@ protected:
public:
// These methods can also be used by other parsers.
static void ParseFrameOptions(SfxFrameDescriptor*, const HTMLOptions*, const String& );
static void ParseFrameOptions(SfxFrameDescriptor*, const HTMLOptions&, const String& );
};

View file

@ -65,12 +65,11 @@ public:
// Read the options of an image map
// <MAP>: sal_True = Image-Map has a name
// <AREA>: sal_True = Image-Map has now one Region more
static sal_Bool ParseMapOptions(ImageMap * pImageMap,
const HTMLOptions * pOptions );
sal_Bool ParseMapOptions(ImageMap * pImageMap)
static bool ParseMapOptions(ImageMap* pImageMap, const HTMLOptions& rOptions);
bool ParseMapOptions(ImageMap * pImageMap)
{ return ParseMapOptions(pImageMap, GetOptions()); }
static sal_Bool ParseAreaOptions(ImageMap * pImageMap, const String& rBaseURL,
const HTMLOptions * pOptions,
static bool ParseAreaOptions(ImageMap * pImageMap, const String& rBaseURL,
const HTMLOptions& rOptions,
sal_uInt16 nEventMouseOver = 0,
sal_uInt16 nEventMouseOut = 0 );
inline sal_Bool ParseAreaOptions(ImageMap * pImageMap, const String& rBaseURL,

View file

@ -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;

View file

@ -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();