[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Mar 22 20:02:42 PDT 2011


 sc/source/ui/view/output2.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 966ed5539ea55262144328e01f45c9f9e96a19e7
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Mar 22 22:58:36 2011 -0400

    Don't auto-adjust date and time values per column width. (fdo#34484)
    
    Actually we want to auto-adjust values per column width *only when*
    the implicit number format is pure numeric.  Note that each cell may
    have two associated number format types: one that's set by the user
    explicitly, and one that's set by the formula interpreter inplicitly.
    We need to care for both.

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 95d8380..11ff347 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -564,6 +564,15 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScBaseCell* pCell, long nWidth )
         // If it's formula, the result must be a value.
         if (!pFCell->IsValue())
             return;
+
+        if (pFCell->GetFormatType() != NUMBERFORMAT_NUMBER)
+        {
+            // Make sure the format type implicitly set by the interpreter is
+            // of pure numeric type.  We don't want to adjust date and time
+            // values here.
+            SetHashText();
+            return;
+        }
     }
 
     sal_uLong nFormat = GetValueFormat();


More information about the Libreoffice-commits mailing list