summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-11-23 14:24:16 +0200
committerTor Lillqvist <tml@collabora.com>2017-11-23 15:29:04 +0100
commit2923cb0b5b757a764e285d7295f4e78b8494c5c8 (patch)
tree3a0c7321e48bac9b0545c9d468cf4b41715177d0 /sc
parent3f289fef2f2b00dcca4948dd9fb2ba2c493fac6f (diff)
Move the need for several ugly const_casts deeper down to just one place
Change-Id: I2cdd66b9819f070548c2a0af7388d9bfbd3689c1 Reviewed-on: https://gerrit.libreoffice.org/45144 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/attarray.hxx2
-rw-r--r--sc/source/core/data/attarray.cxx4
-rw-r--r--sc/source/core/data/column.cxx4
-rw-r--r--sc/source/core/data/table2.cxx4
4 files changed, 7 insertions, 7 deletions
diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx
index 726c5a831114..ccfb1bb8120a 100644
--- a/sc/inc/attarray.hxx
+++ b/sc/inc/attarray.hxx
@@ -139,7 +139,7 @@ public:
void SetPattern( SCROW nRow, const ScPatternAttr* pPattern, bool bPutToPool = false );
void SetPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr* pPattern,
bool bPutToPool = false, ScEditDataArray* pDataArray = nullptr );
- void ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet* pStyle );
+ void ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, const ScStyleSheet& rStyle );
void ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCache* pCache,
ScEditDataArray* pDataArray = nullptr, bool* const pIsChanged = nullptr );
void SetAttrEntries(std::vector<ScAttrEntry> && vNewData);
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index ef4b11cdf09c..c8a7d50da93c 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -605,7 +605,7 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern
#endif
}
-void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet* pStyle )
+void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, const ScStyleSheet& rStyle )
{
if (ValidRow(nStartRow) && ValidRow(nEndRow))
{
@@ -625,7 +625,7 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
{
const ScPatternAttr* pOldPattern = mvData[nPos].pPattern;
std::unique_ptr<ScPatternAttr> pNewPattern(new ScPatternAttr(*pOldPattern));
- pNewPattern->SetStyleSheet(pStyle);
+ pNewPattern->SetStyleSheet(const_cast<ScStyleSheet*>(&rStyle));
SCROW nY1 = nStart;
SCROW nY2 = mvData[nPos].nEndRow;
nStart = mvData[nPos].nEndRow + 1;
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index ff507715af12..73afe1a810f8 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -567,7 +567,7 @@ void ScColumn::ApplyStyle( SCROW nRow, const ScStyleSheet* rStyle )
void ScColumn::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, const ScStyleSheet& rStyle )
{
- pAttrArray->ApplyStyleArea(nStartRow, nEndRow, const_cast<ScStyleSheet*>(&rStyle));
+ pAttrArray->ApplyStyleArea(nStartRow, nEndRow, rStyle);
}
void ScColumn::ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData& rMark)
@@ -579,7 +579,7 @@ void ScColumn::ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData&
{
ScMultiSelIter aMultiIter( rMark.GetMultiSelData(), nCol );
while (aMultiIter.Next( nTop, nBottom ))
- pAttrArray->ApplyStyleArea(nTop, nBottom, const_cast<ScStyleSheet*>(&rStyle));
+ pAttrArray->ApplyStyleArea(nTop, nBottom, rStyle);
}
}
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 0053e5f67f3c..a45d7af408c2 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2569,12 +2569,12 @@ void ScTable::ApplyStyleArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, S
nEndCol = aCol.size() - 1;
for (SCCOL i = nStartCol; i <= nEndCol; i++)
aCol[i].ApplyStyleArea(nStartRow, nEndRow, rStyle);
- aDefaultColAttrArray.ApplyStyleArea(nStartRow, nEndRow, const_cast<ScStyleSheet*>( &rStyle ) );
+ aDefaultColAttrArray.ApplyStyleArea(nStartRow, nEndRow, rStyle );
}
else
{
CreateColumnIfNotExists( nStartCol - 1 );
- aDefaultColAttrArray.ApplyStyleArea(nStartRow, nEndRow, const_cast<ScStyleSheet*>( &rStyle ) );
+ aDefaultColAttrArray.ApplyStyleArea(nStartRow, nEndRow, rStyle );
}
}
else