mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Fix sitemap bug reported by Pinkerton
This commit is contained in:
parent
b351025f58
commit
75c0994f83
@ -6757,7 +6757,7 @@ HT_AddSitemapFor(HT_Pane htPane, char *pUrl, char *pSitemapUrl, char* name)
|
||||
char *nm;
|
||||
|
||||
|
||||
sp = htPane->db->translators[5];
|
||||
sp = RDFTNamed(htPane->db, "rdf:ht");
|
||||
nu = RDF_GetResource(htPane->db, pSitemapUrl, 1);
|
||||
nsmp = makeNewSMP(htPane, pUrl, pSitemapUrl);
|
||||
nsmp->sitemap = nu;
|
||||
@ -6770,8 +6770,8 @@ HT_AddSitemapFor(HT_Pane htPane, char *pUrl, char *pSitemapUrl, char* name)
|
||||
nm = copyString(XP_GetString(RDF_SITEMAPNAME));
|
||||
}
|
||||
nsmp->siteToolType = RDF_SITEMAP;
|
||||
nsmp->name = copyString(name);
|
||||
nsmp->sitemapUrl = copyString(pSitemapUrl);
|
||||
if (name) nsmp->name = copyString(name);
|
||||
nsmp->sitemapUrl = copyString(pSitemapUrl);
|
||||
|
||||
setContainerp(nu, 1);
|
||||
|
||||
@ -6792,11 +6792,12 @@ RetainOldSitemaps (HT_Pane htPane, char *pUrl)
|
||||
HT_URLSiteMapAssoc *nsmp;
|
||||
RDFT sp;
|
||||
|
||||
sp = htPane->db->translators[5];
|
||||
sp = RDFTNamed(htPane->db, "rdf:ht");
|
||||
nsmp = htPane->smp;
|
||||
while (nsmp != NULL) {
|
||||
if ((nsmp->siteToolType == RDF_SITEMAP)) {
|
||||
if (startsWith(nsmp->url, pUrl))
|
||||
if (startsWith(nsmp->url, pUrl) &&
|
||||
(!startsWith("file:", nsmp->url)))
|
||||
{
|
||||
if (!nsmp->onDisplayp) {
|
||||
RDF_Resource nu = RDF_GetResource(htPane->db, nsmp->sitemapUrl, 1);
|
||||
@ -6826,7 +6827,7 @@ HT_ExitPage(HT_Pane htPane, char *pUrl)
|
||||
HT_URLSiteMapAssoc *nsmp;
|
||||
RDFT sp;
|
||||
|
||||
sp = htPane->db->translators[5];
|
||||
sp = RDFTNamed(htPane->db, "rdf:ht");
|
||||
nsmp = htPane->sbp;
|
||||
while (nsmp != NULL) {
|
||||
HT_URLSiteMapAssoc *next;
|
||||
@ -7026,7 +7027,7 @@ HT_AddRelatedLinksFor(HT_Pane htPane, char *pUrl)
|
||||
char *buffer;
|
||||
|
||||
|
||||
sp = htPane->db->translators[5];
|
||||
sp = RDFTNamed(htPane->db, "rdf:ht");
|
||||
if (!htPane->smartBrowsingProviders) populateSBProviders(htPane);
|
||||
if (!relatedLinksEnabledURL(pUrl)) return;
|
||||
prov = htPane->smartBrowsingProviders;
|
||||
|
@ -416,7 +416,17 @@ RDF_GetSlotValue (RDF rdf, RDF_Resource u, RDF_Resource s,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
RDFT
|
||||
RDFTNamed (RDF rdf, char* name) {
|
||||
uint16 size = rdf->numTranslators;
|
||||
uint16 n = 0;
|
||||
while (n < size) {
|
||||
char* nn = (*((RDFT*)rdf->translators + n))->url;
|
||||
if (strcmp(nn, name) == 0) return (*((RDFT*)rdf->translators + n));
|
||||
n = n + 1;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RDF_Cursor
|
||||
getSlotValues (RDF rdf, RDF_Resource u, RDF_Resource s,
|
||||
|
@ -79,6 +79,7 @@ PR_PUBLIC_API(RDF_Cursor)RDF_Find (RDF_Resource s, void* v, RDF_ValueType type);
|
||||
PRIntn findEnumerator (PLHashEntry *he, PRIntn i, void *arg);
|
||||
void disposeAllDBs ();
|
||||
|
||||
|
||||
XP_END_PROTOS
|
||||
|
||||
#endif
|
||||
|
@ -89,7 +89,7 @@
|
||||
|
||||
#define MAX_URL_SIZE 300
|
||||
|
||||
#define copyString(source) XP_STRDUP(source)
|
||||
#define copyString(source) (source != NULL ? XP_STRDUP(source) : NULL)
|
||||
#define stringEquals(x, y) (strcasecomp(x, y) ==0)
|
||||
/*#define stringAppend(x, y) XP_AppendStr(x,y) */
|
||||
|
||||
@ -375,7 +375,7 @@ PRBool remoteStoreHasAssertionInt (RDFT mcf, RDF_Resource u, RDF_Resource s, voi
|
||||
PRBool nlocalStoreAddChildAt(RDFT mcf, RDF_Resource obj, RDF_Resource ref, RDF_Resource new,
|
||||
PRBool beforep);
|
||||
char* advertURLOfContainer (RDF r, RDF_Resource u) ;
|
||||
|
||||
RDFT RDFTNamed (RDF rdf, char* name) ;
|
||||
|
||||
|
||||
|
||||
|
@ -436,6 +436,7 @@ MakeSCookDB (char* url)
|
||||
sk->rf->localp = 1;
|
||||
beginReadingRDFFile(sk->rf);
|
||||
}
|
||||
ntr->url = copyString(url);
|
||||
return ntr;
|
||||
} else return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user