[Libreoffice-commits] core.git: ucb/source unotools/source unoxml/source uui/source vbahelper/source

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


 ucb/source/core/ucbstore.cxx                                  |   20 ++++------
 ucb/source/ucp/cmis/auth_provider.cxx                         |    3 -
 ucb/source/ucp/ext/ucpext_content.cxx                         |    4 --
 ucb/source/ucp/file/filglob.cxx                               |    3 -
 ucb/source/ucp/file/filrset.cxx                               |   12 ++----
 ucb/source/ucp/file/filtask.cxx                               |    5 +-
 ucb/source/ucp/tdoc/tdoc_storage.cxx                          |    2 -
 ucb/source/ucp/webdav-neon/LinkSequence.cxx                   |   10 +----
 unotools/source/accessibility/accessiblerelationsethelper.cxx |    6 +--
 unotools/source/config/fontcfg.cxx                            |   14 +++----
 unotools/source/config/lingucfg.cxx                           |    3 -
 unotools/source/misc/ZipPackageHelper.cxx                     |    3 -
 unotools/source/misc/fontcvt.cxx                              |    6 +--
 unotools/source/misc/mediadescriptor.cxx                      |    3 -
 unotools/source/ucbhelper/ucblockbytes.cxx                    |    3 -
 unoxml/source/dom/elementlist.cxx                             |    7 +--
 uui/source/iahndl.cxx                                         |   15 ++-----
 uui/source/secmacrowarnings.cxx                               |    4 --
 vbahelper/source/msforms/vbacontrol.cxx                       |    4 +-
 vbahelper/source/vbahelper/vbaapplicationbase.cxx             |    3 -
 vbahelper/source/vbahelper/vbacommandbarcontrols.cxx          |    4 --
 vbahelper/source/vbahelper/vbadocumentbase.cxx                |    3 -
 vbahelper/source/vbahelper/vbashapes.cxx                      |   18 +++------
 23 files changed, 55 insertions(+), 100 deletions(-)

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

    loplugin:oncevar in ucb..vbahelper
    
    Change-Id: I1fc7c7505a42b3bf9d4a5ab22961930b9831d4ae
    Reviewed-on: https://gerrit.libreoffice.org/39327
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 18f3af60e1c1..d9e4154e7ed0 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -736,10 +736,10 @@ void PropertySetRegistry::renamePropertySet( const OUString& rOldKey,
 
                         aOldValuesKey += "/";
 
-                        OUString aHandleKey("/Handle");
-                        OUString aValueKey("/Value");
-                        OUString aStateKey("/State");
-                        OUString aAttrKey("/Attributes");
+                        OUString const aHandleKey("/Handle");
+                        OUString const aValueKey("/Value");
+                        OUString const aStateKey("/State");
+                        OUString const aAttrKey("/Attributes");
 
                         for ( sal_Int32 n = 0; n < nCount; ++n )
                         {
@@ -763,32 +763,28 @@ void PropertySetRegistry::renamePropertySet( const OUString& rOldKey,
                             aKey += makeHierarchalNameSegment( rPropName );
 
                             // ... handle
-                            OUString aNewKey1 = aKey;
-                            aNewKey1 += aHandleKey;
+                            OUString aNewKey1 = aKey + aHandleKey;
                             Any aAny =
                                 xRootHierNameAccess->getByHierarchicalName(
                                     aNewKey1 );
                             xNewPropNameReplace->replaceByName( "Handle", aAny );
 
                             // ... value
-                            aNewKey1 = aKey;
-                            aNewKey1 += aValueKey;
+                            aNewKey1 = aKey + aValueKey;
                             aAny =
                                 xRootHierNameAccess->getByHierarchicalName(
                                     aNewKey1 );
                             xNewPropNameReplace->replaceByName( "Value", aAny );
 
                             // ... state
-                            aNewKey1 = aKey;
-                            aNewKey1 += aStateKey;
+                            aNewKey1 = aKey + aStateKey;
                             aAny =
                                 xRootHierNameAccess->getByHierarchicalName(
                                     aNewKey1 );
                             xNewPropNameReplace->replaceByName( "State", aAny );
 
                             // ... attributes
-                            aNewKey1 = aKey;
-                            aNewKey1 += aAttrKey;
+                            aNewKey1 = aKey + aAttrKey;
                             aAny =
                                 xRootHierNameAccess->getByHierarchicalName(
                                     aNewKey1 );
diff --git a/ucb/source/ucp/cmis/auth_provider.cxx b/ucb/source/ucp/cmis/auth_provider.cxx
index b3370eb26fab..c6d5b28bcb56 100644
--- a/ucb/source/ucp/cmis/auth_provider.cxx
+++ b/ucb/source/ucp/cmis/auth_provider.cxx
@@ -126,7 +126,6 @@ namespace cmis
             const char* /*password*/ )
     {
         OUString instructions = "PIN:";
-        OUString url_oustr( "" );
         const css::uno::Reference<
             css::ucb::XCommandEnvironment> xEnv = getXEnv( );
 
@@ -139,7 +138,7 @@ namespace cmis
             {
                 rtl::Reference< ucbhelper::AuthenticationFallbackRequest > xRequest
                     = new ucbhelper::AuthenticationFallbackRequest (
-                            instructions, url_oustr );
+                            instructions, "" );
 
                 xIH->handle( xRequest.get() );
 
diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx
index 1dd52774ab9f..378c402db518 100644
--- a/ucb/source/ucp/ext/ucpext_content.cxx
+++ b/ucb/source/ucp/ext/ucpext_content.cxx
@@ -528,10 +528,8 @@ namespace ucb { namespace ucp { namespace ext
 
     Sequence< CommandInfo > Content::getCommands( const Reference< XCommandEnvironment > & /*xEnv*/ )
     {
-        sal_uInt32 nCommandCount = 5;
         static const CommandInfo aCommandInfoTable[] =
         {
-
             // Mandatory commands
 
             CommandInfo(
@@ -564,7 +562,7 @@ namespace ucb { namespace ucp { namespace ext
             )
         };
 
-        return Sequence< CommandInfo >( aCommandInfoTable, nCommandCount );
+        return Sequence< CommandInfo >( aCommandInfoTable, SAL_N_ELEMENTS(aCommandInfoTable) );
     }
 
 
diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx
index 32010ebf050e..83c6e2ca1a9c 100644
--- a/ucb/source/ucp/file/filglob.cxx
+++ b/ucb/source/ucp/file/filglob.cxx
@@ -186,8 +186,7 @@ namespace fileaccess {
 
     OUString getTitle( const OUString& aPath )
     {
-        sal_Unicode slash = '/';
-        sal_Int32 lastIndex = aPath.lastIndexOf( slash );
+        sal_Int32 lastIndex = aPath.lastIndexOf( '/' );
         return aPath.copy( lastIndex + 1 );
     }
 
diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx
index 3234e975ab10..ff49703198a5 100644
--- a/ucb/source/ucp/file/filrset.cxx
+++ b/ucb/source/ucp/file/filrset.cxx
@@ -190,10 +190,8 @@ void XResultSet_impl::isFinalChanged()
     aEv.PropertyName = "IsRowCountFinal";
     aEv.Further = false;
     aEv.PropertyHandle = -1;
-    bool fval = false;
-    bool tval = true;
-    aEv.OldValue <<= fval;
-    aEv.NewValue <<= tval;
+    aEv.OldValue <<= false;
+    aEv.NewValue <<= true;
     for( const auto& r : seq )
     {
         uno::Reference< beans::XPropertyChangeListener > listener(
@@ -609,12 +607,10 @@ XResultSet_impl::getMetaData()
     {
         if ( m_sProperty.getConstArray()[ n ].Name == "Title" )
         {
-            // @@@ #82177# - Determine correct value!
-            bool bCaseSensitiveChildren = false;
-
             std::vector< ::ucbhelper::ResultSetColumnData >
                                     aColumnData( m_sProperty.getLength() );
-            aColumnData[ n ].isCaseSensitive = bCaseSensitiveChildren;
+            // @@@ #82177# - Determine correct value!
+            aColumnData[ n ].isCaseSensitive = false;
 
             ::ucbhelper::ResultSetMetaData* p =
                 new ::ucbhelper::ResultSetMetaData(
diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index efad9a8ed735..8ae56e8fba74 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -978,12 +978,11 @@ TaskManager::setv( const OUString& aUnqPath,
                             "Uri", -1,
                             uno::makeAny(aUnqPath),
                             beans::PropertyState_DIRECT_VALUE);
-                        IOErrorCode ioError(IOErrorCode_GENERAL);
                         ret[i] <<= InteractiveAugmentedIOException(
                             OUString(),
                             nullptr,
                             task::InteractionClassification_ERROR,
-                            ioError,
+                            IOErrorCode_GENERAL,
                             names );
                     }
                 }
@@ -2069,7 +2068,7 @@ TaskManager::copy_recursive( const OUString& srcUnqPath,
         osl::FileBase::RC next = err;
         if( err == osl::FileBase::E_None )
         {
-            sal_Int32 n_Mask = osl_FileStatus_Mask_FileURL | osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Type;
+            sal_Int32 const n_Mask = osl_FileStatus_Mask_FileURL | osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Type;
 
             osl::DirectoryItem aDirItem;
 
diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx
index 39a0742d2ab8..f21c656795d2 100644
--- a/ucb/source/ucp/tdoc/tdoc_storage.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx
@@ -456,7 +456,7 @@ uno::Reference< embed::XStorage > StorageElementFactory::queryStorage(
         {
             try
             {
-                sal_Int32 nOpenMode = embed::ElementModes::READ
+                sal_Int32 const nOpenMode = embed::ElementModes::READ
                                       | embed::ElementModes::NOCREATE;
                 xStorage
                     = xParentStorage->openStorageElement( rName, nOpenMode );
diff --git a/ucb/source/ucp/webdav-neon/LinkSequence.cxx b/ucb/source/ucp/webdav-neon/LinkSequence.cxx
index 392584ebf5fc..cad12cda2894 100644
--- a/ucb/source/ucp/webdav-neon/LinkSequence.cxx
+++ b/ucb/source/ucp/webdav-neon/LinkSequence.cxx
@@ -197,17 +197,13 @@ bool LinkSequence::toXML( const uno::Sequence< ucb::Link > & rInData,
     sal_Int32 nCount = rInData.getLength();
     if ( nCount )
     {
-        OUString aPre( "<link><src>" );
-        OUString aMid( "</src><dst>" );
-        OUString aEnd( "</dst></link>" );
-
         for ( sal_Int32 n = 0; n < nCount; ++n )
         {
-                rOutData += aPre;
+                rOutData += "<link><src>";
                 rOutData += rInData[ n ].Source;
-                rOutData += aMid;
+                rOutData += "</src><dst>";
                 rOutData += rInData[ n ].Destination;
-                rOutData += aEnd;
+                rOutData += "</dst></link>";
         }
         return true;
     }
diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx b/unotools/source/accessibility/accessiblerelationsethelper.cxx
index 3ca876f1aa46..6456085f55a0 100644
--- a/unotools/source/accessibility/accessiblerelationsethelper.cxx
+++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx
@@ -83,13 +83,11 @@ AccessibleRelation AccessibleRelationSetHelperImpl::getRelationByType( sal_Int16
 {
     sal_Int32 nCount(getRelationCount());
     sal_Int32 i(0);
-    bool bFound(false);
-    while ((i < nCount) && !bFound)
+    while (i < nCount)
     {
         if (maRelations[i].RelationType == aRelationType)
             return maRelations[i];
-        else
-            i++;
+        i++;
     }
     return AccessibleRelation();
 }
diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx
index 37356821911b..8f577c70b0d0 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -1020,13 +1020,13 @@ void FontSubstConfiguration::readLocaleSubst( const OUString& rBcp47 ) const
                 it->second.aSubstAttributes.reserve( nFonts );
 
                 // strings for subst retrieval, construct only once
-                OUString aSubstFontsStr     ( "SubstFonts" );
-                OUString aSubstFontsMSStr   ( "SubstFontsMS" );
-                OUString aSubstFontsPSStr   ( "SubstFontsPS" );
-                OUString aSubstFontsHTMLStr ( "SubstFontsHTML" );
-                OUString aSubstWeightStr    ( "FontWeight" );
-                OUString aSubstWidthStr     ( "FontWidth" );
-                OUString aSubstTypeStr      ( "FontType" );
+                OUString const aSubstFontsStr     ( "SubstFonts" );
+                OUString const aSubstFontsMSStr   ( "SubstFontsMS" );
+                OUString const aSubstFontsPSStr   ( "SubstFontsPS" );
+                OUString const aSubstFontsHTMLStr ( "SubstFontsHTML" );
+                OUString const aSubstWeightStr    ( "FontWeight" );
+                OUString const aSubstWidthStr     ( "FontWidth" );
+                OUString const aSubstTypeStr      ( "FontType" );
                 for( int i = 0; i < nFonts; i++ )
                 {
                     Reference< XNameAccess > xFont;
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index d11b9c62fd6f..6dc0bf1ca68a 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -1158,8 +1158,7 @@ OUString SvtLinguConfig::GetSynonymsContextImage(
     OUString   aRes;
     if (!rServiceImplName.isEmpty())
     {
-        OUString aImageName( "SynonymsContextMenuImage" );
-        OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) );
+        OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, "SynonymsContextMenuImage" ) );
         aRes = aPath;
     }
     return aRes;
diff --git a/unotools/source/misc/ZipPackageHelper.cxx b/unotools/source/misc/ZipPackageHelper.cxx
index 609b863c6710..7d03b43a9279 100644
--- a/unotools/source/misc/ZipPackageHelper.cxx
+++ b/unotools/source/misc/ZipPackageHelper.cxx
@@ -87,8 +87,7 @@ ZipPackageHelper::ZipPackageHelper(
     mxFactory = xFactory;
 
     // get root zip folder
-    OUString szRootFolder("/");
-    mxHNameAccess->getByHierarchicalName( szRootFolder ) >>= mxRootFolder;
+    mxHNameAccess->getByHierarchicalName( "/" ) >>= mxRootFolder;
 }
 
 static OUString encodeZipUri( const OUString& rURI )
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index 97fdc3cb13af..dd3ad60fada3 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -1348,8 +1348,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const OUString& rOrgFontName, con
     if( aMapName == "starsymbol"
      || aMapName == "opensymbol" )
     {
-        int nEntries = SAL_N_ELEMENTS(aStarSymbolRecodeTable);
-        for( int i = 0; i < nEntries; ++i)
+        for( int i = 0; i < int(SAL_N_ELEMENTS(aStarSymbolRecodeTable)); ++i)
         {
             const RecodeTable& r = aStarSymbolRecodeTable[i];
             if( aOrgName.equalsAscii( r.pOrgName ) )
@@ -1364,8 +1363,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const OUString& rOrgFontName, con
     //adobe-symbol to unicode conversion in rtl instead
     else if( aMapName == "applesymbol" )
     {
-        int nEntries = SAL_N_ELEMENTS(aAppleSymbolRecodeTable);
-        for( int i = 0; i < nEntries; ++i)
+        for( int i = 0; i < int(SAL_N_ELEMENTS(aAppleSymbolRecodeTable)); ++i)
         {
             const RecodeTable& r = aAppleSymbolRecodeTable[i];
             if( aOrgName.equalsAscii( r.pOrgName ) )
diff --git a/unotools/source/misc/mediadescriptor.cxx b/unotools/source/misc/mediadescriptor.cxx
index c8c2ec98ea91..1e37fe199cad 100644
--- a/unotools/source/misc/mediadescriptor.cxx
+++ b/unotools/source/misc/mediadescriptor.cxx
@@ -575,8 +575,7 @@ bool MediaDescriptor::impl_openStreamWithPostData( const css::uno::Reference< cs
         aPostArgument.MediaType = sMediaType;
         aPostArgument.Referer = getUnpackedValueOrDefault( PROP_REFERRER(), OUString() );
 
-        OUString sCommandName( "post" );
-        aContent.executeCommand( sCommandName, css::uno::makeAny( aPostArgument ) );
+        aContent.executeCommand( "post", css::uno::makeAny( aPostArgument ) );
 
         // get result
         xResultStream = xSink->getInputStream();
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index 1aa5abaca117..b16bf68dfacd 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -194,8 +194,7 @@ void SAL_CALL UcbPropertiesChangeListener_Impl::propertiesChange ( const Sequenc
             OUString aUrl;
             if (evt.NewValue >>= aUrl)
             {
-                OUString aBad ("private:");
-                if (!aUrl.startsWith(aBad))
+                if (!aUrl.startsWith("private:"))
                 {
                     // URL changed (Redirection).
                     m_xLockBytes->SetRealURL_Impl( aUrl );
diff --git a/unoxml/source/dom/elementlist.cxx b/unoxml/source/dom/elementlist.cxx
index 21e282904074..f4dcfba1136c 100644
--- a/unoxml/source/dom/elementlist.cxx
+++ b/unoxml/source/dom/elementlist.cxx
@@ -95,8 +95,7 @@ namespace DOM
             assert(xTarget.is());
             if (!xTarget.is())
                 return;
-            bool capture = false;
-            xTarget->removeEventListener("DOMSubtreeModified", m_xEventListener, capture);
+            xTarget->removeEventListener("DOMSubtreeModified", m_xEventListener, false/*capture*/);
         }
     }
 
@@ -105,10 +104,8 @@ namespace DOM
         try {
             Reference< XEventTarget > const xTarget(
                     static_cast<XElement*>(& rElement), UNO_QUERY_THROW);
-            bool capture = false;
             m_xEventListener = new WeakEventListener(this);
-            xTarget->addEventListener("DOMSubtreeModified",
-                    m_xEventListener, capture);
+            xTarget->addEventListener("DOMSubtreeModified", m_xEventListener, false/*capture*/);
         } catch (const Exception &e){
             SAL_WARN( "unoxml", "Exception caught while registering NodeList as listener: "
                 << e.Message);
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 6febfae49664..0d742684bb73 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -403,7 +403,6 @@ UUIInteractionHelper::handleRequest_impl(
         script::ModuleSizeExceededRequest aModSizeException;
         if (aAnyRequest >>= aModSizeException )
         {
-            ErrCode nErrorCode = ERRCODE_UUI_IO_MODULESIZEEXCEEDED;
             std::vector< OUString > aArguments;
             uno::Sequence< OUString > sModules
                 = aModSizeException.Names;
@@ -420,7 +419,7 @@ UUIInteractionHelper::handleRequest_impl(
                 aArguments.push_back( aName );
             }
             handleErrorHandlerRequest( task::InteractionClassification_WARNING,
-                                       nErrorCode,
+                                       ERRCODE_UUI_IO_MODULESIZEEXCEEDED,
                                        aArguments,
                                        rRequest->getContinuations(),
                                        bObtainErrorStringOnly,
@@ -454,7 +453,6 @@ UUIInteractionHelper::handleRequest_impl(
         ucb::UnsupportedNameClashException aUORequest;
         if (aAnyRequest >>= aUORequest)
         {
-            ErrCode nErrorCode = ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE;
             std::vector< OUString > aArguments;
 
             uno::Reference< task::XInteractionApprove > xApprove;
@@ -465,7 +463,7 @@ UUIInteractionHelper::handleRequest_impl(
             if ( xApprove.is() && xDisapprove.is() )
             {
                 handleErrorHandlerRequest( task::InteractionClassification_QUERY,
-                                           nErrorCode,
+                                           ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE,
                                            aArguments,
                                            rRequest->getContinuations(),
                                            bObtainErrorStringOnly,
@@ -675,12 +673,11 @@ UUIInteractionHelper::handleRequest_impl(
         ucb::InteractiveLockingNotLockedException aLNLException;
         if (aAnyRequest >>= aLNLException)
         {
-            ErrCode nErrorCode = ERRCODE_UUI_LOCKING_NOT_LOCKED;
             std::vector< OUString > aArguments;
             aArguments.push_back( aLNLException.Url );
 
             handleErrorHandlerRequest( aLNLException.Classification,
-                                       nErrorCode,
+                                       ERRCODE_UUI_LOCKING_NOT_LOCKED,
                                        aArguments,
                                        rRequest->getContinuations(),
                                        bObtainErrorStringOnly,
@@ -692,12 +689,11 @@ UUIInteractionHelper::handleRequest_impl(
         ucb::InteractiveLockingLockExpiredException aLLEException;
         if (aAnyRequest >>= aLLEException)
         {
-            ErrCode nErrorCode = ERRCODE_UUI_LOCKING_LOCK_EXPIRED;
             std::vector< OUString > aArguments;
             aArguments.push_back( aLLEException.Url );
 
             handleErrorHandlerRequest( aLLEException.Classification,
-                                       nErrorCode,
+                                       ERRCODE_UUI_LOCKING_LOCK_EXPIRED,
                                        aArguments,
                                        rRequest->getContinuations(),
                                        bObtainErrorStringOnly,
@@ -747,12 +743,11 @@ UUIInteractionHelper::handleRequest_impl(
         loader::CannotActivateFactoryException aCannotActivateFactoryException;
         if (aAnyRequest >>= aCannotActivateFactoryException)
         {
-            ErrCode nErrorCode = ERRCODE_UUI_CANNOT_ACTIVATE_FACTORY;
             std::vector< OUString > aArguments;
             aArguments.push_back( aCannotActivateFactoryException.Message );
 
             handleErrorHandlerRequest( task::InteractionClassification_ERROR,
-                                       nErrorCode,
+                                       ERRCODE_UUI_CANNOT_ACTIVATE_FACTORY,
                                        aArguments,
                                        rRequest->getContinuations(),
                                        bObtainErrorStringOnly,
diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index 04fb3a6b0b0a..47b8bdd58a14 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -229,9 +229,7 @@ void MacroWarning::SetCertificate( const css::uno::Reference< css::security::XCe
     mxCert = _rxCert;
     if( mxCert.is() )
     {
-        OUString aCN_Id("CN");
-        OUString s;
-        s = GetContentPart( mxCert->getSubjectName(), aCN_Id );
+        OUString s = GetContentPart( mxCert->getSubjectName(), "CN" );
         mpSignsFI->SetText( s );
         mpViewSignsBtn->Enable();
     }
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 1c8e50d6632f..9e6290ddf474 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -460,7 +460,7 @@ PointerStyles const styles[] = {
 static long lcl_loPointerToMsoPointer( PointerStyle eType )
 {
     long nRet = msforms::fmMousePointer::fmMousePointerDefault;
-    for ( int i = 0, nElems = SAL_N_ELEMENTS( styles ); i < nElems; ++i )
+    for ( int i = 0; i < int(SAL_N_ELEMENTS( styles )); ++i )
     {
         if ( styles[ i ].loPointStyle == eType )
         {
@@ -474,7 +474,7 @@ static long lcl_loPointerToMsoPointer( PointerStyle eType )
 static Pointer lcl_msoPointerToLOPointer( long msoPointerStyle )
 {
     Pointer aPointer( PointerStyle::Arrow );
-    for ( int i = 0, nElems = SAL_N_ELEMENTS( styles ); i < nElems; ++i )
+    for ( int i = 0; i < int(SAL_N_ELEMENTS( styles )); ++i )
     {
         if ( styles[ i ].msoPointerStyle == msoPointerStyle )
         {
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 4933e902ecb5..da33cbcaf673 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -205,8 +205,7 @@ VbaApplicationBase::getDisplayStatusBar()
 
     if( xProps.is() ){
         uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager"), uno::UNO_QUERY_THROW );
-        OUString url( "private:resource/statusbar/statusbar" );
-        if( xLayoutManager.is() && xLayoutManager->isElementVisible( url ) ){
+        if( xLayoutManager.is() && xLayoutManager->isElementVisible( "private:resource/statusbar/statusbar" ) ){
             return true;
         }
     }
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
index 0dc0af6406e7..915913586798 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -210,9 +210,7 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
     }
     else
     {
-        bool isVisible = true;
-        sal_Int32 nStyle = 0;
-        aProps = CreateToolbarItemData( sCommandUrl, sHelpUrl, sLabel, nItemType, aSubMenu, isVisible, nStyle );
+        aProps = CreateToolbarItemData( sCommandUrl, sHelpUrl, sLabel, nItemType, aSubMenu, true/*isVisible*/, 0/*nStyle*/ );
     }
 
 
diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx
index cf221ab6b95f..5028d1504b90 100644
--- a/vbahelper/source/vbahelper/vbadocumentbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx
@@ -249,9 +249,8 @@ VbaDocumentBase::getSaved()
 void
 VbaDocumentBase::Save()
 {
-    OUString url(".uno:Save");
     uno::Reference< frame::XModel > xModel = getModel();
-    dispatchRequests(xModel,url);
+    dispatchRequests(xModel,".uno:Save");
 }
 
 void
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx
index da6f0dddc261..18d042ad0446 100644
--- a/vbahelper/source/vbahelper/vbashapes.cxx
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -219,13 +219,12 @@ ScVbaShapes::createShape( const OUString& service )
 uno::Any
 ScVbaShapes::AddRectangle(sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, const uno::Any& rRange)
 {
-    OUString sCreateShapeName( "com.sun.star.drawing.RectangleShape" );
     sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX );
     sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY );
     sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth );
     sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight );
 
-    uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
+    uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.RectangleShape" ), uno::UNO_QUERY_THROW );
     m_xShapes->add( xShape );
 
     OUString sName(createName( "Rectangle" ));
@@ -251,13 +250,12 @@ ScVbaShapes::AddRectangle(sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWid
 uno::Any
 ScVbaShapes::AddEllipse(sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, const uno::Any& rRange)
 {
-    OUString sCreateShapeName( "com.sun.star.drawing.EllipseShape" );
     sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX );
     sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY );
     sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth );
     sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight );
 
-    uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
+    uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.EllipseShape" ), uno::UNO_QUERY_THROW );
     m_xShapes->add( xShape );
 
     awt::Point aMovePositionIfRange( 0, 0 );
@@ -356,13 +354,12 @@ ScVbaShapes::AddTextbox( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, sal_Int3
 uno::Any
 ScVbaShapes::AddTextboxInWriter( sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight )
 {
-    OUString sCreateShapeName( "com.sun.star.drawing.TextShape" );
     sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( _nLeft );
     sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( _nTop );
     sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( _nWidth );
     sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( _nHeight );
 
-    uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
+    uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.TextShape" ), uno::UNO_QUERY_THROW );
     m_xShapes->add( xShape );
 
     setDefaultShapeProperties(xShape);
@@ -386,13 +383,10 @@ ScVbaShapes::AddTextboxInWriter( sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _n
     xShapeProps->setPropertyValue( "VertOrientPosition", uno::makeAny( nYPos ) );
 
     // set to visible
-    drawing::LineStyle aLineStyle = drawing::LineStyle_SOLID;
-    xShapeProps->setPropertyValue( "LineStyle", uno::makeAny( aLineStyle ) );
+    xShapeProps->setPropertyValue( "LineStyle", uno::makeAny( drawing::LineStyle_SOLID ) );
     // set to font
-    sal_Int16 nLayerId = 1;
-    OUString sLayerName("Heaven");
-    xShapeProps->setPropertyValue( "LayerID", uno::makeAny( nLayerId ) );
-    xShapeProps->setPropertyValue( "LayerName", uno::makeAny( sLayerName ) );
+    xShapeProps->setPropertyValue( "LayerID", uno::makeAny( sal_Int16(1) ) );
+    xShapeProps->setPropertyValue( "LayerName", uno::makeAny( OUString("Heaven") ) );
 
 
     ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );


More information about the Libreoffice-commits mailing list