ooo-build r12354 - in trunk: . patches/test
- From: pflin svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12354 - in trunk: . patches/test
- Date: Mon, 28 Apr 2008 07:46:19 +0100 (BST)
Author: pflin
Date: Mon Apr 28 06:46:19 2008
New Revision: 12354
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12354&view=rev
Log:
* patches/test/sc-vba-worksheet-changed-event-by-fong.diff: a test patch
implement VBA's Worksheet_Changed event.
Added:
trunk/patches/test/sc-vba-worksheet-changed-event-by-fong.diff
Modified:
trunk/ChangeLog
Added: trunk/patches/test/sc-vba-worksheet-changed-event-by-fong.diff
==============================================================================
--- (empty file)
+++ trunk/patches/test/sc-vba-worksheet-changed-event-by-fong.diff Mon Apr 28 06:46:19 2008
@@ -0,0 +1,201 @@
+--- backup/sc/source/ui/inc/docsh.hxx 2008-04-23 14:28:42.000000000 +0800
++++ sc/source/ui/inc/docsh.hxx 2008-04-28 14:38:07.000000000 +0800
+@@ -347,6 +348,7 @@ public:
+ void PostPaintExtras();
+
+ void PostDataChanged();
++ void PostContentChanged( const ScRange& rRange ); // for worsheet/workbook changed event
+
+ void UpdatePaintExt( USHORT& rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
+ SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab );
+--- backup/sc/source/ui/docshell/docsh.cxx 2008-04-23 14:28:47.000000000 +0800
++++ sc/source/ui/docshell/docsh.cxx 2008-04-28 14:42:40.000000000 +0800
+@@ -2460,6 +2519,31 @@ void ScDocShell::SetModified( BOOL bModi
+ }
+ }
+
++void ScDocShell::PostContentChanged( const ScRange& rRange )
++{
++ OSL_TRACE("ScDocShell::PostContentChanged. Changed Range Address: nTab1 = %d, nCol1 = %d, nRow1 = %d; nTab2 = %d, nCol2 = %d, nRow2 = %d;", rRange.aStart.Tab(), rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Tab(), rRange.aEnd.Col(), rRange.aEnd.Row() );
++ ScCellRangesBase* pObj = NULL;
++
++ if (rRange.aStart == rRange.aEnd)
++ {
++ pObj = new ScCellObj( this, rRange.aStart );
++ }
++ else
++ {
++ pObj = new ScCellRangeObj( this, rRange );
++ }
++
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] = uno::makeAny(uno::Reference<uno::XInterface>(static_cast<cppu::OWeakObject*>(pObj)));
++
++ SCTAB nTab1 = rRange.aStart.Tab();
++ aDocument.GetVbaEventsHelper()->executeSheetMacro( SC_VBAEVENT_SHEET_CHANGE, nTab1, aArgs );
++
++ SCTAB nTab2 = rRange.aEnd.Tab();
++ if( nTab1 != nTab2 )
++ aDocument.GetVbaEventsHelper()->executeSheetMacro( SC_VBAEVENT_SHEET_CHANGE, nTab2, aArgs );
++}
++
+
+ void ScDocShell::SetDocumentModified( BOOL bIsModified /* = TRUE */ )
+ {
+--- backup/sc/source/ui/undo/undocell.cxx 2008-04-23 13:51:53.000000000 +0800
++++ sc/source/ui/undo/undocell.cxx 2008-04-28 14:40:30.000000000 +0800
+@@ -202,6 +202,7 @@ ScUndoEnterData::ScUndoEnterData( ScDocS
+ nTab( nNewTab ),
+ nCount( nNewCount )
+ {
++ pDocShell->PostContentChanged( ScRange( ScAddress( nCol, nRow, nTab ) ) );
+ SetChangeTrack();
+ }
+
+@@ -238,6 +239,7 @@ void ScUndoEnterData::DoChange() const
+ pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, FALSE, FALSE );
+ }
+
++ pDocShell->PostContentChanged( ScRange( ScAddress( nCol, nRow, nTab ) ) );
+ pDocShell->PostDataChanged();
+ }
+
+@@ -359,6 +361,7 @@ ScUndoEnterValue::ScUndoEnterValue( ScDo
+ nValue ( nVal ),
+ bNeedHeight ( bHeight )
+ {
++ pDocShell->PostContentChanged( ScRange( aPos ) );
+ SetChangeTrack();
+ }
+
+@@ -409,6 +412,8 @@ void __EXPORT ScUndoEnterValue::Undo()
+
+ pDocShell->PostPaintCell( aPos.Col(), aPos.Row(), aPos.Tab() );
+
++ pDocShell->PostContentChanged( ScRange( aPos ) );
++
+ ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ if ( pChangeTrack )
+ pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
+@@ -424,6 +429,8 @@ void __EXPORT ScUndoEnterValue::Redo()
+ pDoc->SetValue( aPos.Col(), aPos.Row(), aPos.Tab(), nValue );
+ pDocShell->PostPaintCell( aPos.Col(), aPos.Row(), aPos.Tab() );
+
++ pDocShell->PostContentChanged( ScRange( aPos ) );
++
+ SetChangeTrack();
+
+ EndRedo();
+@@ -453,6 +460,7 @@ ScUndoPutCell::ScUndoPutCell( ScDocShell
+ pEnteredCell( pRedoCell ),
+ bNeedHeight ( bHeight )
+ {
++ pDocShell->PostContentChanged( ScRange( aPos ) );
+ SetChangeTrack();
+ }
+
+@@ -505,6 +513,8 @@ void __EXPORT ScUndoPutCell::Undo()
+
+ pDocShell->PostPaintCell( aPos.Col(), aPos.Row(), aPos.Tab() );
+
++ pDocShell->PostContentChanged( ScRange( aPos ) );
++
+ ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ if ( pChangeTrack )
+ pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
+@@ -535,6 +545,8 @@ void __EXPORT ScUndoPutCell::Redo()
+
+ pDocShell->PostPaintCell( aPos.Col(), aPos.Row(), aPos.Tab() );
+
++ pDocShell->PostContentChanged( ScRange( aPos ) );
++
+ SetChangeTrack();
+
+ EndRedo();
+--- backup/sc/source/ui/undo/undoblk.cxx 2008-04-23 13:51:53.000000000 +0800
++++ sc/source/ui/undo/undoblk.cxx 2008-04-28 14:40:30.000000000 +0800
+@@ -129,6 +129,7 @@ ScUndoInsertCells::ScUndoInsertCells( Sc
+ aEffRange.aEnd.SetRow(MAXROW);
+ }
+
++ pDocShell->PostContentChanged( aEffRange );
+ SetChangeTrack();
+ }
+
+@@ -264,6 +265,7 @@ void ScUndoInsertCells::DoChange( const
+ if (pViewShell)
+ pViewShell->CellContentChanged();
+
++ pDocShell->PostContentChanged( aEffRange );
+ ShowTable( aEffRange.aStart.Tab() );
+ }
+
+@@ -337,6 +339,8 @@ ScUndoDeleteCells::ScUndoDeleteCells( Sc
+ aEffRange.aEnd.SetRow(MAXROW);
+ }
+
++ pDocShell->PostContentChanged( aEffRange );
++
+ SetChangeTrack();
+ }
+
+@@ -469,6 +473,7 @@ void ScUndoDeleteCells::DoChange( const
+
+ pDocShell->PostDataChanged();
+ // CellContentChanged kommt mit der Markierung
++ pDocShell->PostContentChanged( aWorkRange );
+
+ ShowTable( aEffRange.aStart.Tab() );
+ }
+@@ -718,6 +723,7 @@ ScUndoCut::ScUndoCut( ScDocShell* pNewDo
+ pUndoDoc( pNewUndoDoc ),
+ aExtendedRange( aRange )
+ {
++ pDocShell->PostContentChanged( aExtendedRange );
+ SetChangeTrack();
+ }
+
+@@ -776,6 +782,7 @@ void ScUndoCut::DoChange( const BOOL bUn
+ pDocShell->PostDataChanged();
+ if (pViewShell)
+ pViewShell->CellContentChanged();
++ pDocShell->PostContentChanged( aExtendedRange );
+ }
+
+ void __EXPORT ScUndoCut::Undo()
+@@ -842,6 +849,7 @@ ScUndoPaste::ScUndoPaste( ScDocShell* pN
+
+ if ( pOptions )
+ aPasteOptions = *pOptions; // used only for Repeat
++ pDocShell->PostContentChanged( aBlockRange );
+
+ SetChangeTrack();
+ }
+@@ -1017,6 +1025,7 @@ void ScUndoPaste::DoChange( const BOOL b
+ pDocShell->PostDataChanged();
+ if (pViewShell)
+ pViewShell->CellContentChanged();
++ pDocShell->PostContentChanged( aDrawRange );
+ }
+
+ void __EXPORT ScUndoPaste::Undo()
+--- backup/sc/source/ui/undo/undoblk3.cxx 2008-04-23 13:51:53.000000000 +0800
++++ sc/source/ui/undo/undoblk3.cxx 2008-04-28 14:40:30.000000000 +0800
+@@ -116,7 +116,8 @@ ScUndoDeleteContents::ScUndoDeleteConten
+
+ if ( !(aMarkData.IsMarked() || aMarkData.IsMultiMarked()) ) // keine Zelle markiert:
+ aMarkData.SetMarkArea( aRange ); // Zelle unter Cursor markieren
+-
++
++ pDocShell->PostContentChanged( aRange );
+ SetChangeTrack();
+ }
+
+@@ -207,6 +208,7 @@ void ScUndoDeleteContents::DoChange( con
+ if (pViewShell)
+ pViewShell->CellContentChanged();
+
++ pDocShell->PostContentChanged( aRange );
+ ShowTable( aRange );
+ }
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]