[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 3 12:12:25 UTC 2020


 sw/source/uibase/inc/content.hxx   |   15 +++++++++++++++
 sw/source/uibase/utlui/content.cxx |   13 +++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)

New commits:
commit f79a67a3d09db860b7bb783cdf9e28a5dcd39ea4
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Apr 3 12:01:23 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Apr 3 14:11:49 2020 +0200

    restore pseudo-level indent for sections
    
    which went missing in...
    
    commit 5a2c0ab29719ac914d30d8789c0e386541702cbf
    Author: Caolán McNamara <caolanm at 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 at redhat.com>

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());
                     }
                 }
             }


More information about the Libreoffice-commits mailing list