summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-07-29 16:10:25 -0430
committerRafael Dominguez <venccsralph@gmail.com>2012-07-29 21:29:30 -0430
commit39089e15739eb4de2f055e220976ea501a624e3e (patch)
treee6ec21df6614d37937414ccc5d6fabafded7868a /sfx2
parent76b7f976e4020b90ef5be7151944dd98abd927d7 (diff)
Fetch thumbnails for templates in a remote repository.
Change-Id: I1e2cdfcd7a98a798fde22722e8bba0a1ad8b3cd3
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/templateonlineview.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sfx2/source/control/templateonlineview.cxx b/sfx2/source/control/templateonlineview.cxx
index a7e1c99479a6..2d6c75d8a375 100644
--- a/sfx2/source/control/templateonlineview.cxx
+++ b/sfx2/source/control/templateonlineview.cxx
@@ -26,6 +26,13 @@
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/ucb/XDynamicResultSet.hpp>
+#define ITEM_MAX_WIDTH 192
+#define ITEM_MAX_HEIGHT 192
+#define ITEM_PADDING 5
+#define ITEM_SPACE 20
+#define THUMBNAIL_MAX_HEIGHT 128 - 2*ITEM_PADDING
+#define THUMBNAIL_MAX_WIDTH ITEM_MAX_WIDTH - 2*ITEM_PADDING
+
using namespace com::sun::star;
using namespace com::sun::star::lang;
using namespace com::sun::star::task;
@@ -176,6 +183,9 @@ void TemplateOnlineView::OnItemDblClicked(ThumbnailViewItem *pItem)
aTemplateItem.nId = nIdx+1;
aTemplateItem.nRegionId = pItem->mnId-1;
aTemplateItem.aPath = sRealURL;
+ aTemplateItem.aThumbnail = TemplateAbstractView::fetchThumbnail(sRealURL,
+ THUMBNAIL_MAX_WIDTH,
+ THUMBNAIL_MAX_HEIGHT);
// pData->mbIsRemote = xRow->getBoolean( ROW_IS_REMOTE ) && !xRow->wasNull();
// pData->mbIsRemoveable = xRow->getBoolean( ROW_IS_REMOVEABLE ) && !xRow->wasNull();
aTemplateItem.aName = xRow->getString( ROW_TITLE );