[Libreoffice-commits] core.git: forms/source

Stephan Bergmann sbergman at redhat.com
Sat Jul 27 03:04:11 PDT 2013


 forms/source/misc/limitedformats.cxx |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 5c01c9c6b2447cac2e92a4e8685f40493cfa5090
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sat Jul 27 12:03:39 2013 +0200

    lcl_getFormatTable result is used non-const
    
    Change-Id: I9fbd62c24190c28752fd9f4cf37d84d1fd466983

diff --git a/forms/source/misc/limitedformats.cxx b/forms/source/misc/limitedformats.cxx
index ab13dc7..33e5b37 100644
--- a/forms/source/misc/limitedformats.cxx
+++ b/forms/source/misc/limitedformats.cxx
@@ -84,13 +84,13 @@ namespace frm
     };
 
     //---------------------------------------------------------------------
-    static const FormatEntry* lcl_getFormatTable(sal_Int16 nTableId)
+    static FormatEntry* lcl_getFormatTable(sal_Int16 nTableId)
     {
         switch (nTableId)
         {
             case FormComponentType::TIMEFIELD:
             {
-                static const FormatEntry s_aFormats[] = {
+                static FormatEntry s_aFormats[] = {
                     { "HH:MM", -1, ltEnglishUS },
                     { "HH:MM:SS", -1, ltEnglishUS },
                     { "HH:MM AM/PM", -1, ltEnglishUS },
@@ -103,7 +103,7 @@ namespace frm
             }
             case FormComponentType::DATEFIELD:
             {
-                static const FormatEntry s_aFormats[] = {
+                static FormatEntry s_aFormats[] = {
                     { "T-M-JJ", -1, ltGerman },
                     { "TT-MM-JJ", -1, ltGerman },
                     { "TT-MM-JJJJ", -1, ltGerman },
@@ -151,7 +151,7 @@ namespace frm
     //---------------------------------------------------------------------
     void OLimitedFormats::ensureTableInitialized(const sal_Int16 _nTableId)
     {
-        const FormatEntry* pFormatTable = lcl_getFormatTable(_nTableId);
+        FormatEntry* pFormatTable = lcl_getFormatTable(_nTableId);
         if (-1 == pFormatTable->nKey)
         {
             ::osl::MutexGuard aGuard(s_aMutex);
@@ -166,7 +166,7 @@ namespace frm
                 if (xStandardFormats.is())
                 {
                     // loop through the table
-                    FormatEntry* pLoopFormats = const_cast<FormatEntry*>(pFormatTable);
+                    FormatEntry* pLoopFormats = pFormatTable;
                     while (pLoopFormats->pDescription)
                     {
                         // get the key for the description
@@ -206,8 +206,8 @@ namespace frm
     void OLimitedFormats::clearTable(const sal_Int16 _nTableId)
     {
         ::osl::MutexGuard aGuard(s_aMutex);
-        const FormatEntry* pFormats = lcl_getFormatTable(_nTableId);
-        FormatEntry* pResetLoop = const_cast<FormatEntry*>(pFormats);
+        FormatEntry* pFormats = lcl_getFormatTable(_nTableId);
+        FormatEntry* pResetLoop = pFormats;
         while (pResetLoop->pDescription)
         {
             pResetLoop->nKey = -1;


More information about the Libreoffice-commits mailing list