[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
Re: [XaraXtreme-dev] Open file, get standard colours
- From: JLM <jsado_sc5@xxxxxxxxxxxxx>
- Date: Tue, 26 Jun 2007 21:04:58 -0400
- Subject: Re: [XaraXtreme-dev] Open file, get standard colours
I simply commented out the EXCLUDE_FROM_XARALX preprocessor directives,
recompiled, and it appears to work. It loads a default document for gif,
png, and jpg, but not for svg or xar. Also, I tried saving a file that I
opened (originally a png), and Xara did not automatically save it as
filename.xar, but prompted for a name.
The only problem I still see is when loading an SVG file. An SVG does
not have to define any colours, and hence when opening one a document
with no colours is still created. I think my code submission is still
valid for this filter as well as any others that answer no to
IsDefaultDocRequired, but may not define any colours.
Gerry Iles wrote:
> The #ifndef EXCLUDE_FROM_XARALX in CCamDoc::DefaultDocumentRequired is
> causing the important lines at the end of the function to be skipped as
> the #else clause is simply returning.
>
> This code should really be asking the relevant filter if it is required
> as loading a Xar document should not require the default document.
> Loading all bitmap formats will generally require the default document
> as they have no document structure of their own.
>
> The comments in the function imply that the person doing the porting was
> trying to make it always load the default document but, in fact, it
> never does so. This function should really be called
> LoadDefaultDocumentIfRequired so it is clear what it is supposed to do.
>
> Once the function is correctly loading the default document when
> required it may also be necessary to set a member variable to indicate
> that the document was created from a template so that "Save as" can be
> used when the user tries to save the document. This will ensures that
> another file is not overwritten without warning the user (e.g. if you
> load fred.jpg and hit save it will probably try to automatically save
> fred.xar without prompting if it already exists).
>
> Gerry
>
> -----Original Message-----
> From: owner-dev@xxxxxxxxxxxxxxxx [mailto:owner-dev@xxxxxxxxxxxxxxxx] On
> Behalf Of Gerry Iles
> Sent: 25 June 2007 09:43
> To: dev@xxxxxxxxxxxxxx
> Subject: RE: [XaraXtreme-dev] Open file, get standard colours
>
> Hi Guys,
>
> I did do some (though not all) of the code in this area and I think you
> are right that at the time it was done there weren't any template
> documents to load...
>
> I think the code concerned is in CCamDoc::DefaultDocumentRequired
> (wxOil\camdoc.cpp). It appears that this function simply determines if
> the template is required but I believe it should also be loading the
> template if it is.
>
> Gerry
>
> -----Original Message-----
> From: owner-dev@xxxxxxxxxxxxxxxx [mailto:owner-dev@xxxxxxxxxxxxxxxx] On
> Behalf Of Alex Bligh
> Sent: 24 June 2007 11:14
> To: dev@xxxxxxxxxxxxxx
> Cc: Alex Bligh
> Subject: Re: [XaraXtreme-dev] Open file, get standard colours
>
> JLM,
>
> --On 23 June 2007 18:26 -0400 JLM <jsado_sc5@xxxxxxxxxxxxx> wrote:
>
>> When you open an image or SVG file, a new document is created
> (complete
>> with new tab) but it does not appear that a default template is loaded
>> prior to reading in the file.
>>
>> So if I understand correctly, you believe that opening a file should
> do
>> the same thing as creating a new document and then importing that
> file?
>> I can change the program to work that way.
>
> Yes I believe so. I am more interested though in /why/ (given we're
> using a codebase similar to the Windows version) it doesn't "just work".
> Gerry converted this stuff (hi Gerry!) and I'm hoping he's going to
> chime
> in and say something like "oh yes just uncomment the following line from
> this file which was commented out as we didn't have default document
> loading
> working then". I suspect what is happening is that it is using the wrong
> document template (I think there's a very basic internal code generated
> one) which is potentially dangerous for lots of reasons.
>
> Alex
>