summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-25 18:40:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-26 10:57:03 +0200
commitac2d415a52f22caf0012b7d9b17d015aca27db9d (patch)
tree5c2f153ea470ff77dd00109d3006547869e9b332 /sc/source
parent47f0e83989c4c03d9690229b6433a5541032a3eb (diff)
loplugin:oncevar in sc
Change-Id: Ice59e286debb6bd0eb692f2b2b0c2c5087c069c0 Reviewed-on: https://gerrit.libreoffice.org/39239 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/column.cxx3
-rw-r--r--sc/source/core/data/column2.cxx3
-rw-r--r--sc/source/core/data/column3.cxx3
-rw-r--r--sc/source/core/data/dociter.cxx3
-rw-r--r--sc/source/core/data/documen3.cxx3
-rw-r--r--sc/source/core/data/documen4.cxx2
-rw-r--r--sc/source/core/data/documen5.cxx3
-rw-r--r--sc/source/core/data/document.cxx3
-rw-r--r--sc/source/core/data/dpcache.cxx3
-rw-r--r--sc/source/core/data/dpobject.cxx14
-rw-r--r--sc/source/core/data/dpsave.cxx4
-rw-r--r--sc/source/core/data/dptabsrc.cxx3
-rw-r--r--sc/source/core/data/table1.cxx2
-rw-r--r--sc/source/core/tool/addincol.cxx3
-rw-r--r--sc/source/core/tool/autoform.cxx9
-rw-r--r--sc/source/core/tool/consoli.cxx5
-rw-r--r--sc/source/core/tool/dbdata.cxx3
-rw-r--r--sc/source/core/tool/detfunc.cxx3
-rw-r--r--sc/source/core/tool/editutil.cxx3
-rw-r--r--sc/source/core/tool/interpr2.cxx3
-rw-r--r--sc/source/core/tool/rangenam.cxx2
-rw-r--r--sc/source/core/tool/token.cxx4
-rw-r--r--sc/source/filter/excel/excform.cxx3
-rw-r--r--sc/source/filter/excel/excimp8.cxx3
-rw-r--r--sc/source/filter/excel/xepage.cxx2
-rw-r--r--sc/source/filter/excel/xepivot.cxx12
-rw-r--r--sc/source/filter/excel/xestream.cxx3
-rw-r--r--sc/source/filter/excel/xeview.cxx8
-rw-r--r--sc/source/filter/excel/xicontent.cxx6
-rw-r--r--sc/source/filter/excel/xiescher.cxx3
-rw-r--r--sc/source/filter/excel/xlchart.cxx3
-rw-r--r--sc/source/filter/html/htmlpars.cxx4
-rw-r--r--sc/source/filter/lotus/lotform.cxx3
-rw-r--r--sc/source/filter/lotus/lotread.cxx3
-rw-r--r--sc/source/filter/qpro/qproform.cxx3
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx8
-rw-r--r--sc/source/filter/xml/XMLCodeNameProvider.cxx3
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.cxx3
-rw-r--r--sc/source/filter/xml/editattributemap.cxx3
-rw-r--r--sc/source/filter/xml/xmlcoli.cxx3
-rw-r--r--sc/source/filter/xml/xmlcvali.cxx3
-rw-r--r--sc/source/filter/xml/xmldrani.cxx6
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx24
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx7
-rw-r--r--sc/source/filter/xml/xmlstyle.cxx9
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx9
-rw-r--r--sc/source/ui/Accessibility/AccessibleCell.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleTableBase.cxx6
-rw-r--r--sc/source/ui/app/inputhdl.cxx4
-rw-r--r--sc/source/ui/app/inputwin.cxx2
-rw-r--r--sc/source/ui/app/scmod.cxx10
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx2
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx3
-rw-r--r--sc/source/ui/dbgui/PivotLayoutDialog.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx13
-rw-r--r--sc/source/ui/docshell/docsh8.cxx4
-rw-r--r--sc/source/ui/docshell/impex.cxx10
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx6
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx3
-rw-r--r--sc/source/ui/drawfunc/futext.cxx10
-rw-r--r--sc/source/ui/formdlg/dwfunctr.cxx3
-rw-r--r--sc/source/ui/miscdlgs/tabbgcolordlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/textdlgs.cxx4
-rw-r--r--sc/source/ui/navipi/content.cxx3
-rw-r--r--sc/source/ui/undo/undoblk.cxx2
-rw-r--r--sc/source/ui/undo/undoblk3.cxx4
-rw-r--r--sc/source/ui/undo/undocell.cxx4
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx3
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx2
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx3
-rw-r--r--sc/source/ui/unoobj/datauno.cxx3
-rw-r--r--sc/source/ui/unoobj/docuno.cxx14
-rw-r--r--sc/source/ui/unoobj/filtuno.cxx5
-rw-r--r--sc/source/ui/unoobj/tokenuno.cxx4
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx4
-rw-r--r--sc/source/ui/vba/excelvbahelper.cxx3
-rw-r--r--sc/source/ui/vba/vbamenuitems.cxx5
-rw-r--r--sc/source/ui/vba/vbamenus.cxx5
-rw-r--r--sc/source/ui/vba/vbanames.cxx7
-rw-r--r--sc/source/ui/vba/vbarange.cxx15
-rw-r--r--sc/source/ui/vba/vbasheetobject.cxx2
-rw-r--r--sc/source/ui/vba/vbawindow.cxx36
-rw-r--r--sc/source/ui/view/cellsh2.cxx3
-rw-r--r--sc/source/ui/view/dbfunc3.cxx6
-rw-r--r--sc/source/ui/view/gridwin3.cxx3
-rw-r--r--sc/source/ui/view/gridwin4.cxx15
-rw-r--r--sc/source/ui/view/gridwin_dbgutil.cxx3
-rw-r--r--sc/source/ui/view/output2.cxx6
-rw-r--r--sc/source/ui/view/tabvwshb.cxx3
-rw-r--r--sc/source/ui/view/tabvwshg.cxx3
-rw-r--r--sc/source/ui/view/viewdata.cxx6
-rw-r--r--sc/source/ui/view/viewfun2.cxx3
-rw-r--r--sc/source/ui/view/viewfun3.cxx9
95 files changed, 175 insertions, 322 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index b1acc841a0ca..8456b872f70e 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1750,8 +1750,7 @@ void ScColumn::CopyUpdated( const ScColumn& rPosCol, ScColumn& rDestCol ) const
sc::SingleColumnSpanSet::SpansType aRanges;
aRangeSet.getSpans(aRanges);
- bool bCopyNotes = true;
- CopyToClipHandler aFunc(*this, rDestCol, nullptr, bCopyNotes);
+ CopyToClipHandler aFunc(*this, rDestCol, nullptr, true/*bCopyNotes*/);
sc::CellStoreType::const_iterator itPos = maCells.begin();
sc::SingleColumnSpanSet::SpansType::const_iterator it = aRanges.begin(), itEnd = aRanges.end();
for (; it != itEnd; ++it)
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 506e59006253..582fe6734a00 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -695,7 +695,6 @@ sal_uInt16 ScColumn::GetOptimalColWidth(
ScNeededSizeOptions aOptions;
aOptions.bFormula = bFormula;
const ScPatternAttr* pOldPattern = nullptr;
- SvtScriptType nOldScript = SvtScriptType::NONE;
// Go though all non-empty cells within selection.
sc::CellStoreType::const_iterator itPos = maCells.begin();
@@ -723,7 +722,7 @@ sal_uInt16 ScColumn::GetOptimalColWidth(
const ScPatternAttr* pPattern = GetPattern(nRow);
aOptions.pPattern = pPattern;
- aOptions.bGetFont = (pPattern != pOldPattern || nScript != nOldScript);
+ aOptions.bGetFont = (pPattern != pOldPattern || nScript != SvtScriptType::NONE);
pOldPattern = pPattern;
sal_uInt16 nThis = (sal_uInt16) GetNeededSize(
nRow, pDev, nPPTX, nPPTY, rZoomX, rZoomY, true, aOptions, &pOldPattern);
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 92765d1314bc..112afef0a14a 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1454,9 +1454,8 @@ public:
{
case sc::element_type_numeric:
{
- double fVal1 = 0.0;
double fVal2 = sc::numeric_block::at(*aPos.first->data, aPos.second);
- doFunction(nDestRow, fVal1, fVal2);
+ doFunction(nDestRow, 0.0, fVal2);
}
break;
case sc::element_type_string:
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 901496de75d6..989534a67527 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -2308,8 +2308,7 @@ void ScHorizontalAttrIterator::InitForNextRow(bool bInitialization)
if ( !nIndex && !pArray->nCount )
{
- SCROW nThisEnd = MAXROW;
- pNextEnd[nPos] = nThisEnd;
+ pNextEnd[nPos] = MAXROW;
OSL_ENSURE( pNextEnd[nPos] >= nRow, "Sequence out of order" );
ppPatterns[nPos] = nullptr;
}
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 4c4d25752207..677eef69ba6b 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -125,11 +125,10 @@ void ScDocument::GetAllTabRangeNames(ScRangeName::TabNameCopyMap& rNames) const
void ScDocument::SetAllRangeNames(const std::map<OUString, std::unique_ptr<ScRangeName>>& rRangeMap)
{
- OUString aGlobalStr(STR_GLOBAL_RANGE_NAME);
auto itr = rRangeMap.begin(), itrEnd = rRangeMap.end();
for (; itr!=itrEnd; ++itr)
{
- if (itr->first == aGlobalStr)
+ if (itr->first == STR_GLOBAL_RANGE_NAME)
{
delete pRangeName;
const ScRangeName *const pName = itr->second.get();
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index a6cbd1a321f6..d2f74b9f6125 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -147,7 +147,7 @@ bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab,
sal_uInt16 nHorIter = 0;
const double fHorStepAngle = 5.0;
const double fHorMaxAngle = 80.0;
- int nHorMaxIter = static_cast<int>( fHorMaxAngle / fHorStepAngle );
+ int const nHorMaxIter = static_cast<int>( fHorMaxAngle / fHorStepAngle );
bool bDoneHorMove = false;
while ( !bDoneHorMove && !bHorMoveError && nHorIter++ < nHorMaxIter )
diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index c15f9fc2de9b..73e750c4f62c 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -143,7 +143,6 @@ void ScDocument::UpdateAllCharts()
OUString sRangeStr;
aRanges->Format( sRangeStr, ScRefFlags::RANGE_ABS_3D, this, GetAddressConvention() );
- chart::ChartDataRowSource eDataRowSource = chart::ChartDataRowSource_COLUMNS;
bool bHasCategories = pChartObj->HasRowHeaders();
bool bFirstCellAsLabel = pChartObj->HasColHeaders();
@@ -163,7 +162,7 @@ void ScDocument::UpdateAllCharts()
pShell->GetModel(), uno::UNO_QUERY );
xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
- lcl_SetChartParameters( xReceiver, sRangeStr, eDataRowSource,
+ lcl_SetChartParameters( xReceiver, sRangeStr, chart::ChartDataRowSource_COLUMNS,
bHasCategories, bFirstCellAsLabel );
}
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 41545c80b41a..b0a953801d72 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2995,11 +2995,10 @@ void ScDocument::CopyMultiRangeFromClip(
if (!bSkipAttrForEmpty)
{
// Do the deletion first.
- InsertDeleteFlags nDelFlag = InsertDeleteFlags::CONTENTS;
SCCOL nColSize = rClipParam.getPasteColSize();
SCROW nRowSize = rClipParam.getPasteRowSize();
- DeleteArea(nCol1, nRow1, nCol1+nColSize-1, nRow1+nRowSize-1, rMark, nDelFlag, false, &aBroadcastSpans);
+ DeleteArea(nCol1, nRow1, nCol1+nColSize-1, nRow1+nRowSize-1, rMark, InsertDeleteFlags::CONTENTS, false, &aBroadcastSpans);
}
sc::CopyFromClipContext aCxt(*this, nullptr, pClipDoc, nInsFlag, bAsLink, bSkipAttrForEmpty);
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 2064d840496d..d01419e0e2af 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -768,8 +768,7 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam) const
bool bRealWildOrRegExp = (rParam.eSearchType != utl::SearchParam::SearchType::Normal &&
((rEntry.eOp == SC_EQUAL) || (rEntry.eOp == SC_NOT_EQUAL)));
- bool bTestWildOrRegExp = false;
- if (bRealWildOrRegExp || bTestWildOrRegExp)
+ if (bRealWildOrRegExp)
{
sal_Int32 nStart = 0;
sal_Int32 nEnd = aCellStr.getLength();
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 810742838814..050cb6639773 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -1452,7 +1452,6 @@ bool dequote( const OUString& rSource, sal_Int32 nStartPos, sal_Int32& rEndPos,
{
// nStartPos has to point to opening quote
- bool bRet = false;
const sal_Unicode cQuote = '\'';
if (rSource[nStartPos] == cQuote)
@@ -1488,7 +1487,7 @@ bool dequote( const OUString& rSource, sal_Int32 nStartPos, sal_Int32& rEndPos,
// no closing quote before the end of the string -> error (bRet still false)
}
- return bRet;
+ return false;
}
struct ScGetPivotDataFunctionEntry
@@ -2426,8 +2425,6 @@ bool ScDPObject::FillLabelDataForDimension(
OUString aSubtotalName = ScUnoHelpFunctions::GetStringProperty(
xDimProp, SC_UNO_DP_FIELD_SUBTOTALNAME, OUString());
- bool bIsValue = true; //TODO: check
-
// Name from the UNO dimension object may have trailing '*'s in which
// case it's a duplicate dimension. Convert that to a duplicate index.
@@ -2438,7 +2435,7 @@ bool ScDPObject::FillLabelDataForDimension(
rLabelData.mnCol = static_cast<SCCOL>(nDim);
rLabelData.mnDupCount = nDupCount;
rLabelData.mbDataLayout = bData;
- rLabelData.mbIsValue = bIsValue;
+ rLabelData.mbIsValue = true; //TODO: check
if (!bData)
{
@@ -3749,15 +3746,10 @@ ScDPObject* ScDPCollection::GetByName(const OUString& rName) const
OUString ScDPCollection::CreateNewName() const
{
- OUString aBase("DataPilot");
-
size_t n = maTables.size();
for (size_t nAdd = 0; nAdd <= n; ++nAdd) // nCount+1 tries
{
- OUStringBuffer aBuf;
- aBuf.append(aBase);
- aBuf.append(static_cast<sal_Int32>(1 + nAdd));
- OUString aNewName = aBuf.makeStringAndClear();
+ OUString aNewName = "DataPilot" + OUString::number(1 + nAdd);
bool bFound = false;
TablesType::const_iterator itr = maTables.begin(), itrEnd = maTables.end();
for (; itr != itrEnd; ++itr)
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index a7420be0bf78..323eb34b431d 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -1091,8 +1091,6 @@ void ScDPSaveData::SetDrillDown(bool bSet)
static void lcl_ResetOrient( const uno::Reference<sheet::XDimensionsSupplier>& xSource )
{
- sheet::DataPilotFieldOrientation eOrient = sheet::DataPilotFieldOrientation_HIDDEN;
-
uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName );
long nIntCount = xIntDims->getCount();
@@ -1102,7 +1100,7 @@ static void lcl_ResetOrient( const uno::Reference<sheet::XDimensionsSupplier>& x
uno::Reference<beans::XPropertySet> xDimProp( xIntDim, uno::UNO_QUERY );
if (xDimProp.is())
{
- xDimProp->setPropertyValue( SC_UNO_DP_ORIENTATION, uno::Any(eOrient) );
+ xDimProp->setPropertyValue( SC_UNO_DP_ORIENTATION, uno::Any(sheet::DataPilotFieldOrientation_HIDDEN) );
}
}
}
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index 38c21bd0e92b..7c92e59d3745 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -1626,8 +1626,7 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const OUString& aPropertyName
aRet <<= mbHasHiddenMember;
else if (aPropertyName == SC_UNO_DP_FLAGS)
{
- sal_Int32 nFlags = 0; // tabular data: all orientations are possible
- aRet <<= nFlags;
+ aRet <<= sal_Int32(0); // tabular data: all orientations are possible
}
else
{
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 45f17c663b51..0611f1b7369a 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -320,7 +320,7 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const OUString& rNewName,
if ( pDrawLayer->ScAddPage( nTab ) ) // sal_False (not inserted) during Undo
{
pDrawLayer->ScRenamePage( nTab, aName );
- sal_uLong nx = (sal_uLong) ((double) (MAXCOL+1) * STD_COL_WIDTH * HMM_PER_TWIPS );
+ sal_uLong const nx = (sal_uLong) ((double) (MAXCOL+1) * STD_COL_WIDTH * HMM_PER_TWIPS );
sal_uLong ny = (sal_uLong) ((double) (MAXROW+1) * ScGlobal::nStdRowHeight * HMM_PER_TWIPS );
pDrawLayer->SetPageSize( static_cast<sal_uInt16>(nTab), Size( nx, ny ), false );
}
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index d4041aa40656..82a464737af6 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -479,7 +479,6 @@ void ScUnoAddInCollection::ReadConfiguration()
std::unique_ptr<ScAddInArgDesc[]> pVisibleArgs;
long nVisibleCount = 0;
- long nCallerPos = SC_CALLERPOS_NONE;
OUString aArgumentsPath(aFuncPropPath + CFGSTR_PARAMETERS);
@@ -547,7 +546,7 @@ void ScUnoAddInCollection::ReadConfiguration()
aFuncName, aLocalName, aDescription,
nCategory, sHelpId,
xFunc, aObject,
- nVisibleCount, pVisibleArgs.get(), nCallerPos );
+ nVisibleCount, pVisibleArgs.get(), SC_CALLERPOS_NONE );
pData->SetCompNames( aCompNames );
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index 889af745e706..40b6a836adfa 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -801,8 +801,7 @@ bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions )
bool ScAutoFormatData::Save(SvStream& rStream, sal_uInt16 fileVersion)
{
- sal_uInt16 nVal = AUTOFORMAT_DATA_ID;
- rStream.WriteUInt16( nVal );
+ rStream.WriteUInt16( AUTOFORMAT_DATA_ID );
// --- from 680/dr25 on: store strings as UTF-8
write_uInt16_lenPrefixed_uInt8s_FromOUString(rStream, aName, RTL_TEXTENCODING_UTF8);
@@ -1021,7 +1020,6 @@ void ScAutoFormat::Load()
if( nVal == AUTOFORMAT_ID_358 ||
(AUTOFORMAT_ID_504 <= nVal && nVal <= AUTOFORMAT_ID) )
{
- sal_uInt16 nFileVers = SOFFICE_FILEFORMAT_40;
sal_uInt8 nChrSet, nCnt;
long nPos = rStream.Tell();
rStream.ReadUChar( nCnt ).ReadUChar( nChrSet );
@@ -1031,7 +1029,7 @@ void ScAutoFormat::Load()
rStream.Seek( nPos + nCnt );
}
rStream.SetStreamCharSet( GetSOLoadTextEncoding( nChrSet ) );
- rStream.SetVersion( nFileVers );
+ rStream.SetVersion( SOFFICE_FILEFORMAT_40 );
}
if( nVal == AUTOFORMAT_ID_358 || nVal == AUTOFORMAT_ID_X ||
@@ -1073,8 +1071,7 @@ bool ScAutoFormat::Save()
rStream.SetVersion( fileVersion );
// Attention: A common header has to be saved
- sal_uInt16 nVal = AUTOFORMAT_ID;
- rStream.WriteUInt16( nVal )
+ rStream.WriteUInt16( AUTOFORMAT_ID )
.WriteUChar( 2 ) // Number of chars of the header including this
.WriteUChar( ::GetSOStoreTextEncoding(
osl_getThreadTextEncoding() ) );
diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx
index 76e59047febb..cf3a3a355605 100644
--- a/sc/source/core/tool/consoli.cxx
+++ b/sc/source/core/tool/consoli.cxx
@@ -716,7 +716,6 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
if (ppTitlePos && !maTitles.empty() && !maRowHeaders.empty())
{
- OUString aDelim( " / " );
for (SCSIZE nPos=0; nPos<nDataCount; nPos++)
{
SCSIZE nTPos = ppTitlePos[nArrY][nPos];
@@ -726,9 +725,7 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
bDo = false; // empty
if ( bDo && nTPos < nNeeded )
{
- aString = maRowHeaders[nArrY];
- aString += aDelim;
- aString += maTitles[nPos];
+ aString = maRowHeaders[nArrY] + " / " + maTitles[nPos];
pDestDoc->SetString( nCol-1, nRow+nArrY+nTPos, nTab, aString );
}
}
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 1f2e7703f271..202ec4edfb3a 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -1236,9 +1236,8 @@ ScDBData* ScDBCollection::AnonDBs::getByRange(const ScRange& rRange)
if (!pData)
{
// Insert a new db data. They all have identical names.
- OUString aName(STR_DB_GLOBAL_NONAME);
::std::unique_ptr<ScDBData> pNew(new ScDBData(
- aName, rRange.aStart.Tab(), rRange.aStart.Col(), rRange.aStart.Row(),
+ STR_DB_GLOBAL_NONAME, rRange.aStart.Tab(), rRange.aStart.Col(), rRange.aStart.Row(),
rRange.aEnd.Col(), rRange.aEnd.Row(), true, false, false));
pData = pNew.get();
m_DBs.push_back(std::move(pNew));
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 56c3578088aa..be341862b9ce 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -189,8 +189,7 @@ ScDetectiveData::ScDetectiveData( SdrModel* pModel ) :
aCircleSet.Put( XLineColorItem( OUString(), Color( ScDetectiveFunc::GetErrorColor() ) ) );
aCircleSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
- sal_uInt16 nWidth = 55; // 54 = 1 Pixel
- aCircleSet.Put( XLineWidthItem( nWidth ) );
+ aCircleSet.Put( XLineWidthItem( 55 ) ); // 54 = 1 Pixel
}
ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) :
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index 94a762a9f7ca..383d8227468a 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -153,11 +153,10 @@ void ScEditUtil::RemoveCharAttribs( EditTextObject& rEditText, const ScPatternAt
{ ATTR_FONT_WEIGHT, EE_CHAR_WEIGHT },
{ ATTR_FONT_COLOR, EE_CHAR_COLOR }
};
- sal_uInt16 nMapCount = SAL_N_ELEMENTS(AttrTypeMap);
const SfxItemSet& rSet = rAttr.GetItemSet();
const SfxPoolItem* pItem;
- for (sal_uInt16 i = 0; i < nMapCount; ++i)
+ for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS(AttrTypeMap); ++i)
{
if ( rSet.GetItemState(AttrTypeMap[i].nAttrType, false, &pItem) == SfxItemState::SET )
rEditText.RemoveCharAttribs(AttrTypeMap[i].nCharType);
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 3e61c081e24b..fd80714c2001 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -3337,7 +3337,6 @@ void ScInterpreter::ScEuroConvert()
double fToRate;
int nFromDec;
int nToDec;
- OUString aEur( "EUR");
if ( lclConvertMoney( aFromUnit, fFromRate, nFromDec )
&& lclConvertMoney( aToUnit, fToRate, nToDec ) )
{
@@ -3346,7 +3345,7 @@ void ScInterpreter::ScEuroConvert()
fRes = fVal;
else
{
- if ( aFromUnit.equalsIgnoreAsciiCase( aEur ) )
+ if ( aFromUnit.equalsIgnoreAsciiCase( "EUR" ) )
fRes = fVal * fToRate;
else
{
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index cbf3ff621495..b9c6f9a77f8d 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -473,7 +473,7 @@ ScRangeData::IsNameValidType ScRangeData::IsNameValid( const OUString& rName, Sc
{
/* XXX If changed, sc/source/filter/ftools/ftools.cxx
* ScfTools::ConvertToScDefinedName needs to be changed too. */
- sal_Char a('.');
+ sal_Char const a('.');
if (rName.indexOf(a) != -1)
return NAME_INVALID_BAD_STRING;
sal_Int32 nPos = 0;
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 8349a781dd5c..2e054973dca2 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -5062,7 +5062,6 @@ OUString ScTokenArray::CreateString( sc::TokenStringContext& rCxt, const ScAddre
{
const FormulaToken* pToken = *p;
OpCode eOp = pToken->GetOpCode();
- bool bCheckType = true;
if (eOp == ocSpaces)
{
// TODO : Handle intersection operator '!!'.
@@ -5073,8 +5072,7 @@ OUString ScTokenArray::CreateString( sc::TokenStringContext& rCxt, const ScAddre
if (eOp < rCxt.mxOpCodeMap->getSymbolCount())
aBuf.append(rCxt.mxOpCodeMap->getSymbol(eOp));
- if (bCheckType)
- appendTokenByType(rCxt, aBuf, *pToken, rPos, IsFromRangeName());
+ appendTokenByType(rCxt, aBuf, *pToken, rPos, IsFromRangeName());
}
return aBuf.makeStringAndClear();
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index 8ed97f50c82e..f300bddc93ac 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -1610,11 +1610,10 @@ void ExcelToSc::DoMulArgs( DefTokenId eId, sal_uInt8 nAnz )
// [Parameter{;Parameter}]
if( nLast > nSkipEnd )
{
- sal_Int16 nNull = -1; // skip this parameter
aPool << eParam[ nLast ];
for( nLauf = nLast - 1 ; nLauf > nSkipEnd ; nLauf-- )
{
- if( nLauf != nNull )
+ if( nLauf != -1 ) // skip this parameter
aPool << ocSep << eParam[ nLauf ];
}
}
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 849fee3b4157..2fcd0aedb8dd 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -783,8 +783,7 @@ void XclImpAutoFilterData::Apply()
if( bActive || bCriteria)
{
ScDocument& rDoc = pExcRoot->pIR->GetDocRef();
- OUString aNewName(STR_DB_LOCAL_NONAME);
- pCurrDBData = new ScDBData(aNewName , Tab(),
+ pCurrDBData = new ScDBData(STR_DB_LOCAL_NONAME, Tab(),
StartCol(),StartRow(), EndCol(),EndRow() );
if(bCriteria)
{
diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index e4bf6a5c99c8..dcd86be84c7a 100644
--- a/sc/source/filter/excel/xepage.cxx
+++ b/sc/source/filter/excel/xepage.cxx
@@ -310,7 +310,7 @@ XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) :
set<SCROW> aRowBreaks;
rDoc.GetAllRowBreaks(aRowBreaks, nScTab, false, true);
- SCROW nMaxRow = numeric_limits<sal_uInt16>::max();
+ SCROW const nMaxRow = numeric_limits<sal_uInt16>::max();
for (set<SCROW>::const_iterator itr = aRowBreaks.begin(), itrEnd = aRowBreaks.end(); itr != itrEnd; ++itr)
{
SCROW nRow = *itr;
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index 53599bb3b2e1..5f79475a5dd4 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -1517,14 +1517,14 @@ void XclExpPivotTable::WriteQsiSxTag( XclExpStream& rStrm ) const
{
rStrm.StartRecord( 0x0802, 32 );
- sal_uInt16 nRecordType = 0x0802;
- sal_uInt16 nDummyFlags = 0x0000;
- sal_uInt16 nTableType = 1; // 0 = query table : 1 = pivot table
+ sal_uInt16 const nRecordType = 0x0802;
+ sal_uInt16 const nDummyFlags = 0x0000;
+ sal_uInt16 const nTableType = 1; // 0 = query table : 1 = pivot table
rStrm << nRecordType << nDummyFlags << nTableType;
// General flags
- sal_uInt16 nFlags = 0x0001;
+ sal_uInt16 const nFlags = 0x0001;
#if 0
// for doc purpose
sal_uInt16 nFlags = 0x0000;
@@ -1540,7 +1540,7 @@ void XclExpPivotTable::WriteQsiSxTag( XclExpStream& rStrm ) const
// Feature-specific options. The value differs depending on the table
// type, but we assume the table type is always pivot table.
- sal_uInt32 nOptions = 0x00000000;
+ sal_uInt32 const nOptions = 0x00000000;
#if 0
// documentation for which bit is for what
bool bNoStencil = false;
@@ -1555,7 +1555,7 @@ void XclExpPivotTable::WriteQsiSxTag( XclExpStream& rStrm ) const
rStrm << nOptions;
sal_uInt8 eXclVer = 0; // Excel2000
- sal_uInt8 nOffsetBytes = 16;
+ sal_uInt8 const nOffsetBytes = 16;
rStrm << eXclVer // version table last refreshed
<< eXclVer // minimum version to refresh
<< nOffsetBytes
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 43aa4c0b9525..222e4aa18300 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -270,9 +270,8 @@ void XclExpStream::WriteZeroBytesToRecord( std::size_t nBytes )
// not in record.
return;
- sal_uInt8 nZero = 0;
for (std::size_t i = 0; i < nBytes; ++i)
- *this << nZero;
+ *this << sal_uInt8(0)/*nZero*/;
}
void XclExpStream::CopyFromStream(SvStream& rInStrm, sal_uInt64 const nBytes)
diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx
index 153ee4f2612c..918866c9b089 100644
--- a/sc/source/filter/excel/xeview.cxx
+++ b/sc/source/filter/excel/xeview.cxx
@@ -256,11 +256,11 @@ void XclExpTabBgColor::WriteBody( XclExpStream& rStrm )
{
if ( mrTabViewData.IsDefaultTabBgColor() )
return;
- sal_uInt16 rt = 0x0862; //rt
- sal_uInt16 grbitFrt = 0x0000; //grbit must be set to 0
+ sal_uInt16 const rt = 0x0862; //rt
+ sal_uInt16 const grbitFrt = 0x0000; //grbit must be set to 0
sal_uInt32 unused = 0x00000000; //Use twice...
- sal_uInt32 cb = 0x00000014; // Record Size, may be larger in future...
- sal_uInt16 reserved = 0x0000; //trailing bits are 0
+ sal_uInt32 const cb = 0x00000014; // Record Size, may be larger in future...
+ sal_uInt16 const reserved = 0x0000; //trailing bits are 0
sal_uInt16 TabBgColorIndex;
XclExpPalette& rPal = rStrm.GetRoot().GetPalette();
TabBgColorIndex = rPal.GetColorIndex(mrTabViewData.mnTabBgColorId);
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 150820e88ae0..178237899f52 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -680,8 +680,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
if( !mxScCondFmt.get() )
{
- sal_uLong nKey = 0;
- mxScCondFmt.reset( new ScConditionalFormat( nKey, &GetDocRef() ) );
+ mxScCondFmt.reset( new ScConditionalFormat( 0/*nKey*/, &GetDocRef() ) );
if(maRanges.size() > 1)
maRanges.Join(*maRanges[0], true);
mxScCondFmt->SetRange(maRanges);
@@ -1082,9 +1081,8 @@ void XclImpWebQueryBuffer::ReadWqtables( XclImpStream& rStrm )
void XclImpWebQueryBuffer::Apply()
{
ScDocument& rDoc = GetDoc();
- OUString aFilterName( EXC_WEBQRY_FILTER );
for( XclImpWebQueryList::iterator itQuery = maWQList.begin(); itQuery != maWQList.end(); ++itQuery )
- itQuery->Apply( rDoc, aFilterName );
+ itQuery->Apply( rDoc, EXC_WEBQRY_FILTER );
}
// Decryption =================================================================
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index faf4802ff3c0..f8455ba868b7 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -1496,10 +1496,9 @@ void XclImpTextObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject&
{
if( SdrObjCustomShape* pObjCustomShape = dynamic_cast< SdrObjCustomShape* >( &rSdrObj ) )
{
- double fAngle = 180.0;
css::beans::PropertyValue aTextRotateAngle;
aTextRotateAngle.Name = "TextRotateAngle";
- aTextRotateAngle.Value <<= fAngle;
+ aTextRotateAngle.Value <<= 180.0;
SdrCustomShapeGeometryItem aGeometryItem(static_cast<const SdrCustomShapeGeometryItem&>(pObjCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )));
aGeometryItem.SetPropertyValue( aTextRotateAngle );
pObjCustomShape->SetMergedItem( aGeometryItem );
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index 655d4abce789..638c65f981c5 100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -992,7 +992,6 @@ void XclChPropSetHelper::WriteAreaProperties( ScfPropertySet& rPropSet,
namespace cssd = ::com::sun::star::drawing;
cssd::FillStyle eFillStyle = cssd::FillStyle_NONE;
Color aColor;
- sal_Int16 nTransparency = 0;
// fill color
if( rAreaFmt.mnPattern != EXC_PATT_NONE )
@@ -1004,7 +1003,7 @@ void XclChPropSetHelper::WriteAreaProperties( ScfPropertySet& rPropSet,
// write the properties
ScfPropSetHelper& rAreaHlp = GetAreaHelper( ePropMode );
rAreaHlp.InitializeWrite();
- rAreaHlp << eFillStyle << aColor << nTransparency;
+ rAreaHlp << eFillStyle << aColor << 0/*nTransparency*/;
rAreaHlp.WriteToPropertySet( rPropSet );
}
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 87d444436546..4811c230c2bc 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -2136,11 +2136,9 @@ void ScHTMLTable::DataOn( const HtmlImportInfo& rInfo )
{
// Pick up the number format associated with this class (if
// any).
- OUString aElem("td");
OUString aClass = itr->GetString();
- OUString aProp("mso-number-format");
const ScHTMLStyles& rStyles = mpParser->GetStyles();
- const OUString& rVal = rStyles.getPropertyValue(aElem, aClass, aProp);
+ const OUString& rVal = rStyles.getPropertyValue("td", aClass, "mso-number-format");
if (!rVal.isEmpty())
{
OUString aNumFmt = decodeNumberFormat(rVal);
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index c066684443e7..790fc829ebcc 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -201,10 +201,9 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri
// [Parameter{;Parameter}]
aPool << eParam[ nLast ];
- sal_Int16 nNull = -1; // lists the parameter to be excluded
for( nLauf = nLast - 1 ; nLauf >= 0 ; nLauf-- )
{
- if( nLauf != nNull )
+ if( nLauf != -1 ) // lists the parameter to be excluded
aPool << ocSep << eParam[ nLauf ];
}
}
diff --git a/sc/source/filter/lotus/lotread.cxx b/sc/source/filter/lotus/lotread.cxx
index 9d4dfab84bb3..ce871ba4b49c 100644
--- a/sc/source/filter/lotus/lotread.cxx
+++ b/sc/source/filter/lotus/lotread.cxx
@@ -197,7 +197,6 @@ ErrCode ImportLotus::Read()
SCTAB nCnt;
OUString aTabName;
OUString aBaseName;
- OUString aRef( "temp" );
if( nTabs != 0 )
{
if( nTabs > 1 )
@@ -210,7 +209,7 @@ ErrCode ImportLotus::Read()
OSL_ENSURE( pD->HasTable( nCnt ),
"-ImportLotus::Read(): Where is my table?!" );
pD->GetName( nCnt, aTabName );
- if( aTabName.equals(aRef) )
+ if( aTabName == "temp" )
{
aTabName = aBaseName;
pD->CreateValidTabName( aTabName );
diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index 4ec3f386a338..6ba6f136e0b0 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -140,11 +140,10 @@ void QProToSc::DoFunc( DefTokenId eOc, sal_uInt16 nArgs, const sal_Char* pExtStr
aPool << eParam[ 3 ] << ocSep << eParam[ 2 ] << ocSep << eParam[ 1 ] << ocSep << eParam[ 0 ];
else
{
- sal_Int16 nNull = -1;
aPool << eParam[ nLast ];
for( nCount = nLast - 1 ; nCount >= 0 ; nCount-- )
{
- if( nCount != nNull )
+ if( nCount != -1 )
aPool << ocSep << eParam[ nCount ];
}
}
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 951bf09bd53c..ed8bb5e8cdda 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1586,9 +1586,8 @@ void XclExpSheetProtectOptions::WriteBody( XclExpStream& rStrm )
sal_uInt16 nBytes = 0x0867;
rStrm << nBytes;
- unsigned char nZero = 0x00;
for (int i = 0; i < 9; ++i)
- rStrm << nZero;
+ rStrm << 0;
nBytes = 0x0200;
rStrm << nBytes;
@@ -1612,7 +1611,7 @@ XclExpSheetEnhancedProtection::XclExpSheetEnhancedProtection( const XclExpRoot&
void XclExpSheetEnhancedProtection::WriteBody( XclExpStream& rStrm )
{
- sal_uInt16 nRecordType = 0x0868;
+ sal_uInt16 const nRecordType = 0x0868;
rStrm << nRecordType; // frtHeader rt
rStrm.WriteZeroBytesToRecord(10); // frtHeader unused
rStrm << EXC_ISFPROTECTION; // isf
@@ -1809,8 +1808,7 @@ void XclExpWriteAccess::WriteBody( XclExpStream& rStrm )
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 };
- std::size_t nDataSize = sizeof(aData);
- for (std::size_t i = 0; i < nDataSize; ++i)
+ for (std::size_t i = 0; i < sizeof(aData); ++i)
rStrm << aData[i];
}
diff --git a/sc/source/filter/xml/XMLCodeNameProvider.cxx b/sc/source/filter/xml/XMLCodeNameProvider.cxx
index bb05210c22ab..8cd724f7c950 100644
--- a/sc/source/filter/xml/XMLCodeNameProvider.cxx
+++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx
@@ -29,11 +29,10 @@ bool XMLCodeNameProvider::_getCodeName( const uno::Any& aAny, OUString& rCodeNam
if( !(aAny >>= aProps) )
return false;
- OUString sCodeNameProp("CodeName");
sal_Int32 nPropCount = aProps.getLength();
for( sal_Int32 i=0; i<nPropCount; i++ )
{
- if( aProps[i].Name == sCodeNameProp )
+ if( aProps[i].Name == "CodeName" )
{
OUString sCodeName;
if( aProps[i].Value >>= sCodeName )
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 6236dd6e7369..e1e1a39d7ae8 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -157,8 +157,7 @@ void ScMyValidationsContainer::AddValidation(const uno::Any& aTempAny,
{
sal_Int32 nNameIndex(nCount + 1);
OUString sCount(OUString::number(nNameIndex));
- OUString sPrefix("val");
- aValidation.sName += sPrefix;
+ aValidation.sName += "val";
aValidation.sName += sCount;
aValidationVec.push_back(aValidation);
nValidationIndex = nCount;
diff --git a/sc/source/filter/xml/editattributemap.cxx b/sc/source/filter/xml/editattributemap.cxx
index fdb009cbde56..518a37b988e7 100644
--- a/sc/source/filter/xml/editattributemap.cxx
+++ b/sc/source/filter/xml/editattributemap.cxx
@@ -67,8 +67,7 @@ ScXMLEditAttributeMap::Entry const aEntries[] = {
ScXMLEditAttributeMap::ScXMLEditAttributeMap()
{
- size_t n = SAL_N_ELEMENTS(aEntries);
- for (size_t i = 0; i < n; ++i)
+ for (size_t i = 0; i < SAL_N_ELEMENTS(aEntries); ++i)
{
maAPIEntries.insert(
StrToEntriesType::value_type(
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index 9c396d04b555..2b90f841284d 100644
--- a/sc/source/filter/xml/xmlcoli.cxx
+++ b/sc/source/filter/xml/xmlcoli.cxx
@@ -135,11 +135,10 @@ void ScXMLTableColContext::EndElement()
}
}
}
- OUString sVisible(SC_UNONAME_CELLVIS);
bool bValue(true);
if (!IsXMLToken(sVisibility, XML_VISIBLE))
bValue = false;
- xColumnProperties->setPropertyValue(sVisible, uno::makeAny(bValue));
+ xColumnProperties->setPropertyValue(SC_UNONAME_CELLVIS, uno::makeAny(bValue));
}
}
}
diff --git a/sc/source/filter/xml/xmlcvali.cxx b/sc/source/filter/xml/xmlcvali.cxx
index b736cec252c3..af76bf829149 100644
--- a/sc/source/filter/xml/xmlcvali.cxx
+++ b/sc/source/filter/xml/xmlcvali.cxx
@@ -383,11 +383,10 @@ void ScXMLContentValidationContext::EndElement()
// #i36650# event-listeners element moved up one level
if (xEventContext.is())
{
- OUString sOnError("OnError");
XMLEventsImportContext* pEvents =
static_cast<XMLEventsImportContext*>(xEventContext.get());
uno::Sequence<beans::PropertyValue> aValues;
- pEvents->GetEventSequence( sOnError, aValues );
+ pEvents->GetEventSequence( "OnError", aValues );
sal_Int32 nLength = aValues.getLength();
for( sal_Int32 i = 0; i < nLength; i++ )
diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx
index c38fd98e9f37..eab22def3a85 100644
--- a/sc/source/filter/xml/xmldrani.cxx
+++ b/sc/source/filter/xml/xmldrani.cxx
@@ -428,8 +428,7 @@ void ScXMLDatabaseRangeContext::EndElement()
if (meRangeType == ScDBCollection::SheetAnonymous)
{
- OUString aName(STR_DB_LOCAL_NONAME);
- ::std::unique_ptr<ScDBData> pData(ConvertToDBData(aName));
+ ::std::unique_ptr<ScDBData> pData(ConvertToDBData(STR_DB_LOCAL_NONAME));
if (pData.get())
{
@@ -443,8 +442,7 @@ void ScXMLDatabaseRangeContext::EndElement()
}
else if (meRangeType == ScDBCollection::GlobalAnonymous)
{
- OUString aName(STR_DB_GLOBAL_NONAME);
- ::std::unique_ptr<ScDBData> pData(ConvertToDBData(aName));
+ ::std::unique_ptr<ScDBData> pData(ConvertToDBData(STR_DB_GLOBAL_NONAME));
if (pData.get())
{
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 89fb12331df3..aba3614f99cb 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -1978,14 +1978,13 @@ void ScXMLExport::ExportStyles_( bool bUsed )
if (xCellStyles.is())
{
sal_Int32 nCount(xCellStyles->getCount());
- OUString sNumberFormat(SC_UNONAME_NUMFMT);
for (sal_Int32 i = 0; i < nCount; ++i)
{
uno::Reference <beans::XPropertySet> xCellProperties(xCellStyles->getByIndex(i), uno::UNO_QUERY);
if (xCellProperties.is())
{
sal_Int32 nNumberFormat = 0;
- if (xCellProperties->getPropertyValue(sNumberFormat) >>= nNumberFormat)
+ if (xCellProperties->getPropertyValue(SC_UNONAME_NUMFMT) >>= nNumberFormat)
addDataStyle(nNumberFormat);
}
}
@@ -2012,9 +2011,6 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x
//! pass xCellRanges instead
uno::Reference<sheet::XSheetCellRanges> xCellRanges( xProperties, uno::UNO_QUERY );
- OUString SC_SCELLPREFIX(XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX);
- OUString SC_NUMBERFORMAT(SC_UNONAME_NUMFMT);
-
OUString sStyleName;
sal_Int32 nNumberFormat(-1);
sal_Int32 nValidationIndex(-1);
@@ -2072,7 +2068,7 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x
if (nCount == 1) // this is the CellStyle and should be removed if alone
aPropStates.clear();
if (nNumberFormat == -1)
- xProperties->getPropertyValue(SC_NUMBERFORMAT) >>= nNumberFormat;
+ xProperties->getPropertyValue(SC_UNONAME_NUMFMT) >>= nNumberFormat;
if (!sStyleName.isEmpty())
{
if (!aPropStates.empty())
@@ -2114,7 +2110,7 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x
delete pTemp;
}
else
- nIndex = pCellStyles->GetIndexOfStyleName(sName, SC_SCELLPREFIX, bIsAutoStyle);
+ nIndex = pCellStyles->GetIndexOfStyleName(sName, XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX, bIsAutoStyle);
uno::Sequence<table::CellRangeAddress> aAddresses(xCellRanges->getRangeAddresses());
table::CellRangeAddress* pAddresses(aAddresses.getArray());
@@ -2162,8 +2158,6 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x
void ScXMLExport::AddStyleFromColumn(const uno::Reference<beans::XPropertySet>& xColumnProperties,
const OUString* pOldName, sal_Int32& rIndex, bool& rIsVisible)
{
- OUString SC_SCOLUMNPREFIX(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX);
-
std::vector<XMLPropertyState> aPropStates(xColumnStylesExportPropertySetMapper->Filter(xColumnProperties));
if(!aPropStates.empty())
{
@@ -2199,7 +2193,7 @@ void ScXMLExport::AddStyleFromColumn(const uno::Reference<beans::XPropertySet>&
rIndex = pColumnStyles->AddStyleName(pTemp);
}
else
- rIndex = pColumnStyles->GetIndexOfStyleName(sName, SC_SCOLUMNPREFIX);
+ rIndex = pColumnStyles->GetIndexOfStyleName(sName, XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX);
}
}
}
@@ -2207,8 +2201,6 @@ void ScXMLExport::AddStyleFromColumn(const uno::Reference<beans::XPropertySet>&
void ScXMLExport::AddStyleFromRow(const uno::Reference<beans::XPropertySet>& xRowProperties,
const OUString* pOldName, sal_Int32& rIndex)
{
- OUString SC_SROWPREFIX(XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX);
-
std::vector<XMLPropertyState> aPropStates(xRowStylesExportPropertySetMapper->Filter(xRowProperties));
if(!aPropStates.empty())
{
@@ -2232,7 +2224,7 @@ void ScXMLExport::AddStyleFromRow(const uno::Reference<beans::XPropertySet>& xRo
rIndex = pRowStyles->AddStyleName(pTemp);
}
else
- rIndex = pRowStyles->GetIndexOfStyleName(sName, SC_SROWPREFIX);
+ rIndex = pRowStyles->GetIndexOfStyleName(sName, XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX);
}
}
}
@@ -3382,8 +3374,6 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
uno::Reference < beans::XPropertySet > xShapeProps ( xShape, uno::UNO_QUERY );
bool bIsChart( false );
OUString sPropCLSID ("CLSID");
- OUString sPropModel ("Model");
- OUString sPersistName ("PersistName");
if (xShapeProps.is())
{
sal_Int32 nZOrder = 0;
@@ -3404,7 +3394,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
if ( pDoc )
{
OUString aChartName;
- xShapeProps->getPropertyValue( sPersistName ) >>= aChartName;
+ xShapeProps->getPropertyValue( "PersistName" ) >>= aChartName;
ScChartListenerCollection* pCollection = pDoc->GetChartListenerCollection();
if (pCollection)
{
@@ -3431,7 +3421,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
if ( sRanges.isEmpty() )
{
uno::Reference< frame::XModel > xChartModel;
- if( ( xShapeProps->getPropertyValue( sPropModel ) >>= xChartModel ) &&
+ if( ( xShapeProps->getPropertyValue( "Model" ) >>= xChartModel ) &&
xChartModel.is())
{
uno::Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 2bcbd62b9e69..c777658a65cf 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -2661,15 +2661,12 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence<beans::PropertyVa
if (xMultiServiceFactory.is())
{
sal_Int32 nCount(aConfigProps.getLength());
- OUString sCTName("TrackedChangesProtectionKey");
- OUString sVBName("VBACompatibilityMode");
- OUString sSCName("ScriptConfiguration");
css::uno::Sequence<css::beans::PropertyValue> aFilteredProps(
aConfigProps.getLength());
sal_Int32 nFilteredPropsLen = 0;
for (sal_Int32 i = nCount - 1; i >= 0; --i)
{
- if (aConfigProps[i].Name == sCTName)
+ if (aConfigProps[i].Name == "TrackedChangesProtectionKey")
{
OUString sKey;
if (aConfigProps[i].Value >>= sKey)
@@ -2691,7 +2688,7 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence<beans::PropertyVa
}
}
// store the following items for later use (after document is loaded)
- else if ((aConfigProps[i].Name == sVBName) || (aConfigProps[i].Name == sSCName))
+ else if ((aConfigProps[i].Name == "VBACompatibilityMode") || (aConfigProps[i].Name == "ScriptConfiguration"))
{
uno::Reference< beans::XPropertySet > xImportInfo = getImportInfo();
if (xImportInfo.is())
diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx
index 094907096a82..269f242b708f 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -685,10 +685,9 @@ void ScXMLAutoStylePoolP::exportStyleContent(
SvXMLAutoStylePoolP::exportStyleContent( rHandler, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap );
if (nFamily == XML_STYLE_FAMILY_TABLE_CELL)
{
- bool bNotFound = true;
::std::vector< XMLPropertyState >::const_iterator i(rProperties.begin());
::std::vector< XMLPropertyState >::const_iterator endi(rProperties.end());
- for(; i != endi && bNotFound; ++i)
+ for(; i != endi; ++i)
{
if (i->mnIndex != -1)
{
@@ -1347,8 +1346,7 @@ bool XmlScPropHdl_HoriJustifySource::importXML(
}
else if (IsXMLToken(rStrImpValue, XML_VALUE_TYPE))
{
- table::CellHoriJustify nValue(table::CellHoriJustify_STANDARD);
- rValue <<= nValue;
+ rValue <<= table::CellHoriJustify_STANDARD;
bRetval = true;
}
@@ -1408,8 +1406,7 @@ bool XmlScPropHdl_HoriJustifyRepeat::importXML(
}
else if (IsXMLToken(rStrImpValue, XML_TRUE))
{
- table::CellHoriJustify nValue = table::CellHoriJustify_REPEAT;
- rValue <<= nValue;
+ rValue <<= table::CellHoriJustify_REPEAT;
bRetval = true;
}
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 92295e09f993..979c3cda75c1 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -154,8 +154,7 @@ ErrCode ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCompo
OSL_ENSURE( xInfoSet.is(), "missing property set" );
if( xInfoSet.is() )
{
- OUString sPropName("StreamName");
- xInfoSet->setPropertyValue( sPropName, uno::makeAny( sStream ) );
+ xInfoSet->setPropertyValue( "StreamName", uno::makeAny( sStream ) );
}
ErrCode nReturn = ERRCODE_NONE;
@@ -628,10 +627,9 @@ bool ScXMLImportWrapper::ExportToComponent(const uno::Reference<uno::XComponentC
if (xSet.is())
{
xSet->setPropertyValue("MediaType", uno::makeAny(sMediaType));
- OUString aUseCommonPassPropName("UseCommonStoragePasswordEncryption");
// advise storage impl to use common encryption
- xSet->setPropertyValue( aUseCommonPassPropName, uno::makeAny(true) );
+ xSet->setPropertyValue( "UseCommonStoragePasswordEncryption", uno::makeAny(true) );
}
xOut = xStream->getOutputStream();
@@ -644,8 +642,7 @@ bool ScXMLImportWrapper::ExportToComponent(const uno::Reference<uno::XComponentC
OSL_ENSURE( xInfoSet.is(), "missing property set" );
if( xInfoSet.is() )
{
- OUString sPropName("StreamName");
- xInfoSet->setPropertyValue( sPropName, uno::makeAny( sName ) );
+ xInfoSet->setPropertyValue( "StreamName", uno::makeAny( sName ) );
}
xWriter->setOutputStream( xOut );
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx
index a88d46a0d7d5..8c672119d411 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -540,10 +540,9 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScAccessibleCell::getCharacterAtt
sal_uInt16 nParaIndent = static_cast< const SfxUInt16Item* >( mpDoc->GetAttr( maCellAddress.Col(), maCellAddress.Row(), maCellAddress.Tab(), ATTR_INDENT ) )->GetValue();
if (nParaIndent > 0)
{
- OUString sLeftMarginName ("ParaLeftMargin");
for (int i = 0; i < aAttribs.getLength(); ++i)
{
- if (sLeftMarginName == pAttribs[i].Name)
+ if ("ParaLeftMargin" == pAttribs[i].Name)
{
pAttribs[i].Value <<= nParaIndent;
break;
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index 448aad8cfdbd..d13dfe1e072b 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -173,8 +173,7 @@ uno::Any SAL_CALL ScAccessiblePreviewHeaderCell::getMaximumValue()
uno::Any SAL_CALL ScAccessiblePreviewHeaderCell::getMinimumValue()
{
- double fValue(0.0);
- return uno::Any(fValue);
+ return uno::Any(0.0);
}
//===== XAccessibleComponent ============================================
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index 7354b92bf90e..8d9ee27c0070 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -580,8 +580,7 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessiblePreviewTable::getImplementationId()
OUString SAL_CALL ScAccessiblePreviewTable::createAccessibleDescription()
{
- OUString sDesc(STR_ACC_TABLE_DESCR);
- return sDesc;
+ return OUString(STR_ACC_TABLE_DESCR);
}
OUString SAL_CALL ScAccessiblePreviewTable::createAccessibleName()
diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
index b598dba0953a..e9c22a9d8e0e 100644
--- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
@@ -343,8 +343,7 @@ uno::Reference< XAccessible > SAL_CALL
OUString SAL_CALL
ScAccessibleTableBase::createAccessibleDescription()
{
- OUString sDesc(STR_ACC_TABLE_DESCR);
- return sDesc;
+ return OUString(STR_ACC_TABLE_DESCR);
}
OUString SAL_CALL ScAccessibleTableBase::createAccessibleName()
@@ -398,8 +397,7 @@ void SAL_CALL ScAccessibleTableBase::selectAllAccessibleChildren()
sal_Int32 SAL_CALL
ScAccessibleTableBase::getSelectedAccessibleChildCount( )
{
- sal_Int32 nResult(0);
- return nResult;
+ return 0;
}
uno::Reference<XAccessible > SAL_CALL
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index dfbd1c43bbb3..a8982a130c75 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1086,7 +1086,7 @@ void ScInputHandler::ShowTip( const OUString& rText )
aPos = pTipVisibleParent->OutputToScreenPixel( aPos );
tools::Rectangle aRect( aPos, aPos );
- QuickHelpFlags nAlign = QuickHelpFlags::Left|QuickHelpFlags::Bottom;
+ QuickHelpFlags const nAlign = QuickHelpFlags::Left|QuickHelpFlags::Bottom;
nTipVisible = Help::ShowPopover(pTipVisibleParent, aRect, rText, nAlign);
pTipVisibleParent->AddEventListener( LINK( this, ScInputHandler, ShowHideTipVisibleParentListener ) );
}
@@ -1110,7 +1110,7 @@ void ScInputHandler::ShowTipBelow( const OUString& rText )
}
aPos = pTipVisibleSecParent->OutputToScreenPixel( aPos );
tools::Rectangle aRect( aPos, aPos );
- QuickHelpFlags nAlign = QuickHelpFlags::Left | QuickHelpFlags::Top | QuickHelpFlags::NoEvadePointer;
+ QuickHelpFlags const nAlign = QuickHelpFlags::Left | QuickHelpFlags::Top | QuickHelpFlags::NoEvadePointer;
nTipVisibleSec = Help::ShowPopover(pTipVisibleSecParent, aRect, rText, nAlign);
pTipVisibleSecParent->AddEventListener( LINK( this, ScInputHandler, ShowHideTipVisibleSecParentListener ) );
}
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 70957b3aa601..96f0fb41da9f 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2050,7 +2050,7 @@ void ScPosWnd::Modify()
tools::Rectangle aRect( aPos, aPos );
OUString aText = ScGlobal::GetRscString( nStrId );
- QuickHelpFlags nAlign = QuickHelpFlags::Left|QuickHelpFlags::Bottom;
+ QuickHelpFlags const nAlign = QuickHelpFlags::Left|QuickHelpFlags::Bottom;
nTipVisible = Help::ShowPopover(pWin, aRect, aText, nAlign);
}
}
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index db43a50e0268..513c23e06381 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -379,16 +379,10 @@ void ScModule::Execute( SfxRequest& rReq )
switch ( nSlot )
{
case SID_CHOOSE_DESIGN:
- {
- OUString aMacroName("Template.Samples.ShowStyles");
- SfxApplication::CallAppBasic( aMacroName );
- }
+ SfxApplication::CallAppBasic( "Template.Samples.ShowStyles" );
break;
case SID_EURO_CONVERTER:
- {
- OUString aMacroName("Euro.ConvertRun.Main");
- SfxApplication::CallAppBasic( aMacroName );
- }
+ SfxApplication::CallAppBasic( "Euro.ConvertRun.Main" );
break;
case SID_AUTOSPELL_CHECK:
{
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index d4ff05e72f6c..0a42c36d2c45 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -361,7 +361,7 @@ void ScMenuFloatingWindow::drawMenuItem(vcl::RenderContext& rRenderContext, size
getMenuItemPosSize(nPos, aPos, aSize);
DecorationView aDecoView(&rRenderContext);
- long nXOffset = 5;
+ long const nXOffset = 5;
long nYOffset = (aSize.Height() - maLabelFont.GetFontHeight())/2;
rRenderContext. DrawCtrlText(Point(aPos.X()+nXOffset, aPos.Y() + nYOffset), maMenuItems[nPos].maText, 0,
maMenuItems[nPos].maText.getLength(),
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index c47b7dc74643..44fa974ee649 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -607,13 +607,12 @@ IMPL_LINK_NOARG(ScFormulaFrmtEntry, StyleSelectHdl, ListBox&, void)
ScFormatEntry* ScFormulaFrmtEntry::createFormulaEntry() const
{
- ScConditionMode eMode = SC_COND_DIRECT;
OUString aFormula = maEdFormula->GetText();
if(aFormula.isEmpty())
return nullptr;
OUString aExpr2;
- ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aFormula, aExpr2, mpDoc, maPos, maLbStyle->GetSelectEntry());
+ ScFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT, aFormula, aExpr2, mpDoc, maPos, maLbStyle->GetSelectEntry());
return pEntry;
}
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 95cd569d12a8..59dc0e18723d 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -505,7 +505,7 @@ void ScPivotLayoutDialog::ApplyChanges()
SfxDispatcher* pDispatcher = GetBindings().GetDispatcher();
- SfxCallMode nCallMode = SfxCallMode::SLOT | SfxCallMode::RECORD;
+ SfxCallMode const nCallMode = SfxCallMode::SLOT | SfxCallMode::RECORD;
const SfxPoolItem* pResult = pDispatcher->ExecuteList(SID_PIVOT_TABLE,
nCallMode, { &aPivotItem });
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 63adda37a3f8..77049df85c8f 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3497,11 +3497,9 @@ bool ScDocFunc::SetWidthOrHeight(
return false;
}
- bool bSuccess = false;
SCCOLROW nStart = rRanges[0].mnStart;
SCCOLROW nEnd = rRanges[0].mnEnd;
- bool bFormula = false;
if ( eMode == SC_SIZE_OPTIMAL )
{
//! Option "Show formulas" - but where to get them from?
@@ -3598,7 +3596,7 @@ bool ScDocFunc::SetWidthOrHeight(
if ( eMode==SC_SIZE_OPTIMAL || eMode==SC_SIZE_VISOPT )
nThisSize = nSizeTwips +
- lcl_GetOptimalColWidth( rDocShell, nCol, nTab, bFormula );
+ lcl_GetOptimalColWidth( rDocShell, nCol, nTab, false/*bFormula*/ );
if ( nThisSize )
rDoc.SetColWidth( nCol, nTab, nThisSize );
@@ -3642,7 +3640,7 @@ bool ScDocFunc::SetWidthOrHeight(
rDocShell.PostPaint(0,0,nTab,MAXCOL,MAXROW,nTab,PaintPartFlags::All);
aModificator.SetDocumentModified();
- return bSuccess;
+ return false;
}
bool ScDocFunc::InsertPageBreak( bool bColumn, const ScAddress& rPos,
@@ -4044,7 +4042,6 @@ bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
{
ScDocShellModificator aModificator( rDocShell );
- bool bSuccess = false;
ScDocument& rDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -4141,7 +4138,7 @@ bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
else if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return bSuccess;
+ return false;
}
bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
@@ -4614,9 +4611,7 @@ bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
FillDir eDir, sal_uLong nCount, bool bApi )
{
- double fStep = 1.0;
- double fMax = MAXDOUBLE;
- return FillAuto( rRange, pTabMark, eDir, FILL_AUTO, FILL_DAY, nCount, fStep, fMax, true/*bRecord*/, bApi );
+ return FillAuto( rRange, pTabMark, eDir, FILL_AUTO, FILL_DAY, nCount, 1.0/*fStep*/, MAXDOUBLE/*fMax*/, true/*bRecord*/, bApi );
}
bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, sal_uLong nCount, double fStep, double fMax, bool bRecord, bool bApi )
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 170c94213a66..b21e6426e99b 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -326,11 +326,9 @@ ErrCode ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncoding
OSL_ENSURE( xRowProp.is(), "can't get RowSet" );
if (!xRowProp.is()) return SCERR_IMPORT_CONNECT;
- sal_Int32 nType = sdb::CommandType::TABLE;
-
xRowProp->setPropertyValue( SC_DBPROP_ACTIVECONNECTION, uno::Any(xConnection) );
- xRowProp->setPropertyValue( SC_DBPROP_COMMANDTYPE, uno::Any(nType) );
+ xRowProp->setPropertyValue( SC_DBPROP_COMMANDTYPE, uno::Any(sdb::CommandType::TABLE) );
xRowProp->setPropertyValue( SC_DBPROP_COMMAND, uno::Any(aTabName) );
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 731f1a662c48..3312096dfc0a 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -448,7 +448,7 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, So
// extra bits are used to tell the client to prefer external
// reference link.
- OUString aExtraBits("calc:extref");
+ OUString const aExtraBits("calc:extref");
WriteUnicodeOrByteString( rStrm, aAppName, true );
WriteUnicodeOrByteString( rStrm, aDocName, true );
@@ -1708,8 +1708,8 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
SylkVersion eVersion = SylkVersion::OTHER;
// US-English separators for StringToDouble
- sal_Unicode cDecSep = '.';
- sal_Unicode cGrpSep = ',';
+ sal_Unicode const cDecSep = '.';
+ sal_Unicode const cGrpSep = ',';
SCCOL nStartCol = aRange.aStart.Col();
SCROW nStartRow = aRange.aStart.Row();
@@ -2161,7 +2161,7 @@ bool ScImportExport::RTF2Doc( SvStream& rStrm, const OUString& rBaseURL )
bool bOk = StartPaste();
if (bOk)
{
- InsertDeleteFlags nFlags = InsertDeleteFlags::ALL & ~InsertDeleteFlags::STYLES;
+ InsertDeleteFlags const nFlags = InsertDeleteFlags::ALL & ~InsertDeleteFlags::STYLES;
pDoc->DeleteAreaTab( aRange, nFlags );
pImp->WriteToDocument();
EndPaste();
@@ -2186,7 +2186,7 @@ bool ScImportExport::HTML2Doc( SvStream& rStrm, const OUString& rBaseURL )
if (pDocSh)
pDocSh->MakeDrawLayer();
- InsertDeleteFlags nFlags = InsertDeleteFlags::ALL & ~InsertDeleteFlags::STYLES;
+ InsertDeleteFlags const nFlags = InsertDeleteFlags::ALL & ~InsertDeleteFlags::STYLES;
pDoc->DeleteAreaTab( aRange, nFlags );
if (pExtOptions)
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 2bd0815df733..f9ab423910d0 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -203,8 +203,7 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
if ( xInfo->hasPropertyByName( sPropButtonType ) )
{
- form::FormButtonType eButtonType = form::FormButtonType_URL;
- xPropSet->setPropertyValue( sPropButtonType, uno::Any(eButtonType) );
+ xPropSet->setPropertyValue( sPropButtonType, uno::Any(form::FormButtonType_URL) );
}
//! Undo ???
@@ -657,8 +656,7 @@ void ScDrawShell::ExecFormatPaintbrush( SfxRequest& rReq )
ScDrawView* pDrawView = pViewData->GetScDrawView();
if ( pDrawView && pDrawView->AreObjectsMarked() )
{
- bool bOnlyHardAttr = true;
- SfxItemSet* pItemSet = new SfxItemSet( pDrawView->GetAttrFromMarked(bOnlyHardAttr) );
+ SfxItemSet* pItemSet = new SfxItemSet( pDrawView->GetAttrFromMarked(true/*bOnlyHardAttr*/) );
pView->SetDrawBrushSet( pItemSet, bLock );
}
}
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 7411085b54e7..025934679a6c 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -572,10 +572,9 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV
{
if (bUndo)
{
- bool bAppend = true;
pScDocSh->GetUndoManager()->AddUndoAction(
new ScUndoInsertTab( pScDocSh, nNewTab,
- bAppend, aTabName ) );
+ true/*bAppend*/, aTabName ) );
}
pScDocSh->Broadcast( ScTablesHint( SC_TAB_INSERTED, nNewTab ) );
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index 3062294a8292..892e4a29ee4b 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -341,7 +341,6 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
bool FuText::MouseMove(const MouseEvent& rMEvt)
{
- bool bReturn = false;
pViewShell->SetActivePointer(pView->GetPreferredPointer(
pWindow->PixelToLogic(rMEvt.GetPosPixel()), pWindow ));
@@ -371,7 +370,7 @@ bool FuText::MouseMove(const MouseEvent& rMEvt)
pView->MovAction(aPnt);
}
- return bReturn;
+ return false;
}
bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
@@ -379,8 +378,6 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
// remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- bool bReturn = false;
-
if (aDragTimer.IsActive() )
{
aDragTimer.Stop();
@@ -487,7 +484,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
}
}
- return bReturn;
+ return false;
}
// switch mouse-pointer
@@ -528,9 +525,8 @@ void FuText::Activate()
// if (!pTextObj)
{
// no text object in EditMode, therefore set CreateMode
- sal_uInt16 nObj = OBJ_TEXT;
- pView->SetCurrentObj(nObj);
+ pView->SetCurrentObj(OBJ_TEXT);
pView->SetCreateMode();
}
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index e690b1568a07..00cf7c2db5b3 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -317,7 +317,6 @@ void ScFunctionWin::DoEnter()
aArgStr = aFirstArgStr;
if ( nArgs != VAR_ARGS && nArgs != PAIRED_VAR_ARGS )
{ // no VarArgs or Fix plus VarArgs, but not VarArgs only
- OUString aArgSep("; ");
sal_uInt16 nFix;
if (nArgs >= PAIRED_VAR_ARGS)
nFix = nArgs - PAIRED_VAR_ARGS + 2;
@@ -328,7 +327,7 @@ void ScFunctionWin::DoEnter()
for ( sal_uInt16 nArg = 1;
nArg < nFix && !pDesc->pDefArgFlags[nArg].bOptional; nArg++ )
{
- aArgStr += aArgSep;
+ aArgStr += "; ";
OUString sTmp = pDesc->maDefArgNames[nArg];
sTmp = comphelper::string::strip(sTmp, ' ');
sTmp = sTmp.replaceAll(" ", "_");
diff --git a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
index 71e2896c9e0d..4cde7ff415ca 100644
--- a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
+++ b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
@@ -78,8 +78,6 @@ void ScTabBgColorDlg::FillColorValueSets_Impl()
const SfxPoolItem* pItem = nullptr;
XColorListRef pColorList;
- sal_uInt16 nSelectedItem = 0;
-
OSL_ENSURE( pDocSh, "DocShell not found!" );
if ( pDocSh && ( nullptr != ( pItem = pDocSh->GetItem(SID_COLOR_TABLE) ) ) )
@@ -110,7 +108,7 @@ void ScTabBgColorDlg::FillColorValueSets_Impl()
m_pTabBgColorSet->set_width_request(aSize.Width()+8);
m_pTabBgColorSet->set_height_request(aSize.Height()+8);
- m_pTabBgColorSet->SelectItem(nSelectedItem);
+ m_pTabBgColorSet->SelectItem(0);
}
/// Handler, called when color selection is changed
diff --git a/sc/source/ui/miscdlgs/textdlgs.cxx b/sc/source/ui/miscdlgs/textdlgs.cxx
index 2f27de79ca8f..578681598940 100644
--- a/sc/source/ui/miscdlgs/textdlgs.cxx
+++ b/sc/source/ui/miscdlgs/textdlgs.cxx
@@ -82,8 +82,8 @@ void ScParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
if (nId == m_nTabPageId)
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
- TabulatorDisableFlags nFlags((TabulatorDisableFlags::TypeMask &~TabulatorDisableFlags::TypeLeft) |
- (TabulatorDisableFlags::FillMask &~TabulatorDisableFlags::FillNone));
+ TabulatorDisableFlags const nFlags((TabulatorDisableFlags::TypeMask &~TabulatorDisableFlags::TypeLeft) |
+ (TabulatorDisableFlags::FillMask &~TabulatorDisableFlags::FillNone));
aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_DISABLEFLAGS, (sal_uInt16)nFlags));
rPage.PageCreated(aSet);
}
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index ec66b99e073b..a1dc66de7c38 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1476,7 +1476,6 @@ bool ScContentTree::LoadFile( const OUString& rUrl )
if ( nPos != -1 )
aDocName = aDocName.copy(0, nPos); // only the name without #...
- bool bReturn = false;
OUString aURL = aDocName;
OUString aFilter, aOptions;
ScDocumentLoader aLoader( aURL, aFilter, aOptions );
@@ -1496,7 +1495,7 @@ bool ScContentTree::LoadFile( const OUString& rUrl )
// document is closed again by ScDocumentLoader in dtor
- return bReturn;
+ return false;
}
void ScContentTree::InitWindowBits( bool bButtons )
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 5afa28553b49..53d6212aeb88 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1362,7 +1362,7 @@ void ScUndoDragDrop::Redo()
EnableDrawAdjust( &rDoc, false ); //! include in ScBlockUndo?
// do not undo/redo objects and note captions, they are handled via drawing undo
- InsertDeleteFlags nRedoFlags = (InsertDeleteFlags::ALL & ~InsertDeleteFlags::OBJECTS) | InsertDeleteFlags::NOCAPTIONS;
+ InsertDeleteFlags const nRedoFlags = (InsertDeleteFlags::ALL & ~InsertDeleteFlags::OBJECTS) | InsertDeleteFlags::NOCAPTIONS;
/* TODO: Redoing note captions is quite tricky due to the fact that a
helper clip document is used. While (re-)pasting the contents to the
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 35452714d868..3aa7e90eb509 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -861,8 +861,6 @@ void ScUndoAutoFormat::Redo()
nPPTY = ScGlobal::nScreenPPTY;
}
- bool bFormula = false; // remember
-
sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, pVirtDev);
for (SCTAB nTab=nStartZ; nTab<=nEndZ; nTab++)
{
@@ -886,7 +884,7 @@ void ScUndoAutoFormat::Redo()
if (!rDoc.ColHidden(nCol, nTab))
{
sal_uInt16 nThisSize = STD_EXTRA_WIDTH + rDoc.GetOptimalColWidth( nCol, nTab,
- pVirtDev, nPPTX, nPPTY, aZoomX, aZoomY, bFormula,
+ pVirtDev, nPPTX, nPPTY, aZoomX, aZoomY, false/*bFormula*/,
&aDestMark );
rDoc.SetColWidth( nCol, nTab, nThisSize );
rDoc.ShowCol( nCol, nTab, true );
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 193420cb3fa7..df07b286bd04 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -95,9 +95,7 @@ ScUndoCursorAttr::~ScUndoCursorAttr()
OUString ScUndoCursorAttr::GetComment() const
{
//! own text for automatic attribution
-
- sal_uInt16 nId = STR_UNDO_CURSORATTR; // "Attribute"
- return ScGlobal::GetRscString( nId );
+ return ScGlobal::GetRscString( STR_UNDO_CURSORATTR ); // "Attribute"
}
void ScUndoCursorAttr::SetEditData( EditTextObject* pOld, EditTextObject* pNew )
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index d741224fe558..467cb4b7418b 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -7514,8 +7514,7 @@ void SAL_CALL ScTableSheetObj::link( const OUString& aUrl, const OUString& aShee
else if ( nMode == sheet::SheetLinkMode_VALUE )
nLinkMode = ScLinkMode::VALUE;
- sal_uLong nRefresh = 0;
- rDoc.SetLink( nTab, nLinkMode, aFileString, aFilterString, aOptString, aSheetName, nRefresh );
+ rDoc.SetLink( nTab, nLinkMode, aFileString, aFilterString, aOptString, aSheetName, 0/*nRefresh*/ );
pDocSh->UpdateLinks(); // if needed add or delete link
SfxBindings* pBindings = pDocSh->GetViewBindings();
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 41ee1ee8a01c..b2fcb297cf84 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1968,7 +1968,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
uno::makeAny( sRangeRep ), beans::PropertyState_DIRECT_VALUE ));
//Sequence Mapping
- bool bSequencesReordered = true;//todo detect this above or detect this sequence mapping cheaper ...
+ bool const bSequencesReordered = true;//todo detect this above or detect this sequence mapping cheaper ...
if( bSequencesReordered && bRowSourceDetected )
{
bool bDifferentIndexes = false;
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 6a18af374367..859fc221cc19 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -2653,8 +2653,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons
{
ScDPSaveDimension* pOldDimension = aSaveData.GetDimensionByName( aDimName );
pSaveDimension->SetOrientation( pOldDimension->GetOrientation() );
- long nPosition = 0; //! before (immediate) base
- aSaveData.SetPosition( pSaveDimension, nPosition );
+ aSaveData.SetPosition( pSaveDimension, 0 ); //! before (immediate) base
}
// apply changes
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 042200424777..30039fd76fed 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -2348,10 +2348,9 @@ void ScUnnamedDatabaseRangesObj::setByTable( const table::CellRangeAddress& aRan
throw lang::IndexOutOfBoundsException();
ScDBDocFunc aFunc(*pDocShell);
- OUString aString(STR_DB_LOCAL_NONAME);
ScRange aUnnamedRange( (SCCOL)aRange.StartColumn, (SCROW)aRange.StartRow, aRange.Sheet,
(SCCOL)aRange.EndColumn, (SCROW)aRange.EndRow, aRange.Sheet );
- bDone = aFunc.AddDBRange( aString, aUnnamedRange );
+ bDone = aFunc.AddDBRange( STR_DB_LOCAL_NONAME, aUnnamedRange );
}
if (!bDone)
throw uno::RuntimeException(); // no other exceptions specified
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 2c55292e40a9..a6e3f8769a39 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1641,7 +1641,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
{
// getRenderer(0) is used to query the settings, so it must always return something
- SCTAB nCurTab = 0; //! use current sheet from view?
+ SCTAB const nCurTab = 0; //! use current sheet from view?
ScPrintFunc aDefaultFunc( pDocShell, pDocShell->GetPrinter(), nCurTab );
Size aTwips = aDefaultFunc.GetPageSize();
awt::Size aPageSize( TwipsToHMM( aTwips.Width() ), TwipsToHMM( aTwips.Height() ) );
@@ -1797,8 +1797,8 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
sal_Int32 nDestID = pPDFData->CreateDest( aArea );
OUString aTabName;
rDoc.GetName( nTab, aTabName );
- sal_Int32 nParent = -1; // top-level
- pPDFData->CreateOutlineItem( nParent, aTabName, nDestID );
+ // top-level
+ pPDFData->CreateOutlineItem( -1/*nParent*/, aTabName, nDestID );
}
// #i56629# add the named destination stuff
if( pPDFData && pPDFData->GetIsExportNamedDestinations() )
@@ -3419,10 +3419,8 @@ sal_Int32 ScTableSheetsObj::importSheet(
throw lang::IndexOutOfBoundsException();
// Transfer Tab
- bool bInsertNew = true;
- bool bNotifyAndPaint = true;
pDocShell->TransferTab(
- *pDocShellSrc, nIndexSrc, nIndexDest, bInsertNew, bNotifyAndPaint );
+ *pDocShellSrc, nIndexSrc, nIndexDest, true/*bInsertNew*/, true/*bNotifyAndPaint*/ );
return nIndexDest;
}
@@ -4322,8 +4320,8 @@ void SAL_CALL ScScenariosObj::addNewByName( const OUString& aName,
}
Color aColor( COL_LIGHTGRAY ); // Default
- ScScenarioFlags nFlags = ScScenarioFlags::ShowFrame | ScScenarioFlags::PrintFrame
- | ScScenarioFlags::TwoWay | ScScenarioFlags::Protected;
+ ScScenarioFlags const nFlags = ScScenarioFlags::ShowFrame | ScScenarioFlags::PrintFrame
+ | ScScenarioFlags::TwoWay | ScScenarioFlags::Protected;
pDocShell->MakeScenario( nTab, aName, aComment, aColor, nFlags, aMarkData );
}
diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index f31eba2295bf..c0cc98782879 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -207,11 +207,10 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute()
}
else
{
- bool bMultiByte = true;
bool bDBEnc = false;
bool bAscii = false;
- sal_Unicode cStrDel = '"';
+ sal_Unicode const cStrDel = '"';
sal_Unicode cAsciiDel = ';';
rtl_TextEncoding eEncoding = RTL_TEXTENCODING_DONTKNOW;
@@ -273,7 +272,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute()
ScImportOptions aOptions( cAsciiDel, cStrDel, eEncoding);
ScopedVclPtr<AbstractScImportOptionsDlg> pDlg(pFact->CreateScImportOptionsDlg(
- bAscii, &aOptions, &aTitle, bMultiByte, bDBEnc,
+ bAscii, &aOptions, &aTitle, true/*bMultiByte*/, bDBEnc,
!bExport));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index fe072075925b..a9b4e220b4fe 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -357,8 +357,6 @@ bool ScTokenConversion::ConvertToTokenArray( ScDocument& rDoc,
bool ScTokenConversion::ConvertToTokenSequence( const ScDocument& rDoc,
uno::Sequence<sheet::FormulaToken>& rSequence, const ScTokenArray& rTokenArray )
{
- bool bError = false;
-
sal_Int32 nLen = static_cast<sal_Int32>(rTokenArray.GetLen());
formula::FormulaToken** pTokens = rTokenArray.GetArray();
if ( pTokens )
@@ -477,7 +475,7 @@ bool ScTokenConversion::ConvertToTokenSequence( const ScDocument& rDoc,
else
rSequence.realloc(0);
- return !bError;
+ return true;
}
ScFormulaOpCodeMapperObj::ScFormulaOpCodeMapperObj(::std::unique_ptr<formula::FormulaCompiler> && _pCompiler)
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index b7b502aa9191..d76a9fcfb7cc 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -1613,10 +1613,10 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitRow()
{
long nSplit = rViewData.GetVSplitPos();
- ScSplitPos ePos = SC_SPLIT_TOPLEFT; // split vertically
+ // split vertically
SCCOL nCol;
SCROW nRow;
- rViewData.GetPosFromPixel( 0, nSplit, ePos, nCol, nRow, false );
+ rViewData.GetPosFromPixel( 0, nSplit, SC_SPLIT_TOPLEFT, nCol, nRow, false );
if ( nRow > 0 )
return nRow;
}
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx
index 41f12cec6cfc..b0ecaeb83245 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -194,7 +194,6 @@ implnCut( const uno::Reference< frame::XModel>& xModel )
void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool bSkipEmpty, bool bTranspose)
{
PasteCellsWarningReseter resetWarningBox;
- InsCellCmd eMoveMode = INS_NONE;
ScTabViewShell* pTabViewShell = getBestViewShell( xModel );
if ( pTabViewShell )
@@ -209,7 +208,7 @@ void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, InsertDele
pDoc = pOwnClip->GetDocument();
pTabViewShell->PasteFromClip( nFlags, pDoc,
nFunction, bSkipEmpty, bTranspose, false,
- eMoveMode, InsertDeleteFlags::NONE, true );
+ INS_NONE, InsertDeleteFlags::NONE, true );
pTabViewShell->CellContentChanged();
}
}
diff --git a/sc/source/ui/vba/vbamenuitems.cxx b/sc/source/ui/vba/vbamenuitems.cxx
index 76fb396352c9..8d12983e28d6 100644
--- a/sc/source/ui/vba/vbamenuitems.cxx
+++ b/sc/source/ui/vba/vbamenuitems.cxx
@@ -101,8 +101,9 @@ ScVbaMenuItems::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ )
uno::Reference< excel::XMenuItem > SAL_CALL ScVbaMenuItems::Add( const OUString& Caption, const css::uno::Any& OnAction, const css::uno::Any& /*ShortcutKey*/, const css::uno::Any& Before, const css::uno::Any& Restore, const css::uno::Any& /*StatusBar*/, const css::uno::Any& /*HelpFile*/, const css::uno::Any& /*HelpContextID*/ )
{
- sal_Int32 nType = office::MsoControlType::msoControlButton;
- uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add( uno::makeAny( nType ), uno::Any(), uno::Any(), Before, Restore );
+ uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add(
+ uno::makeAny( office::MsoControlType::msoControlButton ),
+ uno::Any(), uno::Any(), Before, Restore );
xCommandBarControl->setCaption( Caption );
if( OnAction.hasValue() )
{
diff --git a/sc/source/ui/vba/vbamenus.cxx b/sc/source/ui/vba/vbamenus.cxx
index be32c02008d0..9c3f86ad904c 100644
--- a/sc/source/ui/vba/vbamenus.cxx
+++ b/sc/source/ui/vba/vbamenus.cxx
@@ -93,8 +93,9 @@ ScVbaMenus::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ )
uno::Reference< excel::XMenu > SAL_CALL ScVbaMenus::Add( const OUString& Caption, const css::uno::Any& Before, const css::uno::Any& Restore )
{
- sal_Int32 nType = office::MsoControlType::msoControlPopup;
- uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add( uno::makeAny( nType ), uno::Any(), uno::Any(), Before, Restore );
+ uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add(
+ uno::makeAny( office::MsoControlType::msoControlPopup ),
+ uno::Any(), uno::Any(), Before, Restore );
xCommandBarControl->setCaption( Caption );
return uno::Reference< excel::XMenu >( new ScVbaMenu( this, mxContext, xCommandBarControl ) );
}
diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx
index 9ff4af38f77d..7267aa615521 100644
--- a/sc/source/ui/vba/vbanames.cxx
+++ b/sc/source/ui/vba/vbanames.cxx
@@ -103,10 +103,8 @@ ScVbaNames::Add( const css::uno::Any& Name ,
{
if ( ScRangeData::IsNameValid( sName , getScDocument() ) != ScRangeData::NAME_VALID )
{
- OUString sResult ;
- sal_Int32 nToken = 0;
sal_Int32 nIndex = 0;
- sResult = sName.getToken( nToken , '!' , nIndex );
+ OUString sResult = sName.getToken( 0 , '!' , nIndex );
if ( -1 == nIndex )
sResult = sName;
else
@@ -200,7 +198,6 @@ ScVbaNames::Add( const css::uno::Any& Name ,
uno::Any aAny2;
if ( mxNames.is() )
{
- sal_Int32 nUnoType = 0;
table::CellAddress aCellAddr( aAddr.Sheet , aAddr.StartColumn , aAddr.StartRow );
if ( mxNames->hasByName( sName ) )
mxNames->removeByName(sName);
@@ -215,7 +212,7 @@ ScVbaNames::Add( const css::uno::Any& Name ,
sTmp += ",";
sTmp = sTmp + "'" + xRange->getWorksheet()->getName() + "'." + sRangeAdd;
}
- mxNames->addNewByName( sName , sTmp , aCellAddr , nUnoType);
+ mxNames->addNewByName( sName, sTmp, aCellAddr, 0/*nUnoType*/);
return Item( uno::makeAny( sName ), uno::Any() );
}
}
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 49a0d263bb48..59769264ec1a 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -1266,7 +1266,7 @@ inline table::CellRangeAddress lclGetRangeAddress( const uno::Reference< RangeTy
void lclClearRange( const uno::Reference< table::XCellRange >& rxCellRange )
{
using namespace ::com::sun::star::sheet::CellFlags;
- sal_Int32 nFlags = VALUE | DATETIME | STRING | ANNOTATION | FORMULA | HARDATTR | STYLES | EDITATTR | FORMATTED;
+ sal_Int32 const nFlags = VALUE | DATETIME | STRING | ANNOTATION | FORMULA | HARDATTR | STYLES | EDITATTR | FORMATTED;
uno::Reference< sheet::XSheetOperation > xSheetOperation( rxCellRange, uno::UNO_QUERY_THROW );
xSheetOperation->clearContents( nFlags );
}
@@ -1586,7 +1586,7 @@ void SAL_CALL
ScVbaRange::Clear()
{
using namespace ::com::sun::star::sheet::CellFlags;
- sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA | HARDATTR | EDITATTR | FORMATTED;
+ sal_Int32 const nFlags = VALUE | DATETIME | STRING | FORMULA | HARDATTR | EDITATTR | FORMATTED;
ClearContents( nFlags, true );
}
@@ -1628,7 +1628,7 @@ void SAL_CALL
ScVbaRange::ClearContents()
{
using namespace ::com::sun::star::sheet::CellFlags;
- sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA;
+ sal_Int32 const nFlags = VALUE | DATETIME | STRING | FORMULA;
ClearContents( nFlags, true );
}
@@ -1637,7 +1637,7 @@ ScVbaRange::ClearFormats()
{
// FIXME: need to check if we need to combine FORMATTED
using namespace ::com::sun::star::sheet::CellFlags;
- sal_Int32 nFlags = HARDATTR | FORMATTED | EDITATTR;
+ sal_Int32 const nFlags = HARDATTR | FORMATTED | EDITATTR;
ClearContents( nFlags, false );
}
@@ -2079,8 +2079,8 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
ScRange aRange( static_cast< SCCOL >( thisAddress.StartColumn ), static_cast< SCROW >( thisAddress.StartRow ), static_cast< SCTAB >( thisAddress.Sheet ), static_cast< SCCOL >( thisAddress.EndColumn ), static_cast< SCROW >( thisAddress.EndRow ), static_cast< SCTAB >( thisAddress.Sheet ) );
- ScRefFlags ROW_ABS = ( ScRefFlags::ROW_ABS | ScRefFlags::ROW2_ABS );
- ScRefFlags COL_ABS = ( ScRefFlags::COL_ABS | ScRefFlags::COL2_ABS );
+ ScRefFlags const ROW_ABS = ( ScRefFlags::ROW_ABS | ScRefFlags::ROW2_ABS );
+ ScRefFlags const COL_ABS = ( ScRefFlags::COL_ABS | ScRefFlags::COL2_ABS );
if ( RowAbsolute.hasValue() )
{
@@ -5105,10 +5105,9 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const
break;
}
}
- double fEndValue = MAXDOUBLE;
ScDocShell* pDocSh = getDocShellFromRange( mxRange );
pDocSh->GetDocFunc().FillAuto( aSourceRange, nullptr, eDir, eCmd, eDateCmd,
- nCount, fStep, fEndValue, true, true );
+ nCount, fStep, MAXDOUBLE/*fEndValue*/, true, true );
}
sal_Bool SAL_CALL
ScVbaRange::GoalSeek( const uno::Any& Goal, const uno::Reference< excel::XRange >& ChangingCell )
diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx
index c339062b2ce2..5d2a94019073 100644
--- a/sc/source/ui/vba/vbasheetobject.cxx
+++ b/sc/source/ui/vba/vbasheetobject.cxx
@@ -225,7 +225,7 @@ void SAL_CALL ScVbaSheetObjectBase::setName( const OUString& rName )
sal_Int32 SAL_CALL ScVbaSheetObjectBase::getPlacement()
{
- sal_Int32 nRet = excel::XlPlacement::xlMoveAndSize;
+ sal_Int32 const nRet = excel::XlPlacement::xlMoveAndSize;
#if 0 // TODO: not working at the moment.
SvxShape* pShape = SvxShape::getImplementation( mxShape );
if(pShape)
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index f0a7b7f4692a..5586c9347daa 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -485,97 +485,85 @@ ScVbaWindow::RangeSelection()
sal_Bool SAL_CALL
ScVbaWindow::getDisplayGridlines()
{
- OUString sName( SC_UNO_SHOWGRID );
bool bGrid = true;
- getControllerProps()->getPropertyValue( sName ) >>= bGrid;
+ getControllerProps()->getPropertyValue( SC_UNO_SHOWGRID ) >>= bGrid;
return bGrid;
}
void SAL_CALL
ScVbaWindow::setDisplayGridlines( sal_Bool _displaygridlines )
{
- OUString sName( SC_UNO_SHOWGRID );
- getControllerProps()->setPropertyValue( sName, uno::makeAny( _displaygridlines ));
+ getControllerProps()->setPropertyValue( SC_UNO_SHOWGRID, uno::makeAny( _displaygridlines ));
}
sal_Bool SAL_CALL
ScVbaWindow::getDisplayHeadings()
{
- OUString sName( SC_UNO_COLROWHDR );
bool bHeading = true;
- getControllerProps()->getPropertyValue( sName ) >>= bHeading;
+ getControllerProps()->getPropertyValue( SC_UNO_COLROWHDR ) >>= bHeading;
return bHeading;
}
void SAL_CALL
ScVbaWindow::setDisplayHeadings( sal_Bool _bDisplayHeadings )
{
- OUString sName( SC_UNO_COLROWHDR );
- getControllerProps()->setPropertyValue( sName, uno::makeAny( _bDisplayHeadings ));
+ getControllerProps()->setPropertyValue( SC_UNO_COLROWHDR, uno::makeAny( _bDisplayHeadings ));
}
sal_Bool SAL_CALL
ScVbaWindow::getDisplayHorizontalScrollBar()
{
- OUString sName( SC_UNO_HORSCROLL );
bool bHorizontalScrollBar = true;
- getControllerProps()->getPropertyValue( sName ) >>= bHorizontalScrollBar;
+ getControllerProps()->getPropertyValue( SC_UNO_HORSCROLL ) >>= bHorizontalScrollBar;
return bHorizontalScrollBar;
}
void SAL_CALL
ScVbaWindow::setDisplayHorizontalScrollBar( sal_Bool _bDisplayHorizontalScrollBar )
{
- OUString sName( SC_UNO_HORSCROLL );
- getControllerProps()->setPropertyValue( sName, uno::makeAny( _bDisplayHorizontalScrollBar ));
+ getControllerProps()->setPropertyValue( SC_UNO_HORSCROLL, uno::makeAny( _bDisplayHorizontalScrollBar ));
}
sal_Bool SAL_CALL
ScVbaWindow::getDisplayOutline()
{
- OUString sName( SC_UNO_OUTLSYMB );
bool bOutline = true;
- getControllerProps()->getPropertyValue( sName ) >>= bOutline;
+ getControllerProps()->getPropertyValue( SC_UNO_OUTLSYMB ) >>= bOutline;
return bOutline;
}
void SAL_CALL
ScVbaWindow::setDisplayOutline( sal_Bool _bDisplayOutline )
{
- OUString sName( SC_UNO_OUTLSYMB );
- getControllerProps()->setPropertyValue( sName, uno::makeAny( _bDisplayOutline ));
+ getControllerProps()->setPropertyValue( SC_UNO_OUTLSYMB, uno::makeAny( _bDisplayOutline ));
}
sal_Bool SAL_CALL
ScVbaWindow::getDisplayVerticalScrollBar()
{
- OUString sName( SC_UNO_VERTSCROLL );
bool bVerticalScrollBar = true;
- getControllerProps()->getPropertyValue( sName ) >>= bVerticalScrollBar;
+ getControllerProps()->getPropertyValue( SC_UNO_VERTSCROLL ) >>= bVerticalScrollBar;
return bVerticalScrollBar;
}
void SAL_CALL
ScVbaWindow::setDisplayVerticalScrollBar( sal_Bool _bDisplayVerticalScrollBar )
{
- OUString sName( SC_UNO_VERTSCROLL );
- getControllerProps()->setPropertyValue( sName, uno::makeAny( _bDisplayVerticalScrollBar ));
+ getControllerProps()->setPropertyValue( SC_UNO_VERTSCROLL, uno::makeAny( _bDisplayVerticalScrollBar ));
}
sal_Bool SAL_CALL
ScVbaWindow::getDisplayWorkbookTabs()
{
- OUString sName( SC_UNO_SHEETTABS );
bool bWorkbookTabs = true;
- getControllerProps()->getPropertyValue( sName ) >>= bWorkbookTabs;
+ getControllerProps()->getPropertyValue( SC_UNO_SHEETTABS ) >>= bWorkbookTabs;
return bWorkbookTabs;
}
void SAL_CALL
ScVbaWindow::setDisplayWorkbookTabs( sal_Bool _bDisplayWorkbookTabs )
{
- OUString sName( SC_UNO_SHEETTABS );
- getControllerProps()->setPropertyValue( sName, uno::makeAny( _bDisplayWorkbookTabs ));
+ getControllerProps()->setPropertyValue( SC_UNO_SHEETTABS, uno::makeAny( _bDisplayWorkbookTabs ));
}
sal_Bool SAL_CALL
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index feeba69dc20a..6b3fd6245ba0 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -1103,8 +1103,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
{
// SBA wants a sal_Bool-item, enabled
- bool bEnable = true;
- rSet.Put(SfxBoolItem(nWhich, bEnable));
+ rSet.Put(SfxBoolItem(nWhich, true));
}
break;
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index bf745e24294f..e813f1cbebd9 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -992,8 +992,7 @@ void ScDBFunc::DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nPar
{
ScDPSaveDimension* pOldDimension = aData.GetDimensionByName( aBaseDimName );
pSaveDimension->SetOrientation( pOldDimension->GetOrientation() );
- long nPosition = 0; //! before (immediate) base
- aData.SetPosition( pSaveDimension, nPosition );
+ aData.SetPosition( pSaveDimension, 0 ); //! before (immediate) base
}
}
}
@@ -1179,8 +1178,7 @@ void ScDBFunc::GroupDataPilot()
{
ScDPSaveDimension* pOldDimension = aData.GetDimensionByName( aDimName );
pSaveDimension->SetOrientation( pOldDimension->GetOrientation() );
- long nPosition = 0; //! before (immediate) base
- aData.SetPosition( pSaveDimension, nPosition );
+ aData.SetPosition( pSaveDimension, 0 ); //! before (immediate) base
}
// apply changes
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index fb6aba1ee455..83cd72fb062c 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -92,8 +92,7 @@ bool ScGridWindow::DrawMouseButtonUp(const MouseEvent& rMEvt)
ScDrawView* pDrView = pViewData->GetScDrawView();
if ( pDrView )
{
- bool bReplaceAll = true;
- pDrView->SetAttrToMarked(*pDrawBrush, bReplaceAll);
+ pDrView->SetAttrToMarked(*pDrawBrush, true/*bReplaceAll*/);
}
if ( !pView->IsPaintBrushLocked() )
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 74151217831c..a7d13afe54c6 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -787,20 +787,15 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
if ( bHasChange || bHasScenario || !rHigh.empty() )
{
-
//! Merge SetChangedClip() with DrawMarks() ?? (different MapMode!)
- bool bAny = true;
- if (bAny)
- {
- if ( bHasChange )
- aOutputData.DrawChangeTrack();
+ if ( bHasChange )
+ aOutputData.DrawChangeTrack();
- if ( bHasScenario )
- lcl_DrawScenarioFrames( pContentDev, pViewData, eWhich, nX1,nY1,nX2,nY2 );
+ if ( bHasScenario )
+ lcl_DrawScenarioFrames( pContentDev, pViewData, eWhich, nX1,nY1,nX2,nY2 );
- lcl_DrawHighlight( aOutputData, pViewData, rHigh );
- }
+ lcl_DrawHighlight( aOutputData, pViewData, rHigh );
}
// Drawing foreground
diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx b/sc/source/ui/view/gridwin_dbgutil.cxx
index 70a594e65475..2927f87bdac2 100644
--- a/sc/source/ui/view/gridwin_dbgutil.cxx
+++ b/sc/source/ui/view/gridwin_dbgutil.cxx
@@ -90,8 +90,7 @@ void ScGridWindow::dumpCellProperties()
aList.Join(aRange, false);
}
- OString aOutputFile("dump.xml");
- xmlTextWriterPtr writer = xmlNewTextWriterFilename( aOutputFile.getStr(), 0 );
+ xmlTextWriterPtr writer = xmlNewTextWriterFilename( "dump.xml", 0 );
xmlTextWriterSetIndent(writer,1);
xmlTextWriterSetIndentString(writer, BAD_CAST(" "));
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 88f70a8e7249..ab70337c5790 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -717,10 +717,9 @@ long ScDrawStringsVars::GetMaxDigitWidth()
if (nMaxDigitWidth > 0)
return nMaxDigitWidth;
- sal_Char cZero = '0';
for (sal_Char i = 0; i < 10; ++i)
{
- sal_Char cDigit = cZero + i;
+ sal_Char cDigit = '0' + i;
long n = pOutput->pFmtDevice->GetTextWidth(OUString(cDigit));
nMaxDigitWidth = ::std::max(nMaxDigitWidth, n);
}
@@ -1878,8 +1877,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
// check horizontal space
- bool bNeedEditEngine = false;
- if ( !bNeedEditEngine && !bOutside )
+ if ( !bOutside )
{
bool bRightAdjusted = false; // to correct text width calculation later
switch (eOutHorJust)
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 0123464a3252..009afeb5b779 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -270,7 +270,6 @@ ErrCode ScTabViewShell::DoVerb(long nVerb)
return ERRCODE_SO_NOTIMPL; // should not be
SdrOle2Obj* pOle2Obj = nullptr;
- ErrCode nErr = ERRCODE_NONE;
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if (rMarkList.GetMarkCount() == 1)
@@ -289,7 +288,7 @@ ErrCode ScTabViewShell::DoVerb(long nVerb)
OSL_FAIL("no object for Verb found");
}
- return nErr;
+ return ERRCODE_NONE;
}
void ScTabViewShell::DeactivateOle()
diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx
index 7b739b8be0bd..596d0e94e2ee 100644
--- a/sc/source/ui/view/tabvwshg.cxx
+++ b/sc/source/ui/view/tabvwshg.cxx
@@ -82,8 +82,7 @@ void ScTabViewShell::InsertURLButton( const OUString& rName, const OUString& rUR
xPropSet->setPropertyValue("TargetFrame", uno::Any(rTarget) );
}
- form::FormButtonType eButtonType = form::FormButtonType_URL;
- xPropSet->setPropertyValue("ButtonType", uno::Any(eButtonType) );
+ xPropSet->setPropertyValue("ButtonType", uno::Any(form::FormButtonType_URL) );
if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) )
{
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index a82fbd678914..cb7335a216ba 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -2405,10 +2405,10 @@ void ScViewData::ReadUserData(const OUString& rData)
// if available, get tab bar width:
OUString aTabOpt = rData.getToken(2, ';');
- if (aTabOpt.startsWith(TAG_TABBARWIDTH))
+ OUString aRest;
+ if (aTabOpt.startsWith(TAG_TABBARWIDTH, &aRest))
{
- sal_Int32 nTagLen = RTL_CONSTASCII_LENGTH(TAG_TABBARWIDTH);
- pView->SetTabBarWidth(aTabOpt.copy(nTagLen).toInt32());
+ pView->SetTabBarWidth(aRest.toInt32());
nTabStart = 3;
}
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 36e22d64ab24..9c30d27d39ef 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2608,8 +2608,7 @@ void ScViewFunc::MoveTable(
// execute without SfxCallMode::RECORD, because already contained in move command
- OUString aUrl("private:factory/" STRING_SCAPP);
- SfxStringItem aItem( SID_FILE_NAME, aUrl );
+ SfxStringItem aItem( SID_FILE_NAME, "private:factory/" STRING_SCAPP );
SfxStringItem aTarget( SID_TARGETNAME, OUString("_blank") );
const SfxPoolItem* pRetItem = GetViewData().GetDispatcher().ExecuteList(
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index e5a630d7a708..0c675ecd6c12 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -479,16 +479,14 @@ void ScViewFunc::PasteFromSystem()
SotClipboardFormatId nBiff8 = SotExchange::RegisterFormatName("Biff8");
SotClipboardFormatId nBiff5 = SotExchange::RegisterFormatName("Biff5");
- SotExchangeDest nDestination = SotExchangeDest::SCDOC_FREE_AREA;
- sal_uInt16 nSourceOptions = EXCHG_IN_ACTION_COPY;
SotClipboardFormatId nFormat; // output param for GetExchangeAction
sal_uInt8 nEventAction; // output param for GetExchangeAction
uno::Reference<css::datatransfer::XTransferable> xTransferable( aDataHelper.GetXTransferable() );
sal_uInt8 nAction = SotExchange::GetExchangeAction(
aDataHelper.GetDataFlavorExVector(),
- nDestination,
- nSourceOptions,
+ SotExchangeDest::SCDOC_FREE_AREA,
+ EXCHG_IN_ACTION_COPY,
EXCHG_IN_ACTION_DEFAULT,
nFormat, nEventAction, SotClipboardFormatId::NONE,
&xTransferable );
@@ -1950,7 +1948,6 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
bool bRowInfo = ( nStartCol==0 && nEndCol==MAXCOL );
SCCOL nUndoEndCol = nStartCol+aColLength-1;
SCROW nUndoEndRow = nCurrentRow;
- InsertDeleteFlags nUndoFlags = InsertDeleteFlags::NONE;
if ( bRecord )
{
@@ -1974,7 +1971,7 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
SfxUndoAction* pUndo = new ScUndoDataForm( pDocSh,
nStartCol, nCurrentRow, nStartTab,
nUndoEndCol, nUndoEndRow, nEndTab, rMark,
- pUndoDoc, pRedoDoc, nUndoFlags,
+ pUndoDoc, pRedoDoc, InsertDeleteFlags::NONE,
pUndoData );
pUndoMgr->AddUndoAction( new ScUndoWrapper( pUndo ), true );