Kaydet (Commit) 7409c8a6 authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide_2: view cursor: IsSelOnePara(),IsStartPara(),IsEndPara()

Change-Id: Idb7bdc139e501dfbd7e7d3b2d4598d211fa11591
üst e2dc30d6
......@@ -502,7 +502,7 @@ public:
bool ShouldWait() const;
// Check if selection is within one paragraph.
inline bool IsSelOnePara() const;
bool IsSelOnePara() const;
/*
* Returns SRectangle, at which the cursor is located.
......@@ -870,12 +870,6 @@ inline bool SwCursorShell::IsMultiSelection() const
return m_pCurrentCursor->GetNext() != m_pCurrentCursor;
}
inline bool SwCursorShell::IsSelOnePara() const
{
return !m_pCurrentCursor->IsMultiSelection() &&
m_pCurrentCursor->GetPoint()->nNode == m_pCurrentCursor->GetMark()->nNode;
}
inline const SwTableNode* SwCursorShell::IsCursorInTable() const
{
return m_pCurrentCursor->GetNode().FindTableNode();
......
......@@ -1045,11 +1045,62 @@ int SwCursorShell::CompareCursorStackMkCurrPt() const
return nRet;
}
bool SwCursorShell::IsSelOnePara() const
{
if (m_pCurrentCursor->IsMultiSelection())
{
return false;
}
if (m_pCurrentCursor->GetPoint()->nNode == m_pCurrentCursor->GetMark()->nNode)
{
return true;
}
if (GetLayout()->IsHideRedlines())
{
SwContentFrame const*const pFrame(GetCurrFrame(false));
auto const n(m_pCurrentCursor->GetMark()->nNode.GetIndex());
return FrameContainsNode(*pFrame, n);
}
return false;
}
bool SwCursorShell::IsSttPara() const
{ return m_pCurrentCursor->GetPoint()->nContent == 0; }
{
if (GetLayout()->IsHideRedlines())
{
SwTextNode const*const pNode(m_pCurrentCursor->GetPoint()->nNode.GetNode().GetTextNode());
if (pNode)
{
SwTextFrame const*const pFrame(static_cast<SwTextFrame*>(
pNode->getLayoutFrame(GetLayout())));
if (pFrame)
{
return pFrame->MapModelToViewPos(*m_pCurrentCursor->GetPoint())
== TextFrameIndex(0);
}
}
}
return m_pCurrentCursor->GetPoint()->nContent == 0;
}
bool SwCursorShell::IsEndPara() const
{ return m_pCurrentCursor->GetPoint()->nContent == m_pCurrentCursor->GetContentNode()->Len(); }
{
if (GetLayout()->IsHideRedlines())
{
SwTextNode const*const pNode(m_pCurrentCursor->GetPoint()->nNode.GetNode().GetTextNode());
if (pNode)
{
SwTextFrame const*const pFrame(static_cast<SwTextFrame*>(
pNode->getLayoutFrame(GetLayout())));
if (pFrame)
{
return pFrame->MapModelToViewPos(*m_pCurrentCursor->GetPoint())
== TextFrameIndex(pFrame->GetText().getLength());
}
}
}
return m_pCurrentCursor->GetPoint()->nContent == m_pCurrentCursor->GetContentNode()->Len();
}
bool SwCursorShell::IsEndOfTable() const
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment