diff options
author | Armin Le Grand <alg@apache.org> | 2012-05-31 13:23:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-11 11:20:23 +0100 |
commit | 0a29c5bedda700a86b46e3c3cd9c9e1ce1d4f278 (patch) | |
tree | 61ef44bcf873afb94ed3b9efe761e9c0de67307d /svx/source/sdr | |
parent | e2d31c5e705e6e4d6b0185bebba66a55e77981f4 (diff) |
Resolves: #i119287# exchanged hard attributes for OLE and GraphicObject
...with new default StyleSheet for these objects
(cherry picked from commit 2868ea34151cfb623a6a8bf41862d430205d9784)
Conflicts:
sd/source/core/drawdoc4.cxx
svx/source/sdr/contact/viewcontactofgraphic.cxx
Change-Id: I4849101de2ac1da83c8fb0f2d68316774982d197
Resolves: #i119287# Adapted to get the needed style as default style
for all SdrGrafObj and SDrOle2Objs. Checked various scenarios, works
well.
(cherry picked from commit bc85939149f7ae5b65343d7f27bf302a8e31d4b1)
Conflicts:
sd/source/core/drawdoc.cxx
sd/source/ui/func/fuinsert.cxx
sd/source/ui/view/sdview4.cxx
Change-Id: I40a17216f5c11ebca073026f62f1e9ab9ddfd119
Diffstat (limited to 'svx/source/sdr')
9 files changed, 27 insertions, 37 deletions
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 421a32bcee41..0a1082f51fa3 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -297,10 +297,6 @@ namespace sdr { drawinglayer::primitive2d::Primitive2DSequence xRetval; const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet(); - drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( - drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( - rItemSet, - GetGrafObject().getText(0))); // create and fill GraphicAttr GraphicAttr aLocalGrafInfo; @@ -317,25 +313,14 @@ namespace sdr aLocalGrafInfo.SetDrawMode(((SdrGrafModeItem&)rItemSet.Get(SDRATTR_GRAFMODE)).GetValue()); aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom()); - if(aAttribute.isDefault() && 255L != aLocalGrafInfo.GetTransparency()) - { - // no fill, no line, no text (invisible), but the graphic content is visible. - // Create evtl. shadow for content which was not created by createNewSdrLineFillShadowTextAttribute yet - const drawinglayer::attribute::SdrShadowAttribute aShadow( - drawinglayer::primitive2d::createNewSdrShadowAttribute(rItemSet)); + // we have content if graphic is not completely transparent + const bool bHasContent(255L != aLocalGrafInfo.GetTransparency()); + drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( + drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( + rItemSet, + GetGrafObject().getText(0), + bHasContent)); - if(!aShadow.isDefault()) - { - // create new attribute set if indeed shadow is used - aAttribute = drawinglayer::attribute::SdrLineFillShadowTextAttribute( - aAttribute.getLine(), - aAttribute.getFill(), - aAttribute.getLineStartEnd(), - aShadow, - aAttribute.getFillFloatTransGradient(), - aAttribute.getText()); - } - } // take unrotated snap rect for position and size. Directly use model data, not getBoundRect() or getSnapRect() // which will use the primitive data we just create in the near future Rectangle rRectangle = GetGrafObject().GetGeoRect(); diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx index 9076ba7d45a0..78e6c5e2c55d 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx @@ -59,7 +59,8 @@ namespace sdr const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( rItemSet, - rCaptionObj.getText(0))); + rCaptionObj.getText(0), + false)); // take unrotated snap rect (direct model data) for position and size Rectangle rRectangle = rCaptionObj.GetGeoRect(); diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx index 2b1f58c75d34..5289f5e3a734 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx @@ -47,7 +47,8 @@ namespace sdr const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( rItemSet, - GetCircObj().getText(0))); + GetCircObj().getText(0), + false)); // take unrotated snap rect (direct model data) for position and size Rectangle aRectangle = GetCircObj().GetGeoRect(); diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx index 358eda0b6dae..9aa5d07db16b 100644 --- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx @@ -88,10 +88,14 @@ namespace sdr // Prepare attribute settings, will be used soon anyways const SfxItemSet& rItemSet = GetOle2Obj().GetMergedItemSet(); + + // this may be refined more granular; if no content, attributes may get simpler + const bool bHasContent(true); const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( rItemSet, - GetOle2Obj().getText(0))); + GetOle2Obj().getText(0), + bHasContent)); drawinglayer::primitive2d::Primitive2DReference xContent; if(GetOle2Obj().IsChart()) diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx index a6c130b08337..f3cc4e2c4ac5 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -46,7 +46,8 @@ namespace sdr const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( rItemSet, - GetPathObj().getText(0))); + GetPathObj().getText(0), + false)); basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly()); Point aGridOff = GetPathObj().GetGridOffset(); // Hack for calc, transform position of object according diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx index 166c3d52e95b..b4088772039f 100644 --- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx @@ -48,7 +48,8 @@ namespace sdr const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( rItemSet, - GetRectObj().getText(0))); + GetRectObj().getText(0), + false)); // take unrotated snap rect (direct model data) for position and size Rectangle rRectangle = GetRectObj().GetGeoRect(); diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 273db74e60c7..88fce3ce1f3b 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -716,7 +716,8 @@ namespace drawinglayer attribute::SdrLineFillShadowTextAttribute createNewSdrLineFillShadowTextAttribute( const SfxItemSet& rSet, - const SdrText* pText) + const SdrText* pText, + bool bHasContent) { attribute::SdrLineAttribute aLine; attribute::SdrFillAttribute aFill; @@ -760,7 +761,11 @@ namespace drawinglayer } } - if(!aLine.isDefault() || !aFill.isDefault() || !aText.isDefault()) + // bHasContent is used from OLE and graphic objects. Normally a possible shadow + // depends on line, fill or text to be set, but for these objects it is possible + // to have none of these, but still content which needs to have a shadow (if set), + // so shadow needs to be tried + if(bHasContent || !aLine.isDefault() || !aFill.isDefault() || !aText.isDefault()) { // try shadow aShadow = createNewSdrShadowAttribute(rSet); diff --git a/svx/source/sdr/properties/graphicproperties.cxx b/svx/source/sdr/properties/graphicproperties.cxx index e8f74858a928..ad12924a1009 100644 --- a/svx/source/sdr/properties/graphicproperties.cxx +++ b/svx/source/sdr/properties/graphicproperties.cxx @@ -121,10 +121,6 @@ namespace sdr mpItemSet->Put( SdrGrafInvertItem( sal_False ) ); mpItemSet->Put( SdrGrafModeItem( GRAPHICDRAWMODE_STANDARD ) ); mpItemSet->Put( SdrGrafCropItem( 0, 0, 0, 0 ) ); - - // #i25616# - mpItemSet->Put( XFillStyleItem(XFILL_NONE) ); - mpItemSet->Put( XLineStyleItem(XLINE_NONE) ); } } // end of namespace properties } // end of namespace sdr diff --git a/svx/source/sdr/properties/oleproperties.cxx b/svx/source/sdr/properties/oleproperties.cxx index 2d8462ab3c56..02ab254a890e 100644 --- a/svx/source/sdr/properties/oleproperties.cxx +++ b/svx/source/sdr/properties/oleproperties.cxx @@ -55,10 +55,6 @@ namespace sdr // force ItemSet GetObjectItemSet(); - - // #i108221# - mpItemSet->Put( XFillStyleItem(XFILL_NONE) ); - mpItemSet->Put( XLineStyleItem(XLINE_NONE) ); } } // end of namespace properties } // end of namespace sdr |