[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sc/source

Andre Fischer af at apache.org
Sat May 4 03:02:57 PDT 2013


 sc/source/ui/view/formatsh.cxx |   76 +++++++++++++++++++++--------------------
 1 file changed, 40 insertions(+), 36 deletions(-)

New commits:
commit 61b4764c96fa4425ab0c3239a232fa5ebd13fbf8
Author: Andre Fischer <af at apache.org>
Date:   Thu Apr 11 12:29:52 2013 +0000

    Resolves: #i122027# Fixed crash when processing .uno:NumberType command
    
    Reported by:  Ariel Constenla-Haile
    Patch by:  Ariel Constenla-Haile
    Review by: Andre Fischer
    (cherry picked from commit 6a56f5db1d478297aedd3395a882fc2dcce80e82)
    
    Change-Id: Idbcb46b617fc2d2e2d587cdd74226380a2019303

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 3980751..2916810 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1131,45 +1131,49 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
             break;
 
         case SID_NUMBER_TYPE_FORMAT:
+            if ( pReqArgs )
             {
-                SfxInt16Item aFormatItem((const SfxInt16Item&)rReq.GetArgs()->Get(nSlot));
-                sal_uInt16 nFormat = aFormatItem.GetValue();
-                switch(nFormat)
+                const SfxPoolItem* pItem;
+                if ( pReqArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET )
                 {
-                case 0:
-                    pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER); //Modify
-                    break;
-                case 1:
-                    pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER, 2 ); //Modify
-                    break;
-                case 2:
-                    pTabViewShell->SetNumberFormat( NUMBERFORMAT_PERCENT );
-                    break;
-                case 3:
-                    pTabViewShell->SetNumberFormat( NUMBERFORMAT_CURRENCY );
-                    break;
-                case 4:
-                    pTabViewShell->SetNumberFormat( NUMBERFORMAT_DATE );
-                    break;
-                case 5:
-                    pTabViewShell->SetNumberFormat( NUMBERFORMAT_TIME );
-                    break;
-                case 6:
-                    pTabViewShell->SetNumberFormat( NUMBERFORMAT_SCIENTIFIC );
-                    break;
-                case 7:
-                    pTabViewShell->SetNumberFormat( NUMBERFORMAT_FRACTION );
-                    break;
-                case 8:
-                    pTabViewShell->SetNumberFormat( NUMBERFORMAT_LOGICAL );
-                    break;
-                case 9:
-                    pTabViewShell->SetNumberFormat( NUMBERFORMAT_TEXT );
-                    break;
-                default:
-                    ;
+                    sal_uInt16 nFormat = ((SfxInt16Item *)pItem)->GetValue();
+                    switch(nFormat)
+                    {
+                    case 0:
+                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER); //Modify
+                        break;
+                    case 1:
+                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER, 2 ); //Modify
+                        break;
+                    case 2:
+                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_PERCENT );
+                        break;
+                    case 3:
+                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_CURRENCY );
+                        break;
+                    case 4:
+                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_DATE );
+                        break;
+                    case 5:
+                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_TIME );
+                        break;
+                    case 6:
+                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_SCIENTIFIC );
+                        break;
+                    case 7:
+                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_FRACTION );
+                        break;
+                    case 8:
+                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_LOGICAL );
+                        break;
+                    case 9:
+                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_TEXT );
+                        break;
+                    default:
+                        ;
+                    }
+                    rReq.Done();
                 }
-                rReq.Done();
             }
             break;
 


More information about the Libreoffice-commits mailing list