summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-04-03 12:01:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-04-03 14:11:49 +0200
commitf79a67a3d09db860b7bb783cdf9e28a5dcd39ea4 (patch)
tree6a0a39b01d9ddc9557213a9d3745c0b56beb380c /sw
parent65c2ba2daa61e1a7e9faca680abefb13544f04fc (diff)
restore pseudo-level indent for sections
which went missing in... commit 5a2c0ab29719ac914d30d8789c0e386541702cbf Author: Caolán McNamara <caolanm@redhat.com> Date: Fri Feb 28 11:13:12 2020 +0000 weld writer navigator Change-Id: Ia15b282c4621b7e0c35641976ffac18a93ce6a0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91621 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/inc/content.hxx15
-rw-r--r--sw/source/uibase/utlui/content.cxx13
2 files changed, 26 insertions, 2 deletions
diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx
index 4bb37efaa544..414db7068dcb 100644
--- a/sw/source/uibase/inc/content.hxx
+++ b/sw/source/uibase/inc/content.hxx
@@ -53,6 +53,21 @@ class SwOutlineContent : public SwContent
bool IsMoveable() const {return bIsMoveable;};
};
+class SwRegionContent : public SwContent
+{
+
+ sal_uInt8 nRegionLevel;
+
+ public:
+ SwRegionContent( const SwContentType* pCnt,
+ const OUString& rName,
+ sal_uInt8 nLevel,
+ long nYPos) :
+ SwContent(pCnt, rName, nYPos),
+ nRegionLevel(nLevel){}
+ sal_uInt8 GetRegionLevel() const {return nRegionLevel;}
+};
+
class SwURLFieldContent : public SwContent
{
OUString sURL;
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 54f3c6e94caf..db829431569f 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -369,7 +369,8 @@ void SwContentType::Init(bool* pbInvalidateWindow)
pParentFormat = pParentFormat->GetParent();
}
- std::unique_ptr<SwContent> pCnt(new SwContent(this, rSectionName,
+ std::unique_ptr<SwContent> pCnt(new SwRegionContent(this, rSectionName,
+ nLevel,
pFormat->FindLayoutRect( false, &aNullPt ).Top()));
SwPtrMsgPoolItem aAskItem( RES_CONTENT_VISIBLE, nullptr );
@@ -674,7 +675,8 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
pParentFormat = pParentFormat->GetParent();
}
- std::unique_ptr<SwContent> pCnt(new SwContent(this, sSectionName,
+ std::unique_ptr<SwContent> pCnt(new SwRegionContent(this, sSectionName,
+ nLevel,
pFormat->FindLayoutRect( false, &aNullPt ).Top()));
if( !pFormat->GetInfo( aAskItem ) &&
!aAskItem.pObject ) // not visible
@@ -1482,6 +1484,7 @@ bool SwContentTree::RequestingChildren(const weld::TreeIter& rParent)
}
else
{
+ bool bRegion = pCntType->GetType() == ContentTypeId::REGION;
for(size_t i = 0; i < nCount; ++i)
{
const SwContent* pCnt = pCntType->GetMember(i);
@@ -1493,6 +1496,8 @@ bool SwContentTree::RequestingChildren(const weld::TreeIter& rParent)
OUString sId(OUString::number(reinterpret_cast<sal_Int64>(pCnt)));
insert(&rParent, sEntry, sId, nullptr, false, xChild.get());
m_xTreeView->set_sensitive(*xChild, !pCnt->IsInvisible());
+ if (bRegion)
+ m_xTreeView->set_extra_row_indent(*xChild, static_cast<const SwRegionContent*>(pCnt)->GetRegionLevel());
bChild = true;
}
}
@@ -1954,6 +1959,8 @@ void SwContentTree::Display( bool bActive )
if (!bChOnDemand)
{
+ bool bRegion = rpRootContentT->GetType() == ContentTypeId::REGION;
+
std::unique_ptr<weld::TreeIter> xChild = m_xTreeView->make_iterator();
for (size_t i = 0; i < rpRootContentT->GetMemberCount(); ++i)
{
@@ -1966,6 +1973,8 @@ void SwContentTree::Display( bool bActive )
OUString sSubId(OUString::number(reinterpret_cast<sal_Int64>(pCnt)));
insert(xEntry.get(), sEntry, sSubId, nullptr, false, xChild.get());
m_xTreeView->set_sensitive(*xChild, !pCnt->IsInvisible());
+ if (bRegion)
+ m_xTreeView->set_extra_row_indent(*xChild, static_cast<const SwRegionContent*>(pCnt)->GetRegionLevel());
}
}
}