diff options
author | Jan Holesovsky <kendy@suse.cz> | 2012-02-10 14:12:17 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-02-10 15:12:26 +0100 |
commit | 8912cf30755a2a19d50acc3bb0f5352506638fad (patch) | |
tree | ad9406d87e16ac78f7a46697d3e5921c2d73bbd3 /extensions/source/propctrlr/browserlistbox.hxx | |
parent | use system stdlibs on Linux (fdo#45074, fdo#45696) (diff) | |
download | core-8912cf30755a2a19d50acc3bb0f5352506638fad.tar.gz core-8912cf30755a2a19d50acc3bb0f5352506638fad.zip |
fdo#40261: Fix crash in XML Form Document.
The data structure holding the UI elements in the browser listbox was a
terrible mess - it held the items in an unordered_map, but then accessed
them via a vector containing iterators to this unordered_map.
Fixed the problem (and cleaned all this up) by removing the vector of
iterators, and turning the unordered_map into a normal vector. When we need
access by name, we just go through all the items; it is always just a handful
of them anyway.
Diffstat (limited to 'extensions/source/propctrlr/browserlistbox.hxx')
-rw-r--r-- | extensions/source/propctrlr/browserlistbox.hxx | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx index 3f6e4c995e52..c5c46ef4898a 100644 --- a/extensions/source/propctrlr/browserlistbox.hxx +++ b/extensions/source/propctrlr/browserlistbox.hxx @@ -65,19 +65,19 @@ namespace pcr typedef ::boost::shared_ptr< OBrowserLine > BrowserLinePointer; struct ListBoxLine { + ::rtl::OUString aName; BrowserLinePointer pLine; ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler > xHandler; - ListBoxLine() { } - ListBoxLine( BrowserLinePointer _pLine, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _rxHandler ) - :pLine( _pLine ) - ,xHandler( _rxHandler ) + ListBoxLine( const ::rtl::OUString& rName, BrowserLinePointer _pLine, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _rxHandler ) + : aName( rName ), + pLine( _pLine ), + xHandler( _rxHandler ) { } }; - typedef ::boost::unordered_map< ::rtl::OUString, ListBoxLine, ::rtl::OUStringHash > ListBoxLines; - typedef ::std::vector< ListBoxLines::iterator > OrderedListBoxLines; + typedef ::std::vector< ListBoxLine > ListBoxLines; //======================================================================== //= IControlContext @@ -106,7 +106,6 @@ namespace pcr ::std::auto_ptr< InspectorHelpWindow > m_pHelpWindow; ListBoxLines m_aLines; - OrderedListBoxLines m_aOrderedLines; IPropertyLineListener* m_pLineListener; IPropertyControlObserver* m_pControlObserver; long m_nYOffset; @@ -192,16 +191,6 @@ namespace pcr */ sal_uInt16 impl_getControlPos( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl ) const; - /** retrieves (a reference to) the ->ListBoxLine for a given control - @param _rxControl - The control to lookup. Must denote a control of one of the lines in ->m_aLines - */ - inline const ListBoxLine& - impl_getControlLine( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl ) const - { - return m_aOrderedLines[ impl_getControlPos( _rxControl ) ]->second; - } - /** sets the given property value at the given control, after converting it as necessary @param _rLine The line whose at which the value is to be set. |