[Libreoffice-commits] core.git: test/source toolkit/source tools/qa tools/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Jun 28 06:55:05 UTC 2017


 test/source/sheet/xcellrangesquery.cxx                |   12 +++++-----
 test/source/sheet/xnamedrange.cxx                     |   20 ++++++-----------
 test/source/sheet/xnamedranges.cxx                    |   13 +++++------
 test/source/sheet/xspreadsheets2.cxx                  |   21 ++++++------------
 test/source/sheet/xstyleloader.cxx                    |    3 --
 test/source/sheet/xviewpane.cxx                       |    3 --
 toolkit/source/awt/vclxprinter.cxx                    |    3 --
 toolkit/source/controls/controlmodelcontainerbase.cxx |   16 ++++---------
 toolkit/source/controls/roadmapentry.cxx              |    3 --
 toolkit/source/controls/unocontrolbase.cxx            |    5 ----
 toolkit/source/controls/unocontrolcontainer.cxx       |    3 --
 tools/qa/cppunit/test_reversemap.cxx                  |    2 -
 tools/source/generic/b3dtrans.cxx                     |    3 --
 tools/source/generic/color.cxx                        |    3 --
 14 files changed, 39 insertions(+), 71 deletions(-)

New commits:
commit ef531e85d95fe18d553bce1a6926d24c08ffe2bf
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Jun 27 14:05:39 2017 +0200

    loplugin:oncevar in test..tools
    
    Change-Id: I7b3ccc8f227100ff7fedeaca96a12f135da60bab
    Reviewed-on: https://gerrit.libreoffice.org/39326
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/test/source/sheet/xcellrangesquery.cxx b/test/source/sheet/xcellrangesquery.cxx
index 4838c65746de..7496eded47d9 100644
--- a/test/source/sheet/xcellrangesquery.cxx
+++ b/test/source/sheet/xcellrangesquery.cxx
@@ -24,7 +24,7 @@ namespace apitest {
 
 void XCellRangesQuery::testQueryColumnDifference()
 {
-    OUString aExpected( "Sheet1.B1:C1,Sheet1.B3:C5" );
+    OUString const aExpected( "Sheet1.B1:C1,Sheet1.B3:C5" );
     uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(init(),UNO_QUERY_THROW);
     uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryColumnDifferences(table::CellAddress(0, 1, 1));
     OUString aResult = xRanges->getRangeAddressesAsString();
@@ -34,7 +34,7 @@ void XCellRangesQuery::testQueryColumnDifference()
 
 void XCellRangesQuery::testQueryContentDifference()
 {
-    OUString aExpected( "Sheet1.B3,Sheet1.C2" );
+    OUString const aExpected( "Sheet1.B3,Sheet1.C2" );
     uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(init(),UNO_QUERY_THROW);
     uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryContentCells(sheet::CellFlags::VALUE);
     OUString aResult = xRanges->getRangeAddressesAsString();
@@ -54,7 +54,7 @@ void XCellRangesQuery::testQueryEmptyCells()
 
 void XCellRangesQuery::testQueryFormulaCells()
 {
-    OUString aExpected( "Sheet1.B2" );
+    OUString const aExpected( "Sheet1.B2" );
     uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(init(),UNO_QUERY_THROW);
     uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryFormulaCells(sheet::CellFlags::FORMULA);
     OUString aResult = xRanges->getRangeAddressesAsString();
@@ -64,7 +64,7 @@ void XCellRangesQuery::testQueryFormulaCells()
 
 void XCellRangesQuery::testQueryIntersection()
 {
-    OUString aExpected( "Sheet1.D4:E5" );
+    OUString const aExpected( "Sheet1.D4:E5" );
     uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(init(),UNO_QUERY_THROW);
     uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryIntersection(table::CellRangeAddress(0,3,3,7,7));
     OUString aResult = xRanges->getRangeAddressesAsString();
@@ -74,7 +74,7 @@ void XCellRangesQuery::testQueryIntersection()
 
 void XCellRangesQuery::testQueryRowDifference()
 {
-    OUString aExpected( "Sheet1.A2:A4,Sheet1.C2:E4" );
+    OUString const aExpected( "Sheet1.A2:A4,Sheet1.C2:E4" );
     uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(init(),UNO_QUERY_THROW);
     uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryRowDifferences(table::CellAddress(0,1,1));
     OUString aResult = xRanges->getRangeAddressesAsString();
@@ -84,7 +84,7 @@ void XCellRangesQuery::testQueryRowDifference()
 
 void XCellRangesQuery::testQueryVisibleCells()
 {
-    OUString aExpected( "Sheet1.A1:E5" );
+    OUString const aExpected( "Sheet1.A1:E5" );
     uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(init(),UNO_QUERY_THROW);
     uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryVisibleCells();
     OUString aResult = xRanges->getRangeAddressesAsString();
diff --git a/test/source/sheet/xnamedrange.cxx b/test/source/sheet/xnamedrange.cxx
index 5353b5416e82..84e4cb1c4875 100644
--- a/test/source/sheet/xnamedrange.cxx
+++ b/test/source/sheet/xnamedrange.cxx
@@ -35,17 +35,15 @@ namespace apitest {
 
 void XNamedRange::testGetContent()
 {
-    OUString aTestedNamedRangeString("initial1");
-    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(aTestedNamedRangeString);
+    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial1");
 
-    OUString aExpectedContent("$Sheet1.$B$1");
+    OUString const aExpectedContent("$Sheet1.$B$1");
     CPPUNIT_ASSERT_MESSAGE("Wrong expected content for initial1 on GetContent", xNamedRange->getContent().equals(aExpectedContent));
 }
 
 void XNamedRange::testSetContent()
 {
-    OUString aTestedNamedRangeString("initial1");
-    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(aTestedNamedRangeString);
+    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial1");
 
     OUString aExpectedContent;
 
@@ -69,15 +67,13 @@ void XNamedRange::testSetContent()
 
 void XNamedRange::testGetType()
 {
-    OUString aTestedNamedRangeString("initial1");
-    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(aTestedNamedRangeString);
+    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial1");
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong expected Type", sal_Int32(0), xNamedRange->getType());
 }
 
 void XNamedRange::testSetType()
 {
-    OUString aTestedNamedRangeString("initial1");
-    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(aTestedNamedRangeString);
+    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial1");
 
     sal_Int32 nType = ::sheet::NamedRangeFlag::ROW_HEADER;
     xNamedRange->setType(nType);
@@ -102,8 +98,7 @@ void XNamedRange::testSetType()
 
 void XNamedRange::testGetReferencePosition()
 {
-    OUString aTestedNamedRangeString("initial2");
-    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(aTestedNamedRangeString);
+    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial2");
 
     table::CellAddress aCellAddress = xNamedRange->getReferencePosition();
     // the expected address is on B1, as it was the active cell when initial2 was created
@@ -114,8 +109,7 @@ void XNamedRange::testGetReferencePosition()
 
 void XNamedRange::testSetReferencePosition()
 {
-    OUString aTestedNamedRangeString("initial1");
-    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(aTestedNamedRangeString);
+    uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial1");
 
     table::CellAddress aBaseAddress = table::CellAddress(1,2,3);
 
diff --git a/test/source/sheet/xnamedranges.cxx b/test/source/sheet/xnamedranges.cxx
index 4fee1da0e23c..6983ead594d1 100644
--- a/test/source/sheet/xnamedranges.cxx
+++ b/test/source/sheet/xnamedranges.cxx
@@ -59,31 +59,31 @@ void XNamedRanges::testAddNewByName()
     table::CellAddress aBaseAddress = table::CellAddress(0,0,0);
 
     sal_Int32 nType = 0;
-    OUString aContent1("D1");
+    OUString const aContent1("D1");
     OUString aName1("type_0");
     xNamedRanges->addNewByName(aName1, aContent1, aBaseAddress, nType);
     CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type 0 - Normal case", xNamedRanges->hasByName(aName1));
 
     nType = ::sheet::NamedRangeFlag::COLUMN_HEADER;
-    OUString aContent2("D2");
+    OUString const aContent2("D2");
     OUString aName2("type_COLUMN_HEADER");
     xNamedRanges->addNewByName(aName2, aContent2, aBaseAddress, nType);
     CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type COLUMN_HEADER", xNamedRanges->hasByName(aName2));
 
     nType = ::sheet::NamedRangeFlag::FILTER_CRITERIA;
-    OUString aContent3("D3");
+    OUString const aContent3("D3");
     OUString aName3("type_FILTER_CRITERIA");
     xNamedRanges->addNewByName(aName3, aContent3, aBaseAddress, nType);
     CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type FILTER_CRITERIA", xNamedRanges->hasByName(aName3));
 
     nType = ::sheet::NamedRangeFlag::PRINT_AREA;
-    OUString aContent4("D4");
+    OUString const aContent4("D4");
     OUString aName4("type_PRINT_AREA");
     xNamedRanges->addNewByName(aName4, aContent4, aBaseAddress, nType);
     CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type PRINT_AREA", xNamedRanges->hasByName(aName4));
 
     nType = ::sheet::NamedRangeFlag::ROW_HEADER;
-    OUString aContent5("D5");
+    OUString const aContent5("D5");
     OUString aName5("type_ROW_HEADER");
     xNamedRanges->addNewByName(aName5, aContent5, aBaseAddress, nType);
     CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type ROW_HEADER", xNamedRanges->hasByName(aName5));
@@ -171,8 +171,7 @@ void XNamedRanges::testRemoveByName()
         CPPUNIT_ASSERT_EQUAL_MESSAGE("NamedRange initial1 not removed", nNewCount, nInitialCount - 1);
         CPPUNIT_ASSERT_MESSAGE("Wrong NamedRange removed, initial1 still present", !xNamedRanges->hasByName(maNameToRemove));
         // try to remove non existing
-        OUString aNr2("dummyNonExistingNamedRange");
-        xNamedRanges->removeByName(aNr2);// an exception should be raised here
+        xNamedRanges->removeByName("dummyNonExistingNamedRange");// an exception should be raised here
     }
 }
 
diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx
index 7d0e24527685..771bcf6c2e05 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -148,14 +148,12 @@ void XSpreadsheets2::testImportOverExistingNamedRange()
 */
     importSheetToCopy();
 
-    OUString aNamedRangeString("initial1");
-
     uno::Reference< container::XNameAccess > xDestNamedRangesNameAccess(getNamedRanges(xDestDoc), UNO_QUERY_THROW);
-    uno::Any aNr = xDestNamedRangesNameAccess->getByName(aNamedRangeString);
+    uno::Any aNr = xDestNamedRangesNameAccess->getByName("initial1");
     uno::Reference< sheet::XNamedRange > xDestNamedRange(aNr, UNO_QUERY_THROW);
     OUString aNrDestContent = xDestNamedRange->getContent();
 
-    OUString aExpectedContent("$Sheet1.$B$1");
+    OUString const aExpectedContent("$Sheet1.$B$1");
 
     std::cout << "testImportSheet : initial1 aNrDestContent " << aNrDestContent << std::endl;
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for initial1", aNrDestContent, aExpectedContent);
@@ -203,7 +201,7 @@ void XSpreadsheets2::testImportNamedRangeRedefinedInSource()
     uno::Any aRedefinedInSheetNr = xDestNamedRangesNameAccess->getByName(aRedefinedInSheetNamedRangeString);
     uno::Reference< sheet::XNamedRange > xDestRedefinedInSheetNamedRange(aRedefinedInSheetNr, UNO_QUERY_THROW);
     OUString aRedefinedInSheetNrDestContent = xDestRedefinedInSheetNamedRange->getContent();
-    OUString aRedefinedInSheetExpectedContent("$Sheet1.$B$2");
+    OUString const aRedefinedInSheetExpectedContent("$Sheet1.$B$2");
     std::cout << "testImportSheet : initial2 content " << aRedefinedInSheetNrDestContent << std::endl;
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for Redefined InSheet named range", aRedefinedInSheetNrDestContent, aRedefinedInSheetExpectedContent);
 }
@@ -263,17 +261,15 @@ void XSpreadsheets2::testImportCellStyle()
 
     uno::Reference< style::XStyleFamiliesSupplier > xFamiliesSupplier (xDestDoc, UNO_QUERY_THROW);
     uno::Reference< container::XNameAccess > xFamiliesNameAccess (xFamiliesSupplier->getStyleFamilies(), UNO_QUERY_THROW);
-    OUString aCellFamilyName("CellStyles");
-    uno::Any aCellStylesFamily = xFamiliesNameAccess->getByName(aCellFamilyName);
+    uno::Any aCellStylesFamily = xFamiliesNameAccess->getByName("CellStyles");
     uno::Reference< container::XNameContainer > xCellStylesFamilyNameAccess (aCellStylesFamily, UNO_QUERY_THROW);
 
     CPPUNIT_ASSERT_MESSAGE("New cell style not present", xCellStylesFamilyNameAccess->hasByName(aDestStyleName));
 
     uno::Any aCellStyle = xCellStylesFamilyNameAccess->getByName(aDestStyleName);
     uno::Reference< beans::XPropertySet > xCellStyleProp (aCellStyle, UNO_QUERY_THROW);
-    OUString aProperty("VertJustify");
     sal_Int32 aVertJustify = 0;
-    CPPUNIT_ASSERT(xCellStyleProp->getPropertyValue(aProperty) >>= aVertJustify);
+    CPPUNIT_ASSERT(xCellStyleProp->getPropertyValue("VertJustify") >>= aVertJustify);
 
     CPPUNIT_ASSERT_EQUAL_MESSAGE("New style: VertJustify not set", table::CellVertJustify_CENTER, (table::CellVertJustify)aVertJustify);
 }
@@ -296,8 +292,7 @@ uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const OUStri
 uno::Reference< sheet::XNamedRanges> XSpreadsheets2::getNamedRanges(uno::Reference< sheet::XSpreadsheetDocument> const & xDoc)
 {
     uno::Reference< beans::XPropertySet > xPropSet (xDoc, UNO_QUERY_THROW);
-    OUString NamedRangesPropertyString("NamedRanges");
-    uno::Reference< sheet::XNamedRanges > xNamedRanges(xPropSet->getPropertyValue(NamedRangesPropertyString), UNO_QUERY_THROW);
+    uno::Reference< sheet::XNamedRanges > xNamedRanges(xPropSet->getPropertyValue("NamedRanges"), UNO_QUERY_THROW);
     CPPUNIT_ASSERT(xNamedRanges.is());
 
     return xNamedRanges;
@@ -331,9 +326,7 @@ void XSpreadsheets2::importSheetToCopy()
 
 bool XSpreadsheets2::isExternalReference(const OUString& aDestContent, const OUString& aSrcContent )
 {
-    OUString aStart("'file://");
-
-    CPPUNIT_ASSERT(aDestContent.startsWith(aStart));
+    CPPUNIT_ASSERT(aDestContent.startsWith("'file://"));
 
     return  (aDestContent.endsWithIgnoreAsciiCase(aSrcContent) // same cell address
             && aDestContent.indexOf(aSrcFileName)>0); // contains source file name
diff --git a/test/source/sheet/xstyleloader.cxx b/test/source/sheet/xstyleloader.cxx
index 717f3e4a90f0..844e620e1d58 100644
--- a/test/source/sheet/xstyleloader.cxx
+++ b/test/source/sheet/xstyleloader.cxx
@@ -76,8 +76,7 @@ void XStyleLoader::checkStyleProperties( uno::Reference< style::XStyleFamiliesSu
   uno::Reference< style::XStyle > xMyStyle (xCellStyles->getByName("myStyle"), UNO_QUERY_THROW);
   uno::Reference< beans::XPropertySet > xPropSet (xMyStyle, UNO_QUERY_THROW);
 
-  OUString aCellStyleName("CellBackColor");
-  uno::Any aBackColor = xPropSet->getPropertyValue(aCellStyleName);
+  uno::Any aBackColor = xPropSet->getPropertyValue("CellBackColor");
   uno::Any expectedBackColor(sal_Int32(16724787));
 
   CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong CellBackColor" , expectedBackColor, aBackColor);
diff --git a/test/source/sheet/xviewpane.cxx b/test/source/sheet/xviewpane.cxx
index 759531019a27..be0600991194 100644
--- a/test/source/sheet/xviewpane.cxx
+++ b/test/source/sheet/xviewpane.cxx
@@ -36,7 +36,6 @@ void XViewPane::testFirstVisibleRow()
 
 void XViewPane::testVisibleRange()
 {
-    sal_Int16 nSheet = 0;
     sal_Int32 nCol = 5;
     sal_Int32 nRow = 3;
     uno::Reference < sheet::XViewPane > xViewPane(init(),UNO_QUERY_THROW);
@@ -44,7 +43,7 @@ void XViewPane::testVisibleRange()
     xViewPane->setFirstVisibleRow(nRow);
 
     table::CellRangeAddress aCellRangeAddress = xViewPane->getVisibleRange();
-    CPPUNIT_ASSERT_EQUAL(aCellRangeAddress.Sheet, nSheet);
+    CPPUNIT_ASSERT_EQUAL(aCellRangeAddress.Sheet, short(0));
     CPPUNIT_ASSERT_EQUAL(aCellRangeAddress.StartRow, nRow);
     CPPUNIT_ASSERT_EQUAL(aCellRangeAddress.StartColumn, nCol);
 }
diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx
index b2f3ac103bba..6fe73f2ab59c 100644
--- a/toolkit/source/awt/vclxprinter.cxx
+++ b/toolkit/source/awt/vclxprinter.cxx
@@ -280,14 +280,13 @@ sal_Bool VCLXPrinter::start( const OUString& /*rJobName*/, sal_Int16 /*nCopies*/
 {
     ::osl::MutexGuard aGuard( Mutex );
 
-    bool bDone = true;
     if (mxPrinter.get())
     {
         maInitJobSetup = mxPrinter->GetJobSetup();
         mxListener.reset(new vcl::OldStylePrintAdaptor(mxPrinter));
     }
 
-    return bDone;
+    return true;
 }
 
 void VCLXPrinter::end(  )
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index b874493e233a..1589c8e3ff12 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -1628,21 +1628,16 @@ void ControlContainerBase::ImplModelPropertiesChanged( const Sequence< PropertyC
 {
     if( !isDesignMode() && !mbCreatingCompatiblePeer )
     {
-        OUString s1( "PositionX" );
-        OUString s2( "PositionY" );
-        OUString s3( "Width" );
-        OUString s4( "Height" );
-
         sal_Int32 nLen = rEvents.getLength();
         for( sal_Int32 i = 0; i < nLen; i++ )
         {
             const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
             Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
             bool bOwnModel = xModel.get() == getModel().get();
-            if ( ( rEvt.PropertyName == s1 ) ||
-                 ( rEvt.PropertyName == s2 ) ||
-                 ( rEvt.PropertyName == s3 ) ||
-                 ( rEvt.PropertyName == s4 ) )
+            if ( ( rEvt.PropertyName == "PositionX" ) ||
+                 ( rEvt.PropertyName == "PositionY" ) ||
+                 ( rEvt.PropertyName == "Width" ) ||
+                 ( rEvt.PropertyName == "Height" ) )
             {
                 if ( bOwnModel )
                 {
@@ -1778,10 +1773,9 @@ void ControlContainerBase::ImplStartListingForResourceEvents()
 
 void ControlContainerBase::ImplUpdateResourceResolver()
 {
-    OUString aPropName( PROPERTY_RESOURCERESOLVER );
     Reference< resource::XStringResourceResolver > xStringResourceResolver;
 
-    ImplGetPropertyValue( aPropName ) >>= xStringResourceResolver;
+    ImplGetPropertyValue( PROPERTY_RESOURCERESOLVER ) >>= xStringResourceResolver;
     if ( !xStringResourceResolver.is() )
         return;
 
diff --git a/toolkit/source/controls/roadmapentry.cxx b/toolkit/source/controls/roadmapentry.cxx
index 3238b6e5d578..1efe5b39ee57 100644
--- a/toolkit/source/controls/roadmapentry.cxx
+++ b/toolkit/source/controls/roadmapentry.cxx
@@ -76,8 +76,7 @@ css::uno::Reference< css:: beans::XPropertySetInfo > SAL_CALL
 
 OUString SAL_CALL ORoadmapEntry::getImplementationName(  )
 {
-    OUString aStr("com.sun.star.comp.toolkit.RoadmapItem");
-    return aStr;
+    return OUString("com.sun.star.comp.toolkit.RoadmapItem");
 }
 
 sal_Bool SAL_CALL ORoadmapEntry::supportsService( const OUString& ServiceName )
diff --git a/toolkit/source/controls/unocontrolbase.cxx b/toolkit/source/controls/unocontrolbase.cxx
index 6ad663687ccb..d5648869a69e 100644
--- a/toolkit/source/controls/unocontrolbase.cxx
+++ b/toolkit/source/controls/unocontrolbase.cxx
@@ -74,11 +74,6 @@ void UnoControlBase::ImplSetPropertyValues( const css::uno::Sequence< OUString >
         if ( !bUpdateThis )
             ImplLockPropertyChangeNotifications( aPropertyNames, false );
     }
-    else
-    {
-        int dummy = 0;
-        (void)dummy;
-    }
 }
 
 void UnoControlBase::ImplSetPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue, bool bUpdateThis )
diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx
index e1b0a5a13eb6..68b8a960d12a 100644
--- a/toolkit/source/controls/unocontrolcontainer.cxx
+++ b/toolkit/source/controls/unocontrolcontainer.cxx
@@ -281,10 +281,9 @@ UnoControlHolderList::ControlIdentifier UnoControlHolderList::impl_getFreeIdenti
 
 OUString UnoControlHolderList::impl_getFreeName_throw()
 {
-    OUString name( "control_" );
     for ( ControlIdentifier candidateId = 0; candidateId < ::std::numeric_limits< ControlIdentifier >::max(); ++candidateId )
     {
-        OUString candidateName( name + OUString::number( candidateId ) );
+        OUString candidateName( "control_" + OUString::number( candidateId ) );
         ControlMap::const_iterator loop = maControls.begin();
         for ( ; loop != maControls.end(); ++loop )
         {
diff --git a/tools/qa/cppunit/test_reversemap.cxx b/tools/qa/cppunit/test_reversemap.cxx
index 1f1f7c3b9fb0..d6da18a570fd 100644
--- a/tools/qa/cppunit/test_reversemap.cxx
+++ b/tools/qa/cppunit/test_reversemap.cxx
@@ -60,7 +60,7 @@ namespace
             aAllChars[i-1] = static_cast<sal_Char>(i);
 
         //Some slots are unused, so don't map to private, just set them to 'X'
-        sal_uInt32 convertFlags = OUSTRING_TO_OSTRING_CVTFLAGS ^ RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE;
+        sal_uInt32 const convertFlags = OUSTRING_TO_OSTRING_CVTFLAGS ^ RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE;
         OUString sOrigText(&aAllChars[0], aAllChars.size(), eEncoding, convertFlags);
         sOrigText = sOrigText.replace( 0xfffd, 'X' );
 
diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx
index bc830767c280..a28abe320868 100644
--- a/tools/source/generic/b3dtrans.cxx
+++ b/tools/source/generic/b3dtrans.cxx
@@ -447,7 +447,6 @@ void B3dCamera::CalcNewViewportValues()
 bool B3dCamera::CalcFocalLength()
 {
     double fWidth = GetDeviceRectangleWidth();
-    bool bRetval = false;
 
     // Adjust focal length based on given position
     basegfx::B3DPoint aOldPosition;
@@ -456,7 +455,7 @@ bool B3dCamera::CalcFocalLength()
         fFocalLength = aOldPosition.getZ() / fWidth * 35.0;
     if(fFocalLength < 5.0)
         fFocalLength = 5.0;
-    return bRetval;
+    return false;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx
index c1055885ab76..a58f29e71307 100644
--- a/tools/source/generic/color.cxx
+++ b/tools/source/generic/color.cxx
@@ -296,7 +296,6 @@ void Color::ApplyTintOrShade(sal_Int16 n100thPercent)
 
 SvStream& WriteColor( SvStream& rOStream, const Color& rColor )
 {
-    sal_uInt16 nColorName   = COL_NAME_USER;
     sal_uInt16 nRed         = rColor.GetRed();
     sal_uInt16 nGreen       = rColor.GetGreen();
     sal_uInt16 nBlue        = rColor.GetBlue();
@@ -304,7 +303,7 @@ SvStream& WriteColor( SvStream& rOStream, const Color& rColor )
     nGreen  = (nGreen<<8) + nGreen;
     nBlue   = (nBlue<<8) + nBlue;
 
-    rOStream.WriteUInt16( nColorName );
+    rOStream.WriteUInt16( COL_NAME_USER );
     rOStream.WriteUInt16( nRed );
     rOStream.WriteUInt16( nGreen );
     rOStream.WriteUInt16( nBlue );


More information about the Libreoffice-commits mailing list