diff options
author | Robinson Tryon <qubit@runcibility.com> | 2015-11-25 06:03:10 -0500 |
---|---|---|
committer | Robinson Tryon <qubit@runcibility.com> | 2015-11-25 06:07:38 -0500 |
commit | 49c2b9808df8a6b197dec666dfc0cda6321a4306 (patch) | |
tree | 045ef4b9b8dfdb06bfbe18cdf773d59f57d5552d /sw/source/core/unocore | |
parent | 5470a365f25e5052b4dd74f76aa2196f0d70934b (diff) |
bin/rename-sw-abbreviations.shlibreoffice-5-1-branch-point
This commit renames the most annoying abbreviations in Writer (and
partially in the shared code too).
Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r-- | sw/source/core/unocore/unochart.cxx | 156 | ||||
-rw-r--r-- | sw/source/core/unocore/unocrsr.cxx | 40 | ||||
-rw-r--r-- | sw/source/core/unocore/unocrsrhelper.cxx | 42 | ||||
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/unocore/unoflatpara.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 146 | ||||
-rw-r--r-- | sw/source/core/unocore/unoftn.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 194 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj2.cxx | 156 | ||||
-rw-r--r-- | sw/source/core/unocore/unoparagraph.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/unocore/unoport.cxx | 94 | ||||
-rw-r--r-- | sw/source/core/unocore/unoportenum.cxx | 244 | ||||
-rw-r--r-- | sw/source/core/unocore/unoredline.cxx | 28 | ||||
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 430 | ||||
-rw-r--r-- | sw/source/core/unocore/unotext.cxx | 38 |
16 files changed, 819 insertions, 819 deletions
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 169040689c45..45372893af17 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -215,38 +215,38 @@ bool FillRangeDescriptor( return true; } -static OUString GetCellRangeName( SwFrameFormat &rTableFormat, SwUnoCrsr &rTableCrsr ) +static OUString GetCellRangeName( SwFrameFormat &rTableFormat, SwUnoCursor &rTableCursor ) { OUString aRes; //!! see also SwXTextTableCursor::getRangeName - SwUnoTableCrsr* pUnoTableCrsr = dynamic_cast<SwUnoTableCrsr*>(&rTableCrsr); - if (!pUnoTableCrsr) + SwUnoTableCursor* pUnoTableCursor = dynamic_cast<SwUnoTableCursor*>(&rTableCursor); + if (!pUnoTableCursor) return OUString(); - pUnoTableCrsr->MakeBoxSels(); + pUnoTableCursor->MakeBoxSels(); const SwStartNode* pStart; const SwTableBox* pStartBox = nullptr; const SwTableBox* pEndBox = nullptr; - pStart = pUnoTableCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); + pStart = pUnoTableCursor->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); if (pStart) { const SwTable* pTable = SwTable::FindTable( &rTableFormat ); pEndBox = pTable->GetTableBox( pStart->GetIndex()); aRes = pEndBox->GetName(); - if(pUnoTableCrsr->HasMark()) + if(pUnoTableCursor->HasMark()) { - pStart = pUnoTableCrsr->GetMark()->nNode.GetNode().FindTableBoxStartNode(); + pStart = pUnoTableCursor->GetMark()->nNode.GetNode().FindTableBoxStartNode(); pStartBox = pTable->GetTableBox( pStart->GetIndex()); } OSL_ENSURE( pStartBox, "start box not found" ); OSL_ENSURE( pEndBox, "end box not found" ); // need to switch start and end? - if (*pUnoTableCrsr->GetPoint() < *pUnoTableCrsr->GetMark()) + if (*pUnoTableCursor->GetPoint() < *pUnoTableCursor->GetMark()) { const SwTableBox* pTmpBox = pStartBox; pStartBox = pEndBox; @@ -367,7 +367,7 @@ static void GetFormatAndCreateCursorFromRangeRep( const SwDoc *pDoc, const OUString &rRangeRepresentation, // must be a single range (i.e. so called sub-range) SwFrameFormat **ppTableFormat, // will be set to the table format of the table used in the range representation - std::shared_ptr<SwUnoCrsr>& rpUnoCrsr ) // will be set to cursor spanning the cell range (cursor will be created!) + std::shared_ptr<SwUnoCursor>& rpUnoCursor ) // will be set to cursor spanning the cell range (cursor will be created!) { OUString aTableName; // table name OUString aStartCell; // name of top left cell @@ -379,7 +379,7 @@ static void GetFormatAndCreateCursorFromRangeRep( { if (ppTableFormat) *ppTableFormat = nullptr; - rpUnoCrsr.reset(); + rpUnoCursor.reset(); } else { @@ -393,10 +393,10 @@ static void GetFormatAndCreateCursorFromRangeRep( *ppTableFormat = pTableFormat; - rpUnoCrsr.reset(); // default result in case of failure + rpUnoCursor.reset(); // default result in case of failure SwTable *pTable = pTableFormat ? SwTable::FindTable( pTableFormat ) : nullptr; - // create new SwUnoCrsr spanning the specified range + // create new SwUnoCursor spanning the specified range //! see also SwXTextTable::GetRangeByName // #i80314# // perform validation check. Thus, pass <true> as 2nd parameter to <SwTable::GetTableBox(..)> @@ -408,24 +408,24 @@ static void GetFormatAndCreateCursorFromRangeRep( SwPosition aPos(*pSttNd); // set cursor to top left box of range - auto pUnoCrsr = pTableFormat->GetDoc()->CreateUnoCrsr(aPos, true); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); - pUnoCrsr->SetRemainInSection( false ); + auto pUnoCursor = pTableFormat->GetDoc()->CreateUnoCursor(aPos, true); + pUnoCursor->Move( fnMoveForward, fnGoNode ); + pUnoCursor->SetRemainInSection( false ); // #i80314# // perform validation check. Thus, pass <true> as 2nd parameter to <SwTable::GetTableBox(..)> const SwTableBox* pBRBox = pTable->GetTableBox( aEndCell, true ); if(pBRBox) { - pUnoCrsr->SetMark(); - pUnoCrsr->GetPoint()->nNode = *pBRBox->GetSttNd(); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); - SwUnoTableCrsr* pCrsr = - dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr.get()); + pUnoCursor->SetMark(); + pUnoCursor->GetPoint()->nNode = *pBRBox->GetSttNd(); + pUnoCursor->Move( fnMoveForward, fnGoNode ); + SwUnoTableCursor* pCursor = + dynamic_cast<SwUnoTableCursor*>(pUnoCursor.get()); // HACK: remove pending actions for old style tables - UnoActionRemoveContext aRemoveContext(*pCrsr); - pCrsr->MakeBoxSels(); - rpUnoCrsr = pUnoCrsr; + UnoActionRemoveContext aRemoveContext(*pCursor); + pCursor->MakeBoxSels(); + rpUnoCursor = pUnoCursor; } } } @@ -671,11 +671,11 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData // get table format for that single table from above SwFrameFormat *pTableFormat = nullptr; // pointer to table format - std::shared_ptr<SwUnoCrsr> pUnoCrsr; // here required to check if the cells in the range do actually exist + std::shared_ptr<SwUnoCursor> pUnoCursor; // here required to check if the cells in the range do actually exist if (aSubRanges.getLength() > 0) - GetFormatAndCreateCursorFromRangeRep( pDoc, pSubRanges[0], &pTableFormat, pUnoCrsr ); + GetFormatAndCreateCursorFromRangeRep( pDoc, pSubRanges[0], &pTableFormat, pUnoCursor ); - if (!pTableFormat || !pUnoCrsr) + if (!pTableFormat || !pUnoCursor) throw lang::IllegalArgumentException(); if(pTableFormat) @@ -885,18 +885,18 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData } // get cursors spanning the cell ranges for label and data - std::shared_ptr<SwUnoCrsr> pLabelUnoCrsr; - std::shared_ptr<SwUnoCrsr> pDataUnoCrsr; - GetFormatAndCreateCursorFromRangeRep( pDoc, aLabelRange, &pTableFormat, pLabelUnoCrsr); - GetFormatAndCreateCursorFromRangeRep( pDoc, aDataRange, &pTableFormat, pDataUnoCrsr); + std::shared_ptr<SwUnoCursor> pLabelUnoCursor; + std::shared_ptr<SwUnoCursor> pDataUnoCursor; + GetFormatAndCreateCursorFromRangeRep( pDoc, aLabelRange, &pTableFormat, pLabelUnoCursor); + GetFormatAndCreateCursorFromRangeRep( pDoc, aDataRange, &pTableFormat, pDataUnoCursor); // create XDataSequence's from cursors - if (pLabelUnoCrsr) - pLabelSeqs[ nSeqsIdx ] = new SwChartDataSequence( *this, *pTableFormat, pLabelUnoCrsr ); - OSL_ENSURE( pDataUnoCrsr, "pointer to data sequence missing" ); - if (pDataUnoCrsr) - pDataSeqs [ nSeqsIdx ] = new SwChartDataSequence( *this, *pTableFormat, pDataUnoCrsr ); - if (pLabelUnoCrsr || pDataUnoCrsr) + if (pLabelUnoCursor) + pLabelSeqs[ nSeqsIdx ] = new SwChartDataSequence( *this, *pTableFormat, pLabelUnoCursor ); + OSL_ENSURE( pDataUnoCursor, "pointer to data sequence missing" ); + if (pDataUnoCursor) + pDataSeqs [ nSeqsIdx ] = new SwChartDataSequence( *this, *pTableFormat, pDataUnoCursor ); + if (pLabelUnoCursor || pDataUnoCursor) ++nSeqsIdx; } OSL_ENSURE( nSeqsIdx == nNumLDS, "mismatch between sequence size and num,ber of entries" ); @@ -1367,23 +1367,23 @@ uno::Reference< chart2::data::XDataSequence > SwChartDataProvider::Impl_createDa throw lang::DisposedException(); SwFrameFormat *pTableFormat = nullptr; // pointer to table format - std::shared_ptr<SwUnoCrsr> pUnoCrsr; // pointer to new created cursor spanning the cell range + std::shared_ptr<SwUnoCursor> pUnoCursor; // pointer to new created cursor spanning the cell range GetFormatAndCreateCursorFromRangeRep( pDoc, rRangeRepresentation, - &pTableFormat, pUnoCrsr ); - if (!pTableFormat || !pUnoCrsr) + &pTableFormat, pUnoCursor ); + if (!pTableFormat || !pUnoCursor) throw lang::IllegalArgumentException(); // check that cursors point and mark are in a single row or column. - OUString aCellRange( GetCellRangeName( *pTableFormat, *pUnoCrsr ) ); + OUString aCellRange( GetCellRangeName( *pTableFormat, *pUnoCursor ) ); SwRangeDescriptor aDesc; FillRangeDescriptor( aDesc, aCellRange ); if (aDesc.nTop != aDesc.nBottom && aDesc.nLeft != aDesc.nRight) throw lang::IllegalArgumentException(); - OSL_ENSURE( pTableFormat && pUnoCrsr, "table format or cursor missing" ); + OSL_ENSURE( pTableFormat && pUnoCursor, "table format or cursor missing" ); uno::Reference< chart2::data::XDataSequence > xDataSeq; if (!bTestOnly) - xDataSeq = new SwChartDataSequence( *this, *pTableFormat, pUnoCrsr ); + xDataSeq = new SwChartDataSequence( *this, *pTableFormat, pUnoCursor ); return xDataSeq; } @@ -1745,8 +1745,8 @@ OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const OUString& rRange { const OUString aRange( rRangeRepresentation.getToken(0, ';', nPos) ); SwFrameFormat *pTableFormat = nullptr; // pointer to table format - std::shared_ptr<SwUnoCrsr> pCrsr; - GetFormatAndCreateCursorFromRangeRep( pDoc, aRange, &pTableFormat, pCrsr ); + std::shared_ptr<SwUnoCursor> pCursor; + GetFormatAndCreateCursorFromRangeRep( pDoc, aRange, &pTableFormat, pCursor ); if (!pTableFormat) throw lang::IllegalArgumentException(); SwTable* pTable = SwTable::FindTable( pTableFormat ); @@ -1881,7 +1881,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSource::getSupportedServiceNames( SwChartDataSequence::SwChartDataSequence( SwChartDataProvider &rProvider, SwFrameFormat &rTableFormat, - std::shared_ptr<SwUnoCrsr> pTableCursor ) : + std::shared_ptr<SwUnoCursor> pTableCursor ) : SwClient( &rTableFormat ), m_aEvtListeners( GetChartMutex() ), m_aModifyListeners( GetChartMutex() ), @@ -1889,7 +1889,7 @@ SwChartDataSequence::SwChartDataSequence( m_aColLabelText( SW_RES( STR_CHART2_COL_LABEL_TEXT ) ), m_xDataProvider( &rProvider ), m_pDataProvider( &rProvider ), - m_pTableCrsr( pTableCursor ), + m_pTableCursor( pTableCursor ), m_pPropSet( aSwMapProvider.GetPropertySet( PROPERTY_MAP_CHART2_DATA_SEQUENCE ) ) { m_bDisposed = false; @@ -1919,11 +1919,11 @@ SwChartDataSequence::SwChartDataSequence( release(); #if OSL_DEBUG_LEVEL > 0 - // check if it can properly convert into a SwUnoTableCrsr + // check if it can properly convert into a SwUnoTableCursor // which is required for some functions - SwUnoTableCrsr* pUnoTableCrsr = dynamic_cast<SwUnoTableCrsr*>(&(*m_pTableCrsr)); - OSL_ENSURE(pUnoTableCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr"); - (void) pUnoTableCrsr; + SwUnoTableCursor* pUnoTableCursor = dynamic_cast<SwUnoTableCursor*>(&(*m_pTableCursor)); + OSL_ENSURE(pUnoTableCursor, "SwChartDataSequence: cursor not SwUnoTableCursor"); + (void) pUnoTableCursor; #endif } @@ -1937,7 +1937,7 @@ SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) : m_aColLabelText( SW_RES(STR_CHART2_COL_LABEL_TEXT) ), m_xDataProvider( rObj.m_pDataProvider ), m_pDataProvider( rObj.m_pDataProvider ), - m_pTableCrsr( rObj.m_pTableCrsr ), + m_pTableCursor( rObj.m_pTableCursor ), m_pPropSet( rObj.m_pPropSet ) { m_bDisposed = false; @@ -1967,11 +1967,11 @@ SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) : release(); #if OSL_DEBUG_LEVEL > 0 - // check if it can properly convert into a SwUnoTableCrsr + // check if it can properly convert into a SwUnoTableCursor // which is required for some functions - SwUnoTableCrsr* pUnoTableCrsr = dynamic_cast<SwUnoTableCrsr*>(&(*m_pTableCrsr)); - OSL_ENSURE(pUnoTableCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr"); - (void) pUnoTableCrsr; + SwUnoTableCursor* pUnoTableCursor = dynamic_cast<SwUnoTableCursor*>(&(*m_pTableCursor)); + OSL_ENSURE(pUnoTableCursor, "SwChartDataSequence: cursor not SwUnoTableCursor"); + (void) pUnoTableCursor; #endif } @@ -2013,7 +2013,7 @@ OUString SAL_CALL SwChartDataSequence::getSourceRangeRepresentation( ) SwFrameFormat* pTableFormat = GetFrameFormat(); if (pTableFormat) { - const OUString aCellRange( GetCellRangeName( *pTableFormat, *m_pTableCrsr ) ); + const OUString aCellRange( GetCellRangeName( *pTableFormat, *m_pTableCursor ) ); OSL_ENSURE( !aCellRange.isEmpty(), "failed to get cell range" ); aRes = pTableFormat->GetName() + "." + aCellRange; } @@ -2039,7 +2039,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel( throw uno::RuntimeException(); else { - const OUString aCellRange( GetCellRangeName( *pTableFormat, *m_pTableCrsr ) ); + const OUString aCellRange( GetCellRangeName( *pTableFormat, *m_pTableCursor ) ); OSL_ENSURE( !aCellRange.isEmpty(), "failed to get cell range" ); bOk = FillRangeDescriptor( aDesc, aCellRange ); OSL_ENSURE( bOk, "failed to get SwRangeDescriptor" ); @@ -2144,9 +2144,9 @@ std::vector< css::uno::Reference< css::table::XCell > > SwChartDataSequence::Get if(pTable->IsTableComplex()) return std::vector< css::uno::Reference< css::table::XCell > >(); SwRangeDescriptor aDesc; - if(!FillRangeDescriptor(aDesc, GetCellRangeName(*pTableFormat, *m_pTableCrsr))) + if(!FillRangeDescriptor(aDesc, GetCellRangeName(*pTableFormat, *m_pTableCursor))) return std::vector< css::uno::Reference< css::table::XCell > >(); - return SwXCellRange(m_pTableCrsr, *pTableFormat, aDesc).GetCells(); + return SwXCellRange(m_pTableCursor, *pTableFormat, aDesc).GetCells(); } uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getTextualData() @@ -2301,9 +2301,9 @@ void SwChartDataSequence::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pN ClientModify(this, pOld, pNew ); // table was deleted or cursor was deleted - if(!GetRegisteredIn() || !m_pTableCrsr) + if(!GetRegisteredIn() || !m_pTableCursor) { - m_pTableCrsr.reset(nullptr); + m_pTableCursor.reset(nullptr); dispose(); } else @@ -2409,7 +2409,7 @@ void SAL_CALL SwChartDataSequence::dispose( ) if (pLclRegisteredIn && pLclRegisteredIn->HasWriterListeners()) { pLclRegisteredIn->Remove(this); - m_pTableCrsr.reset(nullptr); + m_pTableCursor.reset(nullptr); } } @@ -2449,10 +2449,10 @@ bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox ) // if the implementation cursor gets affected (i.e. the box where it is located // in gets removed) we need to move it before that... (otherwise it does not need to change) - const SwStartNode* pPointStartNode = m_pTableCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); - const SwStartNode* pMarkStartNode = m_pTableCrsr->GetMark()->nNode.GetNode().FindTableBoxStartNode(); + const SwStartNode* pPointStartNode = m_pTableCursor->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); + const SwStartNode* pMarkStartNode = m_pTableCursor->GetMark()->nNode.GetNode().FindTableBoxStartNode(); - if (!m_pTableCrsr->HasMark() || (pPointStartNode == rBox.GetSttNd() && pMarkStartNode == rBox.GetSttNd())) + if (!m_pTableCursor->HasMark() || (pPointStartNode == rBox.GetSttNd() && pMarkStartNode == rBox.GetSttNd())) { bNowEmpty = true; } @@ -2522,12 +2522,12 @@ bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox ) SwPosition aNewPos( *pCNd ); // new position to be used with cursor // if the mark is to be changed, make sure there is one - if (pMarkStartNode == rBox.GetSttNd() && !m_pTableCrsr->HasMark()) - m_pTableCrsr->SetMark(); + if (pMarkStartNode == rBox.GetSttNd() && !m_pTableCursor->HasMark()) + m_pTableCursor->SetMark(); // set cursor to new position SwPosition *pPos = (pPointStartNode == rBox.GetSttNd()) ? - m_pTableCrsr->GetPoint() : m_pTableCrsr->GetMark(); + m_pTableCursor->GetPoint() : m_pTableCursor->GetMark(); if (pPos) { pPos->nNode = aNewPos.nNode; @@ -2553,7 +2553,7 @@ void SwChartDataSequence::FillRangeDesc( SwRangeDescriptor &rRangeDesc ) const SwTable* pTable = SwTable::FindTable( pTableFormat ); if(!pTable->IsTableComplex()) { - FillRangeDescriptor( rRangeDesc, GetCellRangeName( *pTableFormat, *m_pTableCrsr ) ); + FillRangeDescriptor( rRangeDesc, GetCellRangeName( *pTableFormat, *m_pTableCursor ) ); } } } @@ -2575,8 +2575,8 @@ void SwChartDataSequence::FillRangeDesc( SwRangeDescriptor &rRangeDesc ) const bool SwChartDataSequence::ExtendTo( bool bExtendCol, sal_Int32 nFirstNew, sal_Int32 nCount ) { - SwUnoTableCrsr* pUnoTableCrsr = dynamic_cast<SwUnoTableCrsr*>(&(*m_pTableCrsr)); - if (!pUnoTableCrsr) + SwUnoTableCursor* pUnoTableCursor = dynamic_cast<SwUnoTableCursor*>(&(*m_pTableCursor)); + if (!pUnoTableCursor) return false; const SwStartNode *pStartNd = nullptr; @@ -2590,11 +2590,11 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol, // get range descriptor (cell range) for current data-sequence - pStartNd = pUnoTableCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); + pStartNd = pUnoTableCursor->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); pEndBox = pTable->GetTableBox( pStartNd->GetIndex() ); const OUString aEndBox( pEndBox->GetName() ); - pStartNd = pUnoTableCrsr->GetMark()->nNode.GetNode().FindTableBoxStartNode(); + pStartNd = pUnoTableCursor->GetMark()->nNode.GetNode().FindTableBoxStartNode(); pStartBox = pTable->GetTableBox( pStartNd->GetIndex() ); const OUString aStartBox( pStartBox->GetName() ); @@ -2647,11 +2647,11 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol, // move table cursor to new start and end of data-sequence const SwTableBox *pNewStartBox = pTable->GetTableBox( aNewStartCell ); const SwTableBox *pNewEndBox = pTable->GetTableBox( aNewEndCell ); - pUnoTableCrsr->SetMark(); - pUnoTableCrsr->GetPoint()->nNode = *pNewEndBox->GetSttNd(); - pUnoTableCrsr->GetMark()->nNode = *pNewStartBox->GetSttNd(); - pUnoTableCrsr->Move( fnMoveForward, fnGoNode ); - pUnoTableCrsr->MakeBoxSels(); + pUnoTableCursor->SetMark(); + pUnoTableCursor->GetPoint()->nNode = *pNewEndBox->GetSttNd(); + pUnoTableCursor->GetMark()->nNode = *pNewStartBox->GetSttNd(); + pUnoTableCursor->Move( fnMoveForward, fnGoNode ); + pUnoTableCursor->MakeBoxSels(); } return bChanged; diff --git a/sw/source/core/unocore/unocrsr.cxx b/sw/source/core/unocore/unocrsr.cxx index d62096c8a3ee..314ee8f8a822 100644 --- a/sw/source/core/unocore/unocrsr.cxx +++ b/sw/source/core/unocore/unocrsr.cxx @@ -27,9 +27,9 @@ sw::DocDisposingHint::~DocDisposingHint() {} -IMPL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr ) +IMPL_FIXEDMEMPOOL_NEWDEL( SwUnoCursor ) -SwUnoCrsr::SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing ) +SwUnoCursor::SwUnoCursor( const SwPosition &rPos, SwPaM* pRing ) : SwCursor( rPos, pRing, false ) , SwModify(nullptr) , m_bRemainInSection(true) @@ -37,12 +37,12 @@ SwUnoCrsr::SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing ) , m_bSkipOverProtectSections(false) {} -SwUnoCrsr::~SwUnoCrsr() +SwUnoCursor::~SwUnoCursor() { SwDoc* pDoc = GetDoc(); if( !pDoc->IsInDtor() ) { - assert(!static_cast<bool>(SwIterator<SwClient, SwUnoCrsr>(*this).First())); + assert(!static_cast<bool>(SwIterator<SwClient, SwUnoCursor>(*this).First())); } // delete the whole ring @@ -54,23 +54,23 @@ SwUnoCrsr::~SwUnoCrsr() } } -bool SwUnoCrsr::IsReadOnlyAvailable() const +bool SwUnoCursor::IsReadOnlyAvailable() const { return true; } -const SwContentFrm* -SwUnoCrsr::DoSetBidiLevelLeftRight( bool &, bool, bool ) +const SwContentFrame* +SwUnoCursor::DoSetBidiLevelLeftRight( bool &, bool, bool ) { return nullptr; // not for uno cursor } -void SwUnoCrsr::DoSetBidiLevelUpDown() +void SwUnoCursor::DoSetBidiLevelUpDown() { return; // not for uno cursor } -bool SwUnoCrsr::IsSelOvr( int eFlags ) +bool SwUnoCursor::IsSelOvr( int eFlags ) { if (m_bRemainInSection) { @@ -156,24 +156,24 @@ bool SwUnoCrsr::IsSelOvr( int eFlags ) return SwCursor::IsSelOvr( eFlags ); } -SwUnoTableCrsr::SwUnoTableCrsr(const SwPosition& rPos) +SwUnoTableCursor::SwUnoTableCursor(const SwPosition& rPos) : SwCursor(rPos, nullptr, false) - , SwUnoCrsr(rPos) + , SwUnoCursor(rPos) , SwTableCursor(rPos) , m_aTableSel(rPos, nullptr, false) { SetRemainInSection(false); } -SwUnoTableCrsr::~SwUnoTableCrsr() +SwUnoTableCursor::~SwUnoTableCursor() { while (m_aTableSel.GetNext() != &m_aTableSel) delete m_aTableSel.GetNext(); } -bool SwUnoTableCrsr::IsSelOvr( int eFlags ) +bool SwUnoTableCursor::IsSelOvr( int eFlags ) { - bool bRet = SwUnoCrsr::IsSelOvr( eFlags ); + bool bRet = SwUnoCursor::IsSelOvr( eFlags ); if( !bRet ) { const SwTableNode* pTNd = GetPoint()->nNode.GetNode().FindTableNode(); @@ -184,16 +184,16 @@ bool SwUnoTableCrsr::IsSelOvr( int eFlags ) return bRet; } -void SwUnoTableCrsr::MakeBoxSels() +void SwUnoTableCursor::MakeBoxSels() { const SwContentNode* pCNd; - bool bMakeTableCrsrs = true; + bool bMakeTableCursors = true; if( GetPoint()->nNode.GetIndex() && GetMark()->nNode.GetIndex() && - nullptr != ( pCNd = GetContentNode() ) && pCNd->getLayoutFrm( pCNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ) && - nullptr != ( pCNd = GetContentNode(false) ) && pCNd->getLayoutFrm( pCNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ) ) - bMakeTableCrsrs = GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()->MakeTableCrsrs( *this ); + nullptr != ( pCNd = GetContentNode() ) && pCNd->getLayoutFrame( pCNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ) && + nullptr != ( pCNd = GetContentNode(false) ) && pCNd->getLayoutFrame( pCNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ) ) + bMakeTableCursors = GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()->MakeTableCursors( *this ); - if ( !bMakeTableCrsrs ) + if ( !bMakeTableCursors ) { SwSelBoxes const& rTmpBoxes = GetSelectedBoxes(); while (!rTmpBoxes.empty()) diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 8763a8304946..910317c57cb9 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -107,7 +107,7 @@ static SwPaM* lcl_createPamCopy(const SwPaM& rPam) void GetSelectableFromAny(uno::Reference<uno::XInterface> const& xIfc, SwDoc & rTargetDoc, SwPaM *& o_rpPaM, std::pair<OUString, FlyCntType> & o_rFrame, - OUString & o_rTableName, SwUnoTableCrsr const*& o_rpTableCursor, + OUString & o_rTableName, SwUnoTableCursor const*& o_rpTableCursor, ::sw::mark::IMark const*& o_rpMark, std::vector<SdrObject *> & o_rSdrObjects) { @@ -178,10 +178,10 @@ void GetSelectableFromAny(uno::Reference<uno::XInterface> const& xIfc, ::sw::UnoTunnelGetImplementation<SwXTextRanges>(xTunnel)); if (pRanges) { - SwUnoCrsr const* pUnoCrsr = pRanges->GetCursor(); - if (pUnoCrsr && pUnoCrsr->GetDoc() == &rTargetDoc) + SwUnoCursor const* pUnoCursor = pRanges->GetCursor(); + if (pUnoCursor && pUnoCursor->GetDoc() == &rTargetDoc) { - o_rpPaM = lcl_createPamCopy(*pUnoCrsr); + o_rpPaM = lcl_createPamCopy(*pUnoCursor); } return; } @@ -249,12 +249,12 @@ void GetSelectableFromAny(uno::Reference<uno::XInterface> const& xIfc, ::sw::UnoTunnelGetImplementation<SwXCellRange>(xTunnel)); if (pCellRange) { - SwUnoCrsr const*const pUnoCrsr(pCellRange->GetTableCrsr()); - if (pUnoCrsr && pUnoCrsr->GetDoc() == &rTargetDoc) + SwUnoCursor const*const pUnoCursor(pCellRange->GetTableCursor()); + if (pUnoCursor && pUnoCursor->GetDoc() == &rTargetDoc) { // probably can't copy it to o_rpPaM for this since it's // a SwTableCursor - o_rpTableCursor = dynamic_cast<SwUnoTableCrsr const*>(pUnoCrsr); + o_rpTableCursor = dynamic_cast<SwUnoTableCursor const*>(pUnoCursor); } return; } @@ -299,7 +299,7 @@ GetNestedTextContent(SwTextNode & rTextNode, sal_Int32 const nIndex, } // Read the special properties of the cursor -bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry +bool getCursorPropertyValue(const SfxItemPropertySimpleEntry& rEntry , SwPaM& rPam , Any *pAny , PropertyState& eState @@ -897,10 +897,10 @@ void GetCurPageStyle(SwPaM& rPaM, OUString &rString) { if (!rPaM.GetContentNode()) return; // TODO: is there an easy way to get it for tables/sections? - SwContentFrm* pFrame = rPaM.GetContentNode()->getLayoutFrm(rPaM.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()); + SwContentFrame* pFrame = rPaM.GetContentNode()->getLayoutFrame(rPaM.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()); if(pFrame) { - const SwPageFrm* pPage = pFrame->FindPageFrm(); + const SwPageFrame* pPage = pFrame->FindPageFrame(); if(pPage) { SwStyleNameMapper::FillProgName(pPage->GetPageDesc()->GetName(), @@ -910,7 +910,7 @@ void GetCurPageStyle(SwPaM& rPaM, OUString &rString) } // reset special properties of the cursor -void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPam) +void resetCursorPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPam) { SwDoc* pDoc = rPam.GetDoc(); switch(rEntry.nWID) @@ -951,13 +951,13 @@ void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPa } } -void InsertFile(SwUnoCrsr* pUnoCrsr, const OUString& rURL, +void InsertFile(SwUnoCursor* pUnoCursor, const OUString& rURL, const uno::Sequence< beans::PropertyValue >& rOptions) throw (lang::IllegalArgumentException, io::IOException, uno::RuntimeException, std::exception) { std::unique_ptr<SfxMedium> pMed; - SwDoc* pDoc = pUnoCrsr->GetDoc(); + SwDoc* pDoc = pUnoCursor->GetDoc(); SwDocShell* pDocSh = pDoc->GetDocShell(); utl::MediaDescriptor aMediaDescriptor( rOptions ); OUString sFileName = rURL; @@ -1055,30 +1055,30 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, const OUString& rURL, pSet->Put(SfxBoolItem(FN_API_CALL, true)); if(!sPassword.isEmpty()) pSet->Put(SfxStringItem(SID_PASSWORD, sPassword)); - Reader *pRead = pDocSh->StartConvertFrom( *pMed, &pRdr, nullptr, pUnoCrsr); + Reader *pRead = pDocSh->StartConvertFrom( *pMed, &pRdr, nullptr, pUnoCursor); if( pRead ) { UnoActionContext aContext(pDoc); - if(pUnoCrsr->HasMark()) - pDoc->getIDocumentContentOperations().DeleteAndJoin(*pUnoCrsr); + if(pUnoCursor->HasMark()) + pDoc->getIDocumentContentOperations().DeleteAndJoin(*pUnoCursor); - SwNodeIndex aSave( pUnoCrsr->GetPoint()->nNode, -1 ); - sal_Int32 nContent = pUnoCrsr->GetPoint()->nContent.GetIndex(); + SwNodeIndex aSave( pUnoCursor->GetPoint()->nNode, -1 ); + sal_Int32 nContent = pUnoCursor->GetPoint()->nContent.GetIndex(); sal_uInt32 nErrno = pRdr->Read( *pRead ); // and paste the document if(!nErrno) { ++aSave; - pUnoCrsr->SetMark(); - pUnoCrsr->GetMark()->nNode = aSave; + pUnoCursor->SetMark(); + pUnoCursor->GetMark()->nNode = aSave; SwContentNode* pCntNode = aSave.GetNode().GetContentNode(); if( !pCntNode ) nContent = 0; - pUnoCrsr->GetMark()->nContent.Assign( pCntNode, nContent ); + pUnoCursor->GetMark()->nContent.Assign( pCntNode, nContent ); } delete pRdr; diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 171592f3e3e8..165b1525ef7c 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -721,9 +721,9 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) } else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && pDoc->getIDocumentLayoutAccess().GetCurrentLayout()) { - SwCrsrMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( MV_SETONLYTEXT ); Point aTmp(convertMm100ToTwip(aMM100Pos.X), convertMm100ToTwip(aMM100Pos.Y)); - pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetCrsrOfst( pPam->GetPoint(), aTmp, &aState ); + pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetCursorOfst( pPam->GetPoint(), aTmp, &aState ); aAnchor.SetAnchor( pPam->GetPoint() ); // #i32349# - adjustment of vertical positioning @@ -1304,7 +1304,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a RndStdIds eOldAnchorId = rOldAnchor.GetAnchorId(); SdrObject* pObj = pFormat->FindSdrObject(); SwFrameFormat *pFlyFormat = FindFrameFormat( pObj ); - pFlyFormat->DelFrms(); + pFlyFormat->DelFrames(); if( text::TextContentAnchorType_AS_CHARACTER != eNewAnchor && (FLY_AS_CHAR == eOldAnchorId)) { @@ -1337,9 +1337,9 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SwPaM aPam(pDoc->GetNodes().GetEndOfContent()); if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ) { - SwCrsrMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( MV_SETONLYTEXT ); Point aTmp( pObj->GetSnapRect().TopLeft() ); - pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState ); + pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetCursorOfst( aPam.GetPoint(), aTmp, &aState ); } else { @@ -1358,9 +1358,9 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SwPaM aPam(pDoc->GetNodes().GetEndOfContent()); if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ) { - SwCrsrMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( MV_SETONLYTEXT ); Point aTmp( pObj->GetSnapRect().TopLeft() ); - pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState ); + pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetCursorOfst( aPam.GetPoint(), aTmp, &aState ); } else { @@ -1369,7 +1369,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a } //the RES_TXTATR_FLYCNT needs to be added now SwTextNode *pNd = aPam.GetNode().GetTextNode(); - SAL_WARN_IF( !pNd, "sw.uno", "Crsr is not in a TextNode." ); + SAL_WARN_IF( !pNd, "sw.uno", "Cursor is not in a TextNode." ); SwFormatFlyCnt aFormat( pFlyFormat ); pNd->InsertItem(aFormat, aPam.GetPoint()->nContent.GetIndex(), 0 ); diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 0688b392753a..bf288eb39a31 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -392,9 +392,9 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara() { SwViewShell* pViewShell = mpDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); - SwPageFrm* pCurrentPage = pViewShell ? pViewShell->Imp()->GetFirstVisPage(pViewShell->GetOut()) : nullptr; - SwPageFrm* pStartPage = pCurrentPage; - SwPageFrm* pStopPage = nullptr; + SwPageFrame* pCurrentPage = pViewShell ? pViewShell->Imp()->GetFirstVisPage(pViewShell->GetOut()) : nullptr; + SwPageFrame* pStartPage = pCurrentPage; + SwPageFrame* pStopPage = nullptr; while ( pCurrentPage && pCurrentPage != pStopPage ) { @@ -406,7 +406,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara() return xRet; // search for invalid content: - SwContentFrm* pCnt = pCurrentPage->ContainsContent(); + SwContentFrame* pCnt = pCurrentPage->ContainsContent(); while( pCnt && pCurrentPage->IsAnLower( pCnt ) ) { @@ -422,7 +422,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara() break; } - pCnt = pCnt->GetNextContentFrm(); + pCnt = pCnt->GetNextContentFrame(); } } @@ -434,12 +434,12 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara() pCurrentPage->ValidateSpelling(); // proceed with next page, wrap at end of document if required: - pCurrentPage = static_cast<SwPageFrm*>(pCurrentPage->GetNext()); + pCurrentPage = static_cast<SwPageFrame*>(pCurrentPage->GetNext()); if ( !pCurrentPage && !pStopPage ) { pStopPage = pStartPage; - pCurrentPage = static_cast<SwPageFrm*>(pViewShell->GetLayout()->Lower()); + pCurrentPage = static_cast<SwPageFrame*>(pViewShell->GetLayout()->Lower()); } } } diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 4b3a8edeb7d3..ba315f55e6ce 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -160,7 +160,7 @@ public: bool GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& pAny ); bool FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet &rFromSet, bool& rSizeFound); - virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound) = 0; + virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) = 0; }; BaseFrameProperties_Impl::~BaseFrameProperties_Impl() @@ -857,46 +857,46 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI pWidthType ||pSyncWidth || pSyncHeight ) { rSizeFound = true; - SwFormatFrmSize aFrmSz ( static_cast < const ::SwFormatFrmSize& > ( rFromSet.Get ( RES_FRM_SIZE ) ) ); + SwFormatFrameSize aFrameSz ( static_cast < const ::SwFormatFrameSize& > ( rFromSet.Get ( RES_FRM_SIZE ) ) ); if(pWidth) - bRet &= ((SfxPoolItem&)aFrmSz).PutValue(*pWidth, MID_FRMSIZE_WIDTH|CONVERT_TWIPS); + bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pWidth, MID_FRMSIZE_WIDTH|CONVERT_TWIPS); if(pHeight) - bRet &= ((SfxPoolItem&)aFrmSz).PutValue(*pHeight, MID_FRMSIZE_HEIGHT|CONVERT_TWIPS); + bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pHeight, MID_FRMSIZE_HEIGHT|CONVERT_TWIPS); if(pRelH ) - bRet &= ((SfxPoolItem&)aFrmSz).PutValue(*pRelH, MID_FRMSIZE_REL_HEIGHT); + bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pRelH, MID_FRMSIZE_REL_HEIGHT); if (pRelHRelation) - bRet &= const_cast<SwFormatFrmSize&>(aFrmSz).PutValue(*pRelHRelation, MID_FRMSIZE_REL_HEIGHT_RELATION); + bRet &= const_cast<SwFormatFrameSize&>(aFrameSz).PutValue(*pRelHRelation, MID_FRMSIZE_REL_HEIGHT_RELATION); if(pRelW ) - bRet &= ((SfxPoolItem&)aFrmSz).PutValue(*pRelW, MID_FRMSIZE_REL_WIDTH); + bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pRelW, MID_FRMSIZE_REL_WIDTH); if (pRelWRelation) - bRet &= const_cast<SwFormatFrmSize&>(aFrmSz).PutValue(*pRelWRelation, MID_FRMSIZE_REL_WIDTH_RELATION); + bRet &= const_cast<SwFormatFrameSize&>(aFrameSz).PutValue(*pRelWRelation, MID_FRMSIZE_REL_WIDTH_RELATION); if(pSyncWidth) - bRet &= ((SfxPoolItem&)aFrmSz).PutValue(*pSyncWidth, MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT); + bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pSyncWidth, MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT); if(pSyncHeight) - bRet &= ((SfxPoolItem&)aFrmSz).PutValue(*pSyncHeight, MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH); + bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pSyncHeight, MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH); if(pSize) - bRet &= ((SfxPoolItem&)aFrmSz).PutValue(*pSize, MID_FRMSIZE_SIZE|CONVERT_TWIPS); + bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pSize, MID_FRMSIZE_SIZE|CONVERT_TWIPS); if(pSizeType) - bRet &= ((SfxPoolItem&)aFrmSz).PutValue(*pSizeType, MID_FRMSIZE_SIZE_TYPE); + bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pSizeType, MID_FRMSIZE_SIZE_TYPE); if(pWidthType) - bRet &= ((SfxPoolItem&)aFrmSz).PutValue(*pWidthType, MID_FRMSIZE_WIDTH_TYPE); - if(!aFrmSz.GetWidth()) - aFrmSz.SetWidth(MINFLY); - if(!aFrmSz.GetHeight()) - aFrmSz.SetHeight(MINFLY); - rToSet.Put(aFrmSz); + bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pWidthType, MID_FRMSIZE_WIDTH_TYPE); + if(!aFrameSz.GetWidth()) + aFrameSz.SetWidth(MINFLY); + if(!aFrameSz.GetHeight()) + aFrameSz.SetHeight(MINFLY); + rToSet.Put(aFrameSz); } else { rSizeFound = false; - SwFormatFrmSize aFrmSz; + SwFormatFrameSize aFrameSz; awt::Size aSize; aSize.Width = 2 * MM50; aSize.Height = 2 * MM50; ::uno::Any aSizeVal; aSizeVal <<= aSize; - ((SfxPoolItem&)aFrmSz).PutValue(aSizeVal, MID_FRMSIZE_SIZE|CONVERT_TWIPS); - rToSet.Put(aFrmSz); + ((SfxPoolItem&)aFrameSz).PutValue(aSizeVal, MID_FRMSIZE_SIZE|CONVERT_TWIPS); + rToSet.Put(aFrameSz); } } const ::uno::Any* pFrameDirection = nullptr; @@ -956,7 +956,7 @@ public: SwFrameProperties_Impl(); virtual ~SwFrameProperties_Impl(){} - bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound) override; + bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) override; }; SwFrameProperties_Impl::SwFrameProperties_Impl(): @@ -1021,7 +1021,7 @@ public: SwGraphicProperties_Impl(); virtual ~SwGraphicProperties_Impl(){} - virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound) override; + virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) override; }; SwGraphicProperties_Impl::SwGraphicProperties_Impl( ) : @@ -1046,7 +1046,7 @@ static inline void lcl_FillMirror ( SfxItemSet &rToSet, const ::SfxItemSet &rFro bool SwGraphicProperties_Impl::AnyToItemSet( SwDoc* pDoc, - SfxItemSet& rFrmSet, + SfxItemSet& rFrameSet, SfxItemSet& rGrSet, bool& rSizeFound) { @@ -1075,13 +1075,13 @@ bool SwGraphicProperties_Impl::AnyToItemSet( { rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet(*pStyle) ); const ::SfxItemSet *pItemSet = &xStyle->GetItemSet(); - bRet = FillBaseProperties(rFrmSet, *pItemSet, rSizeFound); + bRet = FillBaseProperties(rFrameSet, *pItemSet, rSizeFound); lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet ); } else { const ::SfxItemSet *pItemSet = &pDoc->getIDocumentStylePoolAccess().GetFrameFormatFromPool( RES_POOLFRM_GRAPHIC )->GetAttrSet(); - bRet = FillBaseProperties(rFrmSet, *pItemSet, rSizeFound); + bRet = FillBaseProperties(rFrameSet, *pItemSet, rSizeFound); lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet ); } @@ -1123,17 +1123,17 @@ public: SwFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_EMBEDDED_OBJECT)*/ ){} virtual ~SwOLEProperties_Impl(){} - virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound) override; + virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) override; }; bool SwOLEProperties_Impl::AnyToItemSet( - SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound) + SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) { const ::uno::Any* pTemp; if(!GetProperty(FN_UNO_CLSID, 0, pTemp) && !GetProperty(FN_UNO_STREAM_NAME, 0, pTemp) && !GetProperty(FN_EMBEDDED_OBJECT, 0, pTemp) ) return false; - SwFrameProperties_Impl::AnyToItemSet( pDoc, rFrmSet, rSet, rSizeFound); + SwFrameProperties_Impl::AnyToItemSet( pDoc, rFrameSet, rSet, rSizeFound); return true; } @@ -1325,15 +1325,15 @@ void SwXFrame::setName(const OUString& rName) throw( uno::RuntimeException, std: uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo() throw( uno::RuntimeException, std::exception ) { uno::Reference< beans::XPropertySetInfo > xRef; - static uno::Reference< beans::XPropertySetInfo > xFrmRef; + static uno::Reference< beans::XPropertySetInfo > xFrameRef; static uno::Reference< beans::XPropertySetInfo > xGrfRef; static uno::Reference< beans::XPropertySetInfo > xOLERef; switch(eType) { case FLYCNTTYPE_FRM: - if( !xFrmRef.is() ) - xFrmRef = m_pPropSet->getPropertySetInfo(); - xRef = xFrmRef; + if( !xFrameRef.is() ) + xFrameRef = m_pPropSet->getPropertySetInfo(); + xRef = xFrameRef; break; case FLYCNTTYPE_GRF: if( !xGrfRef.is() ) @@ -1524,7 +1524,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& aValue >>= sTitle; // assure that <SdrObject> instance exists. GetOrCreateSdrObject(rFlyFormat); - rFlyFormat.GetDoc()->SetFlyFrmTitle(rFlyFormat, sTitle); + rFlyFormat.GetDoc()->SetFlyFrameTitle(rFlyFormat, sTitle); } // New attribute Description else if( FN_UNO_DESCRIPTION == pEntry->nWID ) @@ -1534,7 +1534,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& aValue >>= sDescription; // assure that <SdrObject> instance exists. GetOrCreateSdrObject(rFlyFormat); - rFlyFormat.GetDoc()->SetFlyFrmDescription(rFlyFormat, sDescription); + rFlyFormat.GetDoc()->SetFlyFrameDescription(rFlyFormat, sDescription); } else if(FN_UNO_FRAME_STYLE_NAME == pEntry->nWID) { @@ -1550,11 +1550,11 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& if ( !pFormat->GetDoc()->IsInReading() ) { // see SwFEShell::SetFrameFormat( SwFrameFormat *pNewFormat, bool bKeepOrient, Point* pDocPos ) - SwFlyFrm *pFly = nullptr; + SwFlyFrame *pFly = nullptr; { const SwFrameFormat* pFormatXX = pFormat; if (dynamic_cast<const SwFlyFrameFormat*>( pFormatXX) ) - pFly = static_cast<const SwFlyFrameFormat*>(pFormatXX)->GetFrm(); + pFly = static_cast<const SwFlyFrameFormat*>(pFormatXX)->GetFrame(); } if ( pFly ) { @@ -1777,7 +1777,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& aAnchor.SetAnchor(&aPos); aAnchor.SetType(FLY_AT_FLY); aSet.Put(aAnchor); - pDoc->SetFlyFrmAttr( *pFormat, aSet ); + pDoc->SetFlyFrameAttr( *pFormat, aSet ); bDone = true; } } @@ -1811,7 +1811,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& if(!(aChangedBrushItem == aOriginalBrushItem)) { setSvxBrushItemAsFillAttributesToTargetSet(aChangedBrushItem, aSet); - pFormat->GetDoc()->SetFlyFrmAttr( *pFormat, aSet ); + pFormat->GetDoc()->SetFlyFrameAttr( *pFormat, aSet ); } bDone = true; @@ -1835,7 +1835,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& aSet.Put(XFillBmpStretchItem(drawing::BitmapMode_STRETCH == eMode)); aSet.Put(XFillBmpTileItem(drawing::BitmapMode_REPEAT == eMode)); - pFormat->GetDoc()->SetFlyFrmAttr( *pFormat, aSet ); + pFormat->GetDoc()->SetFlyFrameAttr( *pFormat, aSet ); bDone = true; } @@ -1938,10 +1938,10 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& // if document is currently in reading mode. if ( !pFormat->GetDoc()->IsInReading() ) { - // see SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet ) - SwFlyFrm *pFly = nullptr; + // see SwFEShell::SetFlyFrameAttr( SfxItemSet& rSet ) + SwFlyFrame *pFly = nullptr; if (dynamic_cast<SwFlyFrameFormat*>( pFormat) ) - pFly = static_cast<SwFlyFrameFormat*>(pFormat)->GetFrm(); + pFly = static_cast<SwFlyFrameFormat*>(pFormat)->GetFrame(); if (pFly) { const ::SfxPoolItem* pItem; @@ -1956,7 +1956,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& } } - pFormat->GetDoc()->SetFlyFrmAttr( *pFormat, aSet ); + pFormat->GetDoc()->SetFlyFrameAttr( *pFormat, aSet ); } else if(FN_UNO_CLSID == pEntry->nWID || FN_UNO_STREAM_NAME == pEntry->nWID || FN_EMBEDDED_OBJECT == pEntry->nWID) { @@ -2237,11 +2237,11 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) // format document completely in order to get correct value pFormat->GetDoc()->GetEditShell()->CalcLayout(); - SwFrm* pTmpFrm = SwIterator<SwFrm,SwFormat>( *pFormat ).First(); - if ( pTmpFrm ) + SwFrame* pTmpFrame = SwIterator<SwFrame,SwFormat>( *pFormat ).First(); + if ( pTmpFrame ) { - OSL_ENSURE( pTmpFrm->IsValid(), "frame not valid" ); - const SwRect &rRect = pTmpFrm->Frm(); + OSL_ENSURE( pTmpFrame->IsValid(), "frame not valid" ); + const SwRect &rRect = pTmpFrame->Frame(); Size aMM100Size = OutputDevice::LogicToLogic( Size( rRect.Width(), rRect.Height() ), MapMode( MAP_TWIP ), MapMode( MAP_100TH_MM )); @@ -2527,7 +2527,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) SwFlyFrameFormat& rFlyFormat = dynamic_cast<SwFlyFrameFormat&>(*pFormat); // assure that <SdrObject> instance exists. GetOrCreateSdrObject(rFlyFormat); - rFlyFormat.GetDoc()->SetFlyFrmTitle(rFlyFormat, aEmptyOUStr); + rFlyFormat.GetDoc()->SetFlyFrameTitle(rFlyFormat, aEmptyOUStr); } // New attribute Description else if( FN_UNO_DESCRIPTION == pEntry->nWID ) @@ -2535,7 +2535,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) SwFlyFrameFormat& rFlyFormat = dynamic_cast<SwFlyFrameFormat&>(*pFormat); // assure that <SdrObject> instance exists. GetOrCreateSdrObject(rFlyFormat); - rFlyFormat.GetDoc()->SetFlyFrmDescription(rFlyFormat, aEmptyOUStr); + rFlyFormat.GetDoc()->SetFlyFrameDescription(rFlyFormat, aEmptyOUStr); } else { @@ -2718,7 +2718,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan SwNode& rNode = pDoc->GetNodes().GetEndOfContent(); SwPaM aPam(rNode); aPam.Move( fnMoveBackward, fnGoDoc ); - static sal_uInt16 const aFrmAttrRange[] = + static sal_uInt16 const aFrameAttrRange[] = { RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, @@ -2736,14 +2736,14 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan }; SfxItemSet aGrSet(pDoc->GetAttrPool(), aGrAttrRange ); - SfxItemSet aFrmSet(pDoc->GetAttrPool(), aFrmAttrRange ); + SfxItemSet aFrameSet(pDoc->GetAttrPool(), aFrameAttrRange ); //UUUU set correct parent to get the XFILL_NONE FillStyle as needed - aFrmSet.SetParent(&pDoc->GetDfltFrameFormat()->GetAttrSet()); + aFrameSet.SetParent(&pDoc->GetDfltFrameFormat()->GetAttrSet()); // no the related items need to be added to the set bool bSizeFound; - if(!pProps->AnyToItemSet( pDoc, aFrmSet, aGrSet, bSizeFound)) + if(!pProps->AnyToItemSet( pDoc, aFrameSet, aGrSet, bSizeFound)) throw lang::IllegalArgumentException(); // a TextRange is handled separately *aPam.GetPoint() = *aIntPam.GetPoint(); @@ -2755,7 +2755,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan const SfxPoolItem* pItem; RndStdIds eAnchorId = FLY_AT_PARA; - if(SfxItemState::SET == aFrmSet.GetItemState(RES_ANCHOR, false, &pItem) ) + if(SfxItemState::SET == aFrameSet.GetItemState(RES_ANCHOR, false, &pItem) ) { eAnchorId = static_cast<const SwFormatAnchor*>(pItem)->GetAnchorId(); if( FLY_AT_FLY == eAnchorId && @@ -2763,14 +2763,14 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan { // framebound only where a frame exists SwFormatAnchor aAnchor(FLY_AT_PARA); - aFrmSet.Put(aAnchor); + aFrameSet.Put(aAnchor); } else if ((FLY_AT_PAGE == eAnchorId) && 0 == static_cast<const SwFormatAnchor*>(pItem)->GetPageNum() ) { SwFormatAnchor aAnchor( *static_cast<const SwFormatAnchor*>(pItem) ); aAnchor.SetAnchor( aPam.GetPoint() ); - aFrmSet.Put(aAnchor); + aFrameSet.Put(aAnchor); } } @@ -2790,22 +2790,22 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan // to prevent conflicts if the to-be-anchored position is part of the to-be-copied text if (eAnchorId != FLY_AT_PAGE) { - pAnchorItem = static_cast<SwFormatAnchor*>(aFrmSet.Get(RES_ANCHOR).Clone()); - aFrmSet.Put( SwFormatAnchor( FLY_AT_PAGE, 1 )); + pAnchorItem = static_cast<SwFormatAnchor*>(aFrameSet.Get(RES_ANCHOR).Clone()); + aFrameSet.Put( SwFormatAnchor( FLY_AT_PAGE, 1 )); } aPam.DeleteMark(); // mark position node will be deleted! aIntPam.DeleteMark(); // mark position node will be deleted! - pFormat = pDoc->MakeFlyAndMove( *m_pCopySource, aFrmSet, + pFormat = pDoc->MakeFlyAndMove( *m_pCopySource, aFrameSet, nullptr, pParentFrameFormat ); if(pAnchorItem && pFormat) { - pFormat->DelFrms(); + pFormat->DelFrames(); pAnchorItem->SetAnchor( m_pCopySource->Start() ); SfxItemSet aAnchorSet( pDoc->GetAttrPool(), RES_ANCHOR, RES_ANCHOR ); aAnchorSet.Put( *pAnchorItem ); - pDoc->SetFlyFrmAttr( *pFormat, aAnchorSet ); + pDoc->SetFlyFrameAttr( *pFormat, aAnchorSet ); delete pAnchorItem; } DELETEZ( m_pCopySource ); @@ -2813,7 +2813,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan else { pFormat = pDoc->MakeFlySection( FLY_AT_PARA, aPam.GetPoint(), - &aFrmSet, pParentFrameFormat ); + &aFrameSet, pParentFrameFormat ); } if(pFormat) { @@ -2865,10 +2865,10 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan } pFormat = - pGrfObj ? pDoc->getIDocumentContentOperations().Insert( aPam, *pGrfObj, &aFrmSet, &aGrSet, + pGrfObj ? pDoc->getIDocumentContentOperations().Insert( aPam, *pGrfObj, &aFrameSet, &aGrSet, pParentFrameFormat ) : pDoc->getIDocumentContentOperations().Insert( aPam, sGraphicURL, sFltName, &aGraphic, - &aFrmSet, &aGrSet, pParentFrameFormat ); + &aFrameSet, &aGrSet, pParentFrameFormat ); delete pGrfObj; if(pFormat) { @@ -2963,16 +2963,16 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan } MapMode aMyMap( MAP_TWIP ); aSz = OutputDevice::LogicToLogic( aSz, aRefMap, aMyMap ); - SwFormatFrmSize aFrmSz; - aFrmSz.SetSize(aSz); - aFrmSet.Put(aFrmSz); + SwFormatFrameSize aFrameSz; + aFrameSz.SetSize(aSz); + aFrameSet.Put(aFrameSz); } SwFlyFrameFormat* pFormat2 = nullptr; // TODO/LATER: Is it the only possible aspect here? sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT; ::svt::EmbeddedObjectRef xObjRef( xIPObj, nAspect ); - pFormat2 = pDoc->getIDocumentContentOperations().Insert(aPam, xObjRef, &aFrmSet, nullptr, nullptr ); + pFormat2 = pDoc->getIDocumentContentOperations().Insert(aPam, xObjRef, &aFrameSet, nullptr, nullptr ); assert(pFormat2 && "Doc->Insert(notxt) failed."); pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, nullptr); @@ -2988,7 +2988,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, nullptr); SwFlyFrameFormat* pFrameFormat = nullptr; - pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( aPam, sStreamName, embed::Aspects::MSOLE_CONTENT, &aFrmSet, nullptr, nullptr ); + pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( aPam, sStreamName, embed::Aspects::MSOLE_CONTENT, &aFrameSet, nullptr, nullptr ); pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, nullptr); pFrameFormat->Add(this); if(!m_sName.isEmpty()) @@ -3014,7 +3014,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan mrPers.GetEmbeddedObjectContainer().InsertEmbeddedObject( obj, rName ); SwFlyFrameFormat* pFrameFormat = nullptr; - pFrameFormat = pDoc->getIDocumentContentOperations().Insert( aPam, xObj, &aFrmSet, nullptr, nullptr ); + pFrameFormat = pDoc->getIDocumentContentOperations().Insert( aPam, xObj, &aFrameSet, nullptr, nullptr ); pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, nullptr); pFrameFormat->Add(this); if(!m_sName.isEmpty()) @@ -3073,7 +3073,7 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aSet.Get(RES_ANCHOR)); aAnchor.SetAnchor( aIntPam.Start() ); aSet.Put(aAnchor); - pDoc->SetFlyFrmAttr( *pFormat, aSet ); + pDoc->SetFlyFrameAttr( *pFormat, aSet ); } else throw lang::IllegalArgumentException(); @@ -3286,7 +3286,7 @@ uno::Reference< container::XEnumeration > SwXTextFrame::createEnumeration() thr if(!pFormat) return nullptr; SwPosition aPos(pFormat->GetContent().GetContentIdx()->GetNode()); - auto pUnoCursor(GetDoc()->CreateUnoCrsr(aPos)); + auto pUnoCursor(GetDoc()->CreateUnoCursor(aPos)); pUnoCursor->Move(fnMoveForward, fnGoNode); return SwXParagraphEnumeration::Create(this, pUnoCursor, CURSOR_FRAME); } diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 640efc8cae9a..f805fc50f58f 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -436,8 +436,8 @@ SwXFootnote::createTextCursor() throw (uno::RuntimeException, std::exception) SwPosition aPos( *pTextFootnote->GetStartNode() ); SwXTextCursor *const pXCursor = new SwXTextCursor(*GetDoc(), this, CURSOR_FOOTNOTE, aPos); - auto& rUnoCrsr(pXCursor->GetCursor()); - rUnoCrsr.Move(fnMoveForward, fnGoNode); + auto& rUnoCursor(pXCursor->GetCursor()); + rUnoCursor.Move(fnMoveForward, fnGoNode); const uno::Reference< text::XTextCursor > xRet = static_cast<text::XWordCursor*>(pXCursor); return xRet; @@ -483,7 +483,7 @@ SwXFootnote::createEnumeration() throw (uno::RuntimeException, std::exception) SwTextFootnote const*const pTextFootnote = rFormat.GetTextFootnote(); SwPosition aPos( *pTextFootnote->GetStartNode() ); - auto pUnoCursor(GetDoc()->CreateUnoCrsr(aPos)); + auto pUnoCursor(GetDoc()->CreateUnoCursor(aPos)); pUnoCursor->Move(fnMoveForward, fnGoNode); return SwXParagraphEnumeration::Create(this, pUnoCursor, CURSOR_FOOTNOTE); } diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index e71a2fc1fa25..b3d00eec2861 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -282,11 +282,11 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SwTextFormatColl *const pLocal = pStyle->GetCollection(); UnoActionContext aAction(pDoc); pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); - SwPaM *pTmpCrsr = &rPaM; + SwPaM *pTmpCursor = &rPaM; do { - pDoc->SetTextFormatColl(*pTmpCrsr, pLocal); - pTmpCrsr = static_cast<SwPaM*>(pTmpCrsr->GetNext()); - } while ( pTmpCrsr != &rPaM ); + pDoc->SetTextFormatColl(*pTmpCursor, pLocal); + pTmpCursor = static_cast<SwPaM*>(pTmpCursor->GetNext()); + } while ( pTmpCursor != &rPaM ); pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr ); } @@ -341,19 +341,19 @@ SwUnoCursorHelper::SetPageDesc( } static void -lcl_SetNodeNumStart(SwPaM & rCrsr, uno::Any const& rValue) +lcl_SetNodeNumStart(SwPaM & rCursor, uno::Any const& rValue) { sal_Int16 nTmp = 1; rValue >>= nTmp; sal_uInt16 nStt = (nTmp < 0 ? USHRT_MAX : (sal_uInt16)nTmp); - SwDoc* pDoc = rCrsr.GetDoc(); + SwDoc* pDoc = rCursor.GetDoc(); UnoActionContext aAction(pDoc); - if( rCrsr.GetNext() != &rCrsr ) // MultiSelection? + if( rCursor.GetNext() != &rCursor ) // MultiSelection? { pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); - SwPamRanges aRangeArr( rCrsr ); - SwPaM aPam( *rCrsr.GetPoint() ); + SwPamRanges aRangeArr( rCursor ); + SwPaM aPam( *rCursor.GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) { pDoc->SetNumRuleStart(*aRangeArr.SetPam( n, aPam ).GetPoint()); @@ -364,8 +364,8 @@ lcl_SetNodeNumStart(SwPaM & rCrsr, uno::Any const& rValue) } else { - pDoc->SetNumRuleStart( *rCrsr.GetPoint()); - pDoc->SetNodeNumStart( *rCrsr.GetPoint(), nStt ); + pDoc->SetNumRuleStart( *rCursor.GetPoint()); + pDoc->SetNodeNumStart( *rCursor.GetPoint(), nStt ); } } @@ -389,7 +389,7 @@ lcl_setCharFormatSequence(SwPaM & rPam, uno::Any const& rValue) lcl_setCharStyle(rPam.GetDoc(), aStyle, aSet); // the first style should replace the current attributes, // all other have to be added - SwUnoCursorHelper::SetCrsrAttr(rPam, aSet, (nStyle) + SwUnoCursorHelper::SetCursorAttr(rPam, aSet, (nStyle) ? SetAttrMode::DONTREPLACE : SetAttrMode::DEFAULT); rPam.GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_START, nullptr); @@ -617,11 +617,11 @@ SwUnoCursorHelper::GetCurTextFormatColl(SwPaM & rPaM, const bool bConditional) static const sal_uLong nMaxLookup = 1000; SwFormatColl *pFormat = nullptr; bool bError = false; - SwPaM *pTmpCrsr = &rPaM; + SwPaM *pTmpCursor = &rPaM; do { - const sal_uLong nSttNd = pTmpCrsr->Start()->nNode.GetIndex(); - const sal_uLong nEndNd = pTmpCrsr->End()->nNode.GetIndex(); + const sal_uLong nSttNd = pTmpCursor->Start()->nNode.GetIndex(); + const sal_uLong nEndNd = pTmpCursor->End()->nNode.GetIndex(); if( nEndNd - nSttNd >= nMaxLookup ) { @@ -649,8 +649,8 @@ SwUnoCursorHelper::GetCurTextFormatColl(SwPaM & rPaM, const bool bConditional) } } - pTmpCrsr = static_cast<SwPaM*>(pTmpCrsr->GetNext()); - } while ( pTmpCrsr != &rPaM ); + pTmpCursor = static_cast<SwPaM*>(pTmpCursor->GetNext()); + } while ( pTmpCursor != &rPaM ); return (bError) ? nullptr : pFormat; } @@ -670,7 +670,7 @@ public: : m_rPropSet(*aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)) , m_eType(eType) , m_xParentText(xParent) - , m_pUnoCursor(rDoc.CreateUnoCrsr(rPoint), true) + , m_pUnoCursor(rDoc.CreateUnoCursor(rPoint), true) { if (pMark) { @@ -679,14 +679,14 @@ public: } } - SwUnoCrsr& GetCursorOrThrow() { + SwUnoCursor& GetCursorOrThrow() { if(!m_pUnoCursor) throw uno::RuntimeException("SwXTextCursor: disposed or invalid", nullptr); return *m_pUnoCursor; } }; -SwUnoCrsr& SwXTextCursor::GetCursor() +SwUnoCursor& SwXTextCursor::GetCursor() { return *m_pImpl->m_pUnoCursor; } SwPaM const* SwXTextCursor::GetPaM() const @@ -726,15 +726,15 @@ SwXTextCursor::~SwXTextCursor() void SwXTextCursor::DeleteAndInsert(const OUString& rText, const bool bForceExpandHints) { - auto pUnoCrsr = static_cast<SwCursor*>(&(*m_pImpl->m_pUnoCursor)); - if(pUnoCrsr) + auto pUnoCursor = static_cast<SwCursor*>(&(*m_pImpl->m_pUnoCursor)); + if(pUnoCursor) { // Start/EndAction - SwDoc* pDoc = pUnoCrsr->GetDoc(); + SwDoc* pDoc = pUnoCursor->GetDoc(); UnoActionContext aAction(pDoc); const sal_Int32 nTextLen = rText.getLength(); pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, nullptr); - auto pCurrent = static_cast<SwCursor*>(pUnoCrsr); + auto pCurrent = static_cast<SwCursor*>(pUnoCursor); do { if (pCurrent->HasMark()) @@ -749,12 +749,12 @@ void SwXTextCursor::DeleteAndInsert(const OUString& rText, OSL_ENSURE( bSuccess, "Doc->Insert(Str) failed." ); (void) bSuccess; - SwUnoCursorHelper::SelectPam(*pUnoCrsr, true); + SwUnoCursorHelper::SelectPam(*pUnoCursor, true); pCurrent->Left(rText.getLength(), CRSR_SKIP_CHARS, false, false); } pCurrent = static_cast<SwCursor*>(pCurrent->GetNext()); - } while (pCurrent != pUnoCrsr); + } while (pCurrent != pUnoCursor); pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, nullptr); } } @@ -890,7 +890,7 @@ void SAL_CALL SwXTextCursor::collapseToStart() throw (uno::RuntimeException, std { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); if (rUnoCursor.HasMark()) { @@ -906,7 +906,7 @@ void SAL_CALL SwXTextCursor::collapseToEnd() throw (uno::RuntimeException, std:: { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); if (rUnoCursor.HasMark()) { @@ -923,10 +923,10 @@ sal_Bool SAL_CALL SwXTextCursor::isCollapsed() throw (uno::RuntimeException, std SolarMutexGuard aGuard; bool bRet = true; - auto pUnoCrsr(m_pImpl->m_pUnoCursor); - if(pUnoCrsr && pUnoCrsr->GetMark()) + auto pUnoCursor(m_pImpl->m_pUnoCursor); + if(pUnoCursor && pUnoCursor->GetMark()) { - bRet = (*pUnoCrsr->GetPoint() == *pUnoCrsr->GetMark()); + bRet = (*pUnoCursor->GetPoint() == *pUnoCursor->GetMark()); } return bRet; } @@ -937,7 +937,7 @@ throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); bool bRet = rUnoCursor.Left( nCount, CRSR_SKIP_CHARS, false, false); @@ -956,7 +956,7 @@ throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); bool bRet = rUnoCursor.Right(nCount, CRSR_SKIP_CHARS, false, false); @@ -974,7 +974,7 @@ SwXTextCursor::gotoStart(sal_Bool Expand) throw (uno::RuntimeException, std::exc { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); if (CURSOR_BODY == m_pImpl->m_eType) @@ -1030,7 +1030,7 @@ SwXTextCursor::gotoEnd(sal_Bool Expand) throw (uno::RuntimeException, std::excep { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); if (CURSOR_BODY == m_pImpl->m_eType) @@ -1064,7 +1064,7 @@ throw (uno::RuntimeException, std::exception) throw uno::RuntimeException(); } - SwUnoCrsr & rOwnCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rOwnCursor( m_pImpl->GetCursorOrThrow() ); uno::Reference<lang::XUnoTunnel> xRangeTunnel( xRange, uno::UNO_QUERY); SwXTextRange* pRange = nullptr; @@ -1202,7 +1202,7 @@ sal_Bool SAL_CALL SwXTextCursor::isStartOfWord() throw (uno::RuntimeException, s { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); const bool bRet = rUnoCursor.IsStartWordWT( i18n::WordType::DICTIONARY_WORD ); @@ -1213,7 +1213,7 @@ sal_Bool SAL_CALL SwXTextCursor::isEndOfWord() throw (uno::RuntimeException, std { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); const bool bRet = rUnoCursor.IsEndWordWT( i18n::WordType::DICTIONARY_WORD ); @@ -1225,7 +1225,7 @@ SwXTextCursor::gotoNextWord(sal_Bool Expand) throw (uno::RuntimeException, std:: { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); // problems arise when a paragraph starts with something other than a word bool bRet = false; @@ -1272,7 +1272,7 @@ SwXTextCursor::gotoPreviousWord(sal_Bool Expand) throw (uno::RuntimeException, s { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); // white spaces create problems on the paragraph start bool bRet = false; @@ -1312,7 +1312,7 @@ SwXTextCursor::gotoEndOfWord(sal_Bool Expand) throw (uno::RuntimeException, std: { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); bool bRet = false; SwPosition *const pPoint = rUnoCursor.GetPoint(); @@ -1348,7 +1348,7 @@ SwXTextCursor::gotoStartOfWord(sal_Bool Expand) throw (uno::RuntimeException, st { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); bool bRet = false; SwPosition *const pPoint = rUnoCursor.GetPoint(); @@ -1384,7 +1384,7 @@ SwXTextCursor::isStartOfSentence() throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); // start of paragraph? bool bRet = rUnoCursor.GetPoint()->nContent == 0; @@ -1394,10 +1394,10 @@ SwXTextCursor::isStartOfSentence() throw (uno::RuntimeException, std::exception) if (!bRet && (!rUnoCursor.HasMark() || *rUnoCursor.GetPoint() == *rUnoCursor.GetMark())) { - SwCursor aCrsr(*rUnoCursor.GetPoint(),nullptr,false); - SwPosition aOrigPos = *aCrsr.GetPoint(); - aCrsr.GoSentence(SwCursor::START_SENT ); - bRet = aOrigPos == *aCrsr.GetPoint(); + SwCursor aCursor(*rUnoCursor.GetPoint(),nullptr,false); + SwPosition aOrigPos = *aCursor.GetPoint(); + aCursor.GoSentence(SwCursor::START_SENT ); + bRet = aOrigPos == *aCursor.GetPoint(); } return bRet; } @@ -1407,7 +1407,7 @@ SwXTextCursor::isEndOfSentence() throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); // end of paragraph? bool bRet = rUnoCursor.GetContentNode() && @@ -1418,10 +1418,10 @@ SwXTextCursor::isEndOfSentence() throw (uno::RuntimeException, std::exception) if (!bRet && (!rUnoCursor.HasMark() || *rUnoCursor.GetPoint() == *rUnoCursor.GetMark())) { - SwCursor aCrsr(*rUnoCursor.GetPoint(), nullptr, false); - SwPosition aOrigPos = *aCrsr.GetPoint(); - aCrsr.GoSentence(SwCursor::END_SENT); - bRet = aOrigPos == *aCrsr.GetPoint(); + SwCursor aCursor(*rUnoCursor.GetPoint(), nullptr, false); + SwPosition aOrigPos = *aCursor.GetPoint(); + aCursor.GoSentence(SwCursor::END_SENT); + bRet = aOrigPos == *aCursor.GetPoint(); } return bRet; } @@ -1431,7 +1431,7 @@ SwXTextCursor::gotoNextSentence(sal_Bool Expand) throw (uno::RuntimeException, s { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); const bool bWasEOS = isEndOfSentence(); SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); @@ -1467,7 +1467,7 @@ throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); bool bRet = rUnoCursor.GoSentence(SwCursor::PREV_SENT); @@ -1496,7 +1496,7 @@ throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); // if we're at the para start then we wont move @@ -1519,7 +1519,7 @@ SwXTextCursor::gotoEndOfSentence(sal_Bool Expand) throw (uno::RuntimeException, { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); // bRet is true if GoSentence() succeeded or if the @@ -1543,7 +1543,7 @@ SwXTextCursor::isStartOfParagraph() throw (uno::RuntimeException, std::exception { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); const bool bRet = SwUnoCursorHelper::IsStartOfPara(rUnoCursor); return bRet; @@ -1554,7 +1554,7 @@ SwXTextCursor::isEndOfParagraph() throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); const bool bRet = SwUnoCursorHelper::IsEndOfPara(rUnoCursor); return bRet; @@ -1566,7 +1566,7 @@ throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); if (CURSOR_META == m_pImpl->m_eType) { @@ -1591,7 +1591,7 @@ SwXTextCursor::gotoEndOfParagraph(sal_Bool Expand) throw (uno::RuntimeException, { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); if (CURSOR_META == m_pImpl->m_eType) { @@ -1616,7 +1616,7 @@ SwXTextCursor::gotoNextParagraph(sal_Bool Expand) throw (uno::RuntimeException, { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); if (CURSOR_META == m_pImpl->m_eType) { @@ -1633,7 +1633,7 @@ throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); if (CURSOR_META == m_pImpl->m_eType) { @@ -1657,7 +1657,7 @@ SwXTextCursor::getStart() throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); uno::Reference< text::XTextRange > xRet; SwPaM aPam(*rUnoCursor.Start()); @@ -1683,7 +1683,7 @@ SwXTextCursor::getEnd() throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); uno::Reference< text::XTextRange > xRet; SwPaM aPam(*rUnoCursor.End()); @@ -1708,7 +1708,7 @@ OUString SAL_CALL SwXTextCursor::getString() throw (uno::RuntimeException, std:: { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); OUString aText; SwUnoCursorHelper::GetTextFromPam(rUnoCursor, aText); @@ -1720,7 +1720,7 @@ SwXTextCursor::setString(const OUString& aString) throw (uno::RuntimeException, { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); (void) rUnoCursor; // just to check if valid const bool bForceExpandHints( (CURSOR_META == m_pImpl->m_eType) @@ -1747,7 +1747,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, } beans::PropertyState eTemp; - const bool bDone = SwUnoCursorHelper::getCrsrPropertyValue( + const bool bDone = SwUnoCursorHelper::getCursorPropertyValue( *pEntry, rPaM, &aAny, eTemp ); if (!bDone) @@ -1757,7 +1757,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, 0L); - SwUnoCursorHelper::GetCrsrAttr(rPaM, aSet); + SwUnoCursorHelper::GetCursorAttr(rPaM, aSet); rPropSet.getPropertyValue(*pEntry, aSet, aAny); } @@ -1782,7 +1782,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, // FN_UNO_PARA_STYLE is known to set attributes for nodes, inside // SwUnoCursorHelper::SetTextFormatColl, instead of extending item set. -// We need to get them from nodes in next call to GetCrsrAttr. +// We need to get them from nodes in next call to GetCursorAttr. // The rest could cause similar problems in theory, so we just list them here. inline bool propertyCausesSideEffectsInNodes(sal_uInt16 nWID) { @@ -1851,7 +1851,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, // we need to get up-to-date item set from nodes if (i == 0 || bPreviousPropertyCausesSideEffectsInNodes) - SwUnoCursorHelper::GetCrsrAttr(rPaM, aItemSet); + SwUnoCursorHelper::GetCursorAttr(rPaM, aItemSet); const uno::Any &rValue = rPropertyValues[i].Value; // this can set some attributes in nodes' mpAttrSet @@ -1859,7 +1859,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, rPropSet.setPropertyValue(*pEntry, rValue, aItemSet); if (i + 1 == aEntries.size() || bPropertyCausesSideEffectsInNodes) - SwUnoCursorHelper::SetCrsrAttr(rPaM, aItemSet, nAttrMode, bTableMode); + SwUnoCursorHelper::SetCursorAttr(rPaM, aItemSet, nAttrMode, bTableMode); bPreviousPropertyCausesSideEffectsInNodes = bPropertyCausesSideEffectsInNodes; } @@ -1925,7 +1925,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) if ( pEntry->nWID >= FN_UNO_RANGE_BEGIN && pEntry->nWID <= FN_UNO_RANGE_END ) { - (void)SwUnoCursorHelper::getCrsrPropertyValue( + (void)SwUnoCursorHelper::getCursorPropertyValue( *pEntry, rPaM, nullptr, pStates[i] ); } else @@ -1954,7 +1954,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) 0L )); } // #i63870# - SwUnoCursorHelper::GetCrsrAttr( rPaM, *pSet ); + SwUnoCursorHelper::GetCursorAttr( rPaM, *pSet ); } pStates[i] = ( pSet->Count() ) @@ -1968,7 +1968,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) { pSetParent.reset( pSet->Clone( false ) ); // #i63870# - SwUnoCursorHelper::GetCrsrAttr( + SwUnoCursorHelper::GetCursorAttr( rPaM, *pSetParent, true, false ); } @@ -2001,7 +2001,7 @@ lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc, // if we are reseting paragraph attributes, we need to select the full paragraph first SwPosition aStart = *rPaM.Start(); SwPosition aEnd = *rPaM.End(); - auto pTemp ( rDoc.CreateUnoCrsr(aStart) ); + auto pTemp ( rDoc.CreateUnoCursor(aStart) ); if(!SwUnoCursorHelper::IsStartOfPara(*pTemp)) { pTemp->MovePara(fnParaCurr, fnParaStart); @@ -2053,7 +2053,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) } else { - SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, rPaM); + SwUnoCursorHelper::resetCursorPropertyValue(*pEntry, rPaM); } } @@ -2090,7 +2090,7 @@ SwXTextCursor::getPropertySetInfo() throw (uno::RuntimeException, std::exception static uno::Reference< beans::XPropertySetInfo > xRef; if(!xRef.is()) { - static SfxItemPropertyMapEntry const aCrsrExtMap_Impl[] = + static SfxItemPropertyMapEntry const aCursorExtMap_Impl[] = { { OUString(UNO_NAME_IS_SKIP_HIDDEN_TEXT), FN_SKIP_HIDDEN_TEXT, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, { OUString(UNO_NAME_IS_SKIP_PROTECTED_TEXT), FN_SKIP_PROTECTED_TEXT, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, @@ -2101,7 +2101,7 @@ SwXTextCursor::getPropertySetInfo() throw (uno::RuntimeException, std::exception // extend PropertySetInfo! const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties(); xRef = new SfxExtItemPropertySetInfo( - aCrsrExtMap_Impl, + aCursorExtMap_Impl, aPropSeq ); } return xRef; @@ -2116,7 +2116,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); if (rPropertyName == UNO_NAME_IS_SKIP_HIDDEN_TEXT) { @@ -2150,7 +2150,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); uno::Any aAny; if (rPropertyName == UNO_NAME_IS_SKIP_HIDDEN_TEXT) @@ -2217,7 +2217,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); const beans::PropertyState eRet = SwUnoCursorHelper::GetPropertyState( rUnoCursor, m_pImpl->m_rPropSet, rPropertyName); @@ -2231,7 +2231,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); return SwUnoCursorHelper::GetPropertyStates( rUnoCursor, m_pImpl->m_rPropSet, rPropertyNames); @@ -2271,7 +2271,7 @@ void SAL_CALL SwXTextCursor::setPropertyValues( SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); // a little lame to have to copy into this. uno::Sequence< beans::PropertyValue > aPropertyValues( aValues.getLength() ); @@ -2372,7 +2372,7 @@ throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); std::set<sal_uInt16> aParaWhichIds; std::set<sal_uInt16> aWhichIds; @@ -2396,7 +2396,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); const sal_Int32 nCount = rPropertyNames.getLength(); if ( nCount ) @@ -2440,7 +2440,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) } else if (pEntry->nWID == FN_UNO_NUM_START_VALUE) { - SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, rUnoCursor); + SwUnoCursorHelper::resetCursorPropertyValue(*pEntry, rUnoCursor); } } @@ -2463,7 +2463,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); const sal_Int32 nCount = rPropertyNames.getLength(); uno::Sequence< uno::Any > aRet(nCount); @@ -2503,7 +2503,7 @@ throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); SwNode& node = rUnoCursor.GetNode(); @@ -2544,7 +2544,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); SwUnoCursorHelper::makeRedline(rUnoCursor, rRedlineType, rRedlineProperties); } @@ -2556,7 +2556,7 @@ throw (lang::IllegalArgumentException, io::IOException, { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); SwUnoCursorHelper::InsertFile(&rUnoCursor, rURL, rOptions); } @@ -2892,7 +2892,7 @@ SwXTextCursor::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor) { SolarMutexGuard aGuard; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); if (rUnoCursor.HasMark()) { @@ -2937,7 +2937,7 @@ throw (uno::RuntimeException, std::exception) SolarMutexGuard g; if (rServiceName != "com.sun.star.text.TextContent") throw uno::RuntimeException(); - SwUnoCrsr& rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor& rUnoCursor( m_pImpl->GetCursorOrThrow() ); return SwXParaFrameEnumeration::Create(rUnoCursor, PARAFRAME_PORTION_TEXTRANGE); } @@ -2946,7 +2946,7 @@ SwXTextCursor::createEnumeration() throw (uno::RuntimeException, std::exception) { SolarMutexGuard g; - SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() ); const uno::Reference<lang::XUnoTunnel> xTunnel( m_pImpl->m_xParentText, uno::UNO_QUERY); @@ -2961,11 +2961,11 @@ SwXTextCursor::createEnumeration() throw (uno::RuntimeException, std::exception) throw uno::RuntimeException(); } - auto pNewCrsr(rUnoCursor.GetDoc()->CreateUnoCrsr(*rUnoCursor.GetPoint()) ); + auto pNewCursor(rUnoCursor.GetDoc()->CreateUnoCursor(*rUnoCursor.GetPoint()) ); if (rUnoCursor.HasMark()) { - pNewCrsr->SetMark(); - *pNewCrsr->GetMark() = *rUnoCursor.GetMark(); + pNewCursor->SetMark(); + *pNewCursor->GetMark() = *rUnoCursor.GetMark(); } const CursorType eSetType = (CURSOR_TBLTEXT == m_pImpl->m_eType) ? CURSOR_SELECTION_IN_TABLE : CURSOR_SELECTION; @@ -2974,7 +2974,7 @@ SwXTextCursor::createEnumeration() throw (uno::RuntimeException, std::exception) : nullptr); SwTable const*const pTable( (pStartNode) ? & pStartNode->GetTable() : nullptr ); - return SwXParagraphEnumeration::Create(pParentText, pNewCrsr, eSetType, pStartNode, pTable); + return SwXParagraphEnumeration::Create(pParentText, pNewCursor, eSetType, pStartNode, pTable); } uno::Type SAL_CALL diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 5e35fa3e43c2..2b1827560566 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -166,11 +166,11 @@ struct FrameClientSortListLess namespace { - void lcl_CollectFrameAtNodeWithLayout(SwDoc* pDoc, const SwContentFrm* pCFrm, + void lcl_CollectFrameAtNodeWithLayout(SwDoc* pDoc, const SwContentFrame* pCFrame, FrameClientSortList_t& rFrames, const sal_uInt16 nAnchorType) { - auto pObjs = pCFrm->GetDrawObjs(); + auto pObjs = pCFrame->GetDrawObjs(); if(!pObjs) return; const auto aTextBoxes = SwTextBoxHelper::findTextBoxes(pDoc); @@ -206,13 +206,13 @@ void CollectFrameAtNode( const SwNodeIndex& rIdx, const auto nChkType = static_cast< sal_uInt16 >((bAtCharAnchoredObjs) ? FLY_AT_CHAR : FLY_AT_PARA); - const SwContentFrm* pCFrm; + const SwContentFrame* pCFrame; const SwContentNode* pCNd; if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() && nullptr != (pCNd = rIdx.GetNode().GetContentNode()) && - nullptr != (pCFrm = pCNd->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout())) ) + nullptr != (pCFrame = pCNd->getLayoutFrame( pDoc->getIDocumentLayoutAccess().GetCurrentLayout())) ) { - lcl_CollectFrameAtNodeWithLayout(pDoc, pCFrm, rFrames, nChkType); + lcl_CollectFrameAtNodeWithLayout(pDoc, pCFrame, rFrames, nChkType); } else { @@ -244,10 +244,10 @@ void CollectFrameAtNode( const SwNodeIndex& rIdx, UnoActionContext::UnoActionContext(SwDoc *const pDoc) : m_pDoc(pDoc) { - SwRootFrm *const pRootFrm = m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); - if (pRootFrm) + SwRootFrame *const pRootFrame = m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + if (pRootFrame) { - pRootFrm->StartAllAction(); + pRootFrame->StartAllAction(); } } @@ -256,10 +256,10 @@ UnoActionContext::~UnoActionContext() // Doc may already have been removed here if (m_pDoc) { - SwRootFrm *const pRootFrm = m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); - if (pRootFrm) + SwRootFrame *const pRootFrame = m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + if (pRootFrame) { - pRootFrm->EndAllAction(); + pRootFrame->EndAllAction(); } } } @@ -267,10 +267,10 @@ UnoActionContext::~UnoActionContext() static void lcl_RemoveImpl(SwDoc *const pDoc) { assert(pDoc); - SwRootFrm *const pRootFrm = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); - if (pRootFrm) + SwRootFrame *const pRootFrame = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + if (pRootFrame) { - pRootFrm->UnoRemoveAllActions(); + pRootFrame->UnoRemoveAllActions(); } } @@ -280,7 +280,7 @@ UnoActionRemoveContext::UnoActionRemoveContext(SwDoc *const pDoc) lcl_RemoveImpl(m_pDoc); } -static SwDoc * lcl_IsNewStyleTable(SwUnoTableCrsr const& rCursor) +static SwDoc * lcl_IsNewStyleTable(SwUnoTableCursor const& rCursor) { SwTableNode *const pTableNode = rCursor.GetNode().FindTableNode(); return (pTableNode && !pTableNode->GetTable().IsNewModel()) @@ -288,11 +288,11 @@ static SwDoc * lcl_IsNewStyleTable(SwUnoTableCrsr const& rCursor) : nullptr; } -UnoActionRemoveContext::UnoActionRemoveContext(SwUnoTableCrsr const& rCursor) +UnoActionRemoveContext::UnoActionRemoveContext(SwUnoTableCursor const& rCursor) : m_pDoc(lcl_IsNewStyleTable(rCursor)) { // this insanity is only necessary for old-style tables - // because SwRootFrm::MakeTableCrsrs() creates the table cursor for these + // because SwRootFrame::MakeTableCursors() creates the table cursor for these if (m_pDoc) { lcl_RemoveImpl(m_pDoc); @@ -303,10 +303,10 @@ UnoActionRemoveContext::~UnoActionRemoveContext() { if (m_pDoc) { - SwRootFrm *const pRootFrm = m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); - if (pRootFrm) + SwRootFrame *const pRootFrame = m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + if (pRootFrame) { - pRootFrm->UnoRestoreAllActions(); + pRootFrame->UnoRestoreAllActions(); } } } @@ -330,7 +330,7 @@ void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem } } -void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam, +void SwUnoCursorHelper::SetCursorAttr(SwPaM & rPam, const SfxItemSet& rSet, const SetAttrMode nAttrMode, const bool bTableMode) { @@ -372,7 +372,7 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam, // #i63870# // split third parameter <bCurrentAttrOnly> into new parameters <bOnlyTextAttr> // and <bGetFromChrFormat> to get better control about resulting <SfxItemSet> -void SwUnoCursorHelper::GetCrsrAttr(SwPaM & rPam, +void SwUnoCursorHelper::GetCursorAttr(SwPaM & rPam, SfxItemSet & rSet, const bool bOnlyTextAttr, const bool bGetFromChrFormat) { static const sal_uLong nMaxLookup = 1000; @@ -450,11 +450,11 @@ struct SwXParagraphEnumerationImpl final : public SwXParagraphEnumeration sal_Int32 m_nLastParaEnd; bool m_bFirstParagraph; uno::Reference< text::XTextContent > m_xNextPara; - sw::UnoCursorPointer m_pCrsr; + sw::UnoCursorPointer m_pCursor; SwXParagraphEnumerationImpl( uno::Reference< text::XText > const& xParent, - ::std::shared_ptr<SwUnoCrsr> pCursor, + ::std::shared_ptr<SwUnoCursor> pCursor, const CursorType eType, SwStartNode const*const pStartNode, SwTable const*const pTable) : m_xParentText( xParent ) @@ -469,7 +469,7 @@ struct SwXParagraphEnumerationImpl final : public SwXParagraphEnumeration , m_nFirstParaStart( -1 ) , m_nLastParaEnd( -1 ) , m_bFirstParagraph( true ) - , m_pCrsr(pCursor) + , m_pCursor(pCursor) { OSL_ENSURE(m_xParentText.is(), "SwXParagraphEnumeration: no parent?"); OSL_ENSURE( !((CURSOR_SELECTION_IN_TABLE == eType) || @@ -480,7 +480,7 @@ struct SwXParagraphEnumerationImpl final : public SwXParagraphEnumeration if ((CURSOR_SELECTION == m_eCursorType) || (CURSOR_SELECTION_IN_TABLE == m_eCursorType)) { - SwUnoCrsr & rCursor = GetCursor(); + SwUnoCursor & rCursor = GetCursor(); rCursor.Normalize(); m_nFirstParaStart = rCursor.GetPoint()->nContent.GetIndex(); m_nLastParaEnd = rCursor.GetMark()->nContent.GetIndex(); @@ -489,7 +489,7 @@ struct SwXParagraphEnumerationImpl final : public SwXParagraphEnumeration } virtual ~SwXParagraphEnumerationImpl() - { m_pCrsr.reset(nullptr); } + { m_pCursor.reset(nullptr); } virtual void SAL_CALL release() throw () override { SolarMutexGuard g; @@ -508,15 +508,15 @@ struct SwXParagraphEnumerationImpl final : public SwXParagraphEnumeration virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; - SwUnoCrsr& GetCursor() - { return *m_pCrsr; } + SwUnoCursor& GetCursor() + { return *m_pCursor; } uno::Reference< text::XTextContent > NextElement_Impl() throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException); }; SwXParagraphEnumeration* SwXParagraphEnumeration::Create( uno::Reference< text::XText > const& xParent, - ::std::shared_ptr<SwUnoCrsr> pCursor, + ::std::shared_ptr<SwUnoCursor> pCursor, const CursorType eType, SwStartNode const*const pStartNode, SwTable const*const pTable) @@ -531,7 +531,7 @@ SwXParagraphEnumerationImpl::hasMoreElements() throw (uno::RuntimeException, std return m_bFirstParagraph || m_xNextPara.is(); } -//!! compare to SwShellTableCrsr::FillRects() in viscrs.cxx +//!! compare to SwShellTableCursor::FillRects() in viscrs.cxx static SwTableNode * lcl_FindTopLevelTable( SwTableNode *const pTableNode, SwTable const*const pOwnTable) @@ -550,17 +550,17 @@ lcl_FindTopLevelTable( static bool lcl_CursorIsInSection( - SwUnoCrsr const*const pUnoCrsr, SwStartNode const*const pOwnStartNode) + SwUnoCursor const*const pUnoCursor, SwStartNode const*const pOwnStartNode) { // returns true if the cursor is in the section (or in a sub section!) // represented by pOwnStartNode bool bRes = true; - if (pUnoCrsr && pOwnStartNode) + if (pUnoCursor && pOwnStartNode) { const SwEndNode * pOwnEndNode = pOwnStartNode->EndOfSectionNode(); - bRes = pOwnStartNode->GetIndex() <= pUnoCrsr->Start()->nNode.GetIndex() && - pUnoCrsr->End()->nNode.GetIndex() <= pOwnEndNode->GetIndex(); + bRes = pOwnStartNode->GetIndex() <= pUnoCursor->Start()->nNode.GetIndex() && + pUnoCursor->End()->nNode.GetIndex() <= pOwnEndNode->GetIndex(); } return bRes; } @@ -568,36 +568,36 @@ lcl_CursorIsInSection( uno::Reference< text::XTextContent > SwXParagraphEnumerationImpl::NextElement_Impl() throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); // check for exceeding selections if (!m_bFirstParagraph && ((CURSOR_SELECTION == m_eCursorType) || (CURSOR_SELECTION_IN_TABLE == m_eCursorType))) { - SwPosition* pStart = rUnoCrsr.Start(); - auto aNewCrsr(rUnoCrsr.GetDoc()->CreateUnoCrsr(*pStart)); + SwPosition* pStart = rUnoCursor.Start(); + auto aNewCursor(rUnoCursor.GetDoc()->CreateUnoCursor(*pStart)); // one may also go into tables here if ((CURSOR_TBLTEXT != m_eCursorType) && (CURSOR_SELECTION_IN_TABLE != m_eCursorType)) { - aNewCrsr->SetRemainInSection( false ); + aNewCursor->SetRemainInSection( false ); } // os 2005-01-14: This part is only necessary to detect movements out // of a selection; if there is no selection we don't have to care - SwTableNode *const pTableNode = aNewCrsr->GetNode().FindTableNode(); + SwTableNode *const pTableNode = aNewCursor->GetNode().FindTableNode(); if (((CURSOR_TBLTEXT != m_eCursorType) && (CURSOR_SELECTION_IN_TABLE != m_eCursorType)) && pTableNode) { - aNewCrsr->GetPoint()->nNode = pTableNode->EndOfSectionIndex(); - aNewCrsr->Move(fnMoveForward, fnGoNode); + aNewCursor->GetPoint()->nNode = pTableNode->EndOfSectionIndex(); + aNewCursor->Move(fnMoveForward, fnGoNode); } else { - aNewCrsr->MovePara(fnParaNext, fnParaStart); + aNewCursor->MovePara(fnParaNext, fnParaStart); } - if (m_nEndIndex < aNewCrsr->Start()->nNode.GetIndex()) + if (m_nEndIndex < aNewCursor->Start()->nNode.GetIndex()) { return nullptr; } @@ -606,15 +606,15 @@ SwXParagraphEnumerationImpl::NextElement_Impl() throw (container::NoSuchElementE bool bInTable = false; if (!m_bFirstParagraph) { - rUnoCrsr.SetRemainInSection( false ); + rUnoCursor.SetRemainInSection( false ); // what to do if already in a table? - SwTableNode * pTableNode = rUnoCrsr.GetNode().FindTableNode(); + SwTableNode * pTableNode = rUnoCursor.GetNode().FindTableNode(); pTableNode = lcl_FindTopLevelTable( pTableNode, m_pOwnTable ); if (pTableNode && (&pTableNode->GetTable() != m_pOwnTable)) { // this is a foreign table: go to end - rUnoCrsr.GetPoint()->nNode = pTableNode->EndOfSectionIndex(); - if (!rUnoCrsr.Move(fnMoveForward, fnGoNode)) + rUnoCursor.GetPoint()->nNode = pTableNode->EndOfSectionIndex(); + if (!rUnoCursor.Move(fnMoveForward, fnGoNode)) { return nullptr; } @@ -625,19 +625,19 @@ SwXParagraphEnumerationImpl::NextElement_Impl() throw (container::NoSuchElementE uno::Reference< text::XTextContent > xRef; // the cursor must remain in the current section or a subsection // before AND after the movement... - if (lcl_CursorIsInSection( &rUnoCrsr, m_pOwnStartNode ) && + if (lcl_CursorIsInSection( &rUnoCursor, m_pOwnStartNode ) && (m_bFirstParagraph || bInTable || - (rUnoCrsr.MovePara(fnParaNext, fnParaStart) && - lcl_CursorIsInSection( &rUnoCrsr, m_pOwnStartNode )))) + (rUnoCursor.MovePara(fnParaNext, fnParaStart) && + lcl_CursorIsInSection( &rUnoCursor, m_pOwnStartNode )))) { - SwPosition* pStart = rUnoCrsr.Start(); + SwPosition* pStart = rUnoCursor.Start(); const sal_Int32 nFirstContent = (m_bFirstParagraph) ? m_nFirstParaStart : -1; const sal_Int32 nLastContent = (m_nEndIndex == pStart->nNode.GetIndex()) ? m_nLastParaEnd : -1; // position in a table, or in a simple paragraph? - SwTableNode * pTableNode = rUnoCrsr.GetNode().FindTableNode(); + SwTableNode * pTableNode = rUnoCursor.GetNode().FindTableNode(); pTableNode = lcl_FindTopLevelTable( pTableNode, m_pOwnTable ); if (/*CURSOR_TBLTEXT != eCursorType && CURSOR_SELECTION_IN_TABLE != eCursorType && */ pTableNode && (&pTableNode->GetTable() != m_pOwnTable)) @@ -650,7 +650,7 @@ SwXParagraphEnumerationImpl::NextElement_Impl() throw (container::NoSuchElementE else { text::XText *const pText = m_xParentText.get(); - xRef = SwXParagraph::CreateXParagraph(*rUnoCrsr.GetDoc(), + xRef = SwXParagraph::CreateXParagraph(*rUnoCursor.GetDoc(), pStart->nNode.GetNode().GetTextNode(), static_cast<SwXText*>(pText), nFirstContent, nLastContent); } @@ -1039,10 +1039,10 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill, { xTextCursor.set( pText->CreateCursor() ); xTextCursor->gotoEnd(sal_True); - const uno::Reference<lang::XUnoTunnel> xCrsrTunnel( + const uno::Reference<lang::XUnoTunnel> xCursorTunnel( xTextCursor, uno::UNO_QUERY); pCursor = - ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xCrsrTunnel); + ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xCursorTunnel); } if(pRange && &pRange->GetDoc() == rToFill.GetDoc()) { @@ -1058,18 +1058,18 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill, { SwDoc* const pDoc = (pCursor) ? pCursor->GetDoc() : ((pPortion) ? pPortion->GetCursor().GetDoc() : nullptr); - const SwPaM* const pUnoCrsr = (pCursor) ? pCursor->GetPaM() + const SwPaM* const pUnoCursor = (pCursor) ? pCursor->GetPaM() : ((pPortion) ? &pPortion->GetCursor() : nullptr); - if (pUnoCrsr && pDoc == rToFill.GetDoc()) + if (pUnoCursor && pDoc == rToFill.GetDoc()) { - OSL_ENSURE(!pUnoCrsr->IsMultiSelection(), + OSL_ENSURE(!pUnoCursor->IsMultiSelection(), "what to do about rings?"); bRet = true; - *rToFill.GetPoint() = *pUnoCrsr->GetPoint(); - if (pUnoCrsr->HasMark()) + *rToFill.GetPoint() = *pUnoCursor->GetPoint(); + if (pUnoCursor->HasMark()) { rToFill.SetMark(); - *rToFill.GetMark() = *pUnoCrsr->GetMark(); + *rToFill.GetMark() = *pUnoCursor->GetMark(); } else rToFill.DeleteMark(); @@ -1118,15 +1118,15 @@ SwXTextRange::CreateXTextRange( { const uno::Reference<text::XText> xParentText( ::sw::CreateParentXText(rDoc, rPos)); - const auto pNewCrsr(rDoc.CreateUnoCrsr(rPos)); + const auto pNewCursor(rDoc.CreateUnoCursor(rPos)); if(pMark) { - pNewCrsr->SetMark(); - *pNewCrsr->GetMark() = *pMark; + pNewCursor->SetMark(); + *pNewCursor->GetMark() = *pMark; } const bool isCell( dynamic_cast<SwXCell*>(xParentText.get()) ); const uno::Reference< text::XTextRange > xRet( - new SwXTextRange(*pNewCrsr, xParentText, + new SwXTextRange(*pNewCursor, xParentText, isCell ? RANGE_IN_CELL : RANGE_IN_TEXT) ); return xRet; } @@ -1252,13 +1252,13 @@ throw (uno::RuntimeException, std::exception) throw uno::RuntimeException(); } const SwPosition aPos(GetDoc().GetNodes().GetEndOfContent()); - const auto pNewCrsr(m_pImpl->m_rDoc.CreateUnoCrsr(aPos)); - if (!GetPositions(*pNewCrsr)) + const auto pNewCursor(m_pImpl->m_rDoc.CreateUnoCursor(aPos)); + if (!GetPositions(*pNewCursor)) { throw uno::RuntimeException(); } - return SwXParaFrameEnumeration::Create(*pNewCrsr, PARAFRAME_PORTION_TEXTRANGE); + return SwXParaFrameEnumeration::Create(*pNewCursor, PARAFRAME_PORTION_TEXTRANGE); } uno::Reference< container::XEnumeration > SAL_CALL @@ -1271,8 +1271,8 @@ SwXTextRange::createEnumeration() throw (uno::RuntimeException, std::exception) throw uno::RuntimeException(); } const SwPosition aPos(GetDoc().GetNodes().GetEndOfContent()); - auto pNewCrsr(m_pImpl->m_rDoc.CreateUnoCrsr(aPos)); - if (!GetPositions(*pNewCrsr)) + auto pNewCursor(m_pImpl->m_rDoc.CreateUnoCursor(aPos)); + if (!GetPositions(*pNewCursor)) { throw uno::RuntimeException(); } @@ -1283,7 +1283,7 @@ SwXTextRange::createEnumeration() throw (uno::RuntimeException, std::exception) const CursorType eSetType = (RANGE_IN_CELL == m_pImpl->m_eRangePosition) ? CURSOR_SELECTION_IN_TABLE : CURSOR_SELECTION; - return SwXParagraphEnumeration::Create(m_pImpl->m_xParentText, pNewCrsr, eSetType); + return SwXParagraphEnumeration::Create(m_pImpl->m_xParentText, pNewCursor, eSetType); } uno::Type SAL_CALL SwXTextRange::getElementType() throw (uno::RuntimeException, std::exception) @@ -1497,7 +1497,7 @@ struct SwXTextRangesImpl final : public SwXTextRanges { if (pPaM) { - m_pUnoCursor.reset(pPaM->GetDoc()->CreateUnoCrsr(*pPaM->GetPoint())); + m_pUnoCursor.reset(pPaM->GetDoc()->CreateUnoCursor(*pPaM->GetPoint())); ::sw::DeepCopyPaM(*pPaM, *GetCursor()); } MakeRanges(); @@ -1507,7 +1507,7 @@ struct SwXTextRangesImpl final : public SwXTextRanges SolarMutexGuard g; OWeakObject::release(); } - virtual SwUnoCrsr* GetCursor() override + virtual SwUnoCursor* GetCursor() override { return &(*m_pUnoCursor); }; void MakeRanges(); ::std::vector< uno::Reference< text::XTextRange > > m_Ranges; @@ -1615,7 +1615,7 @@ struct SwXParaFrameEnumerationImpl final : public SwXParaFrameEnumeration SolarMutexGuard g; OWeakObject::release(); } - SwUnoCrsr& GetCursor() + SwUnoCursor& GetCursor() { return *m_pUnoCursor; } void PurgeFrameClients() { @@ -1647,7 +1647,7 @@ SwXParaFrameEnumeration* SwXParaFrameEnumeration::Create(const SwPaM& rPaM, cons SwXParaFrameEnumerationImpl::SwXParaFrameEnumerationImpl( const SwPaM& rPaM, const enum ParaFrameMode eParaFrameMode, SwFrameFormat* const pFormat) - : m_pUnoCursor(rPaM.GetDoc()->CreateUnoCrsr(*rPaM.GetPoint())) + : m_pUnoCursor(rPaM.GetDoc()->CreateUnoCursor(*rPaM.GetPoint())) { if (rPaM.HasMark()) { @@ -1672,9 +1672,9 @@ SwXParaFrameEnumerationImpl::SwXParaFrameEnumerationImpl( if (PARAFRAME_PORTION_TEXTRANGE == eParaFrameMode) { //get all frames that are bound at paragraph or at character - for(const auto& pFlyFrm : rPaM.GetDoc()->GetAllFlyFormats(&GetCursor(), false, true)) + for(const auto& pFlyFrame : rPaM.GetDoc()->GetAllFlyFormats(&GetCursor(), false, true)) { - const auto pFrameFormat = const_cast<SwFrameFormat*>(&pFlyFrm->GetFormat()); + const auto pFrameFormat = const_cast<SwFrameFormat*>(&pFlyFrame->GetFormat()); m_vFrames.push_back(std::shared_ptr<sw::FrameClient>(new sw::FrameClient(pFrameFormat))); } } diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index c76943b61eb2..8cf08e4f741b 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -568,7 +568,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, pValues[nProp], pPropertyNames[nProp], pEntry->nWID)) { beans::PropertyState eTemp; - const bool bDone = SwUnoCursorHelper::getCrsrPropertyValue( + const bool bDone = SwUnoCursorHelper::getCursorPropertyValue( *pEntry, aPam, &(pValues[nProp]), eTemp, &rTextNode ); if (!bDone) { @@ -646,7 +646,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SwTextNode & rTextNode(m_pImpl->GetTextNodeOrThrow()); - //SwNode& rTextNode = pUnoCrsr->GetPoint()->nNode.GetNode(); + //SwNode& rTextNode = pUnoCursor->GetPoint()->nNode.GetNode(); //const SwAttrSet& rAttrSet = static_cast<SwTextNode&>(rTextNode).GetSwAttrSet(); //sal_uInt16 nAttrCount = rAttrSet.Count(); @@ -824,7 +824,7 @@ throw (uno::RuntimeException, std::exception) // and thus only pretendend to be paragraph attributes beans::PropertyState eTemp; const bool bDone = - SwUnoCursorHelper::getCrsrPropertyValue( + SwUnoCursorHelper::getCursorPropertyValue( *pEntry, aPam, &aValue, eTemp, &rTextNode ); // if not found try the real paragraph attributes... @@ -1150,10 +1150,10 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) static_cast<cppu::OWeakObject *>(this)); } - const bool bBelowFrmAtrEnd(pEntry->nWID < RES_FRMATR_END); + const bool bBelowFrameAtrEnd(pEntry->nWID < RES_FRMATR_END); const bool bDrawingLayerRange(XATTR_FILL_FIRST <= pEntry->nWID && XATTR_FILL_LAST >= pEntry->nWID); - if(bBelowFrmAtrEnd || bDrawingLayerRange) + if(bBelowFrameAtrEnd || bDrawingLayerRange) { std::set<sal_uInt16> aWhichIds; @@ -1178,7 +1178,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) // to paragraph boundaries SwPosition aStart( *aCursor.Start() ); SwPosition aEnd ( *aCursor.End() ); - auto pTemp( aCursor.GetDoc()->CreateUnoCrsr(aStart) ); + auto pTemp( aCursor.GetDoc()->CreateUnoCursor(aStart) ); if(!SwUnoCursorHelper::IsStartOfPara(*pTemp)) { pTemp->MovePara(fnParaCurr, fnParaStart); @@ -1200,7 +1200,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) } else { - SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, aCursor); + SwUnoCursorHelper::resetCursorPropertyValue(*pEntry, aCursor); } } @@ -1228,10 +1228,10 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, static_cast<cppu::OWeakObject *>(this)); } - const bool bBelowFrmAtrEnd(pEntry->nWID < RES_FRMATR_END); + const bool bBelowFrameAtrEnd(pEntry->nWID < RES_FRMATR_END); const bool bDrawingLayerRange(XATTR_FILL_FIRST <= pEntry->nWID && XATTR_FILL_LAST >= pEntry->nWID); - if(bBelowFrmAtrEnd || bDrawingLayerRange) + if(bBelowFrameAtrEnd || bDrawingLayerRange) { const SfxPoolItem& rDefItem = rTextNode.GetDoc()->GetAttrPool().GetDefaultItem(pEntry->nWID); diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index ca603e804262..0c176c7fa275 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -62,9 +62,9 @@ public: Impl() : m_EventListeners(m_Mutex) { } }; -void SwXTextPortion::init(const SwUnoCrsr* pPortionCursor) +void SwXTextPortion::init(const SwUnoCursor* pPortionCursor) { - m_pUnoCursor = pPortionCursor->GetDoc()->CreateUnoCrsr(*pPortionCursor->GetPoint()); + m_pUnoCursor = pPortionCursor->GetDoc()->CreateUnoCursor(*pPortionCursor->GetPoint()); if (pPortionCursor->HasMark()) { m_pUnoCursor->SetMark(); @@ -73,7 +73,7 @@ void SwXTextPortion::init(const SwUnoCrsr* pPortionCursor) } SwXTextPortion::SwXTextPortion( - const SwUnoCrsr* pPortionCrsr, + const SwUnoCursor* pPortionCursor, uno::Reference< text::XText > const& rParent, SwTextPortionType eType) : m_pImpl(new Impl) @@ -88,11 +88,11 @@ SwXTextPortion::SwXTextPortion( , m_ePortionType(eType) , m_bIsCollapsed(false) { - init( pPortionCrsr); + init( pPortionCursor); } SwXTextPortion::SwXTextPortion( - const SwUnoCrsr* pPortionCrsr, + const SwUnoCursor* pPortionCursor, uno::Reference< text::XText > const& rParent, SwFrameFormat& rFormat ) : m_pImpl(new Impl) @@ -104,11 +104,11 @@ SwXTextPortion::SwXTextPortion( , m_ePortionType(PORTION_FRAME) , m_bIsCollapsed(false) { - init( pPortionCrsr); + init( pPortionCursor); } SwXTextPortion::SwXTextPortion( - const SwUnoCrsr* pPortionCrsr, + const SwUnoCursor* pPortionCursor, SwTextRuby const& rAttr, uno::Reference< text::XText > const& xParent, bool bIsEnd ) @@ -125,7 +125,7 @@ SwXTextPortion::SwXTextPortion( , m_ePortionType( bIsEnd ? PORTION_RUBY_END : PORTION_RUBY_START ) , m_bIsCollapsed(false) { - init( pPortionCrsr); + init( pPortionCursor); if (!bIsEnd) { @@ -159,9 +159,9 @@ throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; uno::Reference< text::XTextRange > xRet; - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); - SwPaM aPam(*rUnoCrsr.Start()); + SwPaM aPam(*rUnoCursor.Start()); uno::Reference< text::XText > xParent = getText(); xRet = new SwXTextRange(aPam, xParent); return xRet; @@ -172,9 +172,9 @@ throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; uno::Reference< text::XTextRange > xRet; - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); - SwPaM aPam(*rUnoCrsr.End()); + SwPaM aPam(*rUnoCursor.End()); uno::Reference< text::XText > xParent = getText(); xRet = new SwXTextRange(aPam, xParent); return xRet; @@ -185,15 +185,15 @@ throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; OUString aText; - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); // TextPortions are always within a paragraph - SwTextNode* pTextNd = rUnoCrsr.GetNode().GetTextNode(); + SwTextNode* pTextNd = rUnoCursor.GetNode().GetTextNode(); if ( pTextNd ) { - const sal_Int32 nStt = rUnoCrsr.Start()->nContent.GetIndex(); + const sal_Int32 nStt = rUnoCursor.Start()->nContent.GetIndex(); aText = pTextNd->GetExpandText( nStt, - rUnoCrsr.End()->nContent.GetIndex() - nStt ); + rUnoCursor.End()->nContent.GetIndex() - nStt ); } return aText; } @@ -201,9 +201,9 @@ throw( uno::RuntimeException, std::exception ) void SwXTextPortion::setString(const OUString& aString) throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); - SwUnoCursorHelper::SetString(rUnoCrsr, aString); + SwUnoCursorHelper::SetString(rUnoCursor, aString); } uno::Reference< beans::XPropertySetInfo > SwXTextPortion::getPropertySetInfo() @@ -229,22 +229,22 @@ void SwXTextPortion::setPropertyValue(const OUString& rPropertyName, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); - SwUnoCursorHelper::SetPropertyValue(rUnoCrsr, *m_pPropSet, + SwUnoCursorHelper::SetPropertyValue(rUnoCursor, *m_pPropSet, rPropertyName, aValue); } void SwXTextPortion::GetPropertyValue( uno::Any &rVal, const SfxItemPropertySimpleEntry& rEntry, - SwUnoCrsr *pUnoCrsr, + SwUnoCursor *pUnoCursor, SfxItemSet *&pSet ) { - OSL_ENSURE( pUnoCrsr, "UNO cursor missing" ); - if (!pUnoCrsr) + OSL_ENSURE( pUnoCursor, "UNO cursor missing" ); + if (!pUnoCursor) return; - if(pUnoCrsr) + if(pUnoCursor) { switch(rEntry.nWID) { @@ -375,18 +375,18 @@ void SwXTextPortion::GetPropertyValue( break; default: beans::PropertyState eTemp; - bool bDone = SwUnoCursorHelper::getCrsrPropertyValue( - rEntry, *pUnoCrsr, &(rVal), eTemp ); + bool bDone = SwUnoCursorHelper::getCursorPropertyValue( + rEntry, *pUnoCursor, &(rVal), eTemp ); if(!bDone) { if(!pSet) { - pSet = new SfxItemSet(pUnoCrsr->GetDoc()->GetAttrPool(), + pSet = new SfxItemSet(pUnoCursor->GetDoc()->GetAttrPool(), RES_CHRATR_BEGIN, RES_FRMATR_END - 1, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, 0L); - SwUnoCursorHelper::GetCrsrAttr(*pUnoCrsr, *pSet); + SwUnoCursorHelper::GetCursorAttr(*pUnoCursor, *pSet); } m_pPropSet->getPropertyValue(rEntry, *pSet, rVal); } @@ -402,7 +402,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXTextPortion::GetPropertyValues_Impl( const OUString *pPropertyNames = rPropertyNames.getConstArray(); uno::Sequence< uno::Any > aValues(rPropertyNames.getLength()); uno::Any *pValues = aValues.getArray(); - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); { SfxItemSet *pSet = nullptr; @@ -414,7 +414,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXTextPortion::GetPropertyValues_Impl( const SfxItemPropertySimpleEntry* pEntry = rMap.getByName(pPropertyNames[nProp]); if(pEntry) { - GetPropertyValue( pValues[nProp], *pEntry, &rUnoCrsr, pSet ); + GetPropertyValue( pValues[nProp], *pEntry, &rUnoCursor, pSet ); } else throw beans::UnknownPropertyException( "Unknown property: " + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); @@ -439,7 +439,7 @@ void SAL_CALL SwXTextPortion::SetPropertyValues_Impl( throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); { const OUString* pPropertyNames = rPropertyNames.getConstArray(); @@ -457,7 +457,7 @@ void SAL_CALL SwXTextPortion::SetPropertyValues_Impl( aValues[nProp].Name = pPropertyNames[nProp]; aValues[nProp].Value = pValues[nProp]; } - SwUnoCursorHelper::SetPropertyValues( rUnoCrsr, *m_pPropSet, aValues ); + SwUnoCursorHelper::SetPropertyValues( rUnoCursor, *m_pPropSet, aValues ); } } @@ -518,7 +518,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPr if (rPropertyNames.getLength() != rValues.getLength()) throw lang::IllegalArgumentException(); - SwUnoCrsr& rUnoCrsr = this->GetCursor(); + SwUnoCursor& rUnoCursor = this->GetCursor(); sal_Int32 nProps = rPropertyNames.getLength(); const OUString *pProp = rPropertyNames.getConstArray(); @@ -550,7 +550,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPr else { SwUnoCursorHelper::SetPropertyValue( - rUnoCrsr, *m_pPropSet, pProp[i], pValue[i] ); + rUnoCursor, *m_pPropSet, pProp[i], pValue[i] ); } } } @@ -612,7 +612,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion: { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = this->GetCursor(); + SwUnoCursor& rUnoCursor = this->GetCursor(); std::vector< beans::GetDirectPropertyTolerantResult > aResultVector; @@ -628,7 +628,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion: uno::Sequence< beans::PropertyState > aPropertyStates = SwUnoCursorHelper::GetPropertyStates( - rUnoCrsr, *m_pPropSet, + rUnoCursor, *m_pPropSet, rPropertyNames, SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT ); const beans::PropertyState* pPropertyStates = aPropertyStates.getConstArray(); @@ -664,7 +664,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion: { // get property value // (compare to SwXTextPortion::getPropertyValue(s)) - GetPropertyValue( aResult.Value, *pEntry, &rUnoCrsr, pSet ); + GetPropertyValue( aResult.Value, *pEntry, &rUnoCursor, pSet ); aResult.Result = beans::TolerantPropertySetResultType::SUCCESS; aResultVector.push_back( aResult ); } @@ -751,7 +751,7 @@ beans::PropertyState SwXTextPortion::getPropertyState(const OUString& rPropertyN { SolarMutexGuard aGuard; beans::PropertyState eRet = beans::PropertyState_DEFAULT_VALUE; - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); if (GetTextPortionType() == PORTION_RUBY_START && rPropertyName.startsWith("Ruby")) @@ -760,7 +760,7 @@ beans::PropertyState SwXTextPortion::getPropertyState(const OUString& rPropertyN } else { - eRet = SwUnoCursorHelper::GetPropertyState(rUnoCrsr, *m_pPropSet, + eRet = SwUnoCursorHelper::GetPropertyState(rUnoCursor, *m_pPropSet, rPropertyName); } return eRet; @@ -771,10 +771,10 @@ uno::Sequence< beans::PropertyState > SwXTextPortion::getPropertyStates( throw( beans::UnknownPropertyException, uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); uno::Sequence< beans::PropertyState > aRet = - SwUnoCursorHelper::GetPropertyStates(rUnoCrsr, *m_pPropSet, + SwUnoCursorHelper::GetPropertyStates(rUnoCursor, *m_pPropSet, rPropertyNames, SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION); if(GetTextPortionType() == PORTION_RUBY_START) @@ -794,10 +794,10 @@ void SwXTextPortion::setPropertyToDefault(const OUString& rPropertyName) throw( beans::UnknownPropertyException, uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); SwUnoCursorHelper::SetPropertyToDefault( - rUnoCrsr, *m_pPropSet, rPropertyName); + rUnoCursor, *m_pPropSet, rPropertyName); } uno::Any SwXTextPortion::getPropertyDefault(const OUString& rPropertyName) @@ -805,9 +805,9 @@ uno::Any SwXTextPortion::getPropertyDefault(const OUString& rPropertyName) { SolarMutexGuard aGuard; uno::Any aRet; - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); - aRet = SwUnoCursorHelper::GetPropertyDefault(rUnoCrsr, *m_pPropSet, + aRet = SwUnoCursorHelper::GetPropertyDefault(rUnoCursor, *m_pPropSet, rPropertyName); return aRet; } @@ -816,9 +816,9 @@ uno::Reference< container::XEnumeration > SwXTextPortion::createContentEnumerat throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); - return SwXParaFrameEnumeration::Create(rUnoCrsr, PARAFRAME_PORTION_CHAR, m_pFrameFormat); + return SwXParaFrameEnumeration::Create(rUnoCursor, PARAFRAME_PORTION_CHAR, m_pFrameFormat); } namespace diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index cd6d41354dea..c1aad4c5c094 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -79,7 +79,7 @@ typedef ::std::stack< PortionList_t > PortionStack_t; static void lcl_CreatePortions( TextRangeList_t & i_rPortions, uno::Reference< text::XText > const& i_xParentText, - SwUnoCrsr* pUnoCrsr, + SwUnoCursor* pUnoCursor, FrameClientSortList_t & i_rFrames, const sal_Int32 i_nStartPos, const sal_Int32 i_nEndPos ); @@ -176,18 +176,18 @@ namespace } } - static void lcl_FillBookmarkArray(SwDoc& rDoc, SwUnoCrsr& rUnoCrsr, SwXBookmarkPortion_ImplList& rBkmArr) + static void lcl_FillBookmarkArray(SwDoc& rDoc, SwUnoCursor& rUnoCursor, SwXBookmarkPortion_ImplList& rBkmArr) { IDocumentMarkAccess* const pMarkAccess = rDoc.getIDocumentMarkAccess(); if(!pMarkAccess->getBookmarksCount()) return; - const SwNodeIndex nOwnNode = rUnoCrsr.GetPoint()->nNode; + const SwNodeIndex nOwnNode = rUnoCursor.GetPoint()->nNode; SwTextNode* pTextNode = nOwnNode.GetNode().GetTextNode(); if (!pTextNode) { // no need to consider marks starting after aEndOfPara - SwPosition aEndOfPara(*rUnoCrsr.GetPoint()); + SwPosition aEndOfPara(*rUnoCursor.GetPoint()); aEndOfPara.nContent = aEndOfPara.nNode.GetNode().GetTextNode()->Len(); const IDocumentMarkAccess::const_iterator_t pCandidatesEnd = upper_bound( pMarkAccess->getBookmarksBegin(), @@ -263,7 +263,7 @@ namespace static void lcl_FillAnnotationStartArray( SwDoc& rDoc, - SwUnoCrsr& rUnoCrsr, + SwUnoCursor& rUnoCursor, SwAnnotationStartPortion_ImplList& rAnnotationStartArr ) { IDocumentMarkAccess* const pMarkAccess = rDoc.getIDocumentMarkAccess(); @@ -273,7 +273,7 @@ namespace } // no need to consider annotation marks starting after aEndOfPara - SwPosition aEndOfPara(*rUnoCrsr.GetPoint()); + SwPosition aEndOfPara(*rUnoCursor.GetPoint()); aEndOfPara.nContent = aEndOfPara.nNode.GetNode().GetTextNode()->Len(); const IDocumentMarkAccess::const_iterator_t pCandidatesEnd = upper_bound( pMarkAccess->getAnnotationMarksBegin(), @@ -282,7 +282,7 @@ namespace sw::mark::CompareIMarkStartsAfter()); // finds the first that starts after // search for all annotation marks that have its start position in this paragraph - const SwNodeIndex nOwnNode = rUnoCrsr.GetPoint()->nNode; + const SwNodeIndex nOwnNode = rUnoCursor.GetPoint()->nNode; for( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAnnotationMarksBegin(); ppMark != pCandidatesEnd; ++ppMark ) @@ -355,36 +355,36 @@ throw( RuntimeException, std::exception ) } SwXTextPortionEnumeration::SwXTextPortionEnumeration( - SwPaM& rParaCrsr, + SwPaM& rParaCursor, uno::Reference< XText > const & xParentText, const sal_Int32 nStart, const sal_Int32 nEnd ) : m_Portions() { - m_pUnoCrsr = rParaCrsr.GetDoc()->CreateUnoCrsr(*rParaCrsr.GetPoint()); + m_pUnoCursor = rParaCursor.GetDoc()->CreateUnoCursor(*rParaCursor.GetPoint()); OSL_ENSURE(nEnd == -1 || (nStart <= nEnd && - nEnd <= m_pUnoCrsr->Start()->nNode.GetNode().GetTextNode()->GetText().getLength()), + nEnd <= m_pUnoCursor->Start()->nNode.GetNode().GetTextNode()->GetText().getLength()), "start or end value invalid!"); // find all frames, graphics and OLEs that are bound AT character in para FrameClientSortList_t frames; - ::CollectFrameAtNode(m_pUnoCrsr->GetPoint()->nNode, frames, true); + ::CollectFrameAtNode(m_pUnoCursor->GetPoint()->nNode, frames, true); lcl_CreatePortions(m_Portions, xParentText, &GetCursor(), frames, nStart, nEnd); } SwXTextPortionEnumeration::SwXTextPortionEnumeration( - SwPaM& rParaCrsr, + SwPaM& rParaCursor, TextRangeList_t const & rPortions ) : m_Portions( rPortions ) { - m_pUnoCrsr = rParaCrsr.GetDoc()->CreateUnoCrsr(*rParaCrsr.GetPoint()); + m_pUnoCursor = rParaCursor.GetDoc()->CreateUnoCursor(*rParaCursor.GetPoint()); } SwXTextPortionEnumeration::~SwXTextPortionEnumeration() { SolarMutexGuard aGuard; - m_pUnoCrsr.reset(nullptr); + m_pUnoCursor.reset(nullptr); } sal_Bool SwXTextPortionEnumeration::hasMoreElements() @@ -413,11 +413,11 @@ throw( container::NoSuchElementException, lang::WrappedTargetException, typedef ::std::deque< sal_Int32 > FieldMarks_t; static void -lcl_FillFieldMarkArray(FieldMarks_t & rFieldMarks, SwUnoCrsr const & rUnoCrsr, +lcl_FillFieldMarkArray(FieldMarks_t & rFieldMarks, SwUnoCursor const & rUnoCursor, const sal_Int32 i_nStartPos) { const SwTextNode * const pTextNode = - rUnoCrsr.GetPoint()->nNode.GetNode().GetTextNode(); + rUnoCursor.GetPoint()->nNode.GetNode().GetTextNode(); if (!pTextNode) return; const sal_Unicode fld[] = { @@ -433,18 +433,18 @@ lcl_FillFieldMarkArray(FieldMarks_t & rFieldMarks, SwUnoCrsr const & rUnoCrsr, static uno::Reference<text::XTextRange> lcl_ExportFieldMark( uno::Reference< text::XText > const & i_xParentText, - SwUnoCrsr * const pUnoCrsr, + SwUnoCursor * const pUnoCursor, const SwTextNode * const pTextNode ) { uno::Reference<text::XTextRange> xRef; - SwDoc* pDoc = pUnoCrsr->GetDoc(); + SwDoc* pDoc = pUnoCursor->GetDoc(); //flr: maybe it's a good idea to add a special hint to the hints array and rely on the hint segmentation.... - const sal_Int32 start = pUnoCrsr->Start()->nContent.GetIndex(); - OSL_ENSURE(pUnoCrsr->End()->nContent.GetIndex() == start, + const sal_Int32 start = pUnoCursor->Start()->nContent.GetIndex(); + OSL_ENSURE(pUnoCursor->End()->nContent.GetIndex() == start, "hmm --- why is this different"); - pUnoCrsr->Right(1, CRSR_SKIP_CHARS, false, false); - if ( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() ) + pUnoCursor->Right(1, CRSR_SKIP_CHARS, false, false); + if ( *pUnoCursor->GetMark() == *pUnoCursor->GetPoint() ) { OSL_FAIL("cannot move cursor?"); return nullptr; @@ -457,10 +457,10 @@ lcl_ExportFieldMark( if (pDoc) { pFieldmark = pDoc->getIDocumentMarkAccess()-> - getFieldmarkFor(*pUnoCrsr->GetMark()); + getFieldmarkFor(*pUnoCursor->GetMark()); } SwXTextPortion* pPortion = new SwXTextPortion( - pUnoCrsr, i_xParentText, PORTION_FIELD_START); + pUnoCursor, i_xParentText, PORTION_FIELD_START); xRef = pPortion; if (pFieldmark && pDoc) { @@ -474,10 +474,10 @@ lcl_ExportFieldMark( if (pDoc) { pFieldmark = pDoc->getIDocumentMarkAccess()-> - getFieldmarkFor(*pUnoCrsr->GetMark()); + getFieldmarkFor(*pUnoCursor->GetMark()); } SwXTextPortion* pPortion = new SwXTextPortion( - pUnoCrsr, i_xParentText, PORTION_FIELD_END); + pUnoCursor, i_xParentText, PORTION_FIELD_END); xRef = pPortion; if (pFieldmark && pDoc) { @@ -490,10 +490,10 @@ lcl_ExportFieldMark( ::sw::mark::IFieldmark* pFieldmark = nullptr; if (pDoc) { - pFieldmark = pDoc->getIDocumentMarkAccess()->getFieldmarkFor(*pUnoCrsr->GetMark()); + pFieldmark = pDoc->getIDocumentMarkAccess()->getFieldmarkFor(*pUnoCursor->GetMark()); } SwXTextPortion* pPortion = new SwXTextPortion( - pUnoCrsr, i_xParentText, PORTION_FIELD_START_END); + pUnoCursor, i_xParentText, PORTION_FIELD_START_END); xRef = pPortion; if (pFieldmark && pDoc) { @@ -511,10 +511,10 @@ lcl_ExportFieldMark( static Reference<XTextRange> lcl_CreateRefMarkPortion( Reference<XText> const& xParent, - const SwUnoCrsr * const pUnoCrsr, + const SwUnoCursor * const pUnoCursor, const SwTextAttr & rAttr, const bool bEnd) { - SwDoc* pDoc = pUnoCrsr->GetDoc(); + SwDoc* pDoc = pUnoCursor->GetDoc(); SwFormatRefMark& rRefMark = const_cast<SwFormatRefMark&>( static_cast<const SwFormatRefMark&>(rAttr.GetAttr())); Reference<XTextContent> xContent; @@ -526,13 +526,13 @@ lcl_CreateRefMarkPortion( SwXTextPortion* pPortion = nullptr; if (!bEnd) { - pPortion = new SwXTextPortion(pUnoCrsr, xParent, PORTION_REFMARK_START); + pPortion = new SwXTextPortion(pUnoCursor, xParent, PORTION_REFMARK_START); pPortion->SetRefMark(xContent); pPortion->SetCollapsed(rAttr.End() == nullptr); } else { - pPortion = new SwXTextPortion(pUnoCrsr, xParent, PORTION_REFMARK_END); + pPortion = new SwXTextPortion(pUnoCursor, xParent, PORTION_REFMARK_END); pPortion->SetRefMark(xContent); } return pPortion; @@ -542,10 +542,10 @@ static void lcl_InsertRubyPortion( TextRangeList_t & rPortions, Reference<XText> const& xParent, - const SwUnoCrsr * const pUnoCrsr, + const SwUnoCursor * const pUnoCursor, const SwTextAttr & rAttr, const bool bEnd) { - SwXTextPortion* pPortion = new SwXTextPortion(pUnoCrsr, + SwXTextPortion* pPortion = new SwXTextPortion(pUnoCursor, static_txtattr_cast<const SwTextRuby&>(rAttr), xParent, bEnd); rPortions.push_back(pPortion); pPortion->SetCollapsed(rAttr.End() == nullptr); @@ -554,10 +554,10 @@ lcl_InsertRubyPortion( static Reference<XTextRange> lcl_CreateTOXMarkPortion( Reference<XText> const& xParent, - const SwUnoCrsr * const pUnoCrsr, + const SwUnoCursor * const pUnoCursor, SwTextAttr & rAttr, const bool bEnd) { - SwDoc* pDoc = pUnoCrsr->GetDoc(); + SwDoc* pDoc = pUnoCursor->GetDoc(); SwTOXMark & rTOXMark = static_cast<SwTOXMark&>(rAttr.GetAttr()); const Reference<XTextContent> xContent( @@ -567,13 +567,13 @@ lcl_CreateTOXMarkPortion( SwXTextPortion* pPortion = nullptr; if (!bEnd) { - pPortion = new SwXTextPortion(pUnoCrsr, xParent, PORTION_TOXMARK_START); + pPortion = new SwXTextPortion(pUnoCursor, xParent, PORTION_TOXMARK_START); pPortion->SetTOXMark(xContent); pPortion->SetCollapsed(rAttr.GetEnd() == nullptr); } else { - pPortion = new SwXTextPortion(pUnoCrsr, xParent, PORTION_TOXMARK_END); + pPortion = new SwXTextPortion(pUnoCursor, xParent, PORTION_TOXMARK_END); pPortion->SetTOXMark(xContent); } return pPortion; @@ -582,7 +582,7 @@ lcl_CreateTOXMarkPortion( static uno::Reference<text::XTextRange> lcl_CreateMetaPortion( uno::Reference<text::XText> const& xParent, - const SwUnoCrsr * const pUnoCrsr, + const SwUnoCursor * const pUnoCursor, SwTextAttr & rAttr, ::std::unique_ptr<TextRangeList_t const> && pPortions) { const uno::Reference<rdf::XMetadatable> xMeta( SwXMeta::CreateXMeta( @@ -593,13 +593,13 @@ lcl_CreateMetaPortion( { const uno::Reference<text::XTextContent> xContent(xMeta, uno::UNO_QUERY); - pPortion = new SwXTextPortion(pUnoCrsr, xParent, PORTION_META); + pPortion = new SwXTextPortion(pUnoCursor, xParent, PORTION_META); pPortion->SetMeta(xContent); } else { const uno::Reference<text::XTextField> xField(xMeta, uno::UNO_QUERY); - pPortion = new SwXTextPortion(pUnoCrsr, xParent, PORTION_FIELD); + pPortion = new SwXTextPortion(pUnoCursor, xParent, PORTION_FIELD); pPortion->SetTextField(xField); } return pPortion; @@ -608,7 +608,7 @@ lcl_CreateMetaPortion( static void lcl_ExportBookmark( TextRangeList_t & rPortions, Reference<XText> const& xParent, - const SwUnoCrsr * const pUnoCrsr, + const SwUnoCursor * const pUnoCursor, SwXBookmarkPortion_ImplList& rBkmArr, const sal_Int32 nIndex) { @@ -628,7 +628,7 @@ static void lcl_ExportBookmark( (BKM_TYPE_START_END == pPtr->nBkmType)) { pPortion = - new SwXTextPortion(pUnoCrsr, xParent, PORTION_BOOKMARK_START); + new SwXTextPortion(pUnoCursor, xParent, PORTION_BOOKMARK_START); rPortions.push_back(pPortion); pPortion->SetBookmark(pPtr->xBookmark); pPortion->SetCollapsed( BKM_TYPE_START_END == pPtr->nBkmType ); @@ -637,7 +637,7 @@ static void lcl_ExportBookmark( if (BKM_TYPE_END == pPtr->nBkmType) { pPortion = - new SwXTextPortion(pUnoCrsr, xParent, PORTION_BOOKMARK_END); + new SwXTextPortion(pUnoCursor, xParent, PORTION_BOOKMARK_END); rPortions.push_back(pPortion); pPortion->SetBookmark(pPtr->xBookmark); } @@ -648,7 +648,7 @@ static void lcl_ExportBookmark( static void lcl_ExportSoftPageBreak( TextRangeList_t & rPortions, Reference<XText> const& xParent, - const SwUnoCrsr * const pUnoCrsr, + const SwUnoCursor * const pUnoCursor, SwSoftPageBreakList& rBreakArr, const sal_Int32 nIndex) { @@ -665,7 +665,7 @@ static void lcl_ExportSoftPageBreak( break; rPortions.push_back( - new SwXTextPortion(pUnoCrsr, xParent, PORTION_SOFT_PAGEBREAK) ); + new SwXTextPortion(pUnoCursor, xParent, PORTION_SOFT_PAGEBREAK) ); rBreakArr.erase( aIter++ ); } } @@ -712,7 +712,7 @@ static Reference<XTextRange> lcl_ExportHints( PortionStack_t & rPortionStack, const Reference<XText> & xParent, - SwUnoCrsr * const pUnoCrsr, + SwUnoCursor * const pUnoCursor, SwpHints * const pHints, const sal_Int32 i_nStartPos, const sal_Int32 i_nEndPos, @@ -725,7 +725,7 @@ lcl_ExportHints( // if the attribute has a dummy character, then xRef is set (except META) // otherwise, the portion for the attribute is inserted into rPortions! Reference<XTextRange> xRef; - SwDoc* pDoc = pUnoCrsr->GetDoc(); + SwDoc* pDoc = pUnoCursor->GetDoc(); //search for special text attributes - first some ends size_t nEndIndex = 0; sal_Int32 nNextEnd = 0; @@ -744,14 +744,14 @@ lcl_ExportHints( case RES_TXTATR_TOXMARK: { Reference<XTextRange> xTmp = lcl_CreateTOXMarkPortion( - xParent, pUnoCrsr, *pAttr, true); + xParent, pUnoCursor, *pAttr, true); rPortionStack.top().first->push_back(xTmp); } break; case RES_TXTATR_REFMARK: { Reference<XTextRange> xTmp = lcl_CreateRefMarkPortion( - xParent, pUnoCrsr, *pAttr, true); + xParent, pUnoCursor, *pAttr, true); rPortionStack.top().first->push_back(xTmp); } break; @@ -760,10 +760,10 @@ lcl_ExportHints( if( *pAttr->GetEnd() == pAttr->GetStart()) { lcl_InsertRubyPortion( *rPortionStack.top().first, - xParent, pUnoCrsr, *pAttr, false); + xParent, pUnoCursor, *pAttr, false); } lcl_InsertRubyPortion( *rPortionStack.top().first, - xParent, pUnoCrsr, *pAttr, true); + xParent, pUnoCursor, *pAttr, true); break; case RES_TXTATR_META: case RES_TXTATR_METAFIELD: @@ -795,7 +795,7 @@ lcl_ExportHints( pCurrentPortions(Top.first); rPortionStack.pop(); const uno::Reference<text::XTextRange> xPortion( - lcl_CreateMetaPortion(xParent, pUnoCrsr, + lcl_CreateMetaPortion(xParent, pUnoCursor, *pAttr, std::move(pCurrentPortions))); rPortionStack.top().first->push_back(xPortion); } @@ -822,13 +822,13 @@ lcl_ExportHints( case RES_TXTATR_FIELD: if(!bRightMoveForbidden) { - pUnoCrsr->Right(1,CRSR_SKIP_CHARS,false,false); - if( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() ) + pUnoCursor->Right(1,CRSR_SKIP_CHARS,false,false); + if( *pUnoCursor->GetMark() == *pUnoCursor->GetPoint() ) break; SwXTextPortion* pPortion; xRef = pPortion = new SwXTextPortion( - pUnoCrsr, xParent, PORTION_FIELD); + pUnoCursor, xParent, PORTION_FIELD); Reference<XTextField> const xField = SwXTextField::CreateXTextField(pDoc, &pAttr->GetFormatField()); @@ -839,22 +839,22 @@ lcl_ExportHints( case RES_TXTATR_ANNOTATION: if(!bRightMoveForbidden) { - pUnoCrsr->Right(1,CRSR_SKIP_CHARS,false,false); - if( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() ) + pUnoCursor->Right(1,CRSR_SKIP_CHARS,false,false); + if( *pUnoCursor->GetMark() == *pUnoCursor->GetPoint() ) break; const SwTextAnnotationField* pTextAnnotationField = dynamic_cast<const SwTextAnnotationField*>( pAttr ); ::sw::mark::IMark* pAnnotationMark = pTextAnnotationField ? pTextAnnotationField->GetAnnotationMark() : nullptr; if ( pAnnotationMark != nullptr ) { - SwXTextPortion* pPortion = new SwXTextPortion( pUnoCrsr, xParent, PORTION_ANNOTATION_END ); + SwXTextPortion* pPortion = new SwXTextPortion( pUnoCursor, xParent, PORTION_ANNOTATION_END ); pPortion->SetBookmark(SwXBookmark::CreateXBookmark( *pDoc, pAnnotationMark)); xRef = pPortion; } else { - SwXTextPortion* pPortion = new SwXTextPortion( pUnoCrsr, xParent, PORTION_ANNOTATION ); + SwXTextPortion* pPortion = new SwXTextPortion( pUnoCursor, xParent, PORTION_ANNOTATION ); Reference<XTextField> xField = SwXTextField::CreateXTextField(pDoc, &pAttr->GetFormatField()); @@ -868,15 +868,15 @@ lcl_ExportHints( if(!bRightMoveForbidden) { - pUnoCrsr->Right( + pUnoCursor->Right( pAttr->GetFormatField().GetField()->ExpandField( true ).getLength() + 2, CRSR_SKIP_CHARS, false, false ); - if( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() ) + if( *pUnoCursor->GetMark() == *pUnoCursor->GetPoint() ) break; SwXTextPortion* pPortion = - new SwXTextPortion( pUnoCrsr, xParent, PORTION_FIELD); + new SwXTextPortion( pUnoCursor, xParent, PORTION_FIELD); xRef = pPortion; Reference<XTextField> xField = SwXTextField::CreateXTextField(pDoc, @@ -888,16 +888,16 @@ lcl_ExportHints( case RES_TXTATR_FLYCNT: if(!bRightMoveForbidden) { - pUnoCrsr->Right(1,CRSR_SKIP_CHARS,false,false); - if( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() ) + pUnoCursor->Right(1,CRSR_SKIP_CHARS,false,false); + if( *pUnoCursor->GetMark() == *pUnoCursor->GetPoint() ) break; // Robust #i81708 content in covered cells // Do not expose inline anchored textboxes. if (rTextBoxes.find(pAttr->GetFlyCnt().GetFrameFormat()) != rTextBoxes.end()) break; - pUnoCrsr->Exchange(); - xRef = new SwXTextPortion( pUnoCrsr, xParent, PORTION_FRAME); + pUnoCursor->Exchange(); + xRef = new SwXTextPortion( pUnoCursor, xParent, PORTION_FRAME); } break; @@ -905,12 +905,12 @@ lcl_ExportHints( { if(!bRightMoveForbidden) { - pUnoCrsr->Right(1,CRSR_SKIP_CHARS,false,false); - if( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() ) + pUnoCursor->Right(1,CRSR_SKIP_CHARS,false,false); + if( *pUnoCursor->GetMark() == *pUnoCursor->GetPoint() ) break; SwXTextPortion* pPortion; xRef = pPortion = new SwXTextPortion( - pUnoCrsr, xParent, PORTION_FOOTNOTE); + pUnoCursor, xParent, PORTION_FOOTNOTE); Reference<XFootnote> xContent = SwXFootnotes::GetObject(*pDoc, pAttr->GetFootnote()); pPortion->SetFootnote(xContent); @@ -926,18 +926,18 @@ lcl_ExportHints( { if (bIsPoint) { - pUnoCrsr->Right(1,CRSR_SKIP_CHARS,false,false); + pUnoCursor->Right(1,CRSR_SKIP_CHARS,false,false); } Reference<XTextRange> xTmp = (RES_TXTATR_REFMARK == nAttrWhich) ? lcl_CreateRefMarkPortion( - xParent, pUnoCrsr, *pAttr, false) + xParent, pUnoCursor, *pAttr, false) : lcl_CreateTOXMarkPortion( - xParent, pUnoCrsr, *pAttr, false); + xParent, pUnoCursor, *pAttr, false); if (bIsPoint) // consume CH_TXTATR! { - pUnoCrsr->Normalize(false); - pUnoCrsr->DeleteMark(); + pUnoCursor->Normalize(false); + pUnoCursor->DeleteMark(); xRef = xTmp; } else // just insert it @@ -952,7 +952,7 @@ lcl_ExportHints( if(pAttr->GetEnd() && (*pAttr->GetEnd() != pAttr->GetStart())) { lcl_InsertRubyPortion( *rPortionStack.top().first, - xParent, pUnoCrsr, *pAttr, false); + xParent, pUnoCursor, *pAttr, false); } break; case RES_TXTATR_META: @@ -961,7 +961,7 @@ lcl_ExportHints( { if (!bRightMoveForbidden) { - pUnoCrsr->Right(1,CRSR_SKIP_CHARS,false,false); + pUnoCursor->Right(1,CRSR_SKIP_CHARS,false,false); o_rbCursorMoved = true; // only if the end is included in selection! if ((i_nEndPos < 0) || @@ -1017,7 +1017,7 @@ lcl_ExportHints( return xRef; } -static void lcl_MoveCursor( SwUnoCrsr * const pUnoCrsr, +static void lcl_MoveCursor( SwUnoCursor * const pUnoCursor, const sal_Int32 nCurrentIndex, const sal_Int32 nNextFrameIndex, const sal_Int32 nNextPortionIndex, @@ -1025,7 +1025,7 @@ static void lcl_MoveCursor( SwUnoCrsr * const pUnoCrsr, const sal_Int32 nNextMarkIndex, const sal_Int32 nEndPos ) { - sal_Int32 nMovePos = pUnoCrsr->GetContentNode()->Len(); + sal_Int32 nMovePos = pUnoCursor->GetContentNode()->Len(); if ((nEndPos >= 0) && (nEndPos < nMovePos)) { @@ -1054,13 +1054,13 @@ static void lcl_MoveCursor( SwUnoCrsr * const pUnoCrsr, if (nMovePos > nCurrentIndex) { - pUnoCrsr->GetPoint()->nContent = nMovePos; + pUnoCursor->GetPoint()->nContent = nMovePos; } } static void lcl_FillRedlineArray( SwDoc const & rDoc, - SwUnoCrsr const & rUnoCrsr, + SwUnoCursor const & rUnoCursor, SwXRedlinePortion_ImplList& rRedArr ) { const SwRedlineTable& rRedTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable(); @@ -1068,7 +1068,7 @@ static void lcl_FillRedlineArray( if ( nRedTableCount > 0 ) { - const SwPosition* pStart = rUnoCrsr.GetPoint(); + const SwPosition* pStart = rUnoCursor.GetPoint(); const SwNodeIndex nOwnNode = pStart->nNode; for(size_t nRed = 0; nRed < nRedTableCount; ++nRed) @@ -1087,11 +1087,11 @@ static void lcl_FillRedlineArray( } static void lcl_FillSoftPageBreakArray( - SwUnoCrsr const & rUnoCrsr, + SwUnoCursor const & rUnoCursor, SwSoftPageBreakList& rBreakArr ) { const SwTextNode *pTextNode = - rUnoCrsr.GetPoint()->nNode.GetNode().GetTextNode(); + rUnoCursor.GetPoint()->nNode.GetNode().GetTextNode(); if( pTextNode ) pTextNode->fillSoftPageBreakList( rBreakArr ); } @@ -1099,7 +1099,7 @@ static void lcl_FillSoftPageBreakArray( static void lcl_ExportRedline( TextRangeList_t & rPortions, Reference<XText> const& xParent, - const SwUnoCrsr * const pUnoCrsr, + const SwUnoCursor * const pUnoCursor, SwXRedlinePortion_ImplList& rRedlineArr, const sal_Int32 nIndex) { @@ -1118,7 +1118,7 @@ static void lcl_ExportRedline( else if ( nIndex == nRealIndex ) { rPortions.push_back( new SwXRedlinePortion( - *pPtr->m_pRedline, pUnoCrsr, xParent, pPtr->m_bStart)); + *pPtr->m_pRedline, pUnoCursor, xParent, pPtr->m_bStart)); rRedlineArr.erase ( aIter++ ); } // MTG: 23/11/05: If we've iterated past nIndex, exit the loop @@ -1130,26 +1130,26 @@ static void lcl_ExportRedline( static void lcl_ExportBkmAndRedline( TextRangeList_t & rPortions, Reference<XText> const & xParent, - const SwUnoCrsr * const pUnoCrsr, + const SwUnoCursor * const pUnoCursor, SwXBookmarkPortion_ImplList& rBkmArr, SwXRedlinePortion_ImplList& rRedlineArr, SwSoftPageBreakList& rBreakArr, const sal_Int32 nIndex) { if (!rBkmArr.empty()) - lcl_ExportBookmark(rPortions, xParent, pUnoCrsr, rBkmArr, nIndex); + lcl_ExportBookmark(rPortions, xParent, pUnoCursor, rBkmArr, nIndex); if (!rRedlineArr.empty()) - lcl_ExportRedline(rPortions, xParent, pUnoCrsr, rRedlineArr, nIndex); + lcl_ExportRedline(rPortions, xParent, pUnoCursor, rRedlineArr, nIndex); if (!rBreakArr.empty()) - lcl_ExportSoftPageBreak(rPortions, xParent, pUnoCrsr, rBreakArr, nIndex); + lcl_ExportSoftPageBreak(rPortions, xParent, pUnoCursor, rBreakArr, nIndex); } static void lcl_ExportAnnotationStarts( TextRangeList_t & rPortions, Reference<XText> const & xParent, - const SwUnoCrsr * const pUnoCrsr, + const SwUnoCursor * const pUnoCursor, SwAnnotationStartPortion_ImplList& rAnnotationStartArr, const sal_Int32 nIndex) { @@ -1170,7 +1170,7 @@ static void lcl_ExportAnnotationStarts( } SwXTextPortion* pPortion = - new SwXTextPortion( pUnoCrsr, xParent, PORTION_ANNOTATION ); + new SwXTextPortion( pUnoCursor, xParent, PORTION_ANNOTATION ); pPortion->SetTextField( pPtr->mxAnnotationField ); rPortions.push_back(pPortion); @@ -1182,7 +1182,7 @@ static void lcl_ExportAnnotationStarts( static sal_Int32 lcl_ExportFrames( TextRangeList_t & rPortions, Reference<XText> const & i_xParent, - SwUnoCrsr * const i_pUnoCrsr, + SwUnoCursor * const i_pUnoCursor, FrameClientSortList_t & i_rFrames, sal_Int32 const i_nCurrentIndex) { @@ -1199,7 +1199,7 @@ static sal_Int32 lcl_ExportFrames( i_rFrames.front().pFrameClient->GetRegisteredIn(); if (pFrame) // Frame could be disposed { - SwXTextPortion* pPortion = new SwXTextPortion(i_pUnoCrsr, i_xParent, + SwXTextPortion* pPortion = new SwXTextPortion(i_pUnoCursor, i_xParent, *static_cast<SwFrameFormat*>( const_cast<SwModify*>( pFrame ) ) ); rPortions.push_back(pPortion); } @@ -1238,59 +1238,59 @@ static sal_Int32 lcl_GetNextIndex( static void lcl_CreatePortions( TextRangeList_t & i_rPortions, uno::Reference< text::XText > const & i_xParentText, - SwUnoCrsr * const pUnoCrsr, + SwUnoCursor * const pUnoCursor, FrameClientSortList_t & i_rFrames, const sal_Int32 i_nStartPos, const sal_Int32 i_nEndPos ) { - if (!pUnoCrsr) + if (!pUnoCursor) return; // set the start if a selection should be exported if ((i_nStartPos > 0) && - (pUnoCrsr->Start()->nContent.GetIndex() != i_nStartPos)) + (pUnoCursor->Start()->nContent.GetIndex() != i_nStartPos)) { - pUnoCrsr->DeleteMark(); - OSL_ENSURE(pUnoCrsr->Start()->nNode.GetNode().GetTextNode() && - (i_nStartPos <= pUnoCrsr->Start()->nNode.GetNode().GetTextNode()-> + pUnoCursor->DeleteMark(); + OSL_ENSURE(pUnoCursor->Start()->nNode.GetNode().GetTextNode() && + (i_nStartPos <= pUnoCursor->Start()->nNode.GetNode().GetTextNode()-> GetText().getLength()), "Incorrect start position" ); // ??? should this be i_nStartPos - current position ? - pUnoCrsr->Right(static_cast<sal_Int32>(i_nStartPos), + pUnoCursor->Right(static_cast<sal_Int32>(i_nStartPos), CRSR_SKIP_CHARS, false, false); } - SwDoc * const pDoc = pUnoCrsr->GetDoc(); + SwDoc * const pDoc = pUnoCursor->GetDoc(); FieldMarks_t FieldMarks; - lcl_FillFieldMarkArray(FieldMarks, *pUnoCrsr, i_nStartPos); + lcl_FillFieldMarkArray(FieldMarks, *pUnoCursor, i_nStartPos); SwXBookmarkPortion_ImplList Bookmarks; - lcl_FillBookmarkArray(*pDoc, *pUnoCrsr, Bookmarks); + lcl_FillBookmarkArray(*pDoc, *pUnoCursor, Bookmarks); SwXRedlinePortion_ImplList Redlines; - lcl_FillRedlineArray(*pDoc, *pUnoCrsr, Redlines); + lcl_FillRedlineArray(*pDoc, *pUnoCursor, Redlines); SwSoftPageBreakList SoftPageBreaks; - lcl_FillSoftPageBreakArray(*pUnoCrsr, SoftPageBreaks); + lcl_FillSoftPageBreakArray(*pUnoCursor, SoftPageBreaks); SwAnnotationStartPortion_ImplList AnnotationStarts; - lcl_FillAnnotationStartArray( *pDoc, *pUnoCrsr, AnnotationStarts ); + lcl_FillAnnotationStartArray( *pDoc, *pUnoCursor, AnnotationStarts ); PortionStack_t PortionStack; PortionStack.push( PortionList_t(&i_rPortions, nullptr) ); - std::set<const SwFrameFormat*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pUnoCrsr->GetNode()); + std::set<const SwFrameFormat*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pUnoCursor->GetNode()); bool bAtEnd( false ); while (!bAtEnd) // every iteration consumes at least current character! { - if (pUnoCrsr->HasMark()) + if (pUnoCursor->HasMark()) { - pUnoCrsr->Normalize(false); - pUnoCrsr->DeleteMark(); + pUnoCursor->Normalize(false); + pUnoCursor->DeleteMark(); } - SwTextNode * const pTextNode = pUnoCrsr->GetNode().GetTextNode(); + SwTextNode * const pTextNode = pUnoCursor->GetNode().GetTextNode(); if (!pTextNode) { OSL_FAIL("lcl_CreatePortions: no TextNode - what now ?"); @@ -1299,24 +1299,24 @@ static void lcl_CreatePortions( SwpHints * const pHints = pTextNode->GetpSwpHints(); const sal_Int32 nCurrentIndex = - pUnoCrsr->GetPoint()->nContent.GetIndex(); + pUnoCursor->GetPoint()->nContent.GetIndex(); // this contains the portion which consumes the character in the // text at nCurrentIndex; i.e. it must be set _once_ per iteration uno::Reference< XTextRange > xRef; - SwUnoCursorHelper::SelectPam(*pUnoCrsr, true); // set mark + SwUnoCursorHelper::SelectPam(*pUnoCursor, true); // set mark const sal_Int32 nFirstFrameIndex = lcl_ExportFrames( *PortionStack.top().first, - i_xParentText, pUnoCrsr, i_rFrames, nCurrentIndex); + i_xParentText, pUnoCursor, i_rFrames, nCurrentIndex); lcl_ExportBkmAndRedline( *PortionStack.top().first, i_xParentText, - pUnoCrsr, Bookmarks, Redlines, SoftPageBreaks, nCurrentIndex ); + pUnoCursor, Bookmarks, Redlines, SoftPageBreaks, nCurrentIndex ); lcl_ExportAnnotationStarts( *PortionStack.top().first, i_xParentText, - pUnoCrsr, + pUnoCursor, AnnotationStarts, nCurrentIndex ); @@ -1329,7 +1329,7 @@ static void lcl_CreatePortions( if (pHints) { // N.B.: side-effects nNextAttrIndex, bCursorMoved; may move cursor - xRef = lcl_ExportHints(PortionStack, i_xParentText, pUnoCrsr, + xRef = lcl_ExportHints(PortionStack, i_xParentText, pUnoCursor, pHints, i_nStartPos, i_nEndPos, nCurrentIndex, bAtEnd, bCursorMoved, nNextAttrIndex, aTextBoxes); if (PortionStack.empty()) @@ -1345,7 +1345,7 @@ static void lcl_CreatePortions( !FieldMarks.empty() && (FieldMarks.front() == nCurrentIndex)) { // moves cursor - xRef = lcl_ExportFieldMark(i_xParentText, pUnoCrsr, pTextNode); + xRef = lcl_ExportFieldMark(i_xParentText, pUnoCursor, pTextNode); FieldMarks.pop_front(); } } @@ -1370,7 +1370,7 @@ static void lcl_CreatePortions( } lcl_MoveCursor( - pUnoCrsr, + pUnoCursor, nCurrentIndex, nFirstFrameIndex, nNextPortionIndex, @@ -1378,13 +1378,13 @@ static void lcl_CreatePortions( nNextMarkIndex, i_nEndPos ); - xRef = new SwXTextPortion(pUnoCrsr, i_xParentText, PORTION_TEXT); + xRef = new SwXTextPortion(pUnoCursor, i_xParentText, PORTION_TEXT); } else if (bAtEnd && !xRef.is() && !pTextNode->Len()) { // special case: for an empty paragraph, we better put out a // text portion because there may be a hyperlink attribute - xRef = new SwXTextPortion(pUnoCrsr, i_xParentText, PORTION_TEXT); + xRef = new SwXTextPortion(pUnoCursor, i_xParentText, PORTION_TEXT); } if (xRef.is()) diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index ce58ecd5cca9..bd4d51bae2a2 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -161,7 +161,7 @@ uno::Reference<container::XEnumeration> SwXRedlineText::createEnumeration() SolarMutexGuard aGuard; SwPaM aPam(aNodeIndex); aPam.Move(fnMoveForward, fnGoNode); - auto pUnoCursor(GetDoc()->CreateUnoCrsr(*aPam.Start())); + auto pUnoCursor(GetDoc()->CreateUnoCursor(*aPam.Start())); return SwXParagraphEnumeration::Create(this, pUnoCursor, CURSOR_REDLINE); } @@ -176,9 +176,9 @@ sal_Bool SwXRedlineText::hasElements( ) throw(uno::RuntimeException, std::excep } SwXRedlinePortion::SwXRedlinePortion(SwRangeRedline const& rRedline, - SwUnoCrsr const*const pPortionCrsr, + SwUnoCursor const*const pPortionCursor, uno::Reference< text::XText > const& xParent, bool const bStart) - : SwXTextPortion(pPortionCrsr, xParent, + : SwXTextPortion(pPortionCursor, xParent, (bStart) ? PORTION_REDLINE_START : PORTION_REDLINE_END) , m_rRedline(rRedline) { @@ -239,8 +239,8 @@ uno::Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName ) { if ( 1 < ( pNodeIdx->GetNode().EndOfSectionIndex() - pNodeIdx->GetNode().GetIndex() ) ) { - SwUnoCrsr& rUnoCrsr = GetCursor(); - uno::Reference<text::XText> xRet = new SwXRedlineText(rUnoCrsr.GetDoc(), *pNodeIdx); + SwUnoCursor& rUnoCursor = GetCursor(); + uno::Reference<text::XText> xRet = new SwXRedlineText(rUnoCursor.GetDoc(), *pNodeIdx); aRet <<= xRet; } else { @@ -260,9 +260,9 @@ uno::Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName ) void SwXRedlinePortion::Validate() throw( uno::RuntimeException ) { - SwUnoCrsr& rUnoCrsr = GetCursor(); + SwUnoCursor& rUnoCursor = GetCursor(); //search for the redline - SwDoc* pDoc = rUnoCrsr.GetDoc(); + SwDoc* pDoc = rUnoCursor.GetDoc(); const SwRedlineTable& rRedTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable(); bool bFound = false; for(size_t nRed = 0; nRed < rRedTable.size() && !bFound; nRed++) @@ -535,7 +535,7 @@ uno::Reference< container::XEnumeration > SwXRedline::createEnumeration() throw return nullptr; SwPaM aPam(*pNodeIndex); aPam.Move(fnMoveForward, fnGoNode); - auto pUnoCursor(GetDoc()->CreateUnoCrsr(*aPam.Start())); + auto pUnoCursor(GetDoc()->CreateUnoCursor(*aPam.Start())); return SwXParagraphEnumeration::Create(this, pUnoCursor, CURSOR_REDLINE); } @@ -564,20 +564,20 @@ uno::Reference< text::XTextCursor > SwXRedline::createTextCursor() throw( uno:: SwPosition aPos(*pNodeIndex); SwXTextCursor *const pXCursor = new SwXTextCursor(*pDoc, this, CURSOR_REDLINE, aPos); - auto& rUnoCrsr(pXCursor->GetCursor()); - rUnoCrsr.Move(fnMoveForward, fnGoNode); + auto& rUnoCursor(pXCursor->GetCursor()); + rUnoCursor.Move(fnMoveForward, fnGoNode); // is here a table? - SwTableNode* pTableNode = rUnoCrsr.GetNode().FindTableNode(); + SwTableNode* pTableNode = rUnoCursor.GetNode().FindTableNode(); SwContentNode* pCont = nullptr; while( pTableNode ) { - rUnoCrsr.GetPoint()->nNode = *pTableNode->EndOfSectionNode(); - pCont = GetDoc()->GetNodes().GoNext(&rUnoCrsr.GetPoint()->nNode); + rUnoCursor.GetPoint()->nNode = *pTableNode->EndOfSectionNode(); + pCont = GetDoc()->GetNodes().GoNext(&rUnoCursor.GetPoint()->nNode); pTableNode = pCont->FindTableNode(); } if(pCont) - rUnoCrsr.GetPoint()->nContent.Assign(pCont, 0); + rUnoCursor.GetPoint()->nContent.Assign(pCont, 0); xRet = static_cast<text::XWordCursor*>(pXCursor); } else diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index c8a06ca629d2..d8b0037dfe9b 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -3161,7 +3161,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( ) pTargetFormat->SetFormatAttr(aLR); pTargetFormat->SetFormatAttr(aUL); SwPageDesc* pStdPgDsc = m_pDoc->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD); - SwFormatFrmSize aFrmSz(ATT_FIX_SIZE); + SwFormatFrameSize aFrameSz(ATT_FIX_SIZE); if(RES_POOLPAGE_STANDARD == rPageDesc.GetPoolFormatId()) { @@ -3169,27 +3169,27 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( ) { const Size aPhysSize( SvxPaperInfo::GetPaperSize( static_cast<Printer*>(m_pDoc->getIDocumentDeviceAccess().getPrinter(false)))); - aFrmSz.SetSize(aPhysSize); + aFrameSz.SetSize(aPhysSize); } else { - aFrmSz.SetSize(SvxPaperInfo::GetDefaultPaperSize()); + aFrameSz.SetSize(SvxPaperInfo::GetDefaultPaperSize()); } } else { - aFrmSz = pStdPgDsc->GetMaster().GetFrmSize(); + aFrameSz = pStdPgDsc->GetMaster().GetFrameSize(); } if(pStdPgDsc->GetLandscape()) { - SwTwips nTmp = aFrmSz.GetHeight(); - aFrmSz.SetHeight(aFrmSz.GetWidth()); - aFrmSz.SetWidth(nTmp); + SwTwips nTmp = aFrameSz.GetHeight(); + aFrameSz.SetHeight(aFrameSz.GetWidth()); + aFrameSz.SetWidth(nTmp); } - pTargetFormat->SetFormatAttr( aFrmSz ); + pTargetFormat->SetFormatAttr( aFrameSz ); } else { diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index ac526d230538..6f93d125fd97 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -207,7 +207,7 @@ static void lcl_SetSpecialProperty(SwFrameFormat* pFormat, case FN_TABLE_WIDTH: case FN_TABLE_RELATIVE_WIDTH: { - SwFormatFrmSize aSz( pFormat->GetFrmSize() ); + SwFormatFrameSize aSz( pFormat->GetFrameSize() ); if(FN_TABLE_WIDTH == pEntry->nWID) { sal_Int32 nWidth = 0; @@ -276,7 +276,7 @@ static uno::Any lcl_GetSpecialProperty(SwFrameFormat* pFormat, const SfxItemProp case FN_TABLE_RELATIVE_WIDTH: { uno::Any aRet; - const SwFormatFrmSize& rSz = pFormat->GetFrmSize(); + const SwFormatFrameSize& rSz = pFormat->GetFrameSize(); if(FN_TABLE_WIDTH == pEntry->nWID) rSz.QueryValue(aRet, MID_FRMSIZE_WIDTH|CONVERT_TWIPS); else if(FN_TABLE_RELATIVE_WIDTH == pEntry->nWID) @@ -573,32 +573,32 @@ static void lcl_InspectLines(SwTableLines& rLines, std::vector<OUString>& rAllNa static bool lcl_FormatTable(SwFrameFormat* pTableFormat) { bool bHasFrames = false; - SwIterator<SwFrm,SwFormat> aIter( *pTableFormat ); - for(SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next()) + SwIterator<SwFrame,SwFormat> aIter( *pTableFormat ); + for(SwFrame* pFrame = aIter.First(); pFrame; pFrame = aIter.Next()) { - vcl::RenderContext* pRenderContext = pFrm->getRootFrm()->GetCurrShell()->GetOut(); - // mba: no TYPEINFO for SwTabFrm - if(!pFrm->IsTabFrm()) + vcl::RenderContext* pRenderContext = pFrame->getRootFrame()->GetCurrShell()->GetOut(); + // mba: no TYPEINFO for SwTabFrame + if(!pFrame->IsTabFrame()) continue; - SwTabFrm* pTabFrm = static_cast<SwTabFrm*>(pFrm); - if(pTabFrm->IsValid()) - pTabFrm->InvalidatePos(); - pTabFrm->SetONECalcLowers(); - pTabFrm->Calc(pRenderContext); + SwTabFrame* pTabFrame = static_cast<SwTabFrame*>(pFrame); + if(pTabFrame->IsValid()) + pTabFrame->InvalidatePos(); + pTabFrame->SetONECalcLowers(); + pTabFrame->Calc(pRenderContext); bHasFrames = true; } return bHasFrames; } -static void lcl_CrsrSelect(SwPaM& rCrsr, bool bExpand) +static void lcl_CursorSelect(SwPaM& rCursor, bool bExpand) { if(bExpand) { - if(!rCrsr.HasMark()) - rCrsr.SetMark(); + if(!rCursor.HasMark()) + rCursor.SetMark(); } - else if(rCrsr.HasMark()) - rCrsr.DeleteMark(); + else if(rCursor.HasMark()) + rCursor.DeleteMark(); } static void lcl_GetTableSeparators(uno::Any& rRet, SwTable* pTable, SwTableBox* pBox, bool bRow) @@ -945,8 +945,8 @@ uno::Reference<text::XTextCursor> SwXCell::createTextCursor() throw( uno::Runtim SwPosition aPos(*pSttNd); SwXTextCursor* const pXCursor = new SwXTextCursor(*GetDoc(), this, CURSOR_TBLTEXT, aPos); - auto& rUnoCrsr(pXCursor->GetCursor()); - rUnoCrsr.Move(fnMoveForward, fnGoNode); + auto& rUnoCursor(pXCursor->GetCursor()); + rUnoCursor.Move(fnMoveForward, fnGoNode); return static_cast<text::XWordCursor*>(pXCursor); } @@ -1089,7 +1089,7 @@ uno::Reference<container::XEnumeration> SwXCell::createEnumeration() throw( uno: return uno::Reference<container::XEnumeration>(); const SwStartNode* pSttNd = pBox->GetSttNd(); SwPosition aPos(*pSttNd); - auto pUnoCursor(GetDoc()->CreateUnoCrsr(aPos)); + auto pUnoCursor(GetDoc()->CreateUnoCursor(aPos)); pUnoCursor->Move(fnMoveForward, fnGoNode); // remember table and start node for later travelling // (used in export of tables in tables) @@ -1304,21 +1304,21 @@ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName, const uno: case FN_UNO_ROW_HEIGHT: case FN_UNO_ROW_AUTO_HEIGHT: { - SwFormatFrmSize aFrmSize(pLn->GetFrameFormat()->GetFrmSize()); + SwFormatFrameSize aFrameSize(pLn->GetFrameFormat()->GetFrameSize()); if(FN_UNO_ROW_AUTO_HEIGHT== pEntry->nWID) { bool bSet = *static_cast<sal_Bool const *>(aValue.getValue()); - aFrmSize.SetHeightSizeType(bSet ? ATT_VAR_SIZE : ATT_FIX_SIZE); + aFrameSize.SetHeightSizeType(bSet ? ATT_VAR_SIZE : ATT_FIX_SIZE); } else { sal_Int32 nHeight = 0; aValue >>= nHeight; - Size aSz(aFrmSize.GetSize()); + Size aSz(aFrameSize.GetSize()); aSz.Height() = convertMm100ToTwip(nHeight); - aFrmSize.SetSize(aSz); + aFrameSize.SetSize(aSz); } - pDoc->SetAttr(aFrmSize, *pLn->ClaimFrameFormat()); + pDoc->SetAttr(aFrameSize, *pLn->ClaimFrameFormat()); } break; @@ -1361,7 +1361,7 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw( case FN_UNO_ROW_HEIGHT: case FN_UNO_ROW_AUTO_HEIGHT: { - const SwFormatFrmSize& rSize = pLn->GetFrameFormat()->GetFrmSize(); + const SwFormatFrameSize& rSize = pLn->GetFrameFormat()->GetFrameSize(); if(FN_UNO_ROW_AUTO_HEIGHT== pEntry->nWID) { aRet <<= ATT_VAR_SIZE == rSize.GetHeightSizeType(); @@ -1431,12 +1431,12 @@ sal_Bool SwXTextTableCursor::supportsService(const OUString& rServiceName) throw { return cppu::supportsService(this, rServiceName); } IMPLEMENT_FORWARD_XINTERFACE2(SwXTextTableCursor,SwXTextTableCursor_Base,OTextCursorHelper) -const SwPaM* SwXTextTableCursor::GetPaM() const { return &GetCrsr(); } -SwPaM* SwXTextTableCursor::GetPaM() { return &GetCrsr(); } +const SwPaM* SwXTextTableCursor::GetPaM() const { return &GetCursor(); } +SwPaM* SwXTextTableCursor::GetPaM() { return &GetCursor(); } const SwDoc* SwXTextTableCursor::GetDoc() const { return GetFrameFormat()->GetDoc(); } SwDoc* SwXTextTableCursor::GetDoc() { return GetFrameFormat()->GetDoc(); } -const SwUnoCrsr& SwXTextTableCursor::GetCrsr() const { return *m_pUnoCrsr; } -SwUnoCrsr& SwXTextTableCursor::GetCrsr() { return *m_pUnoCrsr; } +const SwUnoCursor& SwXTextTableCursor::GetCursor() const { return *m_pUnoCursor; } +SwUnoCursor& SwXTextTableCursor::GetCursor() { return *m_pUnoCursor; } uno::Sequence<OUString> SwXTextTableCursor::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { return {"com.sun.star.text.TextTableCursor"}; } @@ -1448,50 +1448,50 @@ SwXTextTableCursor::SwXTextTableCursor(SwFrameFormat* pFormat, SwTableBox* pBox) SwDoc* pDoc = pFormat->GetDoc(); const SwStartNode* pSttNd = pBox->GetSttNd(); SwPosition aPos(*pSttNd); - m_pUnoCrsr = pDoc->CreateUnoCrsr(aPos, true); - m_pUnoCrsr->Move( fnMoveForward, fnGoNode ); - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(*m_pUnoCrsr); - rTableCrsr.MakeBoxSels(); + m_pUnoCursor = pDoc->CreateUnoCursor(aPos, true); + m_pUnoCursor->Move( fnMoveForward, fnGoNode ); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(*m_pUnoCursor); + rTableCursor.MakeBoxSels(); } SwXTextTableCursor::SwXTextTableCursor(SwFrameFormat& rTableFormat, const SwTableCursor* pTableSelection) : SwClient(&rTableFormat), m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_CURSOR)) { - m_pUnoCrsr = pTableSelection->GetDoc()->CreateUnoCrsr(*pTableSelection->GetPoint(), true); + m_pUnoCursor = pTableSelection->GetDoc()->CreateUnoCursor(*pTableSelection->GetPoint(), true); if(pTableSelection->HasMark()) { - m_pUnoCrsr->SetMark(); - *m_pUnoCrsr->GetMark() = *pTableSelection->GetMark(); + m_pUnoCursor->SetMark(); + *m_pUnoCursor->GetMark() = *pTableSelection->GetMark(); } const SwSelBoxes& rBoxes = pTableSelection->GetSelectedBoxes(); - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(*m_pUnoCrsr); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(*m_pUnoCursor); for(auto pBox : rBoxes) - rTableCrsr.InsertBox(*pBox); - rTableCrsr.MakeBoxSels(); + rTableCursor.InsertBox(*pBox); + rTableCursor.MakeBoxSels(); } OUString SwXTextTableCursor::getRangeName() throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCrsr(); - SwUnoTableCrsr* pTableCrsr = dynamic_cast<SwUnoTableCrsr*>(&rUnoCrsr); + SwUnoCursor& rUnoCursor = GetCursor(); + SwUnoTableCursor* pTableCursor = dynamic_cast<SwUnoTableCursor*>(&rUnoCursor); //!! see also SwChartDataSequence::getSourceRangeRepresentation - if(!pTableCrsr) + if(!pTableCursor) return OUString(); - pTableCrsr->MakeBoxSels(); - const SwStartNode* pNode = pTableCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); + pTableCursor->MakeBoxSels(); + const SwStartNode* pNode = pTableCursor->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); const SwTable* pTable = SwTable::FindTable(GetFrameFormat()); const SwTableBox* pEndBox = pTable->GetTableBox(pNode->GetIndex()); - if(pTableCrsr->HasMark()) + if(pTableCursor->HasMark()) { - pNode = pTableCrsr->GetMark()->nNode.GetNode().FindTableBoxStartNode(); + pNode = pTableCursor->GetMark()->nNode.GetNode().FindTableBoxStartNode(); const SwTableBox* pStartBox = pTable->GetTableBox(pNode->GetIndex()); if(pEndBox != pStartBox) { // need to switch start and end? - if(*pTableCrsr->GetPoint() < *pTableCrsr->GetMark()) + if(*pTableCursor->GetPoint() < *pTableCursor->GetMark()) std::swap(pStartBox, pEndBox); return pStartBox->GetName() + ":" + pEndBox->GetName(); } @@ -1503,90 +1503,90 @@ sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& sCellName, sal_Bool throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCrsr(); - auto& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(rUnoCrsr); - lcl_CrsrSelect(rTableCrsr, bExpand); - return rTableCrsr.GotoTableBox(sCellName); + SwUnoCursor& rUnoCursor = GetCursor(); + auto& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); + lcl_CursorSelect(rTableCursor, bExpand); + return rTableCursor.GotoTableBox(sCellName); } sal_Bool SwXTextTableCursor::goLeft(sal_Int16 Count, sal_Bool bExpand) throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCrsr(); - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(rUnoCrsr); - lcl_CrsrSelect(rTableCrsr, bExpand); - return rTableCrsr.Left(Count, CRSR_SKIP_CHARS, false, false); + SwUnoCursor& rUnoCursor = GetCursor(); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); + lcl_CursorSelect(rTableCursor, bExpand); + return rTableCursor.Left(Count, CRSR_SKIP_CHARS, false, false); } sal_Bool SwXTextTableCursor::goRight(sal_Int16 Count, sal_Bool bExpand) throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCrsr(); - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(rUnoCrsr); - lcl_CrsrSelect(rTableCrsr, bExpand); - return rTableCrsr.Right(Count, CRSR_SKIP_CHARS, false, false); + SwUnoCursor& rUnoCursor = GetCursor(); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); + lcl_CursorSelect(rTableCursor, bExpand); + return rTableCursor.Right(Count, CRSR_SKIP_CHARS, false, false); } sal_Bool SwXTextTableCursor::goUp(sal_Int16 Count, sal_Bool bExpand) throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCrsr(); - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(rUnoCrsr); - lcl_CrsrSelect(rTableCrsr, bExpand); - return rTableCrsr.UpDown(true, Count, nullptr, 0); + SwUnoCursor& rUnoCursor = GetCursor(); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); + lcl_CursorSelect(rTableCursor, bExpand); + return rTableCursor.UpDown(true, Count, nullptr, 0); } sal_Bool SwXTextTableCursor::goDown(sal_Int16 Count, sal_Bool bExpand) throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCrsr(); - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(rUnoCrsr); - lcl_CrsrSelect(rTableCrsr, bExpand); - return rTableCrsr.UpDown(false, Count, nullptr, 0); + SwUnoCursor& rUnoCursor = GetCursor(); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); + lcl_CursorSelect(rTableCursor, bExpand); + return rTableCursor.UpDown(false, Count, nullptr, 0); } void SwXTextTableCursor::gotoStart(sal_Bool bExpand) throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCrsr(); - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(rUnoCrsr); - lcl_CrsrSelect(rTableCrsr, bExpand); - rTableCrsr.MoveTable(fnTableCurr, fnTableStart); + SwUnoCursor& rUnoCursor = GetCursor(); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); + lcl_CursorSelect(rTableCursor, bExpand); + rTableCursor.MoveTable(fnTableCurr, fnTableStart); } void SwXTextTableCursor::gotoEnd(sal_Bool bExpand) throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCrsr(); - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(rUnoCrsr); - lcl_CrsrSelect(rTableCrsr, bExpand); - rTableCrsr.MoveTable(fnTableCurr, fnTableEnd); + SwUnoCursor& rUnoCursor = GetCursor(); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); + lcl_CursorSelect(rTableCursor, bExpand); + rTableCursor.MoveTable(fnTableCurr, fnTableEnd); } sal_Bool SwXTextTableCursor::mergeRange() throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCrsr(); + SwUnoCursor& rUnoCursor = GetCursor(); - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(rUnoCrsr); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); { // HACK: remove pending actions for selecting old style tables - UnoActionRemoveContext aRemoveContext(rTableCrsr); + UnoActionRemoveContext aRemoveContext(rTableCursor); } - rTableCrsr.MakeBoxSels(); + rTableCursor.MakeBoxSels(); bool bResult; { - UnoActionContext aContext(rUnoCrsr.GetDoc()); - bResult = TBLMERGE_OK == rTableCrsr.GetDoc()->MergeTable(rTableCrsr); + UnoActionContext aContext(rUnoCursor.GetDoc()); + bResult = TBLMERGE_OK == rTableCursor.GetDoc()->MergeTable(rTableCursor); } if(bResult) { - size_t nCount = rTableCrsr.GetSelectedBoxesCount(); + size_t nCount = rTableCursor.GetSelectedBoxesCount(); while (nCount--) - rTableCrsr.DeleteBox(nCount); + rTableCursor.DeleteBox(nCount); } - rTableCrsr.MakeBoxSels(); + rTableCursor.MakeBoxSels(); return bResult; } @@ -1596,19 +1596,19 @@ sal_Bool SwXTextTableCursor::splitRange(sal_Int16 Count, sal_Bool Horizontal) SolarMutexGuard aGuard; if (Count <= 0) throw uno::RuntimeException("Illegal first argument: needs to be > 0", static_cast<cppu::OWeakObject*>(this)); - SwUnoCrsr& rUnoCrsr = GetCrsr(); - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(rUnoCrsr); + SwUnoCursor& rUnoCursor = GetCursor(); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); { // HACK: remove pending actions for selecting old style tables - UnoActionRemoveContext aRemoveContext(rTableCrsr); + UnoActionRemoveContext aRemoveContext(rTableCursor); } - rTableCrsr.MakeBoxSels(); + rTableCursor.MakeBoxSels(); bool bResult; { - UnoActionContext aContext(rUnoCrsr.GetDoc()); - bResult = rTableCrsr.GetDoc()->SplitTable(rTableCrsr.GetSelectedBoxes(), !Horizontal, Count); + UnoActionContext aContext(rUnoCursor.GetDoc()); + bResult = rTableCursor.GetDoc()->SplitTable(rTableCursor.GetSelectedBoxes(), !Horizontal, Count); } - rTableCrsr.MakeBoxSels(); + rTableCursor.MakeBoxSels(); return bResult; } @@ -1627,28 +1627,28 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const u std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCrsr(); + SwUnoCursor& rUnoCursor = GetCursor(); auto pEntry(m_pPropSet->getPropertyMap().getByName(rPropertyName)); if(!pEntry) throw beans::UnknownPropertyException("Unknown property: " + rPropertyName, static_cast<cppu::OWeakObject*>(this)); if(pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException("Property is read-only: " + rPropertyName, static_cast<cppu::OWeakObject*>(this)); { - auto pSttNode = rUnoCrsr.GetNode().StartOfSectionNode(); + auto pSttNode = rUnoCursor.GetNode().StartOfSectionNode(); const SwTableNode* pTableNode = pSttNode->FindTableNode(); lcl_FormatTable(pTableNode->GetTable().GetFrameFormat()); } - auto& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(rUnoCrsr); - rTableCrsr.MakeBoxSels(); - SwDoc* pDoc = rUnoCrsr.GetDoc(); + auto& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); + rTableCursor.MakeBoxSels(); + SwDoc* pDoc = rUnoCursor.GetDoc(); switch(pEntry->nWID) { case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush(RES_BACKGROUND); - SwDoc::GetBoxAttr(rUnoCrsr, aBrush); + SwDoc::GetBoxAttr(rUnoCursor, aBrush); aBrush.PutValue(aValue, pEntry->nMemberId); - pDoc->SetBoxAttr(rUnoCrsr, aBrush); + pDoc->SetBoxAttr(rUnoCursor, aBrush); } break; @@ -1656,24 +1656,24 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const u { SfxUInt32Item aNumberFormat(RES_BOXATR_FORMAT); aNumberFormat.PutValue(aValue, 0); - pDoc->SetBoxAttr(rUnoCrsr, aNumberFormat); + pDoc->SetBoxAttr(rUnoCursor, aNumberFormat); } break; case FN_UNO_PARA_STYLE: - SwUnoCursorHelper::SetTextFormatColl(aValue, rUnoCrsr); + SwUnoCursorHelper::SetTextFormatColl(aValue, rUnoCursor); break; default: { SfxItemSet aItemSet(pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID); - SwUnoCursorHelper::GetCrsrAttr(rTableCrsr.GetSelRing(), + SwUnoCursorHelper::GetCursorAttr(rTableCursor.GetSelRing(), aItemSet); if (!SwUnoCursorHelper::SetCursorPropertyValue( - *pEntry, aValue, rTableCrsr.GetSelRing(), aItemSet)) + *pEntry, aValue, rTableCursor.GetSelRing(), aItemSet)) { m_pPropSet->setPropertyValue(*pEntry, aValue, aItemSet); } - SwUnoCursorHelper::SetCrsrAttr(rTableCrsr.GetSelRing(), + SwUnoCursorHelper::SetCursorAttr(rTableCursor.GetSelRing(), aItemSet, SetAttrMode::DEFAULT, true); } } @@ -1686,24 +1686,24 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) std::exception) { SolarMutexGuard aGuard; - SwUnoCrsr& rUnoCrsr = GetCrsr(); + SwUnoCursor& rUnoCursor = GetCursor(); { - auto pSttNode = rUnoCrsr.GetNode().StartOfSectionNode(); + auto pSttNode = rUnoCursor.GetNode().StartOfSectionNode(); const SwTableNode* pTableNode = pSttNode->FindTableNode(); lcl_FormatTable(pTableNode->GetTable().GetFrameFormat()); } - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(rUnoCrsr); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); auto pEntry(m_pPropSet->getPropertyMap().getByName(rPropertyName)); if(!pEntry) throw beans::UnknownPropertyException("Unknown property: " + rPropertyName, static_cast<cppu::OWeakObject*>(this)); - rTableCrsr.MakeBoxSels(); + rTableCursor.MakeBoxSels(); uno::Any aResult; switch(pEntry->nWID) { case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush(RES_BACKGROUND); - if (SwDoc::GetBoxAttr(rUnoCrsr, aBrush)) + if (SwDoc::GetBoxAttr(rUnoCursor, aBrush)) aBrush.QueryValue(aResult, pEntry->nMemberId); } break; @@ -1713,18 +1713,18 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) break; case FN_UNO_PARA_STYLE: { - auto pFormat(SwUnoCursorHelper::GetCurTextFormatColl(rUnoCrsr, false)); + auto pFormat(SwUnoCursorHelper::GetCurTextFormatColl(rUnoCursor, false)); if(pFormat) aResult = uno::makeAny(pFormat->GetName()); } break; default: { - SfxItemSet aSet(rTableCrsr.GetDoc()->GetAttrPool(), + SfxItemSet aSet(rTableCursor.GetDoc()->GetAttrPool(), RES_CHRATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, 0L); - SwUnoCursorHelper::GetCrsrAttr(rTableCrsr.GetSelRing(), aSet); + SwUnoCursorHelper::GetCursorAttr(rTableCursor.GetSelRing(), aSet); m_pPropSet->getPropertyValue(*pEntry, aSet, aResult); } } @@ -1883,7 +1883,7 @@ void SwTableProperties_Impl::ApplyTableAttr(const SwTable& rTable, SwDoc& rDoc) GetProperty(FN_TABLE_WIDTH, 0xff, pWidth); bool bPutSize = pWidth != nullptr; - SwFormatFrmSize aSz(ATT_VAR_SIZE); + SwFormatFrameSize aSz(ATT_VAR_SIZE); if(pWidth) { aSz.PutValue(*pWidth, MID_FRMSIZE_WIDTH); @@ -2201,21 +2201,21 @@ uno::Reference<table::XCellRange> SwXTextTable::GetRangeByName(SwFrameFormat* p const SwStartNode* pSttNd = pTLBox->GetSttNd(); SwPosition aPos(*pSttNd); // set cursor to the upper-left cell of the range - auto pUnoCrsr(pFormat->GetDoc()->CreateUnoCrsr(aPos, true)); - pUnoCrsr->Move(fnMoveForward, fnGoNode); - pUnoCrsr->SetRemainInSection(false); + auto pUnoCursor(pFormat->GetDoc()->CreateUnoCursor(aPos, true)); + pUnoCursor->Move(fnMoveForward, fnGoNode); + pUnoCursor->SetRemainInSection(false); const SwTableBox* pBRBox(pTable->GetTableBox(rBRName)); if(!pBRBox) return nullptr; - pUnoCrsr->SetMark(); - pUnoCrsr->GetPoint()->nNode = *pBRBox->GetSttNd(); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); - SwUnoTableCrsr* pCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr.get()); + pUnoCursor->SetMark(); + pUnoCursor->GetPoint()->nNode = *pBRBox->GetSttNd(); + pUnoCursor->Move( fnMoveForward, fnGoNode ); + SwUnoTableCursor* pCursor = dynamic_cast<SwUnoTableCursor*>(pUnoCursor.get()); // HACK: remove pending actions for selecting old style tables - UnoActionRemoveContext aRemoveContext(*pCrsr); - pCrsr->MakeBoxSels(); - // pUnoCrsr will be provided and will not be deleted - return new SwXCellRange(pUnoCrsr, *pFormat, rDesc); + UnoActionRemoveContext aRemoveContext(*pCursor); + pCursor->MakeBoxSels(); + // pUnoCursor will be provided and will not be deleted + return new SwXCellRange(pUnoCursor, *pFormat, rDesc); } uno::Reference<table::XCellRange> SwXTextTable::getCellRangeByPosition(sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom) @@ -2578,18 +2578,18 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An const SwStartNode* pSttNd = pTLBox->GetSttNd(); SwPosition aPos(*pSttNd); // set cursor to top left cell - auto pUnoCrsr(pDoc->CreateUnoCrsr(aPos, true)); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); - pUnoCrsr->SetRemainInSection( false ); + auto pUnoCursor(pDoc->CreateUnoCursor(aPos, true)); + pUnoCursor->Move( fnMoveForward, fnGoNode ); + pUnoCursor->SetRemainInSection( false ); const SwTableBox* pBRBox = lcl_FindCornerTableBox(rLines, false); - pUnoCrsr->SetMark(); - pUnoCrsr->GetPoint()->nNode = *pBRBox->GetSttNd(); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); - SwUnoTableCrsr& rCrsr = dynamic_cast<SwUnoTableCrsr&>(*pUnoCrsr); + pUnoCursor->SetMark(); + pUnoCursor->GetPoint()->nNode = *pBRBox->GetSttNd(); + pUnoCursor->Move( fnMoveForward, fnGoNode ); + SwUnoTableCursor& rCursor = dynamic_cast<SwUnoTableCursor&>(*pUnoCursor); // HACK: remove pending actions for selecting old style tables - UnoActionRemoveContext aRemoveContext(rCrsr); - rCrsr.MakeBoxSels(); + UnoActionRemoveContext aRemoveContext(rCursor); + rCursor.MakeBoxSels(); SfxItemSet aSet(pDoc->GetAttrPool(), RES_BOX, RES_BOX, @@ -2623,7 +2623,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An aSet.Put(aBox); aSet.Put(aBoxInfo); - pDoc->SetTabBorders(rCrsr, aSet); + pDoc->SetTabBorders(rCursor, aSet); } break; @@ -2767,27 +2767,27 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) const SwStartNode* pSttNd = pTLBox->GetSttNd(); SwPosition aPos(*pSttNd); // set cursor to top left cell - auto pUnoCrsr(pDoc->CreateUnoCrsr(aPos, true)); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); - pUnoCrsr->SetRemainInSection( false ); + auto pUnoCursor(pDoc->CreateUnoCursor(aPos, true)); + pUnoCursor->Move( fnMoveForward, fnGoNode ); + pUnoCursor->SetRemainInSection( false ); const SwTableBox* pBRBox = lcl_FindCornerTableBox(rLines, false); - pUnoCrsr->SetMark(); + pUnoCursor->SetMark(); const SwStartNode* pLastNd = pBRBox->GetSttNd(); - pUnoCrsr->GetPoint()->nNode = *pLastNd; + pUnoCursor->GetPoint()->nNode = *pLastNd; - pUnoCrsr->Move( fnMoveForward, fnGoNode ); - SwUnoTableCrsr& rCrsr = dynamic_cast<SwUnoTableCrsr&>(*pUnoCrsr); + pUnoCursor->Move( fnMoveForward, fnGoNode ); + SwUnoTableCursor& rCursor = dynamic_cast<SwUnoTableCursor&>(*pUnoCursor); // HACK: remove pending actions for selecting old style tables - UnoActionRemoveContext aRemoveContext(rCrsr); - rCrsr.MakeBoxSels(); + UnoActionRemoveContext aRemoveContext(rCursor); + rCursor.MakeBoxSels(); SfxItemSet aSet(pDoc->GetAttrPool(), RES_BOX, RES_BOX, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0); aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); - SwDoc::GetTabBorders(rCrsr, aSet); + SwDoc::GetTabBorders(rCursor, aSet); const SvxBoxInfoItem& rBoxInfoItem = static_cast<const SvxBoxInfoItem&>(aSet.Get(SID_ATTR_BORDER_INNER)); const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX)); @@ -3138,13 +3138,13 @@ uno::Sequence<OUString> SwXCellRange::getSupportedServiceNames() throw( uno::Run "com.sun.star.style.ParagraphPropertiesComplex" }; } -SwXCellRange::SwXCellRange(sw::UnoCursorPointer pCrsr, SwFrameFormat& rFrameFormat, +SwXCellRange::SwXCellRange(sw::UnoCursorPointer pCursor, SwFrameFormat& rFrameFormat, SwRangeDescriptor& rDesc) : SwClient(&rFrameFormat) , m_ChartListeners(m_Mutex) , aRgDesc(rDesc) , m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TABLE_RANGE)) - , m_pTableCrsr(pCrsr) + , m_pTableCursor(pCursor) , m_bFirstRowAsLabel(false) , m_bFirstColumnAsLabel(false) { @@ -3215,21 +3215,21 @@ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByPosition( const SwStartNode* pSttNd = pTLBox->GetSttNd(); SwPosition aPos(*pSttNd); // set cursor in the upper-left cell of the range - auto pUnoCrsr(pFormat->GetDoc()->CreateUnoCrsr(aPos, true)); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); - pUnoCrsr->SetRemainInSection( false ); + auto pUnoCursor(pFormat->GetDoc()->CreateUnoCursor(aPos, true)); + pUnoCursor->Move( fnMoveForward, fnGoNode ); + pUnoCursor->SetRemainInSection( false ); const SwTableBox* pBRBox = pTable->GetTableBox( sBRName ); if(pBRBox) { - pUnoCrsr->SetMark(); - pUnoCrsr->GetPoint()->nNode = *pBRBox->GetSttNd(); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); - SwUnoTableCrsr* pCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr.get()); + pUnoCursor->SetMark(); + pUnoCursor->GetPoint()->nNode = *pBRBox->GetSttNd(); + pUnoCursor->Move( fnMoveForward, fnGoNode ); + SwUnoTableCursor* pCursor = dynamic_cast<SwUnoTableCursor*>(pUnoCursor.get()); // HACK: remove pending actions for selecting old style tables - UnoActionRemoveContext aRemoveContext(*pCrsr); - pCrsr->MakeBoxSels(); - // pUnoCrsr will be provided and will not be deleted - SwXCellRange* pCellRange = new SwXCellRange(pUnoCrsr, *pFormat, aNewDesc); + UnoActionRemoveContext aRemoveContext(*pCursor); + pCursor->MakeBoxSels(); + // pUnoCursor will be provided and will not be deleted + SwXCellRange* pCellRange = new SwXCellRange(pUnoCursor, *pFormat, aNewDesc); aRet = pCellRange; } } @@ -3283,21 +3283,21 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - SwDoc* pDoc = m_pTableCrsr->GetDoc(); - SwUnoTableCrsr& rCrsr = dynamic_cast<SwUnoTableCrsr&>(*m_pTableCrsr); + SwDoc* pDoc = m_pTableCursor->GetDoc(); + SwUnoTableCursor& rCursor = dynamic_cast<SwUnoTableCursor&>(*m_pTableCursor); { // HACK: remove pending actions for selecting old style tables - UnoActionRemoveContext aRemoveContext(rCrsr); + UnoActionRemoveContext aRemoveContext(rCursor); } - rCrsr.MakeBoxSels(); + rCursor.MakeBoxSels(); switch(pEntry->nWID ) { case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush( RES_BACKGROUND ); - SwDoc::GetBoxAttr( *m_pTableCrsr, aBrush ); + SwDoc::GetBoxAttr( *m_pTableCursor, aBrush ); ((SfxPoolItem&)aBrush).PutValue(aValue, pEntry->nMemberId); - pDoc->SetBoxAttr( *m_pTableCrsr, aBrush ); + pDoc->SetBoxAttr( *m_pTableCursor, aBrush ); } break; @@ -3326,20 +3326,20 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An aBoxInfo.SetValid(nValid); aSet.Put(aBoxInfo); - SwDoc::GetTabBorders(rCrsr, aSet); + SwDoc::GetTabBorders(rCursor, aSet); aSet.Put(aBoxInfo); SvxBoxItem aBoxItem(static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX))); ((SfxPoolItem&)aBoxItem).PutValue(aValue, pEntry->nMemberId); aSet.Put(aBoxItem); - pDoc->SetTabBorders( *m_pTableCrsr, aSet ); + pDoc->SetTabBorders( *m_pTableCursor, aSet ); } break; case RES_BOXATR_FORMAT: { SfxUInt32Item aNumberFormat(RES_BOXATR_FORMAT); ((SfxPoolItem&)aNumberFormat).PutValue(aValue, 0); - pDoc->SetBoxAttr(rCrsr, aNumberFormat); + pDoc->SetBoxAttr(rCursor, aNumberFormat); } break; case FN_UNO_RANGE_ROW_LABEL: @@ -3365,15 +3365,15 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An default: { SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID ); - SwUnoCursorHelper::GetCrsrAttr(rCrsr.GetSelRing(), + SwUnoCursorHelper::GetCursorAttr(rCursor.GetSelRing(), aItemSet); if (!SwUnoCursorHelper::SetCursorPropertyValue( - *pEntry, aValue, rCrsr.GetSelRing(), aItemSet)) + *pEntry, aValue, rCursor.GetSelRing(), aItemSet)) { m_pPropSet->setPropertyValue(*pEntry, aValue, aItemSet); } - SwUnoCursorHelper::SetCrsrAttr(rCrsr.GetSelRing(), + SwUnoCursorHelper::SetCursorAttr(rCursor.GetSelRing(), aItemSet, SetAttrMode::DEFAULT, true); } } @@ -3403,20 +3403,20 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush( RES_BACKGROUND ); - if(SwDoc::GetBoxAttr( *m_pTableCrsr, aBrush )) + if(SwDoc::GetBoxAttr( *m_pTableCursor, aBrush )) aBrush.QueryValue(aRet, pEntry->nMemberId); } break; case RES_BOX : { - SwDoc* pDoc = m_pTableCrsr->GetDoc(); + SwDoc* pDoc = m_pTableCursor->GetDoc(); SfxItemSet aSet(pDoc->GetAttrPool(), RES_BOX, RES_BOX, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0); aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); - SwDoc::GetTabBorders(*m_pTableCrsr, aSet); + SwDoc::GetTabBorders(*m_pTableCursor, aSet); const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX)); rBoxItem.QueryValue(aRet, pEntry->nMemberId); } @@ -3427,7 +3427,7 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) case FN_UNO_PARA_STYLE: { SwFormatColl *const pTmpFormat = - SwUnoCursorHelper::GetCurTextFormatColl(*m_pTableCrsr, false); + SwUnoCursorHelper::GetCurTextFormatColl(*m_pTableCursor, false); OUString sRet; if(pFormat) sRet = pTmpFormat->GetName(); @@ -3442,14 +3442,14 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) break; default: { - SfxItemSet aSet(m_pTableCrsr->GetDoc()->GetAttrPool(), + SfxItemSet aSet(m_pTableCursor->GetDoc()->GetAttrPool(), RES_CHRATR_BEGIN, RES_FRMATR_END -1, RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, 0L); // first look at the attributes of the cursor - SwUnoTableCrsr* pCrsr = dynamic_cast<SwUnoTableCrsr*>(&(*m_pTableCrsr)); - SwUnoCursorHelper::GetCrsrAttr(pCrsr->GetSelRing(), aSet); + SwUnoTableCursor* pCursor = dynamic_cast<SwUnoTableCursor*>(&(*m_pTableCursor)); + SwUnoCursorHelper::GetCursorAttr(pCursor->GetSelRing(), aSet); m_pPropSet->getPropertyValue(*pEntry, aSet, aRet); } } @@ -3700,10 +3700,10 @@ void SAL_CALL SwXCellRange::sort(const uno::Sequence< beans::PropertyValue >& rD SwFrameFormat* pFormat(GetFrameFormat()); if(pFormat && SwUnoCursorHelper::ConvertSortProperties(rDescriptor, aSortOpt)) { - SwUnoTableCrsr& rTableCrsr = dynamic_cast<SwUnoTableCrsr&>(*m_pTableCrsr); - rTableCrsr.MakeBoxSels(); + SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(*m_pTableCursor); + rTableCursor.MakeBoxSels(); UnoActionContext aContext(pFormat->GetDoc()); - pFormat->GetDoc()->SortTable(rTableCrsr.GetSelectedBoxes(), aSortOpt); + pFormat->GetDoc()->SortTable(rTableCursor.GetSelectedBoxes(), aSortOpt); } } @@ -3713,18 +3713,18 @@ sal_uInt16 SwXCellRange::getColumnCount() sal_uInt16 SwXCellRange::getRowCount() { return static_cast<sal_uInt16>(aRgDesc.nBottom - aRgDesc.nTop + 1); } -const SwUnoCrsr* SwXCellRange::GetTableCrsr() const +const SwUnoCursor* SwXCellRange::GetTableCursor() const { SwFrameFormat* pFormat = GetFrameFormat(); - return pFormat ? &(*m_pTableCrsr) : nullptr; + return pFormat ? &(*m_pTableCursor) : nullptr; } void SwXCellRange::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew ); - if(!GetRegisteredIn() || !m_pTableCrsr) + if(!GetRegisteredIn() || !m_pTableCursor) { - m_pTableCrsr.reset(nullptr); + m_pTableCursor.reset(nullptr); lang::EventObject const ev(static_cast< ::cppu::OWeakObject&>(*this)); m_ChartListeners.disposeAndClear(ev); } @@ -3827,15 +3827,15 @@ void SwXTableRows::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) SwPosition aPos(*pSttNd); // set cursor to the upper-left cell of the range UnoActionContext aAction(pFrameFormat->GetDoc()); - std::shared_ptr<SwUnoTableCrsr> const pUnoCrsr( - std::dynamic_pointer_cast<SwUnoTableCrsr>( - pFrameFormat->GetDoc()->CreateUnoCrsr(aPos, true))); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); + std::shared_ptr<SwUnoTableCursor> const pUnoCursor( + std::dynamic_pointer_cast<SwUnoTableCursor>( + pFrameFormat->GetDoc()->CreateUnoCursor(aPos, true))); + pUnoCursor->Move( fnMoveForward, fnGoNode ); { // remove actions - TODO: why? - UnoActionRemoveContext aRemoveContext(pUnoCrsr->GetDoc()); + UnoActionRemoveContext aRemoveContext(pUnoCursor->GetDoc()); } - pFrameFormat->GetDoc()->InsertRow(*pUnoCrsr, (sal_uInt16)nCount, bAppend); + pFrameFormat->GetDoc()->InsertRow(*pUnoCursor, (sal_uInt16)nCount, bAppend); } void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) @@ -3855,26 +3855,26 @@ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) const SwStartNode* pSttNd = pTLBox->GetSttNd(); SwPosition aPos(*pSttNd); // set cursor to the upper-left cell of the range - auto pUnoCrsr(pFrameFormat->GetDoc()->CreateUnoCrsr(aPos, true)); - pUnoCrsr->Move(fnMoveForward, fnGoNode); - pUnoCrsr->SetRemainInSection( false ); + auto pUnoCursor(pFrameFormat->GetDoc()->CreateUnoCursor(aPos, true)); + pUnoCursor->Move(fnMoveForward, fnGoNode); + pUnoCursor->SetRemainInSection( false ); const OUString sBLName = sw_GetCellName(0, nIndex + nCount - 1); const SwTableBox* pBLBox = pTable->GetTableBox( sBLName ); if(!pBLBox) throw uno::RuntimeException("Illegal arguments", static_cast<cppu::OWeakObject*>(this)); - pUnoCrsr->SetMark(); - pUnoCrsr->GetPoint()->nNode = *pBLBox->GetSttNd(); - pUnoCrsr->Move(fnMoveForward, fnGoNode); - SwUnoTableCrsr* pCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr.get()); + pUnoCursor->SetMark(); + pUnoCursor->GetPoint()->nNode = *pBLBox->GetSttNd(); + pUnoCursor->Move(fnMoveForward, fnGoNode); + SwUnoTableCursor* pCursor = dynamic_cast<SwUnoTableCursor*>(pUnoCursor.get()); { // HACK: remove pending actions for selecting old style tables - UnoActionRemoveContext aRemoveContext(*pCrsr); + UnoActionRemoveContext aRemoveContext(*pCursor); } - pCrsr->MakeBoxSels(); + pCursor->MakeBoxSels(); { // these braces are important UnoActionContext aAction(pFrameFormat->GetDoc()); - pFrameFormat->GetDoc()->DeleteRow(*pUnoCrsr); - pUnoCrsr.reset(); + pFrameFormat->GetDoc()->DeleteRow(*pUnoCursor); + pUnoCursor.reset(); } { // invalidate all actions - TODO: why? @@ -3966,15 +3966,15 @@ void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) const SwStartNode* pSttNd = pTLBox->GetSttNd(); SwPosition aPos(*pSttNd); UnoActionContext aAction(pFrameFormat->GetDoc()); - auto pUnoCrsr(pFrameFormat->GetDoc()->CreateUnoCrsr(aPos, true)); - pUnoCrsr->Move(fnMoveForward, fnGoNode); + auto pUnoCursor(pFrameFormat->GetDoc()->CreateUnoCursor(aPos, true)); + pUnoCursor->Move(fnMoveForward, fnGoNode); { // remove actions - TODO: why? - UnoActionRemoveContext aRemoveContext(pUnoCrsr->GetDoc()); + UnoActionRemoveContext aRemoveContext(pUnoCursor->GetDoc()); } - pFrameFormat->GetDoc()->InsertCol(*pUnoCrsr, (sal_uInt16)nCount, bAppend); + pFrameFormat->GetDoc()->InsertCol(*pUnoCursor, (sal_uInt16)nCount, bAppend); } ///@see SwXTableRows::removeByIndex (TODO: seems to be copy and paste programming here) @@ -3995,26 +3995,26 @@ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) const SwStartNode* pSttNd = pTLBox->GetSttNd(); SwPosition aPos(*pSttNd); // set cursor to the upper-left cell of the range - auto pUnoCrsr(pFrameFormat->GetDoc()->CreateUnoCrsr(aPos, true)); - pUnoCrsr->Move(fnMoveForward, fnGoNode); - pUnoCrsr->SetRemainInSection(false); + auto pUnoCursor(pFrameFormat->GetDoc()->CreateUnoCursor(aPos, true)); + pUnoCursor->Move(fnMoveForward, fnGoNode); + pUnoCursor->SetRemainInSection(false); const OUString sTRName = sw_GetCellName(nIndex + nCount - 1, 0); const SwTableBox* pTRBox = pTable->GetTableBox(sTRName); if(!pTRBox) throw uno::RuntimeException("Cell not found", static_cast<cppu::OWeakObject*>(this)); - pUnoCrsr->SetMark(); - pUnoCrsr->GetPoint()->nNode = *pTRBox->GetSttNd(); - pUnoCrsr->Move(fnMoveForward, fnGoNode); - SwUnoTableCrsr* pCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr.get()); + pUnoCursor->SetMark(); + pUnoCursor->GetPoint()->nNode = *pTRBox->GetSttNd(); + pUnoCursor->Move(fnMoveForward, fnGoNode); + SwUnoTableCursor* pCursor = dynamic_cast<SwUnoTableCursor*>(pUnoCursor.get()); { // HACK: remove pending actions for selecting old style tables - UnoActionRemoveContext aRemoveContext(*pCrsr); + UnoActionRemoveContext aRemoveContext(*pCursor); } - pCrsr->MakeBoxSels(); + pCursor->MakeBoxSels(); { // these braces are important UnoActionContext aAction(pFrameFormat->GetDoc()); - pFrameFormat->GetDoc()->DeleteCol(*pUnoCrsr); - pUnoCrsr.reset(); + pFrameFormat->GetDoc()->DeleteCol(*pUnoCursor); + pUnoCursor.reset(); } { // invalidate all actions - TODO: why? diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index f10a37853ea9..08213898f90b 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -469,26 +469,26 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) OTextCursorHelper *const pCursor = ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xRangeTunnel); - SwCursor aCrsr(*aPam.GetPoint(), nullptr, false); - SwUnoCursorHelper::SelectPam(aCrsr, true); - aCrsr.Left(1, CRSR_SKIP_CHARS, false, false); + SwCursor aCursor(*aPam.GetPoint(), nullptr, false); + SwUnoCursorHelper::SelectPam(aCursor, true); + aCursor.Left(1, CRSR_SKIP_CHARS, false, false); // here, the PaM needs to be moved: if (pRange) { - pRange->SetPositions(aCrsr); + pRange->SetPositions(aCursor); } else { - SwPaM *const pUnoCrsr = pCursor->GetPaM(); - *pUnoCrsr->GetPoint() = *aCrsr.GetPoint(); - if (aCrsr.HasMark()) + SwPaM *const pUnoCursor = pCursor->GetPaM(); + *pUnoCursor->GetPoint() = *aCursor.GetPoint(); + if (aCursor.HasMark()) { - pUnoCrsr->SetMark(); - *pUnoCrsr->GetMark() = *aCrsr.GetMark(); + pUnoCursor->SetMark(); + *pUnoCursor->GetMark() = *aCursor.GetMark(); } else { - pUnoCrsr->DeleteMark(); + pUnoCursor->DeleteMark(); } } } @@ -2564,7 +2564,7 @@ throw (uno::RuntimeException, std::exception) SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent(); SwPosition aPos(rNode); - auto pUnoCursor(GetDoc()->CreateUnoCrsr(aPos)); + auto pUnoCursor(GetDoc()->CreateUnoCursor(aPos)); pUnoCursor->Move(fnMoveBackward, fnGoDoc); return SwXParagraphEnumeration::Create(this, pUnoCursor, CURSOR_BODY); } @@ -2745,28 +2745,28 @@ SwXHeadFootText::createTextCursor() throw (uno::RuntimeException, std::exception SwPosition aPos(rNode); SwXTextCursor *const pXCursor = new SwXTextCursor(*GetDoc(), this, (m_pImpl->m_bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER, aPos); - auto& rUnoCrsr(pXCursor->GetCursor()); - rUnoCrsr.Move(fnMoveForward, fnGoNode); + auto& rUnoCursor(pXCursor->GetCursor()); + rUnoCursor.Move(fnMoveForward, fnGoNode); // save current start node to be able to check if there is content // after the table - otherwise the cursor would be in the body text! SwStartNode const*const pOwnStartNode = rNode.FindSttNodeByType( (m_pImpl->m_bIsHeader) ? SwHeaderStartNode : SwFooterStartNode); // is there a table here? - SwTableNode* pTableNode = rUnoCrsr.GetNode().FindTableNode(); + SwTableNode* pTableNode = rUnoCursor.GetNode().FindTableNode(); SwContentNode* pCont = nullptr; while (pTableNode) { - rUnoCrsr.GetPoint()->nNode = *pTableNode->EndOfSectionNode(); - pCont = GetDoc()->GetNodes().GoNext(&rUnoCrsr.GetPoint()->nNode); + rUnoCursor.GetPoint()->nNode = *pTableNode->EndOfSectionNode(); + pCont = GetDoc()->GetNodes().GoNext(&rUnoCursor.GetPoint()->nNode); pTableNode = pCont->FindTableNode(); } if (pCont) { - rUnoCrsr.GetPoint()->nContent.Assign(pCont, 0); + rUnoCursor.GetPoint()->nContent.Assign(pCont, 0); } SwStartNode const*const pNewStartNode = - rUnoCrsr.GetNode().FindSttNodeByType( + rUnoCursor.GetNode().FindSttNodeByType( (m_pImpl->m_bIsHeader) ? SwHeaderStartNode : SwFooterStartNode); if (!pNewStartNode || (pNewStartNode != pOwnStartNode)) { @@ -2826,7 +2826,7 @@ throw (uno::RuntimeException, std::exception) const SwFormatContent& rFlyContent = rHeadFootFormat.GetContent(); const SwNode& rNode = rFlyContent.GetContentIdx()->GetNode(); SwPosition aPos(rNode); - auto pUnoCursor(GetDoc()->CreateUnoCrsr(aPos)); + auto pUnoCursor(GetDoc()->CreateUnoCursor(aPos)); pUnoCursor->Move(fnMoveForward, fnGoNode); return SwXParagraphEnumeration::Create(this, pUnoCursor, (m_pImpl->m_bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER); } |