diff options
-rw-r--r-- | include/svx/xbtmpit.hxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xattrbmp.cxx | 22 |
2 files changed, 16 insertions, 8 deletions
diff --git a/include/svx/xbtmpit.hxx b/include/svx/xbtmpit.hxx index fb9cebdd01b3..e1e65229e60a 100644 --- a/include/svx/xbtmpit.hxx +++ b/include/svx/xbtmpit.hxx @@ -41,6 +41,8 @@ class SVX_DLLPUBLIC XFillBitmapItem : public NameOrIndex private: GraphicObject maGraphicObject; + GraphicObject makeGraphicObject(SvStream& rIn, sal_uInt16 nVer) const; + public: static SfxPoolItem* CreateDefault(); XFillBitmapItem() : NameOrIndex(XATTR_FILLBITMAP, -1 ) {} diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx index a1dc1b56685c..bf2ed0f4b16e 100644 --- a/svx/source/xoutdev/xattrbmp.cxx +++ b/svx/source/xoutdev/xattrbmp.cxx @@ -214,8 +214,7 @@ bool isHistorical8x8(const BitmapEx& rBitmapEx, BitmapColor& o_rBack, BitmapColo return bRet; } -XFillBitmapItem::XFillBitmapItem(SvStream& rIn, sal_uInt16 nVer) -: NameOrIndex(XATTR_FILLBITMAP, rIn) +GraphicObject XFillBitmapItem::makeGraphicObject(SvStream& rIn, sal_uInt16 nVer) const { if (!IsIndex()) { @@ -225,7 +224,7 @@ XFillBitmapItem::XFillBitmapItem(SvStream& rIn, sal_uInt16 nVer) Bitmap aBmp; ReadDIB(aBmp, rIn, true); - maGraphicObject = Graphic(aBmp); + return Graphic(aBmp); } else if(1 == nVer) { @@ -239,7 +238,7 @@ XFillBitmapItem::XFillBitmapItem(SvStream& rIn, sal_uInt16 nVer) Bitmap aBmp; ReadDIB(aBmp, rIn, true); - maGraphicObject = Graphic(aBmp); + return Graphic(aBmp); } else if(XBitmapType::N8x8 == (XBitmapType)iTmp) { @@ -258,7 +257,7 @@ XFillBitmapItem::XFillBitmapItem(SvStream& rIn, sal_uInt16 nVer) const Bitmap aBitmap(createHistorical8x8FromArray(aArray, aColorPix, aColorBack)); - maGraphicObject = Graphic(aBitmap); + return Graphic(aBitmap); } } else if(2 == nVer) @@ -266,14 +265,21 @@ XFillBitmapItem::XFillBitmapItem(SvStream& rIn, sal_uInt16 nVer) BitmapEx aBmpEx; ReadDIBBitmapEx(aBmpEx, rIn); - maGraphicObject = Graphic(aBmpEx); + return Graphic(aBmpEx); } } + return GraphicObject(); +} + +XFillBitmapItem::XFillBitmapItem(SvStream& rIn, sal_uInt16 nVer) + : NameOrIndex(XATTR_FILLBITMAP, rIn) + , maGraphicObject(makeGraphicObject(rIn, nVer)) +{ } XFillBitmapItem::XFillBitmapItem(const GraphicObject& rGraphicObject) -: NameOrIndex( XATTR_FILLBITMAP, -1), - maGraphicObject(rGraphicObject) + : NameOrIndex(XATTR_FILLBITMAP, -1) + , maGraphicObject(rGraphicObject) { } |