summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-08-10 20:04:29 -0430
committerRafael Dominguez <venccsralph@gmail.com>2012-08-11 19:57:41 -0430
commitcacba91215f22dad6ddaa055700f40da5b8e8811 (patch)
treec35cf5d60edcd07340554c7f13995faaa7b9ec23 /sfx2
parent533194a6b39fd7e7bb2359c75ce242dc65f97f12 (diff)
Add an index for tracking SfxDocumentTemplate item.
Change-Id: I7d1672e48ef638ac537e5675ed27b67376666d59
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/templateproperties.hxx3
-rw-r--r--sfx2/source/control/templatelocalview.cxx5
2 files changed, 7 insertions, 1 deletions
diff --git a/sfx2/inc/sfx2/templateproperties.hxx b/sfx2/inc/sfx2/templateproperties.hxx
index 8891ee956b27..ffa9003955a8 100644
--- a/sfx2/inc/sfx2/templateproperties.hxx
+++ b/sfx2/inc/sfx2/templateproperties.hxx
@@ -15,7 +15,8 @@
struct TemplateItemProperties
{
- sal_uInt16 nId;
+ sal_uInt16 nId; ///< Index for ThumbnailView
+ sal_uInt16 nDocId; ///< Index based on SfxTemplateDocument
sal_uInt16 nRegionId;
rtl::OUString aName;
rtl::OUString aPath;
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index a1dd938ac84d..63a6739c8019 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -154,6 +154,7 @@ void TemplateLocalView::Populate ()
TemplateItemProperties aProperties;;
aProperties.nId = j+1;
+ aProperties.nDocId = j;
aProperties.nRegionId = i;
aProperties.aName = aName;
aProperties.aPath = aURL;
@@ -384,6 +385,7 @@ bool TemplateLocalView::moveTemplate (const ThumbnailViewItem *pItem, const sal_
TemplateItemProperties aTemplateItem;
aTemplateItem.nId = nTargetIdx + 1;
+ aTemplateItem.nDocId = nTargetIdx;
aTemplateItem.nRegionId = nTargetRegion;
aTemplateItem.aName = pViewItem->maTitle;
aTemplateItem.aPath = pViewItem->getPath();
@@ -478,6 +480,7 @@ bool TemplateLocalView::moveTemplates(std::set<const ThumbnailViewItem *> &rItem
TemplateItemProperties aTemplateItem;
aTemplateItem.nId = nTargetIdx + 1;
+ aTemplateItem.nDocId = nTargetIdx;
aTemplateItem.nRegionId = nTargetRegion;
aTemplateItem.aName = pViewItem->maTitle;
aTemplateItem.aPath = pViewItem->getPath();
@@ -538,6 +541,7 @@ void TemplateLocalView::copyFrom(const sal_uInt16 nRegionItemId, const BitmapEx
{
TemplateItemProperties aTemplate;
aTemplate.nId = nId+1;
+ aTemplate.nDocId = nId;
aTemplate.nRegionId = nRegionId;
aTemplate.aName = aPath;
aTemplate.aThumbnail = rThumbnail;
@@ -574,6 +578,7 @@ void TemplateLocalView::copyFrom (TemplateLocalViewItem *pItem, const rtl::OUStr
{
TemplateItemProperties aTemplate;
aTemplate.nId = nId+1;
+ aTemplate.nDocId = nId;
aTemplate.nRegionId = nRegionId;
aTemplate.aName = mpDocTemplates->GetName(nRegionId,nId);
aTemplate.aThumbnail = TemplateAbstractView::fetchThumbnail(rPath,