sc/sdi/formatsh.sdi            |    2 +-
 sc/source/ui/view/formatsh.cxx |   11 ++++++++++-
 sc/source/ui/view/tabview3.cxx |    1 +
 3 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 82beda528fb74ae1c6b5e12a98dbf5d4e9e4c0db
Author: Gulsah Kose <gulsah.1...@gmail.com>
Date:   Tue May 30 15:45:24 2017 +0300

    tdf#86119 Fix toggle behaviour of SID_NUMBER_STANDARD.
    
    Change-Id: I718869c92a3a03c05b8db3fe665f5502202f434b
    Signed-off-by: Gulsah Kose <gulsah.1...@gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/38217
    Tested-by: Jenkins <c...@libreoffice.org>

diff --git a/sc/sdi/formatsh.sdi b/sc/sdi/formatsh.sdi
index 3663955aadfa..54771a8dbb80 100644
--- a/sc/sdi/formatsh.sdi
+++ b/sc/sdi/formatsh.sdi
@@ -110,7 +110,7 @@ interface FormatForSelection
     SID_NUMBER_CURRENCY     [ ExecMethod = ExecuteNumFormat; StateMethod = 
GetNumFormatState; ]
     SID_NUMBER_PERCENT      [ ExecMethod = ExecuteNumFormat; StateMethod = 
GetNumFormatState; ]
     SID_NUMBER_TIME         [ ExecMethod = ExecuteNumFormat; StateMethod = 
GetNumFormatState; ]
-    SID_NUMBER_STANDARD     [ ExecMethod = ExecuteNumFormat;]
+    SID_NUMBER_STANDARD     [ ExecMethod = ExecuteNumFormat; StateMethod = 
GetNumFormatState; ]
     SID_NUMBER_INCDEC       [ ExecMethod = ExecuteNumFormat;]
     SID_NUMBER_DECDEC       [ ExecMethod = ExecuteNumFormat;]
 
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 259338a37ab4..cef3eab48bc3 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1127,7 +1127,9 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
             rReq.Done();
             break;
         case SID_NUMBER_STANDARD:
-            pTabViewShell->SetNumberFormat( css::util::NumberFormat::NUMBER );
+            if (!(nType & css::util::NumberFormat::NUMBER))
+                pTabViewShell->SetNumberFormat( 
css::util::NumberFormat::NUMBER );
+            rBindings.Invalidate( nSlot );
             rReq.Done();
             break;
         case SID_NUMBER_INCDEC:
@@ -2637,6 +2639,13 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
                     rSet.Put( SfxBoolItem(nWhich, (nType & 
css::util::NumberFormat::NUMBER) && nNumberFormat == 4 ) );
                 }
                 break;
+            case SID_NUMBER_STANDARD:
+                {
+                    const SfxItemSet& rAttrSet = 
pTabViewShell->GetSelectionPattern()->GetItemSet();
+                    sal_uInt32 nNumberFormat = static_cast<const 
SfxUInt32Item&>(rAttrSet.Get(ATTR_VALUE_FORMAT)).GetValue();
+                    rSet.Put( SfxBoolItem(nWhich, (nType & 
css::util::NumberFormat::NUMBER) && nNumberFormat == 0 ) );
+                }
+                break;
         }
         nWhich = aIter.NextWhich();
     }
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 429f34e1017e..de638447b567 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -322,6 +322,7 @@ void ScTabView::InvalidateAttribs()
     rBindings.Invalidate( SID_NUMBER_PERCENT );
     rBindings.Invalidate( SID_NUMBER_TWODEC );
     rBindings.Invalidate( SID_NUMBER_TIME );
+    rBindings.Invalidate( SID_NUMBER_STANDARD );
 }
 
 // SetCursor - Cursor, set, draw, update InputWin
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to