Kaydet (Commit) 125a139e authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwXMLTableContext

Change-Id: I14dddb4ffb9ceb36ccdb902d6cbf253ccf480931
Reviewed-on: https://gerrit.libreoffice.org/57866
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c33613a0
......@@ -1412,9 +1412,9 @@ SwXMLTableContext::~SwXMLTableContext()
{
if (m_bOwnsBox1)
delete m_pBox1;
delete m_pColumnDefaultCellStyleNames;
delete m_pSharedBoxFormats;
delete m_pRows;
m_pColumnDefaultCellStyleNames.reset();
m_pSharedBoxFormats.reset();
m_pRows.reset();
// close redlines on table end nodes
GetImport().GetTextImport()->RedlineAdjustStartNodeCursor(false);
......@@ -1492,7 +1492,7 @@ void SwXMLTableContext::InsertColumn( sal_Int32 nWidth2, bool bRelWidth2,
{
if( !m_pColumnDefaultCellStyleNames )
{
m_pColumnDefaultCellStyleNames = new std::vector<OUString>;
m_pColumnDefaultCellStyleNames.reset(new std::vector<OUString>);
sal_uLong nCount = m_aColumnWidths.size() - 1;
while( nCount-- )
m_pColumnDefaultCellStyleNames->push_back(OUString());
......@@ -1830,7 +1830,7 @@ SwTableBoxFormat* SwXMLTableContext::GetSharedBoxFormat(
bool* pModifyLocked )
{
if ( m_pSharedBoxFormats == nullptr )
m_pSharedBoxFormats = new map_BoxFormat;
m_pSharedBoxFormats.reset(new map_BoxFormat);
SwTableBoxFormat* pBoxFormat2;
......
......@@ -58,12 +58,12 @@ class SwXMLTableContext : public XMLTextTableContext
ColumnWidthInfo(sal_uInt16 wdth, bool isRel) : width(wdth), isRelative(isRel) {};
};
std::vector<ColumnWidthInfo> m_aColumnWidths;
std::vector<OUString> *m_pColumnDefaultCellStyleNames;
std::unique_ptr<std::vector<OUString>> m_pColumnDefaultCellStyleNames;
css::uno::Reference< css::text::XTextCursor > m_xOldCursor;
css::uno::Reference< css::text::XTextContent > m_xTextContent;
SwXMLTableRows_Impl * m_pRows;
std::unique_ptr<SwXMLTableRows_Impl> m_pRows;
SwTableNode *m_pTableNode;
SwTableBox *m_pBox1;
......@@ -77,7 +77,7 @@ class SwXMLTableContext : public XMLTextTableContext
// the column width, and protection flag
typedef std::unordered_map<TableBoxIndex,SwTableBoxFormat*,
TableBoxIndexHasher> map_BoxFormat;
map_BoxFormat* m_pSharedBoxFormats;
std::unique_ptr<map_BoxFormat> m_pSharedBoxFormats;
SvXMLImportContextRef m_xParentTable; // if table is a sub table
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment