summaryrefslogtreecommitdiff
path: root/sfx2/source/control/templatelocalview.cxx
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-08-07 10:27:44 -0430
committerRafael Dominguez <venccsralph@gmail.com>2012-08-08 10:25:52 -0430
commitef71e97d8cae548a46a0040de68df35e5a300905 (patch)
treebba3cb161810034cf4b948bc7636c58846d5434d /sfx2/source/control/templatelocalview.cxx
parent0817e7c0943e9f89db1cf58f50fcc81c6a302682 (diff)
Reload view templates when click refresh button.
- Force remote repository to fetch new template list and update cache. Change-Id: I9d7d67d367023323ca43731d78a275d389a9cf15
Diffstat (limited to 'sfx2/source/control/templatelocalview.cxx')
-rw-r--r--sfx2/source/control/templatelocalview.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index 9fff6d2b9c56..a1dd938ac84d 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -174,6 +174,30 @@ void TemplateLocalView::Populate ()
Invalidate();
}
+void TemplateLocalView::reload ()
+{
+ mpDocTemplates->Update();
+
+ Clear();
+
+ Populate();
+
+ if (mpItemView->IsVisible())
+ {
+ sal_uInt16 nItemId = mpItemView->getId() + 1;
+
+ for (size_t i = 0; i < mItemList.size(); ++i)
+ {
+ if (mItemList[i]->mnId == nItemId)
+ {
+ mpItemView->Clear();
+ mpItemView->InsertItems(static_cast<TemplateLocalViewItem*>(mItemList[i])->maTemplates);
+ break;
+ }
+ }
+ }
+}
+
std::vector<rtl::OUString> TemplateLocalView::getFolderNames()
{
size_t n = mItemList.size();