summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2013-09-28 17:09:33 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-09-28 17:09:33 +0200
commit01c64f9dffe04c3d3ff0c81ca740827d658ea3da (patch)
tree5d57b777a9b5d40c788c582fcced4c339875db0a
parent134741211d5c95a1a0ef07e13eb4846c62adce22 (diff)
save commit: fix various breakage due to GraphicObject... need rebase -i
Change-Id: Ia131c13b8831dc994d5866f968fc3e196ff69972
-rw-r--r--editeng/source/uno/unonrule.cxx6
-rw-r--r--include/svx/svdograf.hxx2
-rw-r--r--include/svx/xbtmpit.hxx2
-rw-r--r--svtools/source/graphic/grfcache.cxx6
-rw-r--r--svx/source/gallery2/galctrl.cxx23
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx4
-rw-r--r--svx/source/svdraw/svdograf.cxx8
-rw-r--r--sw/source/core/graphic/ndgrf.cxx12
8 files changed, 31 insertions, 32 deletions
diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx
index b83eaabed71b..98b59ee4dc53 100644
--- a/editeng/source/uno/unonrule.cxx
+++ b/editeng/source/uno/unonrule.cxx
@@ -225,7 +225,7 @@ Sequence<beans::PropertyValue> SvxUnoNumberingRules::getNumberingRuleByIndex( sa
{
const SvxBrushItem* pBrush = rFmt.GetBrush();
- if(pBrush && pBrush->GetGraphicObject().is())
+ if(pBrush)
{
const rtl::Reference<GraphicObject> xGrafObj = pBrush->GetGraphicObject();
OUString aURL( UNO_NAME_GRAPHOBJ_URLPREFIX);
@@ -463,8 +463,8 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex( const Sequence< beans::Prope
{
if( NULL == aFmt.GetBrush() )
{
- rtl::Reference< GraphicObject > xGrafObj = rtl::Reference< GraphicObject >();
- SvxBrushItem aBrushItem( rtl::Reference< GraphicObject >(), GPOS_AREA, SID_ATTR_BRUSH );
+ rtl::Reference< GraphicObject > xGrafObj = GraphicObject::Create(Graphic());
+ SvxBrushItem aBrushItem( xGrafObj, GPOS_AREA, SID_ATTR_BRUSH );
aFmt.SetGraphicBrush( &aBrushItem );
}
}
diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index 2278cbccdac6..b88d1aa41fcc 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -99,7 +99,7 @@ private:
void ImpLinkAbmeldung();
bool ImpUpdateGraphicLink( bool bAsynchron = true ) const;
void ImpSetLinkedGraphic( const Graphic& rGraphic );
- DECL_LINK( ImpSwapHdl, GraphicObject* );
+ DECL_LINK( ImpSwapHdl, rtl::Reference<GraphicObject>* );
void onGraphicChanged();
public:
diff --git a/include/svx/xbtmpit.hxx b/include/svx/xbtmpit.hxx
index 2354b14f5b51..ea9fb7adb7cb 100644
--- a/include/svx/xbtmpit.hxx
+++ b/include/svx/xbtmpit.hxx
@@ -43,7 +43,7 @@ private:
public:
TYPEINFO();
- XFillBitmapItem() : NameOrIndex(XATTR_FILLBITMAP, -1 ) { mxGraphicObject = rtl::Reference< GraphicObject >(); }
+ XFillBitmapItem() : NameOrIndex(XATTR_FILLBITMAP, -1 ) { mxGraphicObject = GraphicObject::Create(Graphic()); }
explicit XFillBitmapItem(const Graphic & rGraphic);
explicit XFillBitmapItem(const BitmapEx & rBitmapEx);
explicit XFillBitmapItem(const rtl::Reference< GraphicObject > & xGraphicObject);
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index 28f21205982f..f0b447550d1a 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -185,7 +185,7 @@ GraphicCacheEntry::GraphicCacheEntry( const rtl::Reference< GraphicObject >& xOb
mbSwappedAll ( true )
{
mbSwappedAll = !ImplInit( xObj );
- maGraphicObjectList.push_back( (GraphicObject*)&xObj );
+ maGraphicObjectList.push_back( xObj );
}
GraphicCacheEntry::~GraphicCacheEntry()
@@ -318,14 +318,14 @@ void GraphicCacheEntry::AddGraphicObjectReference( const rtl::Reference< Graphic
mbSwappedAll = !ImplInit( xObj );
ImplFillSubstitute( rSubstitute );
- maGraphicObjectList.push_back( (GraphicObject*) &xObj );
+ maGraphicObjectList.push_back( xObj );
}
bool GraphicCacheEntry::ReleaseGraphicObjectReference( const rtl::Reference< GraphicObject >& xObj )
{
for( GraphicObjectList_impl::iterator it = maGraphicObjectList.begin();
it != maGraphicObjectList.end(); ++it ) {
- if( *xObj.get() == *it->get() )
+ if( xObj.get() == (*it).get() )
{
maGraphicObjectList.erase( it );
return true;
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index a730371466a3..035fb28e3ea3 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -49,7 +49,7 @@ GalleryPreview::GalleryPreview( GalleryBrowser2* pParent, GalleryTheme* pTheme )
SetHelpId( HID_GALLERY_WINDOW );
InitSettings();
- mxGraphicObj = rtl::Reference< GraphicObject >();
+ mxGraphicObj = GraphicObject::Create(Graphic());
}
GalleryPreview::GalleryPreview( Window* pParent, const ResId & rResId ) :
@@ -62,7 +62,7 @@ GalleryPreview::GalleryPreview( Window* pParent, const ResId & rResId ) :
SetHelpId( HID_GALLERY_PREVIEW );
InitSettings();
- mxGraphicObj = rtl::Reference< GraphicObject >();
+ mxGraphicObj = GraphicObject::Create(Graphic());
}
GalleryPreview::~GalleryPreview()
@@ -98,7 +98,7 @@ bool GalleryPreview::SetGraphic( const INetURLObject& _aURL )
void GalleryPreview::ClearGraphic()
{
- mxGraphicObj.clear();
+ mxGraphicObj = GraphicObject::Create(Graphic());
}
void GalleryPreview::InitSettings()
@@ -152,18 +152,15 @@ sal_Bool GalleryPreview::ImplGetGraphicCenterRect( const Graphic& rGraphic, Rect
void GalleryPreview::Paint( const Rectangle& rRect )
{
Window::Paint( rRect );
- if(mxGraphicObj.is())
+ if( ImplGetGraphicCenterRect( mxGraphicObj->GetGraphic(), maPreviewRect ) )
{
- if( ImplGetGraphicCenterRect( mxGraphicObj->GetGraphic(), maPreviewRect ) )
- {
- const Point aPos( maPreviewRect.TopLeft() );
- const Size aSize( maPreviewRect.GetSize() );
+ const Point aPos( maPreviewRect.TopLeft() );
+ const Size aSize( maPreviewRect.GetSize() );
- if( mxGraphicObj->IsAnimated() )
- mxGraphicObj->StartAnimation( this, aPos, aSize );
- else
- mxGraphicObj->Draw( this, aPos, aSize );
- }
+ if( mxGraphicObj->IsAnimated() )
+ mxGraphicObj->StartAnimation( this, aPos, aSize );
+ else
+ mxGraphicObj->Draw( this, aPos, aSize );
}
}
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 04d2c7d85f69..e6251febe146 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -87,7 +87,7 @@ namespace sdr
const GraphicAttr& rLocalGrafInfo) const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- rtl::Reference< GraphicObject > xEmptyGraphicObject= rtl::Reference< GraphicObject >();
+ rtl::Reference< GraphicObject > xEmptyGraphicObject= GraphicObject::Create(Graphic());
GraphicAttr aEmptyGraphicAttr;
// SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts
@@ -150,7 +150,7 @@ namespace sdr
const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute) const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- rtl::Reference< GraphicObject > xEmptyGraphicObject = rtl::Reference< GraphicObject >();
+ rtl::Reference< GraphicObject > xEmptyGraphicObject = GraphicObject::Create(Graphic());
GraphicAttr aEmptyGraphicAttr;
// SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index d51ef7adec44..39bdaf92ea7a 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -331,7 +331,7 @@ SdrGrafObj::SdrGrafObj()
pGraphicLink ( NULL ),
bMirrored ( false )
{
- mxGraphic = rtl::Reference<GraphicObject>();
+ mxGraphic = GraphicObject::Create(Graphic());
mxGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT );
onGraphicChanged();
@@ -1273,11 +1273,11 @@ void SdrGrafObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly )
}
}
-IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
+IMPL_LINK( SdrGrafObj, ImpSwapHdl, rtl::Reference<GraphicObject>*, pO )
{
SvStream* pRet = GRFMGR_AUTOSWAPSTREAM_NONE;
- if( pO->IsInSwapOut() )
+ if( (*pO)->IsInSwapOut() )
{
if( pModel && !mbIsPreview && pModel->IsSwapGraphics() && mxGraphic->GetSizeBytes() > 20480 )
{
@@ -1308,7 +1308,7 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
}
}
}
- else if( pO->IsInSwapIn() )
+ else if( (*pO)->IsInSwapIn() )
{
// can be loaded from the original document stream later
if( pModel != NULL )
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 09449a0cfd3a..09c22f010cfd 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -62,7 +62,7 @@ SwGrfNode::SwGrfNode(
SwGrfFmtColl *pGrfColl,
SwAttrSet* pAutoAttr ) :
SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
- mxGrfObj(),
+ mxGrfObj(GraphicObject::Create(Graphic())),
mxReplacementGraphic(),
// #i73788#
mbLinkedInputStreamReady( false ),
@@ -72,7 +72,7 @@ SwGrfNode::SwGrfNode(
bFrameInPaint = bScaleImageMap = sal_False;
bGrafikArrived = sal_True;
- ReRead(rGrfName,rFltName, pGraphic, mxGrfObj.is() ? mxGrfObj.get() : NULL, sal_False);
+ ReRead(rGrfName,rFltName, pGraphic, mxGrfObj.get(), sal_False);
mxGrfObj->SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
}
@@ -105,7 +105,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
SwGrfFmtColl *pGrfColl,
SwAttrSet* pAutoAttr ) :
SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
- mxGrfObj(),
+ mxGrfObj(GraphicObject::Create(Graphic())),
mxReplacementGraphic(),
// #i73788#
mbLinkedInputStreamReady( false ),
@@ -245,8 +245,10 @@ sal_Bool SwGrfNode::ReRead(
bReadGrf = sal_True;
}
// Was the graphic already loaded?
- else if( !bNewGrf && mxGrfObj.is() && GRAPHIC_NONE != mxGrfObj->GetType() )
+ else if( !bNewGrf && GRAPHIC_NONE != mxGrfObj->GetType() )
+ {
return sal_True;
+ }
else
{
if( HasStreamName() )
@@ -501,7 +503,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
// no default bitmap anymore, thus re-paint
mxReplacementGraphic.clear();
- mxGrfObj = rtl::Reference<GraphicObject>();
+ mxGrfObj = GraphicObject::Create(Graphic());
onGraphicChanged();
SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED );
ModifyNotification( &aMsgHint, &aMsgHint );