Hi Tobias,

sorry for the late reply. In theory you should not care much about the xml export. The xml export does not know which one is the default style, it just exports all styles that are available with
their given names and names of optional parent styles.

The "gr1" style is a style automatically created during xml export, it is not available at the model. It contains all hard formated attributes which in the model are stored at the shape itself. If this
"gr1" style has no parent style, this just means the shape has no style set.

If "xShapeSet->getPropertyValue( "Style" ) >>= xStyle" returns false then this indicate that this
is a null reference.

The root cause of this issue is most likely that the ppt import does not set the style at the
shape. This is usually done with

void SdrObject::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);

(Assuming the ppt import is using the core interfaces and not the api)

bDontRemoveHardAttr should be set to true, otherwise all hard formating on the shape will be removed. Shapes are created in the filter project ( note that the general ms filter part was recently moved from svx module to the filter module), but the stylesheet should only be set for the sd module. Therefore you must add the fix to the ImplSdPPTImport::ProcessObj method which is called for each created shape. Be carefull not to set the styles for shapes created with the CreatePresObj method as they need and
automatically get presentation styles.

You get the default SfxStyleSheet from the method

SfxStyleSheet* SdrModel::GetDefaultStyleSheet();

This fix may cause other issues to pop up, because the default for all not hard set attributes will now be the taken from the default style and not the pool. But this would also already happen if the document is saved to odp and reloaded since during loading odp all shapes get the default style if they have no style yet anyway.

Regards,
Christian

Am 23.02.2010 15:35, schrieb Tobias Koenig:
Hej,

I currently try to fix bug #100244 and need some information to
get the overview of how things work together.

The core problem of this bug is, that the autostyle 'gr1' has no
parent style set. As the custom shape, which has the gr1 style assigned,
is imported from a PPT file, I guess the PPT import module does not setup
the style information correctly.

However after looking through the code for several hours now I still missing
the overview how the style information from the PPT are propagated from the
PPT import module through the impress application to the ODP export module.

AFAIKS the PPT import module fills the content of PPT into instances of
SfxStyleSheet and SdrObject classes. In the ODP output module, the data are read
from a XShape instance.
How and where are the data transfered from the SfxStyleSheet to the XShape?

In xmloff/source/draw/shapeexport.cxx in the method collectShapeAutoStyles, the
XShape that represents the text in the example document of #100244, has the 
property
'Style' in its XPropertySetInfo, however when the code tries to extract it via 
operator>>=
the operator returns 'false'. However debug statements show that this property 
has the
right type com.sun.star.style.XStyle. Any idea what the reason could be?

Please CC me, I'm not subscribed to the list.

Ciao,
Tobias


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to