diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 22:22:15 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 22:22:15 +0000 |
commit | 341cf98effdd8452fe9a4a108165728c75a64842 (patch) | |
tree | e31ff80b9f7fbaa77cb2bd4f6eb88fee93b494f6 /svx/source/svdraw/svdoattr.cxx | |
parent | 44e804bd479a7b69962b7366577c04692e61214a (diff) |
INTEGRATION: CWS aw033 (1.50.84); FILE MERGED
2008/07/10 13:00:56 aw 1.50.84.4: #i39532# XOutputDevice removed, PrepareDelete removed
2008/06/24 15:42:25 aw 1.50.84.3: #i39532# corrections
2008/05/14 14:05:56 aw 1.50.84.2: RESYNC: (1.50-1.51); FILE MERGED
2008/01/22 12:29:32 aw 1.50.84.1: adaptions and 1st stripping
Diffstat (limited to 'svx/source/svdraw/svdoattr.cxx')
-rw-r--r-- | svx/source/svdraw/svdoattr.cxx | 153 |
1 files changed, 1 insertions, 152 deletions
diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx index e3cccbe7c266..9338930d9f0c 100644 --- a/svx/source/svdraw/svdoattr.cxx +++ b/svx/source/svdraw/svdoattr.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: svdoattr.cxx,v $ - * $Revision: 1.52 $ + * $Revision: 1.53 $ * * This file is part of OpenOffice.org. * @@ -36,7 +36,6 @@ #include "svditext.hxx" #include "svdtouch.hxx" #include <svx/svdmodel.hxx> -#include "svdxout.hxx" #include <svx/svdpage.hxx> #include <svx/svdattr.hxx> #include <svx/svdattrx.hxx> @@ -172,91 +171,6 @@ sal_Int32 SdrAttrObj::ImpGetLineWdt() const return nRetval; } -INT32 SdrAttrObj::ImpGetLineEndAdd() const -{ - const SfxItemSet& rSet = GetMergedItemSet(); - BOOL bStartSet(TRUE); - BOOL bEndSet(TRUE); - - if(SFX_ITEM_DONTCARE != rSet.GetItemState(XATTR_LINESTART)) - { - String aStr(((const XLineStartItem&)rSet.Get(XATTR_LINESTART)).GetName()); - if(!aStr.Len()) - bStartSet = FALSE; - } - - if(rSet.GetItemState(XATTR_LINEEND) != SFX_ITEM_DONTCARE) - { - String aStr(((const XLineEndItem&)rSet.Get(XATTR_LINEEND)).GetName()); - if(!aStr.Len()) - bEndSet = FALSE; - } - - BOOL bLineEndSet = bStartSet || bEndSet; - XLineStyle eLine = ((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue(); - - if(XLINE_NONE == eLine) - return 0; // Garkeine Linie da. - - // Strichstaerke - sal_Int32 nLineWdt = ((XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue(); - sal_Int32 nSttWdt = ((const XLineStartWidthItem&)(rSet.Get(XATTR_LINESTARTWIDTH))).GetValue(); - - if(nSttWdt < 0) - nSttWdt = -nLineWdt * nSttWdt / 100; - - if(!bLineEndSet) - nSttWdt = 0; - - BOOL bSttCenter = ((const XLineStartCenterItem&)(rSet.Get(XATTR_LINESTARTCENTER))).GetValue(); - sal_Int32 nSttHgt = 0; - - if(bSttCenter) - { - // Linienende steht um die Haelfe ueber - basegfx::B2DPolyPolygon aSttPoly(((const XLineStartItem&)(rSet.Get(XATTR_LINESTART))).GetLineStartValue()); - nSttHgt = XOutputDevice::getLineStartEndDistance(aSttPoly, nSttWdt, bSttCenter); - // InitLineStartEnd liefert bei bCenter=TRUE die halbe Hoehe - } - - nSttWdt++; - nSttWdt /= 2; - - // Lieber etwas mehr, dafuer keine Wurzel ziehen - sal_Int32 nSttAdd = Max(nSttWdt, nSttHgt); - nSttAdd *= 3; - nSttAdd /= 2; - - sal_Int32 nEndWdt = ((const XLineEndWidthItem&)(rSet.Get(XATTR_LINEENDWIDTH))).GetValue(); - - if(nEndWdt < 0) - nEndWdt = -nLineWdt * nEndWdt / 100; // <0 = relativ - - if(!bLineEndSet) - nEndWdt = 0; - - BOOL bEndCenter = ((const XLineEndCenterItem&)(rSet.Get(XATTR_LINEENDCENTER))).GetValue(); - sal_Int32 nEndHgt = 0; - - if(bEndCenter) - { - // Linienende steht um die Haelfe ueber - basegfx::B2DPolyPolygon aEndPoly(((const XLineEndItem&)(rSet.Get(XATTR_LINEEND))).GetLineEndValue()); - nEndHgt = XOutputDevice::getLineStartEndDistance(aEndPoly, nEndWdt, bEndCenter); - // InitLineStartEnd liefert bei bCenter=TRUE die halbe Hoehe - } - - nEndWdt++; - nEndWdt /= 2; - - // Lieber etwas mehr, dafuer keine Wurzel ziehen - sal_Int32 nEndAdd = Max(nEndWdt, nEndHgt); - nEndAdd *= 3; - nEndAdd /= 2; - - return Max(nSttAdd, nEndAdd); -} - ////////////////////////////////////////////////////////////////////////////// FASTBOOL SdrAttrObj::ImpGetShadowDist(sal_Int32& nXDist, sal_Int32& nYDist) const @@ -277,71 +191,6 @@ FASTBOOL SdrAttrObj::ImpGetShadowDist(sal_Int32& nXDist, sal_Int32& nYDist) cons return FALSE; } -void SdrAttrObj::ImpAddShadowToBoundRect() -{ - sal_Int32 nXDist; - sal_Int32 nYDist; - - if(ImpGetShadowDist(nXDist, nYDist)) - { - if(nXDist > 0) - aOutRect.Right() += nXDist; - else - aOutRect.Left() += nXDist; - - if(nYDist > 0) - aOutRect.Bottom() += nYDist; - else - aOutRect.Top() += nYDist; - } -} - -FASTBOOL SdrAttrObj::ImpSetShadowAttributes( const SfxItemSet& rSet, SfxItemSet& rShadowSet ) const -{ - BOOL bShadOn=((SdrShadowItem&)(rSet.Get(SDRATTR_SHADOW))).GetValue(); - - if(bShadOn) - { - const SdrShadowColorItem& rShadColItem = ((const SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))); - Color aShadCol(rShadColItem.GetColorValue()); - sal_uInt16 nTransp = ((const SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue(); - XFillStyle eStyle = ((const XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue(); - BOOL bFillBackground = ((const XFillBackgroundItem&)(rSet.Get(XATTR_FILLBACKGROUND))).GetValue(); - - if(eStyle==XFILL_HATCH && !bFillBackground) - { - // #41666# - XHatch aHatch = ((XFillHatchItem&)(rSet.Get(XATTR_FILLHATCH))).GetHatchValue(); - aHatch.SetColor(aShadCol); - rShadowSet.Put(XFillHatchItem(String(), aHatch)); - } - else - { - if(eStyle != XFILL_NONE && eStyle != XFILL_SOLID) - { - // also fuer Gradient und Bitmap - rShadowSet.Put(XFillStyleItem(XFILL_SOLID)); - } - - rShadowSet.Put(XFillColorItem(String(),aShadCol)); - - // #92183# set XFillTransparenceItem only when no FloatTransparence is used, - // else the OutDev will use the wrong method - if(nTransp) - { - const XFillFloatTransparenceItem& rFillFloatTransparence = - (const XFillFloatTransparenceItem&)rSet.Get(XATTR_FILLFLOATTRANSPARENCE); - if(!rFillFloatTransparence.IsEnabled()) - rShadowSet.Put(XFillTransparenceItem(nTransp)); - } - } - - return TRUE; - } - - return FALSE; -} - BOOL SdrAttrObj::HasFill() const { return bClosedObj && ((XFillStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_FILLSTYLE))).GetValue()!=XFILL_NONE; |