diff options
author | Oliver Specht <os@openoffice.org> | 2000-12-21 13:52:16 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2000-12-21 13:52:16 +0000 |
commit | f18d81d067d75f9868d7e3320d89b1681487154f (patch) | |
tree | 705c911bb0bf3d4255f81c228643f91e89dcaa0f | |
parent | c3600a9d75a04bb6a46d12efb85669601565bbf3 (diff) |
#80935# notify listener of SwXParagraph in ::dispose()
-rw-r--r-- | sw/source/core/unocore/unoobj2.cxx | 60 | ||||
-rw-r--r-- | sw/source/core/unocore/unoparagraph.cxx | 61 |
2 files changed, 61 insertions, 60 deletions
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index a2a34b855f43..d5c8cf08b431 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoobj2.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: os $ $Date: 2000-12-19 15:56:44 $ + * last change: $Author: os $ $Date: 2000-12-21 14:52:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1873,62 +1873,6 @@ void SwXTextCursor::SetString(SwUnoCrsr& rUnoCrsr, const OUString& rString) } pDoc->EndUndo(UNDO_INSERT); } -/*-- 11.12.98 08:12:57--------------------------------------------------- - - -----------------------------------------------------------------------*/ -void SwXParagraph::setString(const OUString& aString) throw( uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - - if(pUnoCrsr) - { - if(!SwUnoCursorHelper::IsStartOfPara(*pUnoCrsr)) - pUnoCrsr->MovePara(fnParaCurr, fnParaStart); - SwXTextCursor::SelectPam(*pUnoCrsr, sal_True); - if(pUnoCrsr->GetNode()->GetTxtNode()->GetTxt().Len()) - pUnoCrsr->MovePara(fnParaCurr, fnParaEnd); - SwXTextCursor::SetString(*pUnoCrsr, aString); - SwXTextCursor::SelectPam(*pUnoCrsr, sal_False); - } - else if(IsDescriptor()) - m_sText = aString; - else - throw uno::RuntimeException(); - -} -/* -----------------23.03.99 12:49------------------- - * - * --------------------------------------------------*/ -uno::Reference< container::XEnumeration > SwXParagraph::createContentEnumeration(const OUString& rServiceName) - throw( uno::RuntimeException ) -{ - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if( !pUnoCrsr || COMPARE_EQUAL != rServiceName.compareToAscii("com.sun.star.text.TextContent") ) - throw uno::RuntimeException(); - - uno::Reference< container::XEnumeration > xRet = new SwXParaFrameEnumeration(*pUnoCrsr, PARAFRAME_PORTION_PARAGRAPH); - return xRet; -} -/* -----------------23.03.99 12:49------------------- - * - * --------------------------------------------------*/ -uno::Sequence< OUString > SwXParagraph::getAvailableServiceNames(void) throw( uno::RuntimeException ) -{ - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.TextContent"); - return aRet; -} -/*-- 11.12.98 08:12:58--------------------------------------------------- - - -----------------------------------------------------------------------*/ -void SwXParagraph::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) -{ - ClientModify(this, pOld, pNew); - if(!GetRegisteredIn()) - aLstnrCntnr.Disposing(); -} /****************************************************************** * SwXParaFrameEnumeration ******************************************************************/ diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 50b63c3f60a7..08d8c9c300a5 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoparagraph.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: os $ $Date: 2000-12-15 12:23:15 $ + * last change: $Author: os $ $Date: 2000-12-21 14:52:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -657,6 +657,7 @@ void SwXParagraph::dispose(void) throw( uno::RuntimeException ) SwParaSelection aSelection(pUnoCrsr); pUnoCrsr->GetDoc()->DeleteAndJoin(*pUnoCrsr); pUnoCrsr->Remove(this); + aLstnrCntnr.Disposing(); } else throw uno::RuntimeException(); @@ -770,4 +771,60 @@ OUString SwXParagraph::getString(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return aRet; } +/*-- 11.12.98 08:12:57--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXParagraph::setString(const OUString& aString) throw( uno::RuntimeException ) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + SwUnoCrsr* pUnoCrsr = GetCrsr(); + + if(pUnoCrsr) + { + if(!SwUnoCursorHelper::IsStartOfPara(*pUnoCrsr)) + pUnoCrsr->MovePara(fnParaCurr, fnParaStart); + SwXTextCursor::SelectPam(*pUnoCrsr, sal_True); + if(pUnoCrsr->GetNode()->GetTxtNode()->GetTxt().Len()) + pUnoCrsr->MovePara(fnParaCurr, fnParaEnd); + SwXTextCursor::SetString(*pUnoCrsr, aString); + SwXTextCursor::SelectPam(*pUnoCrsr, sal_False); + } + else if(IsDescriptor()) + m_sText = aString; + else + throw uno::RuntimeException(); + +} +/* -----------------23.03.99 12:49------------------- + * + * --------------------------------------------------*/ +uno::Reference< container::XEnumeration > SwXParagraph::createContentEnumeration(const OUString& rServiceName) + throw( uno::RuntimeException ) +{ + SwUnoCrsr* pUnoCrsr = GetCrsr(); + if( !pUnoCrsr || COMPARE_EQUAL != rServiceName.compareToAscii("com.sun.star.text.TextContent") ) + throw uno::RuntimeException(); + + uno::Reference< container::XEnumeration > xRet = new SwXParaFrameEnumeration(*pUnoCrsr, PARAFRAME_PORTION_PARAGRAPH); + return xRet; +} +/* -----------------23.03.99 12:49------------------- + * + * --------------------------------------------------*/ +uno::Sequence< OUString > SwXParagraph::getAvailableServiceNames(void) throw( uno::RuntimeException ) +{ + uno::Sequence< OUString > aRet(1); + OUString* pArray = aRet.getArray(); + pArray[0] = C2U("com.sun.star.text.TextContent"); + return aRet; +} +/*-- 11.12.98 08:12:58--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXParagraph::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); + if(!GetRegisteredIn()) + aLstnrCntnr.Disposing(); +} |