accessibility/source/extended/accessiblelistboxentry.cxx           |    2 
 basic/source/sbx/sbxscan.cxx                                       |   81 
++++------
 comphelper/source/misc/backupfilehelper.cxx                        |   18 +-
 compilerplugins/clang/stringstatic.cxx                             |    4 
 connectivity/source/drivers/evoab2/NResultSetMetaData.hxx          |    2 
 connectivity/source/drivers/jdbc/Timestamp.cxx                     |    2 
 connectivity/source/drivers/kab/KResultSetMetaData.hxx             |    2 
 connectivity/source/drivers/macab/MacabResultSetMetaData.hxx       |    2 
 connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx |    2 
 connectivity/source/drivers/postgresql/pq_statement.cxx            |    2 
 connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx |    2 
 cpputools/source/unoexe/unoexe.cxx                                 |    2 
 cui/source/tabpages/swpossizetabpage.cxx                           |    8 
 13 files changed, 62 insertions(+), 67 deletions(-)

New commits:
commit 0f0ebddb81a7c5b83bdf8d050bfe38dad26f0bfd
Author: Andrea Gelmini <andrea.gelm...@gelma.net>
Date:   Fri Mar 10 18:55:12 2017 +0100

    Fix typos
    
    Change-Id: Ic54e808956e5cf4e8079942c0ff799f802cd4b6c
    Reviewed-on: https://gerrit.libreoffice.org/35053
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx 
b/accessibility/source/extended/accessiblelistboxentry.cxx
index 2eb8f39..8f0b1ec 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -439,7 +439,7 @@ namespace accessibility
         {
             return getListBox()->GetEntryLongDescription( pEntry );
         }
-        //want to cout the real column nubmer in the list box.
+        //want to cout the real column number in the list box.
         sal_uInt16 iRealItemCount = 0;
         sal_uInt16 iCount = 0;
         sal_uInt16 iTotleItemCount = pEntry->ItemCount();
diff --git a/comphelper/source/misc/backupfilehelper.cxx 
b/comphelper/source/misc/backupfilehelper.cxx
index 5c65dde..7e5c2db 100644
--- a/comphelper/source/misc/backupfilehelper.cxx
+++ b/comphelper/source/misc/backupfilehelper.cxx
@@ -1869,7 +1869,7 @@ namespace comphelper
             // ensure dir and file vectors
             fillDirFileInfo();
 
-            // proccess all files in question recursively
+            // process all files in question recursively
             if (!maDirs.empty() || !maFiles.empty())
             {
                 bDidPush = tryPush_Files(
@@ -1911,7 +1911,7 @@ namespace comphelper
             // ensure dir and file vectors
             fillDirFileInfo();
 
-            // proccess all files in question recursively
+            // process all files in question recursively
             if (!maDirs.empty() || !maFiles.empty())
             {
                 bPopPossible = isPopPossible_files(
@@ -1936,7 +1936,7 @@ namespace comphelper
             // ensure dir and file vectors
             fillDirFileInfo();
 
-            // proccess all files in question recursively
+            // process all files in question recursively
             if (!maDirs.empty() || !maFiles.empty())
             {
                 bDidPop = tryPop_files(
@@ -2258,7 +2258,7 @@ namespace comphelper
         bool bDidPush(false);
         osl::Directory::createPath(rTargetURL);
 
-        // proccess files
+        // process files
         for (const auto& file : rFiles)
         {
             bDidPush |= tryPush_file(
@@ -2268,7 +2268,7 @@ namespace comphelper
                 file.second);
         }
 
-        // proccess dirs
+        // process dirs
         for (const auto& dir : rDirs)
         {
             OUString aNewSourceURL(rSourceURL + "/" + dir);
@@ -2339,7 +2339,7 @@ namespace comphelper
     {
         bool bPopPossible(false);
 
-        // proccess files
+        // process files
         for (const auto& file : rFiles)
         {
             bPopPossible |= isPopPossible_file(
@@ -2349,7 +2349,7 @@ namespace comphelper
                 file.second);
         }
 
-        // proccess dirs
+        // process dirs
         for (const auto& dir : rDirs)
         {
             OUString aNewSourceURL(rSourceURL + "/" + dir);
@@ -2406,7 +2406,7 @@ namespace comphelper
     {
         bool bDidPop(false);
 
-        // proccess files
+        // process files
         for (const auto& file : rFiles)
         {
             bDidPop |= tryPop_file(
@@ -2416,7 +2416,7 @@ namespace comphelper
                 file.second);
         }
 
-        // proccess dirs
+        // process dirs
         for (const auto& dir : rDirs)
         {
             OUString aNewSourceURL(rSourceURL + "/" + dir);
diff --git a/compilerplugins/clang/stringstatic.cxx 
b/compilerplugins/clang/stringstatic.cxx
index d251ed8..e82d173 100644
--- a/compilerplugins/clang/stringstatic.cxx
+++ b/compilerplugins/clang/stringstatic.cxx
@@ -12,7 +12,7 @@
 #include "check.hxx"
 #include "plugin.hxx"
 
-/** Look for static OUString and OUString[], they can be more effeciently 
declared as:
+/** Look for static OUString and OUString[], they can be more efficiently 
declared as:
 
         static const OUStringLiteral our_aLBEntryMap[] = {" ", ", "};
         static const OUStringLiteral sName("name");
@@ -44,7 +44,7 @@ void StringStatic::run()
     // passing around pointers to global OUString
     if (fn.startswith(SRCDIR "/filter/source/svg/"))
          return;
-    // has a mix of literals and and refs to external OUStrings
+    // has a mix of literals and refs to external OUStrings
     if (fn == SRCDIR "/ucb/source/ucp/webdav-neon/ContentProperties.cxx")
          return;
 
diff --git a/connectivity/source/drivers/evoab2/NResultSetMetaData.hxx 
b/connectivity/source/drivers/evoab2/NResultSetMetaData.hxx
index 9f5d52c..eaa28e4 100644
--- a/connectivity/source/drivers/evoab2/NResultSetMetaData.hxx
+++ b/connectivity/source/drivers/evoab2/NResultSetMetaData.hxx
@@ -49,7 +49,7 @@ namespace connectivity
                         { return m_aEvoabFields[columnIndex - 1]; }
           sal_Int32 getFieldSize() const
             {return m_aEvoabFields.size();}
-          /// Avoid ambigous cast error from the compiler.
+          /// Avoid ambiguous cast error from the compiler.
           operator css::uno::Reference< css::sdbc::XResultSetMetaData > () 
throw()
           { return this; }
 
diff --git a/connectivity/source/drivers/jdbc/Timestamp.cxx 
b/connectivity/source/drivers/jdbc/Timestamp.cxx
index 1c8039e..41a29d0 100644
--- a/connectivity/source/drivers/jdbc/Timestamp.cxx
+++ b/connectivity/source/drivers/jdbc/Timestamp.cxx
@@ -110,7 +110,7 @@ java_sql_Time::java_sql_Time( const css::util::Time& _rOut 
): java_util_Date( nu
     args[0].l = convertwchar_tToJavaString(t.pEnv,sDateStr);
 
     // Turn off Java-Call for the constructor
-    // intialise temporary variables
+    // initialise temporary variables
     jobject tempObj;
     static jmethodID mID(nullptr);
     if ( !mID )
diff --git a/connectivity/source/drivers/kab/KResultSetMetaData.hxx 
b/connectivity/source/drivers/kab/KResultSetMetaData.hxx
index c505238..492089a 100644
--- a/connectivity/source/drivers/kab/KResultSetMetaData.hxx
+++ b/connectivity/source/drivers/kab/KResultSetMetaData.hxx
@@ -45,7 +45,7 @@ namespace connectivity
         public:
             KabResultSetMetaData();
 
-            // avoid ambigous cast error from the compiler
+            // avoid ambiguous cast error from the compiler
             inline operator css::uno::Reference< css::sdbc::XResultSetMetaData 
> () throw()
                 { return this; }
 
diff --git a/connectivity/source/drivers/macab/MacabResultSetMetaData.hxx 
b/connectivity/source/drivers/macab/MacabResultSetMetaData.hxx
index d1b846e..05f911c 100644
--- a/connectivity/source/drivers/macab/MacabResultSetMetaData.hxx
+++ b/connectivity/source/drivers/macab/MacabResultSetMetaData.hxx
@@ -49,7 +49,7 @@ namespace connectivity
         public:
             MacabResultSetMetaData(MacabConnection* _pConnection, OUString 
const & _sTableName);
 
-            // avoid ambigous cast error from the compiler
+            // avoid ambiguous cast error from the compiler
             operator css::uno::Reference< css::sdbc::XResultSetMetaData > () 
throw()
                 { return this; }
 
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx 
b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
index b2ef4d9..3e0432a 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
@@ -186,7 +186,7 @@ namespace connectivity
             ProductStruct &rProduct = m_ProductProfileList[index];
             if (!rProduct.mCurrentProfileName.isEmpty())
             {
-                //default profile setted in mozilla registry
+                //default profile set in mozilla registry
                 return rProduct.mCurrentProfileName;
             }
             if (rProduct.mProfileList.empty())
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx 
b/connectivity/source/drivers/postgresql/pq_statement.cxx
index d4351d3..39063d8 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -341,7 +341,7 @@ static std::vector< OUString > lookupKeys(
 
                     if( keySupplier.is() )
                     {
-                        // is ambigous, as I don't know postgresql searchpath,
+                        // is ambiguous, as I don't know postgresql searchpath,
                         // I can't continue here, as I may write to a 
different table
                         keySupplier.clear();
                         if (isLog(pSettings, LogLevel::Info))
diff --git a/connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx 
b/connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx
index db3e980..904d766 100644
--- a/connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx
+++ b/connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx
@@ -74,7 +74,7 @@ namespace connectivity
             }
             ~ODatabaseMetaDataResultSetMetaData() override;
 
-            /// Avoid ambigous cast error from the compiler.
+            /// Avoid ambiguous cast error from the compiler.
             inline operator css::uno::Reference< css::sdbc::XResultSetMetaData 
> () throw()
             { return this; }
 
diff --git a/cpputools/source/unoexe/unoexe.cxx 
b/cpputools/source/unoexe/unoexe.cxx
index 32a2fcb..e890442 100644
--- a/cpputools/source/unoexe/unoexe.cxx
+++ b/cpputools/source/unoexe/unoexe.cxx
@@ -511,7 +511,7 @@ SAL_IMPLEMENT_MAIN()
                 Reference< XComponent > xComp( xInstance, UNO_QUERY );
                 if (xComp.is())
                     xComp->dispose();
-                throw RuntimeException( "component does not export interface 
interface \"com.sun.star.lang.XMain\"!" );
+                throw RuntimeException( "component does not export interface 
\"com.sun.star.lang.XMain\"!" );
             }
         }
     }
diff --git a/cui/source/tabpages/swpossizetabpage.cxx 
b/cui/source/tabpages/swpossizetabpage.cxx
index 4810f81..e1e3d58 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -305,7 +305,7 @@ static FrmMap aVCharMap[] =
     // #i22341#
     // introduce mappings for new vertical alignment at top of line 
<LB::VertLine>
     // and correct mapping for vertical alignment at character for position 
<FROM_BOTTOM>
-    // Note: Because of these adjustments the map becomes ambigous in its 
values
+    // Note: because of these adjustments the map becomes ambiguous in its 
values
     //       <eStrId>/<eMirrorStrId> and <nAlign>. These ambiguities are 
considered
     //       in the methods <SwFrmPage::FillRelLB(..)>, 
<SwFrmPage::GetAlignment(..)>
     //       and <SwFrmPage::FillPosLB(..)>
@@ -1430,7 +1430,7 @@ short SvxSwPosSizeTabPage::GetAlignment(FrmMap *pMap, 
sal_uInt16 nMapPos, ListBo
     short nAlign = 0;
 
     // #i22341# - special handling also for map <aVCharMap>,
-    // because it contains ambigous items for alignment
+    // because it contains ambiguous items for alignment
     if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap ||
             pMap == aVCharMap )
     {
@@ -1739,7 +1739,7 @@ void SvxSwPosSizeTabPage::FillRelLB(FrmMap *pMap, 
sal_uInt16 nMapPos, sal_uInt16
             sal_uInt16 nRelCount = SAL_N_ELEMENTS(aRelationMap);
 
             // #i22341# - special handling for map <aVCharMap>,
-            // because its ambigous in its <eStrId>/<eMirrorStrId>.
+            // because its ambiguous in its <eStrId>/<eMirrorStrId>.
             if ( pMap == aVCharMap )
             {
                 nLBRelations = ::lcl_GetLBRelationsForStrID( pMap,
@@ -1851,7 +1851,7 @@ sal_uInt16 SvxSwPosSizeTabPage::FillPosLB(FrmMap *_pMap,
                 _rLB.InsertEntry(sEntry);
             }
             // #i22341# - add condition to handle map <aVCharMap>
-            // that is ambigous in the alignment.
+            // that is ambiguous in the alignment.
             if ( _pMap[i].nAlign == _nAlign &&
                  ( !(_pMap == aVCharMap) || _pMap[i].nLBRelations & 
nLBRelations ) )
             {
commit c328aefa6f2c9a04c50bad7228a468ff2f136d22
Author: Jochen Nitschke <j.nitschke+loger...@ok.de>
Date:   Fri Mar 10 12:26:35 2017 +0100

    replace macros and use scoped enum
    
    use OUStringLiteral to store format names.
    just create ResMgr, no need to check if its gone.
    
    Change-Id: Ie3e33bc70b975d8ee49f47dcf23737ca56652f1a
    Reviewed-on: https://gerrit.libreoffice.org/35007
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index d06f4e0..3a7c4ca 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -581,74 +581,69 @@ bool SbxValue::Scan( const OUString& rSrc, sal_uInt16* 
pLen )
 }
 
 
-ResMgr* implGetResMgr()
+namespace
 {
-    static ResMgr* pResMgr = nullptr;
-    if( !pResMgr )
-    {
-        pResMgr = ResMgr::CreateResMgr("sb", 
Application::GetSettings().GetUILanguageTag() );
-    }
-    return pResMgr;
+
+ResMgr& implGetResMgr()
+{
+    static ResMgr* const pResMgr( ResMgr::CreateResMgr(
+                               "sb", 
Application::GetSettings().GetUILanguageTag() ));
+
+    return *pResMgr;
 }
 
 class SbxValueFormatResId : public ResId
 {
 public:
-    explicit SbxValueFormatResId( sal_uInt16 nId )
-        : ResId( nId, *implGetResMgr() )
+    explicit SbxValueFormatResId( sal_uInt32 nId )
+        : ResId( nId, implGetResMgr() )
     {}
 };
 
-
-enum VbaFormatType
+enum class VbaFormatType
 {
-    VBA_FORMAT_TYPE_OFFSET, // standard number format
-    VBA_FORMAT_TYPE_USERDEFINED, // user defined number format
-    VBA_FORMAT_TYPE_NULL
+    Offset,      // standard number format
+    UserDefined, // user defined number format
+    Null
 };
 
 struct VbaFormatInfo
 {
     VbaFormatType meType;
-    OUString mpVbaFormat; // Format string in vba
-    NfIndexTableOffset meOffset; // SvNumberFormatter format index, if meType 
= VBA_FORMAT_TYPE_OFFSET
-    const char* mpOOoFormat; // if meType = VBA_FORMAT_TYPE_USERDEFINED
+    OUStringLiteral mpVbaFormat; // Format string in vba
+    NfIndexTableOffset meOffset; // SvNumberFormatter format index, if meType 
= VbaFormatType::Offset
+    const char* mpOOoFormat;     // if meType = VbaFormatType::UserDefined
 };
 
-#define VBA_FORMAT_OFFSET( pcUtf8, eOffset ) \
-    { VBA_FORMAT_TYPE_OFFSET, OUString(pcUtf8), eOffset, nullptr }
-
-#define VBA_FORMAT_USERDEFINED( pcUtf8, pcDefinedUtf8 ) \
-    { VBA_FORMAT_TYPE_USERDEFINED, OUString(pcUtf8), NF_NUMBER_STANDARD, 
pcDefinedUtf8 }
-
-static VbaFormatInfo pFormatInfoTable[] =
+const VbaFormatInfo pFormatInfoTable[] =
 {
-    VBA_FORMAT_OFFSET( "Long Date", NF_DATE_SYSTEM_LONG ),
-    VBA_FORMAT_USERDEFINED( "Medium Date", "DD-MMM-YY" ),
-    VBA_FORMAT_OFFSET( "Short Date", NF_DATE_SYSTEM_SHORT ),
-    VBA_FORMAT_USERDEFINED( "Long Time", "H:MM:SS AM/PM" ),
-    VBA_FORMAT_OFFSET( "Medium Time", NF_TIME_HHMMAMPM ),
-    VBA_FORMAT_OFFSET( "Short Time", NF_TIME_HHMM ),
-    VBA_FORMAT_OFFSET( "ddddd", NF_DATE_SYSTEM_SHORT ),
-    VBA_FORMAT_OFFSET( "dddddd", NF_DATE_SYSTEM_LONG ),
-    VBA_FORMAT_USERDEFINED( "ttttt", "H:MM:SS AM/PM" ),
-    VBA_FORMAT_OFFSET( "ww", NF_DATE_WW ),
-    { VBA_FORMAT_TYPE_NULL, OUString(""), NF_INDEX_TABLE_ENTRIES, nullptr }
+    { VbaFormatType::Offset,      OUStringLiteral("Long Date"),   
NF_DATE_SYSTEM_LONG,    nullptr },
+    { VbaFormatType::UserDefined, OUStringLiteral("Medium Date"), 
NF_NUMBER_STANDARD,     "DD-MMM-YY" },
+    { VbaFormatType::Offset,      OUStringLiteral("Short Date"),  
NF_DATE_SYSTEM_SHORT,   nullptr },
+    { VbaFormatType::UserDefined, OUStringLiteral("Long Time"),   
NF_NUMBER_STANDARD,     "H:MM:SS AM/PM" },
+    { VbaFormatType::Offset,      OUStringLiteral("Medium Time"), 
NF_TIME_HHMMAMPM,       nullptr },
+    { VbaFormatType::Offset,      OUStringLiteral("Short Time"),  
NF_TIME_HHMM,           nullptr },
+    { VbaFormatType::Offset,      OUStringLiteral("ddddd"),       
NF_DATE_SYSTEM_SHORT,   nullptr },
+    { VbaFormatType::Offset,      OUStringLiteral("dddddd"),      
NF_DATE_SYSTEM_LONG,    nullptr },
+    { VbaFormatType::UserDefined, OUStringLiteral("ttttt"),       
NF_NUMBER_STANDARD,     "H:MM:SS AM/PM" },
+    { VbaFormatType::Offset,      OUStringLiteral("ww"),          NF_DATE_WW,  
           nullptr },
+    { VbaFormatType::Null,        OUStringLiteral(""),            
NF_INDEX_TABLE_ENTRIES, nullptr }
 };
 
-VbaFormatInfo* getFormatInfo( const OUString& rFmt )
+const VbaFormatInfo* getFormatInfo( const OUString& rFmt )
 {
-    VbaFormatInfo* pInfo = nullptr;
-    sal_Int16 i = 0;
-    while( (pInfo = pFormatInfoTable + i )->meType != VBA_FORMAT_TYPE_NULL )
+    const VbaFormatInfo* pInfo = pFormatInfoTable;
+    while( pInfo->meType != VbaFormatType::Null )
     {
         if( rFmt.equalsIgnoreAsciiCase( pInfo->mpVbaFormat ) )
             break;
-        i++;
+        ++pInfo;
     }
     return pInfo;
 }
 
+} // namespace
+
 #define VBAFORMAT_GENERALDATE       "General Date"
 #define VBAFORMAT_C                 "c"
 #define VBAFORMAT_N                 "n"
@@ -699,10 +694,10 @@ void SbxValue::Format( OUString& rRes, const OUString* 
pFmt ) const
             sal_Int32 nCheckPos = 0;
             short nType;
             OUString aFmtStr = *pFmt;
-            VbaFormatInfo* pInfo = getFormatInfo( aFmtStr );
-            if( pInfo && pInfo->meType != VBA_FORMAT_TYPE_NULL )
+            const VbaFormatInfo* pInfo = getFormatInfo( aFmtStr );
+            if( pInfo->meType != VbaFormatType::Null )
             {
-                if( pInfo->meType == VBA_FORMAT_TYPE_OFFSET )
+                if( pInfo->meType == VbaFormatType::Offset )
                 {
                     nIndex = aFormatter.GetFormatIndex( pInfo->meOffset, 
eLangType );
                 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to