diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-22 16:05:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-23 08:59:30 +0200 |
commit | 58ae5fb5ff69a5581cffa583a57ad9381140fa9a (patch) | |
tree | e4776c71b6038e983579facd2ef0c1f8f926d54b /desktop | |
parent | cb37c5f0f3de7b545231a53d46a5271058af76ad (diff) |
loplugin:oncevar in cppcanvas..drawinglayer
Change-Id: I5456aad61fb0dfe6830eae62b91d1a6399d6343f
Reviewed-on: https://gerrit.libreoffice.org/39128
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 13 | ||||
-rw-r--r-- | desktop/source/app/app.cxx | 12 | ||||
-rw-r--r-- | desktop/source/app/check_ext_deps.cxx | 5 | ||||
-rw-r--r-- | desktop/source/app/dispatchwatcher.cxx | 9 | ||||
-rw-r--r-- | desktop/source/deployment/dp_persmap.cxx | 2 | ||||
-rw-r--r-- | desktop/source/deployment/manager/dp_commandenvironments.cxx | 9 | ||||
-rw-r--r-- | desktop/source/deployment/registry/help/dp_help.cxx | 6 | ||||
-rw-r--r-- | desktop/source/migration/migration.cxx | 5 | ||||
-rw-r--r-- | desktop/unx/source/splashx.c | 6 |
9 files changed, 26 insertions, 41 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index b7b32544878d..0152bfa4aa05 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -688,8 +688,8 @@ void DesktopLOKTest::testHiddenRowHeaders() pDocument->pClass->initializeForRendering(pDocument, nullptr); - long nX = 0; - long nY = 0; + long const nX = 0; + long const nY = 0; long nWidth = 0; long nHeight = 0; pDocument->m_pDocumentClass->getDocumentSize(pDocument, &nWidth, &nHeight); @@ -881,8 +881,8 @@ void DesktopLOKTest::testSheetSelections() // Values in twips int row5 = 1150; int col1 = 1100; - int col2 = 2200; - int col3 = 3300; + int const col2 = 2200; + int const col3 = 3300; int col4 = 4400; int col5 = 5500; @@ -932,7 +932,7 @@ void DesktopLOKTest::testSheetSelections() /* * Check if clicking inside the selection deselects the whole selection */ - int row10 = 2400; + int const row10 = 2400; // Select starting from row5, col1 to row10, col5 pDocument->pClass->postMouseEvent(pDocument, LOK_MOUSEEVENT_MOUSEBUTTONDOWN, @@ -1845,8 +1845,7 @@ void DesktopLOKTest::testGetFontSubset() rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8 ); - OUString aUnoFontSubset(".uno:FontSubset&name="); - OString aCommand = OUStringToOString(aUnoFontSubset + aFontName, RTL_TEXTENCODING_UTF8); + OString aCommand = OUStringToOString(".uno:FontSubset&name=" + aFontName, RTL_TEXTENCODING_UTF8); boost::property_tree::ptree aTree; char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, aCommand.getStr()); std::stringstream aStream(pJSON); diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 0e7f37fe0c48..bbf8ccdd0e86 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1537,9 +1537,8 @@ int Desktop::Main() #ifdef DBG_UTIL //include buildid in non product builds - OUString aDefault("development"); aTitle += " ["; - aTitle += utl::Bootstrap::getBuildIdData(aDefault); + aTitle += utl::Bootstrap::getBuildIdData("development"); aTitle += "]"; #endif @@ -1672,7 +1671,6 @@ int Desktop::Main() if ( !pExecGlobals->bRestartRequested ) { Application::SetFilterHdl( LINK( this, Desktop, ImplInitFilterHdl ) ); - bool bTerminateRequested = false; // Preload function depends on an initialized sfx application! SetSplashScreenProgress(75); @@ -1682,7 +1680,7 @@ int Desktop::Main() SetSplashScreenProgress(80); - if ( !bTerminateRequested && !rCmdLineArgs.IsInvisible() && + if ( !rCmdLineArgs.IsInvisible() && !rCmdLineArgs.IsNoQuickstart() ) InitializeQuickstartMode( xContext ); @@ -2072,8 +2070,7 @@ IMPL_LINK_NOARG(Desktop, OpenClients_Impl, void*, void) if (pExitPostStartup && *pExitPostStartup) new ExitTimer(); } catch (const css::uno::Exception &e) { - OUString a( "UNO exception during client open:\n" ); - Application::Abort( a + e.Message ); + Application::Abort( "UNO exception during client open: " + e.Message ); } } @@ -2598,9 +2595,8 @@ void Desktop::OpenSplashScreen() if ( rCmdLine.HasSplashPipe() ) aSplashService = "com.sun.star.office.PipeSplashScreen"; - bool bVisible = true; Sequence< Any > aSeq( 2 ); - aSeq[0] <<= bVisible; + aSeq[0] <<= true; // bVisible aSeq[1] <<= aAppName; css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); m_rSplashScreen.set( diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx index 9c7a300f01eb..6440786317e1 100644 --- a/desktop/source/app/check_ext_deps.cxx +++ b/desktop/source/app/check_ext_deps.cxx @@ -258,9 +258,10 @@ static bool impl_checkDependencies( const uno::Reference< uno::XComponentContext throw uno::RuntimeException( e.Message, e.Context ); } - sal_Int32 nMax = 2; #ifdef DEBUG - nMax = 3; + sal_Int32 const nMax = 3; +#else + sal_Int32 const nMax = 2; #endif for ( sal_Int32 i = 0; i < xAllPackages.getLength(); ++i ) diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index 242e73a625fc..7d7f8fac8401 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -288,7 +288,6 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest Reference< XDesktop2 > xDesktop = css::frame::Desktop::create( ::comphelper::getProcessComponentContext() ); std::vector< DispatchHolder > aDispatches; - OUString aAsTemplateArg( "AsTemplate" ); bool bSetInputFilter = false; OUString aForcedInputFilter; @@ -343,13 +342,11 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest aArgs[1].Name = "InteractionHandler"; aArgs[1].Value <<= xInteraction; - sal_Int16 nMacroExecMode = css::document::MacroExecMode::USE_CONFIG; aArgs[2].Name = "MacroExecutionMode"; - aArgs[2].Value <<= nMacroExecMode; + aArgs[2].Value <<= css::document::MacroExecMode::USE_CONFIG; - sal_Int16 nUpdateDoc = css::document::UpdateDocMode::ACCORDING_TO_CONFIG; aArgs[3].Name = "UpdateDocMode"; - aArgs[3].Value <<= nUpdateDoc; + aArgs[3].Value <<= css::document::UpdateDocMode::ACCORDING_TO_CONFIG; } if ( !aDispatchRequest.aPreselectedFactory.isEmpty() ) @@ -475,7 +472,7 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest { sal_Int32 nIndex = aArgs.getLength(); aArgs.realloc( nIndex+1 ); - aArgs[nIndex].Name = aAsTemplateArg; + aArgs[nIndex].Name = "AsTemplate"; if ( aDispatchRequest.aRequestType == REQUEST_FORCENEW ) aArgs[nIndex].Value <<= true; else diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx index 78f5b42d0824..d52aa38d89b8 100644 --- a/desktop/source/deployment/dp_persmap.cxx +++ b/desktop/source/deployment/dp_persmap.cxx @@ -139,7 +139,7 @@ static OString decodeString( const sal_Char* pEncChars, int nLen) void PersistentMap::open() { // open the existing file - sal_uInt32 nOpenFlags = osl_File_OpenFlag_Read | osl_File_OpenFlag_Write; + sal_uInt32 const nOpenFlags = osl_File_OpenFlag_Read | osl_File_OpenFlag_Write; const osl::File::RC rcOpen = m_MapFile.open( nOpenFlags); m_bIsOpen = (rcOpen == osl::File::E_None); diff --git a/desktop/source/deployment/manager/dp_commandenvironments.cxx b/desktop/source/deployment/manager/dp_commandenvironments.cxx index cd93931e6de0..732c479d9036 100644 --- a/desktop/source/deployment/manager/dp_commandenvironments.cxx +++ b/desktop/source/deployment/manager/dp_commandenvironments.cxx @@ -150,7 +150,6 @@ void TmpRepositoryCommandEnv::handle( deployment::InstallException instExc; bool approve = false; - bool abort = false; if ((request >>= verExc) || (request >>= licExc) @@ -159,7 +158,7 @@ void TmpRepositoryCommandEnv::handle( approve = true; } - handle_(approve, abort, xRequest); + handle_(approve, false/*abort*/, xRequest); } @@ -181,7 +180,6 @@ void LicenseCommandEnv::handle( deployment::LicenseException licExc; bool approve = false; - bool abort = false; if (request >>= licExc) { @@ -197,7 +195,7 @@ void LicenseCommandEnv::handle( } } - handle_(approve, abort, xRequest); + handle_(approve, false/*abort*/, xRequest); } @@ -216,13 +214,12 @@ void NoLicenseCommandEnv::handle( deployment::LicenseException licExc; bool approve = false; - bool abort = false; if (request >>= licExc) { approve = true; } - handle_(approve, abort, xRequest); + handle_(approve, false/*abort*/, xRequest); } SilentCheckPrerequisitesCommandEnv::SilentCheckPrerequisitesCommandEnv() diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index 0a1b81dc4ed6..6ccdd07b07c3 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -473,9 +473,7 @@ void BackendImpl::implProcessHelp( else aLang = "en"; - OUString aMod("help"); - - HelpIndexer aIndexer(aLang, aMod, langFolderDestExpanded, langFolderDestExpanded); + HelpIndexer aIndexer(aLang, "help", langFolderDestExpanded, langFolderDestExpanded); aIndexer.indexDocuments(); } @@ -496,7 +494,7 @@ void BackendImpl::implProcessHelp( // Remove CR/LF OUString aErrMsg( aErrorInfo.m_aErrorMsg ); - sal_Unicode nCR = 13, nLF = 10; + sal_Unicode const nCR = 13, nLF = 10; sal_Int32 nSearchCR = aErrMsg.indexOf( nCR ); sal_Int32 nSearchLF = aErrMsg.indexOf( nLF ); sal_Int32 nCopy; diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index d0291d73290b..56fcbd58d481 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -164,7 +164,7 @@ OUString mapModuleShortNameToIdentifier(const OUString& sShortName) bool MigrationImpl::alreadyMigrated() { - OUString MIGRATION_STAMP_NAME("/MIGRATED4"); + OUString const MIGRATION_STAMP_NAME("/MIGRATED4"); OUString aStr = m_aInfo.userdata + MIGRATION_STAMP_NAME; File aFile(aStr); // create migration stamp, and/or check its existence @@ -391,8 +391,7 @@ migrations_vr MigrationImpl::readMigrationSteps(const OUString& rMigrationName) // get migration description from org.openoffice.Setup/Migration // and build vector of migration steps - OUString aMigrationSteps( "MigrationSteps" ); - uno::Reference< XNameAccess > theNameAccess(xMigrationData->getByName(aMigrationSteps), uno::UNO_QUERY_THROW); + uno::Reference< XNameAccess > theNameAccess(xMigrationData->getByName("MigrationSteps"), uno::UNO_QUERY_THROW); uno::Sequence< OUString > seqMigrations = theNameAccess->getElementNames(); uno::Reference< XNameAccess > tmpAccess; uno::Sequence< OUString > tmpSeq; diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c index 74c071157f00..aa01d44b6c61 100644 --- a/desktop/unx/source/splashx.c +++ b/desktop/unx/source/splashx.c @@ -216,7 +216,6 @@ static void create_pixmap(struct splash* splash) { Pixmap pixmap; GC pixmap_gc; - unsigned long value_mask = 0; XGCValues values; if ( !splash->bitmap_rows ) @@ -225,7 +224,7 @@ static void create_pixmap(struct splash* splash) } pixmap = XCreatePixmap( splash->display, splash->win, splash->width, splash->height, splash->depth ); - pixmap_gc = XCreateGC( splash->display, pixmap, value_mask, &values ); + pixmap_gc = XCreateGC( splash->display, pixmap, 0/*value_mask*/, &values ); if ( splash->visual->class == TrueColor ) { @@ -469,7 +468,6 @@ static int splash_init_display( struct splash* splash, int argc, char** argv ) static int splash_create_window(struct splash* splash) { Window root_win; - unsigned long value_mask = 0; XGCValues values; const char* name = "LibreOffice"; const char* icon = "icon"; // FIXME @@ -495,7 +493,7 @@ static int splash_create_window(struct splash* splash) XAllocColor( splash->display, splash->color_map, &(splash->framecolor) ); // not resizable, no decorations, etc. - splash->gc = XCreateGC( splash->display, splash->win, value_mask, &values ); + splash->gc = XCreateGC( splash->display, splash->win, 0/*value_mask*/, &values ); size_hints.flags = PPosition | PSize | PMinSize | PMaxSize; size_hints.x = splash->display_x_pos; |