Hi Christian,
1. I found that mpVDev- >GetTextOutline returns the PolyPolygon of the whole
line in the impress, and I think we should get the PolyPolygon of single text.
So I define a PolyPolygonVector to store the whole line words' PolyPolygon. And
I invoke the GetTextOutlines() instead of GetTextOutline() as the first
parameter of it is a PolyPolyVector.
mpVDev->GetTextOutlines( aPolyPolyVector, rText, 0, 0, (USHORT)nLen, TRUE,
nWidth, pDXArray );
2. Because I want to store the PolyPolygon of every single text in the
PolyPolygonVector, and the aB2DPolyPolyVector stores the single text, so I add
the code as below in the method GetTextOutlines():
for(; aIt != aB2DPolyPolyVector.end(); ++aIt )
{
rResultVector.push_back( *aIt );
for( unsigned int i = 0; i < aIt->count(); ++i )
{
aPolyPolygon = *aItPolyPolyVector;
aPolyPolygon.Insert( (*aIt).getB2DPolygon( i ) );
}
}
Q1: I am not sure whether it can be modfied like this or I should define a new
method to realize it.
3. And now the PolyPolygonVector stores the every single text's PolyPolygon,
not the whole line text's PolyPolygon. So every PolyPolygon should be
translated and implemented. I use a loop to realize it.
PolyPolyVector::const_iterator aItPolyPolyVector = aPolyPolyVector.begin();
PolyPolygon aPolyPoly;
for(; aItPolyPolyVector != aPolyPolyVector.end(); ++aItPolyPolyVector )
{
aPolyPoly = *aItPolyPolyVector;
aPolyPoly.Translate( rPos );
Impl_writePolyPolygon( aPolyPoly, sal_True, aTextColor, aTextColor );
}
Q2: Last IRC meeting, you said it should be a PolyPolyVector instead of just a
PolyPolygon, so I modfied it like this. Is it right?
4. I can add a cache in Writer::defineShape( const PolyPolygon& rPolyPoly,
const FillStyle& rFillStyle ) as I have said before. But the member varible of
PolyPolygon is a pointer. (ImplPolyPolygon* mpImplPolyPolygon;)
Q3: If two PolyPolygons exported are the same, will the pointer in PolyPolygon
point to the same memory? Or will the same PolyPolygons be exported to the
different memory?
If they point to the same memory then we can compare the pointer. Then if the
pointer is the same, it means they are the same PolyPolygon.
Looking forward to your reply sincerely:)
Best regards,
Fang
Fang Yaqiong [EMAIL PROTECTED]
2007-05-30
Christian wrote,
>Hi Fang,
>
>please write something about why you think you need the changes in
>OutputDevice::GetTextOutlines(),
>and please explain what your changed code should do. I don't understand
>both.
>
>Regards,
>Christian
Fang Yaqiong wrote:
> Hi all,
> Hi Christian and Herbert,
> I have modify the code to change the PolyPolygon to a
> PolyPolygonvector to store the PolyPolygon.
> if( bRTL || (nScriptType != ScriptType::LATIN) )
> {
> PolyPolygon aPolyPoygon;
> //the original code
> //mpVDev- >GetTextOutline( aPolyPoygon, rText, 0, 0, (USHORT)nLen,
> TRUE, nWidth, pDXArray );
> //aPolyPoygon.Translate( rPos );
> //Impl_writePolyPolygon( aPolyPoygon, sal_True, aTextColor, aTextColor );
>
> //modified by fangyq 070528
> PolyPolygonVector aPolyPolyVector;
> mpVDev- >GetTextOutlines( aPolyPolyVector, rText, 0, 0, (USHORT)nLen,
> TRUE, nWidth, pDXArray );
> PolyPolyVector::const_iterator aItPolyPolyVector =
> aPolyPolyVector.begin();
> PolyPolygon aPolyPoly;
> for(; aItPolyPolyVector != aPolyPolyVector.end(); ++aItPolyPolyVector )
> {
> aPolyPoly = *aItPolyPolyVector;
> aPolyPoly.Translate( rPos );
> Impl_writePolyPolygon( aPolyPoly, sal_True, aTextColor, aTextColor );
> } &nbs! p; &n! bsp;
> }
> I invoke mpVDev- >GetTextOutlines instead of GetTextOutline and modify
> the OutputDevice::GetTextOutlines() as below,
> ::basegfx::B2DPolyPolygonVector::const_iterator aIt =
> aB2DPolyPolyVector.begin();
> //the original code
> /*for(; aIt != aB2DPolyPolyVector.end(); ++aIt )
> rResultVector.push_back( *aIt );*/
> //modified by fangyq 070528
> PolyPolyVector::const_iterator aItPolyPolyVector = rResultVector.begin();
> PolyPolygon aPolyPolygon;
> for(; aIt != aB2DPolyPolyVector.end(); ++aIt )
> {
> rResultVector.push_back( *aIt );
> for( unsigned int i = 0; i < aIt- >count(); ++i )
> {
> aPolyPolygon = *aItPolyPolyVector;
> aPolyPolygon.Insert( (*aIt).getB2DPolygon( i ) );
> }
> }
>
> Do you think it is ok to modify the OutputDevice::GetTextOutlines(),
> or I should remain it and define a new method.
> Looking forward to your reply:)
> Sincerely,
> Fang
> ------------------------------------------------------------------------
> Fang Yaqiong [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED] >
> 2007-05-29
> 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]