summaryrefslogtreecommitdiff
path: root/drawinglayer/source/attribute
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-05-10 09:29:55 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-03-15 15:24:52 +0000
commitc97aec0d2276901c20634abe53867f739f420f50 (patch)
treedb775ba307edfffaa990a5d01361ae5c53c43f28 /drawinglayer/source/attribute
parentd2cccde341af33b72378f3e7b0e8dd9ff1cd5e65 (diff)
Related: #i119125# change XFillBitmapItem to work with GraphicObject
Completely changed XFillBitmapItem to work with GraphicObject, removed XOBitmap class, adapted all usages (also the pretty old 8x8 pixel editor). All Bitmap fill styles will now accept transparent bitmaps as fillings in all variations (tiled, etc.). LoadSave is no problem, ODF defines graphic as content for fill. Backward means that OOs before this change will use a white background of fill with transparent, same as the fallback all the time when using a transparent fill. This is also a preparation to e.g. offer SVG or Metafiles as fill style. Conflicts: cui/source/tabpages/backgrnd.cxx cui/source/tabpages/tparea.cxx cui/source/tabpages/tpbitmap.cxx filter/source/msfilter/msdffimp.cxx filter/source/msfilter/svdfppt.cxx sc/source/filter/excel/xiescher.cxx sd/source/ui/func/fupage.cxx svx/inc/svx/dlgctrl.hxx svx/inc/svx/xbitmap.hxx svx/inc/svx/xbtmpit.hxx svx/inc/svx/xtable.hxx svx/source/customshapes/EnhancedCustomShape2d.cxx svx/source/dialog/dlgctrl.cxx svx/source/svdraw/svdograf.cxx svx/source/tbxctrls/fillctrl.cxx svx/source/unodraw/XPropertyTable.cxx svx/source/xoutdev/xattrbmp.cxx svx/source/xoutdev/xtabbtmp.cxx Change-Id: Id838bfbacc863695d078fb3cf379d1c0cd951680
Diffstat (limited to 'drawinglayer/source/attribute')
-rw-r--r--drawinglayer/source/attribute/sdrfillbitmapattribute.cxx54
1 files changed, 31 insertions, 23 deletions
diff --git a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
index 600777863bc8..5d86525c6d98 100644
--- a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
+++ b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
@@ -34,7 +34,7 @@ namespace drawinglayer
sal_uInt32 mnRefCount;
// data definitions
- Bitmap maBitmap;
+ BitmapEx maBitmapEx;
basegfx::B2DVector maSize;
basegfx::B2DVector maOffset;
basegfx::B2DVector maOffsetPosition;
@@ -46,7 +46,7 @@ namespace drawinglayer
unsigned mbLogSize : 1;
ImpSdrFillBitmapAttribute(
- const Bitmap& rBitmap,
+ const BitmapEx& rBitmapEx,
const basegfx::B2DVector& rSize,
const basegfx::B2DVector& rOffset,
const basegfx::B2DVector& rOffsetPosition,
@@ -55,7 +55,7 @@ namespace drawinglayer
bool bStretch,
bool bLogSize)
: mnRefCount(0),
- maBitmap(rBitmap),
+ maBitmapEx(rBitmapEx),
maSize(rSize),
maOffset(rOffset),
maOffsetPosition(rOffsetPosition),
@@ -67,7 +67,7 @@ namespace drawinglayer
}
// data read access
- const Bitmap& getBitmap() const { return maBitmap; }
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
const basegfx::B2DVector& getSize() const { return maSize; }
const basegfx::B2DVector& getOffset() const { return maOffset; }
const basegfx::B2DVector& getOffsetPosition() const { return maOffsetPosition; }
@@ -78,7 +78,7 @@ namespace drawinglayer
bool operator==(const ImpSdrFillBitmapAttribute& rCandidate) const
{
- return (getBitmap() == rCandidate.getBitmap()
+ return (getBitmapEx() == rCandidate.getBitmapEx()
&& getSize() == rCandidate.getSize()
&& getOffset() == rCandidate.getOffset()
&& getOffsetPosition() == rCandidate.getOffsetPosition()
@@ -95,7 +95,7 @@ namespace drawinglayer
if(!pDefault)
{
pDefault = new ImpSdrFillBitmapAttribute(
- Bitmap(),
+ BitmapEx(),
basegfx::B2DVector(),
basegfx::B2DVector(),
basegfx::B2DVector(),
@@ -113,7 +113,7 @@ namespace drawinglayer
};
SdrFillBitmapAttribute::SdrFillBitmapAttribute(
- const Bitmap& rBitmap,
+ const BitmapEx& rBitmapEx,
const basegfx::B2DVector& rSize,
const basegfx::B2DVector& rOffset,
const basegfx::B2DVector& rOffsetPosition,
@@ -121,8 +121,16 @@ namespace drawinglayer
bool bTiling,
bool bStretch,
bool bLogSize)
- : mpSdrFillBitmapAttribute(new ImpSdrFillBitmapAttribute(
- rBitmap, rSize, rOffset, rOffsetPosition, rRectPoint, bTiling, bStretch, bLogSize))
+ : mpSdrFillBitmapAttribute(
+ new ImpSdrFillBitmapAttribute(
+ rBitmapEx,
+ rSize,
+ rOffset,
+ rOffsetPosition,
+ rRectPoint,
+ bTiling,
+ bStretch,
+ bLogSize))
{
}
@@ -190,9 +198,9 @@ namespace drawinglayer
return (*rCandidate.mpSdrFillBitmapAttribute == *mpSdrFillBitmapAttribute);
}
- const Bitmap& SdrFillBitmapAttribute::getBitmap() const
+ const BitmapEx& SdrFillBitmapAttribute::getBitmapEx() const
{
- return mpSdrFillBitmapAttribute->getBitmap();
+ return mpSdrFillBitmapAttribute->getBitmapEx();
}
const basegfx::B2DVector& SdrFillBitmapAttribute::getSize() const
@@ -228,8 +236,8 @@ namespace drawinglayer
FillBitmapAttribute SdrFillBitmapAttribute::getFillBitmapAttribute(const basegfx::B2DRange& rRange) const
{
// get logical size of bitmap (before expanding eventually)
- Bitmap aBitmap(getBitmap());
- const basegfx::B2DVector aLogicalSize(aBitmap.GetPrefSize().getWidth(), aBitmap.GetPrefSize().getHeight());
+ BitmapEx aBitmapEx(getBitmapEx());
+ const basegfx::B2DVector aLogicalSize(aBitmapEx.GetPrefSize().getWidth(), aBitmapEx.GetPrefSize().getHeight());
// get hor/ver shiftings and apply them eventually to the bitmap, but only
// when tiling is on
@@ -240,45 +248,45 @@ namespace drawinglayer
{
if(0.0 != getOffset().getX() || 0.0 != getOffset().getY())
{
- const sal_uInt32 nWidth(aBitmap.GetSizePixel().getWidth());
- const sal_uInt32 nHeight(aBitmap.GetSizePixel().getHeight());
+ const sal_uInt32 nWidth(aBitmapEx.GetSizePixel().getWidth());
+ const sal_uInt32 nHeight(aBitmapEx.GetSizePixel().getHeight());
if(0.0 != getOffset().getX())
{
bExpandHeight = true;
const sal_uInt32 nOffset(basegfx::fround(((double)nWidth * getOffset().getX()) / 100.0));
- aBitmap.Expand(0L, nHeight);
+ aBitmapEx.Expand(0L, nHeight);
const Size aSizeA(nOffset, nHeight);
const Rectangle aDstA(Point(0L, nHeight), aSizeA);
const Rectangle aSrcA(Point(nWidth - nOffset, 0L), aSizeA);
- aBitmap.CopyPixel(aDstA, aSrcA);
+ aBitmapEx.CopyPixel(aDstA, aSrcA);
const Size aSizeB(nWidth - nOffset, nHeight);
const Rectangle aDstB(Point(nOffset, nHeight), aSizeB);
const Rectangle aSrcB(Point(0L, 0L), aSizeB);
- aBitmap.CopyPixel(aDstB, aSrcB);
+ aBitmapEx.CopyPixel(aDstB, aSrcB);
}
else
{
bExpandWidth = true;
const sal_uInt32 nOffset(basegfx::fround(((double)nHeight * getOffset().getY()) / 100.0));
- aBitmap.Expand(nWidth, 0L);
+ aBitmapEx.Expand(nWidth, 0L);
const Size aSize(nWidth, nHeight);
const Rectangle aDst(Point(nWidth, 0L), aSize);
const Rectangle aSrc(Point(0L, 0L), aSize);
- aBitmap.CopyPixel(aDst, aSrc);
+ aBitmapEx.CopyPixel(aDst, aSrc);
const Size aSizeA(nWidth, nOffset);
const Rectangle aDstA(Point(0L, 0L), aSizeA);
const Rectangle aSrcA(Point(nWidth, nHeight - nOffset), aSizeA);
- aBitmap.CopyPixel(aDstA, aSrcA);
+ aBitmapEx.CopyPixel(aDstA, aSrcA);
const Size aSizeB(nWidth, nHeight - nOffset);
const Rectangle aDstB(Point(0L, nOffset), aSizeB);
const Rectangle aSrcB(Point(nWidth, 0L), aSizeB);
- aBitmap.CopyPixel(aDstB, aSrcB);
+ aBitmapEx.CopyPixel(aDstB, aSrcB);
}
}
}
@@ -379,7 +387,7 @@ namespace drawinglayer
aBitmapSize.setY(aBitmapSize.getY() / fRangeHeight);
}
- return FillBitmapAttribute(BitmapEx(aBitmap), aBitmapTopLeft, aBitmapSize, getTiling());
+ return FillBitmapAttribute(aBitmapEx, aBitmapTopLeft, aBitmapSize, getTiling());
}
} // end of namespace attribute
} // end of namespace drawinglayer