[Libreoffice-commits] core.git: 2 commits - formula/source fpicker/source framework/source helpcompiler/source hwpfilter/source i18nlangtag/qa i18npool/qa i18npool/source i18nutil/source idlc/source io/source jvmfwk/plugins
Noel Grandin
noel.grandin at collabora.co.uk
Sun Jun 25 15:19:45 UTC 2017
formula/source/ui/dlg/formula.cxx | 3 -
fpicker/source/office/RemoteFilesDialog.cxx | 4 --
framework/source/accelerators/acceleratorconfiguration.cxx | 3 -
framework/source/dispatch/closedispatcher.cxx | 3 -
framework/source/dispatch/popupmenudispatcher.cxx | 3 -
framework/source/fwe/helper/titlehelper.cxx | 3 -
framework/source/fwe/xml/statusbardocumenthandler.cxx | 12 ++-----
framework/source/fwe/xml/toolboxdocumenthandler.cxx | 12 ++-----
framework/source/fwe/xml/xmlnamespaces.cxx | 3 -
framework/source/helper/oframes.cxx | 2 -
framework/source/helper/persistentwindowstate.cxx | 2 -
framework/source/jobs/shelljob.cxx | 3 -
framework/source/layoutmanager/layoutmanager.cxx | 6 +--
framework/source/layoutmanager/toolbarlayoutmanager.cxx | 9 +----
framework/source/services/autorecovery.cxx | 7 +---
framework/source/services/substitutepathvars.cxx | 6 +--
framework/source/uielement/comboboxtoolbarcontroller.cxx | 3 -
framework/source/uielement/dropdownboxtoolbarcontroller.cxx | 3 -
framework/source/uielement/menubarmanager.cxx | 3 -
framework/source/uielement/toolbarmanager.cxx | 3 -
framework/source/uielement/toolbarsmenucontroller.cxx | 3 -
helpcompiler/source/HelpCompiler.cxx | 3 -
helpcompiler/source/HelpLinker.cxx | 2 -
hwpfilter/source/hwpreader.cxx | 8 ++---
i18nlangtag/qa/cppunit/test_languagetag.cxx | 19 +++++-------
i18npool/qa/cppunit/test_breakiterator.cxx | 2 -
i18npool/qa/cppunit/test_textsearch.cxx | 6 +--
i18npool/source/calendar/calendar_hijri.cxx | 8 ++---
i18npool/source/localedata/LocaleNode.cxx | 8 ++---
i18nutil/source/utility/paper.cxx | 2 -
i18nutil/source/utility/widthfolding.cxx | 6 +--
idlc/source/astoperation.cxx | 3 -
idlc/source/idlccompile.cxx | 4 +-
io/source/TextInputStream/TextInputStream.cxx | 6 +--
io/source/TextOutputStream/TextOutputStream.cxx | 3 -
jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx | 10 +++---
36 files changed, 74 insertions(+), 112 deletions(-)
New commits:
commit a006f60b6ae22db6acb57d06167a3c6fd8bc6f1b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Jun 23 16:04:59 2017 +0200
loplugin:oncevar in helpcompiler..jvmfwk
Change-Id: Ia9b20a8ca95684cbeb21e3425972c43ba50df3cd
Reviewed-on: https://gerrit.libreoffice.org/39187
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx
index eb1c54830ffe..92856d04cf93 100644
--- a/helpcompiler/source/HelpCompiler.cxx
+++ b/helpcompiler/source/HelpCompiler.cxx
@@ -490,8 +490,7 @@ bool HelpCompiler::compile()
{
if (fileName.compare(0, 6, "/text/") == 0)
{
- int len = strlen("/text/");
- actMod = fileName.substr(len);
+ actMod = fileName.substr(strlen("/text/"));
actMod = actMod.substr(0, actMod.find('/'));
}
}
diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx
index d2e3080ca102..1f71635e174e 100644
--- a/helpcompiler/source/HelpLinker.cxx
+++ b/helpcompiler/source/HelpLinker.cxx
@@ -151,7 +151,7 @@ void writeKeyValue_DBHelp( FILE* pFile, const std::string& aKeyStr, const std::s
{
if( pFile == nullptr )
return;
- char cLF = 10;
+ char const cLF = 10;
unsigned int nKeyLen = aKeyStr.length();
unsigned int nValueLen = aValueStr.length();
fprintf( pFile, "%x ", nKeyLen );
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 8a6b6d7e794a..675f2222fcc4 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -122,11 +122,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportHWP(SvStream &rStream)
{
std::unique_ptr<HStream> stream(new HStream);
byte aData[32768];
- std::size_t nRead, nBlock = 32768;
+ std::size_t nRead;
while (true)
{
- nRead = rStream.ReadBytes(aData, nBlock);
+ nRead = rStream.ReadBytes(aData, 32768);
if (nRead == 0)
break;
stream->addData(aData, (int)nRead);
@@ -153,10 +153,10 @@ sal_Bool HwpReader::filter(const Sequence< PropertyValue >& rDescriptor)
std::unique_ptr<HStream> stream(new HStream);
Sequence < sal_Int8 > aBuffer;
- sal_Int32 nRead, nBlock = 32768, nTotal = 0;
+ sal_Int32 nRead, nTotal = 0;
while( true )
{
- nRead = xInputStream->readBytes(aBuffer, nBlock);
+ nRead = xInputStream->readBytes(aBuffer, 32768);
if( nRead == 0 )
break;
stream->addData( reinterpret_cast<const byte *>(aBuffer.getConstArray()), nRead );
diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx b/i18nlangtag/qa/cppunit/test_languagetag.cxx
index e2a1cf72a955..cef9011a95fd 100644
--- a/i18nlangtag/qa/cppunit/test_languagetag.cxx
+++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx
@@ -45,7 +45,7 @@ public:
void TestLanguageTag::testAllTags()
{
{
- OUString s_de_Latn_DE( "de-Latn-DE" );
+ OUString const s_de_Latn_DE( "de-Latn-DE" );
LanguageTag de_DE( s_de_Latn_DE, true );
OUString aBcp47 = de_DE.getBcp47();
lang::Locale aLocale = de_DE.getLocale();
@@ -63,7 +63,7 @@ void TestLanguageTag::testAllTags()
}
{
- OUString s_klingon( "i-klingon" );
+ OUString const s_klingon( "i-klingon" );
LanguageTag klingon( s_klingon, true );
lang::Locale aLocale = klingon.getLocale();
CPPUNIT_ASSERT_EQUAL( OUString("tlh"), klingon.getBcp47() );
@@ -143,7 +143,7 @@ void TestLanguageTag::testAllTags()
// 'sh-RS' has an internal override to 'sr-Latn-RS'
{
- OUString s_sh_RS( "sh-RS" );
+ OUString const s_sh_RS( "sh-RS" );
LanguageTag sh_RS( s_sh_RS, true );
lang::Locale aLocale = sh_RS.getLocale();
CPPUNIT_ASSERT_EQUAL( OUString("sr-Latn-RS"), sh_RS.getBcp47() );
@@ -175,7 +175,7 @@ void TestLanguageTag::testAllTags()
// known LangID with an override and canonicalization should work the same
// without liblangtag.
{
- OUString s_bs_Latn_BA( "bs-Latn-BA" );
+ OUString const s_bs_Latn_BA( "bs-Latn-BA" );
LanguageTag bs_Latn_BA( s_bs_Latn_BA, true );
lang::Locale aLocale = bs_Latn_BA.getLocale();
CPPUNIT_ASSERT_EQUAL( OUString("bs-BA"), bs_Latn_BA.getBcp47() );
@@ -250,7 +250,7 @@ void TestLanguageTag::testAllTags()
// 'ca-XV' has an internal override to 'ca-ES-valencia'
{
- OUString s_ca_XV( "ca-XV" );
+ OUString const s_ca_XV( "ca-XV" );
OUString s_ca_ES_valencia( "ca-ES-valencia" );
LanguageTag ca_XV( s_ca_XV, true );
lang::Locale aLocale = ca_XV.getLocale();
@@ -300,7 +300,7 @@ void TestLanguageTag::testAllTags()
}
{
- OUString s_de_DE( "de-DE" );
+ OUString const s_de_DE( "de-DE" );
LanguageTag de_DE( lang::Locale( "de", "DE", "" ) );
lang::Locale aLocale = de_DE.getLocale();
CPPUNIT_ASSERT_EQUAL( s_de_DE, de_DE.getBcp47() );
@@ -311,7 +311,7 @@ void TestLanguageTag::testAllTags()
}
{
- OUString s_de_DE( "de-DE" );
+ OUString const s_de_DE( "de-DE" );
LanguageTag de_DE( LANGUAGE_GERMAN );
lang::Locale aLocale = de_DE.getLocale();
CPPUNIT_ASSERT_EQUAL( s_de_DE, de_DE.getBcp47() );
@@ -389,9 +389,8 @@ void TestLanguageTag::testAllTags()
// Deprecated as of 2015-04-17, prefer en-GB-oxendict instead.
// As of 2017-03-14 we also alias to en-GB-oxendict.
{
- OUString s_en_GB_oed( "en-GB-oed" );
OUString s_en_GB_oxendict( "en-GB-oxendict" );
- LanguageTag en_GB_oed( s_en_GB_oed );
+ LanguageTag en_GB_oed( "en-GB-oed" );
lang::Locale aLocale = en_GB_oed.getLocale();
CPPUNIT_ASSERT_EQUAL( s_en_GB_oxendict, en_GB_oed.getBcp47() );
CPPUNIT_ASSERT_EQUAL( OUString("qlt"), aLocale.Language );
@@ -493,7 +492,7 @@ void TestLanguageTag::testAllTags()
// 'qtx' is an unknown new mslangid
{
- OUString s_qtx( "qtx" );
+ OUString const s_qtx( "qtx" );
LanguageTag qtx( s_qtx );
qtx.setScriptType( LanguageTag::ScriptType::RTL );
LanguageType n_qtx = qtx.getLanguageType();
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index e18efe843029..8c5b377b3bd9 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -115,7 +115,7 @@ void TestBreakIterator::testLineBreaking()
//See https://bz.apache.org/ooo/show_bug.cgi?id=17155
{
- OUString aTest("foo /bar/baz");
+ OUString const aTest("foo /bar/baz");
aLocale.Language = "en";
aLocale.Country = "US";
diff --git a/i18npool/qa/cppunit/test_textsearch.cxx b/i18npool/qa/cppunit/test_textsearch.cxx
index 303af41db72e..be366aa71fdc 100644
--- a/i18npool/qa/cppunit/test_textsearch.cxx
+++ b/i18npool/qa/cppunit/test_textsearch.cxx
@@ -103,9 +103,9 @@ void TestTextSearch::testSearches()
{
OUString str( "acababaabcababadcdaa" );
sal_Int32 startPos = 2, endPos = 20 ;
- OUString searchStr( "(ab)*a(c|d)+" );
- sal_Int32 fStartRes = 10, fEndRes = 18 ;
- sal_Int32 bStartRes = 18, bEndRes = 10 ;
+ OUString const searchStr( "(ab)*a(c|d)+" );
+ sal_Int32 const fStartRes = 10, fEndRes = 18 ;
+ sal_Int32 const bStartRes = 18, bEndRes = 10 ;
// set options
util::SearchOptions aOptions;
diff --git a/i18npool/source/calendar/calendar_hijri.cxx b/i18npool/source/calendar/calendar_hijri.cxx
index 11046f8e9cbf..eeabf6d47472 100644
--- a/i18npool/source/calendar/calendar_hijri.cxx
+++ b/i18npool/source/calendar/calendar_hijri.cxx
@@ -316,12 +316,12 @@ Calendar_hijri::getJulianDay(sal_Int32 day, sal_Int32 month, sal_Int32 year)
sal_Int32 intgr = (sal_Int32)((sal_Int32)(365.25 * jy) + (sal_Int32)(30.6001 * jm) + day + 1720995 );
//check for switch to Gregorian calendar
- double gregcal = 15 + 31 * ( 10 + 12 * 1582 );
+ double const gregcal = 15 + 31 * ( 10 + 12 * 1582 );
if( day + 31 * (month + 12 * year) >= gregcal ) {
- double ja;
- ja = (sal_Int32)(0.01 * jy);
- intgr += (sal_Int32)(2 - ja + (sal_Int32)(0.25 * ja));
+ double ja;
+ ja = (sal_Int32)(0.01 * jy);
+ intgr += (sal_Int32)(2 - ja + (sal_Int32)(0.25 * ja));
}
return (double) intgr;
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 0fba9c6f5d99..c1c5aaa81e32 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -798,10 +798,10 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
if (strcmp( of.getLocale(), "en_US") != 0)
{
OUString aCode( n->getValue());
- OUString aPar1( "0)");
- OUString aPar2( "-)" );
- OUString aPar3( " )" );
- OUString aPar4( "])" );
+ OUString const aPar1( "0)");
+ OUString const aPar2( "-)" );
+ OUString const aPar3( " )" );
+ OUString const aPar4( "])" );
if (aCode.indexOf( aPar1 ) > 0 || aCode.indexOf( aPar2 ) > 0 ||
aCode.indexOf( aPar3 ) > 0 || aCode.indexOf( aPar4 ) > 0)
fprintf( stderr, "Warning: FormatCode formatindex=\"%d\" for currency uses parentheses for negative amounts, which probably is not correct for locales not based on en_US.\n", formatindex);
diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx
index 9d18618fd3a3..7ab91d089b3c 100644
--- a/i18nutil/source/utility/paper.cxx
+++ b/i18nutil/source/utility/paper.cxx
@@ -259,7 +259,7 @@ PaperInfo PaperInfo::getSystemDefaultPaper()
bool bHalve = false;
- size_t nExtraTabSize = SAL_N_ELEMENTS(aCustoms);
+ size_t const nExtraTabSize = SAL_N_ELEMENTS(aCustoms);
for (size_t i = 0; i < nExtraTabSize; ++i)
{
if (rtl_str_compareIgnoreAsciiCase(aCustoms[i].pName, aPaper.getStr()) == 0)
diff --git a/i18nutil/source/utility/widthfolding.cxx b/i18nutil/source/utility/widthfolding.cxx
index 3b948025e318..84963f54c922 100644
--- a/i18nutil/source/utility/widthfolding.cxx
+++ b/i18nutil/source/utility/widthfolding.cxx
@@ -252,9 +252,7 @@ oneToOneMapping& widthfolding::gethalf2fullTableForJIS()
//
// See the following page for detail:
// http://wiki.openoffice.org/wiki/Calc/Features/JIS_and_ASC_functions
- int i, j;
- int n = SAL_N_ELEMENTS(half2fullJISException);
- for( i = 0; i < n; i++ )
+ for( int i = 0; i < int(SAL_N_ELEMENTS(half2fullJISException)); i++ )
{
const int high = (half2fullJISException[i].first >> 8) & 0xFF;
const int low = (half2fullJISException[i].first) & 0xFF;
@@ -263,7 +261,7 @@ oneToOneMapping& widthfolding::gethalf2fullTableForJIS()
{
table.mpIndex[high] = new UnicodePairWithFlag*[256];
- for( j = 0; j < 256; j++ )
+ for( int j = 0; j < 256; j++ )
table.mpIndex[high][j] = nullptr;
}
table.mpIndex[high][low] = &half2fullJISException[i];
diff --git a/idlc/source/astoperation.cxx b/idlc/source/astoperation.cxx
index e88656f25db5..3a9a39adb5e5 100644
--- a/idlc/source/astoperation.cxx
+++ b/idlc/source/astoperation.cxx
@@ -42,7 +42,6 @@ bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index)
{
sal_uInt16 nParam = getNodeCount(NT_parameter);
sal_uInt16 nExcep = (sal_uInt16)m_exceptions.size();
- RTMethodMode methodMode = RTMethodMode::TWOWAY;
OUString returnTypeName;
if (m_pReturnType == nullptr) {
@@ -52,7 +51,7 @@ bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index)
m_pReturnType->getRelativName(), RTL_TEXTENCODING_UTF8);
}
rBlob.setMethodData(
- index, getDocumentation(), methodMode,
+ index, getDocumentation(), RTMethodMode::TWOWAY,
OStringToOUString(getLocalName(), RTL_TEXTENCODING_UTF8),
returnTypeName, nParam, nExcep);
diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index 5066752b3599..03b9a517f9e3 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -180,8 +180,8 @@ bool copyFile(const OString* source, const OString& target)
return false;
}
- size_t totalSize = 512;
- char pBuffer[513];
+ size_t const totalSize = 512;
+ char pBuffer[totalSize + 1];
while ( !feof(pSource) )
{
diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx
index c068f86fffc7..b49c5ec2e1c1 100644
--- a/io/source/TextInputStream/TextInputStream.cxx
+++ b/io/source/TextInputStream/TextInputStream.cxx
@@ -170,8 +170,7 @@ OUString OTextInputStream::implReadString( const Sequence< sal_Unicode >& Delimi
OUString aRetStr;
if( !mbEncodingInitialized )
{
- OUString aUtf8Str("utf8");
- setEncoding( aUtf8Str );
+ setEncoding( "utf8" );
}
if( !mbEncodingInitialized )
return aRetStr;
@@ -278,8 +277,7 @@ sal_Int32 OTextInputStream::implReadNext()
try
{
- sal_Int32 nBytesToRead = READ_BYTE_COUNT;
- sal_Int32 nRead = mxStream->readSomeBytes( mSeqSource, nBytesToRead );
+ sal_Int32 nRead = mxStream->readSomeBytes( mSeqSource, READ_BYTE_COUNT );
sal_Int32 nTotalRead = nRead;
if( nRead == 0 )
mbReachedEOF = true;
diff --git a/io/source/TextOutputStream/TextOutputStream.cxx b/io/source/TextOutputStream/TextOutputStream.cxx
index a0555e53cc7c..c888adbf9cd4 100644
--- a/io/source/TextOutputStream/TextOutputStream.cxx
+++ b/io/source/TextOutputStream/TextOutputStream.cxx
@@ -159,8 +159,7 @@ void OTextOutputStream::writeString( const OUString& aString )
checkOutputStream();
if( !mbEncodingInitialized )
{
- OUString aUtf8Str("utf8");
- setEncoding( aUtf8Str );
+ setEncoding( "utf8" );
}
if( !mbEncodingInitialized )
return;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
index d7bf982e4fc1..32203618b8cd 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
@@ -98,11 +98,11 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
OUString sJavaLibraryPath;
typedef vector<pair<OUString, OUString> >::const_iterator it_prop;
- OUString sVendorProperty("java.vendor");
- OUString sVersionProperty("java.version");
- OUString sJavaHomeProperty("java.home");
- OUString sJavaLibraryPathProperty("java.library.path");
- OUString sGNUHomeProperty("gnu.classpath.home.url");
+ OUString const sVendorProperty("java.vendor");
+ OUString const sVersionProperty("java.version");
+ OUString const sJavaHomeProperty("java.home");
+ OUString const sJavaLibraryPathProperty("java.library.path");
+ OUString const sGNUHomeProperty("gnu.classpath.home.url");
OUString sAccessProperty("javax.accessibility.assistive_technologies");
bool bVersion = false;
commit d116894b26f538793a0d5dc5847efd2fb53e7acb
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Jun 23 16:03:04 2017 +0200
loplugin:oncevar in formula..framework
Change-Id: I96d6af49c1994ebd7d6dcc41469127e3151b4350
Reviewed-on: https://gerrit.libreoffice.org/39186
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 3b137404419e..d710de4d7503 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -1298,7 +1298,6 @@ IMPL_LINK_NOARG(FormulaDlg_Impl, FormulaHdl, Edit&, void)
OUString aString=pMEdit->GetText();
Selection aSel = pMEdit->GetSelection();
- sal_Int32 nTest = 0;
if(aString.isEmpty()) //in case everything was cleared
{
@@ -1308,7 +1307,7 @@ IMPL_LINK_NOARG(FormulaDlg_Impl, FormulaHdl, Edit&, void)
aSel .Max() = 1;
pMEdit->SetSelection(aSel);
}
- else if(aString[nTest]!='=') //in case it's replaced;
+ else if(aString[0]!='=') //in case it's replaced;
{
aString = "=" + aString;
pMEdit->SetText(aString);
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 1607d3f4aea1..fd9a29a14b3b 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -559,8 +559,6 @@ void RemoteFilesDialog::AddFilter( const OUString& rFilter, const OUString& rTyp
FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
{
- FileViewResult eResult = eFailure;
-
if( m_pFileView )
{
m_pTreeView->EndSelection();
@@ -609,7 +607,7 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
EnableChildPointerOverwrite( false );
}
- return eResult;
+ return eFailure;
}
void RemoteFilesDialog::AddFileExtension()
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index 93c494bd1503..b09042600d45 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -1057,8 +1057,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( bool bPreferred, const css:
sal_Int32 nIndex = 0;
OUString sKeyCommand = sKey.getToken(0, '_', nIndex);
- OUString sPrefix("KEY_");
- aKeyEvent.KeyCode = KeyMapping::get().mapIdentifierToCode(sPrefix + sKeyCommand);
+ aKeyEvent.KeyCode = KeyMapping::get().mapIdentifierToCode("KEY_" + sKeyCommand);
css::uno::Sequence< OUString > sToken(4);
const sal_Int32 nToken = 4;
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx
index 2df66d3c36b1..38cb7f3e53eb 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -252,7 +252,6 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback, LinkParamNone*, void)
// Allow calling of XController->suspend() everytimes.
// Dispatch is an UI functionality. We implement such dispatch object here.
// And further XController->suspend() was designed to bring an UI ...
- bool bAllowSuspend = true;
bool bControllerSuspended = false;
bool bCloseAllViewsToo;
@@ -325,7 +324,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback, LinkParamNone*, void)
// document inside our own frame and decide then again, what has to be done!
else
{
- if (implts_prepareFrameForClosing(m_xCloseFrame, bAllowSuspend, bCloseAllViewsToo, bControllerSuspended))
+ if (implts_prepareFrameForClosing(m_xCloseFrame, true/*bAllowSuspend*/, bCloseAllViewsToo, bControllerSuspended))
{
// OK; this frame is empty now.
// Check the environment again to decide, what is the next step.
diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx
index 5a93197c8b99..bef0902c5fde 100644
--- a/framework/source/dispatch/popupmenudispatcher.cxx
+++ b/framework/source/dispatch/popupmenudispatcher.cxx
@@ -307,8 +307,7 @@ void PopupMenuDispatcher::impl_RetrievePopupControllerQuery()
if ( xLayoutManager.is() )
{
css::uno::Reference< css::ui::XUIElement > xMenuBar;
- OUString aMenuBar( "private:resource/menubar/menubar" );
- xMenuBar = xLayoutManager->getElement( aMenuBar );
+ xMenuBar = xLayoutManager->getElement( "private:resource/menubar/menubar" );
m_xPopupCtrlQuery.set( xMenuBar, css::uno::UNO_QUERY );
}
diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx
index ddce708ab7fe..63fbd191299d 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -559,8 +559,7 @@ void TitleHelper::impl_appendDebugVersion (OUStringBuffer& sTitle)
OUString version(utl::ConfigManager::getProductVersion());
sTitle.append(' ');
sTitle.append(version);
- OUString sDefault("development");
- OUString sVersion = ::utl::Bootstrap::getBuildIdData(sDefault);
+ OUString sVersion = ::utl::Bootstrap::getBuildIdData("development");
sTitle.append(" [");
sTitle.append(sVersion);
if (OpenGLWrapper::isVCLOpenGLEnabled())
diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx
index 033103d25a80..d1edc94bb6d8 100644
--- a/framework/source/fwe/xml/statusbardocumenthandler.cxx
+++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx
@@ -147,24 +147,20 @@ OReadStatusBarDocumentHandler::OReadStatusBarDocumentHandler(
const Reference< XIndexContainer >& rStatusBarItems ) :
m_aStatusBarItems( rStatusBarItems )
{
- OUString aNamespaceStatusBar( XMLNS_STATUSBAR );
- OUString aNamespaceXLink( XMLNS_XLINK );
- OUString aSeparator( XMLNS_FILTER_SEPARATOR );
-
// create hash map
for ( int i = 0; i < (int)SB_XML_ENTRY_COUNT; i++ )
{
if ( StatusBarEntries[i].nNamespace == SB_NS_STATUSBAR )
{
- OUString temp( aNamespaceStatusBar );
- temp += aSeparator;
+ OUString temp( XMLNS_STATUSBAR );
+ temp += XMLNS_FILTER_SEPARATOR;
temp += OUString::createFromAscii( StatusBarEntries[i].aEntryName );
m_aStatusBarMap.insert( StatusBarHashMap::value_type( temp, (StatusBar_XML_Entry)i ) );
}
else
{
- OUString temp( aNamespaceXLink );
- temp += aSeparator;
+ OUString temp( XMLNS_XLINK );
+ temp += XMLNS_FILTER_SEPARATOR;
temp += OUString::createFromAscii( StatusBarEntries[i].aEntryName );
m_aStatusBarMap.insert( StatusBarHashMap::value_type( temp, (StatusBar_XML_Entry)i ) );
}
diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
index 4076a489d0a0..21f2d53ccc5d 100644
--- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx
+++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
@@ -127,24 +127,20 @@ OReadToolBoxDocumentHandler::OReadToolBoxDocumentHandler( const Reference< XInde
m_aIsVisible( ITEM_DESCRIPTOR_VISIBLE ),
m_aCommandURL( ITEM_DESCRIPTOR_COMMANDURL )
{
- OUString aNamespaceToolBar( XMLNS_TOOLBAR );
- OUString aNamespaceXLink( XMLNS_XLINK );
- OUString aSeparator( XMLNS_FILTER_SEPARATOR );
-
// create hash map
for ( int i = 0; i < (int)TB_XML_ENTRY_COUNT; i++ )
{
if ( ToolBoxEntries[i].nNamespace == TB_NS_TOOLBAR )
{
- OUString temp( aNamespaceToolBar );
- temp += aSeparator;
+ OUString temp( XMLNS_TOOLBAR );
+ temp += XMLNS_FILTER_SEPARATOR;
temp += OUString::createFromAscii( ToolBoxEntries[i].aEntryName );
m_aToolBoxMap.insert( ToolBoxHashMap::value_type( temp, (ToolBox_XML_Entry)i ) );
}
else
{
- OUString temp( aNamespaceXLink );
- temp += aSeparator;
+ OUString temp( XMLNS_XLINK );
+ temp += XMLNS_FILTER_SEPARATOR;
temp += OUString::createFromAscii( ToolBoxEntries[i].aEntryName );
m_aToolBoxMap.insert( ToolBoxHashMap::value_type( temp, (ToolBox_XML_Entry)i ) );
}
diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx b/framework/source/fwe/xml/xmlnamespaces.cxx
index 0562d56c2191..a658cf12961e 100644
--- a/framework/source/fwe/xml/xmlnamespaces.cxx
+++ b/framework/source/fwe/xml/xmlnamespaces.cxx
@@ -166,8 +166,7 @@ OUString XMLNamespaces::getNamespaceValue( const OUString& aNamespace ) const
else
{
// namespace not defined => throw exception!
- OUString aErrorMessage( "XML namespace used but not defined!" );
- throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
+ throw SAXException( "XML namespace used but not defined!", Reference< XInterface >(), Any() );
}
}
}
diff --git a/framework/source/helper/oframes.cxx b/framework/source/helper/oframes.cxx
index 90f324c5240d..8a0ac74218d2 100644
--- a/framework/source/helper/oframes.cxx
+++ b/framework/source/helper/oframes.cxx
@@ -180,7 +180,7 @@ Sequence< css::uno::Reference< XFrame > > SAL_CALL OFrames::queryFrames( sal_Int
{
// Don't search for parents, siblings and self at children!
// These things are supported by this instance himself.
- sal_Int32 nChildSearchFlags = FrameSearchFlag::SELF | FrameSearchFlag::CHILDREN;
+ sal_Int32 const nChildSearchFlags = FrameSearchFlag::SELF | FrameSearchFlag::CHILDREN;
// Step over all items of container and ask children for frames.
sal_uInt32 nCount = m_pFrameContainer->getCount();
for ( sal_uInt32 nIndex=0; nIndex<nCount; ++nIndex )
diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx
index 59ab70e5c5e9..30e3290cdbd2 100644
--- a/framework/source/helper/persistentwindowstate.cxx
+++ b/framework/source/helper/persistentwindowstate.cxx
@@ -216,7 +216,7 @@ OUString PersistentWindowState::implst_getWindowStateFromWindow(const css::uno::
(pWindow->IsSystemWindow())
)
{
- WindowStateMask nMask = WindowStateMask::All & ~(WindowStateMask::Minimized);
+ WindowStateMask const nMask = WindowStateMask::All & ~(WindowStateMask::Minimized);
sWindowState = OStringToOUString(
static_cast<SystemWindow*>(pWindow.get())->GetWindowState(nMask),
RTL_TEXTENCODING_UTF8);
diff --git a/framework/source/jobs/shelljob.cxx b/framework/source/jobs/shelljob.cxx
index fc4a16158c7e..469a6c55cc18 100644
--- a/framework/source/jobs/shelljob.cxx
+++ b/framework/source/jobs/shelljob.cxx
@@ -127,13 +127,12 @@ bool ShellJob::impl_execute(const OUString& sCommand
{
::rtl_uString** pArgs = nullptr;
const ::sal_Int32 nArgs = lArguments.getLength ();
- oslProcessOption nOptions = osl_Process_WAIT;
oslProcess hProcess(nullptr);
if (nArgs > 0)
pArgs = reinterpret_cast< ::rtl_uString** >(const_cast< OUString* >(lArguments.getConstArray()));
- oslProcessError eError = osl_executeProcess(sCommand.pData, pArgs, nArgs, nOptions, nullptr, nullptr, nullptr, 0, &hProcess);
+ oslProcessError eError = osl_executeProcess(sCommand.pData, pArgs, nArgs, osl_Process_WAIT, nullptr, nullptr, nullptr, 0, &hProcess);
// executable not found or couldnt be started
if (eError != osl_Process_E_None)
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 55da5a72ea81..6533828a060c 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -2860,12 +2860,11 @@ void SAL_CALL LayoutManager::elementInserted( const ui::ConfigurationEvent& Even
Reference< XUIElementSettings > xElementSettings( xUIElement, UNO_QUERY );
if ( xElementSettings.is() )
{
- OUString aConfigSourcePropName( "ConfigurationSource" );
uno::Reference< XPropertySet > xPropSet( xElementSettings, uno::UNO_QUERY );
if ( xPropSet.is() )
{
if ( Event.Source == uno::Reference< uno::XInterface >( m_xDocCfgMgr, uno::UNO_QUERY ))
- xPropSet->setPropertyValue( aConfigSourcePropName, makeAny( m_xDocCfgMgr ));
+ xPropSet->setPropertyValue( "ConfigurationSource", makeAny( m_xDocCfgMgr ));
}
xElementSettings->updateSettings();
}
@@ -2991,12 +2990,11 @@ void SAL_CALL LayoutManager::elementReplaced( const ui::ConfigurationEvent& Even
Reference< XUIElementSettings > xElementSettings( xUIElement, UNO_QUERY );
if ( xElementSettings.is() )
{
- OUString aConfigSourcePropName( "ConfigurationSource" );
Reference< XInterface > xElementCfgMgr;
Reference< XPropertySet > xPropSet( xElementSettings, UNO_QUERY );
if ( xPropSet.is() )
- xPropSet->getPropertyValue( aConfigSourcePropName ) >>= xElementCfgMgr;
+ xPropSet->getPropertyValue( "ConfigurationSource" ) >>= xElementCfgMgr;
if ( !xElementCfgMgr.is() )
return;
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 37c86960a9b5..be24d67a0262 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -1092,7 +1092,6 @@ void ToolbarLayoutManager::implts_createAddonsToolBars()
uno::Reference< ui::XUIElement > xUIElement;
sal_uInt32 nCount = m_pAddonOptions->GetAddonsToolBarCount();
- OUString aElementType( "toolbar" );
uno::Sequence< beans::PropertyValue > aPropSeq( 2 );
aPropSeq[0].Name = "Frame";
@@ -1151,7 +1150,7 @@ void ToolbarLayoutManager::implts_createAddonsToolBars()
else
{
// Create new UI element and try to read its state data
- UIElement aNewToolbar( aAddonToolBarName, aElementType, xUIElement );
+ UIElement aNewToolbar( aAddonToolBarName, "toolbar", xUIElement );
aNewToolbar.m_bFloating = true;
implts_readWindowStateData( aAddonToolBarName, aNewToolbar );
implts_setElementData( aNewToolbar, xDockWindow );
@@ -3798,12 +3797,11 @@ void SAL_CALL ToolbarLayoutManager::elementInserted( const ui::ConfigurationEven
uno::Reference< ui::XUIElementSettings > xElementSettings( aUIElement.m_xUIElement, uno::UNO_QUERY );
if ( xElementSettings.is() )
{
- OUString aConfigSourcePropName( "ConfigurationSource" );
uno::Reference< beans::XPropertySet > xPropSet( xElementSettings, uno::UNO_QUERY );
if ( xPropSet.is() )
{
if ( rEvent.Source == uno::Reference< uno::XInterface >( m_xDocCfgMgr, uno::UNO_QUERY ))
- xPropSet->setPropertyValue( aConfigSourcePropName, makeAny( m_xDocCfgMgr ));
+ xPropSet->setPropertyValue( "ConfigurationSource", makeAny( m_xDocCfgMgr ));
}
xElementSettings->updateSettings();
}
@@ -3908,12 +3906,11 @@ void SAL_CALL ToolbarLayoutManager::elementReplaced( const ui::ConfigurationEven
uno::Reference< ui::XUIElementSettings > xElementSettings( aUIElement.m_xUIElement, uno::UNO_QUERY );
if ( xElementSettings.is() )
{
- OUString aConfigSourcePropName( "ConfigurationSource" );
uno::Reference< uno::XInterface > xElementCfgMgr;
uno::Reference< beans::XPropertySet > xPropSet( xElementSettings, uno::UNO_QUERY );
if ( xPropSet.is() )
- xPropSet->getPropertyValue( aConfigSourcePropName ) >>= xElementCfgMgr;
+ xPropSet->getPropertyValue( "ConfigurationSource" ) >>= xElementCfgMgr;
if ( !xElementCfgMgr.is() )
return;
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 2a6ceb707af1..3a9fdfdb546a 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -2344,8 +2344,7 @@ IMPL_LINK_NOARG(AutoRecovery, implts_timerExpired, Timer *, void)
// force save of all currently open documents
// The called method returns an info, if and how this
// timer must be restarted.
- bool bAllowUserIdleLoop = true;
- AutoRecovery::ETimerType eSuggestedTimer = implts_saveDocs(bAllowUserIdleLoop, false);
+ AutoRecovery::ETimerType eSuggestedTimer = implts_saveDocs(true/*bAllowUserIdleLoop*/, false);
// If timer is not used for "short callbacks" (means polling
// for special states) ... reset the handle state of all
@@ -3700,7 +3699,7 @@ void AutoRecovery::implts_doEmergencySave(const DispatchParams& aParams)
// Of course this method returns the right state -
// because it knows, that we are running in EMERGENCY SAVE mode .-)
- bool bAllowUserIdleLoop = false; // not allowed to change that .-)
+ bool const bAllowUserIdleLoop = false; // not allowed to change that .-)
AutoRecovery::ETimerType eSuggestedTimer = AutoRecovery::E_DONT_START_TIMER;
do
{
@@ -3768,7 +3767,7 @@ void AutoRecovery::implts_doSessionSave(const DispatchParams& aParams)
// Of course this method returns the right state -
// because it knows, that we are running in SESSION SAVE mode .-)
- bool bAllowUserIdleLoop = false; // not allowed to change that .-)
+ bool const bAllowUserIdleLoop = false; // not allowed to change that .-)
AutoRecovery::ETimerType eSuggestedTimer = AutoRecovery::E_DONT_START_TIMER;
do
{
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index 7b1504ae69f4..a266af912c8f 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -488,8 +488,7 @@ OUString SubstitutePathVariables::impl_substituteVariable( const OUString& rText
// variable in text but unknown!
if ( bSubstRequired )
{
- OUString aMsg( "Unknown variable found!" );
- throw NoSuchElementException( aMsg, static_cast<cppu::OWeakObject *>(this) );
+ throw NoSuchElementException( "Unknown variable found!", static_cast<cppu::OWeakObject *>(this) );
}
else
aResult = aWorkText;
@@ -600,8 +599,7 @@ OUString const & SubstitutePathVariables::impl_getSubstituteVariableValue( const
}
else
{
- OUString aExceptionText("Unknown variable!");
- throw NoSuchElementException(aExceptionText, static_cast<cppu::OWeakObject *>(this));
+ throw NoSuchElementException("Unknown variable!", static_cast<cppu::OWeakObject *>(this));
}
}
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx
index 1e80d29e661d..8f37f6d4f690 100644
--- a/framework/source/uielement/comboboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx
@@ -263,14 +263,13 @@ void ComboboxToolbarController::executeControlCommand( const css::frame::Control
}
else if ( rControlCommand.Command == "AddEntry" )
{
- sal_Int32 nPos( COMBOBOX_APPEND );
OUString aText;
for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ )
{
if ( rControlCommand.Arguments[i].Name == "Text" )
{
if ( rControlCommand.Arguments[i].Value >>= aText )
- m_pComboBox->InsertEntry( aText, nPos );
+ m_pComboBox->InsertEntry( aText, COMBOBOX_APPEND );
break;
}
}
diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
index ccac50e0a70c..7608d112b5d3 100644
--- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
@@ -207,14 +207,13 @@ void DropdownToolbarController::executeControlCommand( const css::frame::Control
}
else if ( rControlCommand.Command == "AddEntry" )
{
- sal_Int32 nPos( LISTBOX_APPEND );
OUString aText;
for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ )
{
if ( rControlCommand.Arguments[i].Name == "Text" )
{
if ( rControlCommand.Arguments[i].Value >>= aText )
- m_pListBoxControl->InsertEntry( aText, nPos );
+ m_pListBoxControl->InsertEntry( aText, LISTBOX_APPEND );
break;
}
}
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 2dcfd3a94920..76b8182dca29 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -597,12 +597,11 @@ void MenuBarManager::CheckAndAddMenuExtension( Menu* pMenu )
sal_uInt16 nNewItemId( 0 );
sal_uInt16 nInsertPos( MENU_APPEND );
sal_uInt16 nBeforePos( MENU_APPEND );
- OUString aCommandBefore( ".uno:About" );
for ( sal_uInt16 n = 0; n < pMenu->GetItemCount(); n++ )
{
sal_uInt16 nItemId = pMenu->GetItemId( n );
nNewItemId = std::max( nItemId, nNewItemId );
- if ( pMenu->GetItemCommand( nItemId ) == aCommandBefore )
+ if ( pMenu->GetItemCommand( nItemId ) == ".uno:About" )
nBeforePos = n;
}
++nNewItemId;
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index ec0f925e7651..584aabdb7ec6 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -676,7 +676,6 @@ void ToolBarManager::CreateControllers()
if ( nId == 0 )
continue;
- OUString aLoadURL( ".uno:OpenUrl" );
bool bInit( true );
bool bCreate( true );
Reference< XStatusListener > xController;
@@ -730,7 +729,7 @@ void ToolBarManager::CreateControllers()
bInit = false; // Initialization is done through the factory service
}
- if (( aCommandURL == aLoadURL ) && ( !m_pToolBar->IsItemVisible(nId)))
+ if (( aCommandURL == ".uno:OpenUrl" ) && ( !m_pToolBar->IsItemVisible(nId)))
bCreate = false;
if ( !xController.is() && bCreate )
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index b587b7e24cca..c5775e88d7b6 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -422,7 +422,6 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
bool bAddCommand( true );
SvtCommandOptions aCmdOptions;
- OUString aConfigureToolbar( ".uno:ConfigureDialog" );
if ( aCmdOptions.HasEntries( SvtCommandOptions::CMDOPTION_DISABLED ))
{
@@ -440,7 +439,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
m_xPopupMenu->insertSeparator( nItemCount+1 );
}
- addCommand( m_xPopupMenu, aConfigureToolbar, "" );
+ addCommand( m_xPopupMenu, ".uno:ConfigureDialog", "" );
}
// Add separator if no configure has been added
More information about the Libreoffice-commits
mailing list