diff options
Diffstat (limited to 'sw/source/ui/uno/unotxvw.cxx')
-rw-r--r-- | sw/source/ui/uno/unotxvw.cxx | 286 |
1 files changed, 142 insertions, 144 deletions
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 42b0d699689a..eaba514a6e6a 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -66,7 +66,7 @@ #include <sfx2/request.hxx> #include <frmatr.hxx> #include <vos/mutex.hxx> -#include <bookmrk.hxx> +#include <IMark.hxx> #include <unotxdoc.hxx> #include <unodraw.hxx> #include <svx/unoshcol.hxx> @@ -134,8 +134,8 @@ SwPaM* lcl_createPamCopy(const SwPaM& rPam) -----------------------------------------------------------------------*/ SwXTextView::SwXTextView(SwView* pSwView) : SfxBaseController(pSwView), - pView(pSwView), - pMap( aSwMapProvider.GetPropertyMap( PROPERTY_MAP_TEXT_VIEW ) ), + m_pView(pSwView), + m_pPropSet( aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_VIEW ) ), pxViewSettings(0), pxTextViewCursor(0) { @@ -188,7 +188,7 @@ void SwXTextView::Invalidate() } m_refCount--; - pView = 0; + m_pView = 0; } /* -----------------------------18.05.00 10:18-------------------------------- @@ -435,13 +435,12 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg xIfcTunnel->getSomething(SwXBookmark::getUnoTunnelId())); if(pBkm && pBkm->GetDoc() == pDoc) { - - sal_uInt16 nFndPos = rSh.FindBookmark(pBkm->getName()); - - if( USHRT_MAX != nFndPos ) + IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess(); + IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->findMark(pBkm->getName()); + if( ppMark != pMarkAccess->getMarksEnd() ) { rSh.EnterStdMode(); - rSh.GotoBookmark( nFndPos ); + rSh.GotoMark( ppMark->get() ); } return sal_True; } @@ -498,7 +497,7 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg SdrObject *pObj = pSvxShape->GetSdrObject(); if (pObj) { -// lcl_ShowObject( *pViewSh, *pDrawView, pObj ); +// lcl_ShowObject( *m_pViewSh, *pDrawView, pObj ); SdrPageView* pPV = pDrawView->GetSdrPageView(); if ( pPV && pObj->GetPage() == pPV->GetPage() ) { @@ -531,7 +530,7 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg { if (!pPV) // erstes Objekt { -// lcl_ShowObject( *pViewSh, *pDrawView, pObj ); +// lcl_ShowObject( *m_pViewSh, *pDrawView, pObj ); pPV = pDrawView->GetSdrPageView(); } if ( pPV && pObj->GetPage() == pPV->GetPage() ) @@ -561,10 +560,10 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException ) if(GetView()) { //force immediat shell update - pView->StopShellTimer(); + m_pView->StopShellTimer(); // ein interface aus der aktuellen Selektion erzeugen - SwWrtShell& rSh = pView->GetWrtShell(); - ShellModes eSelMode = pView->GetShellMode(); + SwWrtShell& rSh = m_pView->GetWrtShell(); + ShellModes eSelMode = m_pView->GetShellMode(); switch(eSelMode) { case SHELL_MODE_TABLE_TEXT : @@ -632,7 +631,7 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException ) case SHELL_MODE_BEZIER : { uno::Reference< drawing::XDrawPageSupplier > xPageSupp; - uno::Reference< frame::XModel > xModel = pView->GetDocShell()->GetBaseModel(); + uno::Reference< frame::XModel > xModel = m_pView->GetDocShell()->GetBaseModel(); uno::Reference< lang::XUnoTunnel > xModelTunnel(xModel, uno::UNO_QUERY); SwXTextDocument* pTextDoc = reinterpret_cast<SwXTextDocument*>(xModelTunnel-> getSomething(SwXTextDocument::getUnoTunnelId())); @@ -787,12 +786,12 @@ uno::Reference< text::XTextViewCursor > SwXTextView::getViewCursor(void) throw( uno::Reference< beans::XPropertySet > SwXTextView::getViewSettings(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if(!pxViewSettings) { ((SwXTextView*)this)->pxViewSettings = new uno::Reference< beans::XPropertySet > ; - *pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( sal_False, pView ) ); + *pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( sal_False, m_pView ) ); } } else @@ -808,15 +807,15 @@ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAuto if(!GetView()) throw RuntimeException(); - SwWrtShell& rSh = pView->GetWrtShell(); - ShellModes eSelMode = pView->GetShellMode(); + SwWrtShell& rSh = m_pView->GetWrtShell(); + ShellModes eSelMode = m_pView->GetShellMode(); if (eSelMode != SHELL_MODE_LIST_TEXT && eSelMode != SHELL_MODE_TABLE_LIST_TEXT && eSelMode != SHELL_MODE_TABLE_TEXT && eSelMode != SHELL_MODE_TEXT ) return Sequence< Sequence< PropertyValue > > (); - SwDoc* pDoc = pView->GetDocShell()->GetDoc(); + SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); SwRubyList aList; USHORT nCount = pDoc->FillRubyList( *rSh.GetCrsr(), aList, 0 ); @@ -858,8 +857,8 @@ void SAL_CALL SwXTextView::setRubyList( if(!GetView() || !rRubyList.getLength()) throw RuntimeException(); - SwWrtShell& rSh = pView->GetWrtShell(); - ShellModes eSelMode = pView->GetShellMode(); + SwWrtShell& rSh = m_pView->GetWrtShell(); + ShellModes eSelMode = m_pView->GetShellMode(); if (eSelMode != SHELL_MODE_LIST_TEXT && eSelMode != SHELL_MODE_TABLE_LIST_TEXT && eSelMode != SHELL_MODE_TABLE_TEXT && @@ -919,7 +918,7 @@ void SAL_CALL SwXTextView::setRubyList( } aList.Insert(pEntry, (USHORT)nPos); } - SwDoc* pDoc = pView->GetDocShell()->GetDoc(); + SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); pDoc->SetRubyList( *rSh.GetCrsr(), aList, 0 ); } /*-- 29.12.02 15:45:29--------------------------------------------------- @@ -927,7 +926,7 @@ void SAL_CALL SwXTextView::setRubyList( -----------------------------------------------------------------------*/ SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc( SfxObjectShellRef& /*rRef*/ ) { - SwWrtShell* pOldSh = &pView->GetWrtShell(); + SwWrtShell* pOldSh = &m_pView->GetWrtShell(); SfxPrinter *pPrt = pOldSh->getIDocumentDeviceAccess()->getPrinter( false ); SwDocShell* pDocSh; SfxObjectShellRef xDocSh( pDocSh = new SwDocShell( /*pPrtDoc, */SFX_CREATE_MODE_STANDARD ) ); @@ -965,14 +964,14 @@ SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc( SfxObjectShellRef& /*rRef*/ -----------------------------------------------------------------------*/ void SwXTextView::NotifySelChanged() { - DBG_ASSERT( pView, "view is missing" ); + DBG_ASSERT( m_pView, "view is missing" ); // destroy temporary document with selected text that is used // in PDF export of (multi-)selections. - if (pView && pView->GetTmpSelectionDoc().Is()) + if (m_pView && m_pView->GetTmpSelectionDoc().Is()) { - pView->GetTmpSelectionDoc()->DoClose(); - pView->GetTmpSelectionDoc() = 0; + m_pView->GetTmpSelectionDoc()->DoClose(); + m_pView->GetTmpSelectionDoc() = 0; } uno::Reference< uno::XInterface > xInt = (cppu::OWeakObject*)(SfxBaseController*)this; @@ -1012,7 +1011,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL SwXTextView::getPropertySetIn throw (uno::RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); - static uno::Reference< XPropertySetInfo > aRef = new SfxItemPropertySetInfo( pMap ); + static uno::Reference< XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo(); return aRef; } @@ -1022,15 +1021,14 @@ void SAL_CALL SwXTextView::setPropertyValue( throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); - - const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName( pMap, rPropertyName ); - if (!pCur) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if (!pEntry) throw UnknownPropertyException(); - else if (pCur->nFlags & PropertyAttribute::READONLY) + else if (pEntry->nFlags & PropertyAttribute::READONLY) throw PropertyVetoException(); else { - switch (pCur->nWID) + switch (pEntry->nWID) { case WID_IS_HIDE_SPELL_MARKS : // deprecated #i91949 @@ -1038,13 +1036,13 @@ void SAL_CALL SwXTextView::setPropertyValue( case WID_IS_CONSTANT_SPELLCHECK : { sal_Bool bVal = sal_False; - const SwViewOption *pOpt = pView->GetWrtShell().GetViewOptions(); + const SwViewOption *pOpt = m_pView->GetWrtShell().GetViewOptions(); if (!pOpt || !(rValue >>= bVal)) throw RuntimeException(); SwViewOption aNewOpt( *pOpt ); - if (pCur->nWID == WID_IS_CONSTANT_SPELLCHECK) + if (pEntry->nWID == WID_IS_CONSTANT_SPELLCHECK) aNewOpt.SetOnlineSpell(bVal); - pView->GetWrtShell().ApplyViewOptions( aNewOpt ); + m_pView->GetWrtShell().ApplyViewOptions( aNewOpt ); } break; default : @@ -1062,12 +1060,12 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue( Any aRet; - const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName( pMap, rPropertyName ); - if (!pCur) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if (!pEntry) throw UnknownPropertyException(); else { - sal_Int16 nWID = pCur->nWID; + sal_Int16 nWID = pEntry->nWID; switch (nWID) { case WID_PAGE_COUNT : @@ -1075,13 +1073,13 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue( { // format document completely in order to get meaningful // values for page count and line count - pView->GetWrtShell().CalcLayout(); + m_pView->GetWrtShell().CalcLayout(); sal_Int32 nCount = -1; if (nWID == WID_PAGE_COUNT) - nCount = pView->GetDocShell()->GetDoc()->GetPageCount(); + nCount = m_pView->GetDocShell()->GetDoc()->GetPageCount(); else // WID_LINE_COUNT - nCount = pView->GetWrtShell().GetLineCount( FALSE /*of whole document*/ ); + nCount = m_pView->GetWrtShell().GetLineCount( FALSE /*of whole document*/ ); aRet <<= nCount; } break; @@ -1090,7 +1088,7 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue( break; case WID_IS_CONSTANT_SPELLCHECK : { - const SwViewOption *pOpt = pView->GetWrtShell().GetViewOptions(); + const SwViewOption *pOpt = m_pView->GetWrtShell().GetViewOptions(); if (!pOpt) throw RuntimeException(); UINT32 nFlag = VIEWOPT_1_ONLINESPELL; @@ -1176,8 +1174,8 @@ Sequence< OUString > SwXTextView::getSupportedServiceNames(void) throw( RuntimeE -----------------------------------------------------------------------*/ SwXTextViewCursor::SwXTextViewCursor(SwView* pVw) : - pView(pVw), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR)) + m_pView(pVw), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)) { } /*-- 17.12.98 09:36:24--------------------------------------------------- @@ -1203,12 +1201,12 @@ sal_Bool SwXTextViewCursor::IsTextSelection( sal_Bool bAllowTables ) const { sal_Bool bRes = sal_False; - DBG_ASSERT(pView, "pView is NULL ???"); - if(pView) + DBG_ASSERT(m_pView, "m_pView is NULL ???"); + if(m_pView) { - //! pView->GetShellMode() will only work after the shell + //! m_pView->GetShellMode() will only work after the shell //! has already changed and thus can not be used here! - SelectionType eSelType = pView->GetWrtShell().GetSelectionType(); + SelectionType eSelType = m_pView->GetWrtShell().GetSelectionType(); bRes = ( (nsSelectionType::SEL_TXT & eSelType) || (nsSelectionType::SEL_NUM & eSelType) ) && (!(nsSelectionType::SEL_TBL_CELLS & eSelType) || bAllowTables); @@ -1240,9 +1238,9 @@ awt::Point SwXTextViewCursor::getPosition(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); awt::Point aRet; - if(pView) + if(m_pView) { - const SwWrtShell& rSh = pView->GetWrtShell(); + const SwWrtShell& rSh = m_pView->GetWrtShell(); const SwRect aCharRect(rSh.GetCharRect()); const SwFrmFmt& rMaster = rSh.GetPageDesc( rSh.GetCurPageDesc() ).GetMaster(); @@ -1265,12 +1263,12 @@ awt::Point SwXTextViewCursor::getPosition(void) throw( uno::RuntimeException ) void SwXTextViewCursor::collapseToStart(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); if(rSh.HasSelection()) { SwPaM* pShellCrsr = rSh.GetCrsr(); @@ -1290,12 +1288,12 @@ void SwXTextViewCursor::collapseToStart(void) throw( uno::RuntimeException ) void SwXTextViewCursor::collapseToEnd(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); if(rSh.HasSelection()) { SwPaM* pShellCrsr = rSh.GetCrsr(); @@ -1316,12 +1314,12 @@ sal_Bool SwXTextViewCursor::isCollapsed(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - const SwWrtShell& rSh = pView->GetWrtShell(); + const SwWrtShell& rSh = m_pView->GetWrtShell(); bRet = !rSh.HasSelection(); } else @@ -1336,13 +1334,13 @@ sal_Bool SwXTextViewCursor::goLeft(sal_Int16 nCount, sal_Bool bExpand) throw( un { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); for( sal_uInt16 i = 0; i < nCount; i++ ) - bRet = pView->GetWrtShell().Left( CRSR_SKIP_CHARS, bExpand, 1, sal_True ); + bRet = m_pView->GetWrtShell().Left( CRSR_SKIP_CHARS, bExpand, 1, sal_True ); } else throw uno::RuntimeException(); @@ -1355,13 +1353,13 @@ sal_Bool SwXTextViewCursor::goRight(sal_Int16 nCount, sal_Bool bExpand) throw( u { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); for( sal_uInt16 i = 0; i < nCount; i++ ) - bRet = pView->GetWrtShell().Right( CRSR_SKIP_CHARS, bExpand, 1, sal_True ); + bRet = m_pView->GetWrtShell().Right( CRSR_SKIP_CHARS, bExpand, 1, sal_True ); } else throw uno::RuntimeException(); @@ -1377,17 +1375,17 @@ void SwXTextViewCursor::gotoRange( throw(RuntimeException) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView && xRange.is()) + if(m_pView && xRange.is()) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwUnoInternalPaM rDestPam(*pView->GetDocShell()->GetDoc()); + SwUnoInternalPaM rDestPam(*m_pView->GetDocShell()->GetDoc()); if(!SwXTextRange::XTextRangeToSwPaM( rDestPam, xRange)) throw IllegalArgumentException(); - ShellModes eSelMode = pView->GetShellMode(); - SwWrtShell& rSh = pView->GetWrtShell(); + ShellModes eSelMode = m_pView->GetShellMode(); + SwWrtShell& rSh = m_pView->GetWrtShell(); // call EnterStdMode in non-text selections only if(!bExpand || (eSelMode != SHELL_MODE_TABLE_TEXT && @@ -1441,8 +1439,8 @@ void SwXTextViewCursor::gotoRange( } else if(pRange && pRange->GetBookmark()) { - SwBookmark* pBkm = pRange->GetBookmark(); - pSrcNode = &pBkm->GetBookmarkPos().nNode.GetNode(); + const ::sw::mark::IMark* const pBkmk = pRange->GetBookmark(); + pSrcNode = &(pBkmk->GetMarkPos().nNode.GetNode()); } else if (pPara && pPara->GetCrsr()) { @@ -1513,12 +1511,12 @@ void SwXTextViewCursor::gotoRange( void SwXTextViewCursor::gotoStart(sal_Bool bExpand) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - pView->GetWrtShell().SttDoc( bExpand ); + m_pView->GetWrtShell().SttDoc( bExpand ); } else throw uno::RuntimeException(); @@ -1529,12 +1527,12 @@ void SwXTextViewCursor::gotoStart(sal_Bool bExpand) throw( uno::RuntimeException void SwXTextViewCursor::gotoEnd(sal_Bool bExpand) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - pView->GetWrtShell().EndDoc( bExpand ); + m_pView->GetWrtShell().EndDoc( bExpand ); } else throw uno::RuntimeException(); @@ -1546,9 +1544,9 @@ sal_Bool SwXTextViewCursor::jumpToFirstPage(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); if (rSh.IsSelFrmMode()) { rSh.UnSelectFrm(); @@ -1568,9 +1566,9 @@ sal_Bool SwXTextViewCursor::jumpToLastPage(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); if (rSh.IsSelFrmMode()) { rSh.UnSelectFrm(); @@ -1591,8 +1589,8 @@ sal_Bool SwXTextViewCursor::jumpToPage(sal_Int16 nPage) throw( uno::RuntimeExcep { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) - bRet = pView->GetWrtShell().GotoPage(nPage, TRUE); + if(m_pView) + bRet = m_pView->GetWrtShell().GotoPage(nPage, TRUE); else throw uno::RuntimeException(); return bRet; @@ -1604,8 +1602,8 @@ sal_Bool SwXTextViewCursor::jumpToNextPage(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) - bRet = pView->GetWrtShell().SttNxtPg(); + if(m_pView) + bRet = m_pView->GetWrtShell().SttNxtPg(); else throw uno::RuntimeException(); return bRet; @@ -1617,8 +1615,8 @@ sal_Bool SwXTextViewCursor::jumpToPreviousPage(void) throw( uno::RuntimeExceptio { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) - bRet = pView->GetWrtShell().EndPrvPg(); + if(m_pView) + bRet = m_pView->GetWrtShell().EndPrvPg(); else throw uno::RuntimeException(); return bRet; @@ -1630,8 +1628,8 @@ sal_Bool SwXTextViewCursor::jumpToEndOfPage(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) - bRet = pView->GetWrtShell().EndPg(); + if(m_pView) + bRet = m_pView->GetWrtShell().EndPg(); else throw uno::RuntimeException(); return bRet; @@ -1643,8 +1641,8 @@ sal_Bool SwXTextViewCursor::jumpToStartOfPage(void) throw( uno::RuntimeException { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) - bRet = pView->GetWrtShell().SttPg(); + if(m_pView) + bRet = m_pView->GetWrtShell().SttPg(); else throw uno::RuntimeException(); return bRet; @@ -1656,9 +1654,9 @@ sal_Int16 SwXTextViewCursor::getPage(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); short nRet = 0; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); nRet = (short)pShellCrsr->GetPageNum( TRUE, 0 ); } @@ -1673,10 +1671,10 @@ sal_Bool SwXTextViewCursor::screenDown(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { - SfxRequest aReq(FN_PAGEDOWN, SFX_CALLMODE_SLOT, pView->GetPool()); - pView->Execute(aReq); + SfxRequest aReq(FN_PAGEDOWN, SFX_CALLMODE_SLOT, m_pView->GetPool()); + m_pView->Execute(aReq); const SfxPoolItem* pRet = aReq.GetReturnValue(); bRet = pRet && ((const SfxBoolItem*)pRet)->GetValue(); } @@ -1691,10 +1689,10 @@ sal_Bool SwXTextViewCursor::screenUp(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { - SfxRequest aReq(FN_PAGEUP, SFX_CALLMODE_SLOT, pView->GetPool()); - pView->Execute(aReq); + SfxRequest aReq(FN_PAGEUP, SFX_CALLMODE_SLOT, m_pView->GetPool()); + m_pView->Execute(aReq); const SfxPoolItem* pRet = aReq.GetReturnValue(); bRet = pRet && ((const SfxBoolItem*)pRet)->GetValue(); } @@ -1709,14 +1707,14 @@ uno::Reference< text::XText > SwXTextViewCursor::getText(void) throw( uno::Runt { ::vos::OGuard aGuard(Application::GetSolarMutex()); uno::Reference< text::XText > xRet; - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - SwDoc* pDoc = pView->GetDocShell()->GetDoc(); + SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); uno::Reference< text::XTextRange > xRg = SwXTextRange::CreateTextRangeFromPosition(pDoc, *pShellCrsr->Start(), 0); xRet = xRg->getText(); @@ -1732,14 +1730,14 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getStart(void) throw( uno { ::vos::OGuard aGuard(Application::GetSolarMutex()); uno::Reference< text::XTextRange > xRet; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - SwDoc* pDoc = pView->GetDocShell()->GetDoc(); + SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); xRet = SwXTextRange::CreateTextRangeFromPosition(pDoc, *pShellCrsr->Start(), 0); } @@ -1754,14 +1752,14 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getEnd(void) throw( uno:: { ::vos::OGuard aGuard(Application::GetSolarMutex()); uno::Reference< text::XTextRange > xRet; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - SwDoc* pDoc = pView->GetDocShell()->GetDoc(); + SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); xRet = SwXTextRange::CreateTextRangeFromPosition(pDoc, *pShellCrsr->End(), 0); } @@ -1776,12 +1774,12 @@ OUString SwXTextViewCursor::getString(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); OUString uRet; - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - ShellModes eSelMode = pView->GetShellMode(); + ShellModes eSelMode = m_pView->GetShellMode(); switch(eSelMode) { //! since setString for SEL_TABLE_TEXT (with possible @@ -1793,7 +1791,7 @@ OUString SwXTextViewCursor::getString(void) throw( uno::RuntimeException ) case SHELL_MODE_TABLE_LIST_TEXT: case SHELL_MODE_TEXT : { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); SwXTextCursor::getTextFromPam(*pShellCrsr, uRet); } @@ -1808,12 +1806,12 @@ OUString SwXTextViewCursor::getString(void) throw( uno::RuntimeException ) void SwXTextViewCursor::setString(const OUString& aString) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - ShellModes eSelMode = pView->GetShellMode(); + ShellModes eSelMode = m_pView->GetShellMode(); switch(eSelMode) { //! since setString for SEL_TABLE_TEXT (with possible @@ -1825,7 +1823,7 @@ void SwXTextViewCursor::setString(const OUString& aString) throw( uno::RuntimeEx case SHELL_MODE_TABLE_LIST_TEXT : case SHELL_MODE_TEXT : { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwCursor* pShellCrsr = rSh.GetSwCrsr(); SwXTextCursor::SetString( *pShellCrsr, aString ); } @@ -1839,7 +1837,7 @@ void SwXTextViewCursor::setString(const OUString& aString) throw( uno::RuntimeEx -----------------------------------------------------------------------*/ uno::Reference< XPropertySetInfo > SwXTextViewCursor::getPropertySetInfo( ) throw(RuntimeException) { - static uno::Reference< XPropertySetInfo > xRef = aPropSet.getPropertySetInfo(); + static uno::Reference< XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } /*-- 29.06.00 17:33:39--------------------------------------------------- @@ -1850,13 +1848,13 @@ void SwXTextViewCursor::setPropertyValue( const OUString& rPropertyName, const IllegalArgumentException, WrappedTargetException, RuntimeException) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); SwNode *pNode = pShellCrsr->GetNode(); if (pNode && pNode->IsTxtNode()) - SwXTextCursor::SetPropertyValue(*pShellCrsr, aPropSet, rPropertyName, aValue ); + SwXTextCursor::SetPropertyValue(*pShellCrsr, *m_pPropSet, rPropertyName, aValue ); else throw RuntimeException(); } @@ -1871,11 +1869,11 @@ Any SwXTextViewCursor::getPropertyValue( const OUString& rPropertyName ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); Any aRet; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - aRet = SwXTextCursor::GetPropertyValue( *pShellCrsr, aPropSet, rPropertyName); + aRet = SwXTextCursor::GetPropertyValue( *pShellCrsr, *m_pPropSet, rPropertyName); } else throw RuntimeException(); @@ -1920,11 +1918,11 @@ PropertyState SwXTextViewCursor::getPropertyState( const OUString& rPropertyNam { ::vos::OGuard aGuard(Application::GetSolarMutex()); PropertyState eState; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - eState = SwXTextCursor::GetPropertyState( *pShellCrsr, aPropSet, rPropertyName); + eState = SwXTextCursor::GetPropertyState( *pShellCrsr, *m_pPropSet, rPropertyName); } else throw RuntimeException(); @@ -1938,11 +1936,11 @@ Sequence< PropertyState > SwXTextViewCursor::getPropertyStates( { ::vos::OGuard aGuard(Application::GetSolarMutex()); Sequence< PropertyState > aRet; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - aRet = SwXTextCursor::GetPropertyStates(*pShellCrsr, aPropSet, rPropertyNames); + aRet = SwXTextCursor::GetPropertyStates(*pShellCrsr, *m_pPropSet, rPropertyNames); } return aRet; } @@ -1953,11 +1951,11 @@ void SwXTextViewCursor::setPropertyToDefault( const OUString& rPropertyName ) throw(UnknownPropertyException, RuntimeException) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - SwXTextCursor::SetPropertyToDefault( *pShellCrsr, aPropSet, rPropertyName); + SwXTextCursor::SetPropertyToDefault( *pShellCrsr, *m_pPropSet, rPropertyName); } } /*-- 29.06.00 17:33:43--------------------------------------------------- @@ -1968,11 +1966,11 @@ Any SwXTextViewCursor::getPropertyDefault( const OUString& rPropertyName ) { Any aRet; ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - aRet = SwXTextCursor::GetPropertyDefault( *pShellCrsr, aPropSet, rPropertyName); + aRet = SwXTextCursor::GetPropertyDefault( *pShellCrsr, *m_pPropSet, rPropertyName); } return aRet; } @@ -1983,13 +1981,13 @@ sal_Bool SwXTextViewCursor::goDown(sal_Int16 nCount, sal_Bool bExpand) throw( un { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); for( sal_uInt16 i = 0; i < nCount; i++ ) - bRet = pView->GetWrtShell().Down( bExpand, 1, sal_True ); + bRet = m_pView->GetWrtShell().Down( bExpand, 1, sal_True ); } else throw uno::RuntimeException(); @@ -2002,13 +2000,13 @@ sal_Bool SwXTextViewCursor::goUp(sal_Int16 nCount, sal_Bool bExpand) throw( uno: { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); for( sal_uInt16 i = 0; i < nCount; i++ ) - bRet = pView->GetWrtShell().Up( bExpand, 1, sal_True ); + bRet = m_pView->GetWrtShell().Up( bExpand, 1, sal_True ); } else throw uno::RuntimeException(); @@ -2021,12 +2019,12 @@ sal_Bool SwXTextViewCursor::isAtStartOfLine(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - bRet = pView->GetWrtShell().IsAtLeftMargin(); + bRet = m_pView->GetWrtShell().IsAtLeftMargin(); } else throw uno::RuntimeException(); @@ -2039,12 +2037,12 @@ sal_Bool SwXTextViewCursor::isAtEndOfLine(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - bRet = pView->GetWrtShell().IsAtRightMargin(sal_True); + bRet = m_pView->GetWrtShell().IsAtRightMargin(sal_True); } else throw uno::RuntimeException(); @@ -2056,12 +2054,12 @@ sal_Bool SwXTextViewCursor::isAtEndOfLine(void) throw( uno::RuntimeException ) void SwXTextViewCursor::gotoEndOfLine(sal_Bool bExpand) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - pView->GetWrtShell().RightMargin(bExpand, sal_True); + m_pView->GetWrtShell().RightMargin(bExpand, sal_True); } else throw uno::RuntimeException(); @@ -2072,12 +2070,12 @@ void SwXTextViewCursor::gotoEndOfLine(sal_Bool bExpand) throw( uno::RuntimeExcep void SwXTextViewCursor::gotoStartOfLine(sal_Bool bExpand) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - pView->GetWrtShell().LeftMargin(bExpand, sal_True); + m_pView->GetWrtShell().LeftMargin(bExpand, sal_True); } else throw uno::RuntimeException(); @@ -2147,25 +2145,25 @@ sal_Int64 SAL_CALL SwXTextViewCursor::getSomething( IMPLEMENT_FORWARD_XINTERFACE2(SwXTextViewCursor,SwXTextViewCursor_Base,OTextCursorHelper) const SwDoc* SwXTextViewCursor::GetDoc() const { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); return rSh.GetCrsr() ? rSh.GetCrsr()->GetDoc() : 0; } // ----------------------------------------------------------------------------- SwDoc* SwXTextViewCursor::GetDoc() { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); return rSh.GetCrsr() ? rSh.GetCrsr()->GetDoc() : 0; } // ----------------------------------------------------------------------------- const SwPaM* SwXTextViewCursor::GetPaM() const { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); return rSh.GetCrsr(); } // ----------------------------------------------------------------------------- SwPaM* SwXTextViewCursor::GetPaM() { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); return rSh.GetCrsr(); } |