summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-06-05 10:57:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-06-05 20:33:28 +0200
commit68db2d42c1518fdb777faeff891155f350da538c (patch)
tree5a07696b7e09451541ae1215a96863ac14aadfc9 /sfx2
parent638f2642769cc73ad6dfa75d33145f03fa408d7f (diff)
have just one way to set expander image
Change-Id: Ic07709a864620c6146616c8e0a1417343c0937de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95590 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/newhelp.cxx10
-rw-r--r--sfx2/source/appl/newhelp.hxx1
-rw-r--r--sfx2/source/dialog/templdlg.cxx2
3 files changed, 9 insertions, 4 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 9160c231f7e3..8226c637bef0 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -229,7 +229,8 @@ void ContentTabPage_Impl::InitRoot()
OUString sId;
if (bIsFolder)
sId = OUString::number(reinterpret_cast<sal_Int64>(new ContentEntry_Impl(aURL, true)));
- m_xContentBox->insert(nullptr, -1, &aTitle, &sId, nullptr, nullptr, &aClosedBookImage, true, nullptr);
+ m_xContentBox->insert(nullptr, -1, &aTitle, &sId, nullptr, nullptr, true, m_xScratchIter.get());
+ m_xContentBox->set_image(*m_xScratchIter, aClosedBookImage);
}
}
@@ -267,7 +268,8 @@ IMPL_LINK(ContentTabPage_Impl, ExpandingHdl, const weld::TreeIter&, rIter, bool)
if ( bIsFolder )
{
OUString sId = OUString::number(reinterpret_cast<sal_Int64>(new ContentEntry_Impl(aURL, true)));
- m_xContentBox->insert(&rIter, -1, &aTitle, &sId, nullptr, nullptr, &aClosedBookImage, true, nullptr);
+ m_xContentBox->insert(&rIter, -1, &aTitle, &sId, nullptr, nullptr, true, m_xScratchIter.get());
+ m_xContentBox->set_image(*m_xScratchIter, aClosedBookImage);
}
else
{
@@ -276,7 +278,8 @@ IMPL_LINK(ContentTabPage_Impl, ExpandingHdl, const weld::TreeIter&, rIter, bool)
OUString aTargetURL;
if ( aAny >>= aTargetURL )
sId = OUString::number(reinterpret_cast<sal_Int64>(new ContentEntry_Impl(aTargetURL, false)));
- m_xContentBox->insert(&rIter, -1, &aTitle, &sId, nullptr, nullptr, &aDocumentImage, false, nullptr);
+ m_xContentBox->insert(&rIter, -1, &aTitle, &sId, nullptr, nullptr, false, m_xScratchIter.get());
+ m_xContentBox->set_image(*m_xScratchIter, aDocumentImage);
}
}
}
@@ -328,6 +331,7 @@ ContentTabPage_Impl::ContentTabPage_Impl(weld::Widget* pParent, SfxHelpIndexWind
: HelpTabPage_Impl(pParent, pIdxWin, "HelpContentPage",
"sfx/ui/helpcontentpage.ui")
, m_xContentBox(m_xBuilder->weld_tree_view("content"))
+ , m_xScratchIter(m_xContentBox->make_iterator())
, aOpenBookImage(BMP_HELP_CONTENT_BOOK_OPEN)
, aClosedBookImage(BMP_HELP_CONTENT_BOOK_CLOSED)
, aDocumentImage(BMP_HELP_CONTENT_DOC)
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index 6a78b857081e..973f4c7089cc 100644
--- a/sfx2/source/appl/newhelp.hxx
+++ b/sfx2/source/appl/newhelp.hxx
@@ -63,6 +63,7 @@ class ContentTabPage_Impl : public HelpTabPage_Impl
{
private:
std::unique_ptr<weld::TreeView> m_xContentBox;
+ std::unique_ptr<weld::TreeIter> m_xScratchIter;
OUString aOpenBookImage;
OUString aClosedBookImage;
OUString aDocumentImage;
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 03da396a51b5..a6d88a2ffade 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -491,7 +491,7 @@ static void FillBox_Impl(weld::TreeView& rBox,
{
std::unique_ptr<weld::TreeIter> xResult = rBox.make_iterator();
const OUString& rName = pEntry->getName();
- rBox.insert(pParent, -1, &rName, &rName, nullptr, nullptr, nullptr, false, xResult.get());
+ rBox.insert(pParent, -1, &rName, &rName, nullptr, nullptr, false, xResult.get());
for (size_t i = 0; i < pEntry->getChildren().size(); ++i)
FillBox_Impl(rBox, pEntry->getChildren()[i].get(), rEntries, eStyleFamily, xResult.get());