summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-18 12:44:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-18 12:46:23 +0100
commite90982f5962968a0f334d232b3be54fcdb736e1d (patch)
treef9a90ebe599a619613738aa79885506d4103ee7b /sfx2
parente3172bbaa08e6a097b0503860b2f4c60e5cc23be (diff)
Resolves: fdo#69444 cursor keys don't move between recent used docs
because each item is identified by an id, but that isn't set on the recent used so it stays stuck on the first one. change the ctor of the base element to require an id to be passed to it and adjust all the good code and then use the index+1 of the recently used elements as the id. Change-Id: I1e5978ddedbd4718923ef72d67598158d5ba8ee7
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/recentdocsview.cxx6
-rw-r--r--sfx2/source/control/recentdocsviewitem.cxx5
-rw-r--r--sfx2/source/control/templateabstractview.cxx6
-rw-r--r--sfx2/source/control/templatecontaineritem.cxx4
-rw-r--r--sfx2/source/control/templatelocalview.cxx12
-rw-r--r--sfx2/source/control/templatesearchview.cxx3
-rw-r--r--sfx2/source/control/templateviewitem.cxx4
-rw-r--r--sfx2/source/control/thumbnailviewitem.cxx4
-rw-r--r--sfx2/source/inc/templatesearchviewitem.hxx4
9 files changed, 21 insertions, 27 deletions
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 109991184b52..5e3c796f41c7 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -136,9 +136,9 @@ BitmapEx RecentDocsView::getDefaultThumbnail(const OUString &rURL)
return aImg;
}
-void RecentDocsView::insertItem(const OUString &rURL, const OUString &rTitle)
+void RecentDocsView::insertItem(const OUString &rURL, const OUString &rTitle, sal_uInt16 nId)
{
- RecentDocsViewItem *pChild = new RecentDocsViewItem(*this, rURL, rTitle);
+ RecentDocsViewItem *pChild = new RecentDocsViewItem(*this, rURL, rTitle, nId);
AppendItem(pChild);
}
@@ -167,7 +167,7 @@ void RecentDocsView::loadRecentDocs()
if( isAcceptedFile(aURL) )
{
- insertItem(aURL, aTitle);
+ insertItem(aURL, aTitle, i+1);
}
}
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx
index a4024ae36629..3817d0d169fb 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -13,8 +13,9 @@
#include <sfx2/recentdocsview.hxx>
#include <tools/urlobj.hxx>
-RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rURL, const OUString &rTitle)
- : ThumbnailViewItem(rView)
+RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rURL,
+ const OUString &rTitle, sal_uInt16 nId)
+ : ThumbnailViewItem(rView, nId)
{
RecentDocsView& rRecentView = dynamic_cast<RecentDocsView&>(rView);
long nThumbnailSize = rRecentView.GetThumbnailSize();
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index 9eb0a0136ba0..32f1372842ae 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -162,8 +162,7 @@ void TemplateAbstractView::insertItem(const TemplateItemProperties &rTemplate)
{
const TemplateItemProperties *pCur = &rTemplate;
- TemplateViewItem *pChild = new TemplateViewItem(*this);
- pChild->mnId = pCur->nId;
+ TemplateViewItem *pChild = new TemplateViewItem(*this, pCur->nId);
pChild->mnDocId = pCur->nDocId;
pChild->mnRegionId = pCur->nRegionId;
pChild->maTitle = pCur->aName;
@@ -190,10 +189,9 @@ void TemplateAbstractView::insertItems(const std::vector<TemplateItemProperties>
for (size_t i = 0, n = rTemplates.size(); i < n; ++i )
{
//TODO: CHECK IF THE ITEM IS A FOLDER OR NOT
- TemplateViewItem *pChild = new TemplateViewItem(*this);
const TemplateItemProperties *pCur = &rTemplates[i];
- pChild->mnId = pCur->nId;
+ TemplateViewItem *pChild = new TemplateViewItem(*this, pCur->nId);
pChild->mnDocId = pCur->nDocId;
pChild->mnRegionId = pCur->nRegionId;
pChild->maTitle = pCur->aName;
diff --git a/sfx2/source/control/templatecontaineritem.cxx b/sfx2/source/control/templatecontaineritem.cxx
index 5dc8c301ee88..fb0cf99c9815 100644
--- a/sfx2/source/control/templatecontaineritem.cxx
+++ b/sfx2/source/control/templatecontaineritem.cxx
@@ -28,8 +28,8 @@ using namespace basegfx::tools;
using namespace drawinglayer::attribute;
using namespace drawinglayer::primitive2d;
-TemplateContainerItem::TemplateContainerItem (ThumbnailView &rView)
- : ThumbnailViewItem(rView)
+TemplateContainerItem::TemplateContainerItem (ThumbnailView &rView, sal_uInt16 nId)
+ : ThumbnailViewItem(rView, nId)
{
}
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index bcc0d7d27cb0..a6933a372f9a 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -71,8 +71,7 @@ void TemplateLocalView::Populate ()
{
OUString aRegionName(mpDocTemplates->GetFullRegionName(i));
- TemplateContainerItem* pItem = new TemplateContainerItem( *this );
- pItem->mnId = i+1;
+ TemplateContainerItem* pItem = new TemplateContainerItem( *this, i+1 );
pItem->mnRegionId = i;
pItem->maTitle = aRegionName;
pItem->setSelectClickHdl(LINK(this,ThumbnailView,OnItemSelected));
@@ -139,8 +138,7 @@ void TemplateLocalView::showRootRegion()
for (int i = 0, n = maRegions.size(); i < n; ++i)
{
TemplateContainerItem *pCur = maRegions[i];
- TemplateContainerItem *pItem = new TemplateContainerItem(*this);
- pItem->mnId = pCur->mnId;
+ TemplateContainerItem *pItem = new TemplateContainerItem(*this, pCur->mnId);
pItem->mnRegionId = pCur->mnRegionId;
pItem->maTitle = pCur->maTitle;
pItem->maTemplates = pCur->maTemplates;
@@ -272,16 +270,14 @@ sal_uInt16 TemplateLocalView::createRegion(const OUString &rName)
OUString aRegionName = rName;
// Insert to the region cache list and to the thumbnail item list
- TemplateContainerItem* pItem = new TemplateContainerItem( *this );
- pItem->mnId = nItemId;
+ TemplateContainerItem* pItem = new TemplateContainerItem( *this, nItemId );
pItem->mnRegionId = nRegionId;
pItem->maTitle = aRegionName;
pItem->setSelectClickHdl(LINK(this,ThumbnailView,OnItemSelected));
maRegions.push_back(pItem);
- pItem = new TemplateContainerItem(*this);
- pItem->mnId = nItemId;
+ pItem = new TemplateContainerItem(*this, nItemId);
pItem->mnRegionId = nRegionId;
pItem->maTitle = aRegionName;
pItem->setSelectClickHdl(LINK(this,ThumbnailView,OnItemSelected));
diff --git a/sfx2/source/control/templatesearchview.cxx b/sfx2/source/control/templatesearchview.cxx
index 2942b66a9726..87bd69cd6653 100644
--- a/sfx2/source/control/templatesearchview.cxx
+++ b/sfx2/source/control/templatesearchview.cxx
@@ -25,8 +25,7 @@ void TemplateSearchView::AppendItem(sal_uInt16 nAssocItemId, sal_uInt16 nRegionI
const OUString &rPath,
const BitmapEx &rImage)
{
- TemplateSearchViewItem *pItem = new TemplateSearchViewItem(*this);
- pItem->mnId = getNextItemId();
+ TemplateSearchViewItem *pItem = new TemplateSearchViewItem(*this, getNextItemId());
pItem->mnAssocId = nAssocItemId;
pItem->mnDocId = nIdx;
pItem->mnRegionId = nRegionId;
diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx
index f488f81697de..116a4c0d8708 100644
--- a/sfx2/source/control/templateviewitem.cxx
+++ b/sfx2/source/control/templateviewitem.cxx
@@ -28,8 +28,8 @@ using namespace basegfx::tools;
using namespace drawinglayer::attribute;
using namespace drawinglayer::primitive2d;
-TemplateViewItem::TemplateViewItem (ThumbnailView &rView)
- : ThumbnailViewItem(rView),
+TemplateViewItem::TemplateViewItem (ThumbnailView &rView, sal_uInt16 nId)
+ : ThumbnailViewItem(rView, nId),
mnRegionId(USHRT_MAX),
mnDocId(USHRT_MAX)
{
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index b2beb6dc786d..791d981f157d 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -104,9 +104,9 @@ void ResizableMultiLineEdit::Modify()
mpItem->updateTitleEditSize();
}
-ThumbnailViewItem::ThumbnailViewItem(ThumbnailView &rView)
+ThumbnailViewItem::ThumbnailViewItem(ThumbnailView &rView, sal_uInt16 nId)
: mrParent(rView)
- , mnId(0)
+ , mnId(nId)
, mbVisible(true)
, mbSelected(false)
, mbHover(false)
diff --git a/sfx2/source/inc/templatesearchviewitem.hxx b/sfx2/source/inc/templatesearchviewitem.hxx
index 9d26ac7aeb72..f6e6a6d54fae 100644
--- a/sfx2/source/inc/templatesearchviewitem.hxx
+++ b/sfx2/source/inc/templatesearchviewitem.hxx
@@ -14,8 +14,8 @@
struct TemplateSearchViewItem : public TemplateViewItem
{
- TemplateSearchViewItem (ThumbnailView &rView)
- : TemplateViewItem(rView)
+ TemplateSearchViewItem (ThumbnailView &rView, sal_uInt16 nId)
+ : TemplateViewItem(rView, nId)
{}
virtual ~TemplateSearchViewItem ()