summaryrefslogtreecommitdiff
path: root/sw/source/ui/uno
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-01-08 17:13:50 +0100
committerMichael Stahl <mst@openoffice.org>2010-01-08 17:13:50 +0100
commit440e521dad8c97e939460af857c6a851b220c52e (patch)
tree84a4f19d97704b2efc0c1cd98ce42ecfbbd74a2e /sw/source/ui/uno
parentfaf50e31a983c1be11d74c1b574cd6c5f63d3a4e (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.cxx17
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
//