[Libreoffice-commits] core.git: 2 commits - sd/source slideshow/source

Stephan Bergmann sbergman at redhat.com
Wed Mar 8 09:57:41 UTC 2017


 sd/source/filter/eppt/epptso.cxx                         |    4 ++--
 sd/source/filter/ppt/pptin.cxx                           |    7 +++----
 sd/source/ui/dlg/headerfooterdlg.cxx                     |    3 +--
 sd/source/ui/dlg/tpoption.cxx                            |    7 +++----
 sd/source/ui/docshell/docshell.cxx                       |    2 +-
 sd/source/ui/func/fuconcs.cxx                            |    3 +--
 sd/source/ui/sidebar/RecentMasterPagesSelector.cxx       |    5 ++---
 sd/source/ui/view/DocumentRenderer.cxx                   |    2 +-
 sd/source/ui/view/ViewTabBar.cxx                         |    5 ++---
 slideshow/source/engine/shapes/drawinglayeranimation.cxx |    3 +--
 10 files changed, 17 insertions(+), 24 deletions(-)

New commits:
commit 823956aa8fa73e6699cbfd1eea237c1997f94fec
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 8 10:56:36 2017 +0100

    loplugin:loopvartoosmall
    
    Change-Id: Ib8737f1690c738016fcdc1f365b744fcb567ce57

diff --git a/slideshow/source/engine/shapes/drawinglayeranimation.cxx b/slideshow/source/engine/shapes/drawinglayeranimation.cxx
index e82072d..0f8f1b1 100644
--- a/slideshow/source/engine/shapes/drawinglayeranimation.cxx
+++ b/slideshow/source/engine/shapes/drawinglayeranimation.cxx
@@ -530,9 +530,8 @@ ScrollTextAnimNode* ActivityImpl::ImpGetScrollTextAnimNode(
     {
         rRelativeTime = nTime;
 
-        for(sal_uInt32 a(0L); !pRetval && a < maVector.size(); a++)
+        for(ScrollTextAnimNode & rNode: maVector)
         {
-            ScrollTextAnimNode & rNode = maVector[a];
             if(!rNode.GetRepeat())
             {
                 // endless loop, use it
commit 1f2fc6e71788432f3ce29fac1678bcd39533f59e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 8 10:56:10 2017 +0100

    loplugin:loopvartoosmall
    
    Change-Id: I4804a25046a35c24d19d578c014d8e52f62b70e8

diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 0dc8903..068cc54 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -2032,11 +2032,11 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
 
                 if ( !aControlName.isEmpty() )
                 {
-                    sal_uInt16 i, nBufSize;
+                    sal_uInt16 nBufSize;
                     nBufSize = ( aControlName.getLength() + 1 ) << 1;
                     sal_uInt8* pBuf = new sal_uInt8[ nBufSize ];
                     sal_uInt8* pTmp = pBuf;
-                    for ( i = 0; i < aControlName.getLength(); i++ )
+                    for ( sal_Int32 i = 0; i < aControlName.getLength(); i++ )
                     {
                         sal_Unicode nUnicode = *(aControlName.getStr() + i);
                         *pTmp++ = (sal_uInt8)nUnicode;
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index c67ed93..53fa340 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -726,8 +726,7 @@ bool ImplSdPPTImport::Import()
             }
         }
     }
-    sal_uInt16 i;
-    for (i = 0; i < mpDoc->GetMasterPageCount(); ++i)
+    for (sal_uInt16 i = 0; i < mpDoc->GetMasterPageCount(); ++i)
     {
         SdPage *const pMPage(static_cast<SdPage*>(mpDoc->GetMasterPage(i)));
         if (pMPage == nullptr)
@@ -1083,7 +1082,7 @@ bool ImplSdPPTImport::Import()
     bOk = mpDoc->CreateMissingNotesAndHandoutPages();
     if ( bOk )
     {
-        for ( i = 0; i < mpDoc->GetSdPageCount( PageKind::Standard ); i++ )
+        for ( sal_uInt16 i = 0; i < mpDoc->GetSdPageCount( PageKind::Standard ); i++ )
         {
 
             // set AutoLayout
@@ -1211,7 +1210,7 @@ bool ImplSdPPTImport::Import()
     }
 
     sal_uInt32 nSlideCount = GetPageCount();
-    for ( i = 0; ( i < nSlideCount) && ( i < maSlideNameList.size() ); i++ )
+    for ( sal_uInt32 i = 0; ( i < nSlideCount) && ( i < maSlideNameList.size() ); i++ )
     {
         SdPage* pPage = mpDoc->GetSdPage( i, PageKind::Standard );
         OUString &aName = maSlideNameList[ i ];
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index 4e61801..201282d 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -518,8 +518,7 @@ void HeaderFooterTabPage::init( const HeaderFooterSettings& rSettings, bool bNot
 
     mpCBDateTimeLanguage->SelectLanguage( meOldLanguage );
 
-    sal_uInt16 nPos;
-    for( nPos = 0; nPos < mpCBDateTimeFormat->GetEntryCount(); nPos++ )
+    for( sal_Int32 nPos = 0; nPos < mpCBDateTimeFormat->GetEntryCount(); nPos++ )
     {
         int nFormat = (int)reinterpret_cast<sal_IntPtr>(mpCBDateTimeFormat->GetEntryData( nPos ));
         if( nFormat == rSettings.meDateTimeFormat )
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index a2cff38..2700f8e 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -240,9 +240,8 @@ SdTpOptionsMisc::SdTpOptionsMisc(vcl::Window* pParent, const SfxItemSet& rInAttr
 
     // fill ListBox with metrics
     SvxStringArray aMetricArr( RID_SVXSTR_FIELDUNIT_TABLE );
-    sal_uInt16 i;
 
-    for ( i = 0; i < aMetricArr.Count(); ++i )
+    for ( sal_uInt32 i = 0; i < aMetricArr.Count(); ++i )
     {
         OUString sMetric = aMetricArr.GetStringByPos( i );
         sal_IntPtr nFieldUnit = aMetricArr.GetValue( i );
@@ -275,9 +274,9 @@ SdTpOptionsMisc::SdTpOptionsMisc(vcl::Window* pParent, const SfxItemSet& rInAttr
     sal_uInt16 aTable[ TABLE_COUNT ] =
         { 1, 2, 4, 5, 8, 10, 16, 20, 30, 40, 50, 100 };
 
-    for( i = 0; i < TABLE_COUNT; i++ )
+    for( sal_uInt16 i = 0; i < TABLE_COUNT; i++ )
         m_pCbScale->InsertEntry( GetScale( 1, aTable[i] ) );
-    for( i = 1; i < TABLE_COUNT; i++ )
+    for( sal_uInt16 i = 1; i < TABLE_COUNT; i++ )
         m_pCbScale->InsertEntry( GetScale(  aTable[i], 1 ) );
 }
 
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index 05d27b6..799c2cf 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -334,7 +334,7 @@ void DrawDocShell::InPlaceActivate( bool bActive )
 
     if( bActive )
     {
-        for( sal_uInt32 i = 0; pSfxViewFrame && (i < rViews.size()); i++ )
+        for( std::vector<FrameView*>::size_type i = 0; pSfxViewFrame && (i < rViews.size()); i++ )
         {
             // determine the number of FrameViews
             SfxViewShell* pSfxViewSh = pSfxViewFrame->GetViewShell();
diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx
index 51d7307..208eb37 100644
--- a/sd/source/ui/func/fuconcs.cxx
+++ b/sd/source/ui/func/fuconcs.cxx
@@ -174,8 +174,7 @@ void FuConstructCustomShape::SetAttributes( SdrObject* pObj )
         std::vector< OUString > aObjList;
         if ( GalleryExplorer::FillObjListTitle( GALLERY_THEME_POWERPOINT, aObjList ) )
         {
-            sal_uInt16 i;
-            for ( i = 0; i < aObjList.size(); i++ )
+            for ( std::vector<OUString>::size_type i = 0; i < aObjList.size(); i++ )
             {
                 if ( aObjList[ i ].equalsIgnoreAsciiCase( aCustomShape ) )
                 {
diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
index 7387786..7ff9acc 100644
--- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
@@ -96,8 +96,7 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList)
     // Create a set of names of the master pages used by the document.
     MasterPageObserver::MasterPageNameSet aCurrentNames;
     sal_uInt16 nMasterPageCount = mrDocument.GetMasterSdPageCount(PageKind::Standard);
-    sal_uInt16 nIndex;
-    for (nIndex=0; nIndex<nMasterPageCount; nIndex++)
+    for (sal_uInt16 nIndex=0; nIndex<nMasterPageCount; nIndex++)
     {
         SdPage* pMasterPage = mrDocument.GetMasterSdPage (nIndex, PageKind::Standard);
         if (pMasterPage != nullptr)
@@ -107,7 +106,7 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList)
     // Insert the recently used master pages that are currently not used.
     RecentlyUsedMasterPages& rInstance (RecentlyUsedMasterPages::Instance());
     int nPageCount = rInstance.GetMasterPageCount();
-    for (nIndex=0; nIndex<nPageCount; nIndex++)
+    for (int nIndex=0; nIndex<nPageCount; nIndex++)
     {
         // Add an entry when a) the page is already known to the
         // MasterPageContainer, b) the style name is empty, i.e. it has not yet
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index 8ef2221..0eba71c 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1641,7 +1641,7 @@ private:
             pOutliner->SetFirstPageNumber(aPages[nIndex]+1);
 
             Paragraph* pPara = nullptr;
-            sal_Int32 nH (0);
+            long nH (0);
             while (nH < nPageH && nIndex<nCount)
             {
                 SdPage* pPage = GetFilteredPage(aPages[nIndex], PageKind::Standard);
diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx
index fc7492c..30aa66d 100644
--- a/sd/source/ui/view/ViewTabBar.cxx
+++ b/sd/source/ui/view/ViewTabBar.cxx
@@ -405,7 +405,7 @@ void ViewTabBar::AddTabBarButton (
     const css::drawing::framework::TabBarButton& rButton,
     const css::drawing::framework::TabBarButton& rAnchor)
 {
-    sal_uInt32 nIndex;
+    TabBarButtonList::size_type nIndex;
 
     if ( ! rAnchor.ResourceId.is()
         || (rAnchor.ResourceId->getResourceURL().isEmpty()
@@ -453,8 +453,7 @@ void ViewTabBar::AddTabBarButton (
 void ViewTabBar::RemoveTabBarButton (
     const css::drawing::framework::TabBarButton& rButton)
 {
-    sal_uInt16 nIndex;
-    for (nIndex=0; nIndex<maTabBarButtons.size(); ++nIndex)
+    for (TabBarButtonList::size_type nIndex=0; nIndex<maTabBarButtons.size(); ++nIndex)
     {
         if (IsEqual(maTabBarButtons[nIndex], rButton))
         {


More information about the Libreoffice-commits mailing list