Apache OpenOffice (AOO) Bugzilla – Issue 32217
Text object: problem with default attributes
Last modified: 2006-02-15 15:30:02 UTC
Our text object is having some problems with default style and or hard attributes. The following code in svx/source/sdr/properties/textproperties.cxx is hard attributing the text object. This leads to problems if the default style is assigned to a text object. - create a text object with some text - select the textobject (not being in the edit modus) - assign the default style via "format/default" -> now the text object is filled with blue 7 - after save / reload (xml) the fill color of the text object white void TextProperties::ForceDefaultAttributes() { SdrTextObj& rObj = (SdrTextObj&)GetSdrObject(); sal_Bool bTextFrame(rObj.IsTextFrame()); // force ItemSet GetObjectItemSet(); if(bTextFrame) { mpItemSet->Put(XLineStyleItem(XLINE_NONE)); mpItemSet->Put(XFillColorItem(String(), Color(COL_WHITE))); mpItemSet->Put(XFillStyleItem(XFILL_NONE)); } else { mpItemSet->Put(SvxAdjustItem(SVX_ADJUST_CENTER)); mpItemSet->Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_CENTER)); mpItemSet->Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER)); } } (Maybe ForceDefaultAttributes should be called each time a stylesheet is set the textobject)
AW: This is a hard and weird problem. The shape is once created, and the creation over the factory sets those hard attributes. Then, assigning the default removes all hard attributes, that's correct. All is saved correct, too. At load time, the API xShape creates an empty SdrObject using the factory again what sets those hard attributes again, too. Those are NOT removed then when setting the PropertySet at the xShape. AW: The problem is more that at load time the setting of attributes only additionally sets attributes, but does not remove not-set ones. Investigating deeper... AW: Getting xmloff...
AW->CL: XMultiPropertyState needs to be implemented, so that at load time the hard attributes at a xShape can be reset before the loaded hard attribues get set.
accepted
Daniel, please take over. You have to add XMultiPropertyState to the SvxShape implementation in svx/source/unodraw/unoshap?.cxx and then call the set?Default in xmloff after adding a shape to its page in SdXMLShapeContext::AddShape() (xmloff/source/draw/ximpshap.cxx)
.
Christian, please verify.
We have a problem with images loaded from OOo 1.0 xml files. In OOo 2.0 we introduced the feature that images can have a background filling. So since OOo 2.0 we also export and import the fill attributes. In OOo 1.0 xml files, there have been no fill attributes sets so when we do an import in OOo 2.0 the default is used and that is fill style solid and color blue7. To fix this issue, we must change the import of image shapes in xmloff. We must detect if we import with the transformator from OOo 1.0 format. In that case, we need to hard set the FillStyle property to solid *after* setting the style. Please ask Oliver Düsterhöft how to detect that we import over the transformator.
back to me.
@cgu: please test some samples, e.g. companyTakeOver which has been broken...
has been verified by SJ.
closed.
fix but failed, this issue caused regression issue 42043.
To correctly fix this issue, I will have to overload ::setAllPropertiesToDefault in the impress application and handle special defaults like empty presentation objects on the masterpage correctly.
retargeted
Changing target as this issue is problematic for the new formatbrush feature
Problem also reproducable with new format paintbrush feature. Create two text shapes with some text Format the first text shape with the tool bar to have a solid blue filling Format the second text shape with the format paintbrush feature so it has the same format as the first shape. After save&reload the second shape has no filling
fixed in cws impress84, in SdXMLShapeContext::AddShape() I again call setAllPropertiesToDefault() on the newly created shape before its hard attributes are imported. But now I only do this for non placeholder shapes. This is because we do not export/import hard attributes for placeholder, therefore we must not clear them on load.
verfified in cws, back to qa re-open issue and reassign to wg@openoffice.org
reassign to wg@openoffice.org
reset resolution to FIXED
Verified in CWS.
*** Issue 61840 has been marked as a duplicate of this issue. ***
Tested in master OOB680m1. Closed.