diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2012-07-05 20:14:00 -0430 |
---|---|---|
committer | Rafael Dominguez <venccsralph@gmail.com> | 2012-07-05 20:14:00 -0430 |
commit | 551948e6239926c414e2f26c95d0a71f7b88a355 (patch) | |
tree | 231dec926cf5639e26e6e8936b44c51eb5977c91 | |
parent | 2691b4db8242aa82c7c77a54902ae112fae635d0 (diff) |
Fix moving templates between folders.
Change-Id: I1befe0add1bdff518c4553a8116d4fed235fd1b8
-rw-r--r-- | sfx2/source/control/templatefolderview.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sfx2/source/control/templatefolderview.cxx b/sfx2/source/control/templatefolderview.cxx index 4f394288f315..022fb47cf6ea 100644 --- a/sfx2/source/control/templatefolderview.cxx +++ b/sfx2/source/control/templatefolderview.cxx @@ -519,17 +519,18 @@ bool TemplateFolderView::moveTemplates(std::set<const ThumbnailViewItem *> &rIte std::set<const ThumbnailViewItem*>::iterator aSelIter; for ( aSelIter = rItems.begin(); aSelIter != rItems.end(); ++aSelIter ) { + const TemplateViewItem *pViewItem = static_cast<const TemplateViewItem*>(*aSelIter); + sal_uInt16 nTargetRegion = pTarget->mnId-1; - sal_uInt16 nTargetIdx = pTarget->maTemplates.back()->mnId; // Last Assigned in filesystem is mnId-1 + sal_uInt16 nTargetIdx = mpDocTemplates->GetCount(nTargetRegion); // Next Idx - if (!mpDocTemplates->Move(nTargetRegion,nTargetIdx,mpItemView->getRegionId(),(*aSelIter)->mnId-1)) + if (!mpDocTemplates->Move(nTargetRegion,nTargetIdx,nSrcRegionId,pViewItem->mnId-1)) { ret = false; continue; } // move template to destination - const TemplateViewItem *pViewItem = static_cast<const TemplateViewItem*>(*aSelIter); TemplateViewItem *pTemplateItem = new TemplateViewItem(*mpItemView,mpItemView); pTemplateItem->mnId = nTargetIdx + 1; |