ooo-build r13538 - in branches/ooo-build-2-4-1: . patches/src680
- From: kyoshida svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r13538 - in branches/ooo-build-2-4-1: . patches/src680
- Date: Wed, 13 Aug 2008 03:01:34 +0000 (UTC)
Author: kyoshida
Date: Wed Aug 13 03:01:34 2008
New Revision: 13538
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13538&view=rev
Log:
2008-08-12 Kohei Yoshida <kyoshida novell com>
* patches/dev300/sc-cellformat-icon-toggle.diff: fixed a crash bug
(n#416837, i#92703), and fixed the handling of number format state on
cell ranges, which is basically a backport of the fix that was already
in trunk.
Modified:
branches/ooo-build-2-4-1/ChangeLog
branches/ooo-build-2-4-1/patches/src680/sc-cellformat-icon-toggle.diff
Modified: branches/ooo-build-2-4-1/patches/src680/sc-cellformat-icon-toggle.diff
==============================================================================
--- branches/ooo-build-2-4-1/patches/src680/sc-cellformat-icon-toggle.diff (original)
+++ branches/ooo-build-2-4-1/patches/src680/sc-cellformat-icon-toggle.diff Wed Aug 13 03:01:34 2008
@@ -1,6 +1,43 @@
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/sdi/formatsh.sdi sc/sdi/formatsh.sdi
---- sc.clean/sdi/formatsh.sdi 2008-02-05 11:16:54.000000000 -0500
-+++ sc/sdi/formatsh.sdi 2008-02-22 15:20:31.000000000 -0500
+diff --git sc/inc/column.hxx sc/inc/column.hxx
+index 6b1efa7..a01de23 100644
+--- sc/inc/column.hxx
++++ sc/inc/column.hxx
+@@ -323,6 +323,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 98a6d71..83b7f2d 100644
+--- sc/inc/document.hxx
++++ sc/inc/document.hxx
+@@ -766,6 +766,7 @@ SC_DLLPUBLIC ScDBCollection* GetDBCollection() const;
+ double RoundValueAsShown( double fVal, ULONG nFormat );
+ void GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab,
+ sal_uInt32& rFormat );
++ sal_uInt32 GetNumberFormat( const ScRange& rRange ) const;
+ sal_uInt32 GetNumberFormat( const ScAddress& ) const;
+ /// if no number format attribute is set the calculated
+ /// number format of the formula cell is returned
+diff --git sc/inc/table.hxx sc/inc/table.hxx
+index 2563eb1..99882db 100644
+--- sc/inc/table.hxx
++++ sc/inc/table.hxx
+@@ -458,6 +458,7 @@ public:
+ ULONG GetNumberFormat( const ScAddress& rPos ) const
+ { return aCol[rPos.Col()].GetNumberFormat( rPos.Row() ); }
+ 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 c13cc7a..90d8bfc 100644
+--- sc/sdi/formatsh.sdi
++++ sc/sdi/formatsh.sdi
@@ -124,11 +124,11 @@ interface FormatForSelection
SID_ATTR_NUMBERFORMAT_VALUE [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState;]
SID_NUMBER_FORMAT [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState;]
@@ -18,22 +55,107 @@
SID_NUMBER_STANDARD [ ExecMethod = ExecuteNumFormat;]
SID_NUMBER_INCDEC [ ExecMethod = ExecuteNumFormat;]
SID_NUMBER_DECDEC [ ExecMethod = ExecuteNumFormat;]
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/ui/inc/formatsh.hxx sc/source/ui/inc/formatsh.hxx
---- sc.clean/source/ui/inc/formatsh.hxx 2008-02-05 11:16:55.000000000 -0500
-+++ sc/source/ui/inc/formatsh.hxx 2008-02-22 13:00:00.000000000 -0500
+diff --git sc/source/core/data/column.cxx sc/source/core/data/column.cxx
+index f41d5d1..95a42c0 100644
+--- sc/source/core/data/column.cxx
++++ sc/source/core/data/column.cxx
+@@ -369,6 +369,22 @@ ULONG ScColumn::GetNumberFormat( SCROW nRow ) const
+ return pAttrArray->GetPattern( nRow )->GetNumberFormat( pDocument->GetFormatTable() );
+ }
+
++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;
++}
++
+
+ SCsROW ScColumn::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray )
+ {
+diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx
+index 0d35712..6d84567 100644
+--- sc/source/core/data/document.cxx
++++ sc/source/core/data/document.cxx
+@@ -2248,6 +2248,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 87c17c7..d2048b3 100644
+--- sc/source/core/data/table2.cxx
++++ sc/source/core/data/table2.cxx
+@@ -1115,6 +1115,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 b86f6fe..ce42e84 100644
+--- sc/source/ui/inc/formatsh.hxx
++++ sc/source/ui/inc/formatsh.hxx
@@ -91,6 +91,9 @@ public:
void ExecFormatPaintbrush( SfxRequest& rReq );
void StateFormatPaintbrush( SfxItemSet& rSet );
+
+private:
-+ short GetCurrentNumberFormatType() const;
++ short GetCurrentNumberFormatType();
};
#endif
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/ui/view/formatsh.cxx sc/source/ui/view/formatsh.cxx
---- sc.clean/source/ui/view/formatsh.cxx 2008-02-05 11:16:56.000000000 -0500
-+++ sc/source/ui/view/formatsh.cxx 2008-02-22 15:22:45.000000000 -0500
+diff --git sc/source/ui/view/formatsh.cxx sc/source/ui/view/formatsh.cxx
+index 3383ad0..3823b09 100644
+--- sc/source/ui/view/formatsh.cxx
++++ sc/source/ui/view/formatsh.cxx
@@ -72,6 +72,7 @@
#include <sfx2/app.hxx>
@@ -42,7 +164,7 @@
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
#include <svtools/whiter.hxx>
-@@ -935,6 +936,7 @@ void ScFormatShell::ExecuteNumFormat( Sf
+@@ -935,6 +936,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
const SfxItemSet* pReqArgs = rReq.GetArgs();
USHORT nSlot = rReq.GetSlot();
@@ -50,7 +172,7 @@
pTabViewShell->HideListBox(); // Autofilter-DropDown-Listbox
-@@ -967,6 +969,8 @@ void ScFormatShell::ExecuteNumFormat( Sf
+@@ -967,6 +969,8 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
}
}
@@ -59,7 +181,7 @@
switch ( nSlot )
{
case SID_NUMBER_TWODEC:
-@@ -974,23 +978,48 @@ void ScFormatShell::ExecuteNumFormat( Sf
+@@ -974,23 +978,48 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
rReq.Done();
break;
case SID_NUMBER_SCIENTIFIC:
@@ -113,7 +235,7 @@
rReq.Done();
break;
case SID_NUMBER_STANDARD:
-@@ -2006,9 +2035,8 @@ void ScFormatShell::GetBckColState( SfxI
+@@ -2006,9 +2035,8 @@ void ScFormatShell::GetBckColState( SfxItemSet& rSet )
void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
{
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
@@ -125,7 +247,7 @@
SfxWhichIter aIter(rSet);
USHORT nWhich = aIter.FirstWhich();
-@@ -2035,7 +2063,21 @@ void ScFormatShell::GetNumFormatState( S
+@@ -2035,7 +2063,21 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
rSet.Put( SfxStringItem( nWhich, aFormatCode ) );
}
break;
@@ -148,24 +270,80 @@
}
nWhich = aIter.NextWhich();
}
-@@ -2186,3 +2228,13 @@ void ScFormatShell::StateFormatPaintbrus
+@@ -2186,3 +2228,68 @@ void ScFormatShell::StateFormatPaintbrush( SfxItemSet& rSet )
rSet.Put( SfxBoolItem( SID_FORMATPAINTBRUSH, pViewData->GetView()->HasPaintBrush() ) );
}
-+short ScFormatShell::GetCurrentNumberFormatType() const
++short ScFormatShell::GetCurrentNumberFormatType()
+{
-+ ScDocument* pDoc = pViewData->GetDocument();
-+ sal_uInt32 nCurrentNumberFormat;
-+ pDoc->GetNumberFormat( pViewData->GetCurX(), pViewData->GetCurY(),
-+ pViewData->GetTabNo(), nCurrentNumberFormat );
-+ const SvNumberformat* pEntry = pDoc->GetFormatTable()->GetEntry( nCurrentNumberFormat );
-+ return pEntry->GetType();
++ 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 -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/ui/view/tabview3.cxx sc/source/ui/view/tabview3.cxx
---- sc.clean/source/ui/view/tabview3.cxx 2008-02-05 11:16:56.000000000 -0500
-+++ sc/source/ui/view/tabview3.cxx 2008-02-22 12:17:51.000000000 -0500
-@@ -355,6 +355,13 @@ void ScTabView::InvalidateAttribs()
+diff --git sc/source/ui/view/tabview3.cxx sc/source/ui/view/tabview3.cxx
+index 5bc41c7..9ac5433 100644
+--- sc/source/ui/view/tabview3.cxx
++++ sc/source/ui/view/tabview3.cxx
+@@ -356,6 +356,13 @@ void ScTabView::InvalidateAttribs()
rBindings.Invalidate( SID_ALIGN_ANY_VCENTER );
rBindings.Invalidate( SID_ALIGN_ANY_BOTTOM );
@@ -179,9 +357,10 @@
// rBindings.Invalidate( SID_RANGE_VALUE );
// rBindings.Invalidate( SID_RANGE_FORMULA );
}
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/uiconfig/scalc/toolbar/formatobjectbar.xml sc/uiconfig/scalc/toolbar/formatobjectbar.xml
---- sc.clean/uiconfig/scalc/toolbar/formatobjectbar.xml 2008-02-05 11:16:54.000000000 -0500
-+++ sc/uiconfig/scalc/toolbar/formatobjectbar.xml 2008-02-22 11:16:00.000000000 -0500
+diff --git sc/uiconfig/scalc/toolbar/formatobjectbar.xml sc/uiconfig/scalc/toolbar/formatobjectbar.xml
+index 7d96473..f1ce57d 100644
+--- sc/uiconfig/scalc/toolbar/formatobjectbar.xml
++++ sc/uiconfig/scalc/toolbar/formatobjectbar.xml
@@ -33,7 +33,6 @@
<toolbar:toolbaritem xlink:href=".uno:NumberFormatPercent" toolbar:helpid="helpid:26046" />
<toolbar:toolbaritem xlink:href=".uno:NumberFormatDate" toolbar:helpid="helpid:26053" toolbar:visible="false" />
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]