[Libreoffice-commits] core.git: include/sfx2 sfx2/source
Caolán McNamara
caolanm at redhat.com
Wed Sep 18 04:46:44 PDT 2013
include/sfx2/recentdocsview.hxx | 2 +-
include/sfx2/recentdocsviewitem.hxx | 3 ++-
include/sfx2/templatecontaineritem.hxx | 2 +-
include/sfx2/templateviewitem.hxx | 2 +-
include/sfx2/thumbnailviewitem.hxx | 2 +-
sfx2/source/control/recentdocsview.cxx | 6 +++---
sfx2/source/control/recentdocsviewitem.cxx | 5 +++--
sfx2/source/control/templateabstractview.cxx | 6 ++----
sfx2/source/control/templatecontaineritem.cxx | 4 ++--
sfx2/source/control/templatelocalview.cxx | 12 ++++--------
sfx2/source/control/templatesearchview.cxx | 3 +--
sfx2/source/control/templateviewitem.cxx | 4 ++--
sfx2/source/control/thumbnailviewitem.cxx | 4 ++--
sfx2/source/inc/templatesearchviewitem.hxx | 4 ++--
14 files changed, 27 insertions(+), 32 deletions(-)
New commits:
commit e90982f5962968a0f334d232b3be54fcdb736e1d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Sep 18 12:44:08 2013 +0100
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
diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx
index ebb915c..1c3949e 100644
--- a/include/sfx2/recentdocsview.hxx
+++ b/include/sfx2/recentdocsview.hxx
@@ -44,7 +44,7 @@ public:
RecentDocsView( Window* pParent );
virtual ~RecentDocsView();
- void insertItem(const OUString &rURL, const OUString &rTitle);
+ void insertItem(const OUString &rURL, const OUString &rTitle, sal_uInt16 nId);
void loadRecentDocs();
void SetThumbnailSize(long thumbnailSize);
diff --git a/include/sfx2/recentdocsviewitem.hxx b/include/sfx2/recentdocsviewitem.hxx
index 05ae15ae..33d3bb9 100644
--- a/include/sfx2/recentdocsviewitem.hxx
+++ b/include/sfx2/recentdocsviewitem.hxx
@@ -15,7 +15,8 @@
class RecentDocsViewItem : public ThumbnailViewItem
{
public:
- RecentDocsViewItem(ThumbnailView &rView, const OUString &rURL, const OUString &rTitle);
+ RecentDocsViewItem(ThumbnailView &rView, const OUString &rURL,
+ const OUString &rTitle, sal_uInt16 nId);
virtual void setEditTitle (bool edit, bool bChangeFocus = true);
OUString maURL;
diff --git a/include/sfx2/templatecontaineritem.hxx b/include/sfx2/templatecontaineritem.hxx
index 8f23c28..9d69ddf 100644
--- a/include/sfx2/templatecontaineritem.hxx
+++ b/include/sfx2/templatecontaineritem.hxx
@@ -23,7 +23,7 @@ public:
BitmapEx maPreview4;
std::vector<TemplateItemProperties> maTemplates;
- TemplateContainerItem (ThumbnailView &rView);
+ TemplateContainerItem (ThumbnailView &rView, sal_uInt16 nId);
virtual ~TemplateContainerItem ();
diff --git a/include/sfx2/templateviewitem.hxx b/include/sfx2/templateviewitem.hxx
index 6e3442b..92d5919 100644
--- a/include/sfx2/templateviewitem.hxx
+++ b/include/sfx2/templateviewitem.hxx
@@ -16,7 +16,7 @@ class TemplateViewItem : public ThumbnailViewItem
{
public:
- TemplateViewItem (ThumbnailView &rView);
+ TemplateViewItem (ThumbnailView &rView, sal_uInt16 nId);
virtual ~TemplateViewItem ();
diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx
index 2272bc5..ea7bf93 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -73,7 +73,7 @@ public:
OUString maTitle;
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >* mpxAcc;
- ThumbnailViewItem (ThumbnailView &rView);
+ ThumbnailViewItem (ThumbnailView &rView, sal_uInt16 nId);
virtual ~ThumbnailViewItem ();
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 1099911..5e3c796 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 a4024ae..3817d0d 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 9eb0a01..32f1372 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 5dc8c30..fb0cf99 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 bcc0d7d..a6933a3 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 2942b66..87bd69c 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 f488f81..116a4c0 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 b2beb6d..791d981 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 9d26ac7..f6e6a6d 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 ()
More information about the Libreoffice-commits
mailing list