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

Michael Stahl mstahl at redhat.com
Tue Jul 8 05:36:09 PDT 2014


 sw/source/core/undo/untbl.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 65438659a18698334f22307ccb4d5ed844b637bf
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Jul 8 14:29:05 2014 +0200

    sw: work around mysterious MSVC warning C4258
    
    Cleraly the variable "n" from line 999 is not in scope in
    line 1054 or line 1057?
    
    Change-Id: I8ca321e6030390ad0192e4dceb37d87b6f06f0a5

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index abb2539..bc71738 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1051,10 +1051,18 @@ void _SaveTable::CreateNew( SwTable& rTbl, bool bCreateFrms,
             }
         }
 
+#ifdef _MSC_VER
+// MSVC 2012 appears very confused and rambles about a declaration of "n" below
+#pragma warning (push, 1)
+#pragma warning (disable: 4258)
+#endif
         for( SwTableLines::const_iterator it = rTbl.GetTabLines().begin() + n;
              it != rTbl.GetTabLines().begin() + nOldLines; ++it )
             delete *it;
         rTbl.GetTabLines().erase( rTbl.GetTabLines().begin() + n, rTbl.GetTabLines().begin() + nOldLines );
+#ifdef _MSC_VER
+#pragma warning (pop)
+#endif
     }
 
     aParent.GetTabLines().erase( aParent.GetTabLines().begin(), aParent.GetTabLines().begin() + n );


More information about the Libreoffice-commits mailing list