The default bug view has changed. See this FAQ.

[CasCadeS] inefficient code in SerializeExternalSheet

RESOLVED FIXED

Status

SeaMonkey
Composer
RESOLVED FIXED
15 years ago
9 years ago

People

(Reporter: Darin Fisher, Assigned: glazou)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

15 years ago
this code should not be creating a standard-url.

924 function SerializeExternalSheet(sheet, href)
925 {
926   var nsuri =
Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURI);
927   if (href)
928     nsuri.spec = href;
929   else
930     nsuri.spec = sheet.href;
931   var fileURL = nsuri.QueryInterface(Components.interfaces.nsIFileURL);
932   var localFile = fileURL.file;
933   var fileOuputStream =
Components.classes['@mozilla.org/network/file-output-stream;1'].createInstance(Components.interfaces.nsIFileOutputStream);
934   try {
935     fileOuputStream.init(localFile, -1, -1, 0);

instead, you should replace it with something like the following:

var ios
  = Components.classes["@mozilla.org/network/io-service;1"]
              .getService(Components.interfaces.nsIIOService);
var fileHandler
  = ios.getProtocolHandler("file")
       .QueryInterface(Components.interfaces.nsIFileProtocolHandler);
var localfile
  = fileHandler.getFileFromURLSpec(href);
(Assignee)

Comment 1

15 years ago
Thanks for contributing and thanks for the hint, Darin :-)
Btw, the component for CaScadeS is Editor:Composer.
Changing. Accepting bug.
Status: NEW → ASSIGNED
Component: Editor: Core → Editor: Composer
OS: Linux → All
Hardware: PC → All
(Assignee)

Comment 2

15 years ago
I was not fast enough : we now have a new component Editor:CSS Editor
Component: Editor: Composer → Editor: CSS Editor
(Assignee)

Comment 3

15 years ago
code added to CaScadeS and ready to check-in, thanks Darin.
(Assignee)

Comment 4

15 years ago
fix checked in trunk 11/07/2002 01:24
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey

Updated

9 years ago
Component: Composer CSS Editor → Composer
QA Contact: sujay → composer
You need to log in before you can comment on or make changes to this bug.