summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-05-23 11:49:33 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-05-26 00:51:13 +0200
commitb23eb203cc696926c748cc81584dff38050224cd (patch)
treeb108f2fb94ced374b3f3ecf267e0849ff7f16e36
parent6ab4c4f9c7b12c6058b08e44d35eb8b386348c55 (diff)
remove old SwUnoCrsrTbl and CreateUnoCrsr
Change-Id: I91e4c7f0e0231b7783affdce63c6ab395a4e219b
-rw-r--r--sw/inc/doc.hxx5
-rw-r--r--sw/inc/docary.hxx6
-rw-r--r--sw/source/core/doc/CntntIdxStore.cxx15
-rw-r--r--sw/source/core/doc/doc.cxx11
-rw-r--r--sw/source/core/doc/doccorr.cxx59
-rw-r--r--sw/source/core/doc/docnew.cxx2
-rw-r--r--sw/source/core/unocore/unocrsr.cxx18
7 files changed, 0 insertions, 116 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 0346079aace7..51ee53a5207a 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -145,7 +145,6 @@ class SwTextFormatColl;
class SwTextFormatColls;
class SwURLStateChanged;
class SwUnoCrsr;
-class SwUnoCrsrTable;
class SwViewShell;
class _SetGetExpField;
class SwDrawContact;
@@ -333,8 +332,6 @@ class SW_DLLPUBLIC SwDoc :
// Hash map to find numrules by name
mutable std::unordered_map<OUString, SwNumRule *, OUStringHash> maNumRuleMap;
- SwUnoCrsrTable *mpUnoCrsrTable;
-
SwPagePreviewPrtData *mpPgPViewPrtData; //< Indenting / spacing for printing of page view.
SwPaM *mpExtInputRing;
@@ -1493,8 +1490,6 @@ public:
void SetOLEObjModified();
// Uno - Interfaces
- const SwUnoCrsrTable& GetUnoCrsrTable() const { return *mpUnoCrsrTable; }
- SwUnoCrsr* CreateUnoCrsr( const SwPosition& rPos, bool bTableCrsr = false );
std::shared_ptr<SwUnoCrsr> CreateUnoCrsr2( const SwPosition& rPos, bool bTableCrsr = false );
// FeShell - Interfaces
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 2d2871f37df5..5544dab15868 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -262,12 +262,6 @@ public:
bool DeleteTableCellRedline( SwDoc* pDoc, const SwTableBox& rTableBox, bool bSaveInUndo, sal_uInt16 nRedlineTypeToDelete );
};
-class SwUnoCrsrTable : public std::set<SwUnoCrsr*> {
-public:
- /// the destructor will free all objects still in the set
- ~SwUnoCrsrTable();
-};
-
typedef std::vector<SwOLENode*> SwOLENodes;
#endif // INCLUDED_SW_INC_DOCARY_HXX
diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx
index b9dc0e526734..70ec055aac48 100644
--- a/sw/source/core/doc/CntntIdxStore.cxx
+++ b/sw/source/core/doc/CntntIdxStore.cxx
@@ -379,21 +379,6 @@ void ContentIdxStoreImpl::RestoreFlys(SwDoc* pDoc, updater_t& rUpdater, bool bAu
void ContentIdxStoreImpl::SaveUnoCrsrs(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent)
{
- for (const SwUnoCrsr* pUnoCrsr : pDoc->GetUnoCrsrTable())
- {
- for(SwPaM& rPaM : (const_cast<SwUnoCrsr*>(pUnoCrsr))->GetRingContainer())
- {
- lcl_ChkPaMBoth( m_aUnoCrsrEntries, nNode, nContent, rPaM);
- }
- const SwUnoTableCrsr* pUnoTableCrsr = dynamic_cast<const SwUnoTableCrsr*>(pUnoCrsr);
- if( pUnoTableCrsr )
- {
- for(SwPaM& rPaM : (&(const_cast<SwUnoTableCrsr*>(pUnoTableCrsr))->GetSelRing())->GetRingContainer())
- {
- lcl_ChkPaMBoth( m_aUnoCrsrEntries, nNode, nContent, rPaM);
- }
- }
- }
for (auto pWeakUnoCrsr : pDoc->mvUnoCrsrTbl2)
{
auto pUnoCrsr(pWeakUnoCrsr.lock());
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 454ea0aab2b5..995aad94f832 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1679,17 +1679,6 @@ bool SwDoc::ContainsHiddenChars() const
return false;
}
-SwUnoCrsr* SwDoc::CreateUnoCrsr( const SwPosition& rPos, bool bTableCrsr )
-{
- SwUnoCrsr* pNew;
- if( bTableCrsr )
- pNew = new SwUnoTableCrsr( rPos );
- else
- pNew = new SwUnoCrsr( rPos );
-
- mpUnoCrsrTable->insert( pNew );
- return pNew;
-}
std::shared_ptr<SwUnoCrsr> SwDoc::CreateUnoCrsr2( const SwPosition& rPos, bool bTblCrsr )
{
std::shared_ptr<SwUnoCrsr> pNew;
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 7f75cd4ce8c3..49a98f26fe51 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -121,47 +121,6 @@ void PaMCorrAbs( const SwPaM& rRange,
}
}
{
- SwUnoCrsrTable& rTable = const_cast<SwUnoCrsrTable&>(pDoc->GetUnoCrsrTable());
-
- for( SwUnoCrsrTable::iterator it = rTable.begin(); it != rTable.end(); ++it )
- {
- SwUnoCrsr *const pUnoCursor = *it;
-
- bool bChange = false; // has the UNO cursor been corrected?
-
- // determine whether the UNO cursor will leave it's designated
- // section
- bool const bLeaveSection =
- pUnoCursor->IsRemainInSection() &&
- ( lcl_FindUnoCrsrSection( aNewPos.nNode.GetNode() ) !=
- lcl_FindUnoCrsrSection(
- pUnoCursor->GetPoint()->nNode.GetNode() ) );
-
- for(SwPaM& rPaM : pUnoCursor->GetRingContainer())
- {
- bChange |= lcl_PaMCorrAbs( rPaM, aStart, aEnd, aNewPos );
- }
-
- SwUnoTableCrsr *const pUnoTableCrsr =
- dynamic_cast<SwUnoTableCrsr *>(*it);
- if( pUnoTableCrsr )
- {
- for(SwPaM& rPaM : (&pUnoTableCrsr->GetSelRing())->GetRingContainer())
- {
- bChange |=
- lcl_PaMCorrAbs( rPaM, aStart, aEnd, aNewPos );
- }
- }
-
- // if a UNO cursor leaves its designated section, we must inform
- // (and invalidate) said cursor
- if (bChange && bLeaveSection)
- {
- // the UNO cursor has left its section. We need to notify it!
- SwMsgPoolItem aHint( RES_UNOCURSOR_LEAVES_SECTION );
- pUnoCursor->ModifyNotification( &aHint, NULL );
- }
- }
for(auto pWeakUnoCrsr : pDoc->mvUnoCrsrTbl2)
{
auto pUnoCursor(pWeakUnoCrsr.lock());
@@ -316,24 +275,6 @@ void PaMCorrRel( const SwNodeIndex &rOldNode,
}
}
{
- SwUnoCrsrTable& rTable = (SwUnoCrsrTable&)pDoc->GetUnoCrsrTable();
- for( SwUnoCrsrTable::iterator it = rTable.begin(); it != rTable.end(); ++it )
- {
- for(SwPaM& rPaM : (*it)->GetRingContainer())
- {
- lcl_PaMCorrRel1( &rPaM, pOldNode, aNewPos, nCntIdx );
- }
-
- SwUnoTableCrsr* pUnoTableCrsr =
- dynamic_cast<SwUnoTableCrsr*>(*it);
- if( pUnoTableCrsr )
- {
- for(SwPaM& rPaM : (&pUnoTableCrsr->GetSelRing())->GetRingContainer())
- {
- lcl_PaMCorrRel1( &rPaM, pOldNode, aNewPos, nCntIdx );
- }
- }
- }
for(auto pWeakUnoCrsr : pDoc->mvUnoCrsrTbl2)
{
auto pUnoCrsr(pWeakUnoCrsr.lock());
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 379f84487367..f546d87be59a 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -250,7 +250,6 @@ SwDoc::SwDoc()
mpURLStateChgd( 0 ),
mpNumberFormatter( 0 ),
mpNumRuleTable( new SwNumRuleTable ),
- mpUnoCrsrTable( new SwUnoCrsrTable() ),
mpPgPViewPrtData( 0 ),
mpExtInputRing( 0 ),
mpStyleAccess( 0 ),
@@ -424,7 +423,6 @@ SwDoc::~SwDoc()
getIDocumentRedlineAccess().GetRedlineTable().DeleteAndDestroyAll();
getIDocumentRedlineAccess().GetExtraRedlineTable().DeleteAndDestroyAll();
- delete mpUnoCrsrTable;
const sw::DocDisposingHint aHint;
std::vector< std::weak_ptr<SwUnoCrsr> > vCursorsToKill(mvUnoCrsrTbl2.begin(), mvUnoCrsrTbl2.end());
for(auto& pWeakCursor : vCursorsToKill)
diff --git a/sw/source/core/unocore/unocrsr.cxx b/sw/source/core/unocore/unocrsr.cxx
index bfdb692b48d8..df918f4ac444 100644
--- a/sw/source/core/unocore/unocrsr.cxx
+++ b/sw/source/core/unocore/unocrsr.cxx
@@ -44,15 +44,6 @@ SwUnoCrsr::~SwUnoCrsr()
{
//assert(!SwIterator<SwClient,SwUnoCrsr>(this).First());
}
- else
- {
- // then remove cursor from array
- SwUnoCrsrTable& rTable = (SwUnoCrsrTable&)pDoc->GetUnoCrsrTable();
- if( !rTable.erase( this ) )
- {
- OSL_ENSURE( false, "UNO Cursor nicht mehr im Array" );
- }
- }
}
// delete the whole ring
@@ -238,13 +229,4 @@ void SwUnoTableCrsr::MakeBoxSels()
}
}
-SwUnoCrsrTable::~SwUnoCrsrTable()
-{
- while (!empty())
- {
- delete *begin();
- erase( begin() );
- }
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */