summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-16 11:14:05 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-03-16 10:27:43 +0000
commitf958db475d19ac60f39616e075717c2fe3ee4839 (patch)
tree2665b94e4302d9853e4913a7e82a3f35017786f4 /unotools
parente41d23abb03a0c5a5c50be290c2265513e178889 (diff)
loplugin:constantparam in unotools/
Change-Id: I016cf96af3a93c8f2114657a7e59599f68446ddc Reviewed-on: https://gerrit.libreoffice.org/23296 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/configvaluecontainer.cxx12
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx9
-rw-r--r--unotools/source/i18n/textsearch.cxx6
-rw-r--r--unotools/source/misc/atom.cxx14
-rw-r--r--unotools/source/misc/fontcvt.cxx11
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx6
6 files changed, 22 insertions, 36 deletions
diff --git a/unotools/source/config/configvaluecontainer.cxx b/unotools/source/config/configvaluecontainer.cxx
index 7ec71c5e5e5b..7880722fb3d1 100644
--- a/unotools/source/config/configvaluecontainer.cxx
+++ b/unotools/source/config/configvaluecontainer.cxx
@@ -212,10 +212,10 @@ namespace utl
OConfigurationValueContainer::OConfigurationValueContainer(
const Reference< XComponentContext >& _rxORB, ::osl::Mutex& _rAccessSafety,
- const sal_Char* _pConfigLocation, const CVCFlags _nAccessFlags, const sal_Int32 _nLevels )
+ const sal_Char* _pConfigLocation, const sal_Int32 _nLevels )
:m_pImpl( new OConfigurationValueContainerImpl( _rxORB, _rAccessSafety ) )
{
- implConstruct( OUString::createFromAscii( _pConfigLocation ), _nAccessFlags, _nLevels );
+ implConstruct( OUString::createFromAscii( _pConfigLocation ), CVCFlags::UPDATE_ACCESS, _nLevels );
}
OConfigurationValueContainer::~OConfigurationValueContainer()
@@ -274,7 +274,7 @@ namespace utl
);
}
- void OConfigurationValueContainer::write( bool _bCommit )
+ void OConfigurationValueContainer::write()
{
// collect the current values in the exchange locations
std::for_each(
@@ -282,17 +282,13 @@ namespace utl
m_pImpl->aAccessors.end(),
UpdateToConfig( m_pImpl->aConfigRoot, m_pImpl->rMutex )
);
-
- // commit the changes done (if requested)
- if ( _bCommit )
- commit( false );
}
void OConfigurationValueContainer::commit( bool _bWrite )
{
// write the current values in the exchange locations (if requested)
if ( _bWrite )
- write( false );
+ write();
// commit the changes done
m_pImpl->aConfigRoot.commit( );
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 6a9ec1cc17fa..76cae71cfe20 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -1361,8 +1361,7 @@ OUString LocaleDataWrapper::getTime( const tools::Time& rTime, bool bSec, bool b
}
OUString LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& rCal,
- sal_Int16 nDisplayDayOfWeek, bool bDayOfMonthWithLeadingZero,
- sal_Int16 nDisplayMonth, bool bTwoDigitYear ) const
+ bool bTwoDigitYear ) const
{
::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical );
using namespace css::i18n;
@@ -1373,15 +1372,15 @@ OUString LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& rCa
rCal.setGregorianDateTime( rDate );
// day of week
nVal = rCal.getValue( CalendarFieldIndex::DAY_OF_WEEK );
- aStr += rCal.getDisplayName( CalendarDisplayIndex::DAY, nVal, nDisplayDayOfWeek );
+ aStr += rCal.getDisplayName( CalendarDisplayIndex::DAY, nVal, 1 );
aStr += getLongDateDayOfWeekSep();
// day of month
nVal = rCal.getValue( CalendarFieldIndex::DAY_OF_MONTH );
- pBuf = ImplAdd2UNum( aBuf, nVal, bDayOfMonthWithLeadingZero );
+ pBuf = ImplAdd2UNum( aBuf, nVal, false/*bDayOfMonthWithLeadingZero*/ );
OUString aDay(aBuf, pBuf-aBuf);
// month of year
nVal = rCal.getValue( CalendarFieldIndex::MONTH );
- OUString aMonth( rCal.getDisplayName( CalendarDisplayIndex::MONTH, nVal, nDisplayMonth ) );
+ OUString aMonth( rCal.getDisplayName( CalendarDisplayIndex::MONTH, nVal, 1 ) );
// year
nVal = rCal.getValue( CalendarFieldIndex::YEAR );
if ( bTwoDigitYear )
diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx
index 7e0d5a4ae3a8..f61ad1841039 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -40,8 +40,6 @@ namespace utl
SearchParam::SearchParam( const OUString &rText,
SearchType eType,
bool bCaseSensitive,
- bool bWrdOnly,
- bool bSearchInSel,
sal_uInt32 cWildEscChar,
bool bWildMatchSel )
{
@@ -50,8 +48,8 @@ SearchParam::SearchParam( const OUString &rText,
m_cWildEscChar = cWildEscChar;
- m_bWordOnly = bWrdOnly;
- m_bSrchInSel = bSearchInSel;
+ m_bWordOnly = false;
+ m_bSrchInSel = false;
m_bCaseSense = bCaseSensitive;
m_bWildMatchSel = bWildMatchSel;
diff --git a/unotools/source/misc/atom.cxx b/unotools/source/misc/atom.cxx
index 85ddad4d23a9..3ea665037357 100644
--- a/unotools/source/misc/atom.cxx
+++ b/unotools/source/misc/atom.cxx
@@ -63,20 +63,16 @@ MultiAtomProvider::~MultiAtomProvider()
delete it->second;
}
-int MultiAtomProvider::getAtom( int atomClass, const OUString& rString, bool bCreate )
+int MultiAtomProvider::getAtom( int atomClass, const OUString& rString )
{
std::unordered_map<int, AtomProvider*>::iterator it =
m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
- return it->second->getAtom( rString, bCreate );
+ return it->second->getAtom( rString, true/*bCreate*/ );
- if( bCreate )
- {
- AtomProvider* pNewClass;
- m_aAtomLists[ atomClass ] = pNewClass = new AtomProvider();
- return pNewClass->getAtom( rString, bCreate );
- }
- return INVALID_ATOM;
+ AtomProvider* pNewClass;
+ m_aAtomLists[ atomClass ] = pNewClass = new AtomProvider();
+ return pNewClass->getAtom( rString, true/*bCreate*/ );
}
const OUString& MultiAtomProvider::getString( int atomClass, int atom ) const
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index 9188293474d3..7b7f255ce353 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -1032,7 +1032,7 @@ class StarSymbolToMSMultiFontImpl : public StarSymbolToMSMultiFont
private:
::std::multimap<sal_Unicode, SymbolEntry> maMagicMap;
public:
- explicit StarSymbolToMSMultiFontImpl(bool bPerfectOnly);
+ explicit StarSymbolToMSMultiFontImpl();
OUString ConvertChar(sal_Unicode &rChar) override;
};
@@ -1123,7 +1123,7 @@ ExtraTable aTNRExtraTab[] =
{0xe0a9, '\\'}
};
-StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl(bool bPerfectOnly)
+StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl()
{
struct ConvertTable
{
@@ -1185,10 +1185,7 @@ StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl(bool bPerfectOnly)
};
//Allow extra conversions that are not perfect, but "good enough"
- if (!bPerfectOnly)
- nEntries = SAL_N_ELEMENTS(aAgressiveTable);
- else
- nEntries = 1;
+ nEntries = SAL_N_ELEMENTS(aAgressiveTable);
for (i = 0; i < nEntries; ++i)
{
@@ -1240,7 +1237,7 @@ OUString StarSymbolToMSMultiFontImpl::ConvertChar(sal_Unicode &rChar)
StarSymbolToMSMultiFont *CreateStarSymbolToMSMultiFont()
{
- return new StarSymbolToMSMultiFontImpl(false/*bPerfectOnly*/);
+ return new StarSymbolToMSMultiFontImpl;
}
sal_Unicode ConvertChar::RecodeChar( sal_Unicode cChar ) const
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index c2534f671ff7..a3b909cc4f45 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -328,13 +328,13 @@ TempFile::TempFile( const OUString* pParent, bool bDirectory )
aName = CreateTempName_Impl( pParent, true, bDirectory );
}
-TempFile::TempFile( const OUString& rLeadingChars, bool _bStartWithZero, const OUString* pExtension, const OUString* pParent, bool bDirectory)
+TempFile::TempFile( const OUString& rLeadingChars, bool _bStartWithZero, const OUString* pExtension, const OUString* pParent)
: pStream( nullptr )
- , bIsDirectory( bDirectory )
+ , bIsDirectory( false )
, bKillingFileEnabled( false )
{
SequentialTokens t(_bStartWithZero);
- aName = lcl_createName(rLeadingChars, t, pExtension, pParent, bDirectory, true, true);
+ aName = lcl_createName(rLeadingChars, t, pExtension, pParent, false/*bDirectory*/, true, true);
}
TempFile::~TempFile()