summaryrefslogtreecommitdiff
path: root/sw/source/uibase/docvw/FrameControlsManager.cxx
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2020-12-05 20:57:15 -0900
committerJim Raykowski <raykowj@gmail.com>2020-12-24 07:12:59 +0100
commitc405bae468d887ec77dd3830b7678fcedc2debfd (patch)
tree711071ec86bfc55b74d2250e5e3b9bce6740b431 /sw/source/uibase/docvw/FrameControlsManager.cxx
parent85f39dc62b7feb357535582deec1c18f72f9ef0d (diff)
tdf#138136 tdf#38093 add option to treat sub outline levels as content
Also included in this patch: - Modifications to make all outline content visible during move operations. - Removal of code intended to redraw buttons when layout is changed that seems not to work as intended. - Function IsOutlineContentFolded changed to IsOutlineContentVisible - Change of delay before button is shown to half of what it was. Change-Id: I0dde555ccd0693ca382c1f15326edfdc2fc44a93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107815 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw/source/uibase/docvw/FrameControlsManager.cxx')
-rw-r--r--sw/source/uibase/docvw/FrameControlsManager.cxx35
1 files changed, 28 insertions, 7 deletions
diff --git a/sw/source/uibase/docvw/FrameControlsManager.cxx b/sw/source/uibase/docvw/FrameControlsManager.cxx
index 2232ca7ed869..886021ee89f8 100644
--- a/sw/source/uibase/docvw/FrameControlsManager.cxx
+++ b/sw/source/uibase/docvw/FrameControlsManager.cxx
@@ -218,7 +218,7 @@ void SwFrameControlsManager::SetOutlineContentVisibilityButton(const SwTextNode*
{
const SwContentFrame* pContentFrame = pTextNd->getLayoutFrame(nullptr);
- // has node frame changed or been deleted
+ // has node frame changed or been deleted?
std::map<const SwTextNode*, const SwContentFrame*>::iterator iter = m_aTextNodeContentFrameMap.find(pTextNd);
if (iter != m_aTextNodeContentFrameMap.end())
{
@@ -272,17 +272,38 @@ void SwFrameControlsManager::SetOutlineContentVisibilityButton(const SwTextNode*
{
// show expand button immediately
pWin->Show();
- // outline content might not be folded, this happens on undo, outline moves, and folded outline content reveals
+ /*
+ The outline content might be visible here. This happens on document load,
+ undo outline moves, and show of outline content that itself has outline nodes
+ having outline content visibility attribute false, for example tables and text
+ frames containing outline nodes.
+ */
SwOutlineNodes::size_type nPos;
SwOutlineNodes rOutlineNds = m_pEditWin->GetView().GetWrtShell().GetNodes().GetOutLineNds();
if (rOutlineNds.Seek_Entry(const_cast<SwTextNode*>(pTextNd), &nPos))
{
- // don't toggle if next node is an outline node or end node
- SwNodeIndex aIdx(*pTextNd, 1);
- if (!(aIdx.GetNode().IsEndNode() || ((nPos + 1 < rOutlineNds.size()) && &aIdx.GetNode() == rOutlineNds[nPos +1]))
- && aIdx.GetNode().IsContentNode() && aIdx.GetNode().GetContentNode()->getLayoutFrame(nullptr))
+ SwNodeIndex aIdx(*pTextNd, +1);
+ // there shouldn't be a layout frame
+ // if there is then force visiblity false
+ if (!m_pEditWin->GetView().GetWrtShell().GetViewOptions()->IsTreatSubOutlineLevelsAsContent())
{
- m_pEditWin->GetView().GetWrtShell().ToggleOutlineContentVisibility(nPos, true); // force fold
+ if (!(aIdx.GetNode().IsEndNode() ||
+ (nPos + 1 < rOutlineNds.size() && &aIdx.GetNode() == rOutlineNds[nPos +1]))
+ && aIdx.GetNode().IsContentNode()
+ // this determines if the content is really visible
+ && aIdx.GetNode().GetContentNode()->getLayoutFrame(nullptr))
+ {
+ // force outline content visibility false
+ m_pEditWin->GetView().GetWrtShell().ToggleOutlineContentVisibility(nPos, true);
+ }
+ }
+ else if (!aIdx.GetNode().IsEndNode()
+ && aIdx.GetNode().IsContentNode()
+ // this determines if the content is really visible
+ && aIdx.GetNode().GetContentNode()->getLayoutFrame(nullptr))
+ {
+ // force outline content visibility false
+ m_pEditWin->GetView().GetWrtShell().ToggleOutlineContentVisibility(nPos, true);
}
}
}