Add an index for tracking SfxDocumentTemplate item.

Change-Id: I7d1672e48ef638ac537e5675ed27b67376666d59
This commit is contained in:
Rafael Dominguez 2012-08-10 20:04:29 -04:30
parent 533194a6b3
commit cacba91215
2 changed files with 7 additions and 1 deletions

View file

@ -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;

View file

@ -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,