diff options
author | Michael Stahl <mst@openoffice.org> | 2010-01-08 17:13:50 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-01-08 17:13:50 +0100 |
commit | 440e521dad8c97e939460af857c6a851b220c52e (patch) | |
tree | 84a4f19d97704b2efc0c1cd98ce42ecfbbd74a2e /sw/source/ui/uno | |
parent | faf50e31a983c1be11d74c1b574cd6c5f63d3a4e (diff) |
swunolocking1: #i105557#: fix locking for SwXBookmark:
add Impl struct, and use UnoImplPtr to lock destructor.
move all implementation details out of header, into Impl struct.
replace broken SwClient iteration with a WeakReference in sw::mark::MarkBase.
make constructor protected, and add factory function CreateXBookmark.
use new XUnoTunnel and XServiceInfo helpers.
clean up the implementation a little.
remove SwXBookmarks::GetObject().
Diffstat (limited to 'sw/source/ui/uno')
-rw-r--r-- | sw/source/ui/uno/unotxvw.cxx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 9da88953d481..35a4c5a2f92c 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -433,19 +433,14 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg if(xBkm.is() && xIfcTunnel.is()) { - SwXBookmark* pBkm = reinterpret_cast<SwXBookmark*>( - xIfcTunnel->getSomething(SwXBookmark::getUnoTunnelId())); - if(pBkm && pBkm->GetDoc() == pDoc) + ::sw::mark::IMark const*const pMark( + SwXBookmark::GetBookmarkInDoc(pDoc, xIfcTunnel) ); + if (pMark) { - IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess(); - IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->findMark(pBkm->getName()); - if( ppMark != pMarkAccess->getMarksEnd() ) - { - rSh.EnterStdMode(); - rSh.GotoMark( ppMark->get() ); - } - return sal_True; + rSh.EnterStdMode(); + rSh.GotoMark(pMark); } + return sal_True; } // IndexMark, Index, TextField, Draw, Section, Footnote, Paragraph // |