diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-07-12 13:43:56 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-07-13 09:59:12 +0200 |
commit | ed9a864a21b38e25ea118c4f42fedf21f1b549fb (patch) | |
tree | 25056f8aedf574a9a2c19accf145d8ba4b67dd25 /include | |
parent | f91ffe03e035cff1204de230ec78fc0aa1bdbb36 (diff) |
Revert "flatten ValueSet item array"
I'm seeing a11y crashes in the impress slide transition ValueSet. The
mxAcc member contains a ValueItemAcc which has a pointer back to the
ValueSetItem so if its std::moved into another ValueSetItem then it
continues to point to the older ValueSetItem and not the new one
This reverts commit 30aa33e6a6b9fb230af96f619db27fcaf31ef914.
Change-Id: I1fd81aa81e47f2e984dd47fdc8a905e25c9f6266
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118728
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/valueset.hxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx index 55399b24f711..084008c79e2e 100644 --- a/include/svtools/valueset.hxx +++ b/include/svtools/valueset.hxx @@ -175,6 +175,8 @@ to be set (before Show) with SetStyle(). *************************************************************************/ +typedef std::vector<std::unique_ptr<ValueSetItem>> ValueItemList; + #define WB_ITEMBORDER (WinBits(0x00010000)) #define WB_DOUBLEBORDER (WinBits(0x00020000)) #define WB_NAMEFIELD (WinBits(0x00040000)) @@ -191,7 +193,7 @@ class SVT_DLLPUBLIC ValueSet : public weld::CustomWidgetController private: ScopedVclPtr<VirtualDevice> maVirDev; css::uno::Reference<css::accessibility::XAccessible> mxAccessible; - std::vector<ValueSetItem> mItemList; + ValueItemList mItemList; std::unique_ptr<ValueSetItem> mpNoneItem; std::unique_ptr<weld::ScrolledWindow> mxScrolledWindow; tools::Rectangle maNoneItemRect; @@ -234,7 +236,7 @@ private: friend class ValueSetAcc; SVT_DLLPRIVATE void ImplDeleteItems(); - SVT_DLLPRIVATE void ImplFormatItem(vcl::RenderContext const & rRenderContext, ValueSetItem& rItem, tools::Rectangle aRect); + SVT_DLLPRIVATE void ImplFormatItem(vcl::RenderContext const & rRenderContext, ValueSetItem* pItem, tools::Rectangle aRect); SVT_DLLPRIVATE void ImplDrawItemText(vcl::RenderContext& rRenderContext, const OUString& rStr); SVT_DLLPRIVATE void ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nItemId, const bool bFocus, const bool bDrawSel); SVT_DLLPRIVATE void ImplDrawSelect(vcl::RenderContext& rRenderContext); @@ -244,7 +246,7 @@ private: SVT_DLLPRIVATE ValueSetItem* ImplGetItem( size_t nPos ); SVT_DLLPRIVATE ValueSetItem* ImplGetFirstItem(); SVT_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const; - SVT_DLLPRIVATE void ImplInsertItem( const ValueSetItem& rItem, const size_t nPos ); + SVT_DLLPRIVATE void ImplInsertItem( std::unique_ptr<ValueSetItem> pItem, const size_t nPos ); SVT_DLLPRIVATE tools::Rectangle ImplGetItemRect( size_t nPos ) const; SVT_DLLPRIVATE void ImplFireAccessibleEvent( short nEventId, const css::uno::Any& rOldValue, const css::uno::Any& rNewValue ); SVT_DLLPRIVATE bool ImplHasAccessibleListeners(); |