diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-09-04 14:53:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-05 08:55:11 +0200 |
commit | dd39a3b25af74511c108d4f71302b15fd9942e21 (patch) | |
tree | 4a6e0b6647c8d7de36d6defbdd42d8b4c6a8c85f /dbaccess | |
parent | 18ea40107ae3b44b1fa5c3d44cb9d5cf1da7d80f (diff) |
RowSet doesn't need a pimpl
it is module internal
Change-Id: I906c579c9303ae7e770559ee37c8bb253738d1f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139363
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/RowSetBase.cxx | 29 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetBase.hxx | 8 |
2 files changed, 12 insertions, 25 deletions
diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 3a17ee27fdd3..e6eddc57eef5 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -1358,12 +1358,6 @@ sal_Int32 ORowSetBase::impl_getRowCount() const return nRowCount; } -struct ORowSetNotifierImpl -{ - std::vector<sal_Int32> aChangedColumns; - ORowSetValueVector::Vector aRow; -}; - ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet ) :m_pRowSet( _pRowSet ) @@ -1383,14 +1377,12 @@ ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet ) } ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet, ORowSetValueVector::Vector&& i_aRow ) - :m_pImpl(new ORowSetNotifierImpl) - ,m_pRowSet( _pRowSet ) + :m_pRowSet( _pRowSet ) ,m_bWasNew( false ) ,m_bWasModified( false ) { - OSL_ENSURE( m_pRowSet, "ORowSetNotifier::ORowSetNotifier: invalid row set. This will crash." ); - m_pImpl->aRow = std::move(i_aRow); // yes, create a copy to store the old values + aRow = std::move(i_aRow); // yes, create a copy to store the old values } ORowSetNotifier::~ORowSetNotifier( ) @@ -1413,24 +1405,19 @@ void ORowSetNotifier::fire() m_pRowSet->fireProperty( PROPERTY_ID_ISNEW, false, true, ORowSetBase::GrantNotifierAccess() ); } -std::vector<sal_Int32>& ORowSetNotifier::getChangedColumns() const +std::vector<sal_Int32>& ORowSetNotifier::getChangedColumns() { - OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!"); - return m_pImpl->aChangedColumns; + return aChangedColumns; } void ORowSetNotifier::firePropertyChange() { - OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!"); - if (m_pImpl) + for (auto const& changedColumn : aChangedColumns) { - for (auto const& changedColumn : m_pImpl->aChangedColumns) - { - m_pRowSet->firePropertyChange(changedColumn-1 ,m_pImpl->aRow[changedColumn-1], ORowSetBase::GrantNotifierAccess()); - } - if ( !m_pImpl->aChangedColumns.empty() ) - m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,true,false, ORowSetBase::GrantNotifierAccess()); + m_pRowSet->firePropertyChange(changedColumn-1, aRow[changedColumn-1], ORowSetBase::GrantNotifierAccess()); } + if ( !aChangedColumns.empty() ) + m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,true,false, ORowSetBase::GrantNotifierAccess()); } } // namespace dbaccess diff --git a/dbaccess/source/core/api/RowSetBase.hxx b/dbaccess/source/core/api/RowSetBase.hxx index f5443a2afcad..8cce9d46f3f3 100644 --- a/dbaccess/source/core/api/RowSetBase.hxx +++ b/dbaccess/source/core/api/RowSetBase.hxx @@ -347,11 +347,11 @@ namespace dbaccess <p>The class can only be used on the stack, within a method of ORowSetBase (or derivees)</p> */ - struct ORowSetNotifierImpl; class ORowSetNotifier { private: - std::unique_ptr<ORowSetNotifierImpl> m_pImpl; + std::vector<sal_Int32> aChangedColumns; + ORowSetValueVector::Vector aRow; ORowSetBase* m_pRowSet; // not acquired! This is not necessary because this class here is to be used on the stack within // a method of ORowSetBase (or derivees) @@ -391,9 +391,9 @@ namespace dbaccess */ void firePropertyChange(); - /** use this one to store the inde of the changed column values + /** use this one to store the index of the changed column values */ - std::vector<sal_Int32>& getChangedColumns() const; + std::vector<sal_Int32>& getChangedColumns(); }; |