summaryrefslogtreecommitdiff
path: root/sc/source/ui
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/ui
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/ui')
-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
49 files changed, 102 insertions, 177 deletions
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 );