Kaydet (Commit) 753dd9ee authored tarafından Armin Le Grand's avatar Armin Le Grand

#120569# Corrected 3D object creations

üst fe59ae72
......@@ -393,7 +393,9 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
}
Rectangle aBoundRect2d;
SdrObjListIter aIter( *pShape2d, IM_DEEPWITHGROUPS );
SdrObjListIter aIter( *pShape2d, IM_DEEPNOGROUPS );
const bool bMultipleSubObjects(aIter.Count() > 1);
while( aIter.IsMore() )
{
const SdrObject* pNext = aIter.Next();
......@@ -406,9 +408,22 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
if ( pNext->ISA( SdrPathObj ) )
{
const SfxItemSet& rSet = pNext->GetMergedItemSet();
bool bNeedToConvertToContour(false);
// do conversion only for single line objects; for all others a fill and a
// line object get created. When we have fill, we want no line. That line has
// always been there, but since it was never converted to contour, it kept
// invisible (all this 'hidden' logic should be migrated to primitives).
if(!bMultipleSubObjects)
{
const XFillStyle eStyle(((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue());
if(XFILL_NONE == eStyle)
{
const drawinglayer::attribute::SdrLineAttribute aLine(
drawinglayer::primitive2d::createNewSdrLineAttribute(rSet));
bool bNeedToConvertToContour(0.0 <= aLine.getWidth() || 0.0 != aLine.getFullDotDashLen());
bNeedToConvertToContour = (0.0 < aLine.getWidth() || 0.0 != aLine.getFullDotDashLen());
if(!bNeedToConvertToContour && !aLine.isDefault())
{
......@@ -421,6 +436,8 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
bNeedToConvertToContour = true;
}
}
}
}
if(bNeedToConvertToContour)
{
......@@ -434,6 +451,16 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
if(aPolyPoly.isClosed())
{
// correct item properties from line to fill style
if(eShadeMode == drawing::ShadeMode_DRAFT)
{
// for draft, create wireframe with fixed line width
aLocalSet.Put(XLineStyleItem(XLINE_SOLID));
aLocalSet.Put(XLineWidthItem(40));
aLocalFillStyle = XFILL_NONE;
}
else
{
// switch from line to fill, copy line attr to fill attr (color, transparence)
aLocalSet.Put(XLineWidthItem(0));
aLocalSet.Put(XLineStyleItem(XLINE_NONE));
aLocalSet.Put(XFillColorItem(XubString(), ((const XLineColorItem&)(aLocalSet.Get(XATTR_LINECOLOR))).GetColorValue()));
......@@ -441,6 +468,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
aLocalSet.Put(XFillTransparenceItem(((const XLineTransparenceItem&)(aLocalSet.Get(XATTR_LINETRANSPARENCE))).GetValue()));
aLocalFillStyle = XFILL_SOLID;
}
}
else
{
// correct item properties to hairlines
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment