[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - include/vcl vcl/jsdialog vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 7 09:12:49 UTC 2020


 include/vcl/svtabbx.hxx         |    2 +
 vcl/jsdialog/executor.cxx       |    2 +
 vcl/source/treelist/svtabbx.cxx |   41 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+)

New commits:
commit f177e666d3de0e8cf8c241f346127d02dc691f83
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Dec 7 09:49:01 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Dec 7 10:12:24 2020 +0100

    jsdialog: change selection not merge
    
    Change-Id: Ie76320aef21ca2c94be608ec06726ac0af6a66f4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107335
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index e71990f3c078..40e870533569 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -203,7 +203,9 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
                         = OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
                     int nRow = std::atoi(nRowString.getStr());
 
+                    pTreeView->unselect(pTreeView->get_selected_index());
                     pTreeView->select(nRow);
+                    pTreeView->set_cursor(nRow);
                     LOKTrigger::trigger_changed(*pTreeView);
                     LOKTrigger::trigger_row_activated(*pTreeView);
                     return true;
commit e75c1ab001bdcdab70b15859a7235591178b5360
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Dec 7 08:39:54 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Dec 7 10:12:16 2020 +0100

    jsdialog: dump all columns in treeview
    
    Change-Id: Ia3fbf1c87b49e367c2ff077eee7734540e96b50b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107333
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/include/vcl/svtabbx.hxx b/include/vcl/svtabbx.hxx
index a732736a031c..c849a592a66a 100644
--- a/include/vcl/svtabbx.hxx
+++ b/include/vcl/svtabbx.hxx
@@ -224,6 +224,8 @@ public:
 
     virtual tools::Rectangle        GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) override;
     virtual sal_Int32               GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) override;
+
+    virtual boost::property_tree::ptree DumpAsPropertyTree() override;
 };
 
 #endif // INCLUDED_VCL_SVTABBX_HXX
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index 1696f3e316ba..a5375af509bf 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -48,10 +48,32 @@ static boost::property_tree::ptree lcl_DumpEntryAndSiblings(SvTreeListEntry* pEn
     {
         boost::property_tree::ptree aEntry;
 
+        // simple listbox value
         const SvLBoxItem* pIt = pEntry->GetFirstItem(SvLBoxItemType::String);
         if (pIt)
             aEntry.put("text", static_cast<const SvLBoxString*>(pIt)->GetText());
 
+        // column based data
+        boost::property_tree::ptree aColumns;
+
+        for (size_t i = 0; i < pEntry->ItemCount(); i++)
+        {
+            boost::property_tree::ptree aItem;
+
+            SvLBoxItem& rItem = pEntry->GetItem(i);
+            if (rItem.GetType() == SvLBoxItemType::String)
+            {
+                const SvLBoxString* pStringItem = dynamic_cast<const SvLBoxString*>(&rItem);
+                if (pStringItem)
+                {
+                    aItem.put("text", pStringItem->GetText());
+                    aColumns.push_back(std::make_pair("", aItem));
+                }
+            }
+        }
+
+        aEntry.push_back(std::make_pair("columns", aColumns));
+
         if (bCheckButtons)
         {
             SvButtonState eCheckState = pTabListBox->GetCheckButtonState(pEntry);
@@ -589,6 +611,25 @@ sal_uLong SvHeaderTabListBox::Insert( SvTreeListEntry* pEntry, sal_uLong nRootPo
     return nPos;
 }
 
+boost::property_tree::ptree SvHeaderTabListBox::DumpAsPropertyTree()
+{
+    boost::property_tree::ptree aTree(SvTabListBox::DumpAsPropertyTree());
+
+    boost::property_tree::ptree aHeaders;
+
+    HeaderBar* pHeaderBar = GetHeaderBar();
+    for(sal_uInt16 i = 0; i < pHeaderBar->GetItemCount(); i++)
+    {
+        boost::property_tree::ptree aHeader;
+        aHeader.put("text", pHeaderBar->GetItemText(pHeaderBar->GetItemId(i)));
+        aHeaders.push_back(std::make_pair("", aHeader));
+    }
+
+    aTree.push_back(std::make_pair("headers", aHeaders));
+
+    return aTree;
+}
+
 IMPL_LINK_NOARG(SvHeaderTabListBox, ScrollHdl_Impl, SvTreeListBox*, void)
 {
     m_pImpl->m_pHeaderBar->SetOffset( -GetXOffset() );


More information about the Libreoffice-commits mailing list