[Libreoffice-commits] core.git: editeng/qa editeng/source extensions/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Jun 23 11:24:04 UTC 2017


 editeng/qa/unit/core-test.cxx                      |   41 ++++++++-------------
 editeng/source/editeng/editobj.cxx                 |    3 -
 editeng/source/editeng/editview.cxx                |    2 -
 editeng/source/editeng/impedit.cxx                 |    2 -
 editeng/source/editeng/impedit3.cxx                |    3 -
 editeng/source/items/frmitems.cxx                  |    4 --
 editeng/source/items/textitem.cxx                  |    6 +--
 editeng/source/misc/svxacorr.cxx                   |   10 +----
 editeng/source/misc/unolingu.cxx                   |    3 -
 editeng/source/outliner/outliner.cxx               |    2 -
 editeng/source/uno/unotext.cxx                     |    6 +--
 extensions/source/abpilot/datasourcehandling.cxx   |    3 -
 extensions/source/abpilot/fieldmappingimpl.cxx     |    2 -
 extensions/source/bibliography/bibconfig.cxx       |   24 +++---------
 extensions/source/bibliography/datman.cxx          |    6 +--
 extensions/source/dbpilots/controlwizard.cxx       |    6 +--
 extensions/source/dbpilots/optiongrouplayouter.cxx |    4 --
 extensions/source/propctrlr/browserline.cxx        |    4 +-
 18 files changed, 45 insertions(+), 86 deletions(-)

New commits:
commit bf39807c67eb2dc7596926486a22d781e8969d47
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Jun 23 10:22:25 2017 +0200

    loplugin:oncevar editeng..extensions
    
    Change-Id: I3a63e3e3b873ef8a2d708d39be084124a6ad1346
    Reviewed-on: https://gerrit.libreoffice.org/39153
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index b71c90c72dfc..1f67db2b479a 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -332,8 +332,8 @@ void Test::testAutocorrect()
 
     {
         OUString sInput("TEst-TEst");
-        sal_Unicode cNextChar(' ');
-        OUString sExpected("Test-Test ");
+        sal_Unicode const cNextChar(' ');
+        OUString const sExpected("Test-Test ");
 
         TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US);
         aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true);
@@ -343,8 +343,8 @@ void Test::testAutocorrect()
 
     {
         OUString sInput("TEst/TEst");
-        sal_Unicode cNextChar(' ');
-        OUString sExpected("Test/Test ");
+        sal_Unicode const cNextChar(' ');
+        OUString const sExpected("Test/Test ");
 
         TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US);
         aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true);
@@ -355,8 +355,8 @@ void Test::testAutocorrect()
     {
         // test auto-bolding with '*'
         OUString sInput("*foo");
-        sal_Unicode cNextChar('*');
-        OUString sExpected("foo");
+        sal_Unicode const cNextChar('*');
+        OUString const sExpected("foo");
 
         TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US);
         aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true);
@@ -366,8 +366,8 @@ void Test::testAutocorrect()
 
     {
         OUString sInput("Test. test");
-        sal_Unicode cNextChar(' ');
-        OUString sExpected("Test. Test ");
+        sal_Unicode const cNextChar(' ');
+        OUString const sExpected("Test. Test ");
 
         TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US);
         aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true);
@@ -378,8 +378,8 @@ void Test::testAutocorrect()
     // don't autocapitalize after a field mark
     {
         OUString sInput("Test. \x01 test");
-        sal_Unicode cNextChar(' ');
-        OUString sExpected("Test. \x01 test ");
+        sal_Unicode const cNextChar(' ');
+        OUString const sExpected("Test. \x01 test ");
 
         TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US);
         aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true);
@@ -771,8 +771,7 @@ void Test::testBoldItalicCopyPaste()
     std::vector<editeng::Section> aAttrs1;
     pEditText1->GetAllSections( aAttrs1 );
     // There should be 3 sections - woBold - wBold - woBold (w - with, wo - without)
-    size_t nSecCountCheck1 = 3;
-    CPPUNIT_ASSERT_EQUAL( nSecCountCheck1, aAttrs1.size() );
+    CPPUNIT_ASSERT_EQUAL( size_t(3), aAttrs1.size() );
 
     const editeng::Section* pSecAttr = &aAttrs1[0];
     CPPUNIT_ASSERT_EQUAL( 0, (int)pSecAttr->mnParagraph );
@@ -804,8 +803,7 @@ void Test::testBoldItalicCopyPaste()
     std::vector<editeng::Section> aAttrs2;
     pEditText2->GetAllSections( aAttrs2 );
     // There should be 5 sections - woBold&woItalic - wBold&woItalic - wBold&wItalic - woBold&wItalic - woBold&woItalic (w - with, wo - without)
-    size_t nSecCountCheck2 = 5;
-    CPPUNIT_ASSERT_EQUAL( nSecCountCheck2, aAttrs2.size() );
+    CPPUNIT_ASSERT_EQUAL( size_t(5), aAttrs2.size() );
 
     pSecAttr = &aAttrs2[0];
     CPPUNIT_ASSERT_EQUAL( 0, (int)pSecAttr->mnParagraph );
@@ -856,8 +854,7 @@ void Test::testBoldItalicCopyPaste()
     pEditText3->GetAllSections( aAttrs3 );
     // There should be 9 sections - woBold&woItalic - wBold&woItalic - wBold&wItalic - woBold&wItalic - woBold&woItalic - wBold&woItalic
     // - wBold&wItalic - woBold&wItalic - woBold&woItalic(w - with, wo - without)
-    size_t nSecCountCheck3 = 9;
-    CPPUNIT_ASSERT_EQUAL( nSecCountCheck3, aAttrs3.size() );
+    CPPUNIT_ASSERT_EQUAL( size_t(9), aAttrs3.size() );
 
     pSecAttr = &aAttrs3[0];
     CPPUNIT_ASSERT_EQUAL( 0, (int)pSecAttr->mnParagraph );
@@ -972,8 +969,7 @@ void Test::testUnderlineCopyPaste()
     pEditText1->GetAllSections( aAttrs1 );
 
     // There should be 3 sections - woUnderline - wUnderline - woUnderline (w - with, wo - without)
-    size_t nSecCountCheck1 = 3;
-    CPPUNIT_ASSERT_EQUAL( nSecCountCheck1, aAttrs1.size() );
+    CPPUNIT_ASSERT_EQUAL( size_t(3), aAttrs1.size() );
 
     const editeng::Section* pSecAttr = &aAttrs1[0];
     CPPUNIT_ASSERT_EQUAL( 0, (int)pSecAttr->mnParagraph );
@@ -1010,8 +1006,7 @@ void Test::testUnderlineCopyPaste()
     pEditText2->GetAllSections( aAttrs2 );
 
     // There should be 4 sections - woUnderline - wUnderline - woUnderline - wUnderline (w - with, wo - without)
-    size_t nSecCountCheck2 = 4;
-    CPPUNIT_ASSERT_EQUAL( nSecCountCheck2, aAttrs2.size() );
+    CPPUNIT_ASSERT_EQUAL( size_t(4), aAttrs2.size() );
 
     pSecAttr = &aAttrs2[0];
     CPPUNIT_ASSERT_EQUAL( 0, (int)pSecAttr->mnParagraph );
@@ -1098,8 +1093,7 @@ void Test::testSectionAttributes()
         aEngine.Clear();
         aEngine.SetText("one\n\ntwo\n\nthree");
         sal_Int32 nParaCount = aEngine.GetParagraphCount();
-        sal_Int32 nCheck = 5;
-        CPPUNIT_ASSERT_EQUAL(nCheck, nParaCount);
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(5), nParaCount);
 
         // Apply boldness to paragraphs 1, 3, 5 only. Leave 2 and 4 unformatted.
         pSet.reset(new SfxItemSet(aEngine.GetEmptyItemSet()));
@@ -1113,8 +1107,7 @@ void Test::testSectionAttributes()
         CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText.get());
         std::vector<editeng::Section> aAttrs;
         pEditText->GetAllSections(aAttrs);
-        size_t nSecCountCheck = 5;
-        CPPUNIT_ASSERT_EQUAL(nSecCountCheck, aAttrs.size());
+        CPPUNIT_ASSERT_EQUAL(size_t(5), aAttrs.size());
 
         // 1st, 3rd and 5th sections should correspond with 1st, 3rd and 5th paragraphs.
         const editeng::Section* pSecAttr = &aAttrs[0];
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 8eee9ea854ef..6c51e587b5be 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1106,8 +1106,7 @@ public:
 
 void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
 {
-    sal_uInt16 nVer = 603;
-    rOStream.WriteUInt16( nVer );
+    rOStream.WriteUInt16( 603 ); // nVer
 
     rOStream.WriteBool( bOwnerOfPool );
 
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index d43131ee7b5a..77cabbec1123 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -133,7 +133,7 @@ LanguageType EditView::CheckLanguage(
         lang::Locale a3( LanguageTag::convertToLocale( aLangList[3] ) );
 #endif
 
-        sal_Int32 nCount = SAL_N_ELEMENTS(aLangList);
+        sal_Int32 const nCount = SAL_N_ELEMENTS(aLangList);
         for (sal_Int32 i = 0;  i < nCount;  i++)
         {
             LanguageType nTmpLang = aLangList[i];
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index cba53df3c486..be17edb0bc3d 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1069,7 +1069,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
         {
             SvxFont aFont;
             pEditEngine->SeekCursor( aPaM.GetNode(), aPaM.GetIndex()+1, aFont );
-            InputContextFlags nContextFlags = InputContextFlags::Text|InputContextFlags::ExtText;
+            InputContextFlags const nContextFlags = InputContextFlags::Text | InputContextFlags::ExtText;
             GetWindow()->SetInputContext( InputContext( aFont, nContextFlags ) );
         }
     }
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 3d0875993baa..5ad6d694cf22 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1684,15 +1684,12 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion )
         SvxAdjust eJustification = GetJustification( nPara );
         long nMaxLineWidth = !IsVertical() ? aPaperSize.Width() : aPaperSize.Height();
         nMaxLineWidth -= GetXValue( rLRItem.GetRight() );
-        long nTextXOffset = 0;
         if ( nMaxLineWidth < 0 )
             nMaxLineWidth = 1;
         if ( eJustification ==  SvxAdjust::Center )
             nStartX = nMaxLineWidth / 2;
         else if ( eJustification ==  SvxAdjust::Right )
             nStartX = nMaxLineWidth;
-
-        nStartX = nStartX + nTextXOffset;
     }
 
     pTmpLine->SetStartPosX( nStartX );
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 0d2955cdae65..b98cd2507942 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3502,12 +3502,10 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
                 sLink = maStrLink;
             else if (xGraphicObject)
             {
-                OUString sPrefix(
-                    UNO_NAME_GRAPHOBJ_URLPREFIX);
                 OUString sId(OStringToOUString(
                     xGraphicObject->GetUniqueID(),
                     RTL_TEXTENCODING_ASCII_US));
-                sLink = sPrefix + sId;
+                sLink = UNO_NAME_GRAPHOBJ_URLPREFIX + sId;
             }
             rVal <<= sLink;
         }
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index e40a630698d2..bb6b66e2ad31 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -357,8 +357,7 @@ SvStream& SvxFontItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) co
     // catch for EditEngine, only set while creating clipboard stream.
     if ( bEnableStoreUnicodeNames )
     {
-        sal_uInt32 nMagic = STORE_UNICODE_MAGIC_MARKER;
-        rStrm.WriteUInt32( nMagic );
+        rStrm.WriteUInt32( STORE_UNICODE_MAGIC_MARKER );
         rStrm.WriteUniOrByteString( aStoreFamilyName, RTL_TEXTENCODING_UNICODE );
         rStrm.WriteUniOrByteString( GetStyleName(), RTL_TEXTENCODING_UNICODE );
     }
@@ -2652,7 +2651,6 @@ bool SvxEmphasisMarkItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) cons
 bool SvxEmphasisMarkItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
 {
     nMemberId &= ~CONVERT_TWIPS;
-    bool bRet = true;
     switch( nMemberId )
     {
     case MID_EMPHASIS:
@@ -2677,7 +2675,7 @@ bool SvxEmphasisMarkItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
     }
     break;
     }
-    return bRet;
+    return true;
 }
 
 sal_uInt16 SvxEmphasisMarkItem::GetVersion( sal_uInt16 nFFVer ) const
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index d8804dcd1727..b5dd3a1233cd 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2067,8 +2067,7 @@ void SvxAutoCorrectLanguageLists::SaveExceptList_Imp(
             {
                 xStrm->SetSize( 0 );
                 xStrm->SetBufferSize( 8192 );
-                OUString aMime( "text/xml" );
-                xStrm->SetProperty( "MediaType", Any(aMime) );
+                xStrm->SetProperty( "MediaType", Any(OUString( "text/xml" )) );
 
 
                 uno::Reference< uno::XComponentContext > xContext =
@@ -2356,8 +2355,7 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl()
         try
         {
             OUString sMain(aDest.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ));
-            sal_Unicode cSlash = '/';
-            sal_Int32 nSlashPos = sMain.lastIndexOf(cSlash);
+            sal_Int32 nSlashPos = sMain.lastIndexOf('/');
             sMain = sMain.copy(0, nSlashPos);
             ::ucbhelper::Content aNewContent( sMain, uno::Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
             TransferInfo aInfo;
@@ -2432,9 +2430,7 @@ bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SotStorage& rStg )
         {
             refList->SetSize( 0 );
             refList->SetBufferSize( 8192 );
-            OUString aPropName( "MediaType" );
-            OUString aMime( "text/xml" );
-            refList->SetProperty( aPropName, Any(aMime) );
+            refList->SetProperty( "MediaType", Any(OUString( "text/xml" )) );
 
             uno::Reference< uno::XComponentContext > xContext =
                 comphelper::getProcessComponentContext();
diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx
index 722ee855f9dd..e21de08007d1 100644
--- a/editeng/source/misc/unolingu.cxx
+++ b/editeng/source/misc/unolingu.cxx
@@ -104,8 +104,7 @@ void ThesDummy_Impl::GetCfgLocales()
     if (!pLocaleSeq)
     {
         SvtLinguConfig aCfg;
-        OUString  aNode("ServiceManager/ThesaurusList");
-        Sequence < OUString > aNodeNames( aCfg.GetNodeNames( aNode ) );
+        Sequence < OUString > aNodeNames( aCfg.GetNodeNames( "ServiceManager/ThesaurusList" ) );
         const OUString *pNodeNames = aNodeNames.getConstArray();
         sal_Int32 nLen = aNodeNames.getLength();
         pLocaleSeq.reset( new Sequence< lang::Locale >( nLen ) );
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 9362efbbfb5d..51b06af008d0 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2095,7 +2095,7 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const
     {
         ESelection aEmptySel(0,0,0,0);
         //EditTextObject *pTObj = pEditEngine->CreateTextObject(aEmptySel);
-        bool bLastParaInterrupted = true; // Last Para was interrupted since everything overflew
+        bool const bLastParaInterrupted = true; // Last Para was interrupted since everything overflew
         return new NonOverflowingText(aEmptySel, bLastParaInterrupted);
     } else { // Get the lines that of the overflowing para fit in the box
 
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index befcc07afa72..058e56ad7d9f 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -652,13 +652,11 @@ void SvxUnoTextRangeBase::getPropertyValue( const SfxItemPropertySimpleEntry* pM
     case WID_PORTIONTYPE:
         if ( rSet.GetItemState( EE_FEATURE_FIELD, false ) == SfxItemState::SET )
         {
-            OUString aType("TextField");
-            rAny <<= aType;
+            rAny <<= OUString("TextField");
         }
         else
         {
-            OUString aType("Text");
-            rAny <<= aType;
+            rAny <<= OUString("Text");
         }
         break;
 
diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx
index b7a2c3492e7c..88abdcce660e 100644
--- a/extensions/source/abpilot/datasourcehandling.cxx
+++ b/extensions/source/abpilot/datasourcehandling.cxx
@@ -547,9 +547,8 @@ namespace abp
         // failure to create the interaction handler is a serious issue ...
         if (!xInteractions.is())
         {
-            OUString s_sInteractionHandlerServiceName("com.sun.star.task.InteractionHandler");
             if ( _pMessageParent )
-                ShowServiceNotAvailableError( _pMessageParent, s_sInteractionHandlerServiceName, true );
+                ShowServiceNotAvailableError( _pMessageParent, "com.sun.star.task.InteractionHandler", true );
             return false;
         }
 
diff --git a/extensions/source/abpilot/fieldmappingimpl.cxx b/extensions/source/abpilot/fieldmappingimpl.cxx
index 1aba04832332..392a613bd694 100644
--- a/extensions/source/abpilot/fieldmappingimpl.cxx
+++ b/extensions/source/abpilot/fieldmappingimpl.cxx
@@ -168,7 +168,7 @@ namespace abp
                 DBG_ASSERT( 0 == SAL_N_ELEMENTS( pMappingProgrammatics ) % 2,
                     "fieldmapping::defaultMapping: invalid programmatic map!" );
                 // number of pairs
-                sal_Int32 nIntersectedProgrammatics = SAL_N_ELEMENTS( pMappingProgrammatics ) / 2;
+                sal_Int32 const nIntersectedProgrammatics = SAL_N_ELEMENTS( pMappingProgrammatics ) / 2;
 
                 const sal_Char** pProgrammatic = pMappingProgrammatics;
                 OUString sAddressProgrammatic;
diff --git a/extensions/source/bibliography/bibconfig.cxx b/extensions/source/bibliography/bibconfig.cxx
index af33237173ee..7eb7402429ee 100644
--- a/extensions/source/bibliography/bibconfig.cxx
+++ b/extensions/source/bibliography/bibconfig.cxx
@@ -124,9 +124,6 @@ BibConfig::BibConfig()
             }
         }
     }
-    OUString sName("DataSourceName");
-    OUString sTable("Command");
-    OUString sCommandType("CommandType");
     Sequence< OUString > aNodeNames = GetNodeNames(cDataSourceHistory);
     const OUString* pNodeNames = aNodeNames.getConstArray();
     for(sal_Int32 nNode = 0; nNode < aNodeNames.getLength(); nNode++)
@@ -138,12 +135,9 @@ BibConfig::BibConfig()
         sPrefix += "/";
         sPrefix += pNodeNames[nNode];
         sPrefix += "/";
-        pHistoryNames[0] = sPrefix;
-        pHistoryNames[0] += sName;
-        pHistoryNames[1] = sPrefix;
-        pHistoryNames[1] += sTable;
-        pHistoryNames[2] = sPrefix;
-        pHistoryNames[2] += sCommandType;
+        pHistoryNames[0] = sPrefix + "DataSourceName";
+        pHistoryNames[1] = sPrefix + "Command";
+        pHistoryNames[2] = sPrefix + "CommandType";
 
         Sequence<Any> aHistoryValues = GetProperties( aHistoryNames );
         const Any* pHistoryValues = aHistoryValues.getConstArray();
@@ -233,9 +227,6 @@ void    BibConfig::ImplCommit()
     PropertyValue* pNodeValues = aNodeValues.getArray();
 
     sal_Int32 nIndex = 0;
-    OUString sName("DataSourceName");
-    OUString sTable("Command");
-    OUString sCommandType("CommandType");
     for(sal_Int32 i = 0; i < (sal_Int32)pMappingsArr->size(); i++)
     {
         const Mapping* pMapping = (*pMappingsArr)[i].get();
@@ -243,14 +234,11 @@ void    BibConfig::ImplCommit()
         sPrefix += "/_";
         sPrefix += OUString::number(i);
         sPrefix += "/";
-        pNodeValues[nIndex].Name    = sPrefix;
-        pNodeValues[nIndex].Name    += sName;
+        pNodeValues[nIndex].Name    = sPrefix + "DataSourceName";
         pNodeValues[nIndex++].Value <<= pMapping->sURL;
-        pNodeValues[nIndex].Name    = sPrefix;
-        pNodeValues[nIndex].Name    += sTable;
+        pNodeValues[nIndex].Name    = sPrefix + "Command";
         pNodeValues[nIndex++].Value <<= pMapping->sTableName;
-        pNodeValues[nIndex].Name    = sPrefix;
-        pNodeValues[nIndex].Name    += sCommandType;
+        pNodeValues[nIndex].Name    = sPrefix + "CommandType";
         pNodeValues[nIndex++].Value <<= pMapping->nCommandType;
         SetSetProperties(cDataSourceHistory, aNodeValues);
 
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 3514fba2c249..9f7d29c84fd9 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -1447,13 +1447,12 @@ void BibDataManager::SetMeAsUidListener()
         Sequence< OUString > aFields(xFields->getElementNames());
         const OUString* pFields = aFields.getConstArray();
         sal_Int32 nCount=aFields.getLength();
-        OUString StrUID(STR_UID);
         OUString theFieldName;
         for( sal_Int32 i=0; i<nCount; i++ )
         {
             const OUString& rName = pFields[i];
 
-            if (rName.equalsIgnoreAsciiCase(StrUID))
+            if (rName.equalsIgnoreAsciiCase(STR_UID))
             {
                 theFieldName=pFields[i];
                 break;
@@ -1490,13 +1489,12 @@ void BibDataManager::RemoveMeAsUidListener()
         Sequence< OUString > aFields(xFields->getElementNames());
         const OUString* pFields = aFields.getConstArray();
         sal_Int32 nCount=aFields.getLength();
-        OUString StrUID(STR_UID);
         OUString theFieldName;
         for( sal_Int32 i=0; i<nCount; i++ )
         {
             const OUString& rName = pFields[i];
 
-            if (rName.equalsIgnoreAsciiCase(StrUID))
+            if (rName.equalsIgnoreAsciiCase(STR_UID))
             {
                 theFieldName=pFields[i];
                 break;
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx
index 6d4d476c173c..8bf34931d91a 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -155,11 +155,10 @@ namespace dbp
         const OUString* pItems = _rItems.getConstArray();
         const OUString* pEnd = pItems + _rItems.getLength();
         ::svt::WizardTypes::WizardState nPos;
-        sal_Int32 nIndex = 0;
         for (;pItems < pEnd; ++pItems)
         {
             nPos = _rList.InsertEntry(*pItems);
-            _rList.SetEntryData(nPos, reinterpret_cast<void*>(nIndex));
+            _rList.SetEntryData(nPos, reinterpret_cast<void*>(0));
         }
     }
 
@@ -637,9 +636,8 @@ namespace dbp
         // the only thing we have at the moment is the label
         try
         {
-            OUString sLabelPropertyName("Label");
             Reference< XPropertySetInfo > xInfo = m_aContext.xObjectModel->getPropertySetInfo();
-            if (xInfo.is() && xInfo->hasPropertyByName(sLabelPropertyName))
+            if (xInfo.is() && xInfo->hasPropertyByName("Label"))
             {
                 OUString sControlLabel(_pSettings->sControlLabel);
                 m_aContext.xObjectModel->setPropertyValue(
diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx b/extensions/source/dbpilots/optiongrouplayouter.cxx
index b8c90319b4c9..c79359461233 100644
--- a/extensions/source/dbpilots/optiongrouplayouter.cxx
+++ b/extensions/source/dbpilots/optiongrouplayouter.cxx
@@ -75,8 +75,6 @@ namespace dbp
         // no. of buttons to create
         sal_Int32 nRadioButtons = _rSettings.aLabels.size();
 
-        sal_Int32 nTopSpace = 0;
-
         // the shape of the groupbox
         css::awt::Size aControlShapeSize = _rContext.xObjectShape->getSize();
         // maybe need to adjust the size if the control shapes
@@ -112,7 +110,7 @@ namespace dbp
         StringArray::const_iterator aValueIter = _rSettings.aValues.begin();
         for (sal_Int32 i=0; i<nRadioButtons; ++i, ++aLabelIter, ++aValueIter)
         {
-            aButtonPosition.Y = aShapePosition.Y + (i+1) * nTempHeight + nTopSpace;
+            aButtonPosition.Y = aShapePosition.Y + (i+1) * nTempHeight;
 
             Reference< XPropertySet > xRadioModel(
                     xDocFactory->createInstance("com.sun.star.form.component.RadioButton"),
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index 32c9cb680780..e345381733e9 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -268,7 +268,7 @@ namespace pcr
             // for Issue 69452
             if (AllSettings::GetLayoutRTL())
             {
-                sal_Unicode cRTL_mark = 0x200F;
+                sal_Unicode const cRTL_mark = 0x200F;
                 aText.append( OUString(cRTL_mark) );
             }
 
@@ -284,7 +284,7 @@ namespace pcr
         // for Issue 69452
         if (AllSettings::GetLayoutRTL())
         {
-            sal_Unicode cRTL_mark = 0x200F;
+            sal_Unicode const cRTL_mark = 0x200F;
             sDisplayName = comphelper::string::stripEnd(sDisplayName, cRTL_mark);
         }
 


More information about the Libreoffice-commits mailing list