[Libreoffice-commits] core.git: 2 commits - oox/source sc/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Mar 28 06:41:39 UTC 2019
oox/source/drawingml/table/tableproperties.cxx | 14 +++++++-------
sc/source/core/inc/interpre.hxx | 4 ++--
sc/source/core/tool/interpr4.cxx | 4 ++--
3 files changed, 11 insertions(+), 11 deletions(-)
New commits:
commit 9304135b560bbb8c8f197c5a8f7127665aafae47
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Mar 27 11:28:04 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Mar 28 07:41:25 2019 +0100
return unique_ptr from CreateTableStyle
Change-Id: I31b12fa3f80dc450fff27128efb2fbebc711b249
Reviewed-on: https://gerrit.libreoffice.org/69859
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx
index b7b25a0e7886..49acda6c25cf 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -99,7 +99,7 @@ namespace
}
//for pptx just has table style id
-static void SetTableStyleProperties(TableStyle* &pTableStyle , sal_Int32 tblFillClr, sal_Int32 tblTextClr, sal_Int32 lineBdrClr)
+static void SetTableStyleProperties(std::unique_ptr<TableStyle> &pTableStyle , sal_Int32 tblFillClr, sal_Int32 tblTextClr, sal_Int32 lineBdrClr)
{
//whole table fill style and color
oox::drawingml::FillPropertiesPtr pWholeTabFillProperties( new oox::drawingml::FillProperties );
@@ -142,9 +142,9 @@ static void SetTableStyleProperties(TableStyle* &pTableStyle , sal_Int32 tblFill
pTableStyle->getLastCol().getTextBoldStyle() = textBoldStyle;
}
-static TableStyle* CreateTableStyle(const OUString& styleId)
+static std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId)
{
- TableStyle* pTableStyle = nullptr;
+ std::unique_ptr<TableStyle> pTableStyle;
// It is a bit silly to handle styleIds specifically and separately like this. Also note that
// the first two code blocks below are mostly copy-pasted, modulo the comments and the fact that
@@ -162,7 +162,7 @@ static TableStyle* CreateTableStyle(const OUString& styleId)
// to AOO in 2012) knows to look at that?
if(styleId == "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}") { //Medium Style 2 Accent 1
- pTableStyle = new TableStyle();
+ pTableStyle.reset(new TableStyle());
//first row style
//fill color and type
oox::drawingml::FillPropertiesPtr pFirstRowFillProperties( new oox::drawingml::FillProperties );
@@ -198,7 +198,7 @@ static TableStyle* CreateTableStyle(const OUString& styleId)
}
else if (styleId == "{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}") //Medium Style 2 Accent 2
{
- pTableStyle = new TableStyle();
+ pTableStyle.reset(new TableStyle());
oox::drawingml::FillPropertiesPtr pFirstRowFillProperties( new oox::drawingml::FillProperties );
pFirstRowFillProperties->moFillType.set(XML_solidFill);
pFirstRowFillProperties->maFillColor.setSchemeClr(XML_accent2);
@@ -229,7 +229,7 @@ static TableStyle* CreateTableStyle(const OUString& styleId)
}
else if (styleId == "{C4B1156A-380E-4F78-BDF5-A606A8083BF9}") //Medium Style 4 Accent 4
{
- pTableStyle = new TableStyle();
+ pTableStyle.reset(new TableStyle());
SetTableStyleProperties(pTableStyle, XML_accent4, XML_dk1, XML_accent4);
}
@@ -259,7 +259,7 @@ const TableStyle& TableProperties::getUsedTableStyle( const ::oox::core::XmlFilt
//if the pptx just has table style id, but no table style content, we will create the table style ourselves
if (!pTableStyle)
{
- rTableStyleToDelete.reset(CreateTableStyle(aStyleId));
+ rTableStyleToDelete = CreateTableStyle(aStyleId);
pTableStyle = rTableStyleToDelete.get();
}
}
commit 5e154869ea78355fccdd0774b829d89819cf2012
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Mar 27 11:21:46 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Mar 28 07:41:08 2019 +0100
return unique_ptr from CreateTokenMatrixMap
Change-Id: I7a779bf1b2e5438e7e5d9f75c765049d4e2b9dac
Reviewed-on: https://gerrit.libreoffice.org/69856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 1b1344164966..3fd3dcf7668c 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -454,7 +454,7 @@ private:
SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
SCCOL nCol2, SCROW nRow2, SCTAB nTab2 );
inline ScTokenMatrixMap& GetTokenMatrixMap();
- static ScTokenMatrixMap* CreateTokenMatrixMap();
+ static std::unique_ptr<ScTokenMatrixMap> CreateTokenMatrixMap();
ScMatrixRef GetMatrix();
ScMatrixRef GetMatrix( short & rParam, size_t & rInRefList );
sc::RangeMatrix GetRangeMatrix();
@@ -1046,7 +1046,7 @@ inline bool ScInterpreter::MatrixParameterConversion()
inline ScTokenMatrixMap& ScInterpreter::GetTokenMatrixMap()
{
if (!pTokenMatrixMap)
- pTokenMatrixMap.reset(CreateTokenMatrixMap());
+ pTokenMatrixMap = CreateTokenMatrixMap();
return *pTokenMatrixMap;
}
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 238edf4eba9b..5713a5bd5fdc 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1434,9 +1434,9 @@ void ScInterpreter::ConvertMatrixJumpConditionToMatrix()
PushIllegalParameter();
}
-ScTokenMatrixMap* ScInterpreter::CreateTokenMatrixMap()
+std::unique_ptr<ScTokenMatrixMap> ScInterpreter::CreateTokenMatrixMap()
{
- return new ScTokenMatrixMap;
+ return std::make_unique<ScTokenMatrixMap>();
}
bool ScInterpreter::ConvertMatrixParameters()
More information about the Libreoffice-commits
mailing list