summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r--sw/source/core/unocore/unoobj.cxx7
-rw-r--r--sw/source/core/unocore/unoobj2.cxx32
-rw-r--r--sw/source/core/unocore/unotbl.cxx3
3 files changed, 28 insertions, 14 deletions
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 1f8b4d02edfd..4238f8287ccd 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -2945,12 +2945,7 @@ SwXTextCursor::createEnumeration()
}
const CursorType eSetType = (CursorType::TableText == m_pImpl->m_eType)
? CursorType::SelectionInTable : CursorType::Selection;
- SwTableNode const*const pStartNode( (CursorType::TableText == m_pImpl->m_eType)
- ? rUnoCursor.GetPoint()->nNode.GetNode().FindTableNode()
- : nullptr);
- SwTable const*const pTable(
- pStartNode ? & pStartNode->GetTable() : nullptr );
- return SwXParagraphEnumeration::Create(pParentText, pNewCursor, eSetType, pStartNode, pTable);
+ return SwXParagraphEnumeration::Create(pParentText, pNewCursor, eSetType);
}
uno::Type SAL_CALL
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 718f977b5345..8e17f700c4d9 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -435,10 +435,9 @@ struct SwXParagraphEnumerationImpl final : public SwXParagraphEnumeration
, m_pCursor(pCursor)
{
OSL_ENSURE(m_xParentText.is(), "SwXParagraphEnumeration: no parent?");
- OSL_ENSURE( !((CursorType::SelectionInTable == eType) ||
- (CursorType::TableText == eType))
- || (m_pOwnTable && m_pOwnStartNode),
- "SwXParagraphEnumeration: table type but no start node or table?");
+ assert( !((CursorType::SelectionInTable == eType)
+ || (CursorType::TableText == eType))
+ || (m_pOwnTable && m_pOwnStartNode));
if ((CursorType::Selection == m_eCursorType) ||
(CursorType::SelectionInTable == m_eCursorType))
@@ -489,9 +488,30 @@ SwXParagraphEnumeration* SwXParagraphEnumeration::Create(
uno::Reference< text::XText > const& xParent,
const std::shared_ptr<SwUnoCursor>& pCursor,
const CursorType eType,
- SwStartNode const*const pStartNode,
- SwTable const*const pTable)
+ SwTableBox const*const pTableBox)
{
+ SwStartNode const* pStartNode(nullptr);
+ SwTable const* pTable(nullptr);
+ assert((eType == CursorType::TableText) == (pTableBox != nullptr));
+ switch (eType)
+ {
+ case CursorType::TableText:
+ {
+ pStartNode = pTableBox->GetSttNd();
+ pTable = & pStartNode->FindTableNode()->GetTable();
+ break;
+ }
+ case CursorType::SelectionInTable:
+ {
+ SwTableNode const*const pTableNode(
+ pCursor->GetPoint()->nNode.GetNode().FindTableNode());
+ pStartNode = pTableNode;
+ pTable = & pTableNode->GetTable();
+ break;
+ }
+ default:
+ break;
+ }
return new SwXParagraphEnumerationImpl(xParent, pCursor, eType, pStartNode, pTable);
}
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index fbce960453b6..e2e5e123871e 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1154,8 +1154,7 @@ uno::Reference<container::XEnumeration> SwXCell::createEnumeration()
pUnoCursor->Move(fnMoveForward, GoInNode);
// remember table and start node for later travelling
// (used in export of tables in tables)
- SwTable const*const pTable(&pSttNd->FindTableNode()->GetTable());
- return SwXParagraphEnumeration::Create(this, pUnoCursor, CursorType::TableText, pSttNd, pTable);
+ return SwXParagraphEnumeration::Create(this, pUnoCursor, CursorType::TableText, m_pBox);
}
uno::Type SAL_CALL SwXCell::getElementType()