summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-02-09 18:30:54 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-02-09 18:30:54 +0100
commit5a5dbb31d559fb8d3cf9831863bea1f215a34f3d (patch)
tree5cdef958f12c98975501dc81c2da968ee543e183 /editeng
parent05554bc47840659e1b9826523c100edfbc8a4ecd (diff)
Use rtl::Reference<CppType> instead of HardCppRef<UnoType,CppType>
Change-Id: I089b5caca5e05726105f78aeb00db1869d0a17f4
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx16
-rw-r--r--editeng/source/accessibility/AccessibleParaManager.cxx13
2 files changed, 15 insertions, 14 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index a51fbbac7e2b..66080c248361 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -258,7 +258,7 @@ namespace accessibility
mnParagraphIndex = nIndex;
- WeakBullet::HardRefType aChild( maImageBullet.get() );
+ auto aChild( maImageBullet.get() );
if( aChild.is() )
aChild->SetParagraphIndex(mnParagraphIndex);
@@ -318,7 +318,7 @@ namespace accessibility
void AccessibleEditableTextPara::SetEditSource( SvxEditSourceAdapter* pEditSource )
{
- WeakBullet::HardRefType aChild( maImageBullet.get() );
+ auto aChild( maImageBullet.get() );
if( aChild.is() )
aChild->SetEditSource(pEditSource);
@@ -561,7 +561,7 @@ namespace accessibility
void AccessibleEditableTextPara::SetEEOffset( const Point& rOffset )
{
- WeakBullet::HardRefType aChild( maImageBullet.get() );
+ auto aChild( maImageBullet.get() );
if( aChild.is() )
aChild->SetEEOffset(rOffset);
@@ -700,7 +700,7 @@ namespace accessibility
uno::Reference< uno::XInterface >
( static_cast< ::cppu::OWeakObject* > (this) ) ); // static_cast: disambiguate hierarchy
- WeakBullet::HardRefType aChild( maImageBullet.get() );
+ auto aChild( maImageBullet.get() );
if( !aChild.is() )
{
@@ -713,7 +713,7 @@ namespace accessibility
uno::Reference< uno::XInterface >
( static_cast< ::cppu::OWeakObject* > (this) ) );
- aChild = WeakBullet::HardRefType( xChild, pChild );
+ aChild = pChild;
aChild->SetEditSource( &GetEditSource() );
aChild->SetParagraphIndex( GetParagraphIndex() );
@@ -722,7 +722,7 @@ namespace accessibility
maImageBullet = aChild;
}
- return aChild.getRef();
+ return aChild.get();
}
uno::Reference< XAccessible > SAL_CALL AccessibleEditableTextPara::getAccessibleParent() throw (uno::RuntimeException, std::exception)
@@ -817,7 +817,7 @@ namespace accessibility
mpParaManager->IsReferencable( nMyParaIndex - 1 ) )
{
uno::Sequence<uno::Reference<XInterface> > aSequence
- { mpParaManager->GetChild( nMyParaIndex - 1 ).first.get().getRef() };
+ { static_cast<cppu::OWeakObject *>(mpParaManager->GetChild( nMyParaIndex - 1 ).first.get().get()) };
AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_FROM,
aSequence );
pAccRelSetHelper->AddRelation( aAccRel );
@@ -828,7 +828,7 @@ namespace accessibility
mpParaManager->IsReferencable( nMyParaIndex + 1 ) )
{
uno::Sequence<uno::Reference<XInterface> > aSequence
- { mpParaManager->GetChild( nMyParaIndex + 1 ).first.get().getRef() };
+ { static_cast<cppu::OWeakObject *>(mpParaManager->GetChild( nMyParaIndex + 1 ).first.get().get()) };
AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_TO,
aSequence );
pAccRelSetHelper->AddRelation( aAccRel );
diff --git a/editeng/source/accessibility/AccessibleParaManager.cxx b/editeng/source/accessibility/AccessibleParaManager.cxx
index 30fbdb56dd1b..bed5541b3f5e 100644
--- a/editeng/source/accessibility/AccessibleParaManager.cxx
+++ b/editeng/source/accessibility/AccessibleParaManager.cxx
@@ -104,13 +104,14 @@ namespace accessibility
if( 0 <= nPara && maChildren.size() > static_cast<size_t>(nPara) )
{
- WeakPara::HardRefType maChild( GetChild( nPara ).first.get() );
+ auto maChild( GetChild( nPara ).first.get() );
if( maChild.is() )
maChild->FireEvent( nEventId, rNewValue, rOldValue );
}
}
- bool AccessibleParaManager::IsReferencable( WeakPara::HardRefType aChild )
+ bool AccessibleParaManager::IsReferencable(
+ rtl::Reference<AccessibleEditableTextPara> const & aChild)
{
return aChild.is();
}
@@ -157,7 +158,7 @@ namespace accessibility
if( 0 <= nParagraphIndex && maChildren.size() > static_cast<size_t>(nParagraphIndex) )
{
// retrieve hard reference from weak one
- WeakPara::HardRefType aChild( GetChild( nParagraphIndex ).first.get() );
+ auto aChild( GetChild( nParagraphIndex ).first.get() );
if( !IsReferencable( nParagraphIndex ) )
{
@@ -169,14 +170,14 @@ namespace accessibility
if( !xChild.is() )
throw uno::RuntimeException("Child creation failed", xFrontEnd);
- aChild = WeakPara::HardRefType( xChild, pChild );
+ aChild = pChild;
InitChild( *aChild, rEditSource, nChild, nParagraphIndex );
maChildren[ nParagraphIndex ] = WeakChild( aChild, pChild->getBounds() );
}
- return Child( aChild.getRef(), GetChild( nParagraphIndex ).second );
+ return Child( aChild.get(), GetChild( nParagraphIndex ).second );
}
else
{
@@ -377,7 +378,7 @@ namespace accessibility
void AccessibleParaManager::ShutdownPara( const WeakChild& rChild )
{
- WeakPara::HardRefType aChild( rChild.first.get() );
+ auto aChild( rChild.first.get() );
if( IsReferencable( aChild ) )
aChild->SetEditSource( nullptr );