loplugin:constantparam
Change-Id: I86592be0717c062a918108bf4437074b0f70b372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132029 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
parent
86fac2109d
commit
ceb8f5d62c
16 changed files with 47 additions and 73 deletions
|
@ -2828,9 +2828,9 @@ css::lang::Locale LanguageTag::convertToLocaleWithFallback( const OUString& rBcp
|
|||
|
||||
|
||||
// static
|
||||
LanguageType LanguageTag::convertToLanguageTypeWithFallback( const css::lang::Locale& rLocale, bool bResolveSystem )
|
||||
LanguageType LanguageTag::convertToLanguageTypeWithFallback( const css::lang::Locale& rLocale )
|
||||
{
|
||||
if (rLocale.Language.isEmpty() && !bResolveSystem)
|
||||
if (rLocale.Language.isEmpty())
|
||||
return LANGUAGE_SYSTEM;
|
||||
|
||||
return LanguageTag( rLocale).makeFallback().getLanguageType();
|
||||
|
|
|
@ -510,13 +510,10 @@ public:
|
|||
|
||||
/** Convert Locale to MS-LangID with fallback.
|
||||
|
||||
@param bResolveSystem
|
||||
If TRUE, resolve an empty language tag denoting the system
|
||||
locale to the real locale used and fallback.
|
||||
If FALSE, return LANGUAGE_SYSTEM for such a tag and do not fallback.
|
||||
Resolves an empty language tag denoting the system
|
||||
locale to LANGUAGE_SYSTEM and does not fallback.
|
||||
*/
|
||||
static LanguageType convertToLanguageTypeWithFallback( const css::lang::Locale& rLocale,
|
||||
bool bResolveSystem = true );
|
||||
static LanguageType convertToLanguageTypeWithFallback( const css::lang::Locale& rLocale );
|
||||
|
||||
/** If rString represents a valid BCP 47 language tag.
|
||||
|
||||
|
|
|
@ -39,14 +39,14 @@ class VCL_DLLPUBLIC TaskStopwatch
|
|||
bool m_bConsiderLastIterTime;
|
||||
VclInputFlags m_eInputStop;
|
||||
|
||||
bool nextIter(bool bQueryOnly)
|
||||
bool nextIter()
|
||||
{
|
||||
sal_uInt64 nCurTicks = tools::Time::GetSystemTicks();
|
||||
// handle system ticks wrap as exceeded time slice
|
||||
if (nCurTicks < m_nStartTicks)
|
||||
return false;
|
||||
|
||||
if (!bQueryOnly && m_bConsiderLastIterTime)
|
||||
if (m_bConsiderLastIterTime)
|
||||
{
|
||||
// based on the last iter runtime, we don't expect to finish in time
|
||||
// m_nTimeSlice < (nCurTicks - m_nStartTicks) + (nCurTicks - m_nIterStartTicks)
|
||||
|
@ -57,8 +57,7 @@ class VCL_DLLPUBLIC TaskStopwatch
|
|||
else if (m_nTimeSlice < nCurTicks - m_nStartTicks)
|
||||
return false;
|
||||
|
||||
if (!bQueryOnly)
|
||||
m_nIterStartTicks = nCurTicks;
|
||||
m_nIterStartTicks = nCurTicks;
|
||||
|
||||
return !Application::AnyInput(m_eInputStop);
|
||||
}
|
||||
|
@ -84,7 +83,7 @@ public:
|
|||
/**
|
||||
* Returns true, if another iteration will probably pass in the time slot
|
||||
**/
|
||||
bool continueIter() { return nextIter(false); }
|
||||
bool continueIter() { return nextIter(); }
|
||||
|
||||
/**
|
||||
* Reset the stopwatch
|
||||
|
|
|
@ -289,7 +289,7 @@ public:
|
|||
bool IsMenuVisible() const;
|
||||
virtual bool IsMenuBar() const = 0;
|
||||
|
||||
void RemoveDisabledEntries( bool bCheckPopups = true, bool bRemoveEmptyPopups = false );
|
||||
void RemoveDisabledEntries( bool bRemoveEmptyPopups = false );
|
||||
|
||||
void UpdateNativeMenu();
|
||||
|
||||
|
|
|
@ -1699,7 +1699,7 @@ void StyleList::Update()
|
|||
// other DocShell -> all new
|
||||
m_pParentDialog->CheckItem(OString::number(m_nActFamily));
|
||||
m_nActFilter = static_cast<sal_uInt16>(m_aLoadFactoryStyleFilter.Call(pDocShell));
|
||||
m_pParentDialog->IsUpdate(true, *this);
|
||||
m_pParentDialog->IsUpdate(*this);
|
||||
if (0xffff == m_nActFilter)
|
||||
{
|
||||
m_nActFilter = pDocShell->GetAutoStyleFilterIndex();
|
||||
|
|
|
@ -494,17 +494,14 @@ void SfxCommonTemplateDialog_Impl::FilterSelect(
|
|||
m_aStyleList.FilterSelect(nActFilter, true);
|
||||
}
|
||||
|
||||
void SfxCommonTemplateDialog_Impl::IsUpdate(bool bDoUpdate, StyleList&)
|
||||
void SfxCommonTemplateDialog_Impl::IsUpdate(StyleList&)
|
||||
{
|
||||
SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
|
||||
SfxObjectShell* pDocShell = pViewFrame->GetObjectShell();
|
||||
if (bDoUpdate)
|
||||
nActFilter = static_cast<sal_uInt16>(LoadFactoryStyleFilter_Hdl(pDocShell));
|
||||
if (0xffff == nActFilter)
|
||||
{
|
||||
nActFilter = static_cast<sal_uInt16>(LoadFactoryStyleFilter_Hdl(pDocShell));
|
||||
if (0xffff == nActFilter)
|
||||
{
|
||||
nActFilter = pDocShell->GetAutoStyleFilterIndex();
|
||||
}
|
||||
nActFilter = pDocShell->GetAutoStyleFilterIndex();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ public:
|
|||
void SelectStyle(const OUString& rStyle, bool bIsCallback, StyleList& rStyleList);
|
||||
|
||||
//When a new document is created, it comes into action
|
||||
void IsUpdate(bool bDoUpdate, StyleList&);
|
||||
void IsUpdate(StyleList&);
|
||||
|
||||
// This function return the value of bUpdate in Stylelist
|
||||
// This value is used in StyleList's Notify
|
||||
|
|
|
@ -112,7 +112,7 @@ public:
|
|||
|
||||
ESelection GetSelection() const;
|
||||
void SetSelection(const ESelection& rSel);
|
||||
void UpdateStatus(bool bSetDocModified);
|
||||
void UpdateStatus();
|
||||
|
||||
bool IsEmpty() const;
|
||||
bool IsSelected() const;
|
||||
|
|
|
@ -181,7 +181,7 @@ SmPrintOptionsTabPage::SmPrintOptionsTabPage(weld::Container* pPage, weld::Dialo
|
|||
|
||||
SmPrintOptionsTabPage::~SmPrintOptionsTabPage()
|
||||
{
|
||||
SmGetActiveView()->GetEditWindow()->UpdateStatus(false);
|
||||
SmGetActiveView()->GetEditWindow()->UpdateStatus();
|
||||
}
|
||||
|
||||
bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet)
|
||||
|
@ -204,7 +204,7 @@ bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet)
|
|||
rSet->Put(SfxBoolItem(SID_AUTO_CLOSE_BRACKETS, m_xAutoCloseBrackets->get_active()));
|
||||
rSet->Put(SfxUInt16Item(SID_SMEDITWINDOWZOOM, sal::static_int_cast<sal_uInt16>(m_xSmZoom->get_value(FieldUnit::PERCENT))));
|
||||
|
||||
SmGetActiveView()->GetEditWindow()->UpdateStatus(false);
|
||||
SmGetActiveView()->GetEditWindow()->UpdateStatus();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -715,9 +715,9 @@ void SmEditTextWindow::UpdateStatus(bool bSetDocModified)
|
|||
static_cast<SmEditEngine*>(GetEditEngine())->executeZoom(GetEditView());
|
||||
}
|
||||
|
||||
void SmEditWindow::UpdateStatus(bool bSetDocModified)
|
||||
void SmEditWindow::UpdateStatus()
|
||||
{
|
||||
mxTextControl->UpdateStatus(bSetDocModified);
|
||||
mxTextControl->UpdateStatus(/*bSetDocModified*/false);
|
||||
}
|
||||
|
||||
void SmEditWindow::Cut()
|
||||
|
|
|
@ -88,7 +88,7 @@ class SvAddressParser_Impl
|
|||
bool readToken();
|
||||
|
||||
static OUString reparse(sal_Unicode const * pBegin,
|
||||
sal_Unicode const * pEnd, bool bAddrSpec);
|
||||
sal_Unicode const * pEnd);
|
||||
|
||||
public:
|
||||
SvAddressParser_Impl(SvAddressParser * pParser, const OUString& rIn);
|
||||
|
@ -245,12 +245,11 @@ bool SvAddressParser_Impl::readToken()
|
|||
|
||||
// static
|
||||
OUString SvAddressParser_Impl::reparse(sal_Unicode const * pBegin,
|
||||
sal_Unicode const * pEnd, bool bAddrSpec)
|
||||
sal_Unicode const * pEnd)
|
||||
{
|
||||
OUStringBuffer aResult;
|
||||
TokenType eMode = TOKEN_ATOM;
|
||||
bool bEscaped = false;
|
||||
bool bEndsWithSpace = false;
|
||||
int nLevel = 0;
|
||||
while (pBegin < pEnd)
|
||||
{
|
||||
|
@ -265,14 +264,12 @@ OUString SvAddressParser_Impl::reparse(sal_Unicode const * pBegin,
|
|||
}
|
||||
else if (cChar == '"')
|
||||
{
|
||||
if (bAddrSpec)
|
||||
aResult.append(cChar);
|
||||
aResult.append(cChar);
|
||||
eMode = TOKEN_ATOM;
|
||||
}
|
||||
else if (cChar == '\\')
|
||||
{
|
||||
if (bAddrSpec)
|
||||
aResult.append(cChar);
|
||||
aResult.append(cChar);
|
||||
bEscaped = true;
|
||||
}
|
||||
else
|
||||
|
@ -292,8 +289,7 @@ OUString SvAddressParser_Impl::reparse(sal_Unicode const * pBegin,
|
|||
}
|
||||
else if (cChar == '\\')
|
||||
{
|
||||
if (bAddrSpec)
|
||||
aResult.append(cChar);
|
||||
aResult.append(cChar);
|
||||
bEscaped = true;
|
||||
}
|
||||
else
|
||||
|
@ -317,28 +313,16 @@ OUString SvAddressParser_Impl::reparse(sal_Unicode const * pBegin,
|
|||
case TOKEN_ATOM:
|
||||
if (cChar <= ' ' || cChar == 0x7F) // DEL
|
||||
{
|
||||
if (!bAddrSpec && !bEndsWithSpace)
|
||||
{
|
||||
aResult.append(' ');
|
||||
bEndsWithSpace = true;
|
||||
}
|
||||
}
|
||||
else if (cChar == '(')
|
||||
{
|
||||
if (!bAddrSpec && !bEndsWithSpace)
|
||||
{
|
||||
aResult.append(' ');
|
||||
bEndsWithSpace = true;
|
||||
}
|
||||
eMode = TOKEN_COMMENT;
|
||||
}
|
||||
else
|
||||
{
|
||||
bEndsWithSpace = false;
|
||||
if (cChar == '"')
|
||||
{
|
||||
if (bAddrSpec)
|
||||
aResult.append(cChar);
|
||||
aResult.append(cChar);
|
||||
eMode = TOKEN_QUOTED;
|
||||
}
|
||||
else if (cChar == '[')
|
||||
|
@ -502,7 +486,7 @@ SvAddressParser_Impl::SvAddressParser_Impl(SvAddressParser * pParser,
|
|||
{
|
||||
OUString aTheAddrSpec;
|
||||
if (m_pAddrSpec->m_bReparse)
|
||||
aTheAddrSpec = reparse(m_pAddrSpec->m_pBegin, m_pAddrSpec->m_pEnd, true);
|
||||
aTheAddrSpec = reparse(m_pAddrSpec->m_pBegin, m_pAddrSpec->m_pEnd);
|
||||
else
|
||||
{
|
||||
sal_Int32 nLen = m_pAddrSpec->m_pEnd - m_pAddrSpec->m_pBegin;
|
||||
|
|
|
@ -97,7 +97,7 @@ static const SfxItemPropertyMapEntry* lcl_GetNumberSettingsPropertyMap()
|
|||
|
||||
static LanguageType lcl_GetLanguage( const lang::Locale& rLocale )
|
||||
{
|
||||
LanguageType eRet = LanguageTag::convertToLanguageTypeWithFallback( rLocale, false);
|
||||
LanguageType eRet = LanguageTag::convertToLanguageTypeWithFallback( rLocale );
|
||||
if ( eRet == LANGUAGE_NONE )
|
||||
eRet = LANGUAGE_SYSTEM; //! or throw an exception?
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ SwReadOnlyPopup::SwReadOnlyPopup(const Point &rDPos, SwView &rV)
|
|||
}
|
||||
Check(m_nReadonlyFullscreen, SID_WIN_FULLSCREEN, rDis);
|
||||
|
||||
m_xMenu->RemoveDisabledEntries( true, true );
|
||||
m_xMenu->RemoveDisabledEntries( true );
|
||||
}
|
||||
|
||||
void SwReadOnlyPopup::Execute( vcl::Window* pWin, const Point &rPixPos )
|
||||
|
|
|
@ -398,7 +398,7 @@ SwSpellPopup::SwSpellPopup(
|
|||
vcl::CommandInfoProvider::GetImageForCommand(".uno:SpellingAndGrammarDialog", xFrame));
|
||||
|
||||
checkRedline();
|
||||
m_xPopupMenu->RemoveDisabledEntries( true, true );
|
||||
m_xPopupMenu->RemoveDisabledEntries( true );
|
||||
|
||||
InitItemCommands(aSuggestions);
|
||||
}
|
||||
|
@ -555,7 +555,7 @@ SwSpellPopup::SwSpellPopup(
|
|||
vcl::CommandInfoProvider::GetImageForCommand(".uno:SpellingAndGrammarDialog", xFrame));
|
||||
|
||||
checkRedline();
|
||||
m_xPopupMenu->RemoveDisabledEntries(true, true);
|
||||
m_xPopupMenu->RemoveDisabledEntries(true);
|
||||
|
||||
SvtLinguConfig().SetProperty( UPN_IS_GRAMMAR_INTERACTIVE, uno::makeAny( true ));
|
||||
|
||||
|
|
|
@ -972,16 +972,13 @@ static void ImplAddNum( OUStringBuffer& rBuf, sal_Int64 nNumber, int nMinLen )
|
|||
return ImplAddUNum( rBuf, nNumber, nMinLen);
|
||||
}
|
||||
|
||||
static void ImplAdd2UNum( OUStringBuffer& rBuf, sal_uInt16 nNumber, bool bLeading )
|
||||
static void ImplAdd2UNum( OUStringBuffer& rBuf, sal_uInt16 nNumber )
|
||||
{
|
||||
DBG_ASSERT( nNumber < 100, "ImplAdd2UNum() - Number >= 100" );
|
||||
|
||||
if ( nNumber < 10 )
|
||||
{
|
||||
if ( bLeading )
|
||||
{
|
||||
rBuf.append('0');
|
||||
}
|
||||
rBuf.append('0');
|
||||
rBuf.append(static_cast<char>(nNumber + '0'));
|
||||
}
|
||||
else
|
||||
|
@ -1124,25 +1121,25 @@ OUString LocaleDataWrapper::getDate( const Date& rDate ) const
|
|||
switch ( getDateOrder() )
|
||||
{
|
||||
case DateOrder::DMY :
|
||||
ImplAdd2UNum( aBuf, nDay, true /* IsDateDayLeadingZero() */ );
|
||||
ImplAdd2UNum( aBuf, nDay );
|
||||
aBuf.append( aLocaleDataItem.dateSeparator );
|
||||
ImplAdd2UNum( aBuf, nMonth, true /* IsDateMonthLeadingZero() */ );
|
||||
ImplAdd2UNum( aBuf, nMonth );
|
||||
aBuf.append( aLocaleDataItem.dateSeparator );
|
||||
ImplAddNum( aBuf, nYear, nYearLen );
|
||||
break;
|
||||
case DateOrder::MDY :
|
||||
ImplAdd2UNum( aBuf, nMonth, true /* IsDateMonthLeadingZero() */ );
|
||||
ImplAdd2UNum( aBuf, nMonth );
|
||||
aBuf.append( aLocaleDataItem.dateSeparator );
|
||||
ImplAdd2UNum( aBuf, nDay, true /* IsDateDayLeadingZero() */ );
|
||||
ImplAdd2UNum( aBuf, nDay );
|
||||
aBuf.append( aLocaleDataItem.dateSeparator );
|
||||
ImplAddNum( aBuf, nYear, nYearLen );
|
||||
break;
|
||||
default:
|
||||
ImplAddNum( aBuf, nYear, nYearLen );
|
||||
aBuf.append( aLocaleDataItem.dateSeparator );
|
||||
ImplAdd2UNum( aBuf, nMonth, true /* IsDateMonthLeadingZero() */ );
|
||||
ImplAdd2UNum( aBuf, nMonth );
|
||||
aBuf.append( aLocaleDataItem.dateSeparator );
|
||||
ImplAdd2UNum( aBuf, nDay, true /* IsDateDayLeadingZero() */ );
|
||||
ImplAdd2UNum( aBuf, nDay );
|
||||
}
|
||||
|
||||
return aBuf.makeStringAndClear();
|
||||
|
@ -1156,13 +1153,13 @@ OUString LocaleDataWrapper::getTime( const tools::Time& rTime, bool bSec, bool b
|
|||
|
||||
nHour %= 24;
|
||||
|
||||
ImplAdd2UNum( aBuf, nHour, true /* IsTimeLeadingZero() */ );
|
||||
ImplAdd2UNum( aBuf, nHour );
|
||||
aBuf.append( aLocaleDataItem.timeSeparator );
|
||||
ImplAdd2UNum( aBuf, rTime.GetMin(), true );
|
||||
ImplAdd2UNum( aBuf, rTime.GetMin() );
|
||||
if ( bSec )
|
||||
{
|
||||
aBuf.append( aLocaleDataItem.timeSeparator );
|
||||
ImplAdd2UNum( aBuf, rTime.GetSec(), true );
|
||||
ImplAdd2UNum( aBuf, rTime.GetSec() );
|
||||
|
||||
if ( b100Sec )
|
||||
{
|
||||
|
@ -1186,11 +1183,11 @@ OUString LocaleDataWrapper::getDuration( const tools::Time& rTime, bool bSec, bo
|
|||
else
|
||||
ImplAddUNum( aBuf, rTime.GetHour() );
|
||||
aBuf.append( aLocaleDataItem.timeSeparator );
|
||||
ImplAdd2UNum( aBuf, rTime.GetMin(), true );
|
||||
ImplAdd2UNum( aBuf, rTime.GetMin() );
|
||||
if ( bSec )
|
||||
{
|
||||
aBuf.append( aLocaleDataItem.timeSeparator );
|
||||
ImplAdd2UNum( aBuf, rTime.GetSec(), true );
|
||||
ImplAdd2UNum( aBuf, rTime.GetSec() );
|
||||
|
||||
if ( b100Sec )
|
||||
{
|
||||
|
|
|
@ -2139,7 +2139,7 @@ Menu* Menu::ImplFindMenu( sal_uInt16 nItemId )
|
|||
return pSelMenu;
|
||||
}
|
||||
|
||||
void Menu::RemoveDisabledEntries( bool bCheckPopups, bool bRemoveEmptyPopups )
|
||||
void Menu::RemoveDisabledEntries( bool bRemoveEmptyPopups )
|
||||
{
|
||||
for ( sal_uInt16 n = 0; n < GetItemCount(); n++ )
|
||||
{
|
||||
|
@ -2153,7 +2153,7 @@ void Menu::RemoveDisabledEntries( bool bCheckPopups, bool bRemoveEmptyPopups )
|
|||
else
|
||||
bRemove = !pItem->bEnabled;
|
||||
|
||||
if ( bCheckPopups && pItem->pSubMenu )
|
||||
if ( pItem->pSubMenu )
|
||||
{
|
||||
pItem->pSubMenu->RemoveDisabledEntries();
|
||||
if ( bRemoveEmptyPopups && !pItem->pSubMenu->GetItemCount() )
|
||||
|
|
Loading…
Reference in a new issue