[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Nov 23 15:30:00 PST 2011


 sc/source/filter/excel/xeview.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0215f8b19451ab67c7fdaf91f2da8298a9b89c47
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Wed Nov 23 18:23:14 2011 -0500

    fdo#39589: Avoid using ulimit_cast between signed and unsigned.
    
    If you do, things go very very wrong.  These *limit_cast try to be
    clever and check ranges of various types before casting, but they
    fail to do the right thing when casting a signed integer into unsigned.

diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx
index 37d075e..94f082a 100644
--- a/sc/source/filter/excel/xeview.cxx
+++ b/sc/source/filter/excel/xeview.cxx
@@ -368,8 +368,8 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc
         else
         {
             // split window: position is in twips
-            maData.mnSplitX = ulimit_cast< sal_uInt16 >( rTabSett.maSplitPos.X() );
-            maData.mnSplitY = ulimit_cast< sal_uInt32 >( rTabSett.maSplitPos.Y() );
+            maData.mnSplitX = static_cast<sal_uInt16>(rTabSett.maSplitPos.X());
+            maData.mnSplitY = static_cast<sal_uInt32>(rTabSett.maSplitPos.Y());
         }
 
         // selection


More information about the Libreoffice-commits mailing list