[Libreoffice-commits] core.git: include/vcl vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 11 09:59:04 UTC 2018


 include/vcl/treelist.hxx            |    1 -
 include/vcl/treelistbox.hxx         |    2 --
 vcl/source/treelist/treelist.cxx    |   13 +++----------
 vcl/source/treelist/treelistbox.cxx |    5 -----
 4 files changed, 3 insertions(+), 18 deletions(-)

New commits:
commit b29b405549a527d4f953c5f0a581ea1e5a22afb8
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Dec 11 10:23:16 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Dec 11 10:58:41 2018 +0100

    SvListView::CreateViewData unnecessary
    
    the method and the only override all do the same thing
    
    Change-Id: Id8cb131845f3303fbd51736879aa15661d672400
    Reviewed-on: https://gerrit.libreoffice.org/64923
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/treelist.hxx b/include/vcl/treelist.hxx
index fb4f724d6ede..89193c850580 100644
--- a/include/vcl/treelist.hxx
+++ b/include/vcl/treelist.hxx
@@ -299,7 +299,6 @@ public:
     SvViewDataEntry*         GetViewData( SvTreeListEntry* pEntry );
     bool                HasViewData() const;
 
-    virtual std::unique_ptr<SvViewDataEntry> CreateViewData( SvTreeListEntry* pEntry );
     virtual void        InitViewData( SvViewDataEntry*, SvTreeListEntry* pEntry );
 
     virtual void        ModelHasCleared();
diff --git a/include/vcl/treelistbox.hxx b/include/vcl/treelistbox.hxx
index 43cee9dd8442..ccda59cda51f 100644
--- a/include/vcl/treelistbox.hxx
+++ b/include/vcl/treelistbox.hxx
@@ -293,8 +293,6 @@ protected:
     void            CancelTextEditing();
     bool            EditingCanceled() const;
 
-    // Return value must be derived from SvViewDataEntry!
-    virtual std::unique_ptr<SvViewDataEntry> CreateViewData( SvTreeListEntry* ) override;
     // InitViewData is called right after CreateViewData
     // The Entry is has not yet been added to the View in InitViewData!
     virtual void InitViewData( SvViewDataEntry*, SvTreeListEntry* pEntry ) override;
diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx
index 255b5225dc02..f9078ea36a16 100644
--- a/vcl/source/treelist/treelist.cxx
+++ b/vcl/source/treelist/treelist.cxx
@@ -1122,19 +1122,13 @@ void SvListView::Impl::InitTable()
     pEntry = m_rThis.pModel->First();
     while( pEntry )
     {
-        pViewData = m_rThis.CreateViewData( pEntry );
-        DBG_ASSERT(pViewData,"InitTable:No ViewData");
+        pViewData = o3tl::make_unique<SvViewDataEntry>();
         m_rThis.InitViewData( pViewData.get(), pEntry );
         m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData)));
         pEntry = m_rThis.pModel->Next( pEntry );
     }
 }
 
-std::unique_ptr<SvViewDataEntry> SvListView::CreateViewData( SvTreeListEntry* )
-{
-    return o3tl::make_unique<SvViewDataEntry>();
-}
-
 void SvListView::Clear()
 {
     m_pImpl->m_DataTable.clear();
@@ -1211,7 +1205,7 @@ void SvListView::Impl::ActionMoved()
 void SvListView::Impl::ActionInserted( SvTreeListEntry* pEntry )
 {
     DBG_ASSERT(pEntry,"Insert:No Entry");
-    std::unique_ptr<SvViewDataEntry> pData(m_rThis.CreateViewData( pEntry ));
+    std::unique_ptr<SvViewDataEntry> pData(new SvViewDataEntry());
     m_rThis.InitViewData( pData.get(), pEntry );
     std::pair<SvDataTable::iterator, bool> aSuccess =
         m_DataTable.insert(std::make_pair(pEntry, std::move(pData)));
@@ -1236,8 +1230,7 @@ void SvListView::Impl::ActionInsertedTree( SvTreeListEntry* pEntry )
     while( pCurEntry )
     {
         DBG_ASSERT(m_DataTable.find(pCurEntry) != m_DataTable.end(),"Entry already in Table");
-        std::unique_ptr<SvViewDataEntry> pViewData(m_rThis.CreateViewData(pCurEntry));
-        DBG_ASSERT(pViewData,"No ViewData");
+        std::unique_ptr<SvViewDataEntry> pViewData(new SvViewDataEntry());
         m_rThis.InitViewData( pViewData.get(), pEntry );
         m_DataTable.insert(std::make_pair(pCurEntry, std::move(pViewData)));
         pCurEntry = m_rThis.pModel->Next( pCurEntry );
diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx
index 98b7f6a7cfae..514a43aea13b 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -808,11 +808,6 @@ const SvViewDataItem* SvTreeListBox::GetViewDataItem(const SvTreeListEntry* pEnt
     return &pEntryData->GetItem(nItemPos);
 }
 
-std::unique_ptr<SvViewDataEntry> SvTreeListBox::CreateViewData( SvTreeListEntry* )
-{
-    return o3tl::make_unique<SvViewDataEntry>();
-}
-
 void SvTreeListBox::InitViewData( SvViewDataEntry* pData, SvTreeListEntry* pEntry )
 {
     SvTreeListEntry* pInhEntry = pEntry;


More information about the Libreoffice-commits mailing list