diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-09 15:43:41 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-03-10 10:09:59 +0200 |
commit | 4358dc795cbd2b49aa87c89795cf63413b82400c (patch) | |
tree | b112046a74791f03b7971d1c22a0d2cb9aa39955 /sc/source | |
parent | f946e905c6c6bb041ae580b14b711c6964af97bd (diff) |
loplugin:constantparam in sc
Change-Id: Ia7bc394fdc0dba720751c2a58d55bfe34b239098
Diffstat (limited to 'sc/source')
32 files changed, 82 insertions, 93 deletions
diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx index d79643da9cb5..9f1e647658d5 100644 --- a/sc/source/core/data/compressedarray.cxx +++ b/sc/source/core/data/compressedarray.cxx @@ -386,8 +386,7 @@ void ScBitMaskCompressedArray<A,D>::CopyFromAnded( } template< typename A, typename D > -A ScBitMaskCompressedArray<A,D>::GetLastAnyBitAccess( A nStart, - const D& rBitMask ) const +A ScBitMaskCompressedArray<A,D>::GetLastAnyBitAccess( const D& rBitMask ) const { A nEnd = ::std::numeric_limits<A>::max(); size_t nIndex = this->nCount-1; @@ -403,7 +402,7 @@ A ScBitMaskCompressedArray<A,D>::GetLastAnyBitAccess( A nStart, if (nIndex > 0) { --nIndex; - if (this->pData[nIndex].nEnd < nStart) + if (this->pData[nIndex].nEnd < 0) break; // while } else diff --git a/sc/source/core/data/segmenttree.cxx b/sc/source/core/data/segmenttree.cxx index 344464cd1bf1..288a8dce2aa1 100644 --- a/sc/source/core/data/segmenttree.cxx +++ b/sc/source/core/data/segmenttree.cxx @@ -378,9 +378,9 @@ void ScFlatBoolRowSegments::insertSegment(SCROW nRow, SCROW nSize, bool bSkipSta mpImpl->insertSegment(static_cast<SCCOLROW>(nRow), static_cast<SCCOLROW>(nSize), bSkipStartBoundary); } -SCROW ScFlatBoolRowSegments::findLastNotOf(bool bValue) const +SCROW ScFlatBoolRowSegments::findLastNotOf() const { - return static_cast<SCROW>(mpImpl->findLastNotOf(bValue)); + return static_cast<SCROW>(mpImpl->findLastNotOf(false)); } ScFlatBoolColSegments::ScFlatBoolColSegments() : diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 9eb910f2174e..fd3d02c75fed 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -3263,7 +3263,7 @@ SCROW ScTable::GetLastFlaggedRow() const SCROW nLastFound = 0; if (pRowFlags) { - SCROW nRow = pRowFlags->GetLastAnyBitAccess( 0, sal::static_int_cast<sal_uInt8>(CR_ALL) ); + SCROW nRow = pRowFlags->GetLastAnyBitAccess( sal::static_int_cast<sal_uInt8>(CR_ALL) ); if (ValidRow(nRow)) nLastFound = nRow; } @@ -3273,14 +3273,14 @@ SCROW ScTable::GetLastFlaggedRow() const if (mpHiddenRows) { - SCROW nRow = mpHiddenRows->findLastNotOf(false); + SCROW nRow = mpHiddenRows->findLastNotOf(); if (ValidRow(nRow)) nLastFound = ::std::max(nLastFound, nRow); } if (mpFilteredRows) { - SCROW nRow = mpFilteredRows->findLastNotOf(false); + SCROW nRow = mpFilteredRows->findLastNotOf(); if (ValidRow(nRow)) nLastFound = ::std::max(nLastFound, nRow); } diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index d372e8a1d036..29ac7a0be289 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -331,7 +331,7 @@ private: // XclExpScToken: pass-by-value and return-by-value is intended const FormulaToken* GetNextRawToken(); - const FormulaToken* PeekNextRawToken( bool bSkipSpaces ) const; + const FormulaToken* PeekNextRawToken() const; bool GetNextToken( XclExpScToken& rTokData ); XclExpScToken GetNextToken(); @@ -796,7 +796,7 @@ const FormulaToken* XclExpFmlaCompImpl::GetNextRawToken() return pScToken; } -const FormulaToken* XclExpFmlaCompImpl::PeekNextRawToken( bool bSkipSpaces ) const +const FormulaToken* XclExpFmlaCompImpl::PeekNextRawToken() const { /* Returns pointer to next raw token in the token array. The token array iterator already points to the next token (A call to GetNextToken() @@ -805,7 +805,7 @@ const FormulaToken* XclExpFmlaCompImpl::PeekNextRawToken( bool bSkipSpaces ) con created and set to the passed skip-spaces mode. If spaces have to be skipped, and the iterator currently points to a space token, the constructor will move it to the next non-space token. */ - XclTokenArrayIterator aTempIt( mxData->maTokArrIt, bSkipSpaces ); + XclTokenArrayIterator aTempIt( mxData->maTokArrIt, true/*bSkipSpaces*/ ); return aTempIt.Get(); } @@ -1252,7 +1252,7 @@ void XclExpFmlaCompImpl::ProcessExternal( const XclExpScToken& rTokData ) names and for external/invalid function calls. This function looks for the next token in the token array. If it is an opening parenthesis, the token is processed as external function call, otherwise as undefined name. */ - const FormulaToken* pNextScToken = PeekNextRawToken( true ); + const FormulaToken* pNextScToken = PeekNextRawToken(); if( !pNextScToken || (pNextScToken->GetOpCode() != ocOpen) ) AppendMissingNameToken( rTokData.mpScToken->GetExternal(), rTokData.mnSpaces ); else diff --git a/sc/source/filter/inc/biffinputstream.hxx b/sc/source/filter/inc/biffinputstream.hxx index 37f64e69677d..997b5632c4ce 100644 --- a/sc/source/filter/inc/biffinputstream.hxx +++ b/sc/source/filter/inc/biffinputstream.hxx @@ -277,7 +277,7 @@ private: /** Initializes all members after base stream has been sought to new record. */ void setupRecord(); /** Restarts the current record from the beginning. */ - void restartRecord( bool bInvalidateRecSize ); + void restartRecord(); /** Sets stream pointer before specified record and invalidates stream. */ void rewindToRecord( sal_Int64 nRecHandle ); /** Returns true, if stream was able to start a valid record. */ diff --git a/sc/source/filter/inc/workbookhelper.hxx b/sc/source/filter/inc/workbookhelper.hxx index 91c544b3084f..c314bf592939 100644 --- a/sc/source/filter/inc/workbookhelper.hxx +++ b/sc/source/filter/inc/workbookhelper.hxx @@ -169,9 +169,9 @@ public: getCellRangeFromDoc( const css::table::CellRangeAddress& rRange ) const; - /** Returns the cell or page styles container from the Calc document. */ + /** Returns the cell styles container from the Calc document. */ css::uno::Reference< css::container::XNameContainer > - getStyleFamily( bool bPageStyles ) const; + getCellStyleFamily() const; /** Returns the specified cell or page style from the Calc document. */ css::uno::Reference< css::style::XStyle > getStyleObject( const OUString& rStyleName, bool bPageStyle ) const; diff --git a/sc/source/filter/oox/biffinputstream.cxx b/sc/source/filter/oox/biffinputstream.cxx index 1619d2ac3bb8..c9840ba2f84d 100644 --- a/sc/source/filter/oox/biffinputstream.cxx +++ b/sc/source/filter/oox/biffinputstream.cxx @@ -247,7 +247,7 @@ void BiffInputStream::seek( sal_Int64 nRecPos ) if( isInRecord() ) { if( mbEof || (nRecPos < tell()) ) - restartRecord( false ); + restartRecord(); if( !mbEof && (nRecPos > tell()) ) skip( static_cast< sal_Int32 >( nRecPos - tell() ) ); } @@ -389,17 +389,12 @@ void BiffInputStream::setupRecord() enableDecoder(); } -void BiffInputStream::restartRecord( bool bInvalidateRecSize ) +void BiffInputStream::restartRecord() { if( isInRecord() ) { maRecBuffer.startRecord( getRecHandle() ); mnCurrRecSize = maRecBuffer.getRecSize(); - if( bInvalidateRecSize ) - { - mnComplRecSize = mnCurrRecSize; - mbHasComplRec = !mbCont; - } mbEof = false; } } diff --git a/sc/source/filter/oox/formulaparser.cxx b/sc/source/filter/oox/formulaparser.cxx index 7b899f4fc256..32588ca292e6 100644 --- a/sc/source/filter/oox/formulaparser.cxx +++ b/sc/source/filter/oox/formulaparser.cxx @@ -471,7 +471,7 @@ protected: void pushOperandSize( size_t nSize ); size_t popOperandSize(); - ApiToken& getOperandToken( size_t nOpCountFromEnd, size_t nOpIndex, size_t nTokenIndex ); + ApiToken& getOperandToken( size_t nOpIndex, size_t nTokenIndex ); bool pushOperandToken( sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces = nullptr ); bool pushAnyOperandToken( const Any& rAny, sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces = nullptr ); @@ -480,7 +480,7 @@ protected: template< typename Type > inline bool pushValueOperandToken( const Type& rValue ) { return pushValueOperandToken( rValue, OPCODE_PUSH, nullptr ); } - bool pushParenthesesOperandToken( const WhiteSpaceVec* pOpeningSpaces = nullptr, const WhiteSpaceVec* pClosingSpaces = nullptr ); + bool pushParenthesesOperandToken( const WhiteSpaceVec* pClosingSpaces = nullptr ); bool pushUnaryPreOperatorToken( sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces = nullptr ); bool pushUnaryPostOperatorToken( sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces = nullptr ); bool pushBinaryOperatorToken( sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces = nullptr ); @@ -747,13 +747,13 @@ size_t FormulaParserImpl::popOperandSize() return nOpSize; } -ApiToken& FormulaParserImpl::getOperandToken( size_t nOpCountFromEnd, size_t nOpIndex, size_t nTokenIndex ) +ApiToken& FormulaParserImpl::getOperandToken( size_t nOpIndex, size_t nTokenIndex ) { SAL_WARN_IF( - getOperandSize( nOpCountFromEnd, nOpIndex ) <= nTokenIndex, "sc.filter", + getOperandSize( 1, nOpIndex ) <= nTokenIndex, "sc.filter", "FormulaParserImpl::getOperandToken - invalid parameters" ); SizeTypeVector::const_iterator aIndexIt = maTokenIndexes.end(); - for( SizeTypeVector::const_iterator aEnd = maOperandSizeStack.end(), aIt = aEnd - nOpCountFromEnd + nOpIndex; aIt != aEnd; ++aIt ) + for( SizeTypeVector::const_iterator aEnd = maOperandSizeStack.end(), aIt = aEnd - 1 + nOpIndex; aIt != aEnd; ++aIt ) aIndexIt -= *aIt; return maTokenStorage[ *(aIndexIt + nTokenIndex) ]; } @@ -783,9 +783,9 @@ bool FormulaParserImpl::pushValueOperandToken( const Type& rValue, sal_Int32 nOp return true; } -bool FormulaParserImpl::pushParenthesesOperandToken( const WhiteSpaceVec* pOpeningSpaces, const WhiteSpaceVec* pClosingSpaces ) +bool FormulaParserImpl::pushParenthesesOperandToken( const WhiteSpaceVec* pClosingSpaces ) { - size_t nSpacesSize = appendWhiteSpaceTokens( pOpeningSpaces ); + size_t nSpacesSize = appendWhiteSpaceTokens( nullptr ); appendRawToken( OPCODE_OPEN ); nSpacesSize += appendWhiteSpaceTokens( pClosingSpaces ); appendRawToken( OPCODE_CLOSE ); @@ -861,7 +861,7 @@ bool FormulaParserImpl::pushFunctionOperatorToken( sal_Int32 nOpCode, size_t nPa // add function parentheses and function name return bOk && - ((nParamCount > 0) ? pushParenthesesOperatorToken( nullptr, pClosingSpaces ) : pushParenthesesOperandToken( nullptr, pClosingSpaces )) && + ((nParamCount > 0) ? pushParenthesesOperatorToken( nullptr, pClosingSpaces ) : pushParenthesesOperandToken( pClosingSpaces )) && pushUnaryPreOperatorToken( nOpCode, pLeadingSpaces ); } @@ -872,10 +872,10 @@ bool FormulaParserImpl::pushFunctionOperatorToken( const FunctionInfo& rFuncInfo { // create an external add-in call for the passed built-in function if( (rFuncInfo.mnApiOpCode == OPCODE_EXTERNAL) && !rFuncInfo.maExtProgName.isEmpty() ) - getOperandToken( 1, 0, 0 ).Data <<= rFuncInfo.maExtProgName; + getOperandToken( 0, 0 ).Data <<= rFuncInfo.maExtProgName; // create a bad token with unsupported function name else if( (rFuncInfo.mnApiOpCode == OPCODE_BAD) && !rFuncInfo.maOoxFuncName.isEmpty() ) - getOperandToken( 1, 0, 0 ).Data <<= rFuncInfo.maOoxFuncName; + getOperandToken( 0, 0 ).Data <<= rFuncInfo.maOoxFuncName; } return bOk; } diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 5756f2f288bf..009e5c940168 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -2707,7 +2707,7 @@ void CellStyleBuffer::finalizeImport() try { // unfortunately, com.sun.star.style.StyleFamily does not implement XEnumerationAccess... - Reference< XIndexAccess > xStyleFamilyIA( getStyleFamily( false ), UNO_QUERY_THROW ); + Reference< XIndexAccess > xStyleFamilyIA( getCellStyleFamily(), UNO_QUERY_THROW ); for( sal_Int32 nIndex = 0, nCount = xStyleFamilyIA->getCount(); nIndex < nCount; ++nIndex ) { Reference< XStyle > xStyle( xStyleFamilyIA->getByIndex( nIndex ), UNO_QUERY_THROW ); diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index c21e471c2751..05d904dde711 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -232,7 +232,7 @@ public: private: /** Initializes some basic members and sets needed document properties. */ - void initialize( bool bWorkbookFile ); + void initialize(); /** Finalizes the filter process (sets some needed document properties). */ void finalize(); @@ -322,7 +322,7 @@ WorkbookGlobals::WorkbookGlobals( ExcelFilter& rFilter ) : { // register at the filter, needed for virtual callbacks (even during construction) mrExcelFilter.registerWorkbookGlobals( *this ); - initialize( true ); + initialize(); } WorkbookGlobals::~WorkbookGlobals() @@ -528,14 +528,14 @@ void WorkbookGlobals::useInternalChartDataTable( bool bInternal ) // private -------------------------------------------------------------------- -void WorkbookGlobals::initialize( bool bWorkbookFile ) +void WorkbookGlobals::initialize() { maCellStyles = "CellStyles"; maPageStyles = "PageStyles"; maCellStyleServ = "com.sun.star.style.CellStyle"; maPageStyleServ = "com.sun.star.style.PageStyle"; mnCurrSheet = -1; - mbWorkbook = bWorkbookFile; + mbWorkbook = true; meTextEnc = osl_getThreadTextEncoding(); mbHasCodePage = false; @@ -827,9 +827,9 @@ Reference< XCellRange > WorkbookHelper::getCellRangeFromDoc( const CellRangeAddr return xRange; } -Reference< XNameContainer > WorkbookHelper::getStyleFamily( bool bPageStyles ) const +Reference< XNameContainer > WorkbookHelper::getCellStyleFamily() const { - return mrBookGlob.getStyleFamily( bPageStyles ); + return mrBookGlob.getStyleFamily( false/*bPageStyles*/ ); } Reference< XStyle > WorkbookHelper::getStyleObject( const OUString& rStyleName, bool bPageStyle ) const diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index d64d2045ceaf..6fbad6d3500a 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -738,7 +738,7 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr if (pContext) { bIsEmpty = false; - rXMLImport.ProgressBarIncrement(false); + rXMLImport.ProgressBarIncrement(); } } } @@ -1138,7 +1138,7 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos, // Formatted text that is put into the cell by the child context // is handled in AddCellsToTable() (bIsEmpty is true then). if (bDoIncrement) - rXMLImport.ProgressBarIncrement(false); + rXMLImport.ProgressBarIncrement(); } void ScXMLTableRowCellContext::PutValueCell( const ScAddress& rCurrentPos ) @@ -1169,7 +1169,7 @@ void ScXMLTableRowCellContext::PutValueCell( const ScAddress& rCurrentPos ) rXMLImport.GetDoc().setNumericCell(rCurrentPos, fValue); } - rXMLImport.ProgressBarIncrement(false); + rXMLImport.ProgressBarIncrement(); } namespace { @@ -1464,7 +1464,7 @@ void ScXMLTableRowCellContext::AddFormulaCell( const ScAddress& rCellPos ) SetAnnotation( rCellPos ); SetDetectiveObj( rCellPos ); SetCellRangeSource( rCellPos ); - rXMLImport.ProgressBarIncrement(false); + rXMLImport.ProgressBarIncrement(); } else { diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index e2564929fa3b..eb22e9015631 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -3266,7 +3266,7 @@ void SAL_CALL ScXMLImport::endDocument() SvXMLImport::endDocument(); if(pDoc && bSelfImportingXMLSet) - ScModelObj::getImplementation(GetModel())->AfterXMLLoading(true); + ScModelObj::getImplementation(GetModel())->AfterXMLLoading(); } // XEventListener @@ -3339,10 +3339,10 @@ void ScXMLImport::SetRangeOverflowType(sal_uInt32 nType) pDoc->SetRangeOverflowType( nType ); } -void ScXMLImport::ProgressBarIncrement(bool bEditCell) +void ScXMLImport::ProgressBarIncrement() { nProgressCount++; - if (bEditCell || nProgressCount > 100) + if (nProgressCount > 100) { GetProgressBarHelper()->Increment(nProgressCount); nProgressCount = 0; diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index 04ff141674db..395c0e871b52 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -1149,7 +1149,7 @@ public: const sal_Int16 nCellType, const OUString& rCurrency); - void ProgressBarIncrement(bool bEditCell); + void ProgressBarIncrement(); void SetNewCondFormatData() { mbHasNewCondFormatData = true; } bool HasNewCondFormatData() { return mbHasNewCondFormatData; } diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index e0a18c846a52..5747f22e9451 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -408,7 +408,7 @@ void ScXMLTableContext::EndElement() } rTables.DeleteTable(); - rImport.ProgressBarIncrement(false); + rImport.ProgressBarIncrement(); // store stream positions if (!pExternalRefInfo.get() && nStartOffset >= 0 /* && nEndOffset >= 0 */) diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 02394b190f8e..a77889463cff 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -593,16 +593,16 @@ bool AbstractScTextImportOptionsDlg_Impl::IsDateConversionSet() const } // =========================Factories for createdialog =================== -AbstractScImportAsciiDlg * ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg ( vcl::Window* pParent, const OUString& aDatName, +AbstractScImportAsciiDlg * ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg ( const OUString& aDatName, SvStream* pInStream, ScImportAsciiCall eCall ) { - VclPtr<ScImportAsciiDlg> pDlg = VclPtr<ScImportAsciiDlg>::Create( pParent, aDatName,pInStream, eCall ); + VclPtr<ScImportAsciiDlg> pDlg = VclPtr<ScImportAsciiDlg>::Create( nullptr, aDatName,pInStream, eCall ); return new AbstractScImportAsciiDlg_Impl( pDlg ); } -AbstractScTextImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg(vcl::Window* pParent) +AbstractScTextImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg() { - VclPtr<ScTextImportOptionsDlg> pDlg = VclPtr<ScTextImportOptionsDlg>::Create(pParent); + VclPtr<ScTextImportOptionsDlg> pDlg = VclPtr<ScTextImportOptionsDlg>::Create(nullptr); return new AbstractScTextImportOptionsDlg_Impl(pDlg); } @@ -889,7 +889,7 @@ AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg( return new AbstractScTabBgColorDlg_Impl( pDlg ); } -AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptionsDlg ( vcl::Window* pParent, +AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptionsDlg ( bool bAscii, const ScImportOptions* pOptions, const OUString* pStrTitle, @@ -897,7 +897,7 @@ AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptions bool bOnlyDbtoolsEncodings, bool bImport ) { - VclPtr<ScImportOptionsDlg> pDlg = VclPtr<ScImportOptionsDlg>::Create( pParent, bAscii, pOptions,pStrTitle, bMultiByte,bOnlyDbtoolsEncodings, bImport ); + VclPtr<ScImportOptionsDlg> pDlg = VclPtr<ScImportOptionsDlg>::Create( nullptr, bAscii, pOptions,pStrTitle, bMultiByte,bOnlyDbtoolsEncodings, bImport ); return new AbstractScImportOptionsDlg_Impl( pDlg ); } diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 0f9e1feadb85..9c459527f20f 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -392,11 +392,11 @@ class ScAbstractDialogFactory_Impl : public ScAbstractDialogFactory public: virtual ~ScAbstractDialogFactory_Impl() {} - virtual AbstractScImportAsciiDlg * CreateScImportAsciiDlg( vcl::Window* pParent, const OUString& aDatName, + virtual AbstractScImportAsciiDlg * CreateScImportAsciiDlg( const OUString& aDatName, SvStream* pInStream, ScImportAsciiCall eCall) override; - virtual AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg(vcl::Window* pParent) override; + virtual AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg() override; virtual AbstractScAutoFormatDlg * CreateScAutoFormatDlg(vcl::Window* pParent, ScAutoFormat* pAutoFormat, @@ -520,8 +520,7 @@ public: const Color& rDefaultColor, //Currently selected Color const OString& sHelpId ) override; - virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( vcl::Window* pParent, - bool bAscii = true, + virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( bool bAscii = true, const ScImportOptions* pOptions = nullptr, const OUString* pStrTitle = nullptr, bool bMultiByte = false, diff --git a/sc/source/ui/inc/cbutton.hxx b/sc/source/ui/inc/cbutton.hxx index a78d71e4eeba..4b6aaaedb99a 100644 --- a/sc/source/ui/inc/cbutton.hxx +++ b/sc/source/ui/inc/cbutton.hxx @@ -37,8 +37,8 @@ public: void Draw( const Point& rAt, const Size& rSize, bool bState ); - void Draw( bool bState ) - { Draw( aBtnPos, aBtnSize, bState ); } + void Draw() + { Draw( aBtnPos, aBtnSize, false ); } void SetOptSizePixel(); diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx index b6b615227bb4..6a91afdb1732 100644 --- a/sc/source/ui/inc/navipi.hxx +++ b/sc/source/ui/inc/navipi.hxx @@ -83,7 +83,7 @@ private: void ExecuteScenarioSlot( sal_uInt16 nSlotId ); void SelectScenario(); void EditScenario(); - void DeleteScenario( bool bQueryBox ); + void DeleteScenario(); private: ScScenarioWindow& mrParent; diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 2644952b400e..3e837fee52e1 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -97,7 +97,7 @@ public: void EnterDataAtCursor( const OUString& rString ); //! Not used? - SC_DLLPUBLIC void CutToClip( ScDocument* pClipDoc = nullptr, bool bIncludeObjects = false ); + SC_DLLPUBLIC void CutToClip( bool bIncludeObjects = false ); SC_DLLPUBLIC bool CopyToClip( ScDocument* pClipDoc = nullptr, bool bCut = false, bool bApi = false, bool bIncludeObjects = false, bool bStopEdit = true ); SC_DLLPUBLIC bool CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRange, bool bCut = false, diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx index 501c2c1107d7..cd3d248c29ea 100644 --- a/sc/source/ui/navipi/scenwnd.cxx +++ b/sc/source/ui/navipi/scenwnd.cxx @@ -121,7 +121,7 @@ bool ScScenarioListBox::Notify( NotifyEvent& rNEvt ) bHandled = true; break; case KEY_DELETE: - DeleteScenario( true ); + DeleteScenario(); bHandled = true; break; } @@ -142,7 +142,7 @@ bool ScScenarioListBox::Notify( NotifyEvent& rNEvt ) switch( aPopup.GetSelected() ) { case RID_NAVIPI_SCENARIO_DELETE: - DeleteScenario( true ); + DeleteScenario(); break; case RID_NAVIPI_SCENARIO_EDIT: EditScenario(); @@ -185,10 +185,10 @@ void ScScenarioListBox::EditScenario() ExecuteScenarioSlot( SID_EDIT_SCENARIO ); } -void ScScenarioListBox::DeleteScenario( bool bQueryBox ) +void ScScenarioListBox::DeleteScenario() { if( GetSelectEntryCount() > 0 ) - if( !bQueryBox || (ScopedVclPtr<QueryBox>::Create( nullptr, WinBits( WB_YES_NO | WB_DEF_YES ), ScGlobal::GetRscString( STR_QUERY_DELSCENARIO ) )->Execute() == RET_YES) ) + if( ScopedVclPtr<QueryBox>::Create( nullptr, WinBits( WB_YES_NO | WB_DEF_YES ), ScGlobal::GetRscString( STR_QUERY_DELSCENARIO ) )->Execute() == RET_YES ) ExecuteScenarioSlot( SID_DELETE_SCENARIO ); } diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 9d5b047c546e..c81cd3b7b66b 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -816,7 +816,7 @@ void ScUndoCut::Redo() void ScUndoCut::Repeat(SfxRepeatTarget& rTarget) { if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr) - static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->CutToClip( nullptr, true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->CutToClip( true ); } bool ScUndoCut::CanRepeat(SfxRepeatTarget& rTarget) const diff --git a/sc/source/ui/unoobj/celllistsource.cxx b/sc/source/ui/unoobj/celllistsource.cxx index d7222686b20f..f6908f2c2cf6 100644 --- a/sc/source/ui/unoobj/celllistsource.cxx +++ b/sc/source/ui/unoobj/celllistsource.cxx @@ -162,12 +162,12 @@ namespace calc return aAddress; } - OUString OCellListSource::getCellTextContent_noCheck( sal_Int32 _nRangeRelativeColumn, sal_Int32 _nRangeRelativeRow ) + OUString OCellListSource::getCellTextContent_noCheck( sal_Int32 _nRangeRelativeRow ) { OSL_PRECOND( m_xRange.is(), "OCellListSource::getRangeAddress: invalid range!" ); Reference< XTextRange > xCellText; if ( m_xRange.is() ) - xCellText.set(m_xRange->getCellByPosition( _nRangeRelativeColumn, _nRangeRelativeRow ), css::uno::UNO_QUERY); + xCellText.set(m_xRange->getCellByPosition( 0, _nRangeRelativeRow ), css::uno::UNO_QUERY); OUString sText; if ( xCellText.is() ) @@ -194,7 +194,7 @@ namespace calc if ( _nPosition >= getListEntryCount() ) throw IndexOutOfBoundsException(); - return getCellTextContent_noCheck( 0, _nPosition ); + return getCellTextContent_noCheck( _nPosition ); } Sequence< OUString > SAL_CALL OCellListSource::getAllListEntries( ) throw (RuntimeException, std::exception) @@ -207,7 +207,7 @@ namespace calc OUString* pAllEntries = aAllEntries.getArray(); for ( sal_Int32 i = 0; i < aAllEntries.getLength(); ++i ) { - *pAllEntries++ = getCellTextContent_noCheck( 0, i ); + *pAllEntries++ = getCellTextContent_noCheck( i ); } return aAllEntries; diff --git a/sc/source/ui/unoobj/celllistsource.hxx b/sc/source/ui/unoobj/celllistsource.hxx index ceb2e1573991..2cc076bd34e9 100644 --- a/sc/source/ui/unoobj/celllistsource.hxx +++ b/sc/source/ui/unoobj/celllistsource.hxx @@ -128,8 +128,6 @@ namespace calc getRangeAddress( ) const; /** retrievs the text of a cell within our range - @param _nRangeRelativeColumn - the relative column index of the cell within our range @param _nRangeRelativeRow the relative row index of the cell within our range @precond @@ -137,7 +135,6 @@ namespace calc */ OUString getCellTextContent_noCheck( - sal_Int32 _nRangeRelativeColumn, sal_Int32 _nRangeRelativeRow ); diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index df1de74049fb..46bf00ce031d 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -1809,10 +1809,10 @@ uno::Sequence<sal_Int8> SAL_CALL ScCellRangesBase::getImplementationId() return css::uno::Sequence<sal_Int8>(); } -void ScCellRangesBase::PaintRanges_Impl( sal_uInt16 nPart ) +void ScCellRangesBase::PaintGridRanges_Impl( ) { for (size_t i = 0, nCount = aRanges.size(); i < nCount; ++i) - pDocShell->PostPaint( *aRanges[ i ], nPart ); + pDocShell->PostPaint( *aRanges[ i ], PAINT_GRID ); } // XSheetOperation @@ -3174,7 +3174,7 @@ void SAL_CALL ScCellRangesBase::setData( const uno::Sequence< uno::Sequence<doub } //! undo - PaintRanges_Impl( PAINT_GRID ); + PaintGridRanges_Impl(); pDocShell->SetDocumentModified(); ForceChartListener_Impl(); // call listeners for this object synchronously bDone = true; @@ -3244,7 +3244,7 @@ void SAL_CALL ScCellRangesBase::setRowDescriptions( } //! undo - PaintRanges_Impl( PAINT_GRID ); + PaintGridRanges_Impl(); pDocShell->SetDocumentModified(); ForceChartListener_Impl(); // call listeners for this object synchronously bDone = true; @@ -3315,7 +3315,7 @@ void SAL_CALL ScCellRangesBase::setColumnDescriptions( } //! undo - PaintRanges_Impl( PAINT_GRID ); + PaintGridRanges_Impl(); pDocShell->SetDocumentModified(); ForceChartListener_Impl(); // call listeners for this object synchronously bDone = true; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index cdb8682ebb50..1c51354a31bb 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -444,10 +444,10 @@ void ScModelObj::BeforeXMLLoading() pDocShell->BeforeXMLLoading(); } -void ScModelObj::AfterXMLLoading(bool bRet) +void ScModelObj::AfterXMLLoading() { if (pDocShell) - pDocShell->AfterXMLLoading(bRet); + pDocShell->AfterXMLLoading(true); } ScSheetSaveData* ScModelObj::GetSheetSaveData() diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx index b1b289d78006..96f74ce7b949 100644 --- a/sc/source/ui/unoobj/filtuno.cxx +++ b/sc/source/ui/unoobj/filtuno.cxx @@ -176,7 +176,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st if ( xInputStream.is() ) pInStream.reset(utl::UcbStreamHelper::CreateStream( xInputStream )); - std::unique_ptr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( nullptr, aPrivDatName, pInStream.get(), SC_IMPORTFILE)); + std::unique_ptr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( aPrivDatName, pInStream.get(), SC_IMPORTFILE)); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) { @@ -195,7 +195,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st { // HTML import. std::unique_ptr<AbstractScTextImportOptionsDlg> pDlg( - pFact->CreateScTextImportOptionsDlg(nullptr)); + pFact->CreateScTextImportOptionsDlg()); if (pDlg->Execute() == RET_OK) { @@ -277,7 +277,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st ScImportOptions aOptions( cAsciiDel, cStrDel, eEncoding); - std::unique_ptr<AbstractScImportOptionsDlg> pDlg(pFact->CreateScImportOptionsDlg(nullptr, + std::unique_ptr<AbstractScImportOptionsDlg> pDlg(pFact->CreateScImportOptionsDlg( bAscii, &aOptions, &aTitle, bMultiByte, bDBEnc, !bExport)); OSL_ENSURE(pDlg, "Dialog create fail!"); diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx index e6f583b8ac39..29ac7bc5a818 100644 --- a/sc/source/ui/vba/excelvbahelper.cxx +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -177,7 +177,7 @@ implnCut( const uno::Reference< frame::XModel>& xModel ) ScTabViewShell* pViewShell = getBestViewShell( xModel ); if ( pViewShell ) { - pViewShell->CutToClip( nullptr, true ); + pViewShell->CutToClip( true ); // mark the copied transfer object so it is used in ScVbaRange::Insert ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( nullptr ); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 88a620b7f104..b9fbf41ccca7 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1272,7 +1272,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_CUT: // for graphs in DrawShell { WaitObject aWait( GetViewData()->GetDialogParent() ); - pTabViewShell->CutToClip( nullptr, true ); + pTabViewShell->CutToClip( true ); rReq.Done(); GetViewData()->SetPasteMode( (ScPasteFlags)(SC_PASTE_MODE | SC_PASTE_BORDER)); pTabViewShell->ShowCursor(); diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 70c0af5d6fb7..1ab82abb7c3d 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -977,7 +977,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE( pFact, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pFact is null!" ); std::unique_ptr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( - nullptr, OUString(), &aStream, SC_TEXTTOCOLUMNS)); + OUString(), &aStream, SC_TEXTTOCOLUMNS)); OSL_ENSURE( pDlg, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pDlg is null!" ); if ( pDlg->Execute() == RET_OK ) diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index c6f0a6c67bf4..e36bf901339f 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1450,7 +1450,7 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo aComboButton.SetPosPixel( aRect.TopLeft() ); aComboButton.SetSizePixel( aRect.GetSize() ); pContentDev->SetClipRegion(vcl::Region(aRect)); - aComboButton.Draw( false ); + aComboButton.Draw(); pContentDev->SetClipRegion(); // always called from Draw() without clip region aComboButton.SetPosPixel( aOldPos ); // restore old state aComboButton.SetSizePixel( aOldSize ); // for MouseUp/Down (AutoFilter) diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 77b0fad9e999..24b91a9b739b 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -75,7 +75,7 @@ using namespace com::sun::star; // C U T -void ScViewFunc::CutToClip( ScDocument* pClipDoc, bool bIncludeObjects ) +void ScViewFunc::CutToClip( bool bIncludeObjects ) { UpdateInputLine(); @@ -104,7 +104,7 @@ void ScViewFunc::CutToClip( ScDocument* pClipDoc, bool bIncludeObjects ) MarkDataChanged(); } - CopyToClip( pClipDoc, true, false, bIncludeObjects ); // copy to clipboard + CopyToClip( nullptr, true, false, bIncludeObjects ); // copy to clipboard ScAddress aOldEnd( aRange.aEnd ); // combined cells in this range? pDoc->ExtendMerge( aRange, true ); diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index 260f4f8efa46..bbd61e0c005b 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -307,7 +307,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, // make sense to do it for other data types too. ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); std::unique_ptr<AbstractScTextImportOptionsDlg> pDlg( - pFact->CreateScTextImportOptionsDlg(nullptr)); + pFact->CreateScTextImportOptionsDlg()); if (pDlg->Execute() == RET_OK) { @@ -336,8 +336,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); std::unique_ptr<AbstractScImportAsciiDlg> pDlg( - pFact->CreateScImportAsciiDlg( nullptr, OUString(), &aStrm, - SC_PASTETEXT)); + pFact->CreateScImportAsciiDlg( OUString(), &aStrm, SC_PASTETEXT)); if (pDlg->Execute() == RET_OK) { |