From cacba91215f22dad6ddaa055700f40da5b8e8811 Mon Sep 17 00:00:00 2001 From: Rafael Dominguez Date: Fri, 10 Aug 2012 20:04:29 -0430 Subject: [PATCH] Add an index for tracking SfxDocumentTemplate item. Change-Id: I7d1672e48ef638ac537e5675ed27b67376666d59 --- sfx2/inc/sfx2/templateproperties.hxx | 3 ++- sfx2/source/control/templatelocalview.cxx | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 &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,