summaryrefslogtreecommitdiff
path: root/sw/source/core/edit/editsh.cxx
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2013-10-08 14:26:21 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-10-08 14:26:21 +0200
commit6e2f5bce80ff9008a8fcda7ad434033d46da17a3 (patch)
tree12314a7bbc0b8393fb7ff77aa589aa82e9d75fc2 /sw/source/core/edit/editsh.cxx
parent677b93b3993e9a14416275e8bd2a64b12ad91c55 (diff)
wrap GraphicObject in a rtl::Referencefeature/go2
Change-Id: I07842c2920202f39cae054cba866f0d02d767e61
Diffstat (limited to 'sw/source/core/edit/editsh.cxx')
-rw-r--r--sw/source/core/edit/editsh.cxx21
1 files changed, 14 insertions, 7 deletions
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index c49cb15fd4e3..1465277dda72 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -265,21 +265,28 @@ sal_Bool SwEditShell::IsGrfSwapOut( sal_Bool bOnlyLinked ) const
SwGrfNode *pGrfNode = _GetGrfNode();
return pGrfNode &&
(bOnlyLinked ? ( pGrfNode->IsLinkedFile() &&
- ( GRAPHIC_DEFAULT == pGrfNode->GetGrfObj().GetType()||
- pGrfNode->GetGrfObj().IsSwappedOut()))
- : pGrfNode->GetGrfObj().IsSwappedOut());
+ ( GRAPHIC_DEFAULT == pGrfNode->GetGrfObj()->GetType()||
+ pGrfNode->GetGrfObj()->IsSwappedOut()))
+ : pGrfNode->GetGrfObj()->IsSwappedOut());
}
-const GraphicObject* SwEditShell::GetGraphicObj() const
+const rtl::Reference<GraphicObject> SwEditShell::GetGraphicObj() const
{
SwGrfNode* pGrfNode = _GetGrfNode();
- return pGrfNode ? &(pGrfNode->GetGrfObj()) : 0L;
+ if(pGrfNode)
+ {
+ return pGrfNode->GetGrfObj();
+ }
+ else
+ {
+ return rtl::Reference<GraphicObject>();
+ }
}
sal_uInt16 SwEditShell::GetGraphicType() const
{
SwGrfNode *pGrfNode = _GetGrfNode();
- return static_cast<sal_uInt16>(pGrfNode ? pGrfNode->GetGrfObj().GetType() : GRAPHIC_NONE);
+ return static_cast<sal_uInt16>(pGrfNode ? pGrfNode->GetGrfObj()->GetType() : GRAPHIC_NONE);
}
// returns the size of a graphic in <rSz> if CurCrsr->GetPoint() points to a SwGrfNode and
@@ -301,7 +308,7 @@ sal_Bool SwEditShell::GetGrfSize(Size& rSz) const
/// Read again if graphic is not OK and replace old one
void SwEditShell::ReRead( const String& rGrfName, const String& rFltName,
- const Graphic* pGraphic, const GraphicObject* pGrfObj )
+ const Graphic* pGraphic, const rtl::Reference<GraphicObject>* pGrfObj )
{
StartAllAction();
mpDoc->ReRead( *GetCrsr(), rGrfName, rFltName, pGraphic, pGrfObj );