diff options
-rw-r--r-- | include/svx/gridctrl.hxx | 5 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridcl.cxx | 1 | ||||
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 9 |
3 files changed, 8 insertions, 7 deletions
diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx index d3d3c778b5bc..80c2b6aad5ff 100644 --- a/include/svx/gridctrl.hxx +++ b/include/svx/gridctrl.hxx @@ -37,6 +37,7 @@ #include <svtools/transfer.hxx> #include <svx/svxdllapi.h> #include <o3tl/typed_flags_set.hxx> +#include <memory> #include <vector> class DbGridControl; @@ -64,14 +65,14 @@ enum class GridRowStatus class DbGridRow : public SvRefBase { css::uno::Any m_aBookmark; // Bookmark of the row, can be set - ::std::vector< ::svxform::DataColumn* > + ::std::vector< std::unique_ptr<::svxform::DataColumn> > m_aVariants; GridRowStatus m_eStatus; bool m_bIsNew; // row is no longer valid // is removed on the next positioning public: - DbGridRow():m_eStatus(GridRowStatus::Clean), m_bIsNew(true) { } + DbGridRow(); DbGridRow(CursorWrapper* pCur, bool bPaintCursor); void SetState(CursorWrapper* pCur, bool bPaintCursor); diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index ba9bef83935d..3ee95dad4b0d 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -33,6 +33,7 @@ #include <svx/svxdlg.hxx> #include <svx/svxids.hrc> #include <bitmaps.hlst> +#include <sdbdatacolumn.hxx> #include <com/sun/star/form/XConfirmDeleteListener.hpp> #include <com/sun/star/form/XFormComponent.hpp> diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 7d75fa5a1a0d..07d08e0249a2 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -835,6 +835,9 @@ void DbGridControl::NavigationBar::StateChanged(StateChangedType nType) } } +DbGridRow::DbGridRow():m_eStatus(GridRowStatus::Clean), m_bIsNew(true) +{} + DbGridRow::DbGridRow(CursorWrapper* pCur, bool bPaintCursor) :m_bIsNew(false) { @@ -846,8 +849,7 @@ DbGridRow::DbGridRow(CursorWrapper* pCur, bool bPaintCursor) { Reference< XPropertySet > xColSet( xColumns->getByIndex(i), css::uno::UNO_QUERY); - DataColumn* pColumn = new DataColumn(xColSet); - m_aVariants.push_back( pColumn ); + m_aVariants.emplace_back( new DataColumn(xColSet) ); } if (pCur->rowDeleted()) @@ -884,9 +886,6 @@ DbGridRow::DbGridRow(CursorWrapper* pCur, bool bPaintCursor) DbGridRow::~DbGridRow() { - for (DataColumn* p : m_aVariants) - delete p; - m_aVariants.clear(); } void DbGridRow::SetState(CursorWrapper* pCur, bool bPaintCursor) |