summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-07-05 21:11:25 -0430
committerRafael Dominguez <venccsralph@gmail.com>2012-07-05 21:11:25 -0430
commit23c3e635a2c048692deb327bbc21866d19f1806e (patch)
treebbc9356cca56601d86f2eff614db0bbca4efaf54 /sfx2
parent6e21f93b752167b27e78055cffcdfd9898152a8a (diff)
Update folder thumbnails after moving or copying templates.
Change-Id: I25596759c78a8898b5059db9c39b752f80075a2b
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/templatefolderview.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sfx2/source/control/templatefolderview.cxx b/sfx2/source/control/templatefolderview.cxx
index 89479cdcccda..ef58cfe26d6c 100644
--- a/sfx2/source/control/templatefolderview.cxx
+++ b/sfx2/source/control/templatefolderview.cxx
@@ -36,6 +36,8 @@
#define INIT_VIEW_COLS 3
#define INIT_VIEW_LINES 1
+void lcl_updateThumbnails (TemplateFolderViewItem *pItem);
+
BitmapEx lcl_ScaleImg (const BitmapEx &rImg, long width, long height)
{
BitmapEx aImg = rImg;
@@ -576,6 +578,11 @@ bool TemplateFolderView::moveTemplates(std::set<const ThumbnailViewItem *> &rIte
if (refresh)
{
+ lcl_updateThumbnails(pSrc);
+ lcl_updateThumbnails(pTarget);
+
+ CalculateItemPositions();
+
Invalidate();
mpItemView->Invalidate();
}
@@ -679,4 +686,24 @@ IMPL_LINK_NOARG(TemplateFolderView, OverlayCloseHdl)
return 0;
}
+void lcl_updateThumbnails (TemplateFolderViewItem *pItem)
+{
+ // Update folder thumbnails
+ for (size_t i = 0, n = pItem->maTemplates.size(); i < 2 && i < n; ++i)
+ {
+ if (i == 0)
+ {
+ pItem->maPreview1 = lcl_ScaleImg(pItem->maTemplates[i]->maPreview1,
+ THUMBNAIL_MAX_WIDTH*0.75,
+ THUMBNAIL_MAX_HEIGHT*0.75);
+ }
+ else
+ {
+ pItem->maPreview1 = lcl_ScaleImg(pItem->maTemplates[i]->maPreview1,
+ THUMBNAIL_MAX_WIDTH*0.75,
+ THUMBNAIL_MAX_HEIGHT*0.75);
+ }
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */