[ooo-build-commit] .: 3 commits - patches/dev300

Fridrich Strba fridrich at kemper.freedesktop.org
Wed Sep 15 08:25:13 PDT 2010


 patches/dev300/apply                                   |   11 
 patches/dev300/calc-dp-default-new-sheet.diff          |  123 -----
 patches/dev300/sc-cellformat-icon-toggle.diff          |  388 -----------------
 patches/dev300/sc-fit-to-width-height-skip-breaks.diff |   31 -
 4 files changed, 553 deletions(-)

New commits:
commit 283067f2cae660ae4f3766daaff4c7abd2047f61
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Wed Sep 15 17:24:51 2010 +0200

    calc-dp-default-new-sheet.diff: Migrate to git

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 9be132d..50547cc 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -524,9 +524,6 @@ sw-ww8-styles-import-fix.diff, i#21939, cbosdo
 # keybindings: <ctrl> +/‑ to insert/delete a complete line in calc (X#62530)
 calc-new-acceleration.diff, i#67029, michael
 
-# default output to new sheet, instead of current sheet.
-calc-dp-default-new-sheet.diff, i#50886, kohei
-
 # Replace 'Manual Break' with 'Page Break' in menu texts.
 calc-menu-manual-page-break.diff, kohei
 
diff --git a/patches/dev300/calc-dp-default-new-sheet.diff b/patches/dev300/calc-dp-default-new-sheet.diff
deleted file mode 100644
index aa8e2f7..0000000
--- a/patches/dev300/calc-dp-default-new-sheet.diff
+++ /dev/null
@@ -1,123 +0,0 @@
----
- sc/source/ui/dbgui/pvlaydlg.cxx |   36 ++++++++++++++++++++++++------------
- sc/source/ui/inc/pvlaydlg.hxx   |    5 +++--
- sc/source/ui/view/tabvwshc.cxx  |    7 ++++++-
- 3 files changed, 33 insertions(+), 15 deletions(-)
-
-diff --git sc/source/ui/dbgui/pvlaydlg.cxx sc/source/ui/dbgui/pvlaydlg.cxx
-index 867277e..7372f9a 100644
---- sc/source/ui/dbgui/pvlaydlg.cxx
-+++ sc/source/ui/dbgui/pvlaydlg.cxx
-@@ -105,7 +105,7 @@ PointerStyle lclGetPointerForField( ScDPFieldType eType )
- //----------------------------------------------------------------------------
- 
- ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
--                                    const ScDPObject& rDPObject )
-+                                    const ScDPObject& rDPObject, bool bNewOutput )
-     :	ScAnyRefDlg	( pB, pCW, pParent, RID_SCDLG_PIVOT_LAYOUT ),
-         aFlLayout       ( this, ScResId( FL_LAYOUT ) ),
-         aFtPage         ( this, ScResId( FT_PAGE ) ),
-@@ -165,7 +165,7 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar
-     xDlgDPObject->FillOldParam( thePivotData, FALSE );
-     xDlgDPObject->FillLabelData( thePivotData );
- 
--    Init();
-+    Init(bNewOutput);
-     FreeResource();
- }
- 
-@@ -200,7 +200,7 @@ ScDPFieldWindow& ScDPLayoutDlg::GetFieldWindow( ScDPFieldType eType )
-     return aWndSelect;
- }
- 
--void __EXPORT ScDPLayoutDlg::Init()
-+void __EXPORT ScDPLayoutDlg::Init(bool bNewOutput)
- {
-     DBG_ASSERT( pViewData && pDoc,
-                 "Ctor-Initialisierung fehlgeschlagen!" );
-@@ -301,19 +301,31 @@ void __EXPORT ScDPLayoutDlg::Init()
-         }
-     }
- 
--    if ( thePivotData.nTab != MAXTAB+1 )
-+    if (bNewOutput)
-     {
--        String aStr;
--        ScAddress( thePivotData.nCol,
--                   thePivotData.nRow,
--                   thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() );
--        aEdOutPos.SetText( aStr );
--        EdModifyHdl(0);
-+        // Output to a new sheet by default for a brand-new output.
-+        aLbOutPos.SelectEntryPos(1);
-+        aEdOutPos.Disable();
-+        aRbOutPos.Disable();
-     }
-     else
-     {
--        aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 );
--        SelAreaHdl(NULL);
-+        // Modifying an existing dp output.
-+
-+        if ( thePivotData.nTab != MAXTAB+1 )
-+        {
-+            String aStr;
-+            ScAddress( thePivotData.nCol,
-+                       thePivotData.nRow,
-+                       thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() );
-+            aEdOutPos.SetText( aStr );
-+            EdModifyHdl(0);
-+        }
-+        else
-+        {
-+            aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 );
-+            SelAreaHdl(NULL);
-+        }
-     }
- 
-     aBtnIgnEmptyRows.Check( thePivotData.bIgnoreEmptyRows );
-diff --git sc/source/ui/inc/pvlaydlg.hxx sc/source/ui/inc/pvlaydlg.hxx
-index b14501e..5f77de2 100644
---- sc/source/ui/inc/pvlaydlg.hxx
-+++ sc/source/ui/inc/pvlaydlg.hxx
-@@ -87,7 +87,8 @@ public:
-                                 SfxBindings* pB,
-                                 SfxChildWindow* pCW,
-                                 Window* pParent,
--                                const ScDPObject& rDPObject );
-+                                const ScDPObject& rDPObject,
-+                                bool bNewOutput );
-     virtual                 ~ScDPLayoutDlg();
- 
-     virtual void            SetReference( const ScRange& rRef, ScDocument* pDoc );
-@@ -189,7 +190,7 @@ private:
- 
- private:
-     ScDPFieldWindow&        GetFieldWindow  ( ScDPFieldType eType );
--    void                    Init            ();
-+    void                    Init            (bool bNewOutput);
-     void                    InitWndSelect   ( const ::std::vector<ScDPLabelDataRef>& rLabels );
-     void                    InitWnd         ( PivotField* pArr, long nCount, ScDPFieldType eType );
-     void                    InitFocus       ();
-diff --git sc/source/ui/view/tabvwshc.cxx sc/source/ui/view/tabvwshc.cxx
-index 1beb938..241b923 100644
---- sc/source/ui/view/tabvwshc.cxx
-+++ sc/source/ui/view/tabvwshc.cxx
-@@ -252,8 +252,13 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
- 
-             if( pDialogDPObject )
-             {
-+                // Check for an existing datapilot output.
-+                ScViewData* pViewData = GetViewData();
-+                ScDPObject* pObj = GetViewData()->GetDocument()->GetDPAtCursor(
-+                    pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo());
-+
-                 GetViewData()->SetRefTabNo( GetViewData()->GetTabNo() );
--                pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject );
-+                pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject, pObj == NULL);
-             }
-         }
-         break;
--- 
-1.7.0.1
-
commit 9938e627480bea99a63f5cd6c57ca675606f3a8b
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Wed Sep 15 17:21:26 2010 +0200

    sc-fit-to-width-height-skip-breaks.diff: Migrate to git

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 4ff2b31..9be132d 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -524,10 +524,6 @@ sw-ww8-styles-import-fix.diff, i#21939, cbosdo
 # keybindings: <ctrl> +/‑ to insert/delete a complete line in calc (X#62530)
 calc-new-acceleration.diff, i#67029, michael
 
-# ignore manual breaks when the "fit to x pages wide and x pages tall" option
-# is used, for Excel interoperability.
-sc-fit-to-width-height-skip-breaks.diff, n#404232, n#404563, i#94698, kohei
-
 # default output to new sheet, instead of current sheet.
 calc-dp-default-new-sheet.diff, i#50886, kohei
 
diff --git a/patches/dev300/sc-fit-to-width-height-skip-breaks.diff b/patches/dev300/sc-fit-to-width-height-skip-breaks.diff
deleted file mode 100644
index 93ae632..0000000
--- a/patches/dev300/sc-fit-to-width-height-skip-breaks.diff
+++ /dev/null
@@ -1,31 +0,0 @@
- sc/source/core/data/table5.cxx |   10 ++++++++++
- 1 files changed, 10 insertions(+), 0 deletions(-)
-
-diff --git sc/source/core/data/table5.cxx sc/source/core/data/table5.cxx
-index bf4f50c..915b4f2 100644
---- sc/source/core/data/table5.cxx
-+++ sc/source/core/data/table5.cxx
-@@ -135,6 +135,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
- 
-     bool bSkipColBreaks = false;
-     bool bSkipRowBreaks = false;
-+    bool bSkipBreaks = false;
- 
-     if ( pStyleSet->GetItemState( ATTR_PAGE_SCALETOPAGES, FALSE, &pItem ) == SFX_ITEM_SET )
-     {
-@@ -152,6 +153,15 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
-             bSkipRowBreaks = true;
-     }
- 
-+    if (!bSkipBreaks && pStyleSet->GetItemState(ATTR_PAGE_SCALETO, false, &pItem) == SFX_ITEM_SET)
-+    {
-+        const ScPageScaleToItem& rScaleToItem = static_cast<const ScPageScaleToItem&>(
-+            pStyleSet->Get(ATTR_PAGE_SCALETO));
-+        if (rScaleToItem.GetWidth() > 0 || rScaleToItem.GetHeight() > 0)
-+            // when fitting to a fixed width x height, ignore manual breaks.
-+            bSkipBreaks = true;
-+    }
-+
-     //--------------------------------------------------------------------------
- 
-     long nPageSizeX = aPageSizeTwips.Width();
commit 9199944dc1e085d950ee2f6e1db90548d2482cec
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Wed Sep 15 17:15:12 2010 +0200

    sc-cellformat-icon-toggle.diff: Migrate to git

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 2c3452b..4ff2b31 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -524,10 +524,6 @@ sw-ww8-styles-import-fix.diff, i#21939, cbosdo
 # keybindings: <ctrl> +/‑ to insert/delete a complete line in calc (X#62530)
 calc-new-acceleration.diff, i#67029, michael
 
-# Make cell number format toolbar icons togglable & remove the standard format
-# button.
-sc-cellformat-icon-toggle.diff, n#358548, i#86377, kohei
-
 # ignore manual breaks when the "fit to x pages wide and x pages tall" option
 # is used, for Excel interoperability.
 sc-fit-to-width-height-skip-breaks.diff, n#404232, n#404563, i#94698, kohei
diff --git a/patches/dev300/sc-cellformat-icon-toggle.diff b/patches/dev300/sc-cellformat-icon-toggle.diff
deleted file mode 100644
index 1ab5688..0000000
--- a/patches/dev300/sc-cellformat-icon-toggle.diff
+++ /dev/null
@@ -1,388 +0,0 @@
----
- sc/inc/column.hxx                             |    1 +
- sc/inc/document.hxx                           |    1 +
- sc/inc/table.hxx                              |    1 +
- sc/sdi/formatsh.sdi                           |   10 +-
- sc/source/core/data/column.cxx                |   16 +++
- sc/source/core/data/document.cxx              |   26 +++++
- sc/source/core/data/table2.cxx                |    8 ++
- sc/source/ui/inc/formatsh.hxx                 |    3 +
- sc/source/ui/view/formatsh.cxx                |  124 +++++++++++++++++++++++--
- sc/source/ui/view/tabview3.cxx                |    7 ++
- sc/uiconfig/scalc/toolbar/formatobjectbar.xml |    2 +-
- 11 files changed, 184 insertions(+), 15 deletions(-)
-
-diff --git sc/inc/column.hxx sc/inc/column.hxx
-index 7987301..6a9ef60 100644
---- sc/inc/column.hxx
-+++ sc/inc/column.hxx
-@@ -301,6 +301,7 @@ public:
-     const ScPatternAttr*    GetMostUsedPattern( SCROW nStartRow, SCROW nEndRow ) const;
- 
-     ULONG		GetNumberFormat( SCROW nRow ) const;
-+    sal_uInt32  GetNumberFormat( SCROW nStartRow, SCROW nEndRow ) const;
- 
-     void		MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, BOOL bDeep ) const;
-     void		MergePatternArea( ScMergePatternState& rState, SCROW nRow1, SCROW nRow2, BOOL bDeep ) const;
-diff --git sc/inc/document.hxx sc/inc/document.hxx
-index a747095..10bb8d1 100644
---- sc/inc/document.hxx
-+++ sc/inc/document.hxx
-@@ -779,6 +779,7 @@ public:
-     SC_DLLPUBLIC double			RoundValueAsShown( double fVal, ULONG nFormat );
-     SC_DLLPUBLIC void			GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab,
-                                      sal_uInt32& rFormat );
-+    sal_uInt32      GetNumberFormat( const ScRange& rRange ) const;
-     SC_DLLPUBLIC sal_uInt32		GetNumberFormat( const ScAddress& ) const;
-                     /** If no number format attribute is set and the cell
-                         pointer passed is of type formula cell, the calculated
-diff --git sc/inc/table.hxx sc/inc/table.hxx
-index 0bbf7da..f20edc2 100644
---- sc/inc/table.hxx
-+++ sc/inc/table.hxx
-@@ -512,6 +512,7 @@ public:
-                                         0;
-                                 }
-     ULONG					GetNumberFormat( SCCOL nCol, SCROW nRow ) const;
-+    sal_uInt32              GetNumberFormat( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const;
-     void					MergeSelectionPattern( ScMergePatternState& rState,
-                                                 const ScMarkData& rMark, BOOL bDeep ) const;
-     void					MergePatternArea( ScMergePatternState& rState, SCCOL nCol1, SCROW nRow1,
-diff --git sc/sdi/formatsh.sdi sc/sdi/formatsh.sdi
-index 1ea04c7..923b935 100644
---- sc/sdi/formatsh.sdi
-+++ sc/sdi/formatsh.sdi
-@@ -117,11 +117,11 @@ interface FormatForSelection
-     SID_ATTR_NUMBERFORMAT_VALUE       [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState;]
-     SID_NUMBER_FORMAT       [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState;]
-     SID_NUMBER_TWODEC		[ ExecMethod = ExecuteNumFormat;]
--    SID_NUMBER_SCIENTIFIC	[ ExecMethod = ExecuteNumFormat;]
--    SID_NUMBER_DATE			[ ExecMethod = ExecuteNumFormat;]
--    SID_NUMBER_CURRENCY		[ ExecMethod = ExecuteNumFormat;]
--    SID_NUMBER_PERCENT		[ ExecMethod = ExecuteNumFormat;]
--    SID_NUMBER_TIME			[ ExecMethod = ExecuteNumFormat;]
-+    SID_NUMBER_SCIENTIFIC   [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ]
-+    SID_NUMBER_DATE         [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ]
-+    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_INCDEC		[ ExecMethod = ExecuteNumFormat;]
-     SID_NUMBER_DECDEC		[ ExecMethod = ExecuteNumFormat;]
-diff --git sc/source/core/data/column.cxx sc/source/core/data/column.cxx
-index 9d7fdd0..0f3e43d 100644
---- sc/source/core/data/column.cxx
-+++ sc/source/core/data/column.cxx
-@@ -354,6 +354,22 @@ const ScPatternAttr* ScColumn::GetMostUsedPattern( SCROW nStartRow, SCROW nEndRo
-     return pMaxPattern;
- }
- 
-+sal_uInt32 ScColumn::GetNumberFormat( SCROW nStartRow, SCROW nEndRow ) const
-+{
-+    SCROW nPatStartRow, nPatEndRow;
-+    const ScPatternAttr* pPattern = pAttrArray->GetPatternRange(nPatStartRow, nPatEndRow, nStartRow);
-+    sal_uInt32 nFormat = pPattern->GetNumberFormat(pDocument->GetFormatTable());
-+    while (nEndRow > nPatEndRow)
-+    {
-+        nStartRow = nPatEndRow + 1;
-+        pPattern = pAttrArray->GetPatternRange(nPatStartRow, nPatEndRow, nStartRow);
-+        sal_uInt32 nTmpFormat = pPattern->GetNumberFormat(pDocument->GetFormatTable());
-+        if (nFormat != nTmpFormat)
-+            return 0;
-+    }
-+    return nFormat;
-+}
-+
- 
- ULONG ScColumn::GetNumberFormat( SCROW nRow ) const
- {
-diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx
-index 8e96721..f63af99 100644
---- sc/source/core/data/document.cxx
-+++ sc/source/core/data/document.cxx
-@@ -2723,6 +2723,32 @@ void ScDocument::GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab,
-     rFormat = 0;
- }
- 
-+sal_uInt32 ScDocument::GetNumberFormat( const ScRange& rRange ) const
-+{
-+    SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab();
-+    SCCOL nCol1 = rRange.aStart.Col(), nCol2 = rRange.aEnd.Col();
-+    SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row();
-+
-+    if (!ValidTab(nTab1) || !ValidTab(nTab2) || !pTab[nTab1] || !pTab[nTab2])
-+        return 0;
-+
-+    sal_uInt32 nFormat = 0;
-+    bool bFirstItem = true;
-+    for (SCTAB nTab = nTab1; nTab <= nTab2; ++nTab)
-+        for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
-+        {
-+            sal_uInt32 nThisFormat = pTab[nTab]->GetNumberFormat(nCol, nRow1, nRow2);
-+            if (bFirstItem)
-+            {
-+                nFormat = nThisFormat;
-+                bFirstItem = false;
-+            }
-+            else if (nThisFormat != nFormat)
-+                return 0;
-+        }
-+
-+    return nFormat;
-+}
- 
- sal_uInt32 ScDocument::GetNumberFormat( const ScAddress& rPos ) const
- {
-diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
-index 0b2979f..50b86f6 100644
---- sc/source/core/data/table2.cxx
-+++ sc/source/core/data/table2.cxx
-@@ -1241,6 +1241,14 @@ ULONG ScTable::GetNumberFormat( SCCOL nCol, SCROW nRow ) const
-         return 0;
- }
- 
-+sal_uInt32 ScTable::GetNumberFormat( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const
-+{
-+    if (!ValidCol(nCol) || !ValidRow(nStartRow) || !ValidRow(nEndRow))
-+        return 0;
-+
-+    return aCol[nCol].GetNumberFormat(nStartRow, nEndRow);
-+}
-+
- 
- const ScPatternAttr* ScTable::GetPattern( SCCOL nCol, SCROW nRow ) const
- {
-diff --git sc/source/ui/inc/formatsh.hxx sc/source/ui/inc/formatsh.hxx
-index e22d492..1dfd724 100644
---- sc/source/ui/inc/formatsh.hxx
-+++ sc/source/ui/inc/formatsh.hxx
-@@ -74,6 +74,9 @@ public:
- 
-     void        ExecFormatPaintbrush( SfxRequest& rReq );
-     void        StateFormatPaintbrush( SfxItemSet& rSet );
-+
-+private:
-+    short       GetCurrentNumberFormatType();
- };
- 
- #endif
-diff --git sc/source/ui/view/formatsh.cxx sc/source/ui/view/formatsh.cxx
-index 9f6bf0d..04a7236 100644
---- sc/source/ui/view/formatsh.cxx
-+++ sc/source/ui/view/formatsh.cxx
-@@ -55,6 +55,7 @@
- 
- #include <sfx2/app.hxx>
- #include <sfx2/viewfrm.hxx>
-+#include <sfx2/bindings.hxx>
- #include <sfx2/objface.hxx>
- #include <sfx2/request.hxx>
- #include <svl/whiter.hxx>
-@@ -921,6 +922,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
-     ScTabViewShell*	pTabViewShell  	= GetViewData()->GetViewShell();
-     const SfxItemSet*	pReqArgs	= rReq.GetArgs();
-     USHORT				nSlot		= rReq.GetSlot();
-+    SfxBindings& rBindings          = pTabViewShell->GetViewFrame()->GetBindings();
- 
-     pTabViewShell->HideListBox();					// Autofilter-DropDown-Listbox
- 
-@@ -953,6 +955,8 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
-         }
-     }
- 
-+    short nType = GetCurrentNumberFormatType();
-+    SfxItemSet aSet( GetPool(), nSlot, nSlot );
-     switch ( nSlot )
-     {
-         case SID_NUMBER_TWODEC:
-@@ -960,23 +964,48 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
-             rReq.Done();
-             break;
-         case SID_NUMBER_SCIENTIFIC:
--            pTabViewShell->SetNumberFormat( NUMBERFORMAT_SCIENTIFIC );
-+            if ((nType & NUMBERFORMAT_SCIENTIFIC))
-+                pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER );
-+            else
-+                pTabViewShell->SetNumberFormat( NUMBERFORMAT_SCIENTIFIC );
-+            aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_SCIENTIFIC)) );
-+            rBindings.Invalidate( nSlot );
-             rReq.Done();
-             break;
-         case SID_NUMBER_DATE:
--            pTabViewShell->SetNumberFormat( NUMBERFORMAT_DATE );
-+            if ((nType & NUMBERFORMAT_DATE))
-+                pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER );
-+            else
-+                pTabViewShell->SetNumberFormat( NUMBERFORMAT_DATE );
-+            aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_DATE)) );
-+            rBindings.Invalidate( nSlot );
-             rReq.Done();
-             break;
-         case SID_NUMBER_TIME:
--            pTabViewShell->SetNumberFormat( NUMBERFORMAT_TIME );
-+            if ((nType & NUMBERFORMAT_TIME))
-+                pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER );
-+            else
-+                pTabViewShell->SetNumberFormat( NUMBERFORMAT_TIME );
-+            aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_TIME)) );
-+            rBindings.Invalidate( nSlot );
-             rReq.Done();
-             break;
-         case SID_NUMBER_CURRENCY:
--            pTabViewShell->SetNumberFormat( NUMBERFORMAT_CURRENCY );
-+            if ((nType & NUMBERFORMAT_CURRENCY))
-+                pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER );
-+            else
-+                pTabViewShell->SetNumberFormat( NUMBERFORMAT_CURRENCY );
-+            aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_CURRENCY)) );
-+            rBindings.Invalidate( nSlot );
-             rReq.Done();
-             break;
-         case SID_NUMBER_PERCENT:
--            pTabViewShell->SetNumberFormat( NUMBERFORMAT_PERCENT );
-+            if ((nType & NUMBERFORMAT_PERCENT))
-+                pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER );
-+            else
-+                pTabViewShell->SetNumberFormat( NUMBERFORMAT_PERCENT );
-+            aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_PERCENT)) );
-+            rBindings.Invalidate( nSlot );
-             rReq.Done();
-             break;
-         case SID_NUMBER_STANDARD:
-@@ -1982,9 +2011,8 @@ void ScFormatShell::GetAlignState( SfxItemSet& rSet )
- void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
- {
-     ScTabViewShell*	pTabViewShell  	= GetViewData()->GetViewShell();
--
--    // ScViewData* pViewData   = GetViewData();
--    ScDocument* pDoc		= pViewData->GetDocument();
-+    ScDocument* pDoc                = pViewData->GetDocument();
-+    short nType                     = GetCurrentNumberFormatType();
- 
-     SfxWhichIter aIter(rSet);
-     USHORT nWhich = aIter.FirstWhich();
-@@ -2011,7 +2039,21 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
-                     rSet.Put( SfxStringItem( nWhich, aFormatCode ) );
-                 }
-                 break;
--
-+            case SID_NUMBER_SCIENTIFIC:
-+                rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_SCIENTIFIC)) );
-+                break;
-+            case SID_NUMBER_DATE:
-+                rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_DATE)) );
-+                break;
-+            case SID_NUMBER_CURRENCY:
-+                rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_CURRENCY)) );
-+                break;
-+            case SID_NUMBER_PERCENT:
-+                rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_PERCENT)) );
-+                break;
-+            case SID_NUMBER_TIME:
-+                rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_TIME)) );
-+                break;
-         }
-         nWhich = aIter.NextWhich();
-     }
-@@ -2162,3 +2204,67 @@ void ScFormatShell::StateFormatPaintbrush( SfxItemSet& rSet )
-         rSet.Put( SfxBoolItem( SID_FORMATPAINTBRUSH, pViewData->GetView()->HasPaintBrush() ) );
- }
- 
-+short ScFormatShell::GetCurrentNumberFormatType()
-+{
-+    short nType = NUMBERFORMAT_ALL;
-+    ScDocument* pDoc = GetViewData()->GetDocument();
-+    ScMarkData aMark(GetViewData()->GetMarkData());
-+    const SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
-+    if (!pFormatter)
-+        return nType;
-+
-+    // TODO: Find out how to get a selected table range in case multiple tables
-+    // are selected.  Currently we only check for the current active table.
-+
-+    if ( aMark.IsMarked() || aMark.IsMultiMarked() )
-+    {
-+        aMark.MarkToMulti();
-+        ScRange aRange;
-+        aMark.GetMultiMarkArea(aRange);
-+
-+        const ScMarkArray* pArray = aMark.GetArray();
-+        if (!pArray)
-+            return nType;
-+
-+        short nComboType = NUMBERFORMAT_ALL;
-+        bool bFirstItem = true;
-+        for (SCCOL nCol = aRange.aStart.Col(); nCol <= aRange.aEnd.Col(); ++nCol)
-+        {
-+            const ScMarkArray& rColArray = pArray[nCol];
-+            if (!rColArray.HasMarks())
-+                continue;
-+
-+            SCROW nRow1, nRow2;
-+            ScMarkArrayIter aMarkIter(&rColArray);
-+            while (aMarkIter.Next(nRow1, nRow2))
-+            {
-+                ScRange aColRange(nCol, nRow1, aRange.aStart.Tab());
-+                aColRange.aEnd.SetRow(nRow2);
-+                sal_uInt32 nNumFmt = pDoc->GetNumberFormat(aColRange);
-+                const SvNumberformat* pEntry = pFormatter->GetEntry(nNumFmt);
-+                if (!pEntry)
-+                    return 0;
-+
-+                short nThisType = pEntry->GetType();
-+                if (bFirstItem)
-+                {
-+                    bFirstItem = false;
-+                    nComboType = nThisType;
-+                }
-+                else if (nComboType != nThisType)
-+                    // mixed number format type.
-+                    return NUMBERFORMAT_ALL;
-+            }
-+        }
-+        nType = nComboType;
-+    }
-+    else
-+    {
-+        sal_uInt32 nNumFmt;
-+        pDoc->GetNumberFormat( pViewData->GetCurX(), pViewData->GetCurY(),
-+                               pViewData->GetTabNo(), nNumFmt );
-+        const SvNumberformat* pEntry = pFormatter->GetEntry( nNumFmt );
-+        nType = pEntry ? pEntry->GetType() : 0;
-+    }
-+    return nType;
-+}
-diff --git sc/source/ui/view/tabview3.cxx sc/source/ui/view/tabview3.cxx
-index 806db79..6444efe 100644
---- sc/source/ui/view/tabview3.cxx
-+++ sc/source/ui/view/tabview3.cxx
-@@ -264,6 +264,13 @@ void ScTabView::InvalidateAttribs()
-     rBindings.Invalidate( SID_ALIGN_ANY_VCENTER );
-     rBindings.Invalidate( SID_ALIGN_ANY_BOTTOM );
- 
-+    rBindings.Invalidate( SID_NUMBER_CURRENCY );
-+    rBindings.Invalidate( SID_NUMBER_SCIENTIFIC );
-+    rBindings.Invalidate( SID_NUMBER_DATE );
-+    rBindings.Invalidate( SID_NUMBER_CURRENCY );
-+    rBindings.Invalidate( SID_NUMBER_PERCENT );
-+    rBindings.Invalidate( SID_NUMBER_TIME );
-+
- //	rBindings.Invalidate( SID_RANGE_VALUE );
- //	rBindings.Invalidate( SID_RANGE_FORMULA );
- }
-diff --git sc/uiconfig/scalc/toolbar/formatobjectbar.xml sc/uiconfig/scalc/toolbar/formatobjectbar.xml
-index 13b6abc..49c31d7 100644
---- sc/uiconfig/scalc/toolbar/formatobjectbar.xml
-+++ sc/uiconfig/scalc/toolbar/formatobjectbar.xml
-@@ -33,7 +33,7 @@
-  <toolbar:toolbaritem xlink:href=".uno:NumberFormatPercent" toolbar:helpid="helpid:26046"  />
-  <toolbar:toolbaritem xlink:href=".uno:NumberFormatDate" toolbar:helpid="helpid:26053"  toolbar:visible="false" />
-  <toolbar:toolbaritem xlink:href=".uno:NumberFormatScientific" toolbar:helpid="helpid:26055"  toolbar:visible="false" />
-- <toolbar:toolbaritem xlink:href=".uno:NumberFormatStandard" toolbar:helpid="helpid:26052"  />
-+ <toolbar:toolbaritem xlink:href=".uno:NumberFormatStandard" toolbar:helpid="helpid:26052"  toolbar:visible="false" />
-  <toolbar:toolbaritem xlink:href=".uno:NumberFormatIncDecimals" toolbar:helpid="helpid:26057"  />
-  <toolbar:toolbaritem xlink:href=".uno:NumberFormatDecDecimals" toolbar:helpid="helpid:26058"  />
-  <toolbar:toolbarseparator/>
--- 
-1.7.0.1
-


More information about the ooo-build-commit mailing list