From 74410f016965e228a56b251f3f2635af538c6b93 Mon Sep 17 00:00:00 2001
From: Brandon Garcia <brandon.garcia@my.wheaton.edu>
Date: Thu, 31 May 2012 17:17:23 -0500
Subject: [PATCH] Resolved some warnings.

Change-Id: I3772220cead1a4a7ff9182d65e066da406753238
---
 desktop/source/app/app.cxx                      |    3 +--
 eventattacher/source/eventattacher.cxx          |    2 --
 io/source/TextInputStream/TextInputStream.cxx   |   12 ++++++------
 io/source/TextOutputStream/TextOutputStream.cxx |    2 +-
 package/source/zippackage/ZipPackage.cxx        |   18 +++++++-----------
 sw/source/core/text/redlnitr.cxx                |    2 +-
 sw/source/filter/ww8/rtfexport.cxx              |    6 +++---
 7 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index b24f94f..b030afd 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -119,7 +119,7 @@ using namespace ::com::sun::star::container;
 
 namespace css = ::com::sun::star;
 
-ResMgr*                 desktop::Desktop::pResMgr = 0;
+ResMgr* 	desktop::Desktop::pResMgr = nullptr;
 
 namespace desktop
 {
@@ -385,7 +385,6 @@ static bool needsSynchronization(
     if (err2 == ::osl::File::E_NOENT)
     {
         return true;
-
     }
     else if (err2 != ::osl::File::E_None)
     {
diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx
index fd8fd9a..d13b720 100644
--- a/eventattacher/source/eventattacher.cxx
+++ b/eventattacher/source/eventattacher.cxx
@@ -306,9 +306,7 @@ Reference< XInterface > SAL_CALL EventAttacherImpl_CreateInstance( const Referen
     XEventAttacher *pEventAttacher = (XEventAttacher*) new EventAttacherImpl(rSMgr);
 
     if (pEventAttacher)
-    {
         xRet = Reference<XInterface>::query(pEventAttacher);
-    }
 
     return xRet;
 }
diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx
index 5bf76c5..fe2cf8a 100644
--- a/io/source/TextInputStream/TextInputStream.cxx
+++ b/io/source/TextInputStream/TextInputStream.cxx
@@ -68,8 +68,8 @@ namespace io_TextInputStream
 typedef WeakImplHelper3< XTextInputStream, XActiveDataSink, XServiceInfo > TextInputStreamHelper;
 class OCommandEnvironment;
 
-#define INITIAL_UNICODE_BUFFER_CAPACITY     0x100
-#define READ_BYTE_COUNT                     0x100
+constexpr unsigned short initial_unicode_buffer_capacity = 0x100;
+constexpr unsigned short read_byte_count = 0x100;
 
 class OTextInputStream : public TextInputStreamHelper
 {
@@ -132,7 +132,7 @@ public:
 };
 
 OTextInputStream::OTextInputStream()
-    : mSeqSource( READ_BYTE_COUNT ), mpBuffer( NULL ), mnBufferSize( 0 )
+    : mSeqSource( read_byte_count ), mpBuffer( nullptr ), mnBufferSize( 0 )
     , mnCharsInBuffer( 0 ), mbReachedEOF( sal_False )
 {
     g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
@@ -200,7 +200,7 @@ OUString OTextInputStream::implReadString( const Sequence< sal_Unicode >& Delimi
 
     if( !mpBuffer )
     {
-        mnBufferSize = INITIAL_UNICODE_BUFFER_CAPACITY;
+        mnBufferSize = initial_unicode_buffer_capacity;
         mpBuffer = new sal_Unicode[ mnBufferSize ];
     }
 
@@ -295,13 +295,13 @@ sal_Int32 OTextInputStream::implReadNext()
         throw(IOException, RuntimeException)
 {
     sal_Int32 nFreeBufferSize = mnBufferSize - mnCharsInBuffer;
-    if( nFreeBufferSize < READ_BYTE_COUNT )
+    if( nFreeBufferSize < read_byte_count )
         implResizeBuffer();
     nFreeBufferSize = mnBufferSize - mnCharsInBuffer;
 
     try
     {
-        sal_Int32 nBytesToRead = READ_BYTE_COUNT;
+        sal_Int32 nBytesToRead = read_byte_count;
         sal_Int32 nRead = mxStream->readSomeBytes( mSeqSource, nBytesToRead );
         sal_Int32 nTotalRead = nRead;
         if( nRead < nBytesToRead )
diff --git a/io/source/TextOutputStream/TextOutputStream.cxx b/io/source/TextOutputStream/TextOutputStream.cxx
index 90f34ab..8cd29ae 100644
--- a/io/source/TextOutputStream/TextOutputStream.cxx
+++ b/io/source/TextOutputStream/TextOutputStream.cxx
@@ -107,8 +107,8 @@ public:
 };
 
 OTextOutputStream::OTextOutputStream()
+	: mbEncodingInitialized{false}
 {
-    mbEncodingInitialized = false;
 }
 
 OTextOutputStream::~OTextOutputStream()
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 799f2bf..f6d6574 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1054,11 +1054,10 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< uno::Seq
         // Convert vector into a uno::Sequence
         uno::Sequence < uno::Sequence < PropertyValue > > aManifestSequence ( aManList.size() );
         sal_Int32 nInd = 0;
-        for ( vector < uno::Sequence < PropertyValue > >::const_iterator aIter = aManList.begin(), aEnd = aManList.end();
-             aIter != aEnd;
-             ++aIter, ++nInd )
+        for ( const uno::Sequence<PropertyValue>& seq : aManList )
         {
-            aManifestSequence[nInd] = ( *aIter );
+            aManifestSequence[nInd] = ( seq );
+            ++nInd;
         }
         xWriter->writeManifestSequence ( xManOutStream,  aManifestSequence );
 
@@ -1101,21 +1100,18 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< uno:
     uno::Sequence< beans::StringPair > aDefaultsSequence;
     uno::Sequence< beans::StringPair > aOverridesSequence( aManList.size() );
     sal_Int32 nSeqLength = 0;
-    for ( vector< uno::Sequence< beans::PropertyValue > >::const_iterator aIter = aManList.begin(),
-            aEnd = aManList.end();
-         aIter != aEnd;
-         ++aIter)
+    for ( const uno::Sequence<beans::PropertyValue>& seq : aManList )
     {
         ::rtl::OUString aPath;
         ::rtl::OUString aType;
-        OSL_ENSURE( ( *aIter )[PKG_MNFST_MEDIATYPE].Name.equals( sMediaType ) && ( *aIter )[PKG_MNFST_FULLPATH].Name.equals( sFullPath ),
+        OSL_ENSURE( seq[PKG_MNFST_MEDIATYPE].Name.equals( sMediaType ) && seq[PKG_MNFST_FULLPATH].Name.equals( sFullPath ),
                     "The mediatype sequence format is wrong!\n" );
-        ( *aIter )[PKG_MNFST_MEDIATYPE].Value >>= aType;
+        seq[PKG_MNFST_MEDIATYPE].Value >>= aType;
         if ( !aType.isEmpty() )
         {
             // only nonempty type makes sence here
             nSeqLength++;
-            ( *aIter )[PKG_MNFST_FULLPATH].Value >>= aPath;
+            seq[PKG_MNFST_FULLPATH].Value >>= aPath;
             aOverridesSequence[nSeqLength-1].First = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) + aPath;
             aOverridesSequence[nSeqLength-1].Second = aType;
         }
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index f126b25..1fb6552 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -147,7 +147,7 @@ void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, S
         MSHORT nRedlPos = pIDRA->GetRedlinePos( rTxtNode, USHRT_MAX );
         if( pExtInp || MSHRT_MAX != nRedlPos )
         {
-            const std::vector<sal_uInt16> *pArr = 0;
+            const std::vector<sal_uInt16> *pArr = nullptr;
             xub_StrLen nInputStt = 0;
             if( pExtInp )
             {
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 95f8350..5b39e09 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -963,10 +963,10 @@ void RtfExport::InsColor( const Color& rCol )
 {
     sal_uInt16 n;
     bool bContainsAuto = false;
-    for (RtfColorTbl::iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); ++it )
-        if ((*it).second == rCol)
+    for (auto myColor : m_aColTbl )
+        if (myColor.second == rCol)
             return; // Already in the table
-        else if ((*it).second == COL_AUTO)
+        else if (myColor.second == COL_AUTO)
             bContainsAuto = true;
     if (rCol.GetColor() == COL_AUTO)
         n = 0;
-- 
1.7.9.5

