Hi Fang,

hard to give you any hints on this. First on your code, that looks fine.
Maybe you just missed it for this sample code but don't forget to put the
code from startTag(...) to endTag() right after "nShapeId = createId();" and
before the "}". Else you will export the PolyPolygon anyway even if it is
already exported.

Looking at defineShape I noticed that we can not only use the PolyPolygon
as a key, we also need to add the FillStyle. So the key for the cache should
be something like

class PolyPolygonCacheKey
{
public:
PolyPolygonCacheKey( const PolyPolygon& rPolyPoly, const FillStyle&
rFillStyle );
bool operator==( const PolyPolygonCacheKey& rKey ) const;

private:
PolyPolygon maPolyPoly;
FillStyle maFillStyle;
};

For the debugging, I guess you will develop on linux. I don't have much
experience debugging
on linux so I can't give you any clues there.
There are many things that can go wrong. F.e. you should check if the
office actually can load
your flash lib. Maybe you have installed an office from m112 and build
the filter with m120 or
something? You can check this by registering the flash lib again with
the regcomp tool that
is part of the OOo build environment.
If this works then I suspect that there is an exception thrown
somewhere. I don't know how to
catch them with gdb but there sure must be a way. The next step would be
to debug the code
from the filter entry point, which would be FlashExportFilter::filter().
If that does not work for you than the last resort on linux debugging is
to put fprintf() around the
code and see how far you get.

Hope that helps,
Christian


Fang Yaqiong wrote:
> Hi,
> I am doing something modify to the codes to add a cache for the
> PolyPolygon, which is being generated durning the export of the flash.
> Christian, you said that the key to that cache is actually the
> PolyPolygon itself and the
> mapped value is the flash id.
> So I new a cache maPolyPolygonIndex in the class writer
> (filter\souce\flash\swfwriter.hxx) and I add the codes in the
> Writer::defineShape(). filter\source\flash\swfwriter.cxx
> sal_uInt16 Writer::defineShape( const PolyPolygon& rPolyPoly, const
> FillStyle& rFillStyle )
> {
> //add fangyq 070521
> // see if we already created a glyph for this character
> sal_uInt16 nShapeId = 0;
> std::map<PolyPolygon, sal_uInt16>::const_iterator aIter(
> maPolyPolygonIndex.find(rPolyPoly) );
> if( aIter != maPolyPolygonIndex.end() )
> {
> nShapeId = aIter->second;
> }
> else
> {
> // if not, we create one now
> nShapeId = createID();
> }
> maPolyPolygonIndex[rPolyPoly]=nShapeId;
>
> .......
> return nShapeId;
> }
> But after building and debuging it, I found it cause a serious
> problem. The swf cannot be exported successfully, and an error
> messagebox appeares when I export the impress to swf. It says
> "Error saving the document Untitled1: Writer Error. The file could not
> be written."
>
> And unfortunately I cannot trace the code of this part as it seems not
> pass through the code, but the problem is assuredly influenced by it.
> I am puzzled about it and looking forward to your reply.
> Sincerely,
> Fang
>
> ------------------------------------------------------------------------
> Fang Yaqiong [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> 2007-05-22
> Regards&Thanks!
> Tel:010-5157-0010 Ext.6202
> Beijing Redflag CH2000 Software Co., Ltd.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to