[Libreoffice-commits] core.git: include/sfx2 sfx2/inc sfx2/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Sep 9 12:29:54 UTC 2021
include/sfx2/thumbnailview.hxx | 33 ++++++++---------------------
include/sfx2/thumbnailviewitem.hxx | 6 ++---
sfx2/inc/emojiviewitem.hxx | 2 -
sfx2/inc/templateviewitem.hxx | 2 -
sfx2/source/control/emojiviewitem.cxx | 3 --
sfx2/source/control/templateviewitem.cxx | 2 -
sfx2/source/control/thumbnailview.cxx | 6 -----
sfx2/source/control/thumbnailviewitem.cxx | 2 -
sfx2/source/inc/templatesearchviewitem.hxx | 2 -
9 files changed, 20 insertions(+), 38 deletions(-)
New commits:
commit 3c94c1c61f1e25de26dab9e63146994eb1139013
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Sep 9 11:39:13 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 9 14:29:14 2021 +0200
merge ThumbnailView and ThumbnailViewBase
only ThumbnailView inherits directly from ThumbnailViewBase and it will
simplify a11y if ThumbnailView instead of ThumbnailViewBase is available
Change-Id: I715faa3f9b2cec68c1de07479b7d1dbbd9ddbcc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121846
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 3352821e1fa6..ded4f58a310d 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -159,29 +159,11 @@ public:
*
**/
-class SFX2_DLLPUBLIC ThumbnailViewBase
+class SFX2_DLLPUBLIC ThumbnailView : public weld::CustomWidgetController
{
friend class ThumbnailViewAcc;
friend class ThumbnailViewItemAcc;
- virtual sal_uInt16 ImplGetVisibleItemCount() const = 0;
- virtual ThumbnailViewItem* ImplGetVisibleItem(sal_uInt16 nVisiblePos) = 0;
-
- virtual css::uno::Reference<css::accessibility::XAccessible> getAccessible() = 0;
-
-public:
- /// Updates information in the view; used only in RecentDocsView ATM.
- virtual void Reload() {}
-
- virtual bool renameItem(ThumbnailViewItem* pItem, const OUString& sNewTitle);
-
- virtual bool isDrawMnemonic() const = 0;
-
- virtual ~ThumbnailViewBase();
-};
-
-class SFX2_DLLPUBLIC ThumbnailView : public weld::CustomWidgetController, public ThumbnailViewBase
-{
public:
ThumbnailView(std::unique_ptr<weld::ScrolledWindow> xWindow, std::unique_ptr<weld::Menu> xMenu);
@@ -189,6 +171,9 @@ public:
virtual bool MouseMove(const MouseEvent& rMEvt) override;
+ /// Updates information in the view; used only in RecentDocsView ATM.
+ virtual void Reload() {}
+
void AppendItem(std::unique_ptr<ThumbnailViewItem> pItem);
void RemoveItem(sal_uInt16 nItemId);
@@ -206,7 +191,9 @@ public:
sal_uInt16 getNextItemId () const;
- virtual bool isDrawMnemonic() const override { return mbDrawMnemonics; }
+ virtual bool renameItem(ThumbnailViewItem* pItem, const OUString& sNewTitle);
+
+ virtual bool isDrawMnemonic() const { return mbDrawMnemonics; }
void setItemMaxTextLength (sal_uInt32 nLength);
@@ -269,7 +256,7 @@ protected:
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
- virtual css::uno::Reference<css::accessibility::XAccessible> getAccessible() override;
+ virtual css::uno::Reference<css::accessibility::XAccessible> getAccessible();
protected:
@@ -295,8 +282,8 @@ protected:
void ImplDeleteItems();
size_t ImplGetItem( const Point& rPoint ) const;
ThumbnailViewItem* ImplGetItem( size_t nPos );
- virtual sal_uInt16 ImplGetVisibleItemCount() const override;
- virtual ThumbnailViewItem* ImplGetVisibleItem(sal_uInt16 nVisiblePos) override;
+ virtual sal_uInt16 ImplGetVisibleItemCount() const;
+ virtual ThumbnailViewItem* ImplGetVisibleItem(sal_uInt16 nVisiblePos);
void ImplFireAccessibleEvent( short nEventId, const css::uno::Any& rOldValue, const css::uno::Any& rNewValue );
bool ImplHasAccessibleListeners();
DECL_LINK( ImplScrollHdl, weld::ScrolledWindow&, void );
diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx
index 82c98e2c482d..d0da2edaec0a 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -32,7 +32,7 @@ namespace drawinglayer::primitive2d { class Primitive2DContainer; }
const int THUMBNAILVIEW_ITEM_CORNER = 5;
-class ThumbnailViewBase;
+class ThumbnailView;
class MouseEvent;
namespace basegfx {
@@ -66,7 +66,7 @@ class SFX2_DLLPUBLIC ThumbnailViewItem
{
public:
- ThumbnailViewBase &mrParent;
+ ThumbnailView& mrParent;
sal_uInt16 mnId;
bool mbVisible;
bool mbBorder;
@@ -77,7 +77,7 @@ public:
OUString maHelpText;
css::uno::Reference< css::accessibility::XAccessible > mxAcc;
- ThumbnailViewItem (ThumbnailViewBase &rView, sal_uInt16 nId);
+ ThumbnailViewItem(ThumbnailView& rView, sal_uInt16 nId);
virtual ~ThumbnailViewItem ();
diff --git a/sfx2/inc/emojiviewitem.hxx b/sfx2/inc/emojiviewitem.hxx
index b5a614f7acba..61a3306735bd 100644
--- a/sfx2/inc/emojiviewitem.hxx
+++ b/sfx2/inc/emojiviewitem.hxx
@@ -14,7 +14,7 @@
class EmojiViewItem final : public ThumbnailViewItem
{
public:
- EmojiViewItem (ThumbnailViewBase &rView, sal_uInt16 nId);
+ EmojiViewItem(ThumbnailView& rView, sal_uInt16 nId);
virtual ~EmojiViewItem () override;
diff --git a/sfx2/inc/templateviewitem.hxx b/sfx2/inc/templateviewitem.hxx
index 36d433b00119..41c77b060f80 100644
--- a/sfx2/inc/templateviewitem.hxx
+++ b/sfx2/inc/templateviewitem.hxx
@@ -15,7 +15,7 @@ class TemplateViewItem : public ThumbnailViewItem
{
public:
- TemplateViewItem (ThumbnailViewBase &rView, sal_uInt16 nId);
+ TemplateViewItem(ThumbnailView& rView, sal_uInt16 nId);
virtual ~TemplateViewItem () override;
diff --git a/sfx2/source/control/emojiviewitem.cxx b/sfx2/source/control/emojiviewitem.cxx
index ff90325dd4bc..5b3075e503b7 100644
--- a/sfx2/source/control/emojiviewitem.cxx
+++ b/sfx2/source/control/emojiviewitem.cxx
@@ -22,7 +22,7 @@ using namespace basegfx::utils;
using namespace drawinglayer::attribute;
using namespace drawinglayer::primitive2d;
-EmojiViewItem::EmojiViewItem (ThumbnailViewBase &rView, sal_uInt16 nId)
+EmojiViewItem::EmojiViewItem(ThumbnailView& rView, sal_uInt16 nId)
: ThumbnailViewItem(rView, nId)
{
}
@@ -31,7 +31,6 @@ EmojiViewItem::~EmojiViewItem ()
{
}
-
void EmojiViewItem::calculateItemsPosition (const tools::Long /*nThumbnailHeight*/,
const tools::Long /*nPadding*/, sal_uInt32 nMaxTextLength,
const ThumbnailItemAttributes *pAttrs)
diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx
index 3dd20a30fd64..2d6c9d0732af 100644
--- a/sfx2/source/control/templateviewitem.cxx
+++ b/sfx2/source/control/templateviewitem.cxx
@@ -28,7 +28,7 @@ using namespace basegfx::utils;
using namespace drawinglayer::attribute;
using namespace drawinglayer::primitive2d;
-TemplateViewItem::TemplateViewItem (ThumbnailViewBase &rView, sal_uInt16 nId)
+TemplateViewItem::TemplateViewItem(ThumbnailView& rView, sal_uInt16 nId)
: ThumbnailViewItem(rView, nId),
mnRegionId(USHRT_MAX),
mnDocId(USHRT_MAX),
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index a6b395a0b666..619ede548701 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -47,16 +47,12 @@ using namespace drawinglayer::primitive2d;
constexpr int gnFineness = 5;
-bool ThumbnailViewBase::renameItem(ThumbnailViewItem*, const OUString&)
+bool ThumbnailView::renameItem(ThumbnailViewItem*, const OUString&)
{
// Do nothing by default
return false;
}
-ThumbnailViewBase::~ThumbnailViewBase()
-{
-}
-
BitmapEx ThumbnailView::readThumbnail(const OUString &msURL)
{
using namespace ::com::sun::star;
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index 0e82be466f7e..809f6b935bcd 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -40,7 +40,7 @@ using namespace ::com::sun::star;
using namespace drawinglayer::attribute;
using namespace drawinglayer::primitive2d;
-ThumbnailViewItem::ThumbnailViewItem(ThumbnailViewBase &rView, sal_uInt16 nId)
+ThumbnailViewItem::ThumbnailViewItem(ThumbnailView& rView, sal_uInt16 nId)
: mrParent(rView)
, mnId(nId)
, mbVisible(true)
diff --git a/sfx2/source/inc/templatesearchviewitem.hxx b/sfx2/source/inc/templatesearchviewitem.hxx
index bd4b682da102..e9ba57f1cd75 100644
--- a/sfx2/source/inc/templatesearchviewitem.hxx
+++ b/sfx2/source/inc/templatesearchviewitem.hxx
@@ -14,7 +14,7 @@
struct TemplateSearchViewItem final : public TemplateViewItem
{
- TemplateSearchViewItem(ThumbnailViewBase& rView, sal_uInt16 nId)
+ TemplateSearchViewItem(ThumbnailView& rView, sal_uInt16 nId)
: TemplateViewItem(rView, nId)
, mnAssocId(0)
{
More information about the Libreoffice-commits
mailing list