diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-12-08 12:18:32 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-12-08 12:18:32 +0100 |
commit | 01b21b027114baebac99da23f95463373a6addf2 (patch) | |
tree | 2e162ae2e2e6a5b0a5f7e4a65b528e283167e041 /sc/source | |
parent | 65cc20c6911bdbe0995691d6c3d0f5c772155d13 (diff) |
Replace manual acquire/release calls with rtl::Reference
...which also removes the need for a user-declared ScHeaderFooterTextCursor copy
ctor
Change-Id: Ida4ad4b3aef0865b40535f1fbf220ce5c44f2d47
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/unoobj/textuno.cxx | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 9487ae7e2b9f..68d9bccf6741 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -299,7 +299,7 @@ uno::Reference<text::XTextCursor> SAL_CALL ScHeaderFooterTextObj::createTextCurs throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - return new ScHeaderFooterTextCursor( *this ); + return new ScHeaderFooterTextCursor( this ); } uno::Reference<text::XTextCursor> SAL_CALL ScHeaderFooterTextObj::createTextCursorByRange( @@ -669,31 +669,19 @@ ScCellTextCursor* ScCellTextCursor::getImplementation(const uno::Reference<uno:: return pRet; } -ScHeaderFooterTextCursor::ScHeaderFooterTextCursor(const ScHeaderFooterTextCursor& rOther) : - SvxUnoTextCursor( rOther ), - rTextObj( rOther.rTextObj ) -{ - rTextObj.acquire(); -} - -ScHeaderFooterTextCursor::ScHeaderFooterTextCursor(ScHeaderFooterTextObj& rText) : - SvxUnoTextCursor( rText.GetUnoText() ), +ScHeaderFooterTextCursor::ScHeaderFooterTextCursor(rtl::Reference<ScHeaderFooterTextObj> const & rText) : + SvxUnoTextCursor( rText->GetUnoText() ), rTextObj( rText ) -{ - rTextObj.acquire(); -} +{} -ScHeaderFooterTextCursor::~ScHeaderFooterTextCursor() throw() -{ - rTextObj.release(); -} +ScHeaderFooterTextCursor::~ScHeaderFooterTextCursor() throw() = default; // SvxUnoTextCursor methods reimplemented here to return the right objects: uno::Reference<text::XText> SAL_CALL ScHeaderFooterTextCursor::getText() throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - return &rTextObj; + return rTextObj.get(); } uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextCursor::getStart() throw(uno::RuntimeException, std::exception) |