[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Mar 2 15:12:50 PST 2011


 sc/source/ui/view/output2.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 6cf6c9f9cc80c739cf12d03c22360487b3a4bc91
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Mar 2 18:09:36 2011 -0500

    No auto decimal adjustment when in "show formula" mode. (fdo#33665)

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index cc0147d..a110f35 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -143,6 +143,7 @@ public:
     void		SetPatternSimple( const ScPatternAttr* pNew, const SfxItemSet* pSet );
 
     BOOL		SetText( ScBaseCell* pCell );	// TRUE -> pOldPattern vergessen
+    void        SetHashText();
     void        SetTextToWidthOrHash( ScBaseCell* pCell, long nWidth );
     void		SetAutoText( const String& rAutoText );
 
@@ -176,7 +177,6 @@ public:
     BOOL    HasEditCharacters() const;
 
 private:
-    void        SetHashText();
     long        GetMaxDigitWidth();     // in logic units
     long        GetSignWidth();
     long        GetDotWidth();
@@ -1677,8 +1677,12 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
                 {
                     if ( bCellIsValue && ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) )
                     {
-                        // Adjust the decimals to fit the available column width.
-                        aVars.SetTextToWidthOrHash(pCell, aAreaParam.mnColWidth - nTotalMargin);
+                        if (bShowFormulas)
+                            aVars.SetHashText();
+                        else
+                            // Adjust the decimals to fit the available column width.
+                            aVars.SetTextToWidthOrHash(pCell, aAreaParam.mnColWidth - nTotalMargin);
+
                         nNeededWidth = aVars.GetTextSize().Width() +
                                     (long) ( aVars.GetLeftTotal() * nPPTX ) +
                                     (long) ( aVars.GetMargin()->GetRightMargin() * nPPTX );


More information about the Libreoffice-commits mailing list