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

Michael Stahl mstahl at redhat.com
Sat Mar 29 05:51:07 PDT 2014


 sw/source/filter/basflt/shellio.cxx |   21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

New commits:
commit 2ca930d66b56adcd1ae36b7de473a4598c24acb7
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sat Mar 29 13:39:44 2014 +0100

    Reader::ResetFrmFmts(): work around spurious MSVC warning C4701
    
    Change-Id: I216888cb92d61a5b8c9252fe8c12c01a6fb9af8a

diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 56eefcb..a0db1dd 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -617,23 +617,12 @@ void Reader::ResetFrmFmtAttrs( SfxItemSet &rFrmSet )
 
 void Reader::ResetFrmFmts( SwDoc& rDoc )
 {
-    for (sal_uInt16 i=0; i<3; ++i)
+    sal_uInt16 const s_ids[3] = {
+        RES_POOLFRM_FRAME, RES_POOLFRM_GRAPHIC, RES_POOLFRM_OLE
+    };
+    for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS(s_ids); ++i)
     {
-        sal_uInt16 nPoolId;
-        switch (i)
-        {
-            case 0:
-                nPoolId = RES_POOLFRM_FRAME;
-                break;
-            case 1:
-                nPoolId = RES_POOLFRM_GRAPHIC;
-                break;
-            case 2:
-                nPoolId = RES_POOLFRM_OLE;
-                break;
-        }
-
-        SwFrmFmt *pFrmFmt = rDoc.GetFrmFmtFromPool( nPoolId );
+        SwFrmFmt *const pFrmFmt = rDoc.GetFrmFmtFromPool( s_ids[i] );
 
         pFrmFmt->ResetFmtAttr( RES_LR_SPACE );
         pFrmFmt->ResetFmtAttr( RES_UL_SPACE );


More information about the Libreoffice-commits mailing list