Kaydet (Commit) 3dfc17ed authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constantparam (3)

Change-Id: Ifc47bb8e096c9a8563021b2fcb44199577740746
Reviewed-on: https://gerrit.libreoffice.org/59747
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst f8e989c2
......@@ -70,8 +70,7 @@ public:
static void SetDocInfoState(
const css::uno::Reference< css::frame::XModel >& xModel,
const css::uno::Reference< css::document::XDocumentProperties>& i_xOldDocInfo,
bool bNoModify );
const css::uno::Reference< css::document::XDocumentProperties>& i_xOldDocInfo );
static bool WarnUnacceptableFormat(
const css::uno::Reference< css::frame::XModel >& xModel,
......
......@@ -182,10 +182,9 @@ class PreventDuplicateInteraction : private ThreadHelpBase2
public:
InteractionInfo(const css::uno::Type& aInteraction,
sal_Int32 nMaxCount )
InteractionInfo(const css::uno::Type& aInteraction)
: m_aInteraction(aInteraction)
, m_nMaxCount (nMaxCount )
, m_nMaxCount (1 )
, m_nCallCount (0 )
{}
};
......
......@@ -686,7 +686,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// define rules for this handler
css::uno::Type aInteraction = ::cppu::UnoType<css::task::ErrorCodeRequest>::get();
::sfx2::PreventDuplicateInteraction::InteractionInfo aRule (aInteraction, 1);
::sfx2::PreventDuplicateInteraction::InteractionInfo aRule(aInteraction);
pHandler->addInteractionRule(aRule);
if (!aDocService.isEmpty())
......
......@@ -1654,7 +1654,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo
if ( nStoreMode & EXPORT_REQUESTED )
{
SfxStoringHelper::SetDocInfoState(aModel.GetModel(), xOldDocProps, true);
SfxStoringHelper::SetDocInfoState(aModel.GetModel(), xOldDocProps);
}
};
......@@ -1728,8 +1728,7 @@ bool SfxStoringHelper::CheckFilterOptionsAppearance(
// static
void SfxStoringHelper::SetDocInfoState(
const uno::Reference< frame::XModel >& xModel,
const uno::Reference< document::XDocumentProperties>& i_xOldDocProps,
bool bNoModify )
const uno::Reference< document::XDocumentProperties>& i_xOldDocProps )
{
uno::Reference<document::XDocumentPropertiesSupplier> const
xModelDocPropsSupplier(xModel, uno::UNO_QUERY_THROW);
......@@ -1739,10 +1738,10 @@ void SfxStoringHelper::SetDocInfoState(
i_xOldDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
uno::Reference< util::XModifiable > xModifiable( xModel, uno::UNO_QUERY );
if ( bNoModify && !xModifiable.is() )
if ( !xModifiable.is() )
throw uno::RuntimeException();
bool bIsModified = bNoModify && xModifiable->isModified();
bool bIsModified = xModifiable->isModified();
try
{
......@@ -1799,7 +1798,7 @@ void SfxStoringHelper::SetDocInfoState(
}
// set the modified flag back if required
if ( (bNoModify && bIsModified) != bool(xModifiable->isModified()) )
if ( bIsModified != bool(xModifiable->isModified()) )
xModifiable->setModified( bIsModified );
}
......
......@@ -24,7 +24,7 @@
class SdrMoveXItem: public SdrMetricItem {
public:
SdrMoveXItem(long n=0): SdrMetricItem(SDRATTR_MOVEX,n) {}
SdrMoveXItem(): SdrMetricItem(SDRATTR_MOVEX,0) {}
SfxPoolItem* Clone(SfxItemPool*) const override
{
return new SdrMoveXItem(*this);
......@@ -33,7 +33,7 @@ public:
class SdrMoveYItem: public SdrMetricItem {
public:
SdrMoveYItem(long n=0): SdrMetricItem(SDRATTR_MOVEY,n) {}
SdrMoveYItem(): SdrMetricItem(SDRATTR_MOVEY,0) {}
SfxPoolItem* Clone(SfxItemPool*) const override
{
return new SdrMoveYItem(*this);
......
......@@ -24,7 +24,7 @@
class SdrRotateAllItem: public SdrAngleItem {
public:
SdrRotateAllItem(long nAngle=0): SdrAngleItem(SDRATTR_ROTATEALL,nAngle) {}
SdrRotateAllItem(): SdrAngleItem(SDRATTR_ROTATEALL,0) {}
virtual SfxPoolItem* Clone(SfxItemPool*) const override
{
return new SdrRotateAllItem(*this);
......
......@@ -24,7 +24,7 @@
class SdrRotateOneItem: public SdrAngleItem {
public:
SdrRotateOneItem(long nAngle=0): SdrAngleItem(SDRATTR_ROTATEONE,nAngle) {}
SdrRotateOneItem(): SdrAngleItem(SDRATTR_ROTATEONE,0) {}
SfxPoolItem* Clone(SfxItemPool*) const override
{
return new SdrRotateOneItem(*this);
......
......@@ -24,7 +24,7 @@
class SdrHorzShearAllItem: public SdrAngleItem {
public:
SdrHorzShearAllItem(long nAngle=0): SdrAngleItem(SDRATTR_HORZSHEARALL,nAngle) {}
SdrHorzShearAllItem(): SdrAngleItem(SDRATTR_HORZSHEARALL,0) {}
virtual SfxPoolItem* Clone(SfxItemPool*) const override
{
return new SdrHorzShearAllItem(*this);
......@@ -33,7 +33,7 @@ public:
class SdrVertShearAllItem: public SdrAngleItem {
public:
SdrVertShearAllItem(long nAngle=0): SdrAngleItem(SDRATTR_VERTSHEARALL,nAngle) {}
SdrVertShearAllItem(): SdrAngleItem(SDRATTR_VERTSHEARALL,0) {}
virtual SfxPoolItem* Clone(SfxItemPool*) const override
{
return new SdrVertShearAllItem(*this);
......
......@@ -24,7 +24,7 @@
class SdrHorzShearOneItem: public SdrAngleItem {
public:
SdrHorzShearOneItem(long nAngle=0): SdrAngleItem(SDRATTR_HORZSHEARONE,nAngle) {}
SdrHorzShearOneItem(): SdrAngleItem(SDRATTR_HORZSHEARONE,0) {}
SfxPoolItem* Clone(SfxItemPool*) const override
{
return new SdrHorzShearOneItem(*this);
......@@ -33,7 +33,7 @@ public:
class SdrVertShearOneItem: public SdrAngleItem {
public:
SdrVertShearOneItem(long nAngle=0): SdrAngleItem(SDRATTR_VERTSHEARONE,nAngle) {}
SdrVertShearOneItem(): SdrAngleItem(SDRATTR_VERTSHEARONE,0) {}
SfxPoolItem* Clone(SfxItemPool*) const override
{
return new SdrVertShearOneItem(*this);
......
......@@ -512,9 +512,9 @@ public:
// false: which is visible at the upper margin.
void GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum,
bool bAtCursorPos = true, const bool bCalcFrame = true );
// Returns current page's sequential number (1-based), ignoring autoinserted empty pages
// Returns current page's sequential number (1-based),in which cursor is located, ignoring autoinserted empty pages.
// Returns 0 on error
sal_uInt16 GetPageNumSeqNonEmpty(bool bAtCursorPos, bool bCalcFrame);
sal_uInt16 GetPageNumSeqNonEmpty();
// Determine how "empty pages" are handled
// (used in PhyPage).
sal_uInt16 GetNextPrevPageNum( bool bNext = true );
......
......@@ -1126,14 +1126,14 @@ void SwCursorShell::GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum,
rnVirtNum = pPg? pPg->GetVirtPageNum() : 1;
}
sal_uInt16 SwCursorShell::GetPageNumSeqNonEmpty(bool bAtCursorPos, bool bCalcFrame)
sal_uInt16 SwCursorShell::GetPageNumSeqNonEmpty()
{
SET_CURR_SHELL(this);
// page number: first visible page or the one at the cursor
const SwContentFrame* pCFrame = GetCurrFrame(bCalcFrame);
const SwContentFrame* pCFrame = GetCurrFrame(/*bCalcFrame*/true);
const SwPageFrame* pPg = nullptr;
if (!bAtCursorPos || !pCFrame || nullptr == (pPg = pCFrame->FindPageFrame()))
if (!pCFrame || nullptr == (pPg = pCFrame->FindPageFrame()))
{
pPg = Imp()->GetFirstVisPage(GetOut());
while (pPg && pPg->IsEmptyPage())
......
......@@ -1900,7 +1900,7 @@ void DocxAttributeOutput::DoWriteFieldRunProperties( const SwTextNode * pNode, s
// 3. output all other character properties
SwWW8AttrIter aAttrIt( m_rExport, *pNode );
aAttrIt.OutAttr( nPos, false, bWriteCombChars );
aAttrIt.OutAttr( nPos, bWriteCombChars );
// 4. explicitly write the font-properties, to ensure all runs in the field have them
// see tdf#66401
......
......@@ -381,14 +381,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
return nMinPos;
}
static bool lcl_isFontsizeItem( const SfxPoolItem& rItem )
{
return ( rItem.Which( ) == RES_CHRATR_FONTSIZE ||
rItem.Which( ) == RES_CHRATR_CJK_FONTSIZE ||
rItem.Which( ) == RES_CHRATR_CTL_FONTSIZE );
}
void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby , bool bWriteCombChars)
void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bWriteCombChars)
{
m_rExport.AttrOutput().RTLAndCJKState( mbCharIsRTL, GetScript() );
......@@ -498,8 +491,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby , bool bWriteCombChars
for ( const auto& aRangeItem : aRangeItems )
{
if ( !bRuby || !lcl_isFontsizeItem( *(aRangeItem.second) ) )
aExportItems[aRangeItem.first] = aRangeItem.second;
aExportItems[aRangeItem.first] = aRangeItem.second;
}
if ( !aExportItems.empty() )
......@@ -2471,7 +2463,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
// Output the character attributes
// #i51277# do this before writing flys at end of paragraph
AttrOutput().StartRunProperties();
aAttrIter.OutAttr( nCurrentPos );
aAttrIter.OutAttr( nCurrentPos, false );
AttrOutput().EndRunProperties( pRedlineData );
}
......@@ -2514,7 +2506,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
// do it after WriteCR for an empty paragraph (otherwise
// WW8_WrFkp::Append throws SPRMs away...)
AttrOutput().StartRunProperties();
aAttrIter.OutAttr( nCurrentPos );
aAttrIter.OutAttr( nCurrentPos, false );
AttrOutput().EndRunProperties( pRedlineData );
}
......@@ -2583,7 +2575,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
if (0 != nEnd)
{
AttrOutput().StartRunProperties();
aAttrIter.OutAttr( nCurrentPos );
aAttrIter.OutAttr( nCurrentPos, false );
AttrOutput().EndRunProperties( pRedlineData );
}
AttrOutput().RunText( aSavedSnippet, eChrSet );
......
......@@ -1505,7 +1505,7 @@ public:
void NextPos() { if ( nCurrentSwPos < SAL_MAX_INT32 ) nCurrentSwPos = SearchNext( nCurrentSwPos + 1 ); }
void OutAttr( sal_Int32 nSwPos, bool bRuby = false, bool bWriteCombinedChars = false );
void OutAttr( sal_Int32 nSwPos, bool bWriteCombinedChars );
virtual const SfxPoolItem* HasTextItem( sal_uInt16 nWhich ) const override;
virtual const SfxPoolItem& GetItem( sal_uInt16 nWhich ) const override;
int OutAttrWithRange(const SwTextNode& rNode, sal_Int32 nPos);
......
......@@ -480,7 +480,7 @@ int documentStartPageNumber(SwMailMergeConfigItem* pConfigItem, int document, bo
if (!bIgnoreEmpty)
shell.GetPageNum(page, o3tl::temporary(sal_uInt16()));
else
page = shell.GetPageNumSeqNonEmpty(true, true);
page = shell.GetPageNumSeqNonEmpty();
shell.Pop(SwCursorShell::PopMode::DeleteCurrent);
return page;
}
......@@ -506,7 +506,7 @@ int documentEndPageNumber(SwMailMergeConfigItem* pConfigItem, int document, bool
if (!bIgnoreEmpty)
shell.GetPageNum(page, o3tl::temporary(sal_uInt16()));
else
page = shell.GetPageNumSeqNonEmpty(true, true);
page = shell.GetPageNumSeqNonEmpty();
shell.Pop(SwCursorShell::PopMode::DeleteCurrent);
return page;
}
......
......@@ -1213,16 +1213,13 @@ static sal_Unicode* ImplAdd2UNum( sal_Unicode* pBuf, sal_uInt16 nNumber, bool bL
return pBuf;
}
static sal_Unicode* ImplAdd9UNum( sal_Unicode* pBuf, sal_uInt32 nNumber, bool bLeading )
static sal_Unicode* ImplAdd9UNum( sal_Unicode* pBuf, sal_uInt32 nNumber )
{
DBG_ASSERT( nNumber < 1000000000, "ImplAdd9UNum() - Number >= 1000000000" );
std::ostringstream ostr;
if (bLeading)
{
ostr.fill('0');
ostr.width(9);
}
ostr.fill('0');
ostr.width(9);
ostr << nNumber;
std::string aStr = ostr.str();
for(const char *pAB= aStr.c_str(); *pAB != '\0'; ++pAB, ++pBuf)
......@@ -1436,7 +1433,7 @@ OUString LocaleDataWrapper::getTime( const tools::Time& rTime, bool bSec, bool b
if ( b100Sec )
{
pBuf = ImplAddString( pBuf, getTime100SecSep() );
pBuf = ImplAdd9UNum( pBuf, rTime.GetNanoSec(), true );
pBuf = ImplAdd9UNum( pBuf, rTime.GetNanoSec() );
}
}
......@@ -1508,7 +1505,7 @@ OUString LocaleDataWrapper::getDuration( const tools::Time& rTime, bool bSec, bo
if ( b100Sec )
{
pBuf = ImplAddString( pBuf, getTime100SecSep() );
pBuf = ImplAdd9UNum( pBuf, rTime.GetNanoSec(), true );
pBuf = ImplAdd9UNum( pBuf, rTime.GetNanoSec() );
}
}
......
......@@ -76,7 +76,7 @@ private:
std::shared_ptr<ImplOpenGLTexture> mpImpl;
int mnSlotNumber;
inline void GetTextureRect(const SalTwoRect& rPosAry, bool bInverted, GLfloat& x1, GLfloat& x2, GLfloat& y1, GLfloat& y2) const;
inline void GetTextureRect(const SalTwoRect& rPosAry, GLfloat& x1, GLfloat& x2, GLfloat& y1, GLfloat& y2) const;
bool IsValid() const
{
......
......@@ -380,7 +380,7 @@ void OpenGLTexture::GetCoord( GLfloat* pCoord, const SalTwoRect& rPosAry, bool b
}
}
void OpenGLTexture::GetTextureRect(const SalTwoRect& rPosAry, bool bInverted, GLfloat& x1, GLfloat& x2, GLfloat& y1, GLfloat& y2) const
void OpenGLTexture::GetTextureRect(const SalTwoRect& rPosAry, GLfloat& x1, GLfloat& x2, GLfloat& y1, GLfloat& y2) const
{
if (IsValid())
{
......@@ -390,16 +390,8 @@ void OpenGLTexture::GetTextureRect(const SalTwoRect& rPosAry, bool bInverted, GL
x1 = (maRect.Left() + rPosAry.mnSrcX) / fTextureWidth;
x2 = (maRect.Left() + rPosAry.mnSrcX + rPosAry.mnSrcWidth) / fTextureWidth;
if (bInverted)
{
y2 = 1.0f - (maRect.Top() + rPosAry.mnSrcY) / fTextureHeight;
y1 = 1.0f - (maRect.Top() + rPosAry.mnSrcY + rPosAry.mnSrcHeight) / fTextureHeight;
}
else
{
y1 = 1.0f - (maRect.Top() + rPosAry.mnSrcY) / fTextureHeight;
y2 = 1.0f - (maRect.Top() + rPosAry.mnSrcY + rPosAry.mnSrcHeight) / fTextureHeight;
}
y1 = 1.0f - (maRect.Top() + rPosAry.mnSrcY) / fTextureHeight;
y2 = 1.0f - (maRect.Top() + rPosAry.mnSrcY + rPosAry.mnSrcHeight) / fTextureHeight;
}
}
......@@ -411,7 +403,7 @@ void OpenGLTexture::FillCoords<GL_TRIANGLE_FAN>(std::vector<GLfloat>& rCoords, c
GLfloat y1 = 0.0f;
GLfloat y2 = 0.0f;
GetTextureRect(rPosAry, false/*bInverted*/, x1, x2, y1, y2);
GetTextureRect(rPosAry, x1, x2, y1, y2);
rCoords.insert(rCoords.end(), {
x1, y2, x1, y1,
......@@ -427,7 +419,7 @@ void OpenGLTexture::FillCoords<GL_TRIANGLES>(std::vector<GLfloat>& rCoords, cons
GLfloat y1 = 0.0f;
GLfloat y2 = 0.0f;
GetTextureRect(rPosAry, false/*bInverted*/, x1, x2, y1, y2);
GetTextureRect(rPosAry, x1, x2, y1, y2);
rCoords.insert(rCoords.end(), {
x1, y1, x2, y1, x1, y2,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment