[Libreoffice-commits] .: 7 commits - sc/inc sc/sdi sc/source sc/uiconfig sc/util

Noel Power noelp at kemper.freedesktop.org
Wed Oct 13 07:22:19 PDT 2010


 sc/inc/address.hxx                              |    3 
 sc/inc/addruno.hxx                              |    2 
 sc/inc/appoptio.hxx                             |    5 
 sc/inc/cell.hxx                                 |    2 
 sc/inc/document.hxx                             |   17 
 sc/inc/global.hxx                               |    1 
 sc/inc/globstr.hrc                              |   19 
 sc/inc/macromgr.hxx                             |   69 
 sc/inc/rangenam.hxx                             |    2 
 sc/inc/sc.hrc                                   |    6 
 sc/inc/scabstdlg.hxx                            |   13 
 sc/inc/scmod.hxx                                |    4 
 sc/inc/shapeuno.hxx                             |    2 
 sc/inc/table.hxx                                |    3 
 sc/inc/unonames.hxx                             |    4 
 sc/inc/userdat.hxx                              |    4 
 sc/inc/viewuno.hxx                              |    8 
 sc/sdi/cellsh.sdi                               |    1 
 sc/sdi/drawsh.sdi                               |    6 
 sc/sdi/scalc.sdi                                |  115 -
 sc/source/core/data/cell.cxx                    |   46 
 sc/source/core/data/column3.cxx                 |   15 
 sc/source/core/data/documen2.cxx                |    2 
 sc/source/core/data/documen8.cxx                |    8 
 sc/source/core/data/document.cxx                |   78 
 sc/source/core/inc/interpre.hxx                 |   11 
 sc/source/core/tool/address.cxx                 |    2 
 sc/source/core/tool/appoptio.cxx                |    4 
 sc/source/core/tool/interpr1.cxx                |   13 
 sc/source/core/tool/interpr4.cxx                |  134 +
 sc/source/core/tool/interpr5.cxx                |    5 
 sc/source/core/tool/rangelst.cxx                |   21 
 sc/source/filter/excel/excimp8.cxx              |   30 
 sc/source/filter/excel/makefile.mk              |    4 
 sc/source/filter/excel/read.cxx                 |   69 
 sc/source/filter/excel/xecontent.cxx            |   11 
 sc/source/filter/excel/xeescher.cxx             |   88 -
 sc/source/filter/excel/xiescher.cxx             |  151 +
 sc/source/filter/excel/xiname.cxx               |   23 
 sc/source/filter/excel/xistyle.cxx              |   65 
 sc/source/filter/excel/xlescher.cxx             |    2 
 sc/source/filter/excel/xltoolbar.cxx            |  431 +++++
 sc/source/filter/excel/xltoolbar.hxx            |   95 +
 sc/source/filter/excel/xltools.cxx              |    7 
 sc/source/filter/inc/excimp8.hxx                |    5 
 sc/source/filter/inc/xcl97esc.hxx               |    9 
 sc/source/filter/inc/xcl97rec.hxx               |    2 
 sc/source/filter/inc/xecontent.hxx              |    2 
 sc/source/filter/inc/xeescher.hxx               |   35 
 sc/source/filter/inc/xiescher.hxx               |   51 
 sc/source/filter/inc/xistyle.hxx                |    2 
 sc/source/filter/inc/xlescher.hxx               |    2 
 sc/source/filter/xcl97/xcl97esc.cxx             |   46 
 sc/source/filter/xml/xmlexprt.cxx               |   35 
 sc/source/ui/attrdlg/scdlgfact.cxx              |   24 
 sc/source/ui/attrdlg/scdlgfact.hxx              |   10 
 sc/source/ui/docshell/docfunc.cxx               |   12 
 sc/source/ui/docshell/docsh5.cxx                |   51 
 sc/source/ui/docshell/macromgr.cxx              |  216 ++
 sc/source/ui/docshell/makefile.mk               |    9 
 sc/source/ui/drawfunc/drawsh.cxx                |    4 
 sc/source/ui/drawfunc/drawsh2.cxx               |    4 
 sc/source/ui/drawfunc/drawsh5.cxx               |    4 
 sc/source/ui/drawfunc/fudraw.cxx                |    4 
 sc/source/ui/drawfunc/fusel.cxx                 |   16 
 sc/source/ui/drawfunc/makefile.mk               |    1 
 sc/source/ui/drawfunc/objdraw.src               |    6 
 sc/source/ui/inc/asciiopt.hxx                   |    2 
 sc/source/ui/inc/datafdlg.hrc                   |   40 
 sc/source/ui/inc/datafdlg.hxx                   |  111 +
 sc/source/ui/inc/docfunc.hxx                    |    2 
 sc/source/ui/inc/docsh.hxx                      |    5 
 sc/source/ui/inc/drawsh.hxx                     |    2 
 sc/source/ui/inc/impex.hxx                      |    2 
 sc/source/ui/inc/tabvwsh.hxx                    |    4 
 sc/source/ui/inc/undodat.hxx                    |   36 
 sc/source/ui/inc/viewfunc.hxx                   |   11 
 sc/source/ui/miscdlgs/datafdlg.cxx              |  414 +++++
 sc/source/ui/miscdlgs/makefile.mk               |    1 
 sc/source/ui/src/datafdlg.src                   |   95 +
 sc/source/ui/src/globstr.src                    |   73 
 sc/source/ui/src/makefile.mk                    |    1 
 sc/source/ui/undo/undodat.cxx                   |  209 ++
 sc/source/ui/unoobj/addruno.cxx                 |   30 
 sc/source/ui/unoobj/docuno.cxx                  |   30 
 sc/source/ui/unoobj/servuno.cxx                 |   25 
 sc/source/ui/unoobj/shapeuno.cxx                |   64 
 sc/source/ui/unoobj/viewuno.cxx                 |  146 +
 sc/source/ui/vba/excelvbahelper.cxx             |  204 ++
 sc/source/ui/vba/excelvbahelper.hxx             |   39 
 sc/source/ui/vba/makefile.mk                    |   14 
 sc/source/ui/vba/testvba/testvba.cxx            |    6 
 sc/source/ui/vba/vbaapplication.cxx             |  792 ++++++++-
 sc/source/ui/vba/vbaapplication.hxx             |   33 
 sc/source/ui/vba/vbacomment.cxx                 |   26 
 sc/source/ui/vba/vbacommentshape.cxx            |   46 
 sc/source/ui/vba/vbacommentshape.hxx            |   46 
 sc/source/ui/vba/vbadialog.cxx                  |   79 
 sc/source/ui/vba/vbadialog.hxx                  |    3 
 sc/source/ui/vba/vbadialogs.cxx                 |   14 
 sc/source/ui/vba/vbadialogs.hxx                 |    1 
 sc/source/ui/vba/vbaeventshelper.cxx            |   10 
 sc/source/ui/vba/vbafiledialog.cxx              |  183 ++
 sc/source/ui/vba/vbafiledialog.hxx              |   60 
 sc/source/ui/vba/vbafiledialogselecteditems.cxx |  154 +
 sc/source/ui/vba/vbafiledialogselecteditems.hxx |   87 +
 sc/source/ui/vba/vbafilesearch.cxx              |  242 ++
 sc/source/ui/vba/vbafilesearch.hxx              |   77 
 sc/source/ui/vba/vbafoundfiles.cxx              |  143 +
 sc/source/ui/vba/vbafoundfiles.hxx              |   88 +
 sc/source/ui/vba/vbaglobals.cxx                 |    6 
 sc/source/ui/vba/vbaglobals.hxx                 |    1 
 sc/source/ui/vba/vbahelper.cxx                  |   94 -
 sc/source/ui/vba/vbamenu.cxx                    |   84 +
 sc/source/ui/vba/vbamenu.hxx                    |   54 
 sc/source/ui/vba/vbamenubar.cxx                 |   66 
 sc/source/ui/vba/vbamenubar.hxx                 |   50 
 sc/source/ui/vba/vbamenubars.cxx                |  137 +
 sc/source/ui/vba/vbamenubars.hxx                |   61 
 sc/source/ui/vba/vbamenuitem.cxx                |   82 
 sc/source/ui/vba/vbamenuitem.hxx                |   55 
 sc/source/ui/vba/vbamenuitems.cxx               |  150 +
 sc/source/ui/vba/vbamenuitems.hxx               |   60 
 sc/source/ui/vba/vbamenus.cxx                   |  136 +
 sc/source/ui/vba/vbamenus.hxx                   |   60 
 sc/source/ui/vba/vbaname.cxx                    |   91 -
 sc/source/ui/vba/vbaname.hxx                    |    4 
 sc/source/ui/vba/vbanames.cxx                   |  100 -
 sc/source/ui/vba/vbaoleobject.cxx               |    2 
 sc/source/ui/vba/vbapagebreaks.cxx              |   52 
 sc/source/ui/vba/vbapagesetup.cxx               |  130 +
 sc/source/ui/vba/vbapagesetup.hxx               |    2 
 sc/source/ui/vba/vbapivotcache.cxx              |   19 
 sc/source/ui/vba/vbapivotcache.hxx              |    8 
 sc/source/ui/vba/vbaquerytable.cxx              |   87 +
 sc/source/ui/vba/vbaquerytable.hxx              |   59 
 sc/source/ui/vba/vbarange.cxx                   | 1977 +++++++++++++++---------
 sc/source/ui/vba/vbarange.hxx                   |   42 
 sc/source/ui/vba/vbavalidation.cxx              |   12 
 sc/source/ui/vba/vbaworkbook.cxx                |  111 +
 sc/source/ui/vba/vbaworkbook.hxx                |    9 
 sc/source/ui/vba/vbaworksheet.cxx               |  240 ++
 sc/source/ui/vba/vbaworksheet.hxx               |    7 
 sc/source/ui/vba/vbawsfunction.cxx              |   82 
 sc/source/ui/view/cellsh2.cxx                   |   18 
 sc/source/ui/view/gridwin5.cxx                  |    2 
 sc/source/ui/view/tabview3.cxx                  |   15 
 sc/source/ui/view/tabvwsh4.cxx                  |    7 
 sc/source/ui/view/viewfun2.cxx                  |   59 
 sc/source/ui/view/viewfun3.cxx                  |  186 ++
 sc/uiconfig/scalc/menubar/menubar.xml           |    1 
 sc/util/makefile.mk                             |   10 
 152 files changed, 8669 insertions(+), 1560 deletions(-)

New commits:
commit 63cb2de15fc42c2defa97422cf1d21f98a88cd50
Merge: b381c6c... bd83ad4...
Author: Noel Power <noel.power at novell.com>
Date:   Wed Oct 13 15:16:30 2010 +0100

    Merge branch 'master' of ssh://noelp@git.freedesktop.org/git/libreoffice/calc

commit b381c6c5072b260069ee8ab497c19a19a320d5c6
Merge: 4e63e44... 7eabce1...
Author: Noel Power <noel.power at novell.com>
Date:   Wed Oct 13 12:41:26 2010 +0100

    Merge commit 'origin/master' fix conflicts and more trailing ws
    
    Conflicts:
    	sc/source/ui/undo/undodat.cxx
    	sc/source/ui/vba/excelvbahelper.cxx
    	sc/source/ui/vba/vbadialog.cxx
    	sc/source/ui/vba/vbahelper.cxx
    	sc/source/ui/vba/vbapagesetup.cxx

diff --cc sc/source/filter/xcl97/xcl97esc.cxx
index be4f944,1c4ec4e..bce8797
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@@ -513,40 -510,5 +514,41 @@@ void XclEscherClientTextbox::WriteData
      pXclObj->SetText( GetRoot(), rTextObj );
  }
  
 +XclExpShapeObj*
 +ShapeInteractionHelper::CreateShapeObj( XclExpObjectManager& rObjMgr, const Reference< XShape >& xShape )
 +{
 +    return new XclExpShapeObj( rObjMgr, xShape );
 +}
 +
 +void
 +ShapeInteractionHelper::PopulateShapeInteractionInfo( XclExpObjectManager& rObjMgr, const Reference< XShape >& xShape, EscherExHostAppData& rHostAppData )
 +{
 +   try
 +   {
 +      SvMemoryStream* pMemStrm = NULL;
 +      rtl::OUString sHyperLink;
 +      rtl::OUString sMacro;
 +      if ( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( ::GetSdrObjectFromXShape( xShape ) ) )
 +      {
 +         sHyperLink = pInfo->GetHlink();
 +         sMacro = pInfo->GetMacro();
 +      }
 +      if (  sHyperLink.getLength() > 0 )
 +      {
 +         pMemStrm = new SvMemoryStream();
 +         XclExpStream tmpStream( *pMemStrm, rObjMgr.GetRoot() );
 +         ScAddress dummyAddress;
 +         SvxURLField aUrlField;
 +         aUrlField.SetURL( sHyperLink );
 +         XclExpHyperlink hExpHlink( rObjMgr.GetRoot(), aUrlField, dummyAddress );
 +         hExpHlink.WriteEmbeddedData( tmpStream );
 +      }
 +      if ( ( sHyperLink.getLength() > 0 ) || ( sMacro.getLength() > 0 ) )
 +          rHostAppData.SetInteractionInfo( new InteractionInfo( pMemStrm, true ) );
 +   }
 +   catch( Exception& )
 +   {
 +   }
 +}
  
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --cc sc/source/ui/drawfunc/drawsh.cxx
index 7d19133,667d9e2..8b7e21d
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@@ -480,4 -484,6 +481,5 @@@ void ScDrawShell::SetHlinkForObject( Sd
          lcl_setModified( GetObjectShell() );
      }
  }
 -#endif
  
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --cc sc/source/ui/undo/undodat.cxx
index 469486d,e3d91ed..6dd1c57
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@@ -2030,210 -2028,9 +2031,211 @@@ BOOL __EXPORT ScUndoChartData::CanRepea
      return FALSE;
  }
  
 +// Amelia Wang
 +ScUndoDataForm::ScUndoDataForm( ScDocShell* pNewDocShell,
 +                                SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
 +                                SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
 +                                const ScMarkData& rMark,
 +                                ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc,
 +                                USHORT nNewFlags,
 +                                ScRefUndoData* pRefData,
 +                                void* /*pFill1*/, void* /*pFill2*/, void* /*pFill3*/,
 +                                BOOL bRedoIsFilled ) :
 +        ScBlockUndo( pNewDocShell, ScRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ), SC_UNDO_SIMPLE ),
 +        aMarkData( rMark ),
 +        pUndoDoc( pNewUndoDoc ),
 +        pRedoDoc( pNewRedoDoc ),
 +        nFlags( nNewFlags ),
 +        pRefUndoData( pRefData ),
 +        pRefRedoData( NULL ),
 +        bRedoFilled( bRedoIsFilled )
 +{
 +        //      pFill1,pFill2,pFill3 are there so the ctor calls for simple paste (without cutting)
 +        //      don't have to be changed and branched for 641.
 +        //      They can be removed later.
 +
 +        if ( !aMarkData.IsMarked() )                            // no cell marked:
 +                aMarkData.SetMarkArea( aBlockRange );   //  mark paste block
 +
 +        if ( pRefUndoData )
 +                pRefUndoData->DeleteUnchanged( pDocShell->GetDocument() );
  
 +        SetChangeTrack();
 +}
  
 +ScUndoDataForm::~ScUndoDataForm()
 +{
 +        delete pUndoDoc;
 +        delete pRedoDoc;
 +        delete pRefUndoData;
 +        delete pRefRedoData;
 +}
 +
 +String ScUndoDataForm::GetComment() const
 +{
 +        return ScGlobal::GetRscString( STR_UNDO_PASTE );
 +}
 +
 +void ScUndoDataForm::SetChangeTrack()
 +{
 +        ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
 +        if ( pChangeTrack && (nFlags & IDF_CONTENTS) )
 +                pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc,
 +                        nStartChangeAction, nEndChangeAction, SC_CACM_PASTE );
 +        else
 +                nStartChangeAction = nEndChangeAction = 0;
 +}
 +
 +
 +void ScUndoDataForm::Undo()
 +{
 +        BeginUndo();
 +        DoChange( TRUE );
 +        ShowTable( aBlockRange );
 +        EndUndo();
 +        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 +}
  
 +void ScUndoDataForm::Redo()
 +{
 +        BeginRedo();
 +        ScDocument* pDoc = pDocShell->GetDocument();
 +        EnableDrawAdjust( pDoc, FALSE );                                //! include in ScBlockUndo?
 +        DoChange( FALSE );
 +        EnableDrawAdjust( pDoc, TRUE );                                 //! include in ScBlockUndo?
 +        EndRedo();
 +        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 +}
 +
 +void ScUndoDataForm::Repeat(SfxRepeatTarget& /*rTarget*/)
 +{
 +}
 +
 +BOOL ScUndoDataForm::CanRepeat(SfxRepeatTarget& rTarget) const
 +{
 +        return (rTarget.ISA(ScTabViewTarget));
 +}
 +
 +void ScUndoDataForm::DoChange( const BOOL bUndo )
 +{
 +    ScDocument* pDoc = pDocShell->GetDocument();
 +
 +    //      RefUndoData for redo is created before first undo
 +    //      (with DeleteUnchanged after the DoUndo call)
 +    BOOL bCreateRedoData = ( bUndo && pRefUndoData && !pRefRedoData );
 +    if ( bCreateRedoData )
 +            pRefRedoData = new ScRefUndoData( pDoc );
 +
 +    ScRefUndoData* pWorkRefData = bUndo ? pRefUndoData : pRefRedoData;
 +
 +    //      fuer Undo immer alle oder keine Inhalte sichern
 +    USHORT nUndoFlags = IDF_NONE;
 +    if (nFlags & IDF_CONTENTS)
 +            nUndoFlags |= IDF_CONTENTS;
 +    if (nFlags & IDF_ATTRIB)
 +            nUndoFlags |= IDF_ATTRIB;
 +
 +    BOOL bPaintAll = FALSE;
 +
 +    ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
  
 +    // marking is in ScBlockUndo...
 +    //ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockRange );
  
 +    SCTAB nTabCount = pDoc->GetTableCount();
 +    if ( bUndo && !bRedoFilled )
 +    {
 +        if (!pRedoDoc)
 +        {
 +            BOOL bColInfo = ( aBlockRange.aStart.Row()==0 && aBlockRange.aEnd.Row()==MAXROW );
 +            BOOL bRowInfo = ( aBlockRange.aStart.Col()==0 && aBlockRange.aEnd.Col()==MAXCOL );
 +
 +            pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
 +            pRedoDoc->InitUndoSelected( pDoc, aMarkData, bColInfo, bRowInfo );
 +        }
 +        //  read "redo" data from the document in the first undo
 +            //  all sheets - CopyToDocument skips those that don't exist in pRedoDoc
 +        ScRange aCopyRange = aBlockRange;
 +        aCopyRange.aStart.SetTab(0);
 +        aCopyRange.aEnd.SetTab(nTabCount-1);
 +        pDoc->CopyToDocument( aCopyRange, 1, FALSE, pRedoDoc );
 +        bRedoFilled = TRUE;
 +    }
 +
 +    USHORT nExtFlags = 0;
 +    pDocShell->UpdatePaintExt( nExtFlags, aBlockRange );
 +
 +    for ( sal_uInt16 i=0; i <= ( aBlockRange.aEnd.Col() - aBlockRange.aStart.Col() ); i++ )
 +    {
 +        String aOldString;
 +        pUndoDoc->GetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString );
 +        pDoc->SetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString );
 +    }
 +
 +    //ScRange aTabSelectRange = aBlockRange;
 +
 +    if (pWorkRefData)
 +    {
 +        pWorkRefData->DoUndo( pDoc, TRUE );             // TRUE = bSetChartRangeLists for SetChartListenerCollection
 +        if ( pDoc->RefreshAutoFilter( 0,0, MAXCOL,MAXROW, aBlockRange.aStart.Tab() ) )
 +            bPaintAll = TRUE;
 +    }
 +
 +    if ( bCreateRedoData && pRefRedoData )
 +            pRefRedoData->DeleteUnchanged( pDoc );
 +
 +    if ( bUndo )
 +    {
 +        ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
 +        if ( pChangeTrack )
 +            pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
 +    }
 +    else
 +        SetChangeTrack();
 +
 +    ScRange aDrawRange( aBlockRange );
 +    pDoc->ExtendMerge( aDrawRange, TRUE );      // only needed for single sheet (text/rtf etc.)
 +    USHORT nPaint = PAINT_GRID;
 +    if (bPaintAll)
 +    {
 +        aDrawRange.aStart.SetCol(0);
 +        aDrawRange.aStart.SetRow(0);
 +        aDrawRange.aEnd.SetCol(MAXCOL);
 +        aDrawRange.aEnd.SetRow(MAXROW);
 +        nPaint |= PAINT_TOP | PAINT_LEFT;
 +/*A*/   if (pViewShell)
 +            pViewShell->AdjustBlockHeight(FALSE);
 +    }
 +    else
 +    {
 +        if ( aBlockRange.aStart.Row() == 0 && aBlockRange.aEnd.Row() == MAXROW )        // ganze Spalte
 +        {
 +            nPaint |= PAINT_TOP;
 +            aDrawRange.aEnd.SetCol(MAXCOL);
 +        }
 +        if ( aBlockRange.aStart.Col() == 0 && aBlockRange.aEnd.Col() == MAXCOL )        // ganze Zeile
 +        {
 +            nPaint |= PAINT_LEFT;
 +            aDrawRange.aEnd.SetRow(MAXROW);
 +        }
 +/*A*/   if ((pViewShell) && pViewShell->AdjustBlockHeight(FALSE))
 +        {
 +            aDrawRange.aStart.SetCol(0);
 +            aDrawRange.aStart.SetRow(0);
 +            aDrawRange.aEnd.SetCol(MAXCOL);
 +            aDrawRange.aEnd.SetRow(MAXROW);
 +            nPaint |= PAINT_LEFT;
 +        }
 +        pDocShell->UpdatePaintExt( nExtFlags, aDrawRange );
 +    }
 +
 +    if ( !bUndo )                               //      draw redo after updating row heights
 +        RedoSdrUndoAction( pDrawUndo );                 //!     include in ScBlockUndo?
 +
 +    pDocShell->PostPaint( aDrawRange, nPaint, nExtFlags );
 +
 +    pDocShell->PostDataChanged();
 +    if (pViewShell)
 +        pViewShell->CellContentChanged();
 +}
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --cc sc/source/ui/vba/excelvbahelper.cxx
index 7d1dcd2,d584fdc..3ca5ba8
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@@ -430,5 -265,7 +431,7 @@@ ScVbaCellRangeAccess::GetDataSet( ScCel
  
  
  } //excel
 -} //vba 
 -} //ooo 
 +} //vba
 +} //ooo
+ 
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --cc sc/source/ui/vba/vbadialog.cxx
index 1d8c5aa,ad6c236..452fa9a
--- a/sc/source/ui/vba/vbadialog.cxx
+++ b/sc/source/ui/vba/vbadialog.cxx
@@@ -105,8 -90,4 +106,9 @@@ ScVbaDialog::getServiceNames(
      return aServiceNames;
  }
  
 +//liuchen add 2009-7-27
 +sal_Int32 ScVbaDialog::GetSupportedDialogCount()
 +{
 +    return nDialogSize;
 +}
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --cc sc/source/ui/vba/vbadialogs.cxx
index 6aa4a65,ed4cb35..361d1a4
--- a/sc/source/ui/vba/vbadialogs.cxx
+++ b/sc/source/ui/vba/vbadialogs.cxx
@@@ -64,13 -65,6 +65,14 @@@ ScVbaDialogs::getServiceNames(
      return aServiceNames;
  }
  
 +//liuchen 2009-7-27
 +::sal_Int32
 +ScVbaDialogs::getCount() throw (uno::RuntimeException)
 +{
 +    return ScVbaDialog::GetSupportedDialogCount();
 +}
 +
 +
  
  
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --cc sc/source/ui/vba/vbahelper.cxx
index 0000000,85cd065..bc1b07d
mode 000000,100644..100644
--- a/sc/source/ui/vba/vbahelper.cxx
+++ b/sc/source/ui/vba/vbahelper.cxx
@@@ -1,0 -1,761 +1,761 @@@
+ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+ /*************************************************************************
+  *
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 - * 
++ *
+  * Copyright 2000, 2010 Oracle and/or its affiliates.
+  *
+  * OpenOffice.org - a multi-platform office productivity suite
+  *
+  * This file is part of OpenOffice.org.
+  *
+  * OpenOffice.org is free software: you can redistribute it and/or modify
+  * it under the terms of the GNU Lesser General Public License version 3
+  * only, as published by the Free Software Foundation.
+  *
+  * OpenOffice.org is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU Lesser General Public License version 3 for more details
+  * (a copy is included in the LICENSE file that accompanied this code).
+  *
+  * You should have received a copy of the GNU Lesser General Public License
+  * version 3 along with OpenOffice.org.  If not, see
+  * <http://www.openoffice.org/license.html>
+  * for a copy of the LGPLv3 License.
+  *
+  ************************************************************************/
+ #include <cppuhelper/bootstrap.hxx>
+ #include <com/sun/star/util/XURLTransformer.hpp>
+ #include <com/sun/star/frame/XDispatchProvider.hpp>
+ #include <com/sun/star/frame/XModel.hpp>
+ #include <com/sun/star/frame/XFrame.hpp>
+ #include <com/sun/star/frame/XDesktop.hpp>
+ #include <com/sun/star/frame/XController.hpp>
+ #include <com/sun/star/uno/XComponentContext.hpp>
+ #include <com/sun/star/lang/XMultiComponentFactory.hpp>
+ #include <com/sun/star/beans/XPropertySet.hpp>
+ #include <com/sun/star/beans/XIntrospection.hpp>
+ 
+ #include <comphelper/processfactory.hxx>
+ 
+ #include <sfx2/objsh.hxx>
+ #include <sfx2/viewfrm.hxx>
+ #include <sfx2/dispatch.hxx>
+ #include <sfx2/app.hxx>
+ #include <svl/stritem.hxx>
+ 
+ #include <docuno.hxx>
+ 
+ #include <basic/sbx.hxx>
+ #include <basic/sbstar.hxx>
+ #include <rtl/math.hxx>
+ 
+ #include <math.h>
+ #include "vbahelper.hxx"
+ #include "tabvwsh.hxx"
+ #include "transobj.hxx"
+ #include "scmod.hxx"
+ #include "vbashape.hxx"
+ #include "unonames.hxx"
+ #include "cellsuno.hxx"
+ using namespace ::com::sun::star;
+ using namespace ::ooo::vba;
+ 
+ #define POINTTO100THMILLIMETERFACTOR 35.27778
+ void unoToSbxValue( SbxVariable* pVar, const uno::Any& aValue );
+ 
+ uno::Any sbxToUnoValue( SbxVariable* pVar );
+ 
+ 
+ namespace ooo
+ {
+ namespace vba
+ {
+ 
+ const double Millimeter::factor =  35.27778;
+ 
+ uno::Reference< beans::XIntrospectionAccess >
+ getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
+ {
+     static uno::Reference< beans::XIntrospection > xIntrospection;
+     if( !xIntrospection.is() )
+     {
+         uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+         xIntrospection.set( xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.beans.Introspection") ), uno::UNO_QUERY_THROW );
+     }
+     return xIntrospection->inspect( aObject );
+ }
+ 
+ uno::Reference< script::XTypeConverter >
+ getTypeConverter( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
+ {
+     static uno::Reference< script::XTypeConverter > xTypeConv( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter") ), xContext ), uno::UNO_QUERY_THROW );
+     return xTypeConv;
+ }
+ // helper method to determine if the view ( calc ) is in print-preview mode
+ bool isInPrintPreview( SfxViewFrame* pView )
+ {
+     sal_uInt16 nViewNo = SID_VIEWSHELL1 - SID_VIEWSHELL0;
+     if ( pView->GetObjectShell()->GetFactory().GetViewFactoryCount() >
+ nViewNo && !pView->GetObjectShell()->IsInPlaceActive() )
+     {
+         SfxViewFactory &rViewFactory =
+             pView->GetObjectShell()->GetFactory().GetViewFactory(nViewNo);
+         if (  pView->GetCurViewId() == rViewFactory.GetOrdinal() )
+             return true;
+     }
+     return false;
+ }
+ const ::rtl::OUString REPLACE_CELLS_WARNING(  RTL_CONSTASCII_USTRINGPARAM( "ReplaceCellsWarning"));
+ const uno::Any&
+ aNULL()
+ {
+      static  uno::Any aNULLL = uno::makeAny( uno::Reference< uno::XInterface >() );
+     return aNULLL;
+ }
+ 
+ class PasteCellsWarningReseter
+ {
+ private:
+     bool bInitialWarningState;
+     static uno::Reference< beans::XPropertySet > getGlobalSheetSettings() throw ( uno::RuntimeException )
+     {
+         static uno::Reference< beans::XPropertySet > xTmpProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+         static uno::Reference<uno::XComponentContext > xContext( xTmpProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
+         static uno::Reference<lang::XMultiComponentFactory > xServiceManager(
+                 xContext->getServiceManager(), uno::UNO_QUERY_THROW );
+         static uno::Reference< beans::XPropertySet > xProps( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.GlobalSheetSettings" ) ) ,xContext ), uno::UNO_QUERY_THROW );
+         return xProps;
+     }
+ 
+     bool getReplaceCellsWarning() throw ( uno::RuntimeException )
+     {
+         sal_Bool res = sal_False;
+         getGlobalSheetSettings()->getPropertyValue( REPLACE_CELLS_WARNING ) >>= res;
+         return ( res == sal_True );
+     }
+ 
+     void setReplaceCellsWarning( bool bState ) throw ( uno::RuntimeException )
+     {
+         getGlobalSheetSettings()->setPropertyValue( REPLACE_CELLS_WARNING, uno::makeAny( bState ) );
+     }
+ public:
+     PasteCellsWarningReseter() throw ( uno::RuntimeException )
+     {
+         bInitialWarningState = getReplaceCellsWarning();
+         if ( bInitialWarningState )
+             setReplaceCellsWarning( false );
+     }
+     ~PasteCellsWarningReseter()
+     {
+         if ( bInitialWarningState )
+         {
+             // don't allow dtor to throw
+             try
+             {
+                 setReplaceCellsWarning( true );
+             }
+             catch ( uno::Exception& /*e*/ ){}
+         }
+     }
+ };
+ 
+ void dispatchExecute(css::uno::Reference< css::frame::XModel>& xModel, USHORT nSlot, SfxCallMode nCall)
+ {
+     ScTabViewShell* pViewShell = getBestViewShell( xModel );
+     SfxViewFrame* pViewFrame = NULL;
+     if ( pViewShell )
+         pViewFrame = pViewShell->GetViewFrame();
+     if ( pViewFrame )
+     {
+         SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
+         if( pDispatcher )
+         {
+             pDispatcher->Execute( nSlot , nCall );
+         }
 -    }	
++    }
+ }
 -        
++
+ void
+ implnPaste()
+ {
+     PasteCellsWarningReseter resetWarningBox;
+     ScTabViewShell* pViewShell = getCurrentBestViewShell();
+     if ( pViewShell )
+     {
+         pViewShell->PasteFromSystem();
+         pViewShell->CellContentChanged();
+     }
+ }
+ 
+ 
+ void
+ implnCopy()
+ {
+     ScTabViewShell* pViewShell = getCurrentBestViewShell();
+     if ( pViewShell )
+         pViewShell->CopyToClip(NULL,false,false,true);
+ }
+ 
 -void 
++void
+ implnCut()
+ {
+     ScTabViewShell* pViewShell =  getCurrentBestViewShell();
+     if ( pViewShell )
+         pViewShell->CutToClip( NULL, TRUE );
+ }
+ 
+ void implnPasteSpecial(USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose)
+ {
+     PasteCellsWarningReseter resetWarningBox;
+     sal_Bool bAsLink(sal_False), bOtherDoc(sal_False);
+     InsCellCmd eMoveMode = INS_NONE;
+ 
+     ScTabViewShell* pTabViewShell = ScTabViewShell::GetActiveViewShell();
 -    if ( !pTabViewShell ) 
++    if ( !pTabViewShell )
+         // none active, try next best
+         pTabViewShell = getCurrentBestViewShell();
+     if ( pTabViewShell )
+     {
 -        ScViewData* pView = pTabViewShell->GetViewData();	
++        ScViewData* pView = pTabViewShell->GetViewData();
+         Window* pWin = ( pView != NULL ) ? pView->GetActiveWin() : NULL;
+         if ( pView && pWin )
+         {
+             if ( bAsLink && bOtherDoc )
+                 pTabViewShell->PasteFromSystem(0);//SOT_FORMATSTR_ID_LINK
 -            else 
++            else
+             {
+                 ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
 -                ScDocument* pDoc = NULL; 
++                ScDocument* pDoc = NULL;
+                 if ( pOwnClip )
 -                    pDoc = pOwnClip->GetDocument();	
++                    pDoc = pOwnClip->GetDocument();
+                 pTabViewShell->PasteFromClip( nFlags, pDoc,
+                     nFunction, bSkipEmpty, bTranspose, bAsLink,
+                     eMoveMode, IDF_NONE, TRUE );
+                 pTabViewShell->CellContentChanged();
+             }
+         }
+     }
+ 
+ }
+ 
 - uno::Reference< frame::XModel > 
++ uno::Reference< frame::XModel >
+ getCurrentDocument() throw (uno::RuntimeException)
+ {
+     uno::Reference< frame::XModel > xModel;
+     SbxObject* pBasic = dynamic_cast< SbxObject* > ( SFX_APP()->GetBasic() );
+     SbxObject* basicChosen =  pBasic ;
+     if ( basicChosen == NULL)
+     {
+         OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" );
+         return xModel;
 -    }    
++    }
+     SbxObject* p = pBasic;
+     SbxObject* pParent = p->GetParent();
+     SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL;
+ 
+     if( pParentParent )
+     {
+         basicChosen = pParentParent;
+     }
+     else if( pParent )
+     {
+         basicChosen = pParent;
+     }
+ 
+ 
 -    uno::Any aModel; 
++    uno::Any aModel;
+     SbxVariable *pCompVar = basicChosen->Find(  UniString(RTL_CONSTASCII_USTRINGPARAM("ThisComponent")), SbxCLASS_OBJECT );
+ 
+     if ( pCompVar )
+     {
+         aModel = sbxToUnoValue( pCompVar );
+         if ( sal_False == ( aModel >>= xModel ) ||
+             !xModel.is() )
+         {
+             // trying last gasp try the current component
+             uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+             // test if vba service is present
+             uno::Reference< uno::XComponentContext > xCtx( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
+             uno::Reference<lang::XMultiComponentFactory > xSMgr( xCtx->getServiceManager(), uno::UNO_QUERY_THROW );
+             uno::Reference< frame::XDesktop > xDesktop (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx), uno::UNO_QUERY_THROW );
+             xModel.set( xDesktop->getCurrentComponent(), uno::UNO_QUERY );
+             if ( !xModel.is() )
+             {
 -                throw uno::RuntimeException( 
++                throw uno::RuntimeException(
+                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't extract model from basic ( its obviously not set yet ) therefore don't know the currently selected document") ), uno::Reference< uno::XInterface >() );
+             }
+             return xModel;
+         }
+         else
+         {
+             OSL_TRACE("Have model ThisComponent points to url %s",
+             ::rtl::OUStringToOString( xModel->getURL(),
+                 RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+         }
+     }
+     else
+     {
+         OSL_TRACE("Failed to get ThisComponent");
 -        throw uno::RuntimeException( 
 -            rtl::OUString( 
++        throw uno::RuntimeException(
++            rtl::OUString(
+                 RTL_CONSTASCII_USTRINGPARAM(
+                     "Can't determine the currently selected document") ),
+             uno::Reference< uno::XInterface >() );
+     }
+     return xModel;
+ }
+ 
 -ScDocShell* 
 -getDocShell( css::uno::Reference< css::frame::XModel>& xModel ) 
++ScDocShell*
++getDocShell( css::uno::Reference< css::frame::XModel>& xModel )
+ {
+     uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW );
+     ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() );
+     ScDocShell* pDocShell = NULL;
+     if ( pModel )
+         pDocShell = (ScDocShell*)pModel->GetEmbeddedObject();
+     return pDocShell;
+ 
+ }
+ 
 -ScTabViewShell* 
++ScTabViewShell*
+ getBestViewShell(  css::uno::Reference< css::frame::XModel>& xModel )
+ {
+     ScDocShell* pDocShell = getDocShell( xModel );
+     if ( pDocShell )
+         return pDocShell->GetBestViewShell();
+     return NULL;
+ }
+ 
 -ScTabViewShell* 
++ScTabViewShell*
+ getCurrentBestViewShell()
 -{ 
++{
+     uno::Reference< frame::XModel > xModel = getCurrentDocument();
+     return getBestViewShell( xModel );
+ }
+ 
 -SfxViewFrame* 
++SfxViewFrame*
+ getCurrentViewFrame()
+ {
 -    ScTabViewShell* pViewShell = getCurrentBestViewShell();	
++    ScTabViewShell* pViewShell = getCurrentBestViewShell();
+     if ( pViewShell )
+         return pViewShell->GetViewFrame();
+     return NULL;
+ }
+ 
 -sal_Int32 
++sal_Int32
+ OORGBToXLRGB( sal_Int32 nCol )
+ {
+     sal_Int32 nRed = nCol;
+     nRed &= 0x00FF0000;
+     nRed >>= 16;
+     sal_Int32 nGreen = nCol;
+     nGreen &= 0x0000FF00;
+     nGreen >>= 8;
+     sal_Int32 nBlue = nCol;
+     nBlue &= 0x000000FF;
+     sal_Int32 nRGB =  ( (nBlue << 16) | (nGreen << 8) | nRed );
+     return nRGB;
+ }
 -sal_Int32 
++sal_Int32
+ XLRGBToOORGB( sal_Int32 nCol )
+ {
+     sal_Int32 nBlue = nCol;
+     nBlue &= 0x00FF0000;
+     nBlue >>= 16;
+     sal_Int32 nGreen = nCol;
+     nGreen &= 0x0000FF00;
+     nGreen >>= 8;
+     sal_Int32 nRed = nCol;
+     nRed &= 0x000000FF;
+     sal_Int32 nRGB =  ( (nRed << 16) | (nGreen << 8) | nBlue );
+     return nRGB;
+ }
 -uno::Any 
++uno::Any
+ OORGBToXLRGB( const uno::Any& aCol )
+ {
+     sal_Int32 nCol=0;
+     aCol >>= nCol;
+     nCol = OORGBToXLRGB( nCol );
+     return uno::makeAny( nCol );
+ }
 -uno::Any 
++uno::Any
+ XLRGBToOORGB(  const uno::Any& aCol )
+ {
+     sal_Int32 nCol=0;
+     aCol >>= nCol;
+     nCol = XLRGBToOORGB( nCol );
+     return uno::makeAny( nCol );
+ }
+ 
+ void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& Copies, const uno::Any& Preview, const uno::Any& /*ActivePrinter*/, const uno::Any& /*PrintToFile*/, const uno::Any& Collate, const uno::Any& PrToFileName, css::uno::Reference< frame::XModel >& xModel, sal_Bool bUseSelection  )
+ {
+     sal_Int32 nTo = 0;
+     sal_Int32 nFrom = 0;
+     sal_Int16 nCopies = 1;
+     sal_Bool bPreview = sal_False;
+     sal_Bool bCollate = sal_False;
+     sal_Bool bSelection = bUseSelection;
+     From >>= nFrom;
+     To >>= nTo;
+     Copies >>= nCopies;
+     Preview >>= bPreview;
+     if ( nCopies > 1 ) // Collate only useful when more that 1 copy
+         Collate >>= bCollate;
+ 
+     rtl::OUString sRange(  RTL_CONSTASCII_USTRINGPARAM( "-" ) );
+     rtl::OUString sFileName;
 -    
++
+     if (( nFrom || nTo ) )
+     {
+         if ( nFrom )
+             sRange = ( ::rtl::OUString::valueOf( nFrom ) + sRange );
+         if ( nTo )
+             sRange += ::rtl::OUString::valueOf( nTo );
+     }
+ 
+     if (  PrToFileName.getValue() )
+     {
+         PrToFileName >>= sFileName;
+     }
+     ScTabViewShell* pViewShell = getBestViewShell( xModel );
+     SfxViewFrame* pViewFrame = NULL;
+     if ( pViewShell )
+         pViewFrame = pViewShell->GetViewFrame();
+     if ( pViewFrame )
+     {
+         SfxAllItemSet aArgs( SFX_APP()->GetPool() );
 -                
++
+         SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate );
+         aArgs.Put( sfxCollate, sfxCollate.Which() );
+         SfxInt16Item sfxCopies( SID_PRINT_COPIES, nCopies );
+         aArgs.Put( sfxCopies, sfxCopies.Which() );
+         if ( sFileName.getLength() )
+         {
+             SfxStringItem sfxFileName( SID_FILE_NAME, sFileName);
+             aArgs.Put( sfxFileName, sfxFileName.Which() );
 -        
++
+         }
+         if (  sRange.getLength() )
+         {
+             SfxStringItem sfxRange( SID_PRINT_PAGES, sRange );
+             aArgs.Put( sfxRange, sfxRange.Which() );
+         }
+         SfxBoolItem sfxSelection( SID_SELECTION, bSelection );
+         aArgs.Put( sfxSelection, sfxSelection.Which() );
+         SfxBoolItem sfxAsync( SID_ASYNCHRON, sal_False );
+         aArgs.Put( sfxAsync, sfxAsync.Which() );
+         SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
+ 
+         if ( pDispatcher )
+         {
+             if ( bPreview )
+             {
 -                if ( !pViewFrame->GetFrame().IsInPlace() ) 	
++                if ( !pViewFrame->GetFrame().IsInPlace() )
+                 {
+                     SC_MOD()->InputEnterHandler();
+                     pViewFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SFX_CALLMODE_SYNCHRON );
+                     while ( isInPrintPreview( pViewFrame ) )
+                         Application::Yield();
+                 }
+             }
+             else
+                 pDispatcher->Execute( (USHORT)SID_PRINTDOC, (SfxCallMode)SFX_CALLMODE_SYNCHRON, aArgs );
+         }
 -            
++
+     }
 -    
++
+     // #FIXME #TODO
+     // 1 ActivePrinter ( how/can we switch a printer via API? )
 -    // 2 PrintToFile ( ms behaviour if this option is specified but no 
++    // 2 PrintToFile ( ms behaviour if this option is specified but no
+     //   filename supplied 'PrToFileName' then the user will be prompted )
+     // 3 Need to check behaviour of Selected sheets with range ( e.g. From & To
+     //    values ) in oOO these options are mutually exclusive
+     // 4 There is a pop up to do with transparent objects in the print source
+     //   should be able to disable that via configuration for the duration
+     //   of this method
+ }
+ 
+  void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, css::uno::Reference< css::frame::XModel >& xModel )
+ {
+     dispatchExecute( xModel, SID_VIEWSHELL1 );
+ }
+ 
+ rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException )
+ {
+     uno::Type aType = pvargItem.getValueType();
+     uno::TypeClass eTypeClass = aType.getTypeClass();
+     rtl::OUString sString;
+     switch ( eTypeClass )
+     {
+         case uno::TypeClass_BOOLEAN:
+         {
+             sal_Bool bBool = sal_False;
+             pvargItem >>= bBool;
+             sString = rtl::OUString::valueOf( bBool );
+             break;
+         }
+         case uno::TypeClass_STRING:
+             pvargItem >>= sString;
+             break;
+         case uno::TypeClass_FLOAT:
+             {
+                 float aFloat = 0;
+                 pvargItem >>= aFloat;
+                 sString = rtl::OUString::valueOf( aFloat );
+                 break;
+             }
+         case uno::TypeClass_DOUBLE:
+             {
+                 double aDouble = 0;
+                 pvargItem >>= aDouble;
+                 sString = rtl::OUString::valueOf( aDouble );
+                 break;
+             }
+         case uno::TypeClass_SHORT:
+         case uno::TypeClass_LONG:
+         case uno::TypeClass_BYTE:
+             {
+                 sal_Int32 aNum = 0;
+                 pvargItem >>= aNum;
+                 sString = rtl::OUString::valueOf( aNum );
+                 break;
+             }
+ 
+         case uno::TypeClass_HYPER:
+             {
+                 sal_Int64 aHyper = 0;
+                 pvargItem >>= aHyper;
+                 sString = rtl::OUString::valueOf( aHyper );
+                 break;
+             }
+         default:
+                    throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid type, can't convert" ), uno::Reference< uno::XInterface >() );
+     }
+     return sString;
+ }
+ 
+ 
 -rtl::OUString 
++rtl::OUString
+ ContainerUtilities::getUniqueName( const uno::Sequence< ::rtl::OUString >&  _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator)
+ {
+     return getUniqueName(_slist, _sElementName, _sSuffixSeparator, sal_Int32(2));
+ }
+ 
 -rtl::OUString 
++rtl::OUString
+ ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix)
+ {
+     sal_Int32 a = _nStartSuffix;
+     rtl::OUString scompname = _sElementName;
+     bool bElementexists = true;
+     sal_Int32 nLen = _slist.getLength();
+     if ( nLen == 0 )
+         return _sElementName;
+ 
 -    while (bElementexists == true) 
++    while (bElementexists == true)
+     {
+         for (sal_Int32 i = 0; i < nLen; i++)
+         {
+             if (FieldInList(_slist, scompname) == -1)
+             {
+                 return scompname;
+             }
+         }
+         scompname = _sElementName + _sSuffixSeparator + rtl::OUString::valueOf( a++ );
+     }
+     return rtl::OUString();
+ }
+ 
 -sal_Int32 
++sal_Int32
+ ContainerUtilities::FieldInList( const uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString )
+ {
+     sal_Int32 FieldLen = SearchList.getLength();
+     sal_Int32 retvalue = -1;
 -    for (sal_Int32 i = 0; i < FieldLen; i++) 
++    for (sal_Int32 i = 0; i < FieldLen; i++)
+     {
+         // I wonder why comparing lexicographically is done
+         // when its a match is whats interesting?
 -        //if (SearchList[i].compareTo(SearchString) == 0) 
 -        if ( SearchList[i].equals( SearchString ) ) 
++        //if (SearchList[i].compareTo(SearchString) == 0)
++        if ( SearchList[i].equals( SearchString ) )
+         {
+             retvalue = i;
+             break;
+         }
+     }
+     return retvalue;
+ 
+ }
+ bool NeedEsc(sal_Unicode cCode)
+ {
+     String sEsc(RTL_CONSTASCII_USTRINGPARAM(".^$+\\|{}()"));
+     return (STRING_NOTFOUND != sEsc.Search(cCode));
+ }
+ 
+ rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike )
+ {
+     rtl::OUStringBuffer sResult;
+     const sal_Unicode *start = rIn.getStr();
+     const sal_Unicode *end = start + rIn.getLength();
+ 
+     int seenright = 0;
+     if ( bForLike )
+         sResult.append(static_cast<sal_Unicode>('^'));
+ 
 -    while (start < end) 
++    while (start < end)
+     {
+         switch (*start)
+         {
+             case '?':
+                 sResult.append(static_cast<sal_Unicode>('.'));
+                 start++;
+                 break;
+             case '*':
+                 sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".*")));
+                 start++;
+                 break;
+             case '#':
+                 sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[0-9]")));
+                 start++;
+                 break;
+             case '~':
+                 sResult.append(static_cast<sal_Unicode>('\\'));
+                 sResult.append(*(++start));
+                 start++;
+                 break;
+                 // dump the ~ and escape the next characture
+             case ']':
+                 sResult.append(static_cast<sal_Unicode>('\\'));
+                 sResult.append(*start++);
+                 break;
+             case '[':
+                 sResult.append(*start++);
+                 seenright = 0;
+                 while (start < end && !seenright)
+                 {
+                     switch (*start)
+                     {
+                         case '[':
+                         case '?':
+                         case '*':
+                         sResult.append(static_cast<sal_Unicode>('\\'));
+                         sResult.append(*start);
+                             break;
+                         case ']':
+                         sResult.append(*start);
+                             seenright = 1;
+                             break;
+                         case '!':
+                             sResult.append(static_cast<sal_Unicode>('^'));
+                             break;
+                         default:
+                         if (NeedEsc(*start))
+                             sResult.append(static_cast<sal_Unicode>('\\'));
+                         sResult.append(*start);
+                             break;
+                     }
+                     start++;
+                 }
+                 break;
+             default:
+                 if (NeedEsc(*start))
+                     sResult.append(static_cast<sal_Unicode>('\\'));
+                 sResult.append(*start++);
+         }
+     }
+ 
+     if ( bForLike )
+         sResult.append(static_cast<sal_Unicode>('$'));
+ 
+     return sResult.makeStringAndClear( );
+ }
+ 
+ double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical)
+ {
+     double fConvertFactor = 1.0;
+     if( bVertical )
+     {
+         fConvertFactor = xDevice->getInfo().PixelPerMeterY/100000;
+     }
+     else
+     {
 -        fConvertFactor = xDevice->getInfo().PixelPerMeterX/100000;	
++        fConvertFactor = xDevice->getInfo().PixelPerMeterX/100000;
+     }
+     return fConvertFactor;
+ }
+ 
+ double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical)
+ {
+     double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical );
+     return fPoints * POINTTO100THMILLIMETERFACTOR * fConvertFactor;
+ }
+ double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPixels, sal_Bool bVertical)
+ {
+     double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical );
+     return (fPixels/fConvertFactor)/POINTTO100THMILLIMETERFACTOR;
+ }
+ 
+ ConcreteXShapeGeometryAttributes::ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape )
+ {
+     m_xShape = new ScVbaShape( xContext, xShape );
+ }
+ 
+ #define VBA_LEFT "PositionX"
+ #define VBA_TOP "PositionY"
+ UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComponentContext >& /*xContext*/, const uno::Reference< awt::XControl >& xControl )
+ {
+     mxModel.set( xControl->getModel(), uno::UNO_QUERY_THROW );
+ }
+     double UserFormGeometryHelper::getLeft()
+     {
+     sal_Int32 nLeft = 0;
 -    mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft;	
++    mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft;
+     return Millimeter::getInPoints( nLeft );
+     }
+     void UserFormGeometryHelper::setLeft( double nLeft )
+     {
+         mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nLeft ) ) );
+     }
+     double UserFormGeometryHelper::getTop()
+     {
+     sal_Int32 nTop = 0;
 -    mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	VBA_TOP ) ) ) >>= nTop;	
++    mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	VBA_TOP ) ) ) >>= nTop;
+     return Millimeter::getInPoints( nTop );
+     }
+     void UserFormGeometryHelper::setTop( double nTop )
+     {
+     mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	VBA_TOP ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nTop ) ) );
+     }
+     double UserFormGeometryHelper::getHeight()
+     {
+     sal_Int32 nHeight = 0;
 -    mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLHGT ) ) ) >>= nHeight;	
++    mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLHGT ) ) ) >>= nHeight;
+     return Millimeter::getInPoints( nHeight );
+     }
+     void UserFormGeometryHelper::setHeight( double nHeight )
+     {
+     mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLHGT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nHeight ) ) );
+     }
+     double UserFormGeometryHelper::getWidth()
+     {
+     sal_Int32 nWidth = 0;
 -    mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLWID ) ) ) >>= nWidth;	
++    mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLWID ) ) ) >>= nWidth;
+     return Millimeter::getInPoints( nWidth );
+     }
+     void UserFormGeometryHelper::setWidth( double nWidth)
+     {
+     mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLWID ) ), uno::makeAny(  Millimeter::getInHundredthsOfOneMillimeter( nWidth ) ) );
+     }
+ 
+ SfxItemSet*
+ ScVbaCellRangeAccess::GetDataSet( ScCellRangeObj* pRangeObj )
+ {
+     SfxItemSet* pDataSet = pRangeObj ? pRangeObj->GetCurrentDataSet( true ) : NULL ;
+     return pDataSet;
 -    
++
+ }
+ 
+ } // vba
+ } // ooo
+ 
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --cc sc/source/ui/vba/vbapagesetup.cxx
index f72b324,b3ceb17..3b1a8ae
--- a/sc/source/ui/vba/vbapagesetup.cxx
+++ b/sc/source/ui/vba/vbapagesetup.cxx
@@@ -628,104 -626,4 +629,105 @@@ ScVbaPageSetup::getServiceNames(
      return aServiceNames;
  }
  
 +//liuchen 2009-12-11
 +
 +struct PaperSizeMap
 +{
 +    Paper ePaper;
 +    sal_Int32 xlPaper;
 +};
 +
 +static PaperSizeMap paperSizeMappings[] =
 +{
 +    { PAPER_A3, ooo::vba::excel::XlPaperSize::xlPaperA3 },
 +    { PAPER_A4, ooo::vba::excel::XlPaperSize::xlPaperA4 },
 +    { PAPER_A5, ooo::vba::excel::XlPaperSize::xlPaperA5 },
 +    { PAPER_B4_ISO, ooo::vba::excel::XlPaperSize::xlPaperB4 },
 +    { PAPER_B5_ISO, ooo::vba::excel::XlPaperSize::xlPaperB5 },
 +    { PAPER_LETTER, ooo::vba::excel::XlPaperSize::xlPaperLetter },
 +    { PAPER_LEGAL, ooo::vba::excel::XlPaperSize::xlPaperLegal },
 +    { PAPER_TABLOID, ooo::vba::excel::XlPaperSize::xlPaperTabloid },
 +    { PAPER_USER, ooo::vba::excel::XlPaperSize::xlPaperUser },
 +    { PAPER_B6_ISO, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeB6 },
 +    { PAPER_ENV_C4, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC4 },
 +    { PAPER_ENV_C5, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC5 },
 +    { PAPER_ENV_C6, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC6 },
 +    { PAPER_ENV_C65, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC65 },
 +    { PAPER_ENV_DL, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeDL },
 +    { PAPER_C, ooo::vba::excel::XlPaperSize::xlPaperCsheet },
 +    { PAPER_D, ooo::vba::excel::XlPaperSize::xlPaperDsheet },
 +    { PAPER_E, ooo::vba::excel::XlPaperSize::xlPaperEsheet },
 +    { PAPER_ENV_MONARCH, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeMonarch },
 +    { PAPER_ENV_PERSONAL, ooo::vba::excel::XlPaperSize::xlPaperEnvelopePersonal },
 +    { PAPER_ENV_9, ooo::vba::excel::XlPaperSize::xlPaperEnvelope9 },
 +    { PAPER_ENV_10, ooo::vba::excel::XlPaperSize::xlPaperEnvelope10 },
 +    { PAPER_ENV_11, ooo::vba::excel::XlPaperSize::xlPaperEnvelope11 },
 +    { PAPER_ENV_12, ooo::vba::excel::XlPaperSize::xlPaperEnvelope12 }
 +};
 +
 +static const int nMapSize = sizeof(paperSizeMappings) / sizeof(paperSizeMappings[0]);
 +
 +sal_Int32 PaperSizeOOoToExcel(Paper ePaper)
 +{
 +    sal_Int32 nPaperSize = ooo::vba::excel::XlPaperSize::xlPaperUser;
 +
 +    for (int i = 0; i < nMapSize; i++)
 +    {
 +        if (ePaper == paperSizeMappings[i].ePaper)
 +        {
 +            nPaperSize = paperSizeMappings[i].xlPaper;
 +            break;
 +        }
 +    }
 +
 +    return nPaperSize;
 +}
 +
 +sal_Int32 SAL_CALL ScVbaPageSetup::getPaperSize() throw (css::uno::RuntimeException)
 +{
 +    com::sun::star::awt::Size size;
 +    Paper ePaper = PAPER_USER;
 +
 +    try
 +    {
 +        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Size")));
 +        aValue >>= size;
 +        ePaper = SvxPaperInfo::GetSvxPaper( Size(size.Width, size.Height), MAP_100TH_MM, TRUE);
 +    }
 +    catch( uno::Exception& )
 +    {
 +    }
 +
 +    return PaperSizeOOoToExcel(ePaper);
 +}
 +
 +Paper PaperSizeExcelToOOo( sal_Int32 xlPaper)
 +{
 +    Paper ePaper = PAPER_USER;
 +
 +    for (int i = 0; i < nMapSize; i++)
 +    {
 +        if (xlPaper == paperSizeMappings[i].xlPaper)
 +        {
 +            ePaper = paperSizeMappings[i].ePaper;
 +            break;
 +        }
 +    }
 +
 +    return ePaper;
 +}
 +void SAL_CALL ScVbaPageSetup::setPaperSize( sal_Int32 paperSize) throw (css::uno::RuntimeException)
 +{
 +    Paper ePaper = PaperSizeExcelToOOo( paperSize );
 +
 +    try
 +    {
 +        Size size1 = SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM );
 +        com::sun::star::awt::Size size(size1.Width(), size1.Height());
 +        mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Size")), uno::makeAny( size ));
 +    }
 +    catch( uno::Exception& )
 +    {
 +    }
 +}
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --cc sc/source/ui/view/viewfun3.cxx
index aed6fc6,078bde5..46b62aa
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@@ -1855,85 -1785,7 +1856,86 @@@ BOOL ScViewFunc::LinkBlock( const ScRan
      return TRUE;
  }
  
 +void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
 +                                  SCROW nStartRow , SCCOL nStartCol ,
 +                                  SCROW nEndRow , SCCOL nEndCol ,
 +                                  Edit** pEdits ,
 +                                  sal_uInt16 aColLength )
 +{
 +    ScDocument* pDoc = GetViewData()->GetDocument();
 +    ScDocShell* pDocSh = GetViewData()->GetDocShell();
 +    ScMarkData& rMark = GetViewData()->GetMarkData();
 +    ScDocShellModificator aModificator( *pDocSh );
 +    SfxUndoManager* pUndoMgr = pDocSh->GetUndoManager();
 +    if ( pDoc )
 +    {
 +        const BOOL bRecord( pDoc->IsUndoEnabled());
 +        ScDocument* pUndoDoc = NULL;
 +        ScDocument* pRedoDoc = NULL;
 +        ScDocument* pRefUndoDoc = NULL;
 +        ScRefUndoData* pUndoData = NULL;
 +        SCTAB nTab = GetViewData()->GetTabNo();
 +        SCTAB nStartTab = nTab;
 +        SCTAB nEndTab = nTab;
  
 +        {
 +                ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
 +                if ( pChangeTrack )
 +                        pChangeTrack->ResetLastCut();   // kein CutMode mehr
 +        }
 +        ScRange aUserRange( nStartCol, nCurrentRow, nStartTab, nEndCol, nCurrentRow, nEndTab );
 +        BOOL bColInfo = ( nStartRow==0 && nEndRow==MAXROW );
 +        BOOL bRowInfo = ( nStartCol==0 && nEndCol==MAXCOL );
 +        SCCOL nUndoEndCol = nStartCol+aColLength-1;
 +        SCROW nUndoEndRow = nCurrentRow;
 +        USHORT nUndoFlags = IDF_NONE;
 +
 +        if ( bRecord )
 +        {
 +            pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
 +            pUndoDoc->InitUndoSelected( pDoc , rMark , bColInfo , bRowInfo );
 +            pDoc->CopyToDocument( aUserRange , 1 , FALSE , pUndoDoc );
 +        }
 +        USHORT nExtFlags = 0;
 +        pDocSh->UpdatePaintExt( nExtFlags, nStartCol, nStartRow, nStartTab , nEndCol, nEndRow, nEndTab ); // content before the change
 +        //rMark.SetMarkArea( aUserRange );
 +        pDoc->BeginDrawUndo();
 +
 +        for(sal_uInt16 i = 0; i < aColLength; i++)
 +        {
 +            if (pEdits[i])
 +            {
 +                String  aFieldName=pEdits[i]->GetText();
 +                pDoc->SetString( nStartCol + i, nCurrentRow, nTab, aFieldName );
 +            }
 +        }
 +        //pDoc->ExtendMergeSel( nStartCol, nStartRow, nEndCol, nEndRow, rMark, TRUE );    // Refresh
 +        pDocSh->UpdatePaintExt( nExtFlags, nStartCol, nCurrentRow, nStartTab, nEndCol, nCurrentRow, nEndTab );  // content after the change
 +        SfxUndoAction* pUndo = new ScUndoDataForm( pDocSh,
 +                                                                nStartCol, nCurrentRow, nStartTab,
 +                                                                nUndoEndCol, nUndoEndRow, nEndTab, rMark,
 +                                                                pUndoDoc, pRedoDoc, nUndoFlags,
 +                                                                pUndoData, NULL, NULL, NULL,
 +                                                                FALSE );           // FALSE = Redo data not yet copied
 +        pUndoMgr->AddUndoAction( new ScUndoWrapper( pUndo ), TRUE );
 +
 +        USHORT nPaint = PAINT_GRID;
 +        if (bColInfo)
 +        {
 +                nPaint |= PAINT_TOP;
 +                nUndoEndCol = MAXCOL;                           // nur zum Zeichnen !
 +        }
 +        if (bRowInfo)
 +        {
 +                nPaint |= PAINT_LEFT;
 +                nUndoEndRow = MAXROW;                           // nur zum Zeichnen !
 +        }
 +
 +        pDocSh->PostPaint( nStartCol, nCurrentRow, nStartTab,
 +                                                nUndoEndCol, nUndoEndRow, nEndTab, nPaint, nExtFlags );
 +        pDocSh->UpdateOle(GetViewData());
 +    }
 +}
  
  
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 4e63e44c55f3c0ab6fa38ad62c5b0ab7fbbd09f0
Author: Noel Power <noel.power at novell.com>
Date:   Wed Oct 13 11:30:25 2010 +0100

    replace old header ( that I deleted ) with spanking new one

diff --git a/sc/source/ui/inc/datafdlg.hrc b/sc/source/ui/inc/datafdlg.hrc
index b7ae326..eb6b3fe 100644
--- a/sc/source/ui/inc/datafdlg.hrc
+++ b/sc/source/ui/inc/datafdlg.hrc
@@ -1,4 +1,29 @@
-
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Amelia Wang <amwang at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #include "sc.hrc"	// -> RID_SCDLG_DATAFORM
 
 //dataform
diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx
index bb09495..bd6d3f3 100644
--- a/sc/source/ui/inc/datafdlg.hxx
+++ b/sc/source/ui/inc/datafdlg.hxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Amelia Wang <amwang at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 
 #ifndef SC_DATAFDLG_HXX
 #define SC_DATAFDLG_HXX
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index 8911fd9..b5d910f 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Amelia Wang <amwang at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sc.hxx"
diff --git a/sc/source/ui/src/datafdlg.src b/sc/source/ui/src/datafdlg.src
index 99812af..2c07a70 100644
--- a/sc/source/ui/src/datafdlg.src
+++ b/sc/source/ui/src/datafdlg.src
@@ -1,4 +1,29 @@
-
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Amelia Wang <amwang at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #include "datafdlg.hrc"
 
 //zhangyun, dataform
diff --git a/sc/source/ui/vba/vbamenu.cxx b/sc/source/ui/vba/vbamenu.cxx
index fa3dc17..237fd72 100644
--- a/sc/source/ui/vba/vbamenu.cxx
+++ b/sc/source/ui/vba/vbamenu.cxx
@@ -1,3 +1,30 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
 #include "vbamenu.hxx"
 #include "vbamenuitems.hxx"
 
diff --git a/sc/source/ui/vba/vbamenu.hxx b/sc/source/ui/vba/vbamenu.hxx
index bc4c5e3..a297c6d 100644
--- a/sc/source/ui/vba/vbamenu.hxx
+++ b/sc/source/ui/vba/vbamenu.hxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #ifndef SC_VBA_MENU_HXX
 #define SC_VBA_MENU_HXX
 
diff --git a/sc/source/ui/vba/vbamenubar.cxx b/sc/source/ui/vba/vbamenubar.cxx
index 254d8fd..abf2c05 100644
--- a/sc/source/ui/vba/vbamenubar.cxx
+++ b/sc/source/ui/vba/vbamenubar.cxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #include "vbamenubar.hxx"
 #include "vbamenus.hxx"
 #include <ooo/vba/XCommandBarControls.hpp>
diff --git a/sc/source/ui/vba/vbamenubar.hxx b/sc/source/ui/vba/vbamenubar.hxx
index daadd62..6ba8f36 100644
--- a/sc/source/ui/vba/vbamenubar.hxx
+++ b/sc/source/ui/vba/vbamenubar.hxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #ifndef SC_VBA_MENUBAR_HXX
 #define SC_VBA_MENUBAR_HXX
 
diff --git a/sc/source/ui/vba/vbamenubars.cxx b/sc/source/ui/vba/vbamenubars.cxx
index 00fe9cc..a13bb49 100644
--- a/sc/source/ui/vba/vbamenubars.cxx
+++ b/sc/source/ui/vba/vbamenubars.cxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #include "vbamenubars.hxx"
 #include "vbamenubar.hxx"
 #include <ooo/vba/excel/XlSheetType.hpp>
diff --git a/sc/source/ui/vba/vbamenubars.hxx b/sc/source/ui/vba/vbamenubars.hxx
index 1a2f228..44cf96e 100644
--- a/sc/source/ui/vba/vbamenubars.hxx
+++ b/sc/source/ui/vba/vbamenubars.hxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #ifndef SC_VBA_MENUBARS_HXX
 #define SC_VBA_MENUBARS_HXX
 
diff --git a/sc/source/ui/vba/vbamenuitem.cxx b/sc/source/ui/vba/vbamenuitem.cxx
index d6abde4..42f276b 100644
--- a/sc/source/ui/vba/vbamenuitem.cxx
+++ b/sc/source/ui/vba/vbamenuitem.cxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #include "vbamenuitem.hxx"
 
 using namespace com::sun::star;
diff --git a/sc/source/ui/vba/vbamenuitem.hxx b/sc/source/ui/vba/vbamenuitem.hxx
index 71feec0..eaccdbb 100644
--- a/sc/source/ui/vba/vbamenuitem.hxx
+++ b/sc/source/ui/vba/vbamenuitem.hxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #ifndef SC_VBA_MENUITEM_HXX
 #define SC_VBA_MENUITEM_HXX
 
diff --git a/sc/source/ui/vba/vbamenuitems.cxx b/sc/source/ui/vba/vbamenuitems.cxx
index 4cbc98a..f3a3f3e 100644
--- a/sc/source/ui/vba/vbamenuitems.cxx
+++ b/sc/source/ui/vba/vbamenuitems.cxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #include "vbamenuitems.hxx"
 #include "vbamenuitem.hxx"
 #include "vbamenu.hxx"
diff --git a/sc/source/ui/vba/vbamenuitems.hxx b/sc/source/ui/vba/vbamenuitems.hxx
index 6b0d5f5..17eee45 100644
--- a/sc/source/ui/vba/vbamenuitems.hxx
+++ b/sc/source/ui/vba/vbamenuitems.hxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #ifndef SC_VBA_MENUITEMS_HXX
 #define SC_VBA_MENUITEMS_HXX
 
diff --git a/sc/source/ui/vba/vbamenus.cxx b/sc/source/ui/vba/vbamenus.cxx
index 7644e51..057f822 100644
--- a/sc/source/ui/vba/vbamenus.cxx
+++ b/sc/source/ui/vba/vbamenus.cxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #include "vbamenus.hxx"
 #include "vbamenu.hxx"
 #include <ooo/vba/office/MsoControlType.hpp>
diff --git a/sc/source/ui/vba/vbamenus.hxx b/sc/source/ui/vba/vbamenus.hxx
index 19e26a7..4203cb1 100644
--- a/sc/source/ui/vba/vbamenus.hxx
+++ b/sc/source/ui/vba/vbamenus.hxx
@@ -1,3 +1,29 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
 #ifndef SC_VBA_MENUS_HXX
 #define SC_VBA_MENUS_HXX
 
commit bef01b6751dc826beff29426ad6ac3c3a5f9dbcc
Merge: c4712cc... c76ef56...
Author: Noel Power <noel.power at novell.com>
Date:   Wed Oct 13 09:48:44 2010 +0100

    Merge branch 'vba' fix conflics, trailing ws & tab issues
    
    additionally the following iz patches are rolled up with this commit i#113356, i#112998 i#113955 i#113358 i#113515 i#112531 i#112596 i#112530

diff --cc sc/inc/address.hxx
index cdaff96,b344e11..da6a3b1
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@@ -232,6 -232,9 +232,9 @@@ inline SCTAB SanitizeTab( SCTAB nTab, S
  #define SCA_VALID_ROW       0x0100
  #define SCA_VALID_COL       0x0200
  #define SCA_VALID_TAB       0x0400
 -// SCA_BITS is a convience for 
++// SCA_BITS is a convience for
+ // (SCA_VALID_TAB | SCA_VALID_COL | SCA_VALID_ROW | SCA_TAB_3D | SCA_TAB_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_COL_ABSOLUTE)
+ #define SCA_BITS            0x070F
  // somewhat cheesy kludge to force the display of the document name even for
  // local references.  Requires TAB_3D to be valid
  #define SCA_FORCE_DOC       0x0800
diff --cc sc/inc/appoptio.hxx
index 4056b3c,12b41ff..ce45e35
--- a/sc/inc/appoptio.hxx
+++ b/sc/inc/appoptio.hxx
@@@ -44,6 -44,10 +44,10 @@@ public
  
      void		SetDefaults();
  
 -	// Set or get the initial tab count for new spreadsheet, it is used by VBA API currently.
 -	void		SetTabCountInNewSpreadsheet( sal_Int16 nCount )  { nTabCountInNewSpreadsheet = nCount; }
 -	sal_Int16	GetTabCountInNewSpreadsheet() const              { return nTabCountInNewSpreadsheet;   }
++    // Set or get the initial tab count for new spreadsheet, it is used by VBA API currently.
++    void	SetTabCountInNewSpreadsheet( sal_Int16 nCount )  { nTabCountInNewSpreadsheet = nCount; }
++    sal_Int16	GetTabCountInNewSpreadsheet() const              { return nTabCountInNewSpreadsheet;   }
+ 
      void		SetAppMetric( FieldUnit eUnit )	{ eMetric = eUnit;		}
      FieldUnit	GetAppMetric() const			{ return eMetric;		}
      void		SetZoom( USHORT nNew )			{ nZoom = nNew;			}
@@@ -87,6 -91,7 +91,7 @@@
      const ScAppOptions&	operator=	( const ScAppOptions& rOpt );
  
  private:
 -	sal_Int16	nTabCountInNewSpreadsheet;
++    sal_Int16	nTabCountInNewSpreadsheet;
      FieldUnit	eMetric;
      USHORT		nLRUFuncCount;
      USHORT*		pLRUList;
diff --cc sc/inc/cell.hxx
index 847e833,3c1605e..395da21
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@@ -406,7 -406,7 +406,7 @@@ public
                                  const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
  
      void			SetDirty();
-     inline void		SetDirtyVar() { bDirty = TRUE; }
 -	void			SetDirtyVar();
++    void			SetDirtyVar();
      // If setting entire document dirty after load, no broadcasts but still append to FormulaTree.
      void            SetDirtyAfterLoad();
      inline void		ResetTableOpDirtyVar() { bTableOpDirty = FALSE; }
diff --cc sc/inc/document.hxx
index 7565e3f,2be3882..ed78343
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@@ -466,7 -463,9 +469,9 @@@ public
      void			SetName( const String& r ) { aDocName = r; }
      const String& 	GetCodeName() const { return aDocCodeName; }
      void			SetCodeName( const String& r ) { aDocCodeName = r; }
 -    
 +
+     SC_DLLPUBLIC NameToNameMap*              GetLocalNameMap( SCTAB& rTab );
+ 
      void			GetDocStat( ScDocStat& rDocStat );
  
      SC_DLLPUBLIC void			InitDrawLayer( SfxObjectShell* pDocShell = NULL );
@@@ -586,6 -585,7 +591,7 @@@
      BOOL			HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow,
                                              SCCOL nEndCol, SCROW nEndRow,
                                              const ScMarkData& rMark ) const;
 -	BOOL			HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTAB ) const;
++    BOOL			HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTAB ) const;
  
      BOOL			GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix );
  
@@@ -958,7 -956,7 +964,7 @@@
                                              SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab,
                                              ScDirection eDir );
  
-     void			FindAreaPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY );
 -	SC_DLLPUBLIC void			FindAreaPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY );
++    SC_DLLPUBLIC void			FindAreaPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY );
      SC_DLLPUBLIC void			GetNextPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY,
                                  BOOL bMarked, BOOL bUnprotected, const ScMarkData& rMark );
  
@@@ -979,7 -977,7 +985,7 @@@
                                 SCROW nStartRow, SCSIZE nSize,
                                 ScDocument* pRefUndoDoc = NULL, BOOL* pUndoOutline = NULL,
                                 const ScMarkData* pTabMark = NULL );
-     void			DeleteRow( const ScRange& rRange,
 -	SC_DLLPUBLIC void	DeleteRow( const ScRange& rRange,
++    SC_DLLPUBLIC void	DeleteRow( const ScRange& rRange,
                                 ScDocument* pRefUndoDoc = NULL, BOOL* pUndoOutline = NULL );
      BOOL			InsertCol( SCROW nStartRow, SCTAB nStartTab,
                                 SCROW nEndRow,   SCTAB nEndTab,
@@@ -1017,7 -1015,7 +1023,7 @@@
      SC_DLLPUBLIC void			ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks );
      SC_DLLPUBLIC void			ResetClip( ScDocument* pSourceDoc, SCTAB nTab );
      void			SetCutMode( BOOL bCut );
-     BOOL			IsCutMode();
 -	SC_DLLPUBLIC BOOL			IsCutMode();
++    SC_DLLPUBLIC BOOL			IsCutMode();
      void			SetClipArea( const ScRange& rArea, BOOL bCut = FALSE );
  
      SC_DLLPUBLIC BOOL			IsDocVisible() const						{ return bIsVisible; }
@@@ -1039,6 -1037,9 +1045,9 @@@
                                 const ScMarkData* pMarks = NULL, bool bAllTabs = false, bool bKeepScenarioFlags = false,
                                 bool bIncludeObjects = false, bool bCloneNoteCaptions = true);
  
 -    void			CopyToClip4VBA(const ScClipParam& rClipParam, ScDocument* pClipDoc, bool bKeepScenarioFlags = false, 
++    void			CopyToClip4VBA(const ScClipParam& rClipParam, ScDocument* pClipDoc, bool bKeepScenarioFlags = false,
+                                    bool bIncludeObjects = false, bool bCloneNoteCaptions = true);
+ 
      void			CopyTabToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                                  SCTAB nTab, ScDocument* pClipDoc = NULL);
      void 			CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
diff --cc sc/inc/globstr.hrc
index 7003ceb,7503ce2..db00d9c
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@@ -575,12 -576,24 +575,27 @@@
  
  #define STR_UNDO_SET_TAB_BG_COLOR       438
  #define STR_UNDO_SET_MULTI_TAB_BG_COLOR 439
 -
 -#define STR_SHAPE_AUTOSHAPE         440
 -#define STR_SHAPE_RECTANGLE         441
 -#define STR_SHAPE_LINE              442
 -#define STR_SHAPE_OVAL              443
 -#define STR_SHAPE_TEXTBOX           444
 -
 -#define STR_FORM_BUTTON             445
 -#define STR_FORM_CHECKBOX           446
 -#define STR_FORM_OPTIONBUTTON       447
 -#define STR_FORM_LABEL              448
 -#define STR_FORM_LISTBOX            449
 -#define STR_FORM_GROUPBOX           450
 -#define STR_FORM_DROPDOWN           451
 -#define STR_FORM_SPINNER            452
 -#define STR_FORM_SCROLLBAR          453
 -                                       
 -#define STR_COUNT                       454
 +#define STR_UNDO_INSERT_CURRENT_DATE    440
 +#define STR_UNDO_INSERT_CURRENT_TIME    441
 +
 +#define STR_OPTIONS_WARN_SEPARATORS     442
- 
- #define STR_COUNT                       443
++#define STR_SHAPE_AUTOSHAPE         443
++#define STR_SHAPE_RECTANGLE         444
++#define STR_SHAPE_LINE              445
++#define STR_SHAPE_OVAL              446
++#define STR_SHAPE_TEXTBOX           447
++
++#define STR_FORM_BUTTON             448
++#define STR_FORM_CHECKBOX           449
++#define STR_FORM_OPTIONBUTTON       450
++#define STR_FORM_LABEL              451
++#define STR_FORM_LISTBOX            452
++#define STR_FORM_GROUPBOX           453
++#define STR_FORM_DROPDOWN           454
++#define STR_FORM_SPINNER            455
++#define STR_FORM_SCROLLBAR          456
++
++#define STR_COUNT                       456
  
  #endif
  
diff --cc sc/inc/macromgr.hxx
index 0000000,35a3b2d..ae99f81
mode 000000,100644..100644
--- a/sc/inc/macromgr.hxx
+++ b/sc/inc/macromgr.hxx
@@@ -1,0 -1,70 +1,69 @@@
+ /*************************************************************************
+  *
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * Copyright 2008 by Sun Microsystems, Inc.
+  *
+  * OpenOffice.org - a multi-platform office productivity suite
+  *
+  * $RCSfile: document.hxx,v $
+  * $Revision: 1.115.36.9 $
+  *
+  * This file is part of OpenOffice.org.
+  *
+  * OpenOffice.org is free software: you can redistribute it and/or modify
+  * it under the terms of the GNU Lesser General Public License version 3
+  * only, as published by the Free Software Foundation.
+  *
+  * OpenOffice.org is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU Lesser General Public License version 3 for more details
+  * (a copy is included in the LICENSE file that accompanied this code).
+  *
+  * You should have received a copy of the GNU Lesser General Public License
+  * version 3 along with OpenOffice.org.  If not, see
+  * <http://www.openoffice.org/license.html>
+  * for a copy of the LGPLv3 License.
+  *
+  ************************************************************************/
+ 
+ #ifndef SC_MACROMGR_HXX
+ #define SC_MACROMGR_HXX
+ 
+ #include <com/sun/star/container/XContainerListener.hpp>
+ 
+ #include "rtl/ustring.hxx"
+ #include "scdllapi.h"
+ 
+ #include <hash_map>
+ #include <memory>
+ 
+ class ScDocument;
+ class ScFormulaCell;
+ class ScUserMacroDepTracker;
+ 
+ class ScMacroManager
+ {
+ public:
+     explicit ScMacroManager(ScDocument* pDoc);
+     ~ScMacroManager();
+ 
+     SC_DLLPUBLIC void InitUserFuncData();
+     SC_DLLPUBLIC void SetUserFuncVolatile( const rtl::OUString& sName, bool isVolatile );
+     SC_DLLPUBLIC bool GetUserFuncVolatile( const rtl::OUString& sName );
+ 
+     void AddDependentCell(const ::rtl::OUString& aModuleName, ScFormulaCell* pCell);
+     void RemoveDependentCell(ScFormulaCell* pCell);
+     void BroadcastModuleUpdate(const ::rtl::OUString& aModuleName);
+ 
+ private:
+     typedef std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NameBoolMap;
+     NameBoolMap mhFuncToVolatile;
+     com::sun::star::uno::Reference< com::sun::star::container::XContainerListener > mxContainerListener;
+ 
+     ::std::auto_ptr<ScUserMacroDepTracker> mpDepTracker;
+     ScDocument* mpDoc;
+ };
+ 
+ #endif
 -
diff --cc sc/inc/sc.hrc
index 3eabf42,035739d..23ea60e
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@@ -1669,9 -1667,10 +1667,13 @@@
  #define RID_SCPAGE_FORMULA          (SC_OOO_BUILD_START + 2)
  #define HID_SCPAGE_FORMULA          (SC_OOO_BUILD_START + 3)
  
 +// Insert current date and time to cell via command
 +#define SID_INSERT_CURRENT_DATE     (SC_OOO_BUILD_START + 4)
 +#define SID_INSERT_CURRENT_TIME     (SC_OOO_BUILD_START + 5)
+ // Data Form
 -#define SID_DATAFORM_NEW            (SC_OOO_BUILD_START + 5) // message
 -#define SID_DATA_FORM               (SC_OOO_BUILD_START + 6) // menu (in Data menu)
 -#define RID_SCDLG_DATAFORM          (SC_OOO_BUILD_START + 7) // dialog
++#define SID_DATAFORM_NEW            (SC_OOO_BUILD_START + 6) // message
++#define SID_DATA_FORM               (SC_OOO_BUILD_START + 7) // menu (in Data menu)
++#define RID_SCDLG_DATAFORM          (SC_OOO_BUILD_START + 8) // dialog
  
  #endif
  
diff --cc sc/inc/scabstdlg.hxx
index 05ca719,e50f8cd..d007527
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@@ -309,7 -317,7 +317,7 @@@ public
  class ScAbstractDialogFactory
  {
  public:
-     static ScAbstractDialogFactory* 	Create();
 -	SC_DLLPUBLIC static ScAbstractDialogFactory* 	Create();
++    SC_DLLPUBLIC static ScAbstractDialogFactory* 	Create();
  
      virtual 	AbstractScImportAsciiDlg * CreateScImportAsciiDlg( Window* pParent, String aDatName, //add for ScImportAsciiDlg
                                                                      SvStream* pInStream, int nId,
@@@ -343,6 -351,9 +351,9 @@@
  
      virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId, BOOL bDisallowCellMove = FALSE ) = 0 ; //add for ScDeleteCellDlg
  
 -	//for dataform
 -	virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell*      pTabViewShell ) = 0 ; //add for ScDataFormDlg
++    //for dataform
++    virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell*      pTabViewShell ) = 0 ; //add for ScDataFormDlg
+ 
      virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg
                                                                   USHORT  nCheckDefaults = 0 ) = 0;
      virtual AbstractScFillSeriesDlg * CreateScFillSeriesDlg( Window*		pParent, //add for ScFillSeriesDlg
diff --cc sc/inc/table.hxx
index 82d0e70,51c6c32..84aaf35
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@@ -86,9 -86,9 +86,11 @@@ class ScFlatUInt16RowSegments
  class ScFlatBoolRowSegments;
  class ScFlatBoolColSegments;
  struct ScSetStringParam;
 +struct ScColWidthParam;
 +struct ScColWidthParam;
  
+ typedef std::hash_map< ::rtl::OUString, rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NameToNameMap;
 - 
++
  class ScTable
  {
  private:
diff --cc sc/inc/unonames.hxx
index 11d8132,2ca67a1..a396e9c
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@@ -186,6 -184,8 +186,8 @@@
  #define SC_UNONAME_ANCHOR           "Anchor"
  #define SC_UNONAME_HORIPOS          "HoriOrientPosition"
  #define SC_UNONAME_VERTPOS          "VertOrientPosition"
+ //     #i66550 HLINK_FOR_SHAPES
 -#define SC_UNONAME_HYPERLINK        "Hyperlink" 
++#define SC_UNONAME_HYPERLINK        "Hyperlink"
  
  //	other cell properties
  #define SC_UNONAME_CHCOLHDR			"ChartColumnAsLabel"
diff --cc sc/inc/viewuno.hxx
index 9d3d822,f34a962..c0d4787
--- a/sc/inc/viewuno.hxx
+++ b/sc/inc/viewuno.hxx
@@@ -313,6 -314,13 +314,13 @@@ public
                                  ::com::sun::star::sheet::XSpreadsheet >& xActiveSheet )
                                      throw(::com::sun::star::uno::RuntimeException);
  
 -	//liuchen 2009-9-2 support expand (but not replace) the active sheet
 -	virtual void SAL_CALL	selectSheet( const ::com::sun::star::uno::Reference<
 -									::com::sun::star::sheet::XSpreadsheet >& xActiveSheet,
 -									sal_Bool bExpand)
 -										throw(::com::sun::star::uno::RuntimeException);
 -	//liuchen 2009-9-2
++    //liuchen 2009-9-2 support expand (but not replace) the active sheet
++    virtual void SAL_CALL	selectSheet( const ::com::sun::star::uno::Reference<
++                                    ::com::sun::star::sheet::XSpreadsheet >& xActiveSheet,
++                                    sal_Bool bExpand)
++                                        throw(::com::sun::star::uno::RuntimeException);
++    //liuchen 2009-9-2
+ 
                              //XEnhancedMouseClickBroadcaster
  
      virtual void SAL_CALL addEnhancedMouseClickHandler( const ::com::sun::star::uno::Reference<
diff --cc sc/sdi/cellsh.sdi
index c5677d0,84b23d5..b4bd228
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@@ -60,6 -60,7 +60,7 @@@ interface CellSelectio
      SID_SBA_BRW_INSERT		[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
      SID_SELECT_DB			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
      SID_SORT				[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
 -	SID_DATA_FORM			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
++    SID_DATA_FORM			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
      FID_FILTER_OK			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
      SID_AUTO_FILTER			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
      SID_AUTOFILTER_HIDE		[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
diff --cc sc/sdi/scalc.sdi
index 4e56491,6d7f289..0628d84
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@@ -1598,6 -1598,31 +1598,31 @@@ SfxVoidItem DataSort SID_SOR
  ]
  
  //--------------------------------------------------------------------------
+ SfxVoidItem DataForm SID_DATA_FORM
+ ()
+ [
 -	/* flags: */
 -	AutoUpdate = FALSE,
 -	Cachable = Cachable,
 -	FastCall = FALSE,
 -	HasCoreId = FALSE,
 -	HasDialog = TRUE,
 -	ReadOnlyDoc = TRUE,
 -	Toggle = FALSE,
 -	Container = FALSE,
 -	RecordAbsolute = FALSE,
 -	RecordPerSet;
 -	Synchron;
 -
 -	/* config: */
 -	AccelConfig = TRUE,
 -	MenuConfig = TRUE,
 -	StatusBarConfig = FALSE,
 -	ToolBoxConfig = FALSE,
 -	GroupId = GID_DATA;
++    /* flags: */
++    AutoUpdate = FALSE,
++    Cachable = Cachable,
++    FastCall = FALSE,
++    HasCoreId = FALSE,
++    HasDialog = TRUE,
++    ReadOnlyDoc = TRUE,
++    Toggle = FALSE,
++    Container = FALSE,
++    RecordAbsolute = FALSE,
++    RecordPerSet;
++    Synchron;
++
++    /* config: */
++    AccelConfig = TRUE,
++    MenuConfig = TRUE,
++    StatusBarConfig = FALSE,
++    ToolBoxConfig = FALSE,
++    GroupId = GID_DATA;
+ ]
+ 
+ //--------------------------------------------------------------------------
  SfxVoidItem DataSubTotals SID_SUBTOTALS
  ()
  [
diff --cc sc/source/core/data/cell.cxx
index c524f0c,4abff4b..6ba7b2a
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@@ -825,7 -820,8 +826,9 @@@ ScFormulaCell::ScFormulaCell( const ScF
  ScFormulaCell::~ScFormulaCell()
  {
      pDocument->RemoveFromFormulaTree( this );
 +    pDocument->RemoveSubTotalCell(this);
+     if (pCode->HasOpCode(ocMacro))
+         pDocument->GetMacroManager()->RemoveDependentCell(this);
  
      if (pDocument->HasExternalRefManager())
          pDocument->GetExternalRefManager()->removeRefCell(this);
@@@ -1757,6 -1745,36 +1760,36 @@@ void ScFormulaCell::InterpretTail( ScIn
          // Reschedule verlangsamt das ganze erheblich, nur bei Prozentaenderung ausfuehren
          ScProgress::GetInterpretProgress()->SetStateCountDownOnPercent(
              pDocument->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE );
+ 
+         switch (p->GetVolatileType())
+         {
+             case ScInterpreter::VOLATILE:
+                 // Volatile via built-in volatile functions.  No actions needed.
+             break;
+             case ScInterpreter::VOLATILE_MACRO:
+                 // The formula contains a volatile macro.
+                 pCode->SetRecalcModeAlways();
+                 pDocument->PutInFormulaTree(this);
+                 StartListeningTo(pDocument);
+             break;
+             case ScInterpreter::NOT_VOLATILE:
+                 if (pCode->IsRecalcModeAlways())
+                 {
+                     // The formula was previously volatile, but no more.
+                     EndListeningTo(pDocument);
+                     pCode->SetRecalcModeNormal();
+                 }
+                 else
 -                {    
 -                    // non-volatile formula.  End listening to the area in case 
++                {
++                    // non-volatile formula.  End listening to the area in case
+                     // it's listening due to macro module change.
+                     pDocument->EndListeningArea(BCA_LISTEN_ALWAYS, this);
+                 }
+                 pDocument->RemoveFromFormulaTree(this);
+             break;
+             default:
+                 ;
+         }
      }
      else
      {
@@@ -1824,7 -1842,7 +1857,7 @@@ void __EXPORT ScFormulaCell::Notify( Sv
              else
              {
                  bForceTrack = !bDirty;
-                 bDirty = TRUE;
 -				SetDirtyVar();
++                SetDirtyVar();
              }
              // #35962# Don't remove from FormulaTree to put in FormulaTrack to
              // put in FormulaTree again and again, only if necessary.
@@@ -1847,7 -1865,7 +1880,7 @@@ void ScFormulaCell::SetDirty(
      if ( !IsInChangeTrack() )
      {
          if ( pDocument->GetHardRecalcState() )
-             bDirty = TRUE;
 -			SetDirtyVar();
++            SetDirtyVar();
          else
          {
              // Mehrfach-FormulaTracking in Load und in CompileAll
@@@ -1856,7 -1874,7 +1889,7 @@@
              // setzen, z.B. in CompileTokenArray
              if ( !bDirty || !pDocument->IsInFormulaTree( this ) )
              {
-                 bDirty = TRUE;
 -				SetDirtyVar();
++                SetDirtyVar();
                  pDocument->AppendToFormulaTrack( this );
                  pDocument->TrackFormulas();
              }
@@@ -1867,6 -1885,13 +1900,13 @@@
      }
  }
  
+ void ScFormulaCell::SetDirtyVar()
+ {
 -	bDirty = TRUE;
 -	// mark the sheet of this cell to be calculated
 -	//#FIXME do we need to revert this remnant of old fake vba events? pDocument->AddCalculateTable( aPos.Tab() );
++    bDirty = TRUE;
++    // mark the sheet of this cell to be calculated
++    //#FIXME do we need to revert this remnant of old fake vba events? pDocument->AddCalculateTable( aPos.Tab() );
+ }
+ 
  void ScFormulaCell::SetDirtyAfterLoad()
  {
      bDirty = TRUE;
diff --cc sc/source/core/data/documen2.cxx
index cefddea,6d3ef04..c7b936a
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@@ -156,6 -157,7 +157,7 @@@ ScDocument::ScDocument( ScDocumentMode	
          pCacheFieldEditEngine( NULL ),
          pDocProtection( NULL ),
          mpClipParam( NULL),
 -        mpMacroMgr( NULL ), 
++        mpMacroMgr( NULL ),
          pExternalRefMgr( NULL ),
          pViewOptions( NULL ),
          pDocOptions( NULL ),
diff --cc sc/source/core/data/document.cxx
index 7a75b14,6e69856..5604e4b
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@@ -1608,6 -1618,40 +1618,40 @@@ void ScDocument::CopyToClip(const ScCli
      pClipDoc->ExtendMerge(aClipRange, true);
  }
  
+ // Copy the content of the Range into clipboard. Adding this method for VBA API: Range.Copy().
+ void ScDocument::CopyToClip4VBA(const ScClipParam& rClipParam, ScDocument* pClipDoc, bool bKeepScenarioFlags, bool bIncludeObjects, bool bCloneNoteCaptions)
+ {
 -	if ( !bIsClip )
 -	{
 -		pClipDoc = pClipDoc ? pClipDoc : SC_MOD()->GetClipDoc();
 -		if ( !pClipDoc )
 -		{
 -			return;
 -		}
 -		ScRange aClipRange = rClipParam.getWholeRange();
 -		SCTAB nTab = aClipRange.aStart.Tab();
 -		pClipDoc->aDocName = aDocName;
 -		pClipDoc->SetClipParam( rClipParam );
 -		pClipDoc->ResetClip( this, nTab );
 -
 -		CopyRangeNamesToClip( pClipDoc, aClipRange, nTab );
 -
 -		if ( pTab[nTab] && pClipDoc->pTab[nTab] )
 -		{
 -			pTab[nTab]->CopyToClip( rClipParam.maRanges, pClipDoc->pTab[nTab], bKeepScenarioFlags, bCloneNoteCaptions );
 -			if ( pDrawLayer && bIncludeObjects )
 -			{
 -				// Also copy drawing objects.
 -				Rectangle aObjRect = GetMMRect( aClipRange.aStart.Col(), aClipRange.aStart.Row(), aClipRange.aEnd.Col(), aClipRange.aEnd.Row(), nTab );
 -				pDrawLayer->CopyToClip( pClipDoc, nTab, aObjRect );
 -			}
 -		}
 -
 -		// Make sure to mark overlapped cells.
 -		pClipDoc->ExtendMerge( aClipRange, true );
 -	}
++    if ( !bIsClip )
++    {
++        pClipDoc = pClipDoc ? pClipDoc : SC_MOD()->GetClipDoc();
++        if ( !pClipDoc )
++        {
++            return;
++        }
++        ScRange aClipRange = rClipParam.getWholeRange();
++        SCTAB nTab = aClipRange.aStart.Tab();
++        pClipDoc->aDocName = aDocName;
++        pClipDoc->SetClipParam( rClipParam );
++        pClipDoc->ResetClip( this, nTab );
++
++        CopyRangeNamesToClip( pClipDoc, aClipRange, nTab );
++
++        if ( pTab[nTab] && pClipDoc->pTab[nTab] )
++        {
++            pTab[nTab]->CopyToClip( rClipParam.maRanges, pClipDoc->pTab[nTab], bKeepScenarioFlags, bCloneNoteCaptions );
++            if ( pDrawLayer && bIncludeObjects )
++            {
++                // Also copy drawing objects.
++                Rectangle aObjRect = GetMMRect( aClipRange.aStart.Col(), aClipRange.aStart.Row(), aClipRange.aEnd.Col(), aClipRange.aEnd.Row(), nTab );
++                pDrawLayer->CopyToClip( pClipDoc, nTab, aObjRect );
++            }
++        }
++
++        // Make sure to mark overlapped cells.
++        pClipDoc->ExtendMerge( aClipRange, true );
++    }
+ }
+ 
  void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1,
                                  SCCOL nCol2, SCROW nRow2,
                                  SCTAB nTab, ScDocument* pClipDoc)
@@@ -1729,6 -1773,31 +1773,31 @@@ void ScDocument::CopyRangeNamesToClip(S
      }
  }
  
+ void ScDocument::CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, SCTAB nTab)
+ {
 -	// Indexes of named ranges that are used in the copied cells
 -	std::set<USHORT> aUsedNames;
 -	if ( pTab[nTab] && pClipDoc->pTab[nTab] )
 -	{
 -		pTab[nTab]->FindRangeNamesInUse( rClipRange.aStart.Col(), rClipRange.aStart.Row(), rClipRange.aEnd.Col(), rClipRange.aEnd.Row(), aUsedNames );
 -	}
 -
 -	pClipDoc->pRangeName->FreeAll();
 -	for ( USHORT i = 0; i < pRangeName->GetCount(); i++ )
 -	{
 -		USHORT nIndex = ((ScRangeData*)((*pRangeName)[i]))->GetIndex();
 -		bool bInUse = ( aUsedNames.find(nIndex) != aUsedNames.end() );
 -		if ( bInUse )
 -		{
 -			ScRangeData* pData = new ScRangeData(*((*pRangeName)[i]));
 -			if ( !pClipDoc->pRangeName->Insert(pData) )
 -				delete pData;
 -			else
 -				pData->SetIndex(nIndex);
 -		}
 -	}
++    // Indexes of named ranges that are used in the copied cells
++    std::set<USHORT> aUsedNames;
++    if ( pTab[nTab] && pClipDoc->pTab[nTab] )
++    {
++        pTab[nTab]->FindRangeNamesInUse( rClipRange.aStart.Col(), rClipRange.aStart.Row(), rClipRange.aEnd.Col(), rClipRange.aEnd.Row(), aUsedNames );
++    }
++
++    pClipDoc->pRangeName->FreeAll();
++    for ( USHORT i = 0; i < pRangeName->GetCount(); i++ )
++    {
++        USHORT nIndex = ((ScRangeData*)((*pRangeName)[i]))->GetIndex();
++        bool bInUse = ( aUsedNames.find(nIndex) != aUsedNames.end() );
++        if ( bInUse )
++        {
++            ScRangeData* pData = new ScRangeData(*((*pRangeName)[i]));
++            if ( !pClipDoc->pRangeName->Insert(pData) )
++                delete pData;
++            else
++                pData->SetIndex(nIndex);
++        }
++    }
+ }
+ 
  ScDocument::NumFmtMergeHandler::NumFmtMergeHandler(ScDocument* pDoc, ScDocument* pSrcDoc) :
          mpDoc(pDoc)
  {
@@@ -4502,6 -4557,15 +4571,15 @@@ BOOL ScDocument::HasSelectedBlockMatrix
      return !bOk;
  }
  
+ BOOL ScDocument::HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const
+ {
 -	BOOL bOk = TRUE;
 -	if ( pTab[nTab] && pTab[nTab]->HasBlockMatrixFragment( nStartCol, nStartRow, nEndCol, nEndRow ) )
 -	{
 -		bOk = FALSE;
 -	}
 -	return !bOk;
++    BOOL bOk = TRUE;
++    if ( pTab[nTab] && pTab[nTab]->HasBlockMatrixFragment( nStartCol, nStartRow, nEndCol, nEndRow ) )
++    {
++        bOk = FALSE;
++    }
++    return !bOk;
+ }
  
  BOOL ScDocument::GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix )
  {
diff --cc sc/source/core/inc/interpre.hxx
index 98c6afb,b28bfc1..138d1be
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@@ -135,6 -134,15 +135,15 @@@ public

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list