summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-10-13 23:21:02 -0400
committerKohei Yoshida <kyoshida@novell.com>2010-10-13 23:21:02 -0400
commit1708b3497f767b0298ec93518b14614180c096bc (patch)
tree9fbc7bad4c9b0bab013e8252510f03905ea67ee4 /sc/source/ui
parent2be03e2ec720cbe9aa04f7e463c7e19944347d96 (diff)
parent167c1f3a9566fdb4d197675b520b690326d8eaa9 (diff)
Merge branch 'master' into feature/calc-key-binding-compat
Conflicts: sc/source/ui/attrdlg/scdlgfact.cxx
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/Accessibility/AccessibilityHints.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleCell.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleCellBase.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleContextBase.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleCsvControl.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentBase.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleEditObject.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleFilterMenu.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleGlobal.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeader.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewCell.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleTableBase.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx3
-rw-r--r--sc/source/ui/Accessibility/DrawModelBroadcaster.cxx3
-rw-r--r--sc/source/ui/app/client.cxx2
-rw-r--r--sc/source/ui/app/drwtrans.cxx2
-rw-r--r--sc/source/ui/app/inputhdl.cxx2
-rw-r--r--sc/source/ui/app/inputwin.cxx2
-rw-r--r--sc/source/ui/app/lnktrans.cxx2
-rw-r--r--sc/source/ui/app/msgpool.cxx2
-rw-r--r--sc/source/ui/app/rfindlst.cxx2
-rw-r--r--sc/source/ui/app/scdll.cxx3
-rw-r--r--sc/source/ui/app/scmod.cxx2
-rw-r--r--sc/source/ui/app/scmod2.cxx2
-rw-r--r--sc/source/ui/app/seltrans.cxx2
-rw-r--r--sc/source/ui/app/template.cxx2
-rw-r--r--sc/source/ui/app/transobj.cxx2
-rw-r--r--sc/source/ui/app/typemap.cxx3
-rw-r--r--sc/source/ui/app/uiitems.cxx3
-rw-r--r--sc/source/ui/app/wtcdummy.cxx3
-rw-r--r--sc/source/ui/attrdlg/attrdlg.cxx2
-rw-r--r--sc/source/ui/attrdlg/condfrmt.cxx2
-rw-r--r--sc/source/ui/attrdlg/scabstdlg.cxx3
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx25
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx10
-rw-r--r--sc/source/ui/attrdlg/scuiexp.cxx3
-rw-r--r--sc/source/ui/attrdlg/tabpages.cxx3
-rw-r--r--sc/source/ui/cctrl/cbuttonw.cxx2
-rw-r--r--sc/source/ui/cctrl/dpcontrol.cxx24
-rw-r--r--sc/source/ui/cctrl/editfield.cxx2
-rw-r--r--sc/source/ui/cctrl/popmenu.cxx2
-rw-r--r--sc/source/ui/cctrl/tbinsert.cxx2
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx3
-rw-r--r--sc/source/ui/dbgui/asciiopt.cxx2
-rw-r--r--sc/source/ui/dbgui/consdlg.cxx2
-rw-r--r--sc/source/ui/dbgui/csvcontrol.cxx2
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx2
-rw-r--r--sc/source/ui/dbgui/csvruler.cxx2
-rw-r--r--sc/source/ui/dbgui/csvsplits.cxx2
-rw-r--r--sc/source/ui/dbgui/csvtablebox.cxx2
-rw-r--r--sc/source/ui/dbgui/dapidata.cxx2
-rw-r--r--sc/source/ui/dbgui/dapitype.cxx2
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx2
-rw-r--r--sc/source/ui/dbgui/dpgroupdlg.cxx2
-rw-r--r--sc/source/ui/dbgui/expftext.cxx2
-rw-r--r--sc/source/ui/dbgui/fieldwnd.cxx2
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx3
-rw-r--r--sc/source/ui/dbgui/foptmgr.cxx3
-rw-r--r--sc/source/ui/dbgui/imoptdlg.cxx3
-rw-r--r--sc/source/ui/dbgui/pfiltdlg.cxx2
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx2
-rw-r--r--sc/source/ui/dbgui/pvlaydlg.cxx2
-rw-r--r--sc/source/ui/dbgui/scendlg.cxx2
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx3
-rw-r--r--sc/source/ui/dbgui/scuiimoptdlg.cxx3
-rw-r--r--sc/source/ui/dbgui/sfiltdlg.cxx2
-rw-r--r--sc/source/ui/dbgui/sortdlg.cxx3
-rw-r--r--sc/source/ui/dbgui/subtdlg.cxx2
-rw-r--r--sc/source/ui/dbgui/textimportoptions.cxx2
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx2
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx2
-rw-r--r--sc/source/ui/dbgui/validate.cxx3
-rw-r--r--sc/source/ui/docshell/arealink.cxx2
-rw-r--r--sc/source/ui/docshell/autostyl.cxx2
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx2
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx14
-rw-r--r--sc/source/ui/docshell/docsh.cxx9
-rw-r--r--sc/source/ui/docshell/docsh2.cxx3
-rw-r--r--sc/source/ui/docshell/docsh3.cxx3
-rw-r--r--sc/source/ui/docshell/docsh4.cxx3
-rw-r--r--sc/source/ui/docshell/docsh5.cxx43
-rw-r--r--sc/source/ui/docshell/docsh6.cxx2
-rw-r--r--sc/source/ui/docshell/docsh7.cxx2
-rw-r--r--sc/source/ui/docshell/docsh8.cxx2
-rw-r--r--sc/source/ui/docshell/editable.cxx2
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx2
-rw-r--r--sc/source/ui/docshell/hiranges.cxx2
-rw-r--r--sc/source/ui/docshell/impex.cxx3
-rw-r--r--sc/source/ui/docshell/macromgr.cxx216
-rw-r--r--sc/source/ui/docshell/makefile.mk9
-rw-r--r--sc/source/ui/docshell/olinefun.cxx2
-rw-r--r--sc/source/ui/docshell/pagedata.cxx2
-rw-r--r--sc/source/ui/docshell/pntlock.cxx2
-rw-r--r--sc/source/ui/docshell/servobj.cxx2
-rw-r--r--sc/source/ui/docshell/sizedev.cxx2
-rw-r--r--sc/source/ui/docshell/tablink.cxx2
-rw-r--r--sc/source/ui/docshell/tpstat.cxx2
-rw-r--r--sc/source/ui/drawfunc/chartsh.cxx2
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx6
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx6
-rw-r--r--sc/source/ui/drawfunc/drawsh4.cxx2
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx6
-rw-r--r--sc/source/ui/drawfunc/drformsh.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob1.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob2.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuconarc.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuconcustomshape.cxx3
-rw-r--r--sc/source/ui/drawfunc/fuconpol.cxx3
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuconstr.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuconuno.cxx2
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx7
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx3
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx2
-rw-r--r--sc/source/ui/drawfunc/fumark.cxx2
-rw-r--r--sc/source/ui/drawfunc/fupoor.cxx3
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx18
-rw-r--r--sc/source/ui/drawfunc/fusel2.cxx2
-rw-r--r--sc/source/ui/drawfunc/futext.cxx2
-rw-r--r--sc/source/ui/drawfunc/futext2.cxx2
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx2
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx2
-rw-r--r--sc/source/ui/drawfunc/makefile.mk1
-rw-r--r--sc/source/ui/drawfunc/mediash.cxx3
-rw-r--r--sc/source/ui/drawfunc/objdraw.src6
-rw-r--r--sc/source/ui/drawfunc/oleobjsh.cxx2
-rw-r--r--sc/source/ui/formdlg/dwfunctr.cxx2
-rw-r--r--sc/source/ui/formdlg/formdata.cxx2
-rw-r--r--sc/source/ui/formdlg/formula.cxx2
-rw-r--r--sc/source/ui/formdlg/privsplt.cxx2
-rw-r--r--sc/source/ui/inc/asciiopt.hxx2
-rw-r--r--sc/source/ui/inc/datafdlg.hrc40
-rw-r--r--sc/source/ui/inc/datafdlg.hxx111
-rw-r--r--sc/source/ui/inc/docfunc.hxx2
-rw-r--r--sc/source/ui/inc/docsh.hxx5
-rw-r--r--sc/source/ui/inc/dpcontrol.hxx4
-rw-r--r--sc/source/ui/inc/drawsh.hxx2
-rw-r--r--sc/source/ui/inc/impex.hxx2
-rw-r--r--sc/source/ui/inc/tabcont.hxx1
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx4
-rw-r--r--sc/source/ui/inc/undodat.hxx36
-rw-r--r--sc/source/ui/inc/viewfunc.hxx9
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx2
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/autofmt.cxx2
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.cxx3
-rw-r--r--sc/source/ui/miscdlgs/crdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx3
-rw-r--r--sc/source/ui/miscdlgs/datafdlg.cxx414
-rw-r--r--sc/source/ui/miscdlgs/delcldlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/delcodlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/filldlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/groupdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/highred.cxx2
-rw-r--r--sc/source/ui/miscdlgs/inscldlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/inscodlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/lbseldlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx2
-rw-r--r--sc/source/ui/miscdlgs/makefile.mk1
-rw-r--r--sc/source/ui/miscdlgs/mtrindlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/mvtabdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/namecrea.cxx2
-rw-r--r--sc/source/ui/miscdlgs/namepast.cxx2
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx2
-rw-r--r--sc/source/ui/miscdlgs/protectiondlg.cxx3
-rw-r--r--sc/source/ui/miscdlgs/redcom.cxx2
-rw-r--r--sc/source/ui/miscdlgs/retypepassdlg.cxx3
-rw-r--r--sc/source/ui/miscdlgs/scuiautofmt.cxx3
-rw-r--r--sc/source/ui/miscdlgs/sharedocdlg.cxx3
-rw-r--r--sc/source/ui/miscdlgs/shtabdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/simpref.cxx2
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx2
-rw-r--r--sc/source/ui/miscdlgs/solverutil.cxx2
-rw-r--r--sc/source/ui/miscdlgs/solvrdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/strindlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/tabbgcolordlg.cxx3
-rw-r--r--sc/source/ui/miscdlgs/tabopdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/textdlgs.cxx2
-rw-r--r--sc/source/ui/miscdlgs/warnbox.cxx2
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx2
-rw-r--r--sc/source/ui/navipi/content.cxx2
-rw-r--r--sc/source/ui/navipi/navcitem.cxx2
-rw-r--r--sc/source/ui/navipi/navipi.cxx2
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx2
-rw-r--r--sc/source/ui/optdlg/opredlin.cxx2
-rw-r--r--sc/source/ui/optdlg/tpcalc.cxx2
-rw-r--r--sc/source/ui/optdlg/tpformula.cxx3
-rw-r--r--sc/source/ui/optdlg/tpprint.cxx2
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx2
-rw-r--r--sc/source/ui/optdlg/tpview.cxx2
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx2
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.cxx2
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx3
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx2
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx2
-rw-r--r--sc/source/ui/pagedlg/tptable.cxx2
-rw-r--r--sc/source/ui/src/datafdlg.src95
-rw-r--r--sc/source/ui/src/globstr.src71
-rw-r--r--sc/source/ui/src/makefile.mk1
-rw-r--r--sc/source/ui/styleui/styledlg.cxx2
-rw-r--r--sc/source/ui/undo/areasave.cxx2
-rw-r--r--sc/source/ui/undo/refundo.cxx2
-rw-r--r--sc/source/ui/undo/target.cxx3
-rw-r--r--sc/source/ui/undo/undobase.cxx2
-rw-r--r--sc/source/ui/undo/undoblk.cxx2
-rw-r--r--sc/source/ui/undo/undoblk2.cxx2
-rw-r--r--sc/source/ui/undo/undoblk3.cxx2
-rw-r--r--sc/source/ui/undo/undocell.cxx2
-rw-r--r--sc/source/ui/undo/undodat.cxx207
-rw-r--r--sc/source/ui/undo/undodraw.cxx2
-rw-r--r--sc/source/ui/undo/undoolk.cxx2
-rw-r--r--sc/source/ui/undo/undostyl.cxx2
-rw-r--r--sc/source/ui/undo/undotab.cxx2
-rw-r--r--sc/source/ui/undo/undoutil.cxx3
-rw-r--r--sc/source/ui/unoobj/ChartRangeSelectionListener.cxx3
-rw-r--r--sc/source/ui/unoobj/addruno.cxx30
-rw-r--r--sc/source/ui/unoobj/afmtuno.cxx2
-rw-r--r--sc/source/ui/unoobj/appluno.cxx2
-rw-r--r--sc/source/ui/unoobj/celllistsource.cxx3
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx2
-rw-r--r--sc/source/ui/unoobj/cellvaluebinding.cxx3
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx3
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx2
-rw-r--r--sc/source/ui/unoobj/confuno.cxx2
-rw-r--r--sc/source/ui/unoobj/convuno.cxx2
-rw-r--r--sc/source/ui/unoobj/cursuno.cxx2
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx2
-rw-r--r--sc/source/ui/unoobj/datauno.cxx2
-rw-r--r--sc/source/ui/unoobj/defltuno.cxx2
-rw-r--r--sc/source/ui/unoobj/detreg.cxx2
-rw-r--r--sc/source/ui/unoobj/dispuno.cxx2
-rw-r--r--sc/source/ui/unoobj/docuno.cxx16
-rw-r--r--sc/source/ui/unoobj/drdefuno.cxx2
-rw-r--r--sc/source/ui/unoobj/editsrc.cxx2
-rw-r--r--sc/source/ui/unoobj/eventuno.cxx2
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx2
-rw-r--r--sc/source/ui/unoobj/filtuno.cxx2
-rw-r--r--sc/source/ui/unoobj/fmtuno.cxx2
-rw-r--r--sc/source/ui/unoobj/forbiuno.cxx2
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx2
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx2
-rw-r--r--sc/source/ui/unoobj/listenercalls.cxx2
-rw-r--r--sc/source/ui/unoobj/miscuno.cxx2
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx2
-rw-r--r--sc/source/ui/unoobj/notesuno.cxx8
-rw-r--r--sc/source/ui/unoobj/optuno.cxx2
-rw-r--r--sc/source/ui/unoobj/pageuno.cxx3
-rw-r--r--sc/source/ui/unoobj/scdetect.cxx2
-rw-r--r--sc/source/ui/unoobj/servuno.cxx27
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx67
-rw-r--r--sc/source/ui/unoobj/srchuno.cxx2
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx2
-rw-r--r--sc/source/ui/unoobj/targuno.cxx2
-rw-r--r--sc/source/ui/unoobj/textuno.cxx2
-rw-r--r--sc/source/ui/unoobj/tokenuno.cxx2
-rw-r--r--sc/source/ui/unoobj/unodoc.cxx2
-rw-r--r--sc/source/ui/unoobj/unoguard.cxx2
-rw-r--r--sc/source/ui/unoobj/unoreflist.cxx2
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx140
-rw-r--r--sc/source/ui/unoobj/warnpassword.cxx2
-rw-r--r--sc/source/ui/vba/excelvbahelper.cxx169
-rw-r--r--sc/source/ui/vba/excelvbahelper.hxx39
-rw-r--r--sc/source/ui/vba/makefile.mk14
-rw-r--r--sc/source/ui/vba/service.cxx3
-rw-r--r--sc/source/ui/vba/testvba/testvba.cxx9
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx661
-rw-r--r--sc/source/ui/vba/vbaapplication.hxx23
-rw-r--r--sc/source/ui/vba/vbaassistant.cxx3
-rw-r--r--sc/source/ui/vba/vbaaxes.cxx2
-rw-r--r--sc/source/ui/vba/vbaaxis.cxx2
-rw-r--r--sc/source/ui/vba/vbaaxistitle.cxx2
-rw-r--r--sc/source/ui/vba/vbaborders.cxx3
-rw-r--r--sc/source/ui/vba/vbacharacters.cxx2
-rw-r--r--sc/source/ui/vba/vbachart.cxx2
-rw-r--r--sc/source/ui/vba/vbachartobject.cxx3
-rw-r--r--sc/source/ui/vba/vbachartobjects.cxx2
-rw-r--r--sc/source/ui/vba/vbacharts.cxx2
-rw-r--r--sc/source/ui/vba/vbacharttitle.cxx2
-rw-r--r--sc/source/ui/vba/vbacomment.cxx21
-rw-r--r--sc/source/ui/vba/vbacomments.cxx3
-rw-r--r--sc/source/ui/vba/vbacommentshape.cxx46
-rw-r--r--sc/source/ui/vba/vbacommentshape.hxx46
-rw-r--r--sc/source/ui/vba/vbacondition.cxx2
-rw-r--r--sc/source/ui/vba/vbadialog.cxx82
-rw-r--r--sc/source/ui/vba/vbadialog.hxx3
-rw-r--r--sc/source/ui/vba/vbadialogs.cxx10
-rw-r--r--sc/source/ui/vba/vbadialogs.hxx1
-rw-r--r--sc/source/ui/vba/vbaeventshelper.cxx13
-rw-r--r--sc/source/ui/vba/vbafiledialog.cxx183
-rw-r--r--sc/source/ui/vba/vbafiledialog.hxx60
-rw-r--r--sc/source/ui/vba/vbafiledialogselecteditems.cxx154
-rw-r--r--sc/source/ui/vba/vbafiledialogselecteditems.hxx87
-rw-r--r--sc/source/ui/vba/vbafilesearch.cxx242
-rw-r--r--sc/source/ui/vba/vbafilesearch.hxx77
-rw-r--r--sc/source/ui/vba/vbafont.cxx3
-rw-r--r--sc/source/ui/vba/vbaformat.cxx2
-rw-r--r--sc/source/ui/vba/vbaformatcondition.cxx3
-rw-r--r--sc/source/ui/vba/vbaformatconditions.cxx2
-rw-r--r--sc/source/ui/vba/vbafoundfiles.cxx143
-rw-r--r--sc/source/ui/vba/vbafoundfiles.hxx88
-rw-r--r--sc/source/ui/vba/vbaglobals.cxx8
-rw-r--r--sc/source/ui/vba/vbaglobals.hxx1
-rw-r--r--sc/source/ui/vba/vbahelper.cxx3
-rw-r--r--sc/source/ui/vba/vbahyperlink.cxx3
-rw-r--r--sc/source/ui/vba/vbahyperlinks.cxx3
-rw-r--r--sc/source/ui/vba/vbainterior.cxx2
-rw-r--r--sc/source/ui/vba/vbamenu.cxx84
-rw-r--r--sc/source/ui/vba/vbamenu.hxx54
-rw-r--r--sc/source/ui/vba/vbamenubar.cxx66
-rw-r--r--sc/source/ui/vba/vbamenubar.hxx50
-rw-r--r--sc/source/ui/vba/vbamenubars.cxx137
-rw-r--r--sc/source/ui/vba/vbamenubars.hxx61
-rw-r--r--sc/source/ui/vba/vbamenuitem.cxx82
-rw-r--r--sc/source/ui/vba/vbamenuitem.hxx55
-rw-r--r--sc/source/ui/vba/vbamenuitems.cxx150
-rw-r--r--sc/source/ui/vba/vbamenuitems.hxx60
-rw-r--r--sc/source/ui/vba/vbamenus.cxx136
-rw-r--r--sc/source/ui/vba/vbamenus.hxx60
-rw-r--r--sc/source/ui/vba/vbaname.cxx93
-rw-r--r--sc/source/ui/vba/vbaname.hxx4
-rw-r--r--sc/source/ui/vba/vbanames.cxx88
-rw-r--r--sc/source/ui/vba/vbaoleobject.cxx5
-rw-r--r--sc/source/ui/vba/vbaoleobjects.cxx3
-rw-r--r--sc/source/ui/vba/vbaoutline.cxx3
-rw-r--r--sc/source/ui/vba/vbapagebreak.cxx2
-rw-r--r--sc/source/ui/vba/vbapagebreaks.cxx28
-rw-r--r--sc/source/ui/vba/vbapagesetup.cxx107
-rw-r--r--sc/source/ui/vba/vbapagesetup.hxx2
-rw-r--r--sc/source/ui/vba/vbapalette.cxx3
-rw-r--r--sc/source/ui/vba/vbapane.cxx3
-rw-r--r--sc/source/ui/vba/vbapivotcache.cxx13
-rw-r--r--sc/source/ui/vba/vbapivotcache.hxx4
-rw-r--r--sc/source/ui/vba/vbapivottable.cxx3
-rw-r--r--sc/source/ui/vba/vbapivottables.cxx3
-rw-r--r--sc/source/ui/vba/vbapropvalue.cxx3
-rw-r--r--sc/source/ui/vba/vbaquerytable.cxx87
-rw-r--r--sc/source/ui/vba/vbaquerytable.hxx59
-rw-r--r--sc/source/ui/vba/vbarange.cxx1044
-rw-r--r--sc/source/ui/vba/vbarange.hxx16
-rw-r--r--sc/source/ui/vba/vbaseriescollection.cxx2
-rw-r--r--sc/source/ui/vba/vbasheetobject.cxx3
-rw-r--r--sc/source/ui/vba/vbasheetobjects.cxx3
-rw-r--r--sc/source/ui/vba/vbastyle.cxx3
-rw-r--r--sc/source/ui/vba/vbastyles.cxx3
-rw-r--r--sc/source/ui/vba/vbatextboxshape.cxx3
-rw-r--r--sc/source/ui/vba/vbatextframe.cxx3
-rw-r--r--sc/source/ui/vba/vbavalidation.cxx15
-rw-r--r--sc/source/ui/vba/vbawindow.cxx3
-rw-r--r--sc/source/ui/vba/vbawindows.cxx3
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx74
-rw-r--r--sc/source/ui/vba/vbaworkbook.hxx9
-rw-r--r--sc/source/ui/vba/vbaworkbooks.cxx3
-rw-r--r--sc/source/ui/vba/vbaworksheet.cxx123
-rw-r--r--sc/source/ui/vba/vbaworksheet.hxx7
-rw-r--r--sc/source/ui/vba/vbaworksheets.cxx3
-rw-r--r--sc/source/ui/vba/vbawsfunction.cxx69
-rw-r--r--sc/source/ui/view/auditsh.cxx2
-rw-r--r--sc/source/ui/view/cellmergeoption.cxx3
-rw-r--r--sc/source/ui/view/cellsh.cxx2
-rw-r--r--sc/source/ui/view/cellsh1.cxx3
-rw-r--r--sc/source/ui/view/cellsh2.cxx16
-rw-r--r--sc/source/ui/view/cellsh3.cxx2
-rw-r--r--sc/source/ui/view/cellsh4.cxx2
-rw-r--r--sc/source/ui/view/colrowba.cxx2
-rw-r--r--sc/source/ui/view/dbfunc.cxx2
-rw-r--r--sc/source/ui/view/dbfunc2.cxx2
-rw-r--r--sc/source/ui/view/dbfunc3.cxx3
-rw-r--r--sc/source/ui/view/dbfunc4.cxx2
-rw-r--r--sc/source/ui/view/drawattr.cxx2
-rw-r--r--sc/source/ui/view/drawutil.cxx2
-rw-r--r--sc/source/ui/view/drawvie2.cxx2
-rw-r--r--sc/source/ui/view/drawvie3.cxx2
-rw-r--r--sc/source/ui/view/drawvie4.cxx2
-rw-r--r--sc/source/ui/view/drawview.cxx3
-rw-r--r--sc/source/ui/view/editsh.cxx2
-rw-r--r--sc/source/ui/view/formatsh.cxx3
-rw-r--r--sc/source/ui/view/galwrap.cxx2
-rw-r--r--sc/source/ui/view/gridmerg.cxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx3
-rw-r--r--sc/source/ui/view/gridwin2.cxx19
-rw-r--r--sc/source/ui/view/gridwin3.cxx2
-rw-r--r--sc/source/ui/view/gridwin4.cxx15
-rw-r--r--sc/source/ui/view/gridwin5.cxx5
-rw-r--r--sc/source/ui/view/hdrcont.cxx2
-rw-r--r--sc/source/ui/view/hintwin.cxx3
-rw-r--r--sc/source/ui/view/imapwrap.cxx2
-rw-r--r--sc/source/ui/view/invmerge.cxx2
-rw-r--r--sc/source/ui/view/notemark.cxx2
-rw-r--r--sc/source/ui/view/olinewin.cxx2
-rw-r--r--sc/source/ui/view/olkact.cxx2
-rw-r--r--sc/source/ui/view/output.cxx2
-rw-r--r--sc/source/ui/view/output2.cxx24
-rw-r--r--sc/source/ui/view/output3.cxx2
-rw-r--r--sc/source/ui/view/overlayobject.cxx3
-rw-r--r--sc/source/ui/view/pfuncache.cxx2
-rw-r--r--sc/source/ui/view/pgbrksh.cxx2
-rw-r--r--sc/source/ui/view/pivotsh.cxx2
-rw-r--r--sc/source/ui/view/preview.cxx3
-rw-r--r--sc/source/ui/view/prevloc.cxx2
-rw-r--r--sc/source/ui/view/prevwsh.cxx2
-rw-r--r--sc/source/ui/view/prevwsh2.cxx2
-rw-r--r--sc/source/ui/view/printfun.cxx2
-rw-r--r--sc/source/ui/view/reffact.cxx3
-rw-r--r--sc/source/ui/view/scextopt.cxx2
-rw-r--r--sc/source/ui/view/select.cxx2
-rw-r--r--sc/source/ui/view/selectionstate.cxx2
-rw-r--r--sc/source/ui/view/spelldialog.cxx2
-rw-r--r--sc/source/ui/view/spelleng.cxx2
-rw-r--r--sc/source/ui/view/tabcont.cxx19
-rw-r--r--sc/source/ui/view/tabpopsh.cxx3
-rw-r--r--sc/source/ui/view/tabsplit.cxx2
-rw-r--r--sc/source/ui/view/tabview.cxx2
-rw-r--r--sc/source/ui/view/tabview2.cxx2
-rw-r--r--sc/source/ui/view/tabview3.cxx12
-rw-r--r--sc/source/ui/view/tabview4.cxx2
-rw-r--r--sc/source/ui/view/tabview5.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh.cxx3
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx9
-rw-r--r--sc/source/ui/view/tabvwsh5.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh8.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh9.cxx2
-rw-r--r--sc/source/ui/view/tabvwsha.cxx2
-rw-r--r--sc/source/ui/view/tabvwshb.cxx2
-rw-r--r--sc/source/ui/view/tabvwshc.cxx2
-rw-r--r--sc/source/ui/view/tabvwshd.cxx2
-rw-r--r--sc/source/ui/view/tabvwshe.cxx2
-rw-r--r--sc/source/ui/view/tabvwshf.cxx2
-rw-r--r--sc/source/ui/view/tabvwshg.cxx2
-rw-r--r--sc/source/ui/view/tabvwshh.cxx2
-rw-r--r--sc/source/ui/view/viewdata.cxx3
-rw-r--r--sc/source/ui/view/viewfun2.cxx61
-rw-r--r--sc/source/ui/view/viewfun3.cxx152
-rw-r--r--sc/source/ui/view/viewfun4.cxx2
-rw-r--r--sc/source/ui/view/viewfun5.cxx2
-rw-r--r--sc/source/ui/view/viewfun6.cxx3
-rw-r--r--sc/source/ui/view/viewfun7.cxx2
-rw-r--r--sc/source/ui/view/viewfunc.cxx2
-rw-r--r--sc/source/ui/view/viewutil.cxx2
-rw-r--r--sc/source/ui/view/waitoff.cxx2
453 files changed, 7222 insertions, 621 deletions
diff --git a/sc/source/ui/Accessibility/AccessibilityHints.cxx b/sc/source/ui/Accessibility/AccessibilityHints.cxx
index 6c276b806e88..d0b9d3192da6 100644
--- a/sc/source/ui/Accessibility/AccessibilityHints.cxx
+++ b/sc/source/ui/Accessibility/AccessibilityHints.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110,3 +111,5 @@ ScAccGridWinFocusGotHint::ScAccGridWinFocusGotHint(ScSplitPos eNew,
ScAccGridWinFocusGotHint::~ScAccGridWinFocusGotHint()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx
index a49ae24a970a..9d16743c4057 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -451,3 +452,5 @@ void ScAccessibleCell::AddRelation(const ScRange& rRange,
pRelationSet->AddRelation(aRelation);
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
index 800b398710ae..75a853433d69 100644
--- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -337,3 +338,5 @@ sal_Bool ScAccessibleCellBase::IsEditable(
bEditable = sal_True;
return bEditable;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
index 1d1ad0a50550..c5a79d90604d 100644
--- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -622,3 +623,4 @@ void ScAccessibleContextBase::IsObjectValid() const
throw lang::DisposedException();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
index b6a48ca53316..6a279f61d281 100644
--- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1672,3 +1673,4 @@ Rectangle ScAccessibleCsvCell::implGetBoundingBox() const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
index 2063eac08663..51cadd4aed98 100644
--- a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -731,3 +732,5 @@ Rectangle ScAccessibleDataPilotButton::GetBoundingBox(void) const
else
return Rectangle();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index b2772cfbb92a..e27e135499b2 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2110,3 +2111,5 @@ rtl::OUString ScAccessibleDocument::GetCurrentCellDescription() const
{
return rtl::OUString();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx b/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx
index 179e8ab2278a..6c48fbffb388 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,3 +48,5 @@ ScAccessibleDocumentBase::ScAccessibleDocumentBase(
ScAccessibleDocumentBase::~ScAccessibleDocumentBase(void)
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index c3caf93b007d..9f2f0cab1749 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1886,3 +1887,5 @@ ScShapeChilds* ScAccessibleDocumentPagePreview::GetShapeChilds()
return mpShapeChilds;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
index 04df409a76bb..e91abb2524e9 100644
--- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx
+++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -350,3 +351,4 @@ void ScAccessibleEditObject::CreateTextHelper()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
index 02fb5c12463e..89dd008480a7 100644
--- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
+++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -396,3 +397,5 @@ void ScAccessibleFilterMenu::updateStates()
if (isSelected())
p->insert(SELECTED);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx
index 0da1e6858a75..1c70ee6ba5c5 100644
--- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx
+++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -203,3 +204,4 @@ void ScAccessibleFilterMenuItem::updateStateSet()
p->insert(SELECTED);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx
index 2af69faa33c8..fb649eba5f4f 100644
--- a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx
+++ b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125,3 +126,4 @@ void ScAccessibleFilterTopWindow::setAccessibleChild(
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleGlobal.cxx b/sc/source/ui/Accessibility/AccessibleGlobal.cxx
index ac2562fa9bd5..2ddc53694c89 100644
--- a/sc/source/ui/Accessibility/AccessibleGlobal.cxx
+++ b/sc/source/ui/Accessibility/AccessibleGlobal.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,4 @@ void ScAccessibleStateSet::clear()
maStates.clear();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
index 51b8688e1a34..9912f3180aac 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -437,3 +438,5 @@ void ScAccessiblePageHeader::AddChild(const EditTextObject* pArea, sal_uInt32 nI
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
index a0e3b8af102a..e4849bd5e8f3 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -322,3 +323,5 @@ void ScAccessiblePageHeaderArea::CreateTextHelper()
mpTextHelper->SetEventSource(this);
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
index c07eb0844b7f..5ab74a176339 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -314,3 +315,4 @@ void ScAccessiblePreviewCell::CreateTextHelper()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index 1d91b7ebb2ae..b71bbf92936a 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -439,3 +440,5 @@ void ScAccessiblePreviewHeaderCell::FillTableInfo() const
mpViewShell->GetLocationData().GetTableInfo( aVisRect, *mpTableInfo );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index a720085f8d93..8a8167d95fed 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -765,3 +766,4 @@ void ScAccessiblePreviewTable::FillTableInfo() const
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index b10cfa1de06f..106d68ec4a43 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -991,3 +992,5 @@ Rectangle ScAccessibleSpreadsheet::GetVisCells(const Rectangle& rVisArea)
else
return Rectangle();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
index 4f4b2b7304bd..48b04220d834 100644
--- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -489,3 +490,5 @@ void ScAccessibleTableBase::CommitTableModelChange(sal_Int32 nStartRow, sal_Int3
CommitChange(aEvent);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 26a98b6cdacc..0ee57b63deb2 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1841,3 +1842,5 @@ SvxEditViewForwarder* ScAccessibleCsvTextData::GetEditViewForwarder( sal_Bool /*
{
return NULL;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
index 31bf438772d0..053d0c11dd94 100644
--- a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
+++ b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,3 +91,5 @@ void ScDrawModelBroadcaster::Notify( SfxBroadcaster&,
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index b1cb325ceb69..1553f37cc05c 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -254,3 +255,4 @@ void __EXPORT ScClient::MakeVisible()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index b256233d7394..0a987024cf54 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -802,3 +803,4 @@ sal_Int64 SAL_CALL ScDrawTransferObj::getSomething( const com::sun::star::uno::S
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 8e4bf74976a3..bf4707ae137f 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -3844,3 +3845,4 @@ ScInputHdlState& ScInputHdlState::operator=( const ScInputHdlState& r )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 8f0465d7d7c7..e2c865e7d5b9 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1808,3 +1809,4 @@ void ScPosWnd::ReleaseFocus_Impl()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/lnktrans.cxx b/sc/source/ui/app/lnktrans.cxx
index 2e0f5d276a97..055f8da1a828 100644
--- a/sc/source/ui/app/lnktrans.cxx
+++ b/sc/source/ui/app/lnktrans.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -95,3 +96,4 @@ void ScLinkTransferObj::DragFinished( sal_Int8 nDropAction )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/msgpool.cxx b/sc/source/ui/app/msgpool.cxx
index 78cb70fa64f0..0de23989202f 100644
--- a/sc/source/ui/app/msgpool.cxx
+++ b/sc/source/ui/app/msgpool.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121,3 +122,4 @@ SfxMapUnit __EXPORT ScMessagePool::GetMetric( USHORT nWhich ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/rfindlst.cxx b/sc/source/ui/app/rfindlst.cxx
index 3d62c0396b51..8f2526197787 100644
--- a/sc/source/ui/app/rfindlst.cxx
+++ b/sc/source/ui/app/rfindlst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,3 +66,4 @@ ColorData ScRangeFindList::GetColorName( USHORT nIndex ) // static
//==================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index ebc5a14687a7..8cd7a4e74686 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -344,3 +345,5 @@ void ScDLL::Exit()
// DetectFilter functionality has moved - please update your bookmarks
// see sc/source/ui/unoobj/scdetect.cxx, have a nice day.
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 0c1957fdcf18..66b9fade4d8f 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2285,3 +2286,4 @@ Window * ScModule::Find1RefWindow( Window *pWndAncestor )
return NULL;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/scmod2.cxx b/sc/source/ui/app/scmod2.cxx
index c92f0bf5d206..246d204038ae 100644
--- a/sc/source/ui/app/scmod2.cxx
+++ b/sc/source/ui/app/scmod2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,3 +106,4 @@ BOOL ScModule::HasThesaurusLanguage( USHORT nLang )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index 0b213709863d..1866008f6782 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -447,3 +448,4 @@ void ScSelectionTransferObj::ObjectReleased()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/template.cxx b/sc/source/ui/app/template.cxx
index 80dc667c5de6..edb30ff6468d 100644
--- a/sc/source/ui/app/template.cxx
+++ b/sc/source/ui/app/template.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,3 +78,4 @@ void ScTemplateDlg::ToggleApplyTemplate()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 537f464ed045..00585e8e5051 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -866,3 +867,4 @@ sal_Int64 SAL_CALL ScTransferObj::getSomething( const com::sun::star::uno::Seque
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/typemap.cxx b/sc/source/ui/app/typemap.cxx
index 253560ca010c..10c35fde833f 100644
--- a/sc/source/ui/app/typemap.cxx
+++ b/sc/source/ui/app/typemap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -134,3 +135,5 @@
#define SFX_TYPEMAP
#include "scslots.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/uiitems.cxx b/sc/source/ui/app/uiitems.cxx
index 3cd83ed42c03..4148b96675c6 100644
--- a/sc/source/ui/app/uiitems.cxx
+++ b/sc/source/ui/app/uiitems.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -719,3 +720,5 @@ SfxPoolItem* __EXPORT ScCondFrmtItem::Clone( SfxItemPool * ) const
{
return new ScCondFrmtItem( *this );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/wtcdummy.cxx b/sc/source/ui/app/wtcdummy.cxx
index a755830cbd71..055a37a644f4 100644
--- a/sc/source/ui/app/wtcdummy.cxx
+++ b/sc/source/ui/app/wtcdummy.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,3 +64,5 @@ SdbRow::~SdbRow()
{
DBG_ERROR("WATCOM Hack failed !");
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index c9f70fb91285..8ff3c4cdb573 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -143,3 +144,4 @@ IMPL_LINK( ScAttrDlg, OkHandler, void*, EMPTYARG )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/condfrmt.cxx b/sc/source/ui/attrdlg/condfrmt.cxx
index 5e3b23af8afa..dbdad9aace69 100644
--- a/sc/source/ui/attrdlg/condfrmt.cxx
+++ b/sc/source/ui/attrdlg/condfrmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -827,3 +828,4 @@ IMPL_LINK( ScConditionalFormatDlg, NewBtnHdl, PushButton*, pBtn )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/scabstdlg.cxx b/sc/source/ui/attrdlg/scabstdlg.cxx
index b50435041409..23af73743aa9 100644
--- a/sc/source/ui/attrdlg/scabstdlg.cxx
+++ b/sc/source/ui/attrdlg/scabstdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,3 +55,5 @@ ScAbstractDialogFactory* ScAbstractDialogFactory::Create()
return fp();
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index bb1325e0280f..b4035b187197 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,6 +81,7 @@
#include "tpusrlst.hxx" //add for ScTpUserLists
#include "tpview.hxx" //add for ScTpContentOptions
#include "tpformula.hxx"
+#include "datafdlg.hxx" //add for ScDataFormDlg
#include "tpcompatibility.hxx"
// ause
@@ -94,6 +96,8 @@ IMPL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl); //add for ScDataPilotDat
IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl); //add for ScDataPilotSourceTypeDlg
IMPL_ABSTDLG_BASE(AbstractScDataPilotServiceDlg_Impl); //add for ScDataPilotServiceDlg
IMPL_ABSTDLG_BASE(AbstractScDeleteCellDlg_Impl); //add for ScDeleteCellDlg
+//for dataform
+IMPL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl); //add for ScDataFormDlg
IMPL_ABSTDLG_BASE(AbstractScDeleteContentsDlg_Impl); //add for ScDeleteContentsDlg
IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl); //add for ScFillSeriesDlg
IMPL_ABSTDLG_BASE(AbstractScGroupDlg_Impl); //add for ScGroupDlg
@@ -865,6 +869,26 @@ AbstractScDeleteCellDlg* ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg( Wi
//add for ScDeleteCellDlg end
+//add for ScDataFormDlg begin
+AbstractScDataFormDlg* ScAbstractDialogFactory_Impl::CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell )
+{
+ ScDataFormDlg * pDlg=NULL;
+ switch ( nId )
+ {
+ case RID_SCDLG_DATAFORM :
+ pDlg = new ScDataFormDlg( pParent, pTabViewShell);
+ break;
+ default:
+ break;
+ }
+
+ if ( pDlg )
+ return new AbstractScDataFormDlg_Impl( pDlg );
+ return 0;
+}
+
+//add for ScDataFormDlg end
+
//add for ScDeleteContentsDlg begin
AbstractScDeleteContentsDlg* ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg
USHORT nCheckDefaults )
@@ -1604,3 +1628,4 @@ void ScDPFunctionDlg_Dummy()
ScDPListBoxWrapper aWrapper( *pListBox );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index d0d3d0879e5f..4770923ea6d1 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -37,6 +37,7 @@ class ScDataPilotDatabaseDlg;
class ScDataPilotSourceTypeDlg;
class ScDataPilotServiceDlg;
class ScDeleteCellDlg;
+class ScDataFormDlg;
class ScDeleteContentsDlg;
class ScFillSeriesDlg;
class ScGroupDlg;
@@ -163,6 +164,12 @@ class AbstractScDeleteCellDlg_Impl : public AbstractScDeleteCellDlg //add for S
virtual DelCellCmd GetDelCellCmd() const;
};
+//for dataform
+class AbstractScDataFormDlg_Impl : public AbstractScDataFormDlg //add for ScDataFormDlg
+{
+ DECL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl,ScDataFormDlg);
+};
+
class AbstractScDeleteContentsDlg_Impl : public AbstractScDeleteContentsDlg //add for ScDeleteContentsDlg
{
DECL_ABSTDLG_BASE( AbstractScDeleteContentsDlg_Impl,ScDeleteContentsDlg)
@@ -424,6 +431,9 @@ public:
virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId,
BOOL bDisallowCellMove = FALSE ); //add for ScDeleteCellDlg
+ //for dataform
+ virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell); //add for ScDeleteCellDlg
+
virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg
USHORT nCheckDefaults = 0 );
diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx
index 35a0a3a1fb35..41ed3cdf9502 100644
--- a/sc/source/ui/attrdlg/scuiexp.cxx
+++ b/sc/source/ui/attrdlg/scuiexp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,5 @@ extern "C"
return ::scui::GetFactory();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx
index 21c769cf0603..84298f174211 100644
--- a/sc/source/ui/attrdlg/tabpages.cxx
+++ b/sc/source/ui/attrdlg/tabpages.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -248,3 +249,5 @@ void ScTabPageProtection::UpdateButtons()
aBtnHideFormula.Enable( bEnable );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx
index 6004fdfcfc51..4634b179664a 100644
--- a/sc/source/ui/cctrl/cbuttonw.cxx
+++ b/sc/source/ui/cctrl/cbuttonw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -176,3 +177,4 @@ void ScDDComboBoxButton::ImpDrawArrow( const Rectangle& rRect,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 82c276d98f2c..c49b54ee9835 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,7 +67,8 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt
mbBaseButton(true),
mbPopupButton(false),
mbHasHiddenMember(false),
- mbPopupPressed(false)
+ mbPopupPressed(false),
+ mbPopupLeft(false)
{
if (pZoomX)
maZoomX = *pZoomX;
@@ -88,10 +90,15 @@ void ScDPFieldButton::setText(const OUString& rText)
maText = rText;
}
-void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize)
+void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize, bool bLayoutRTL)
{
maPos = rPos;
maSize = rSize;
+ if (bLayoutRTL)
+ {
+ // rPos is the logical-left position, adjust maPos to visual-left (inside the cell border)
+ maPos.X() -= maSize.Width() - 1;
+ }
}
void ScDPFieldButton::setDrawBaseButton(bool b)
@@ -114,6 +121,11 @@ void ScDPFieldButton::setPopupPressed(bool b)
mbPopupPressed = b;
}
+void ScDPFieldButton::setPopupLeft(bool b)
+{
+ mbPopupLeft = b;
+}
+
void ScDPFieldButton::draw()
{
const long nMargin = 2;
@@ -179,7 +191,12 @@ void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const
if (nH > 18)
nH = 18;
- rPos.setX(maPos.getX() + maSize.getWidth() - nW);
+ // #i114944# AutoFilter button is left-aligned in RTL.
+ // DataPilot button is always right-aligned for now, so text output isn't affected.
+ if (mbPopupLeft)
+ rPos.setX(maPos.getX());
+ else
+ rPos.setX(maPos.getX() + maSize.getWidth() - nW);
rPos.setY(maPos.getY() + maSize.getHeight() - nH);
rSize.setWidth(nW);
rSize.setHeight(nH);
@@ -1404,3 +1421,4 @@ void ScDPFieldPopupWindow::setOKAction(Action* p)
mpOKAction.reset(p);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/editfield.cxx b/sc/source/ui/cctrl/editfield.cxx
index 4358694f6b04..d52ccefea685 100644
--- a/sc/source/ui/cctrl/editfield.cxx
+++ b/sc/source/ui/cctrl/editfield.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,3 +83,4 @@ void ScDoubleField::SetValue( double fValue, sal_Int32 nDecPlaces, bool bEraseTr
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/popmenu.cxx b/sc/source/ui/cctrl/popmenu.cxx
index 6510fff87ead..742104ea517f 100644
--- a/sc/source/ui/cctrl/popmenu.cxx
+++ b/sc/source/ui/cctrl/popmenu.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,4 @@ void __EXPORT ScPopupMenu::Select()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/tbinsert.cxx b/sc/source/ui/cctrl/tbinsert.cxx
index e27baecec115..6c439fd94693 100644
--- a/sc/source/ui/cctrl/tbinsert.cxx
+++ b/sc/source/ui/cctrl/tbinsert.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -230,3 +231,4 @@ void __EXPORT ScTbxInsertPopup::PopupModeEnd()
*/
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 220a135d9a2e..9fe3acc0af73 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -528,3 +529,5 @@ void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ )
}
// -----------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index a22953ade25b..157d6c4d2e4c 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -478,3 +479,4 @@ void ScAsciiOptions::InterpretColumnList( const String& rString )
}
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index e094149ab99b..7e2bafd2c42b 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -653,3 +654,4 @@ USHORT ScConsolidateDlg::FuncToLbPos( ScSubTotalFunc eFunc )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/csvcontrol.cxx b/sc/source/ui/dbgui/csvcontrol.cxx
index 0dbc4e7dab39..3455fa72c1fd 100644
--- a/sc/source/ui/dbgui/csvcontrol.cxx
+++ b/sc/source/ui/dbgui/csvcontrol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -335,3 +336,4 @@ ScCsvControl::XAccessibleRef ScCsvControl::CreateAccessible()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index d271022a987c..a18bbb7e2607 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1353,3 +1354,4 @@ ScAccessibleCsvControl* ScCsvGrid::ImplCreateAccessible()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index 56aa2a50a835..84d5ad6bee1b 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -680,3 +681,4 @@ ScAccessibleCsvControl* ScCsvRuler::ImplCreateAccessible()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/csvsplits.cxx b/sc/source/ui/dbgui/csvsplits.cxx
index b93bb09b5151..5215f3f9a799 100644
--- a/sc/source/ui/dbgui/csvsplits.cxx
+++ b/sc/source/ui/dbgui/csvsplits.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118,3 +119,4 @@ sal_uInt32 ScCsvSplits::GetIterIndex( const_iterator aIter ) const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx
index e6a900845eef..e7d3071da1f3 100644
--- a/sc/source/ui/dbgui/csvtablebox.cxx
+++ b/sc/source/ui/dbgui/csvtablebox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -432,3 +433,4 @@ ScAccessibleCsvControl* ScCsvTableBox::ImplCreateAccessible()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx
index 976e0ae23039..ab2159af2f93 100644
--- a/sc/source/ui/dbgui/dapidata.cxx
+++ b/sc/source/ui/dbgui/dapidata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -227,3 +228,4 @@ void ScDataPilotDatabaseDlg::FillObjects()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx
index 31aafbcb13da..b9ca10fef09e 100644
--- a/sc/source/ui/dbgui/dapitype.cxx
+++ b/sc/source/ui/dbgui/dapitype.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -140,3 +141,4 @@ String ScDataPilotServiceDlg::GetParPass() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index a2f4d61af537..1782e4245b1d 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -719,3 +720,4 @@ IMPL_LINK( ScDbNameDlg, AssModifyHdl, void *, EMPTYARG )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/dpgroupdlg.cxx b/sc/source/ui/dbgui/dpgroupdlg.cxx
index 2e3da92fbd05..e665b215c0e9 100644
--- a/sc/source/ui/dbgui/dpgroupdlg.cxx
+++ b/sc/source/ui/dbgui/dpgroupdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -354,3 +355,4 @@ IMPL_LINK( ScDPDateGroupDlg, CheckHdl, SvxCheckListBox*, pListBox )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/expftext.cxx b/sc/source/ui/dbgui/expftext.cxx
index 405a18fcc004..b05d9c193638 100644
--- a/sc/source/ui/dbgui/expftext.cxx
+++ b/sc/source/ui/dbgui/expftext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,4 @@ void ScExpandedFixedText::RequestHelp(const HelpEvent& rEvt)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index d4b477cd4b33..8c181959f049 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -774,3 +775,4 @@ String ScDPFieldWindow::GetDescription() const
//===================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 8ca95f70441e..02188e367f0c 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1184,3 +1185,5 @@ void ScFilterDlg::RefreshEditRow( USHORT nOffset )
UpdateValueList( static_cast<USHORT>(i+1) );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index 1e274690c31c..d6b331494667 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -335,3 +336,5 @@ IMPL_LINK( ScFilterOptionsMgr, BtnCopyResultHdl, CheckBox*, pBox )
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index bd18008afd47..641ce7dc6374 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -88,3 +89,5 @@ void ScImportOptions::SetTextEncoding( rtl_TextEncoding nEnc )
gsl_getSystemTextEncoding() : nEnc);
aStrFont = ScGlobal::GetCharsetString( nEnc );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index d590ffb83457..dfbf7e8989fa 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -618,3 +619,4 @@ IMPL_LINK( ScPivotFilterDlg, ValModifyHdl, ComboBox*, pEd )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index daa549688f21..4e834fb95935 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -854,3 +855,4 @@ IMPL_LINK( ScDPShowDetailDlg, DblClickHdl, ListBox*, pLBox )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 2d3ae285c45f..3b26d1c836f6 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1867,3 +1868,4 @@ IMPL_LINK( ScDPLayoutDlg, GetFocusHdl, Control*, pCtrl )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index 58e153387e09..916bb0db8a34 100644
--- a/sc/source/ui/dbgui/scendlg.cxx
+++ b/sc/source/ui/dbgui/scendlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -241,3 +242,4 @@ IMPL_LINK( ScNewScenarioDlg, EnableHdl, CheckBox *, pBox )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index e29e33e8fd64..67817a140af2 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -721,3 +722,5 @@ IMPL_LINK( ScImportAsciiDlg, ColTypeHdl, ScCsvTableBox*, pTableBox )
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index 5440f515c86a..547983af83fe 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -314,3 +315,5 @@ IMPL_LINK( ScImportOptionsDlg, FixedWidthHdl, CheckBox*, pCheckBox )
}
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index f70fbb094c92..d66ff75d7530 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -528,3 +529,4 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit*, pEd )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/sortdlg.cxx b/sc/source/ui/dbgui/sortdlg.cxx
index f2a733af3aa8..0fbbe991e327 100644
--- a/sc/source/ui/dbgui/sortdlg.cxx
+++ b/sc/source/ui/dbgui/sortdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,3 +106,5 @@ IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn )
return 0;
}
//========================================================================//
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/subtdlg.cxx b/sc/source/ui/dbgui/subtdlg.cxx
index 2c9cba31cd13..172e887cf51e 100644
--- a/sc/source/ui/dbgui/subtdlg.cxx
+++ b/sc/source/ui/dbgui/subtdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,4 @@ IMPL_LINK_INLINE_START( ScSubTotalDlg, RemoveHdl, PushButton *, pBtn )
}
IMPL_LINK_INLINE_END( ScSubTotalDlg, RemoveHdl, PushButton *, pBtn )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/textimportoptions.cxx b/sc/source/ui/dbgui/textimportoptions.cxx
index be918d2a0fbd..99253d6cc5a1 100644
--- a/sc/source/ui/dbgui/textimportoptions.cxx
+++ b/sc/source/ui/dbgui/textimportoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,3 +120,4 @@ IMPL_LINK( ScTextImportOptionsDlg, RadioHdl, RadioButton*, pBtn )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 37a7dab398a4..7a54da38da03 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1081,3 +1082,4 @@ IMPL_LINK( ScTabPageSortOptions, FillAlgorHdl, void *, EMPTYARG )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index fbada165b55d..b4d6519d3388 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -684,3 +685,4 @@ __EXPORT ScTpSubTotalGroup3::~ScTpSubTotalGroup3()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 7626a95971ca..6eed9ab7fee0 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -993,3 +994,5 @@ bool ScValidationDlg::IsAlive()
{
return SC_MOD()->IsAliveRefDlg( SLOTID, this );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index bed1622b0a2a..69a62985e02f 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -527,3 +528,4 @@ IMPL_LINK( ScAreaLink, AreaEndEditHdl, void*, EMPTYARG )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx
index 61683e169f02..511d7695c471 100644
--- a/sc/source/ui/docshell/autostyl.cxx
+++ b/sc/source/ui/docshell/autostyl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -242,3 +243,4 @@ IMPL_LINK( ScAutoStyleList, TimerHdl, Timer*, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index c7a2f838e087..4a5f68b3e658 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1500,3 +1501,4 @@ void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index dee7438bc07f..8400f1ad8b6f 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -721,3 +722,4 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 57b2245ad9ce..4ee20c186299 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,6 +110,7 @@ using namespace com::sun::star;
using ::com::sun::star::uno::Sequence;
using ::std::vector;
+
// STATIC DATA -----------------------------------------------------------
//========================================================================
@@ -4188,6 +4190,13 @@ BOOL ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
FillDir eDir, ULONG nCount, BOOL bRecord, BOOL bApi )
{
+ double fStep = 1.0;
+ double fMax = MAXDOUBLE;
+ return FillAuto( rRange, pTabMark, eDir, FILL_AUTO, FILL_DAY, nCount, fStep, fMax, bRecord, bApi );
+}
+
+BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, ULONG nCount, double fStep, double fMax, BOOL bRecord, BOOL bApi )
+{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
@@ -4213,10 +4222,6 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
ScRange aSourceArea = rRange;
ScRange aDestArea = rRange;
- FillCmd eCmd = FILL_AUTO;
- FillDateCmd eDateCmd = FILL_DAY;
- double fStep = 1.0;
- double fMax = MAXDOUBLE;
switch (eDir)
{
@@ -4948,3 +4953,4 @@ BOOL ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 205fa3148b39..902a1994f3b4 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -178,7 +179,6 @@ static const sal_Char __FAR_DATA pFilterExcel95[] = "MS Excel 95";
static const sal_Char __FAR_DATA pFilterEx95Temp[] = "MS Excel 95 Vorlage/Template";
static const sal_Char __FAR_DATA pFilterExcel97[] = "MS Excel 97";
static const sal_Char __FAR_DATA pFilterEx97Temp[] = "MS Excel 97 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterEx07Xml[] = "MS Excel 2007 XML";
static const sal_Char __FAR_DATA pFilterDBase[] = "dBase";
static const sal_Char __FAR_DATA pFilterDif[] = "DIF";
static const sal_Char __FAR_DATA pFilterSylk[] = "SYLK";
@@ -2097,8 +2097,7 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
}
else if (aFltName.EqualsAscii(pFilterExcel5) || aFltName.EqualsAscii(pFilterExcel95) ||
aFltName.EqualsAscii(pFilterExcel97) || aFltName.EqualsAscii(pFilterEx5Temp) ||
- aFltName.EqualsAscii(pFilterEx95Temp) || aFltName.EqualsAscii(pFilterEx97Temp) ||
- aFltName.EqualsAscii(pFilterEx07Xml))
+ aFltName.EqualsAscii(pFilterEx95Temp) || aFltName.EqualsAscii(pFilterEx97Temp))
{
WaitObject aWait( GetActiveDialogParent() );
@@ -2140,8 +2139,6 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
ExportFormatExcel eFormat = ExpBiff5;
if( aFltName.EqualsAscii( pFilterExcel97 ) || aFltName.EqualsAscii( pFilterEx97Temp ) )
eFormat = ExpBiff8;
- if( aFltName.EqualsAscii( pFilterEx07Xml ) )
- eFormat = Exp2007Xml;
FltError eError = ScFormatFilter::Get().ScExportExcel5( rMed, &aDocument, eFormat, RTL_TEXTENCODING_MS_1252 );
if( eError && !GetError() )
@@ -3080,3 +3077,5 @@ bool ScDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 14ff7622818c..d8a7311a6c94 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -261,3 +262,5 @@ ScDrawLayer* ScDocShell::MakeDrawLayer()
}
return pDrawLayer;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 233843935bbd..8e0719ad328b 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1407,3 +1408,5 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
return ( pThisAction != NULL );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index ba4553fd8826..bc9681e2aaeb 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2713,3 +2714,5 @@ uno::Reference< frame::XModel > ScDocShell::LoadSharedDocument()
}
return xModel;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 9510c91e3290..e852ca29a948 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -853,6 +854,47 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const String& rName, const String& r
return nTab;
}
+ULONG ScDocShell::TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos,
+ SCTAB nDestPos, BOOL bInsertNew,
+ BOOL bNotifyAndPaint )
+{
+ ScDocument* pSrcDoc = rSrcDocShell.GetDocument();
+
+ ULONG nErrVal = aDocument.TransferTab( pSrcDoc, nSrcPos, nDestPos,
+ bInsertNew ); // no insert
+
+ // TransferTab doesn't copy drawing objects with bInsertNew=FALSE
+ if ( nErrVal > 0 && !bInsertNew)
+ aDocument.TransferDrawPage( pSrcDoc, nSrcPos, nDestPos );
+
+ if(nErrVal>0 && pSrcDoc->IsScenario( nSrcPos ))
+ {
+ String aComment;
+ Color aColor;
+ USHORT nFlags;
+
+ pSrcDoc->GetScenarioData( nSrcPos, aComment,aColor, nFlags);
+ aDocument.SetScenario(nDestPos,TRUE);
+ aDocument.SetScenarioData(nDestPos,aComment,aColor,nFlags);
+ BOOL bActive = pSrcDoc->IsActiveScenario(nSrcPos);
+ aDocument.SetActiveScenario(nDestPos, bActive );
+
+ BOOL bVisible=pSrcDoc->IsVisible(nSrcPos);
+ aDocument.SetVisible(nDestPos,bVisible );
+
+ }
+
+ if ( nErrVal > 0 && pSrcDoc->IsTabProtected( nSrcPos ) )
+ aDocument.SetTabProtection(nDestPos, pSrcDoc->GetTabProtection(nSrcPos));
+ if ( bNotifyAndPaint )
+ {
+ Broadcast( ScTablesHint( SC_TAB_INSERTED, nDestPos ) );
+ PostPaintExtras();
+ PostPaintGridAll();
+ }
+ return nErrVal;
+}
+
BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRecord )
{
ScDocShellModificator aModificator( *this );
@@ -989,3 +1031,4 @@ IMPL_LINK( ScDocShell, RefreshDBDataHdl, ScRefreshTimer*, pRefreshTimer )
return bContinue != 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index d735a359f0a2..60f75c885a83 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -538,3 +539,4 @@ void ScDocShell::CheckConfigOptions()
SetConfigOptionsChecked(true);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh7.cxx b/sc/source/ui/docshell/docsh7.cxx
index 89f082672b29..85ca951be483 100644
--- a/sc/source/ui/docshell/docsh7.cxx
+++ b/sc/source/ui/docshell/docsh7.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,4 @@ void ScDocShell::GetDrawObjState( SfxItemSet & /* rSet */ )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 8ef15badde9c..1e94a7f3b2e4 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1180,3 +1181,4 @@ ULONG ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet, BO
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/editable.cxx b/sc/source/ui/docshell/editable.cxx
index d381ff067a99..24cae921fddf 100644
--- a/sc/source/ui/docshell/editable.cxx
+++ b/sc/source/ui/docshell/editable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -160,3 +161,4 @@ USHORT ScEditableTester::GetMessageId() const
return STR_PROTECTIONERR;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 68f0b277717a..c0fc2fbfa215 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2551,3 +2552,4 @@ IMPL_LINK(ScExternalRefManager, TimeOutHdl, AutoTimer*, pTimer)
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/hiranges.cxx b/sc/source/ui/docshell/hiranges.cxx
index af1226216a06..0ad4c4e3e5d8 100644
--- a/sc/source/ui/docshell/hiranges.cxx
+++ b/sc/source/ui/docshell/hiranges.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,3 +52,4 @@ ScHighlightRanges::~ScHighlightRanges()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 9d57734dd2fb..b3c202d4bc40 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2111,3 +2112,5 @@ ScFormatFilterPlugin &ScFormatFilter::Get()
return *plugin;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/macromgr.cxx b/sc/source/ui/docshell/macromgr.cxx
new file mode 100644
index 000000000000..3adb03ddb42c
--- /dev/null
+++ b/sc/source/ui/docshell/macromgr.cxx
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sc.hxx"
+
+// INCLUDE ---------------------------------------------------------------
+
+#include "macromgr.hxx"
+#include "document.hxx"
+
+#include "basic/basmgr.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "sfx2/objsh.hxx"
+#include "cell.hxx"
+#include <com/sun/star/container/XContainer.hpp>
+
+#include <list>
+
+using namespace ::com::sun::star;
+using ::com::sun::star::uno::RuntimeException;
+using ::com::sun::star::uno::Reference;
+using ::rtl::OUString;
+using ::rtl::OUStringHash;
+using ::std::hash_map;
+using ::std::list;
+using ::std::for_each;
+using ::std::pair;
+
+// ============================================================================
+
+/**
+ * A simple container to keep track of cells that depend on basic modules
+ * changes. We don't check for duplicates at insertion time; instead, we
+ * remove duplicates at query time.
+ */
+class ScUserMacroDepTracker
+{
+public:
+ void addCell(const OUString& rModuleName, ScFormulaCell* pCell)
+ {
+ ModuleCellMap::iterator itr = maCells.find(rModuleName);
+ if (itr == maCells.end())
+ {
+ pair<ModuleCellMap::iterator, bool> r = maCells.insert(
+ ModuleCellMap::value_type(rModuleName, list<ScFormulaCell*>()));
+
+ if (!r.second)
+ // insertion failed.
+ return;
+
+ itr = r.first;
+ }
+ itr->second.push_back(pCell);
+ }
+
+ void removeCell(ScFormulaCell* pCell)
+ {
+ ModuleCellMap::iterator itr = maCells.begin(), itrEnd = maCells.end();
+ for (; itr != itrEnd; ++itr)
+ itr->second.remove(pCell);
+ }
+
+ void getCellsByModule(const OUString& rModuleName, list<ScFormulaCell*>& rCells)
+ {
+ ModuleCellMap::iterator itr = maCells.find(rModuleName);
+ if (itr == maCells.end())
+ return;
+
+ list<ScFormulaCell*>& rCellList = itr->second;
+
+ // Remove duplicates.
+ rCellList.sort();
+ rCellList.unique();
+ // exception safe copy
+ list<ScFormulaCell*> temp(rCellList);
+ rCells.swap(temp);
+ }
+
+private:
+ typedef hash_map<OUString, list<ScFormulaCell*>, OUStringHash> ModuleCellMap;
+ ModuleCellMap maCells;
+};
+
+
+// ============================================================================
+
+ScMacroManager::ScMacroManager(ScDocument* pDoc) :
+ mpDepTracker(new ScUserMacroDepTracker),
+ mpDoc(pDoc)
+{
+}
+
+ScMacroManager::~ScMacroManager()
+{
+}
+
+typedef ::cppu::WeakImplHelper1< ::com::sun::star::container::XContainerListener > ContainerListenerHelper;
+
+class VBAProjectListener : public ContainerListenerHelper
+{
+ ScMacroManager* mpMacroMgr;
+public:
+ VBAProjectListener( ScMacroManager* pMacroMgr ) : mpMacroMgr( pMacroMgr ) {}
+ // XEventListener
+ virtual void SAL_CALL disposing( const lang::EventObject& /*Source*/ ) throw(RuntimeException) {}
+
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const container::ContainerEvent& /*Event*/ ) throw(RuntimeException){}
+ virtual void SAL_CALL elementReplaced( const container::ContainerEvent& Event ) throw(RuntimeException)
+ {
+ rtl::OUString sModuleName;
+ Event.Accessor >>= sModuleName;
+ OSL_TRACE("VBAProjectListener::elementReplaced(%s)", rtl::OUStringToOString( sModuleName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ mpMacroMgr->InitUserFuncData();
+ mpMacroMgr->BroadcastModuleUpdate(sModuleName);
+ }
+ virtual void SAL_CALL elementRemoved( const container::ContainerEvent& /*Event*/ ) throw(RuntimeException){}
+
+};
+
+void ScMacroManager::InitUserFuncData()
+{
+ // Clear hash_map
+ mhFuncToVolatile.clear();
+ String sProjectName( RTL_CONSTASCII_USTRINGPARAM("Standard") );
+
+ Reference< container::XContainer > xModuleContainer;
+ SfxObjectShell* pShell = mpDoc->GetDocumentShell();
+ if ( pShell && pShell->GetBasicManager()->GetName().Len() > 0 )
+ sProjectName = pShell->GetBasicManager()->GetName();
+ try
+ {
+ Reference< script::XLibraryContainer > xLibraries( pShell->GetBasicContainer(), uno::UNO_QUERY_THROW );
+ xModuleContainer.set( xLibraries->getByName( sProjectName ), uno::UNO_QUERY_THROW );
+
+ if ( xModuleContainer.is() )
+ {
+ // remove old listener ( if there was one )
+ if ( mxContainerListener.is() )
+ xModuleContainer->removeContainerListener( mxContainerListener );
+ // Create listener
+ mxContainerListener = new VBAProjectListener( this );
+ xModuleContainer->addContainerListener( mxContainerListener );
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+void ScMacroManager::SetUserFuncVolatile( const OUString& sName, bool isVolatile )
+{
+ mhFuncToVolatile[ sName ] = isVolatile;
+}
+
+bool ScMacroManager::GetUserFuncVolatile( const OUString& sName )
+{
+ NameBoolMap::iterator it = mhFuncToVolatile.find( sName );
+ if ( it == mhFuncToVolatile.end() )
+ return false;
+ return it->second;
+}
+
+void ScMacroManager::AddDependentCell(const OUString& aModuleName, ScFormulaCell* pCell)
+{
+ mpDepTracker->addCell(aModuleName, pCell);
+}
+
+void ScMacroManager::RemoveDependentCell(ScFormulaCell* pCell)
+{
+ mpDepTracker->removeCell(pCell);
+}
+
+void ScMacroManager::BroadcastModuleUpdate(const OUString& aModuleName)
+{
+ list<ScFormulaCell*> aCells;
+ mpDepTracker->getCellsByModule(aModuleName, aCells);
+ list<ScFormulaCell*>::iterator itr = aCells.begin(), itrEnd = aCells.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ ScFormulaCell* pCell = *itr;
+ mpDoc->PutInFormulaTree(pCell); // for F9 recalc
+
+ // for recalc on cell value change. If the cell is not volatile, the
+ // cell stops listening right away after it gets re-interpreted.
+ mpDoc->StartListeningArea(BCA_LISTEN_ALWAYS, pCell);
+ }
+}
diff --git a/sc/source/ui/docshell/makefile.mk b/sc/source/ui/docshell/makefile.mk
index dcfd0429bd50..df8d4c9b37f2 100644
--- a/sc/source/ui/docshell/makefile.mk
+++ b/sc/source/ui/docshell/makefile.mk
@@ -91,7 +91,8 @@ SLOFILES = \
$(SLO)$/hiranges.obj \
$(SLO)$/pntlock.obj \
$(SLO)$/sizedev.obj \
- $(SLO)$/editable.obj
+ $(SLO)$/editable.obj \
+ $(SLO)$/macromgr.obj
EXCEPTIONSFILES= \
@@ -102,7 +103,8 @@ EXCEPTIONSFILES= \
$(SLO)$/docsh8.obj \
$(SLO)$/externalrefmgr.obj \
$(SLO)$/dbdocimp.obj \
- $(SLO)$/docfunc.obj
+ $(SLO)$/docfunc.obj \
+ $(SLO)$/macromgr.obj
SRS1NAME=$(TARGET)
SRC1FILES = tpstat.src
@@ -132,7 +134,8 @@ LIB1OBJFILES = \
$(SLO)$/hiranges.obj \
$(SLO)$/pntlock.obj \
$(SLO)$/sizedev.obj \
- $(SLO)$/editable.obj
+ $(SLO)$/editable.obj \
+ $(SLO)$/macromgr.obj
# --- Tagets -------------------------------------------------------
diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx
index 32f803e75509..dfbe7ed24fe0 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -795,3 +796,4 @@ BOOL ScOutlineDocFunc::HideOutline( SCTAB nTab, BOOL bColumns, USHORT nLevel, US
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/pagedata.cxx b/sc/source/ui/docshell/pagedata.cxx
index db55c2364305..e87c2322a228 100644
--- a/sc/source/ui/docshell/pagedata.cxx
+++ b/sc/source/ui/docshell/pagedata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -137,3 +138,4 @@ void ScPageBreakData::AddPages()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/pntlock.cxx b/sc/source/ui/docshell/pntlock.cxx
index 764d431f3af0..0450f7c67a0d 100644
--- a/sc/source/ui/docshell/pntlock.cxx
+++ b/sc/source/ui/docshell/pntlock.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,4 @@ void ScPaintLockData::AddRange( const ScRange& rRange, USHORT nP )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index a30e60607b49..186b94f3bf83 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -275,3 +276,4 @@ void __EXPORT ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/sizedev.cxx b/sc/source/ui/docshell/sizedev.cxx
index d89009540156..3171fa8164ae 100644
--- a/sc/source/ui/docshell/sizedev.cxx
+++ b/sc/source/ui/docshell/sizedev.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,3 +76,4 @@ ScSizeDeviceProvider::~ScSizeDeviceProvider()
pDevice->SetMapMode( aOldMapMode );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 697b39052b9f..f949b3ffb45c 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -619,3 +620,4 @@ String ScDocumentLoader::GetTitle() const
return EMPTY_STRING;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx
index 1072af30c7a1..b5ced9d105a8 100644
--- a/sc/source/ui/docshell/tpstat.cxx
+++ b/sc/source/ui/docshell/tpstat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,3 +100,4 @@ void __EXPORT ScDocStatPage::Reset( const SfxItemSet& /* rSet */ )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx
index 4099d599c29c..77823a9b37d3 100644
--- a/sc/source/ui/drawfunc/chartsh.cxx
+++ b/sc/source/ui/drawfunc/chartsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,3 +80,4 @@ ScChartShell::~ScChartShell()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 5199b721352a..5da044f24d89 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -205,7 +206,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
ExecuteTextAttrDlg( rReq );
break;
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
case SID_DRAW_HLINK_EDIT:
if ( pSingleSelectedObj )
pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG );
@@ -233,7 +233,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
ScGlobal::OpenURL( pInfo->GetHlink(), String::EmptyString() );
}
break;
-#endif
case SID_ATTR_TRANSFORM:
{
@@ -473,7 +472,6 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq, USHORT /* nTabPage */ )
delete( pDlg );
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk )
{
if ( pObj )
@@ -483,5 +481,5 @@ void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk
lcl_setModified( GetObjectShell() );
}
}
-#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 7da571fc05a7..0a5b5ad7c21f 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -197,24 +198,20 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
BOOL bCanRename = FALSE;
if ( nMarkCount > 1 )
{
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
// no hypelink options for a selected group
rSet.DisableItem( SID_DRAW_HLINK_EDIT );
rSet.DisableItem( SID_DRAW_HLINK_DELETE );
rSet.DisableItem( SID_OPEN_HYPERLINK );
-#endif
}
else if ( nMarkCount == 1 )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
if ( !pInfo || (pInfo->GetHlink().getLength() == 0) )
{
rSet.DisableItem( SID_DRAW_HLINK_DELETE );
rSet.DisableItem( SID_OPEN_HYPERLINK );
}
-#endif
SdrLayerID nLayerID = pObj->GetLayer();
if ( nLayerID != SC_LAYER_INTERN )
bCanRename = TRUE; // #i51351# anything except internal objects can be renamed
@@ -397,3 +394,4 @@ BOOL ScDrawShell::AreAllObjectsOnLayer(USHORT nLayerNo,const SdrMarkList& rMark)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx
index 45b26584f29a..fe432103a912 100644
--- a/sc/source/ui/drawfunc/drawsh4.cxx
+++ b/sc/source/ui/drawfunc/drawsh4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113,3 +114,4 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index a05083eeadcc..23270038e419 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,14 +91,12 @@ void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink
if ( nMarkCount == 1 ) // URL-Button markiert ?
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
{
aHLinkItem.SetURL( pInfo->GetHlink() );
aHLinkItem.SetInsertMode(HLINK_FIELD);
}
-#endif
SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
@@ -240,13 +239,11 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
bDone = TRUE;
}
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
else
{
SetHlinkForObject( pObj, rURL );
bDone = TRUE;
}
-#endif
}
}
@@ -756,3 +753,4 @@ ScDrawView* ScDrawShell::GetDrawView()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drformsh.cxx b/sc/source/ui/drawfunc/drformsh.cxx
index a2531c208f18..e9a986cac5f9 100644
--- a/sc/source/ui/drawfunc/drformsh.cxx
+++ b/sc/source/ui/drawfunc/drformsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,3 +80,4 @@ ScDrawFormShell::~ScDrawFormShell()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index a5159d8a8043..5f4297fa42e7 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1093,3 +1094,4 @@ void ScDrawTextObjectBar::ExecuteTrans( SfxRequest& rReq )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx
index 0ed0853bcd73..e3ab9efcd409 100644
--- a/sc/source/ui/drawfunc/drtxtob1.cxx
+++ b/sc/source/ui/drawfunc/drtxtob1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -146,3 +147,4 @@ void ScDrawTextObjectBar::ExecutePasteContents( SfxRequest & /* rReq */ )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index 27f1a3dbb77f..aef408544aa4 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -297,3 +298,4 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconarc.cxx b/sc/source/ui/drawfunc/fuconarc.cxx
index 20daacffac0e..48c529d923e6 100644
--- a/sc/source/ui/drawfunc/fuconarc.cxx
+++ b/sc/source/ui/drawfunc/fuconarc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -232,3 +233,4 @@ SdrObject* FuConstArc::CreateDefaultObject(const sal_uInt16 nID, const Rectangle
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx
index 69a47f0584d0..dfcbdb2f5d49 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -286,3 +287,5 @@ bool FuConstCustomShape::doConstructOrthogonal() const
}
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx
index 440f49f41326..d10259e3456e 100644
--- a/sc/source/ui/drawfunc/fuconpol.cxx
+++ b/sc/source/ui/drawfunc/fuconpol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -353,3 +354,5 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
}
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index 733c6fe08b45..71d46ea98b7c 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -313,3 +314,4 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
return pObj;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx
index bb918e9005ae..63b1a34ac221 100644
--- a/sc/source/ui/drawfunc/fuconstr.cxx
+++ b/sc/source/ui/drawfunc/fuconstr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -333,3 +334,4 @@ void FuConstruct::Deactivate()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconuno.cxx b/sc/source/ui/drawfunc/fuconuno.cxx
index c1212d4d9699..45df699b3e75 100644
--- a/sc/source/ui/drawfunc/fuconuno.cxx
+++ b/sc/source/ui/drawfunc/fuconuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -188,3 +189,4 @@ SdrObject* FuConstUnoControl::CreateDefaultObject(const sal_uInt16 /* nID */, co
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index 1142e34b780d..70342cc10e24 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -828,11 +829,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
SdrObjMacroHitRec aHitRec; //! muss da noch irgendwas gesetzt werden ????
pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) );
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
else if ( !bAlt && pInfo && ((pInfo->GetMacro().getLength() > 0) || (pInfo->GetHlink().getLength() > 0)) )
-#else
- else if ( !bAlt && pInfo && (pInfo->GetMacro().getLength() > 0) )
-#endif
pWindow->SetPointer( Pointer( POINTER_REFHAND ) );
else if ( IsDetectiveHit( aPnt ) )
pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) );
@@ -861,3 +858,5 @@ BOOL FuDraw::IsSizingOrMovingNote( const MouseEvent& rMEvt ) const
}
return bIsSizingOrMoving;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index ead135751cce..bf1dc7abd133 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -455,3 +456,5 @@ void FuInsertMedia::Deactivate()
{
FuPoor::Deactivate();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index f648a1484e8e..89a483d736d5 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -847,3 +848,4 @@ void FuInsertChart::Deactivate()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fumark.cxx b/sc/source/ui/drawfunc/fumark.cxx
index 02554c495729..dfbf584bc8bd 100644
--- a/sc/source/ui/drawfunc/fumark.cxx
+++ b/sc/source/ui/drawfunc/fumark.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -288,3 +289,4 @@ void FuMarkRect::ForcePointer(const MouseEvent* /* pMEvt */)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index 0bffdfe7ef84..370385aace20 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -383,3 +384,5 @@ bool FuPoor::doConstructOrthogonal() const
}
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 4a456522003c..1fdf75eabc2f 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -202,7 +203,6 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
}
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE );
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
// For interoperability favour links over macros if both are defined
if ( pInfo->GetHlink().getLength() > 0 )
{
@@ -210,20 +210,27 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
sURL = pInfo->GetHlink();
}
else if ( pInfo->GetMacro().getLength() > 0 )
-#else
- if ( pInfo->GetMacro().getLength() > 0 )
-#endif
{
SfxObjectShell* pObjSh = SfxObjectShell::Current();
if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) )
{
+ uno::Reference< beans::XPropertySet > xProps( pObj->getUnoShape(), uno::UNO_QUERY );
+ uno::Any aCaller;
+ if ( xProps.is() )
+ {
+ try
+ {
+ aCaller = xProps->getPropertyValue( rtl::OUString::createFromAscii("Name") );
+ }
+ catch( uno::Exception& ) {}
+ }
uno::Any aRet;
uno::Sequence< sal_Int16 > aOutArgsIndex;
uno::Sequence< uno::Any > aOutArgs;
uno::Sequence< uno::Any >* pInArgs =
new uno::Sequence< uno::Any >(0);
pObjSh->CallXScript( pInfo->GetMacro(),
- *pInArgs, aRet, aOutArgsIndex, aOutArgs);
+ *pInArgs, aRet, aOutArgsIndex, aOutArgs, true, &aCaller );
pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
return TRUE; // kein CaptureMouse etc.
}
@@ -647,3 +654,4 @@ void FuSelection::Deactivate()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx
index 402143ac0a8c..8e884ee45a61 100644
--- a/sc/source/ui/drawfunc/fusel2.cxx
+++ b/sc/source/ui/drawfunc/fusel2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -183,3 +184,4 @@ void FuSelection::ActivateNoteHandles(SdrObject* pObject)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index a13cfc61d1c6..6742ea4c8186 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -880,3 +881,4 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR
return pObj;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/futext2.cxx b/sc/source/ui/drawfunc/futext2.cxx
index 340e71faa71c..354339dd0d75 100644
--- a/sc/source/ui/drawfunc/futext2.cxx
+++ b/sc/source/ui/drawfunc/futext2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -305,3 +306,4 @@ SdrOutliner* FuText::MakeOutliner()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index 534e68705fa8..b1fad759a9ec 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -247,3 +248,4 @@ void FuText::StopDragMode(SdrObject* /*pObject*/)
#endif
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index 25cda28aaa9d..101ce8578f05 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -146,3 +147,4 @@ void ScGraphicShell::ExecuteFilter( SfxRequest& rReq )
Invalidate();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/makefile.mk b/sc/source/ui/drawfunc/makefile.mk
index a50c450ab373..f82008e4cdeb 100644
--- a/sc/source/ui/drawfunc/makefile.mk
+++ b/sc/source/ui/drawfunc/makefile.mk
@@ -75,6 +75,7 @@ SLOFILES = \
$(SLO)$/mediash.obj
EXCEPTIONSFILES= \
+ $(SLO)$/fusel.obj \
$(SLO)$/fuins2.obj \
$(SLO)$/graphsh.obj \
$(SLO)$/mediash.obj
diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx
index 78948550aea6..542573e39fa9 100644
--- a/sc/source/ui/drawfunc/mediash.cxx
+++ b/sc/source/ui/drawfunc/mediash.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -141,3 +142,5 @@ void ScMediaShell::ExecuteMedia( SfxRequest& rReq )
Invalidate();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/objdraw.src b/sc/source/ui/drawfunc/objdraw.src
index 82649044b38c..c221567f3671 100644
--- a/sc/source/ui/drawfunc/objdraw.src
+++ b/sc/source/ui/drawfunc/objdraw.src
@@ -186,7 +186,6 @@
ITEM_FORMAT_PARA_DLG\
};
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
#define MN_EDITLNK \
MenuItem\
{\
@@ -202,7 +201,6 @@
HelpID = SID_DRAW_HLINK_DELETE ; \
Text [ en-US ] = "~Remove Hyperlink" ; \
};
-#endif
#define MN_DRWTXTATTR \
MenuItem\
@@ -1297,14 +1295,12 @@ Menu RID_POPUP_DRAW
MenuItem { Separator = TRUE ; };
//------------------------------
ITEM_GROUP_MENU
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
//------------------------------
MenuItem { Separator = TRUE ; };
//------------------------------
MN_EDITLNK
MN_DELLNK
MenuItem { ITEM_OPEN_HYPERLINK };
-#endif
};
};
@@ -1374,14 +1370,12 @@ Menu RID_POPUP_GRAPHIC
MenuItem { Separator = TRUE ; };
//------------------------------
ITEM_GROUP_MENU
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
//------------------------------
MenuItem { Separator = TRUE ; };
//------------------------------
MN_EDITLNK
MN_DELLNK
MenuItem { ITEM_OPEN_HYPERLINK };
-#endif
};
};
diff --git a/sc/source/ui/drawfunc/oleobjsh.cxx b/sc/source/ui/drawfunc/oleobjsh.cxx
index 5f6a3a6c2f5e..d8a0b8c052ac 100644
--- a/sc/source/ui/drawfunc/oleobjsh.cxx
+++ b/sc/source/ui/drawfunc/oleobjsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,3 +80,4 @@ ScOleObjectShell::~ScOleObjectShell()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index 1d522fb3211e..d22531e76f59 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1180,3 +1181,4 @@ void ScFunctionDockWin::StateChanged( StateChangedType nStateChange )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/formdlg/formdata.cxx b/sc/source/ui/formdlg/formdata.cxx
index e493e3f7b00f..d11ad33a6a45 100644
--- a/sc/source/ui/formdlg/formdata.cxx
+++ b/sc/source/ui/formdlg/formdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,4 @@ void ScFormEditData::SaveValues()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 25971594f116..fec3f5885932 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -670,3 +671,4 @@ table::CellAddress ScFormulaDlg::getReferencePosition() const
return pArray;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/formdlg/privsplt.cxx b/sc/source/ui/formdlg/privsplt.cxx
index a3b27ba21b1d..2497a86707d6 100644
--- a/sc/source/ui/formdlg/privsplt.cxx
+++ b/sc/source/ui/formdlg/privsplt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -420,3 +421,4 @@ void ScPrivatSplit::DataChanged( const DataChangedEvent& rDCEvt )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/asciiopt.hxx b/sc/source/ui/inc/asciiopt.hxx
index 9d798083a155..469a8f2da0f2 100644
--- a/sc/source/ui/inc/asciiopt.hxx
+++ b/sc/source/ui/inc/asciiopt.hxx
@@ -44,7 +44,7 @@
// ============================================================================
-class ScAsciiOptions
+class SC_DLLPUBLIC ScAsciiOptions
{
private:
BOOL bFixedLen;
diff --git a/sc/source/ui/inc/datafdlg.hrc b/sc/source/ui/inc/datafdlg.hrc
new file mode 100644
index 000000000000..edc14778ff8d
--- /dev/null
+++ b/sc/source/ui/inc/datafdlg.hrc
@@ -0,0 +1,40 @@
+/*
+ * 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@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
+#define BTN_DATAFORM_NEW 1001
+#define BTN_DATAFORM_DELETE 1002
+#define BTN_DATAFORM_RESTORE 1003
+#define BTN_DATAFORM_LAST 1004
+#define BTN_DATAFORM_NEXT 1005
+#define BTN_DATAFORM_CLOSE 1007
+#define WND_DATAFORM_SCROLLBAR 1008
+#define LAB_DATAFORM_RECORDNO 1009
+
+#define FT_DATAFORM_FIXEDTEXT1 2001
+#define ED_DATAFORM_EDIT1 2002
diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx
new file mode 100644
index 000000000000..bd6d3f3d4965
--- /dev/null
+++ b/sc/source/ui/inc/datafdlg.hxx
@@ -0,0 +1,111 @@
+/*
+ * 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@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
+
+
+#ifndef _SV_DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+
+#ifndef _SV_BUTTON_HXX //autogen
+#include <vcl/imagebtn.hxx>
+#endif
+
+#ifndef _SV_FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+
+
+#include "global.hxx"
+
+#include <tabvwsh.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+
+#define MAX_DATAFORM_COLS 256
+#define MAX_DATAFORM_ROWS 32000
+#define CTRL_HEIGHT 22
+#define FIXED_WIDTH 60
+#define EDIT_WIDTH 140
+#define FIXED_LEFT 12
+#define EDIT_LEFT 78
+#define LINE_HEIGHT 30
+
+//zhangyun
+class ScDataFormDlg : public ModalDialog
+{
+private:
+
+ PushButton aBtnNew;
+ PushButton aBtnDelete;
+ PushButton aBtnRestore;
+ PushButton aBtnLast;
+ PushButton aBtnNext;
+ PushButton aBtnClose;
+ ScrollBar aSlider;
+ FixedText aFixedText;
+ //FixedText aFixedText1;
+ //Edit aEdit1;
+
+ ScTabViewShell* pTabViewShell;
+ ScDocument* pDoc;
+ sal_uInt16 aColLength;
+ SCROW aCurrentRow;
+ SCCOL nStartCol;
+ SCCOL nEndCol;
+ SCROW nStartRow;
+ SCROW nEndRow;
+ SCTAB nTab;
+ BOOL bNoSelection;
+
+ FixedText** pFixedTexts;
+ Edit** pEdits;
+
+public:
+ ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShell);
+ ~ScDataFormDlg();
+
+ void FillCtrls(SCROW nCurrentRow);
+private:
+
+ void SetButtonState();
+
+ // Handler:
+ DECL_LINK( Impl_NewHdl, PushButton* );
+ DECL_LINK( Impl_LastHdl, PushButton* );
+ DECL_LINK( Impl_NextHdl, PushButton* );
+
+ DECL_LINK( Impl_RestoreHdl, PushButton* );
+ DECL_LINK( Impl_DeleteHdl, PushButton* );
+ DECL_LINK( Impl_CloseHdl, PushButton* );
+
+ DECL_LINK( Impl_ScrollHdl, ScrollBar* );
+ DECL_LINK( Impl_DataModifyHdl, Edit* );
+};
+#endif // SC_DATAFDLG_HXX
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index 6c61364c5228..a28692350421 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -167,6 +167,8 @@ public:
double fStart, double fStep, double fMax,
BOOL bRecord, BOOL bApi );
// FillAuto: rRange wird von Source-Range auf Dest-Range angepasst
+ SC_DLLPUBLIC BOOL FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, ULONG nCount, double fStep, double fMax, BOOL bRecord, BOOL bApi );
+
BOOL FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
FillDir eDir, ULONG nCount, BOOL bRecord, BOOL bApi );
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index f7061e179fae..db675399d688 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -43,6 +43,7 @@
#include "optutil.hxx"
#include <hash_map>
+#include <cppuhelper/implbase1.hxx>
class ScEditEngineDefaulter;
class FontList;
@@ -301,6 +302,10 @@ public:
ScMarkData& rMark, BOOL bRecord = TRUE );
void ModifyScenario( SCTAB nTab, const String& rName, const String& rComment,
const Color& rColor, USHORT nFlags );
+ ULONG TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos,
+ SCTAB nDestPos, BOOL bInsertNew,
+ BOOL bNotifyAndPaint );
+
BOOL MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRecord );
void DoRecalc( BOOL bApi );
diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx
index 45badf0c88fd..25cb3e05acac 100644
--- a/sc/source/ui/inc/dpcontrol.hxx
+++ b/sc/source/ui/inc/dpcontrol.hxx
@@ -69,11 +69,12 @@ public:
~ScDPFieldButton();
void setText(const ::rtl::OUString& rText);
- void setBoundingBox(const Point& rPos, const Size& rSize);
+ void setBoundingBox(const Point& rPos, const Size& rSize, bool bLayoutRTL);
void setDrawBaseButton(bool b);
void setDrawPopupButton(bool b);
void setHasHiddenMember(bool b);
void setPopupPressed(bool b);
+ void setPopupLeft(bool b);
void draw();
void getPopupBoundingBox(Point& rPos, Size& rSize) const;
@@ -94,6 +95,7 @@ private:
bool mbPopupButton;
bool mbHasHiddenMember;
bool mbPopupPressed;
+ bool mbPopupLeft;
};
// ============================================================================
diff --git a/sc/source/ui/inc/drawsh.hxx b/sc/source/ui/inc/drawsh.hxx
index e633ab00e277..8d2e7238f759 100644
--- a/sc/source/ui/inc/drawsh.hxx
+++ b/sc/source/ui/inc/drawsh.hxx
@@ -44,9 +44,7 @@ class ScDrawShell : public SfxShell
DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
void SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk );
-#endif
protected:
ScViewData* GetViewData() { return pViewData; }
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index 86a91216edcc..164c4edb187c 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -50,7 +50,7 @@ struct ScExportTextOptions
bool mbAddQuotes;
};
-class ScImportExport
+class SC_DLLPUBLIC ScImportExport
{
ScDocShell* pDocSh;
ScDocument* pDoc;
diff --git a/sc/source/ui/inc/tabcont.hxx b/sc/source/ui/inc/tabcont.hxx
index d77ee812fdb3..245adc7e974e 100644
--- a/sc/source/ui/inc/tabcont.hxx
+++ b/sc/source/ui/inc/tabcont.hxx
@@ -76,6 +76,7 @@ public:
using TabBar::StartDrag;
+ void UpdateInputContext();
void UpdateStatus();
void ActivateView(BOOL bActivate);
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 7bfd0201cbb8..5109c99cb223 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -246,7 +246,7 @@ public:
virtual ~ScTabViewShell();
- Window* GetDialogParent();
+ SC_DLLPUBLIC Window* GetDialogParent();
bool IsRefInputMode() const;
void ExecuteInputDirect();
@@ -289,7 +289,7 @@ public:
void GetSaveState( SfxItemSet& rSet );
void ExecSearch( SfxRequest& rReq );
- void ExecuteUndo(SfxRequest& rReq);
+ SC_DLLPUBLIC void ExecuteUndo(SfxRequest& rReq);
void GetUndoState(SfxItemSet &rSet);
void ExecuteSbx( SfxRequest& rReq );
diff --git a/sc/source/ui/inc/undodat.hxx b/sc/source/ui/inc/undodat.hxx
index 76f3d42a8475..fafc71511f03 100644
--- a/sc/source/ui/inc/undodat.hxx
+++ b/sc/source/ui/inc/undodat.hxx
@@ -495,7 +495,43 @@ private:
void Init();
};
+// amelia
+class ScUndoDataForm: public ScBlockUndo
+{
+public:
+ TYPEINFO();
+ 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 = TRUE
+ );
+ virtual ~ScUndoDataForm();
+
+ virtual void Undo();
+ virtual void Redo();
+ virtual void Repeat(SfxRepeatTarget& rTarget);
+ virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
+ virtual String GetComment() const;
+
+private:
+ ScMarkData aMarkData;
+ ScDocument* pUndoDoc;
+ ScDocument* pRedoDoc;
+ USHORT nFlags;
+ ScRefUndoData* pRefUndoData;
+ ScRefUndoData* pRefRedoData;
+ ULONG nStartChangeAction;
+ ULONG nEndChangeAction;
+ BOOL bRedoFilled;
+
+ void DoChange( const BOOL bUndo );
+ void SetChangeTrack();
+};
#endif
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 301c3e5663f7..4f7e9e01771a 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -110,6 +110,8 @@ public:
SC_DLLPUBLIC void CutToClip( ScDocument* pClipDoc = NULL, BOOL bIncludeObjects = FALSE );
SC_DLLPUBLIC BOOL CopyToClip( ScDocument* pClipDoc = NULL, BOOL bCut = FALSE, BOOL bApi = FALSE,
BOOL bIncludeObjects = FALSE, BOOL bStopEdit = TRUE );
+ SC_DLLPUBLIC BOOL CopyToClip( ScDocument* pClipDoc, const ScRange& rRange, BOOL bCut = FALSE,
+ BOOL bApi = FALSE, BOOL bIncludeObjects = FALSE, BOOL bStopEdit = TRUE );
ScTransferObj* CopyToTransferable();
SC_DLLPUBLIC BOOL PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
USHORT nFunction = PASTE_NOFUNC, BOOL bSkipEmpty = FALSE,
@@ -337,6 +339,13 @@ public:
void ForgetFormatArea() { bFormatValid = FALSE; }
BOOL SelectionEditable( BOOL* pOnlyNotBecauseOfMatrix = NULL );
+ // Amelia Wang
+ SC_DLLPUBLIC void DataFormPutData( SCROW nCurrentRow ,
+ SCROW nStartRow , SCCOL nStartCol ,
+ SCROW nEndRow , SCCOL nEndCol ,
+ Edit** pEdits ,
+ sal_uInt16 aColLength );
+
// interne Hilfsfunktionen
protected:
void UpdateLineAttrs( SvxBorderLine& rLine,
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 626f48254f37..ce6473c2b068 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2133,3 +2134,4 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData )
return eCompare;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 32b3376da9a7..0c46284c77d7 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1009,3 +1010,4 @@ void ScRefHandler::RefInputDone( BOOL bForced )
m_aHelper.RefInputDone( bForced );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index ce981a6e5793..18013a089306 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -565,3 +566,4 @@ void ScAutoFmtPreview::Paint( const Rectangle& rRect )
DoPaint( rRect );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index 213c0b6a16a3..ef525d6d8447 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -856,3 +857,5 @@ void ScConflictsDlg::UpdateView()
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/crdlg.cxx b/sc/source/ui/miscdlgs/crdlg.cxx
index 074d54a5c912..5100474274df 100644
--- a/sc/source/ui/miscdlgs/crdlg.cxx
+++ b/sc/source/ui/miscdlgs/crdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,3 +86,4 @@ IMPL_LINK_INLINE_END( ScColOrRowDlg, OkHdl, OKButton *, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 0ad2a2e80ca4..7afec7c603b4 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1170,3 +1171,5 @@ IMPL_LINK( ScColRowNameRangesDlg, LoseFocusHdl, Control*, EMPTYARG )
bDlgLostFocus = !IsActive();
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
new file mode 100644
index 000000000000..b5d910f94343
--- /dev/null
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -0,0 +1,414 @@
+/*
+ * 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@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"
+
+#undef SC_DLLIMPLEMENTATION
+
+//------------------------------------------------------------------
+
+#include "datafdlg.hxx"
+#include "scresid.hxx"
+#include "datafdlg.hrc"
+#include "viewdata.hxx"
+//#include "document.hxx"
+#include "docsh.hxx"
+#include "refundo.hxx"
+#include "undodat.hxx"
+
+#define HDL(hdl) LINK( this, ScDataFormDlg, hdl )
+
+//zhangyun
+ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShellOri) :
+ ModalDialog ( pParent, ScResId( RID_SCDLG_DATAFORM ) ),
+ //
+ aBtnNew ( this, ScResId( BTN_DATAFORM_NEW ) ),
+ aBtnDelete ( this, ScResId( BTN_DATAFORM_DELETE ) ),
+ aBtnRestore ( this, ScResId( BTN_DATAFORM_RESTORE ) ),
+ aBtnLast ( this, ScResId( BTN_DATAFORM_LAST ) ),
+ aBtnNext ( this, ScResId( BTN_DATAFORM_NEXT ) ),
+ aBtnClose ( this, ScResId( BTN_DATAFORM_CLOSE ) ),
+ aSlider ( this, ScResId( WND_DATAFORM_SCROLLBAR ) ),
+ aFixedText ( this, ScResId( LAB_DATAFORM_RECORDNO ) )
+{
+ pTabViewShell = pTabViewShellOri;
+ FreeResource();
+ //read header form current document, and add new controls
+ DBG_ASSERT( pTabViewShell, "pTabViewShell is NULL! :-/" );
+ ScViewData* pViewData = pTabViewShell->GetViewData();
+
+ pDoc = pViewData->GetDocument();
+ if (pDoc)
+ {
+ ScRange aRange;
+ pViewData->GetSimpleArea( aRange );
+ ScAddress aStart = aRange.aStart;
+ ScAddress aEnd = aRange.aEnd;
+
+ nStartCol = aStart.Col();
+ nEndCol = aEnd.Col();
+ nStartRow = aStart.Row();
+ nEndRow = aEnd.Row();
+
+ nTab = pViewData->GetTabNo();
+ //if there is no selection
+ if ((nStartCol == nEndCol) && (nStartRow == nEndRow))
+ bNoSelection = TRUE;
+
+ if (bNoSelection)
+ {
+ //find last not blank cell in row
+ for (int i=1;i<=MAX_DATAFORM_COLS;i++)
+ {
+ String aColName;
+ nEndCol++;
+ pDoc->GetString( nEndCol, nStartRow, nTab, aColName );
+ int nColWidth = pDoc->GetColWidth( nEndCol, nTab );
+ if ( aColName.Len() == 0 && nColWidth)
+ {
+ nEndCol--;
+ break;
+ }
+ }
+
+ //find first not blank cell in row
+ for (int i=1;i<=MAX_DATAFORM_COLS;i++)
+ {
+ String aColName;
+ if (nStartCol <= 0)
+ break;
+ nStartCol--;
+
+ pDoc->GetString( nStartCol, nStartRow, nTab, aColName );
+ int nColWidth = pDoc->GetColWidth( nEndCol, nTab );
+ if ( aColName.Len() == 0 && nColWidth)
+ {
+ nStartCol++;
+ break;
+ }
+ }
+
+ //skip leading hide column
+ for (int i=1;i<=MAX_DATAFORM_COLS;i++)
+ {
+ String aColName;
+ int nColWidth = pDoc->GetColWidth( nStartCol, nTab );
+ if (nColWidth)
+ break;
+ nStartCol++;
+ }
+
+ if (nEndCol < nStartCol)
+ nEndCol = nStartCol;
+
+ //find last not blank cell in row
+ for (int i=1;i<=MAX_DATAFORM_ROWS;i++)
+ {
+ String aColName;
+ nEndRow++;
+ pDoc->GetString( nStartCol, nEndRow, nTab, aColName );
+ if ( aColName.Len() == 0 )
+ {
+ nEndRow--;
+ break;
+ }
+ }
+
+ //find first not blank cell in row
+ for (int i=1;i<=MAX_DATAFORM_ROWS;i++)
+ {
+ String aColName;
+ if (nStartRow <= 0)
+ break;
+ nStartRow--;
+
+ pDoc->GetString( nStartCol, nStartRow, nTab, aColName );
+ if ( aColName.Len() == 0 )
+ {
+ nStartRow++;
+ break;
+ }
+ }
+
+ if (nEndRow < nStartRow)
+ nEndRow = nStartRow;
+ }
+
+ aCurrentRow = nStartRow + 1;
+
+ String aFieldName;
+
+ int nTop = 12;
+
+ Size nFixedSize(FIXED_WIDTH, CTRL_HEIGHT );
+ Size nEditSize(EDIT_WIDTH, CTRL_HEIGHT );
+
+ //pFtArray = new FixedText(this);
+ aColLength = nEndCol - nStartCol + 1;
+
+ //new the controls
+ pFixedTexts = new FixedText*[aColLength];
+ pEdits = new Edit*[aColLength];
+
+ for(sal_uInt16 nIndex = 0; nIndex < aColLength; nIndex++)
+ {
+ pDoc->GetString( nIndex + nStartCol, nStartRow, nTab, aFieldName );
+ int nColWidth = pDoc->GetColWidth( nIndex + nStartCol, nTab );
+ if (nColWidth)
+ {
+ pFixedTexts[nIndex] = new FixedText(this);
+ pEdits[nIndex] = new Edit(this, WB_BORDER);
+
+ pFixedTexts[nIndex]->SetSizePixel(nFixedSize);
+ pEdits[nIndex]->SetSizePixel(nEditSize);
+ pFixedTexts[nIndex]->SetPosPixel(Point(FIXED_LEFT, nTop));
+ pEdits[nIndex]->SetPosPixel(Point(EDIT_LEFT, nTop));
+ //pFixedTexts[nIndex]->SetText(String::CreateFromAscii("W4W-Filter Nr. "));
+ pFixedTexts[nIndex]->SetText(aFieldName);
+ pFixedTexts[nIndex]->Show();
+ pEdits[nIndex]->Show();
+
+ nTop += LINE_HEIGHT;
+ }
+ else
+ {
+ pFixedTexts[nIndex] = NULL;
+ pEdits[nIndex] = NULL;
+ }
+ pEdits[nIndex]->SetModifyHdl( HDL(Impl_DataModifyHdl) );
+ }
+
+ Size nDialogSize = this->GetSizePixel();
+ if (nTop > nDialogSize.Height())
+ {
+ nDialogSize.setHeight(nTop);
+ this->SetSizePixel(nDialogSize);
+ }
+ Size nScrollSize = aSlider.GetSizePixel();
+ nScrollSize.setHeight(nDialogSize.Height()-20);
+ aSlider.SetSizePixel(nScrollSize);
+ }
+
+ FillCtrls(aCurrentRow);
+
+ aSlider.SetPageSize( 10 );
+ aSlider.SetVisibleSize( 1 );
+ aSlider.SetLineSize( 1 );
+ aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) );
+ aSlider.Show();
+
+ aBtnNew.SetClickHdl ( HDL(Impl_NewHdl) );
+ aBtnLast.SetClickHdl ( HDL(Impl_LastHdl) );
+ aBtnNext.SetClickHdl ( HDL(Impl_NextHdl) );
+
+ aBtnRestore.SetClickHdl ( HDL(Impl_RestoreHdl) );
+ aBtnDelete.SetClickHdl ( HDL(Impl_DeleteHdl) );
+ aBtnClose.SetClickHdl ( HDL(Impl_CloseHdl) );
+
+ aSlider.SetEndScrollHdl( HDL( Impl_ScrollHdl ) );
+
+ SetButtonState();
+
+ //end
+ //FreeResource();
+}
+
+ScDataFormDlg::~ScDataFormDlg()
+{
+ for(sal_uInt16 i = 0; i < aColLength; i++)
+ {
+ if (pEdits[i])
+ delete pEdits[i];
+ if (pFixedTexts[i])
+ delete pFixedTexts[i];
+ }
+ if (pEdits)
+ delete pEdits;
+ if (pFixedTexts)
+ delete pFixedTexts;
+}
+
+void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/)
+{
+ //ScViewData* pViewData = pTabViewShell->GetViewData();
+
+ //pDoc = pViewData->GetDocument();
+ String aFieldName;
+ int nRecordNum = nEndRow - nStartRow;
+ for(sal_uInt16 i = 0; i < aColLength; i++)
+ {
+ if (pEdits[i])
+ {
+ if (aCurrentRow<=nEndRow)
+ {
+ pDoc->GetString( i + nStartCol, aCurrentRow, nTab, aFieldName );
+ pEdits[i]->SetText(aFieldName);
+ }
+ else
+ pEdits[i]->SetText(String());
+ }
+ }
+ char sRecordStr[256];
+ if (aCurrentRow<=nEndRow)
+ aFixedText.SetText(String::CreateFromAscii(sRecordStr));
+ else
+ aFixedText.SetText(String::CreateFromAscii("New Record"));
+
+ aSlider.SetThumbPos(aCurrentRow-nStartRow-1);
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_DataModifyHdl, Edit*, pEdit)
+{
+ if ( pEdit->IsModified() )
+ aBtnRestore.Enable( TRUE );
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_NewHdl, PushButton*, EMPTYARG )
+{
+ ScViewData* pViewData = pTabViewShell->GetViewData();
+ ScDocShell* pDocSh = pViewData->GetDocShell();
+ if ( pDoc )
+ {
+ sal_Bool bHasData = sal_False;
+ for(sal_uInt16 i = 0; i < aColLength; i++)
+ if (pEdits[i])
+ if ( pEdits[i]->GetText().Len() != 0 )
+ {
+ bHasData = sal_True;
+ break;
+ }
+
+ if ( bHasData )
+ {
+ pTabViewShell->DataFormPutData( aCurrentRow , nStartRow , nStartCol , nEndRow , nEndCol , pEdits , aColLength );
+ aCurrentRow++;
+ if (aCurrentRow >= nEndRow + 2)
+ {
+ nEndRow ++ ;
+ aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) );
+ }
+ SetButtonState();
+ FillCtrls(aCurrentRow);
+ pDocSh->SetDocumentModified();
+ pDocSh->PostPaintGridAll();
+ }
+ }
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_LastHdl, PushButton*, EMPTYARG )
+{
+ if (pDoc)
+ {
+ if ( aCurrentRow > nStartRow +1 )
+ aCurrentRow--;
+
+ SetButtonState();
+ FillCtrls(aCurrentRow);
+ }
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_NextHdl, PushButton*, EMPTYARG )
+{
+ if (pDoc)
+ {
+ if ( aCurrentRow <= nEndRow)
+ aCurrentRow++;
+
+ SetButtonState();
+ FillCtrls(aCurrentRow);
+ }
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_RestoreHdl, PushButton*, EMPTYARG )
+{
+ if (pDoc)
+ {
+ FillCtrls(aCurrentRow);
+ }
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_DeleteHdl, PushButton*, EMPTYARG )
+{
+ ScViewData* pViewData = pTabViewShell->GetViewData();
+ ScDocShell* pDocSh = pViewData->GetDocShell();
+ if (pDoc)
+ {
+ ScRange aRange(nStartCol, aCurrentRow, nTab, nEndCol, aCurrentRow, nTab);
+ pDoc->DeleteRow(aRange);
+ nEndRow--;
+
+ SetButtonState();
+ pDocSh->GetUndoManager()->Clear();
+
+ FillCtrls(aCurrentRow);
+ pDocSh->SetDocumentModified();
+ pDocSh->PostPaintGridAll();
+ }
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_CloseHdl, PushButton*, EMPTYARG )
+{
+ EndDialog( );
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_ScrollHdl, ScrollBar*, EMPTYARG )
+{
+ long nOffset = aSlider.GetThumbPos();
+ aCurrentRow = nStartRow + nOffset + 1;
+ SetButtonState();
+ FillCtrls(aCurrentRow);
+ return 0;
+}
+
+void ScDataFormDlg::SetButtonState()
+{
+ if ( aCurrentRow > nEndRow )
+ {
+ aBtnDelete.Enable( FALSE );
+ aBtnLast.Enable( TRUE );
+ aBtnNext.Enable( FALSE );
+ }
+ else
+ {
+ aBtnDelete.Enable( TRUE );
+ aBtnNext.Enable( TRUE );
+ }
+ if ( 1 == aCurrentRow )
+ aBtnLast.Enable( FALSE );
+
+ aBtnRestore.Enable( FALSE );
+ if ( pEdits )
+ pEdits[0]->GrabFocus();
+}
diff --git a/sc/source/ui/miscdlgs/delcldlg.cxx b/sc/source/ui/miscdlgs/delcldlg.cxx
index fd206ac537ba..8d20d2ee50e6 100644
--- a/sc/source/ui/miscdlgs/delcldlg.cxx
+++ b/sc/source/ui/miscdlgs/delcldlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118,3 +119,4 @@ __EXPORT ScDeleteCellDlg::~ScDeleteCellDlg()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/delcodlg.cxx b/sc/source/ui/miscdlgs/delcodlg.cxx
index 7be4c7a0bf3f..e8c7dde31443 100644
--- a/sc/source/ui/miscdlgs/delcodlg.cxx
+++ b/sc/source/ui/miscdlgs/delcodlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -178,3 +179,4 @@ __EXPORT ScDeleteContentsDlg::~ScDeleteContentsDlg()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx
index 2b247f0f9a07..46af2992e4a5 100644
--- a/sc/source/ui/miscdlgs/filldlg.cxx
+++ b/sc/source/ui/miscdlgs/filldlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -373,3 +374,4 @@ IMPL_LINK( ScFillSeriesDlg, OKHdl, void *, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/groupdlg.cxx b/sc/source/ui/miscdlgs/groupdlg.cxx
index d6eb1865b184..d771e225ffdb 100644
--- a/sc/source/ui/miscdlgs/groupdlg.cxx
+++ b/sc/source/ui/miscdlgs/groupdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,3 +82,4 @@ __EXPORT ScGroupDlg::~ScGroupDlg()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx
index dce755c10db3..d2c2f2c7cf84 100644
--- a/sc/source/ui/miscdlgs/highred.cxx
+++ b/sc/source/ui/miscdlgs/highred.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -299,3 +300,4 @@ IMPL_LINK( ScHighlightChgDlg, OKBtnHdl, PushButton*, pOKBtn )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/inscldlg.cxx b/sc/source/ui/miscdlgs/inscldlg.cxx
index 2a3489088489..f09513960ae4 100644
--- a/sc/source/ui/miscdlgs/inscldlg.cxx
+++ b/sc/source/ui/miscdlgs/inscldlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118,3 +119,4 @@ __EXPORT ScInsertCellDlg::~ScInsertCellDlg()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx
index b1c8e31ef373..63d55ac6f41e 100644
--- a/sc/source/ui/miscdlgs/inscodlg.cxx
+++ b/sc/source/ui/miscdlgs/inscodlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -370,3 +371,4 @@ USHORT ScInsertContentsDlg::GetFormulaCmdBits() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index 06d4f23389c0..d3a5cbe4f0dd 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -431,3 +432,4 @@ IMPL_LINK( ScInsertTableDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/lbseldlg.cxx b/sc/source/ui/miscdlgs/lbseldlg.cxx
index afdb2b70da8a..f340cab4127c 100644
--- a/sc/source/ui/miscdlgs/lbseldlg.cxx
+++ b/sc/source/ui/miscdlgs/lbseldlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,3 +100,4 @@ __EXPORT ScSelEntryDlg::~ScSelEntryDlg()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index 48e33622e99f..26bc8cc56dad 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -364,3 +365,4 @@ ULONG ScLinkedAreaDlg::GetRefresh()
return 0; // disabled
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/makefile.mk b/sc/source/ui/miscdlgs/makefile.mk
index d34994341ade..d3c6853d6875 100644
--- a/sc/source/ui/miscdlgs/makefile.mk
+++ b/sc/source/ui/miscdlgs/makefile.mk
@@ -41,6 +41,7 @@ LIBTARGET=no
# --- Files --------------------------------------------------------
SLOFILES = \
+ $(SLO)$/datafdlg.obj \
$(SLO)$/delcldlg.obj \
$(SLO)$/inscldlg.obj \
$(SLO)$/delcodlg.obj \
diff --git a/sc/source/ui/miscdlgs/mtrindlg.cxx b/sc/source/ui/miscdlgs/mtrindlg.cxx
index 02bc77f8f89e..7bc19c14fa27 100644
--- a/sc/source/ui/miscdlgs/mtrindlg.cxx
+++ b/sc/source/ui/miscdlgs/mtrindlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -184,3 +185,4 @@ IMPL_LINK_INLINE_END( ScMetricInputDlg, ModifyHdl, MetricField *, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index 296cf8a8637f..b3505aa005ff 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -203,3 +204,4 @@ IMPL_LINK( ScMoveTableDlg, SelHdl, ListBox *, pLb )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/namecrea.cxx b/sc/source/ui/miscdlgs/namecrea.cxx
index 1714fddd3b3d..269ae78ad21f 100644
--- a/sc/source/ui/miscdlgs/namecrea.cxx
+++ b/sc/source/ui/miscdlgs/namecrea.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,3 +78,4 @@ USHORT ScNameCreateDlg::GetFlags() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/namepast.cxx b/sc/source/ui/miscdlgs/namepast.cxx
index c621f14b431c..6e5baea3ed42 100644
--- a/sc/source/ui/miscdlgs/namepast.cxx
+++ b/sc/source/ui/miscdlgs/namepast.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -131,3 +132,4 @@ String ScNamePasteDlg::GetSelectedName() const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 37759aef81b5..4f70376455b5 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1064,3 +1065,4 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
return bClose;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/protectiondlg.cxx b/sc/source/ui/miscdlgs/protectiondlg.cxx
index 603b60e24884..d66bd541a174 100644
--- a/sc/source/ui/miscdlgs/protectiondlg.cxx
+++ b/sc/source/ui/miscdlgs/protectiondlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -160,3 +161,5 @@ IMPL_LINK( ScTableProtectionDlg, PasswordModifyHdl, Edit*, EMPTYARG )
maBtnOk.Enable(aPass1.Equals(aPass2));
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/redcom.cxx b/sc/source/ui/miscdlgs/redcom.cxx
index 518c6515580b..cae6a64ce233 100644
--- a/sc/source/ui/miscdlgs/redcom.cxx
+++ b/sc/source/ui/miscdlgs/redcom.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -183,3 +184,4 @@ IMPL_LINK(ScRedComDialog, NextHdl, AbstractSvxPostItDialog*, pDlgP )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx
index ef60b357489e..2a844c784888 100644
--- a/sc/source/ui/miscdlgs/retypepassdlg.cxx
+++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -542,3 +543,5 @@ IMPL_LINK( ScRetypePassInputDlg, PasswordModifyHdl, Edit*, EMPTYARG )
CheckPasswordInput();
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx
index b2f837db4cb4..a7637afc5381 100644
--- a/sc/source/ui/miscdlgs/scuiautofmt.cxx
+++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -474,3 +475,5 @@ String __EXPORT ScAutoFormatDlg::GetCurrFormatName()
return aResult;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index 4a5b7cc2149b..797f29612fe6 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -233,3 +234,5 @@ void ScShareDocumentDlg::UpdateView()
maLbUsers.InsertEntry( aString, NULL );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/shtabdlg.cxx b/sc/source/ui/miscdlgs/shtabdlg.cxx
index 7e57ebbe5d60..66cf2c8034e7 100644
--- a/sc/source/ui/miscdlgs/shtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/shtabdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,3 +110,4 @@ __EXPORT ScShowTabDlg::~ScShowTabDlg()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/simpref.cxx b/sc/source/ui/miscdlgs/simpref.cxx
index 097016836ee5..732543394634 100644
--- a/sc/source/ui/miscdlgs/simpref.cxx
+++ b/sc/source/ui/miscdlgs/simpref.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -255,3 +256,4 @@ IMPL_LINK( ScSimpleRefDlg, CancelBtnHdl, void *, EMPTYARG )
//------------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 418a88b3cbea..4ed6eebb07cb 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -490,3 +491,4 @@ double ScSolverValueDialog::GetValue() const
return fValue;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/solverutil.cxx b/sc/source/ui/miscdlgs/solverutil.cxx
index ae080f2525c7..377ab4b358e7 100644
--- a/sc/source/ui/miscdlgs/solverutil.cxx
+++ b/sc/source/ui/miscdlgs/solverutil.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -227,3 +228,4 @@ uno::Sequence<beans::PropertyValue> ScSolverUtil::GetDefaults( const rtl::OUStri
return aDefaults;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx
index 5b41592e8457..524fcb8420ed 100644
--- a/sc/source/ui/miscdlgs/solvrdlg.cxx
+++ b/sc/source/ui/miscdlgs/solvrdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -311,3 +312,4 @@ IMPL_LINK( ScSolverDlg, LoseFocusHdl, Control*, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/strindlg.cxx b/sc/source/ui/miscdlgs/strindlg.cxx
index b8dc2e13538e..f2bcd660bae6 100644
--- a/sc/source/ui/miscdlgs/strindlg.cxx
+++ b/sc/source/ui/miscdlgs/strindlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,3 +106,4 @@ __EXPORT ScStringInputDlg::~ScStringInputDlg()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
index 463c06d76712..6154749f16aa 100644
--- a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
+++ b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -196,3 +197,5 @@ void ScTabBgColorDlg::ScTabBgColorValueSet::KeyInput( const KeyEvent& rKEvt )
}
ValueSet::KeyInput(rKEvt);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx
index 38ae6bddaebd..2dce5792232d 100644
--- a/sc/source/ui/miscdlgs/tabopdlg.cxx
+++ b/sc/source/ui/miscdlgs/tabopdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -369,3 +370,4 @@ IMPL_LINK( ScTabOpDlg, LoseFocusHdl, Control*, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/textdlgs.cxx b/sc/source/ui/miscdlgs/textdlgs.cxx
index dcbb32bfa3e6..5af55079dda6 100644
--- a/sc/source/ui/miscdlgs/textdlgs.cxx
+++ b/sc/source/ui/miscdlgs/textdlgs.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -128,3 +129,4 @@ void __EXPORT ScParagraphDlg::PageCreated( USHORT nId, SfxTabPage &rPage )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/warnbox.cxx b/sc/source/ui/miscdlgs/warnbox.cxx
index 24b2e62a1c78..acf12cf263b0 100644
--- a/sc/source/ui/miscdlgs/warnbox.cxx
+++ b/sc/source/ui/miscdlgs/warnbox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -89,3 +90,4 @@ void ScReplaceWarnBox::DisableDialog()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index bc79fa7c65e7..728fefae1443 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -647,3 +648,4 @@ IMPL_LINK_INLINE_START( ScNameDlg, AssignGetFocusHdl, void *, EMPTYARG )
IMPL_LINK_INLINE_END( ScNameDlg, AssignGetFocusHdl, void *, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 5da1e4c273f7..5b55d47b70cd 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1513,3 +1514,4 @@ void ScContentTree::StoreSettings() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/navipi/navcitem.cxx b/sc/source/ui/navipi/navcitem.cxx
index e5002c44c60e..c6346ccc32c7 100644
--- a/sc/source/ui/navipi/navcitem.cxx
+++ b/sc/source/ui/navipi/navcitem.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125,3 +126,4 @@ void __EXPORT ScNavigatorControllerItem::StateChanged( USHORT /* nSID */, SfxIte
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index e5f459d5b335..399cc85638c0 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1562,3 +1563,4 @@ BOOL __EXPORT ScNavigatorDlg::QueryDrop( DropEvent& rEvt )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index e7dff0bf37c7..d8733a2cfef2 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -307,3 +308,4 @@ void ScScenarioWindow::SetSizePixel( const Size& rNewSize )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx
index 1a45ab715dee..f438b3cdfcbc 100644
--- a/sc/source/ui/optdlg/opredlin.cxx
+++ b/sc/source/ui/optdlg/opredlin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -287,3 +288,4 @@ IMPL_LINK( ScRedlineOptionsTabPage, ColorHdl, ColorListBox *, EMPTYARG )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 5b5920e904fc..7d56184d014e 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -303,3 +304,4 @@ IMPL_LINK( ScTpCalcOptions, CheckClickHdl, CheckBox*, pBtn )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index f793a058312d..8d7dd7daff95 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -289,3 +290,5 @@ int ScTpFormulaOptions::DeactivatePage(SfxItemSet* /*pSet*/)
// What's this method for ?
return KEEP_PAGE;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx
index d14b79bd739a..31f913e23061 100644
--- a/sc/source/ui/optdlg/tpprint.cxx
+++ b/sc/source/ui/optdlg/tpprint.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -142,3 +143,4 @@ BOOL ScTpPrintOptions::FillItemSet( SfxItemSet& rCoreAttrs )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index e3f6e488c310..da188c65470b 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -825,3 +826,4 @@ IMPL_LINK( ScTpUserLists, EdEntriesModHdl, MultiLineEdit*, pEd )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 5c2e8dd52c9f..7c49d6d2d54c 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -743,3 +744,4 @@ IMPL_LINK( ScTpLayoutOptions, AlignHdl, CheckBox*, pBox )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index 915355d5d0f2..2391d426073e 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -904,3 +905,4 @@ void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIs
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/hfedtdlg.cxx b/sc/source/ui/pagedlg/hfedtdlg.cxx
index 263b4c0bae30..3fa032989dfc 100644
--- a/sc/source/ui/pagedlg/hfedtdlg.cxx
+++ b/sc/source/ui/pagedlg/hfedtdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -183,3 +184,4 @@ void __EXPORT ScHFEditDlg::PageCreated( USHORT /* nId */, SfxTabPage& rPage )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 15d1b646b73f..5ea90ef0d77d 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -997,3 +998,5 @@ USHORT* __EXPORT ScLeftFooterEditPage::GetRanges()
SfxTabPage* __EXPORT ScLeftFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
{ return ( new ScLeftFooterEditPage( pParent, rCoreSet ) ); };
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index 7c1c3046f743..96150acf4960 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -328,3 +329,4 @@ USHORT* __EXPORT ScFooterPage::GetRanges()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index fef6778d184f..52d8d7cad040 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -563,3 +564,4 @@ Timer
*/
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx
index a2b732464e12..a85ef657a3e1 100644
--- a/sc/source/ui/pagedlg/tptable.cxx
+++ b/sc/source/ui/pagedlg/tptable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -568,3 +569,4 @@ BOOL lcl_PutScaleItem2( USHORT nWhich,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/src/datafdlg.src b/sc/source/ui/src/datafdlg.src
new file mode 100644
index 000000000000..2c07a704d1c0
--- /dev/null
+++ b/sc/source/ui/src/datafdlg.src
@@ -0,0 +1,95 @@
+/*
+ * 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@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
+ModalDialog RID_SCDLG_DATAFORM
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 191 , 180 ) ;
+ Text [ en-US ] = "Data Form" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ FixedText LAB_DATAFORM_RECORDNO
+ {
+ Pos = MAP_APPFONT ( 136 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 12 ) ;
+ Text [ en-US ] = "/" ;
+ };
+ PushButton BTN_DATAFORM_NEW
+ {
+ Pos = MAP_APPFONT ( 135 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ Text [ en-US ] = "New" ;
+ };
+ PushButton BTN_DATAFORM_DELETE
+ {
+ Pos = MAP_APPFONT ( 135 , 40 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Delete" ;
+ };
+ PushButton BTN_DATAFORM_RESTORE
+ {
+ Pos = MAP_APPFONT ( 135 , 57 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Restore" ;
+ };
+ PushButton BTN_DATAFORM_LAST
+ {
+ Pos = MAP_APPFONT ( 135 , 82 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Last Record" ;
+ };
+ PushButton BTN_DATAFORM_NEXT
+ {
+ Pos = MAP_APPFONT ( 135 , 99 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Next Record" ;
+ };
+ PushButton BTN_DATAFORM_CLOSE
+ {
+ Pos = MAP_APPFONT ( 135 , 116 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Close" ;
+ };
+ ScrollBar WND_DATAFORM_SCROLLBAR
+ {
+ Pos = MAP_APPFONT ( 124 , 6 ) ;
+ Size = MAP_APPFONT ( 8 , 135 ) ;
+ HScroll = FALSE ;
+ TabStop = FALSE ;
+ };
+};
+//end
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 6f0b1f1fd789..c18dd724014b 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -1718,6 +1718,77 @@ Resource RID_GLOBSTR
{
Text [ en-US ] = "Unknown User";
};
+
+ String STR_SHAPE_AUTOSHAPE
+ {
+ Text [ en-US ] = "AutoShape";
+ };
+
+ String STR_SHAPE_RECTANGLE
+ {
+ Text [ en-US ] = "Rectangle";
+ };
+
+ String STR_SHAPE_LINE
+ {
+ Text [ en-US ] = "Line";
+ };
+
+ String STR_SHAPE_OVAL
+ {
+ Text [ en-US ] = "Oval";
+ };
+
+ String STR_SHAPE_TEXTBOX
+ {
+ Text [ en-US ] = "Text Box";
+ };
+
+ String STR_FORM_BUTTON
+ {
+ Text [ en-US ] = "Button";
+ };
+
+ String STR_FORM_CHECKBOX
+ {
+ Text [ en-US ] = "Check Box";
+ };
+
+ String STR_FORM_OPTIONBUTTON
+ {
+ Text [ en-US ] = "Option Button";
+ };
+
+ String STR_FORM_LABEL
+ {
+ Text [ en-US ] = "Label";
+ };
+
+ String STR_FORM_LISTBOX
+ {
+ Text [ en-US ] = "List Box";
+ };
+
+ String STR_FORM_GROUPBOX
+ {
+ Text [ en-US ] = "Group Box";
+ };
+
+ String STR_FORM_DROPDOWN
+ {
+ Text [ en-US ] = "Drop Down";
+ };
+
+ String STR_FORM_SPINNER
+ {
+ Text [ en-US ] = "Spinner";
+ };
+
+ String STR_FORM_SCROLLBAR
+ {
+ Text [ en-US ] = "Scroll Bar";
+ };
+
String STR_STYLE_FAMILY_CELL
{
Text [ en-US ] = "Cell Styles";
diff --git a/sc/source/ui/src/makefile.mk b/sc/source/ui/src/makefile.mk
index 96bb78e2902c..7036ad8bde27 100644
--- a/sc/source/ui/src/makefile.mk
+++ b/sc/source/ui/src/makefile.mk
@@ -53,6 +53,7 @@ SRC1FILES = \
dbnamdlg.src \
subtdlg.src \
miscdlgs.src \
+ datafdlg.src \
autofmt.src \
solvrdlg.src \
optsolver.src \
diff --git a/sc/source/ui/styleui/styledlg.cxx b/sc/source/ui/styleui/styledlg.cxx
index 2452f338b8e7..bc2d2f2dfdf0 100644
--- a/sc/source/ui/styleui/styledlg.cxx
+++ b/sc/source/ui/styleui/styledlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -215,3 +216,4 @@ const SfxItemSet* __EXPORT ScStyleDlg::GetRefreshedSet()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx
index 8f5ce350b887..9f2b4eb7f03c 100644
--- a/sc/source/ui/undo/areasave.cxx
+++ b/sc/source/ui/undo/areasave.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -228,3 +229,4 @@ ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocum
return pColl;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/refundo.cxx b/sc/source/ui/undo/refundo.cxx
index c863259ddf94..e4ca41b3ed30 100644
--- a/sc/source/ui/undo/refundo.cxx
+++ b/sc/source/ui/undo/refundo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -212,3 +213,4 @@ void ScRefUndoData::DoUndo( ScDocument* pDoc, BOOL bUndoRefFirst )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/target.cxx b/sc/source/ui/undo/target.cxx
index 1c2e4a925378..492c18bebc9a 100644
--- a/sc/source/ui/undo/target.cxx
+++ b/sc/source/ui/undo/target.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,5 @@ TYPEINIT1(ScTabViewTarget, SfxRepeatTarget);
__EXPORT ScTabViewTarget::~ScTabViewTarget()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index fffb76ebd061..e1d7c65c5072 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -537,3 +538,4 @@ BOOL ScUndoWrapper::CanRepeat(SfxRepeatTarget& rTarget) const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 6a12201d9b41..eda49aa114c5 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2273,3 +2274,4 @@ BOOL __EXPORT ScUndoBorder::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index 2ab03eb71923..4a46c61683c5 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -213,3 +214,4 @@ BOOL __EXPORT ScUndoWidthOrHeight::CanRepeat(SfxRepeatTarget& rTarget) const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index f5c05178ac8a..f73e664a5bcd 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2177,3 +2178,4 @@ BOOL __EXPORT ScUndoUpdateAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) co
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index a9376e5e9b1d..65e903c42990 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1143,3 +1144,4 @@ BOOL __EXPORT ScUndoRangeNames::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index 36b192abce24..308a3e7b2ef7 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,6 +53,8 @@
#include "attrib.hxx"
#include "hints.hxx"
#include "sc.hrc"
+#include "chgtrack.hxx" // Amelia Wang
+#include "refundo.hxx" // Amelia Wang
// -----------------------------------------------------------------------
@@ -71,6 +74,7 @@ TYPEINIT1(ScUndoRepeatDB, ScSimpleUndo);
TYPEINIT1(ScUndoDataPilot, ScSimpleUndo);
TYPEINIT1(ScUndoConsolidate, ScSimpleUndo);
TYPEINIT1(ScUndoChartData, ScSimpleUndo);
+TYPEINIT1(ScUndoDataForm, SfxUndoAction); // amelia
// -----------------------------------------------------------------------
@@ -2027,8 +2031,211 @@ BOOL __EXPORT ScUndoChartData::CanRepeat(SfxRepeatTarget& /* rTarget */) const
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 --git a/sc/source/ui/undo/undodraw.cxx b/sc/source/ui/undo/undodraw.cxx
index a10a7381d808..e1bfb468fb4e 100644
--- a/sc/source/ui/undo/undodraw.cxx
+++ b/sc/source/ui/undo/undodraw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -267,3 +268,4 @@ BOOL __EXPORT ScUndoDraw::CanRepeat(SfxRepeatTarget& rTarget) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoolk.cxx b/sc/source/ui/undo/undoolk.cxx
index 183b9d1cd7b4..bfb1e0a27cc6 100644
--- a/sc/source/ui/undo/undoolk.cxx
+++ b/sc/source/ui/undo/undoolk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -100,3 +101,4 @@ void EnableDrawAdjust( ScDocument* pDoc, BOOL bEnable )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index b4ea7f35448c..5d4af591a2bc 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -309,3 +310,4 @@ BOOL ScUndoApplyPageStyle::CanRepeat(SfxRepeatTarget& /* rTarget */) const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 8d852ce0cda5..c3fdfc156528 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1664,3 +1665,4 @@ String ScUndoLayoutRTL::GetComment() const
return ScGlobal::GetRscString( STR_UNDO_TAB_RTL );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoutil.cxx b/sc/source/ui/undo/undoutil.cxx
index 168975cdda3a..0be0a7f4f363 100644
--- a/sc/source/ui/undo/undoutil.cxx
+++ b/sc/source/ui/undo/undoutil.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -131,3 +132,5 @@ void ScUndoUtil::PaintMore( ScDocShell* pDocShell,
pDocShell->PostPaint( nCol1,nRow1,rRange.aStart.Tab(),
nCol2,nRow2,rRange.aEnd.Tab(), PAINT_GRID );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx b/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx
index e8000d71518b..ac4b8550c292 100644
--- a/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx
+++ b/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,5 @@ void SAL_CALL ScChartRangeSelectionListener::disposing()
{
m_pViewShell = 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx
index 10627222be80..854b0d67b81c 100644
--- a/sc/source/ui/unoobj/addruno.cxx
+++ b/sc/source/ui/unoobj/addruno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,7 +70,7 @@ void ScAddressConversionObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
-sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
+sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString, ::formula::FormulaGrammar::AddressConvention eConv )
{
if (!pDocShell)
return sal_False;
@@ -78,7 +79,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
sal_Bool bSuccess = sal_False;
if ( bIsRange )
{
- USHORT nResult = aRange.ParseAny( rUIString, pDoc );
+ USHORT nResult = aRange.ParseAny( rUIString, pDoc, eConv );
if ( nResult & SCA_VALID )
{
if ( ( nResult & SCA_TAB_3D ) == 0 )
@@ -92,7 +93,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
}
else
{
- USHORT nResult = aRange.aStart.Parse( rUIString, pDoc );
+ USHORT nResult = aRange.aStart.Parse( rUIString, pDoc, eConv );
if ( nResult & SCA_VALID )
{
if ( ( nResult & SCA_TAB_3D ) == 0 )
@@ -116,6 +117,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp
{
{MAP_CHAR_LEN(SC_UNONAME_ADDRESS), 0, &getCppuType((table::CellRangeAddress*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_XL_A1_REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{0,0,0,0,0,0}
@@ -129,6 +131,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp
{
{MAP_CHAR_LEN(SC_UNONAME_ADDRESS), 0, &getCppuType((table::CellAddress*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_XL_A1_REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{0,0,0,0,0,0}
@@ -190,8 +193,11 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr
bSuccess = ParseUIString( aUIString );
}
}
- else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) )
+ else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) )
{
+ ::formula::FormulaGrammar::AddressConvention aConv = ::formula::FormulaGrammar::CONV_OOO;
+ if ( aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) )
+ aConv = ::formula::FormulaGrammar::CONV_XL_A1;
// parse the file format string
rtl::OUString sRepresentation;
if (aValue >>= sRepresentation)
@@ -212,7 +218,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr
}
// parse the rest like a UI string
- bSuccess = ParseUIString( aUIString );
+ bSuccess = ParseUIString( aUIString, aConv );
}
}
else
@@ -265,17 +271,24 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const rtl::OUString&
aRange.aStart.Format( aFormatStr, nFlags, pDoc );
aRet <<= rtl::OUString( aFormatStr );
}
- else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) )
+ else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) )
{
+ ::formula::FormulaGrammar::AddressConvention aConv = ::formula::FormulaGrammar::CONV_OOO;
+ if ( aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) )
+ aConv = ::formula::FormulaGrammar::CONV_XL_A1;
+
// generate file format string - always include sheet
String aFormatStr;
- aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc );
+ aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc, aConv );
if ( bIsRange )
{
// manually concatenate range so both parts always have the sheet name
aFormatStr.Append( (sal_Unicode) ':' );
String aSecond;
- aRange.aEnd.Format( aSecond, SCA_VALID | SCA_TAB_3D, pDoc );
+ USHORT nFlags = SCA_VALID;
+ if( aConv != ::formula::FormulaGrammar::CONV_XL_A1 )
+ nFlags |= SCA_TAB_3D;
+ aRange.aEnd.Format( aSecond, SCA_VALID | SCA_TAB_3D, pDoc, aConv );
aFormatStr.Append( aSecond );
}
aRet <<= rtl::OUString( aFormatStr );
@@ -313,3 +326,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScAddressConversionObj::getSupportedServic
return aRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx
index e3fc18d8a926..81c7e0624521 100644
--- a/sc/source/ui/unoobj/afmtuno.cxx
+++ b/sc/source/ui/unoobj/afmtuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -882,3 +883,4 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScAutoFormatFieldObj )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index 8b20d9849f47..338996a86ede 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1084,3 +1085,4 @@ sal_Bool SAL_CALL ScFunctionListObj::hasByName( const rtl::OUString& aName )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/celllistsource.cxx b/sc/source/ui/unoobj/celllistsource.cxx
index 246555d06f25..c10fadccea7c 100644
--- a/sc/source/ui/unoobj/celllistsource.cxx
+++ b/sc/source/ui/unoobj/celllistsource.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -447,3 +448,5 @@ namespace calc
//.........................................................................
} // namespace calc
//.........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 12ecf80b9e3f..cdb958f0ddf0 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -9859,3 +9860,4 @@ uno::Any SAL_CALL ScUniqueCellFormatsEnumeration::nextElement() throw(container:
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/cellvaluebinding.cxx b/sc/source/ui/unoobj/cellvaluebinding.cxx
index 3b806ccf80b7..9e3cae0756c1 100644
--- a/sc/source/ui/unoobj/cellvaluebinding.cxx
+++ b/sc/source/ui/unoobj/cellvaluebinding.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -661,3 +662,5 @@ namespace calc
//.........................................................................
} // namespace calc
//.........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index f87818553ee1..a841c852f6ed 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -3907,3 +3908,5 @@ void SAL_CALL ScChart2EmptyDataSequence::removeVetoableChangeListener(
// return pRet;
// }
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index 86f59d66a7a4..dd3a0c098229 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -815,3 +816,4 @@ uno::Reference< beans::XPropertySetInfo > ScChartObj::getPropertySetInfo() throw
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index a680185a1d1c..2b513d2b2e71 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -486,3 +487,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScDocumentConfiguration::getSupportedServi
//-------------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/convuno.cxx b/sc/source/ui/unoobj/convuno.cxx
index e3b0c09b25c2..7781ecf6ac4a 100644
--- a/sc/source/ui/unoobj/convuno.cxx
+++ b/sc/source/ui/unoobj/convuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,3 +63,4 @@ void ScUnoConversion::FillLocale( lang::Locale& rLocale, LanguageType eLang )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx
index daf075964a3a..344ca2c71ebd 100644
--- a/sc/source/ui/unoobj/cursuno.cxx
+++ b/sc/source/ui/unoobj/cursuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -508,3 +509,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellCursorObj::getSupportedServiceNames(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index c7bf89671161..4d5286c302a1 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -3552,3 +3553,4 @@ void SAL_CALL ScDataPilotItemObj::removeVetoableChangeListener(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 6e416764eb76..a1026fc4f325 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2369,3 +2370,4 @@ sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const rtl::OUString& aName )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx
index f3f76685e5cb..1a5fd7fca33d 100644
--- a/sc/source/ui/unoobj/defltuno.cxx
+++ b/sc/source/ui/unoobj/defltuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -385,3 +386,4 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyDefault( const rtl::OUString& aPr
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/detreg.cxx b/sc/source/ui/unoobj/detreg.cxx
index 498d0fc886ec..da87ca9e3644 100644
--- a/sc/source/ui/unoobj/detreg.cxx
+++ b/sc/source/ui/unoobj/detreg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,3 +110,4 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImple
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx
index 6c82871d02da..6c0d7375edc1 100644
--- a/sc/source/ui/unoobj/dispuno.cxx
+++ b/sc/source/ui/unoobj/dispuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -413,3 +414,4 @@ void SAL_CALL ScDispatch::disposing( const ::com::sun::star::lang::EventObject&
pViewShell = NULL;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 83c9441d8fc7..8a403beb8be2 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,6 +103,7 @@
#include "scresid.hxx"
using namespace com::sun::star;
+#define SC_UNO_VBADOCOBJ "ThisVBADocObj" // perhaps we want to actually make this ThisWorkbook ?
//------------------------------------------------------------------------
@@ -117,6 +119,7 @@ const SfxItemPropertyMapEntry* lcl_GetDocOptPropertyMap()
{MAP_CHAR_LEN(SC_UNO_AUTOCONTFOC), 0, &getBooleanCppuType(), 0, 0},
{MAP_CHAR_LEN(SC_UNO_BASICLIBRARIES), 0, &getCppuType((uno::Reference< script::XLibraryContainer >*)0), beans::PropertyAttribute::READONLY, 0},
{MAP_CHAR_LEN(SC_UNO_DIALOGLIBRARIES), 0, &getCppuType((uno::Reference< script::XLibraryContainer >*)0), beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(SC_UNO_VBADOCOBJ), 0, &getCppuType((beans::PropertyValue*)0), beans::PropertyAttribute::READONLY, 0},
{MAP_CHAR_LEN(SC_UNO_CALCASSHOWN), PROP_UNO_CALCASSHOWN, &getBooleanCppuType(), 0, 0},
{MAP_CHAR_LEN(SC_UNONAME_CLOCAL), 0, &getCppuType((lang::Locale*)0), 0, 0},
{MAP_CHAR_LEN(SC_UNO_CJK_CLOCAL), 0, &getCppuType((lang::Locale*)0), 0, 0},
@@ -1873,6 +1876,18 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa
{
aRet <<= pDocShell->GetDialogContainer();
}
+ else if ( aString.EqualsAscii( SC_UNO_VBADOCOBJ ) )
+ {
+ // PropertyValue seems extreme because we store
+ // the model ( as the value member ) of the PropertyValue that is
+ // itself a property of the model ( the intention however is to
+ // store something like a Workbook object... but we don't do that )
+ // yet
+ beans::PropertyValue aProp;
+ aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisExcelDoc") );
+ aProp.Value <<= pDocShell->GetModel();
+ aRet <<= aProp;
+ }
else if ( aString.EqualsAscii( SC_UNO_RUNTIMEUID ) )
{
aRet <<= getRuntimeUID();
@@ -3768,3 +3783,4 @@ sal_Bool SAL_CALL ScScenariosObj::hasByName( const rtl::OUString& aName )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/drdefuno.cxx b/sc/source/ui/unoobj/drdefuno.cxx
index 52fce55dfc58..ee4a89baf76b 100644
--- a/sc/source/ui/unoobj/drdefuno.cxx
+++ b/sc/source/ui/unoobj/drdefuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,3 +82,4 @@ SfxItemPool* ScDrawDefaultsObj::getModelPool( sal_Bool bReadOnly ) throw()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx
index 7febe374d0d9..aca36831415d 100644
--- a/sc/source/ui/unoobj/editsrc.cxx
+++ b/sc/source/ui/unoobj/editsrc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -371,3 +372,4 @@ SfxBroadcaster& ScAccessibilityEditSource::GetBroadcaster() const
return mpAccessibleTextData->GetBroadcaster();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx
index d7de00f4cc56..c5e86135319b 100644
--- a/sc/source/ui/unoobj/eventuno.cxx
+++ b/sc/source/ui/unoobj/eventuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -199,3 +200,4 @@ sal_Bool SAL_CALL ScSheetEventsObj::hasElements() throw(uno::RuntimeException)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 07a4cbda0230..7b118eb7c0ad 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1526,3 +1527,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScHeaderFieldObj::getSupportedServiceNames
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index 8c7402de370b..bcbd3a4c4a93 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -310,3 +311,4 @@ void SAL_CALL ScFilterOptionsObj::setSourceDocument( const uno::Reference<lang::
bExport = sal_True;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index ee828136cf14..b1397b3067ce 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1059,3 +1060,4 @@ ScTableValidationObj* ScTableValidationObj::getImplementation(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx
index 2807a12f7dac..e847c4ee25a3 100644
--- a/sc/source/ui/unoobj/forbiuno.cxx
+++ b/sc/source/ui/unoobj/forbiuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,3 +92,4 @@ void ScForbiddenCharsObj::onChange()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 7012b477050c..a4b107492e54 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -743,3 +744,4 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const rtl::OUString& aName,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index a119eda13a32..02bb69a412b9 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1819,3 +1820,4 @@ sal_Bool SAL_CALL ScExternalDocLinksObj::hasElements()
return mpRefMgr->getExternalFileCount() > 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/listenercalls.cxx b/sc/source/ui/unoobj/listenercalls.cxx
index 9abc8e0ab826..8160cd470424 100644
--- a/sc/source/ui/unoobj/listenercalls.cxx
+++ b/sc/source/ui/unoobj/listenercalls.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,3 +88,4 @@ void ScUnoListenerCalls::ExecuteAndClear()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/miscuno.cxx b/sc/source/ui/unoobj/miscuno.cxx
index 77232a176598..57e45f7fc73a 100644
--- a/sc/source/ui/unoobj/miscuno.cxx
+++ b/sc/source/ui/unoobj/miscuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -326,3 +327,4 @@ sal_Bool SAL_CALL ScNameToIndexAccess::hasElements( ) throw(::com::sun::star::u
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 8aa34b88f25d..1b5bc50766fe 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1128,3 +1129,4 @@ sal_Bool SAL_CALL ScLabelRangesObj::hasElements() throw(uno::RuntimeException)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx
index c5dd11977478..453baa96afa4 100644
--- a/sc/source/ui/unoobj/notesuno.cxx
+++ b/sc/source/ui/unoobj/notesuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,16 +57,20 @@
#include <svx/svditer.hxx>
#include <svx/svdpage.hxx>
#include <com/sun/star/drawing/XShapeDescriptor.hpp>
+#include <editeng/unoprnms.hxx>
using namespace com::sun::star;
//------------------------------------------------------------------------
-// keine Properties fuer Text in Notizen
const SvxItemPropertySet* lcl_GetAnnotationPropertySet()
{
static SfxItemPropertyMapEntry aAnnotationPropertyMap_Impl[] =
{
+ SVX_UNOEDIT_CHAR_PROPERTIES,
+ SVX_UNOEDIT_FONT_PROPERTIES,
+ SVX_UNOEDIT_PARA_PROPERTIES,
+ SVX_UNOEDIT_NUMBERING_PROPERTIE, // for completeness of service ParagraphProperties
{0,0,0,0,0,0}
};
static SvxItemPropertySet aAnnotationPropertySet_Impl( aAnnotationPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
@@ -727,3 +732,4 @@ void SAL_CALL ScAnnotationShapeObj::removeEventListener( const uno::Reference< l
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/optuno.cxx b/sc/source/ui/unoobj/optuno.cxx
index 0d277fdb19fe..24da175d5834 100644
--- a/sc/source/ui/unoobj/optuno.cxx
+++ b/sc/source/ui/unoobj/optuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -235,3 +236,4 @@ uno::Any SAL_CALL ScDocOptionsObj::getPropertyValue( const rtl::OUString& aPrope
return aRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/pageuno.cxx b/sc/source/ui/unoobj/pageuno.cxx
index 4687683a8ef4..37b7d83c6886 100644
--- a/sc/source/ui/unoobj/pageuno.cxx
+++ b/sc/source/ui/unoobj/pageuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,3 +77,5 @@ uno::Sequence<rtl::OUString> SAL_CALL ScPageObj::getSupportedServiceNames()
pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDrawPage"));
return aRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index d04681460818..71881493eb2f 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -914,3 +915,4 @@ UNOREFERENCE< UNOXINTERFACE > SAL_CALL ScFilterDetect::impl_createInstance( cons
return UNOREFERENCE< UNOXINTERFACE >( *new ScFilterDetect( xServiceManager ) );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx
index 45f55b03df2c..450c5f8c3ef1 100644
--- a/sc/source/ui/unoobj/servuno.cxx
+++ b/sc/source/ui/unoobj/servuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,6 +37,7 @@
#include <svx/unofill.hxx>
#include <editeng/unonrule.hxx>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
#include "servuno.hxx"
#include "unoguard.hxx"
@@ -72,8 +74,27 @@
#include <basic/basmgr.hxx>
#include <sfx2/app.hxx>
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/document/XCodeNameQuery.hpp>
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
+#include <com/sun/star/form/XFormsSupplier.hpp>
+#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <comphelper/componentcontext.hxx>
+#include <cppuhelper/component_context.hxx>
+#include <vbahelper/vbaaccesshelper.hxx>
+#include <com/sun/star/script/vba/XVBACompatibility.hpp>
+
using namespace ::com::sun::star;
+bool isInVBAMode( ScDocShell& rDocSh )
+{
+ uno::Reference<script::XLibraryContainer> xLibContainer = rDocSh.GetBasicContainer();
+ uno::Reference<script::vba::XVBACompatibility> xVBACompat( xLibContainer, uno::UNO_QUERY );
+ if ( xVBACompat.is() )
+ return xVBACompat->getVBACompatibilityMode();
+ return false;
+}
+
class ScVbaObjectForCodeNameProvider : public ::cppu::WeakImplHelper1< container::XNameAccess >
{
uno::Any maWorkbook;
@@ -286,7 +307,8 @@ static const ProvNamesId_Type __FAR_DATA aProvNamesId[] =
{ "com.sun.star.text.textfield.Time", SC_SERVICE_TIMEFIELD },
{ "com.sun.star.text.textfield.DocumentTitle", SC_SERVICE_TITLEFIELD },
{ "com.sun.star.text.textfield.FileName", SC_SERVICE_FILEFIELD },
- { "com.sun.star.text.textfield.SheetName", SC_SERVICE_SHEETFIELD }
+ { "com.sun.star.text.textfield.SheetName", SC_SERVICE_SHEETFIELD },
+ { "ooo.vba.VBAGlobals", SC_SERVICE_VBAGLOBALS },
};
//
@@ -548,7 +570,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
}
break;
case SC_SERVICE_VBACODENAMEPROVIDER:
- if (pDocShell && pDocShell->GetDocument()->IsInVBAMode())
+ if ( pDocShell && ooo::vba::isAlienExcelDoc( *pDocShell ) && isInVBAMode( *pDocShell ) )
{
OSL_TRACE("**** creating VBA Object provider");
xRet.set(static_cast<document::XCodeNameQuery*>(new ScVbaCodeNameProvider( pDocShell )));
@@ -590,3 +612,4 @@ uno::Sequence<rtl::OUString> ScServiceProvider::GetAllServiceNames()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index 1ed384ed2ebd..a5b8dcba36c4 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,6 +71,8 @@ const SfxItemPropertyMapEntry* lcl_GetShapeMap()
{MAP_CHAR_LEN(SC_UNONAME_HORIPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_IMAGEMAP), 0, &getCppuType((uno::Reference<container::XIndexContainer>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VERTPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 },
+ // #i66550 HLINK_FOR_SHAPES
+ {MAP_CHAR_LEN(SC_UNONAME_HYPERLINK), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{0,0,0,0,0,0}
};
return aShapeMap_Impl;
@@ -84,6 +87,14 @@ const SvEventDescription* ScShapeObj::GetSupportedMacroItems()
};
return aMacroDescriptionsImpl;
}
+// #i66550 HLINK_FOR_SHAPES
+ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, BOOL bCreate = FALSE )
+{
+ if( pShape )
+ if( SdrObject* pObj = pShape->GetSdrObject() )
+ return ScDrawLayer::GetMacroInfo( pObj, bCreate );
+ return 0;
+}
//------------------------------------------------------------------------
@@ -635,6 +646,13 @@ void SAL_CALL ScShapeObj::setPropertyValue(
}
}
}
+ else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) )
+ {
+ rtl::OUString sHlink;
+ ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this, TRUE);
+ if ( ( aValue >>= sHlink ) && pInfo )
+ pInfo->SetHlink( sHlink );
+ }
else
{
GetShapePropertySet();
@@ -816,6 +834,13 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa
}
}
}
+ else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) )
+ {
+ rtl::OUString sHlink;
+ if ( ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this) )
+ sHlink = pInfo->GetHlink();
+ aAny <<= sHlink;
+ }
else
{
GetShapePropertySet();
@@ -1339,11 +1364,6 @@ SdrObject* ScShapeObj::GetSdrObject() const throw()
}
#define SC_EVENTACC_ONCLICK ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) )
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
-#define SC_EVENTACC_ONACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) )
-#define SC_EVENTACC_URL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) )
-#define SC_EVENTACC_ACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) )
-#endif
#define SC_EVENTACC_SCRIPT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Script" ) )
#define SC_EVENTACC_EVENTTYPE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) )
@@ -1355,10 +1375,7 @@ private:
ScMacroInfo* getInfo( BOOL bCreate = FALSE )
{
- if( mpShape )
- if( SdrObject* pObj = mpShape->GetSdrObject() )
- return ScDrawLayer::GetMacroInfo( pObj, bCreate );
- return 0;
+ return lcl_getShapeHyperMacroInfo( mpShape, bCreate );
}
public:
@@ -1384,11 +1401,7 @@ public:
isEventType = true;
continue;
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- if ( isEventType && ((pProperties->Name == SC_EVENTACC_SCRIPT) || (pProperties->Name == SC_EVENTACC_URL)) )
-#else
if ( isEventType && (pProperties->Name == SC_EVENTACC_SCRIPT) )
-#endif
{
rtl::OUString sValue;
if ( pProperties->Value >>= sValue )
@@ -1399,10 +1412,8 @@ public:
break;
if ( pProperties->Name == SC_EVENTACC_SCRIPT )
pInfo->SetMacro( sValue );
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
else
pInfo->SetHlink( sValue );
-#endif
}
}
}
@@ -1425,19 +1436,6 @@ public:
aProperties[ 1 ].Value <<= pInfo->GetMacro();
}
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- else if( aName == SC_EVENTACC_ONACTION )
- {
- if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
- {
- aProperties.realloc( 2 );
- aProperties[ 0 ].Name = SC_EVENTACC_EVENTTYPE;
- aProperties[ 0 ].Value <<= SC_EVENTACC_ACTION;
- aProperties[ 1 ].Name = SC_EVENTACC_URL;
- aProperties[ 1 ].Value <<= pInfo->GetHlink();
- }
- }
-#endif
else
{
throw container::NoSuchElementException();
@@ -1448,25 +1446,14 @@ public:
virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames() throw(uno::RuntimeException)
{
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- uno::Sequence< rtl::OUString > aSeq( 2 );
-#else
uno::Sequence< rtl::OUString > aSeq( 1 );
-#endif
aSeq[ 0 ] = SC_EVENTACC_ONCLICK;
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- aSeq[ 1 ] = SC_EVENTACC_ONACTION;
-#endif
return aSeq;
}
virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
{
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- return (aName == SC_EVENTACC_ONCLICK) || (aName == SC_EVENTACC_ONACTION);
-#else
return aName == SC_EVENTACC_ONCLICK;
-#endif
}
// XElementAccess
@@ -1519,3 +1506,5 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScShapeObj::getSupportedServiceNames(
aSupported[ aSupported.getLength() - 1 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.Shape" ) );
return aSupported;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx
index f0bff44dc05c..d1999ed7bd13 100644
--- a/sc/source/ui/unoobj/srchuno.cxx
+++ b/sc/source/ui/unoobj/srchuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -276,3 +277,4 @@ ScCellSearchObj* ScCellSearchObj::getImplementation(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 36c2962bfc71..ea310e72a127 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2133,3 +2134,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScStyleObj::getSupportedServiceNames()
//------------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx
index e4a0768002a6..fa7d128b7f89 100644
--- a/sc/source/ui/unoobj/targuno.cxx
+++ b/sc/source/ui/unoobj/targuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -314,3 +315,4 @@ sal_Bool SAL_CALL ScLinkTargetsObj::hasElements(void) throw( uno::RuntimeExcepti
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 5c45195621d8..e24637d179ea 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1150,3 +1151,4 @@ ScCellTextObj::~ScCellTextObj() throw()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index 49e5c65e29ec..a2cb339db36c 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -467,3 +468,4 @@ ScFormulaOpCodeMapperObj::ScFormulaOpCodeMapperObj(::std::auto_ptr<formula::Form
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/unodoc.cxx b/sc/source/ui/unoobj/unodoc.cxx
index d3d755e8b495..772bce48df0f 100644
--- a/sc/source/ui/unoobj/unodoc.cxx
+++ b/sc/source/ui/unoobj/unodoc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,3 +66,4 @@ uno::Reference< uno::XInterface > SAL_CALL ScDocument_createInstance(
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/unoguard.cxx b/sc/source/ui/unoobj/unoguard.cxx
index ff1c94338b72..6f7a6bb9036a 100644
--- a/sc/source/ui/unoobj/unoguard.cxx
+++ b/sc/source/ui/unoobj/unoguard.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,3 +46,4 @@ ScUnoGuard::ScUnoGuard() :
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/unoreflist.cxx b/sc/source/ui/unoobj/unoreflist.cxx
index 65f43273f6e7..1a80e1e8b2c7 100644
--- a/sc/source/ui/unoobj/unoreflist.cxx
+++ b/sc/source/ui/unoobj/unoreflist.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,4 @@ ScUnoRefUndoHint::~ScUnoRefUndoHint()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 86ebf066a52d..d939018b707a 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -460,6 +461,91 @@ void SAL_CALL ScViewPaneObj::release() throw()
OWeakObject::release();
}
+// To process sheet compatibile event
+typedef ::cppu::WeakImplHelper2< awt::XEnhancedMouseClickHandler, view::XSelectionChangeListener > TabViewEventListener_BASE;
+class ScTabViewEventListener: public TabViewEventListener_BASE
+{
+private:
+ ScTabViewObj* pViewObj;
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEventsHelper;
+ sal_Bool bDelaySelectionEvent;
+ sal_Bool bSelectionChangeOccured;
+
+ void fireSelectionChangeEvent();
+
+public:
+ ScTabViewEventListener( ScTabViewObj* pObj, uno::Reference< script::vba::XVBAEventProcessor >& rVbaEventsHelper);
+ ~ScTabViewEventListener();
+ // XEnhancedMouseClickHandler
+ virtual sal_Bool SAL_CALL mousePressed( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException);
+ virtual sal_Bool SAL_CALL mouseReleased( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException);
+
+ // XSelectionChangeListener
+ virtual void SAL_CALL selectionChanged( const lang::EventObject& aEvent ) throw ( uno::RuntimeException );
+ // XEventListener
+ virtual void SAL_CALL disposing( const lang::EventObject& aEvent ) throw ( uno::RuntimeException );
+};
+
+ScTabViewEventListener::ScTabViewEventListener(ScTabViewObj* pObj, uno::Reference< script::vba::XVBAEventProcessor >& rVbaEventsHelper):
+ pViewObj( pObj ),xVbaEventsHelper( rVbaEventsHelper ), bDelaySelectionEvent( sal_False ), bSelectionChangeOccured( sal_False )
+{
+}
+
+ScTabViewEventListener::~ScTabViewEventListener()
+{
+}
+
+void SAL_CALL ScTabViewEventListener::disposing( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException )
+{
+}
+
+void ScTabViewEventListener::fireSelectionChangeEvent()
+{
+ if ( xVbaEventsHelper.is() && pViewObj )
+ {
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[0] = pViewObj->getSelection();
+ try
+ {
+ xVbaEventsHelper->processVbaEvent( script::vba::VBAEventId::WORKSHEET_SELECTIONCHANGE, aArgs );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ bDelaySelectionEvent = sal_False;
+ bSelectionChangeOccured = sal_False;
+}
+
+sal_Bool SAL_CALL ScTabViewEventListener::mousePressed( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException)
+{
+ // Delay to fire the selection change event if clicking the left mouse button to do selection.
+ bDelaySelectionEvent = ( e.Buttons == ::com::sun::star::awt::MouseButton::RIGHT ) ? sal_False : sal_True;
+ bSelectionChangeOccured = sal_False;
+
+ // ScTabViewObj::MousePressed should handle process BeforeDoubleClick and BeforeRightClick events
+ return sal_True;
+}
+
+sal_Bool SAL_CALL ScTabViewEventListener::mouseReleased( const awt::EnhancedMouseEvent&/*e*/) throw (uno::RuntimeException)
+{
+ if ( bSelectionChangeOccured )
+ fireSelectionChangeEvent();
+ return sal_True;
+}
+
+void SAL_CALL ScTabViewEventListener::selectionChanged( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException )
+{
+ if ( !bDelaySelectionEvent )
+ {
+ fireSelectionChangeEvent();
+ }
+ else
+ {
+ bSelectionChangeOccured = sal_True;
+ }
+}
+
//------------------------------------------------------------------------
// Default-ctor wird fuer SMART_REFLECTION_IMPLEMENTATION gebraucht
@@ -474,7 +560,22 @@ ScTabViewObj::ScTabViewObj( ScTabViewShell* pViewSh ) :
bDrawSelModeSet(sal_False)
{
if (pViewSh)
+ {
nPreviousTab = pViewSh->GetViewData()->GetTabNo();
+ ScViewData* pViewData = pViewSh->GetViewData();
+ if( pViewData )
+ {
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEventsHelper (pViewData->GetDocument()->GetVbaEventProcessor(), uno::UNO_QUERY );
+ if ( xVbaEventsHelper.is() )
+ {
+ ScTabViewEventListener* pEventListener = new ScTabViewEventListener( this, xVbaEventsHelper );
+ uno::Reference< awt::XEnhancedMouseClickHandler > aMouseClickHandler( *pEventListener, uno::UNO_QUERY );
+ addEnhancedMouseClickHandler( aMouseClickHandler );
+ uno::Reference< view::XSelectionChangeListener > aSelectionChangeListener( *pEventListener, uno::UNO_QUERY );
+ addSelectionChangeListener( aSelectionChangeListener );
+ }
+ }
+ }
}
ScTabViewObj::~ScTabViewObj()
@@ -1162,10 +1263,20 @@ uno::Reference<sheet::XSpreadsheet> SAL_CALL ScTabViewObj::getActiveSheet()
return NULL;
}
+//liuchen 2009-9-2 support expand (but not replace) the active sheet
void SAL_CALL ScTabViewObj::setActiveSheet( const uno::Reference<sheet::XSpreadsheet>& xActiveSheet )
throw(uno::RuntimeException)
{
+ selectSheet(xActiveSheet, false);
+}
+
+void SAL_CALL
+ScTabViewObj::selectSheet( const uno::Reference<sheet::XSpreadsheet>& xActiveSheet,
+ sal_Bool bExpand)
+ throw(uno::RuntimeException)
+{
ScUnoGuard aGuard;
+ sal_Bool bNew = bExpand;
ScTabViewShell* pViewSh = GetViewShell();
if ( pViewSh && xActiveSheet.is() )
@@ -1180,7 +1291,7 @@ void SAL_CALL ScTabViewObj::setActiveSheet( const uno::Reference<sheet::XSpreads
{
SCTAB nNewTab = rRanges.GetObject(0)->aStart.Tab();
if ( pViewSh->GetViewData()->GetDocument()->HasTable(nNewTab) )
- pViewSh->SetTabNo( nNewTab );
+ pViewSh->SetTabNo( nNewTab, bNew, bExpand );
}
}
}
@@ -1837,19 +1948,7 @@ void ScTabViewObj::SelectionChanged()
/*ErrCode eRet =*/ pDocSh->CallXScript( *pScript, aParams, aRet, aOutArgsIndex, aOutArgs );
}
}
-
- // execute VBA event handler
- try
- {
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( pDoc->GetVbaEventProcessor(), uno::UNO_SET_THROW );
- // the parameter is the clicked object, as in the mousePressed call above
- uno::Sequence< uno::Any > aArgs( 1 );
- aArgs[ 0 ] <<= getSelection();
- xVbaEvents->processVbaEvent( ScSheetEvents::GetVbaSheetEventId( SC_SHEETEVENT_SELECT ), aArgs );
- }
- catch( uno::Exception& )
- {
- }
+ // Removed Sun/Oracle code intentionally, it doesn't work properly ( selection should be fired after mouse release )
}
@@ -1874,6 +1973,12 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
ScUnoGuard aGuard;
String aString(aPropertyName);
+ if ( aString.EqualsAscii(SC_UNO_FILTERED_RANGE_SELECTION) )
+ {
+ bFilteredRangeSelection = ScUnoHelpFunctions::GetBoolFromAny(aValue);
+ return;
+ }
+
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
@@ -1994,6 +2099,12 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const rtl::OUString& aProperty
String aString(aPropertyName);
uno::Any aRet;
+ if ( aString.EqualsAscii(SC_UNO_FILTERED_RANGE_SELECTION) )
+ {
+ ScUnoHelpFunctions::SetBoolInAny(aRet, bFilteredRangeSelection);
+ return aRet;
+ }
+
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
@@ -2345,3 +2456,4 @@ void SAL_CALL ScTabViewObj::insertTransferable( const ::com::sun::star::uno::Ref
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/warnpassword.cxx b/sc/source/ui/unoobj/warnpassword.cxx
index ce81fd2645c4..c00df0a3eedf 100644
--- a/sc/source/ui/unoobj/warnpassword.cxx
+++ b/sc/source/ui/unoobj/warnpassword.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,4 @@ bool ScWarnPassword::WarningOnPassword( SfxMedium& rMedium )
return bReturn;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx
index 2c39d7154b4b..3ca5ba861dc8 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,9 @@
#include "transobj.hxx"
#include "scmod.hxx"
#include "cellsuno.hxx"
+#include "compiler.hxx"
+#include "token.hxx"
+#include "tokenarray.hxx"
#include <comphelper/processfactory.hxx>
#include <com/sun/star/sheet/XSheetCellRange.hpp>
@@ -43,6 +47,52 @@ namespace vba
namespace excel
{
+uno::Reference< sheet::XDatabaseRanges >
+GetDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException )
+{
+ uno::Reference< frame::XModel > xModel;
+ if ( pShell )
+ xModel.set( pShell->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XDatabaseRanges > xDBRanges( xModelProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DatabaseRanges") ) ), uno::UNO_QUERY_THROW );
+ return xDBRanges;
+}
+
+// returns the XDatabaseRange for the autofilter on sheet (nSheet)
+// also populates sName with the name of range
+uno::Reference< sheet::XDatabaseRange >
+GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) throw ( uno::RuntimeException )
+{
+ uno::Reference< container::XIndexAccess > xIndexAccess( GetDataBaseRanges( pShell ), uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XDatabaseRange > xDataBaseRange;
+ table::CellRangeAddress dbAddress;
+ for ( sal_Int32 index=0; index < xIndexAccess->getCount(); ++index )
+ {
+ uno::Reference< sheet::XDatabaseRange > xDBRange( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNamed > xNamed( xDBRange, uno::UNO_QUERY_THROW );
+ // autofilters work weirdly with openoffice, unnamed is the default
+ // named range which is used to create an autofilter, but
+ // its also possible that another name could be used
+ // this also causes problems when an autofilter is created on
+ // another sheet
+ // ( but.. you can use any named range )
+ dbAddress = xDBRange->getDataArea();
+ if ( dbAddress.Sheet == nSheet )
+ {
+ sal_Bool bHasAuto = sal_False;
+ uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW );
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ) ) >>= bHasAuto;
+ if ( bHasAuto )
+ {
+ sName = xNamed->getName();
+ xDataBaseRange=xDBRange;
+ break;
+ }
+ }
+ }
+ return xDataBaseRange;
+}
+
ScDocShell* GetDocShellFromRange( const uno::Reference< uno::XInterface >& xRange ) throw ( uno::RuntimeException )
{
ScCellRangesBase* pScCellRangesBase = ScCellRangesBase::getImplementation( xRange );
@@ -53,6 +103,13 @@ ScDocShell* GetDocShellFromRange( const uno::Reference< uno::XInterface >& xRang
return pScCellRangesBase->GetDocShell();
}
+ScDocShell* GetDocShellFromRanges( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) throw ( uno::RuntimeException )
+{
+ // need the ScCellRangesBase to get docshell
+ uno::Reference< uno::XInterface > xIf( xRanges, uno::UNO_QUERY_THROW );
+ return GetDocShellFromRange( xIf );
+}
+
ScDocument* GetDocumentFromRange( const uno::Reference< uno::XInterface >& xRange ) throw ( uno::RuntimeException )
{
ScDocShell* pDocShell = GetDocShellFromRange( xRange );
@@ -63,6 +120,16 @@ ScDocument* GetDocumentFromRange( const uno::Reference< uno::XInterface >& xRang
return pDocShell->GetDocument();
}
+uno::Reference< frame::XModel > GetModelFromRange( const uno::Reference< uno::XInterface >& xRange ) throw ( uno::RuntimeException )
+{
+ ScDocShell* pDocShell = GetDocShellFromRange( xRange );
+ if ( !pDocShell )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access underlying model uno range object" ) ), uno::Reference< uno::XInterface >() );
+ }
+ return pDocShell->GetModel();
+}
+
void implSetZoom( const uno::Reference< frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs )
{
ScTabViewShell* pViewSh = excel::getBestViewShell( xModel );
@@ -192,6 +259,15 @@ void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, USHORT nFl
}
+void implnCopyRange( const uno::Reference< frame::XModel>& xModel, const ScRange& rRange )
+{
+ ScTabViewShell* pViewShell = getBestViewShell( xModel );
+ if ( pViewShell )
+ {
+ pViewShell->CopyToClip( NULL, rRange, FALSE, TRUE, TRUE );
+ }
+}
+
ScDocShell*
getDocShell( const css::uno::Reference< css::frame::XModel>& xModel )
{
@@ -229,6 +305,19 @@ getViewFrame( const uno::Reference< frame::XModel >& xModel )
return NULL;
}
+sal_Bool IsR1C1ReferFormat( ScDocument* pDoc, const rtl::OUString& sRangeStr )
+{
+ ScRangeList aCellRanges;
+ String sAddress( sRangeStr );
+ USHORT nMask = SCA_VALID;
+ USHORT rResFlags = aCellRanges.Parse( sAddress, pDoc, nMask, formula::FormulaGrammar::CONV_XL_R1C1 );
+ if ( rResFlags & SCA_VALID )
+ {
+ return sal_True;
+ }
+ return sal_False;
+}
+
uno::Reference< XHelperInterface >
getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException )
{
@@ -246,6 +335,84 @@ getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw
return xParent;
}
+formula::FormulaGrammar::Grammar GetFormulaGrammar( ScDocument* pDoc, const ScAddress& sAddress, const css::uno::Any& aFormula )
+{
+ formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_NATIVE_XL_A1;
+ if ( pDoc && aFormula.hasValue() && aFormula.getValueTypeClass() == uno::TypeClass_STRING )
+ {
+ rtl::OUString sFormula;
+ aFormula >>= sFormula;
+
+ ScCompiler aCompiler( pDoc, sAddress );
+ aCompiler.SetGrammar( formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 );
+ ScTokenArray* pCode = aCompiler.CompileString( sFormula );
+ if ( pCode )
+ {
+ USHORT nLen = pCode->GetLen();
+ formula::FormulaToken** pTokens = pCode->GetArray();
+ for ( USHORT nPos = 0; nPos < nLen; nPos++ )
+ {
+ const formula::FormulaToken& rToken = *pTokens[nPos];
+ switch ( rToken.GetType() )
+ {
+ case formula::svSingleRef:
+ case formula::svDoubleRef:
+ {
+ return formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1;
+ }
+ break;
+ default: break;
+ }
+ }
+ }
+ }
+ return eGrammar;
+}
+
+void CompileExcelFormulaToODF( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula )
+{
+ if ( !pDoc )
+ {
+ return;
+ }
+ ScCompiler aCompiler( pDoc, ScAddress() );
+ aCompiler.SetGrammar( excel::GetFormulaGrammar( pDoc, ScAddress(), uno::Any( rtl::OUString( rOldFormula ) ) ) );
+ ScTokenArray* pCode = aCompiler.CompileString( rOldFormula );
+ aCompiler.SetGrammar( formula::FormulaGrammar::GRAM_PODF_A1 );
+ aCompiler.CreateStringFromTokenArray( rNewFormula );
+}
+
+void CompileODFFormulaToExcel( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula, const formula::FormulaGrammar::Grammar eGrammar )
+{
+ // eGrammar can be formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 and formula::FormulaGrammar::GRAM_NATIVE_XL_A1
+ if ( !pDoc )
+ {
+ return;
+ }
+ ScCompiler aCompiler( pDoc, ScAddress() );
+ aCompiler.SetGrammar( formula::FormulaGrammar::GRAM_PODF_A1 );
+ ScTokenArray* pCode = aCompiler.CompileString( rOldFormula );
+ aCompiler.SetGrammar( eGrammar );
+ if ( !pCode )
+ {
+ return;
+ }
+ USHORT nLen = pCode->GetLen();
+ formula::FormulaToken** pTokens = pCode->GetArray();
+ for ( USHORT nPos = 0; nPos < nLen && pTokens[nPos]; nPos++ )
+ {
+ String rFormula;
+ formula::FormulaToken* pToken = pTokens[nPos];
+ aCompiler.CreateStringFromToken( rFormula, pToken, TRUE );
+ if ( pToken->GetOpCode() == ocSep )
+ {
+ // Excel formula separator is ",".
+ rFormula = String::CreateFromAscii(",");
+ }
+ rNewFormula += rFormula;
+ }
+}
+
uno::Reference< XHelperInterface >
getUnoSheetModuleObj( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) throw ( uno::RuntimeException )
{
@@ -266,3 +433,5 @@ ScVbaCellRangeAccess::GetDataSet( ScCellRangesBase* pRangeObj )
} //excel
} //vba
} //ooo
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx
index da0474e6ceb0..fca3d11958fc 100644
--- a/sc/source/ui/vba/excelvbahelper.hxx
+++ b/sc/source/ui/vba/excelvbahelper.hxx
@@ -29,9 +29,12 @@
#include<vbahelper/vbahelper.hxx>
#include <docsh.hxx>
+#include <com/sun/star/sheet/XDatabaseRanges.hpp>
+#include <com/sun/star/sheet/XDatabaseRange.hpp>
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
#include <ooo/vba/XHelperInterface.hpp>
+#include <formula/grammar.hxx>
class ScCellRangesBase;
@@ -39,29 +42,39 @@ namespace ooo
{
namespace vba
{
- namespace excel
+ namespace excel
{
- // nTabs empty means apply zoom to all sheets
- void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs );
- void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel );
- void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel );
- void implnCut( const css::uno::Reference< css::frame::XModel>& xModel );
- void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose);
- ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
- ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
- ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext );
- SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel );
+ // nTabs empty means apply zoom to all sheets
+ void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs );
+ void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel );
+ void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel );
+ void implnCut( const css::uno::Reference< css::frame::XModel>& xModel );
+ void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose);
+ void implnCopyRange( const css::uno::Reference< css::frame::XModel>& xModel, const ScRange& rRange );
+ ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
+ ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
+ ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel );
+ sal_Bool IsR1C1ReferFormat( ScDocument* pDoc, const ::rtl::OUString& sRangeStr );
+ formula::FormulaGrammar::Grammar GetFormulaGrammar( ScDocument* pDoc, const ScAddress& sAddress, const css::uno::Any& aFormula );
+ void CompileExcelFormulaToODF( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula );
+ void CompileODFFormulaToExcel( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula, const formula::FormulaGrammar::Grammar eGrammar );
+ css::uno::Reference< css::sheet::XDatabaseRanges > GetDataBaseRanges( ScDocShell* pShell ) throw ( css::uno::RuntimeException );
+
+ css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) throw ( css::uno::RuntimeException );
css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException );
css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::uno::RuntimeException );
ScDocShell* GetDocShellFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
+ ScDocShell* GetDocShellFromRanges( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException );
ScDocument* GetDocumentFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
css::uno::Reference< css::frame::XModel > GetModelFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
+
class ScVbaCellRangeAccess
{
public:
static SfxItemSet* GetDataSet( ScCellRangesBase* pRangeObj );
};
-}
-}
+ }
+ }
}
#endif
diff --git a/sc/source/ui/vba/makefile.mk b/sc/source/ui/vba/makefile.mk
index 92bb3fd39db0..ba50cbad9abd 100644
--- a/sc/source/ui/vba/makefile.mk
+++ b/sc/source/ui/vba/makefile.mk
@@ -31,7 +31,7 @@ PRJNAME=sc
TARGET=vbaobj
ENABLE_EXCEPTIONS=TRUE
VISIBILITY_HIDDEN=TRUE
-
+CDEFS+=-DVBA_OOBUILD_HACK
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -63,18 +63,29 @@ SLOFILES= \
$(SLO)$/vbacharttitle.obj \
$(SLO)$/vbacomment.obj \
$(SLO)$/vbacomments.obj \
+ $(SLO)$/vbacommentshape.obj \
$(SLO)$/vbacondition.obj \
$(SLO)$/vbadialog.obj \
$(SLO)$/vbadialogs.obj \
$(SLO)$/vbaeventshelper.obj \
+ $(SLO)$/vbafiledialog.obj \
+ $(SLO)$/vbafiledialogselecteditems.obj \
+ $(SLO)$/vbafilesearch.obj \
$(SLO)$/vbafont.obj \
$(SLO)$/vbaformat.obj \
$(SLO)$/vbaformatcondition.obj \
$(SLO)$/vbaformatconditions.obj \
+ $(SLO)$/vbafoundfiles.obj \
$(SLO)$/vbaglobals.obj \
$(SLO)$/vbahyperlink.obj \
$(SLO)$/vbahyperlinks.obj \
$(SLO)$/vbainterior.obj \
+ $(SLO)$/vbamenubar.obj \
+ $(SLO)$/vbamenubars.obj \
+ $(SLO)$/vbamenu.obj \
+ $(SLO)$/vbamenus.obj \
+ $(SLO)$/vbamenuitem.obj \
+ $(SLO)$/vbamenuitems.obj \
$(SLO)$/vbaname.obj \
$(SLO)$/vbanames.obj \
$(SLO)$/vbaoleobject.obj \
@@ -88,6 +99,7 @@ SLOFILES= \
$(SLO)$/vbapivotcache.obj \
$(SLO)$/vbapivottable.obj \
$(SLO)$/vbapivottables.obj \
+ $(SLO)$/vbaquerytable.obj \
$(SLO)$/vbarange.obj \
$(SLO)$/vbaseriescollection.obj \
$(SLO)$/vbasheetobject.obj \
diff --git a/sc/source/ui/vba/service.cxx b/sc/source/ui/vba/service.cxx
index 2b1f14cf154a..e0ed82fbc0fd 100644
--- a/sc/source/ui/vba/service.cxx
+++ b/sc/source/ui/vba/service.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -132,3 +133,5 @@ extern "C"
return pRet;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/testvba/testvba.cxx b/sc/source/ui/vba/testvba/testvba.cxx
index 686b3e47eaa9..cf04d45250db 100644
--- a/sc/source/ui/vba/testvba/testvba.cxx
+++ b/sc/source/ui/vba/testvba/testvba.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include "cppuhelper/bootstrap.hxx"
#include <com/sun/star/beans/Property.hpp>
@@ -159,15 +160,15 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) )
Reference< script::provider::XScript > xScript;
try
{
- xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.TestMacros.Main?language=Basic&location=document" ));
+ xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:VBAProject.TestMacros.Main?language=Basic&location=document" ));
} catch ( uno::Exception& e )
{
try
{
- xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.testMacro.Main?language=Basic&location=document" ));
+ xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:VBAProject.testMacro.Main?language=Basic&location=document" ));
} catch ( uno::Exception& e2 )
{
- xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.testMain.Main?language=Basic&location=document" ));
+ xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:VBAProject.testMain.Main?language=Basic&location=document" ));
}
}
OSL_TRACE("Got script for doc %s", rtl::OUStringToOString( sUrl, RTL_TEXTENCODING_UTF8 ).getStr() );
@@ -307,3 +308,5 @@ int main( int argv, char** argc )
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index f3965393e919..7ed96e7f900e 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,11 +28,14 @@
#include <stdio.h>
+#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
+#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
#include <com/sun/star/sheet/XSpreadsheetView.hpp>
#include <com/sun/star/sheet/XSpreadsheets.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <ooo/vba/excel/XlCalculation.hpp>
+#include <ooo/vba/excel/XlCutCopyMode.hpp>
#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
#include <com/sun/star/sheet/XCalculatable.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
@@ -40,6 +44,19 @@
#include <ooo/vba/excel/XlMousePointer.hpp>
#include <com/sun/star/sheet/XNamedRanges.hpp>
#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
+#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker2.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+//2009-11-06 add by limingl
+#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+//end
+#include<ooo/vba/XCommandBars.hpp>
+#include <ooo/vba/excel/XlEnableCancelKey.hpp> //liuchen 2009-11-26
+#include <ooo/vba/excel/XlApplicationInternational.hpp> //liuchen 2009-11-26
+#include <unotools/localedatawrapper.hxx> //liuchen 2009-11-26
#include "vbaapplication.hxx"
#include "vbaworkbooks.hxx"
@@ -51,25 +68,37 @@
#include "vbawindow.hxx"
#include "vbawindows.hxx"
#include "vbaglobals.hxx"
+#include "vbamenubars.hxx"
#include "tabvwsh.hxx"
#include "gridwin.hxx"
#include "vbanames.hxx"
#include <vbahelper/vbashape.hxx>
#include "vbatextboxshape.hxx"
#include "vbaassistant.hxx"
+#include "vbafilesearch.hxx" //liuchen 2009-8-18, add the support of VBA Application.FileSearch
#include "sc.hrc"
+#include "macromgr.hxx"
+#include "global.hxx" //liuchen 2009-11-26
+#include "scmod.hxx" //liuchen 2009-11-26
+#include "docoptio.hxx" //liuchen 2009-11-26
+#include "appoptio.hxx"
#include <osl/file.hxx>
+#include <map>
+
#include <sfx2/request.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/app.hxx>
+#include <comphelper/processfactory.hxx>
+
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
+#include <tools/urlobj.hxx>
#include <docuno.hxx>
@@ -78,15 +107,29 @@
#include <basic/sbuno.hxx>
#include <basic/sbmeth.hxx>
+#include "transobj.hxx"
#include "convuno.hxx"
#include "cellsuno.hxx"
+#include "miscuno.hxx"
+#include "unonames.hxx"
#include "docsh.hxx"
#include <vbahelper/helperdecl.hxx>
#include "excelvbahelper.hxx"
-
+#include <basic/sbmeth.hxx>
+#include <basic/sbmod.hxx>
+#include <basic/sbstar.hxx>
+#include <basic/sbx.hxx>
+#include <basic/sbxobj.hxx>
+#include <basic/sbuno.hxx>
+//limingl 2009-07-20
+#include "vbafiledialog.hxx"
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::rtl::OUString;
// #TODO is this defined somewhere else?
#if ( defined UNX ) || ( defined OS2 ) //unix
@@ -237,16 +280,49 @@ ScVbaApplication::getAssistant() throw (uno::RuntimeException)
return uno::Reference< XAssistant >( new ScVbaAssistant( this, mxContext ) );
}
+//liuchen 2009-8-18, add support of VBA Application.FileSearch
+uno::Reference< XFileSearch > SAL_CALL
+ScVbaApplication::getFileSearch() throw (uno::RuntimeException)
+{
+ if (! m_xFileSearch.get() )
+ {
+ m_xFileSearch = uno::Reference< XFileSearch >( new ScVbaFileSearch( this, uno::Reference< XHelperInterface >( this ), mxContext ) );
+ }
+
+ return m_xFileSearch;
+}
+//liuchen
+
uno::Any SAL_CALL
ScVbaApplication::getSelection() throw (uno::RuntimeException)
{
OSL_TRACE("** ScVbaApplication::getSelection() ** ");
uno::Reference< frame::XModel > xModel( getCurrentDocument() );
- uno::Reference< lang::XServiceInfo > xServiceInfo( xModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
- rtl::OUString sImpementaionName = xServiceInfo->getImplementationName();
- if( sImpementaionName.equalsIgnoreAsciiCaseAscii("com.sun.star.drawing.SvxShapeCollection") )
+
+ Reference< view::XSelectionSupplier > xSelSupp( xModel->getCurrentController(), UNO_QUERY_THROW );
+ Reference< beans::XPropertySet > xPropSet( xSelSupp, UNO_QUERY_THROW );
+ OUString aPropName = OUString::createFromAscii( SC_UNO_FILTERED_RANGE_SELECTION );
+ uno::Any aOldVal = xPropSet->getPropertyValue( aPropName );
+ uno::Any any;
+ any <<= sal_False;
+ xPropSet->setPropertyValue( aPropName, any );
+ uno::Reference< uno::XInterface > aSelection = ScUnoHelpFunctions::AnyToInterface(
+ xSelSupp->getSelection() );
+ xPropSet->setPropertyValue( aPropName, aOldVal );
+
+ if (!aSelection.is())
{
- uno::Reference< drawing::XShapes > xShapes( xModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
+ throw uno::RuntimeException(
+ rtl::OUString::createFromAscii("failed to obtain current selection"),
+ uno::Reference< uno::XInterface >() );
+ }
+
+ uno::Reference< lang::XServiceInfo > xServiceInfo( aSelection, uno::UNO_QUERY_THROW );
+ rtl::OUString sImplementationName = xServiceInfo->getImplementationName();
+
+ if( sImplementationName.equalsIgnoreAsciiCaseAscii("com.sun.star.drawing.SvxShapeCollection") )
+ {
+ uno::Reference< drawing::XShapes > xShapes( aSelection, uno::UNO_QUERY_THROW );
uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY_THROW );
uno::Reference< drawing::XShape > xShape( xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW );
// if ScVbaShape::getType( xShape ) == office::MsoShapeType::msoAutoShape
@@ -265,10 +341,10 @@ ScVbaApplication::getSelection() throw (uno::RuntimeException)
else if( xServiceInfo->supportsService( rtl::OUString::createFromAscii("com.sun.star.sheet.SheetCellRange")) ||
xServiceInfo->supportsService( rtl::OUString::createFromAscii("com.sun.star.sheet.SheetCellRanges")))
{
- uno::Reference< table::XCellRange > xRange( getCurrentDocument()->getCurrentSelection(), ::uno::UNO_QUERY);
+ uno::Reference< table::XCellRange > xRange( aSelection, ::uno::UNO_QUERY);
if ( !xRange.is() )
{
- uno::Reference< sheet::XSheetCellRangeContainer > xRanges( getCurrentDocument()->getCurrentSelection(), ::uno::UNO_QUERY);
+ uno::Reference< sheet::XSheetCellRangeContainer > xRanges( aSelection, ::uno::UNO_QUERY);
if ( xRanges.is() )
return uno::makeAny( uno::Reference< excel::XRange >( new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ), mxContext, xRanges ) ) );
@@ -277,7 +353,7 @@ ScVbaApplication::getSelection() throw (uno::RuntimeException)
}
else
{
- throw uno::RuntimeException( sImpementaionName + rtl::OUString::createFromAscii(" not suported"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( sImplementationName + rtl::OUString::createFromAscii(" not supported"), uno::Reference< uno::XInterface >() );
}
}
@@ -367,16 +443,67 @@ ScVbaApplication::getActiveWindow() throw (uno::RuntimeException)
uno::Any SAL_CALL
ScVbaApplication::getCutCopyMode() throw (uno::RuntimeException)
{
- //# FIXME TODO, implementation
uno::Any result;
- result <<= sal_False;
+ ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( NULL );
+ ScDocument* pDoc = pOwnClip ? pOwnClip->GetDocument() : NULL;
+ if ( pDoc )
+ {
+ if ( pDoc->IsCutMode() )
+ {
+ result <<= excel::XlCutCopyMode::xlCut;
+ }
+ else
+ {
+ result <<= excel::XlCutCopyMode::xlCopy;
+ }
+ }
+ else
+ {
+ result <<= sal_False;
+ }
return result;
}
void SAL_CALL
-ScVbaApplication::setCutCopyMode( const uno::Any& /*_cutcopymode*/ ) throw (uno::RuntimeException)
+ScVbaApplication::setCutCopyMode( const uno::Any& _cutcopymode ) throw (uno::RuntimeException)
{
- //# FIXME TODO, implementation
+ // According to Excel's behavior, no matter what is the value of _cutcopymode, always releases the clip object.
+ sal_Bool bCutCopyMode = sal_False;
+ if ( ( _cutcopymode >>= bCutCopyMode ) )
+ {
+ ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( NULL );
+ if ( pOwnClip )
+ {
+ pOwnClip->ObjectReleased();
+ ScTabViewShell* pTabViewShell = excel::getBestViewShell( getCurrentDocument() );
+ if ( pTabViewShell )
+ {
+ ScViewData* pView = pTabViewShell->GetViewData();
+ Window* pWindow = pView ? pView->GetActiveWin() : NULL;
+ if ( pWindow )
+ {
+ Reference< datatransfer::clipboard::XClipboard > xClipboard = pWindow->GetClipboard();
+ Reference< datatransfer::clipboard::XFlushableClipboard > xFlushableClipboard( xClipboard, uno::UNO_QUERY );
+ if ( xClipboard.is() )
+ {
+ xClipboard->setContents( NULL, NULL );
+ if ( xFlushableClipboard.is() )
+ {
+ const sal_uInt32 nRef = Application::ReleaseSolarMutex();
+ try
+ {
+ xFlushableClipboard->flushClipboard();
+ }
+ catch( const uno::Exception& )
+ {
+ }
+ Application::AcquireSolarMutex( nRef );
+ }
+ }
+ }
+ }
+ }
+ }
}
uno::Any SAL_CALL
@@ -725,6 +852,91 @@ ScVbaApplication::getEnableEvents() throw (uno::RuntimeException)
return m_bEnableEvents;
}
+sal_Bool SAL_CALL
+ScVbaApplication::getVisible() throw (uno::RuntimeException)
+{
+ sal_Bool bVisible = sal_True;
+ return bVisible;
+}
+
+void SAL_CALL
+ScVbaApplication::setVisible(sal_Bool /*bVisible*/) throw (uno::RuntimeException)
+{
+}
+
+//liuchen 2009-11-25 add the support of Excel VBA Application.Iteration
+//The Excel Iteration option is global and unique, but in Symphony there is an Iteration property in ScModule and one in every ScDocument,
+//so the set method will set all the Iteration properties
+sal_Bool SAL_CALL
+ScVbaApplication::getIteration() throw (uno::RuntimeException)
+{
+ ScModule* pScMod = SC_MOD();
+ ScDocOptions aDocOpt = pScMod->GetDocOptions();
+
+ return aDocOpt.IsIter();
+}
+
+void SAL_CALL
+ScVbaApplication::setIteration(sal_Bool bIteration) throw (uno::RuntimeException)
+{
+ ScModule* pScMod = SC_MOD();
+ ScDocOptions& aDocOpt = const_cast< ScDocOptions& > (pScMod->GetDocOptions());
+ aDocOpt.SetIter( bIteration );
+
+ uno::Any aIteration;
+ aIteration <<= bIteration;
+
+ OUString aPropName = OUString::createFromAscii( "IsIterationEnabled" );
+
+ uno::Reference< XCollection > xWorkbooks( new ScVbaWorkbooks( this, mxContext ) );
+ sal_Int32 nCount = xWorkbooks->getCount();
+
+ for (sal_Int32 i = 1; i <= nCount; i++)
+ {
+ uno::Reference< ooo::vba::excel::XWorkbook > xWorkbook;
+ uno::Any aWorkbook = xWorkbooks->Item(uno::makeAny(i), uno::Any());
+ aWorkbook >>= xWorkbook;
+ ScVbaWorkbook* pWorkbook = static_cast< ScVbaWorkbook* > ( xWorkbook.get() );
+
+ uno::Reference< frame::XModel > xModel( pWorkbook->getDocModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xPropertySet( xModel, uno::UNO_QUERY_THROW );
+ xPropertySet->setPropertyValue( aPropName, aIteration );
+ }
+}
+//liuchen 2009-11-25 end
+
+//liuchen 2009-11-26 add the support of Excel VBA Application.EnableCancelKey
+sal_Int32 SAL_CALL
+ScVbaApplication::getEnableCancelKey() throw (uno::RuntimeException)
+{
+ return ooo::vba::excel::XlEnableCancelKey::xlDisabled;
+}
+
+void SAL_CALL
+ScVbaApplication::setEnableCancelKey(sal_Int32 /*lEnableCancelKey*/) throw (uno::RuntimeException)
+{
+}
+//liuchen 2009-11-26 end
+
+sal_Int32 SAL_CALL ScVbaApplication::getSheetsInNewWorkbook() throw (uno::RuntimeException)
+{
+ const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
+ return rAppOpt.GetTabCountInNewSpreadsheet();
+}
+
+void SAL_CALL ScVbaApplication::setSheetsInNewWorkbook( sal_Int32 SheetsInNewWorkbook ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ if ( SheetsInNewWorkbook < 1 || SheetsInNewWorkbook > MAXTAB )
+ {
+ DebugHelper::exception( OUString::createFromAscii("The number must be between 1 and 255"), uno::Exception(), SbERR_METHOD_FAILED, OUString() );
+ }
+ else
+ {
+ ScAppOptions& rAppOpt = const_cast< ScAppOptions& >(SC_MOD()->GetAppOptions());
+ rAppOpt.SetTabCountInNewSpreadsheet( SheetsInNewWorkbook );
+ }
+}
+
void SAL_CALL
ScVbaApplication::Calculate() throw( script::BasicErrorException , uno::RuntimeException )
{
@@ -1090,13 +1302,19 @@ ScVbaApplication::Volatile( const uno::Any& aVolatile ) throw ( uno::RuntimeExc
{
sal_Bool bVolatile = sal_True;
aVolatile >>= bVolatile;
+ SbMethod* pMeth = StarBASIC::GetActiveMethod();
+ if ( pMeth )
+ {
+ OSL_TRACE("ScVbaApplication::Volatile() In method ->%s<-", rtl::OUStringToOString( pMeth->GetName(), RTL_TEXTENCODING_UTF8 ).getStr() );
+ uno::Reference< frame::XModel > xModel( getCurrentDocument() );
+ ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
+ pDoc->GetMacroManager()->SetUserFuncVolatile( pMeth->GetName(), bVolatile);
+ }
+
+// this is bound to break when loading the document
return;
}
-void SAL_CALL
-ScVbaApplication::DoEvents() throw ( uno::RuntimeException )
-{
-}
::sal_Bool SAL_CALL
ScVbaApplication::getDisplayFormulaBar() throw ( css::uno::RuntimeException )
{
@@ -1148,12 +1366,421 @@ ScVbaApplication::Caller( const uno::Any& /*aIndex*/ ) throw ( uno::RuntimeExcep
return aRet;
}
+//Add by minz@cn.ibm.com. 2009-07-08.
+uno::Any SAL_CALL
+ScVbaApplication::GetOpenFilename(const uno::Any& FileFilter, const uno::Any& FilterIndex, const uno::Any& Title, const uno::Any& ButtonText, const uno::Any& MultiSelect) throw (uno::RuntimeException)
+{
+ uno::Any aRet = uno::makeAny( sal_False );
+ try
+ {
+ const ::rtl::OUString sServiceName = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FilePicker" );
+ uno::Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
+ // Set the type of File Picker Dialog: TemplateDescription::FILEOPEN_SIMPLE.
+ uno::Sequence< uno::Any > aDialogType( 1 );
+ aDialogType[0] <<= ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE;
+ uno::Reference< ui::dialogs::XFilePicker > xFilePicker( xMSF->createInstanceWithArguments( sServiceName, aDialogType ), UNO_QUERY );
+ uno::Reference< ui::dialogs::XFilePicker2 > xFilePicker2( xFilePicker, UNO_QUERY );
+ uno::Reference< ui::dialogs::XFilterManager > xFilterManager( xFilePicker, UNO_QUERY );
+ uno::Reference< ui::dialogs::XExecutableDialog > xExecutableDialog( xFilePicker, UNO_QUERY );
+ uno::Reference< ui::dialogs::XFilePickerControlAccess > xPickerControlAccess( xFilePicker, UNO_QUERY );
+
+ if ( xFilterManager.is() && FileFilter.hasValue() )
+ {
+ sal_Int32 nFilterIndex = 1;
+ if ( FilterIndex.hasValue() )
+ {
+ FilterIndex >>= nFilterIndex;
+ }
+ ::rtl::OUString strFilter;
+ FileFilter >>= strFilter;
+ sal_Int32 nCommaID = 0;
+ sal_Int32 nIndex = 1;
+ do
+ {
+ ::rtl::OUString aFilterTitleToken = strFilter.getToken( 0, ',' , nCommaID );
+ ::rtl::OUString aFilterToken;
+ if ( nCommaID >= 0 )
+ {
+ aFilterToken = strFilter.getToken( 0, ',' , nCommaID );
+ }
+ else if ( nCommaID < 0 && nIndex == 1 )
+ {
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid FileFilter format!" ), uno::Reference< uno::XInterface >() );
+ }
+ xFilterManager->appendFilter( aFilterTitleToken, aFilterToken );
+ if ( nFilterIndex == nIndex )
+ {
+ xFilterManager->setCurrentFilter( aFilterTitleToken );
+ }
+ nIndex++;
+ } while ( nCommaID >= 0 );
+ }
+ if ( xExecutableDialog.is() && Title.hasValue() )
+ {
+ ::rtl::OUString sTitle;
+ Title >>= sTitle;
+ xExecutableDialog->setTitle( sTitle );
+ }
+ if ( xPickerControlAccess.is() && ButtonText.hasValue() )
+ {
+ ::rtl::OUString sButtonText;
+ ButtonText >>= sButtonText;
+ xPickerControlAccess->setLabel( ui::dialogs::CommonFilePickerElementIds::PUSHBUTTON_OK, sButtonText );
+ }
+ sal_Bool bMultiSelect = sal_False;
+ if ( xFilePicker.is() && MultiSelect.hasValue() )
+ {
+ MultiSelect >>= bMultiSelect;
+ xFilePicker->setMultiSelectionMode( bMultiSelect );
+ }
+
+ if ( xFilePicker.is() && xFilePicker->execute() )
+ {
+ sal_Bool bUseXFilePicker2 = sal_False;
+ uno::Reference< lang::XServiceInfo > xServiceInfo( xFilePicker, UNO_QUERY );
+ if ( xServiceInfo.is() )
+ {
+ rtl::OUString sImplName = xServiceInfo->getImplementationName();
+ if ( sImplName.equalsAscii("com.sun.star.comp.fpicker.VistaFileDialog") || sImplName.equalsAscii("com.sun.star.ui.dialogs.SalGtkFilePicker") )
+ {
+ bUseXFilePicker2 = sal_True;
+ }
+ }
+ uno::Sequence< rtl::OUString > aSelectedFiles;
+ if ( bUseXFilePicker2 && xFilePicker2.is() )
+ {
+ // On Linux, XFilePicker->getFiles() always return one selected file although we select more than one file, also on Vista
+ // XFilePicker->getFiles() does not work well too, so we call XFilePicker2->getSelectedFiles() to get selected files.
+ aSelectedFiles = xFilePicker2->getSelectedFiles();
+ }
+ else
+ {
+ // If only one file is selected, the first entry of the sequence contains the complete path/filename in URL format. If multiple files are selected,
+ // the first entry of the sequence contains the path in URL format, and the other entries contains the names of the selected files without path information.
+ uno::Sequence< rtl::OUString > aTmpFiles = xFilePicker->getFiles();
+ aSelectedFiles = aTmpFiles;
+ sal_Int32 iFileCount = aTmpFiles.getLength();
+ if ( iFileCount > 1 )
+ {
+ aSelectedFiles.realloc( iFileCount - 1 );
+ INetURLObject aPath( aTmpFiles[0] );
+ aPath.setFinalSlash();
+ for ( sal_Int32 i = 1; i < iFileCount; i++ )
+ {
+ if ( aTmpFiles[i].indexOf ('/') > 0 || aTmpFiles[i].indexOf ('\\') > 0 )
+ {
+ aSelectedFiles[i - 1] = aTmpFiles[i];
+ }
+ else
+ {
+ if ( i == 1 )
+ aPath.Append( aTmpFiles[i] );
+ else
+ aPath.setName( aTmpFiles[i] );
+ aSelectedFiles[i - 1] = aPath.GetMainURL( INetURLObject::NO_DECODE );
+ }
+ }
+ }
+ }
+
+ sal_Int32 iFileCount = aSelectedFiles.getLength();
+ for ( sal_Int32 i = 0; i < iFileCount; i++ )
+ {
+ INetURLObject aObj( aSelectedFiles[i] );
+ if ( aObj.GetProtocol() == INET_PROT_FILE )
+ {
+ rtl::OUString aTemp = aObj.PathToFileName();
+ aSelectedFiles[i] = aTemp.getLength() > 0 ? aTemp : aSelectedFiles[i];
+ }
+ }
+ if ( bMultiSelect )
+ {
+ aRet = uno::makeAny( aSelectedFiles );
+ }
+ else if ( aSelectedFiles.getLength() > 0 && !bMultiSelect )
+ {
+ aRet = uno::makeAny( aSelectedFiles[0] );
+ }
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
+ }
+
+ return aRet;
+}
+
+//liming 2009-7-17
+::com::sun::star::uno::Reference< ::ooo::vba::XFileDialog > SAL_CALL
+ScVbaApplication::getFileDialog() throw (::com::sun::star::uno::RuntimeException)
+{
+ uno::Reference< XFileDialog > xFileDialogs( new ScVbaFileDialog( uno::Reference< XHelperInterface >( this ), mxContext, getCurrentDocument() ) );
+ return xFileDialogs;
+}
+
+typedef std::map< ::rtl::OUString, ::rtl::OUString > FileFilterMap;
+
+//2009-11-06 add by limingl
+uno::Any SAL_CALL
+ScVbaApplication::GetSaveAsFilename( const ::com::sun::star::uno::Any& InitialFilename, const ::com::sun::star::uno::Any& FileFilter, const ::com::sun::star::uno::Any& FilterIndex, const ::com::sun::star::uno::Any& Title, const ::com::sun::star::uno::Any& ButtonText ) throw (::com::sun::star::uno::RuntimeException)
+{
+ uno::Any strRet;
+ try
+ {
+ const ::rtl::OUString sServiceName = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FilePicker" );
+ uno::Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
+
+ uno::Sequence< uno::Any > aDialogType( 1 );
+ aDialogType[0] <<= ui::dialogs::TemplateDescription::FILESAVE_SIMPLE;
+ uno::Reference< ui::dialogs::XFilePicker > xFilePicker( xMSF->createInstanceWithArguments( sServiceName, aDialogType ), UNO_QUERY );
+
+ if (InitialFilename.hasValue())
+ {
+ ::rtl::OUString strInitFileName;
+ InitialFilename >>= strInitFileName;
+ xFilePicker->setDefaultName(strInitFileName);
+ }
+
+ // Begin from 1.
+ sal_Int32 nFilterIndex = 1;
+ if (FilterIndex.hasValue())
+ {
+ FilterIndex >>= nFilterIndex;
+ }
+
+ uno::Reference< ui::dialogs::XFilterManager > xFilter( xFilePicker, UNO_QUERY );
+ FileFilterMap mFilterNameMap;
+ if (FileFilter.hasValue())
+ {
+ ::rtl::OUString strFilter;
+ sal_Int32 nCommaID = 0;
+ FileFilter >>= strFilter;
+
+ sal_Int32 nIndex = 1;
+ do
+ {
+ ::rtl::OUString aFilterTitleToken = strFilter.getToken( 0, ',' , nCommaID );
+ ::rtl::OUString aFilterToken;
+ if ( nCommaID >= 0 )
+ {
+ aFilterToken = strFilter.getToken( 0, ',' , nCommaID );
+ }
+ else if ( nCommaID < 0 && nIndex == 1 )
+ {
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid FileFilter format!" ), uno::Reference< uno::XInterface >() );
+ }
+
+ FileFilterMap::const_iterator aIt = mFilterNameMap.find( aFilterTitleToken );
+ if ( aIt == mFilterNameMap.end() )
+ {
+ xFilter->appendFilter( aFilterTitleToken, aFilterToken );
+ if ( nFilterIndex == nIndex )
+ {
+ xFilter->setCurrentFilter( aFilterTitleToken );
+ }
+ nIndex++;
+ mFilterNameMap[aFilterTitleToken] = aFilterToken;
+ }
+ } while ( nCommaID >= 0 );
+ }
+
+ if (Title.hasValue())
+ {
+ ::rtl::OUString strTitle;
+ Title >>= strTitle;
+ uno::Reference< ::com::sun::star::ui::dialogs::XExecutableDialog> xExcTblDlg(xFilePicker, UNO_QUERY );
+ xExcTblDlg->setTitle(strTitle);
+ }
+
+ if (ButtonText.hasValue())
+ {
+ ::rtl::OUString strBttTxt;
+ ButtonText >>= strBttTxt;
+ }
+
+
+ if ( xFilePicker.is() )
+ {
+ sal_Int16 nRet = xFilePicker->execute();
+ if (nRet == 0)
+ {
+ strRet <<= sal_False;
+ }
+ else
+ {
+ uno::Sequence < rtl::OUString > aPathSeq = xFilePicker->getFiles();
+
+ if ( aPathSeq.getLength() )
+ {
+ ::rtl::OUString sSelectedFilters;
+ if ( xFilter.is() )
+ {
+ ::rtl::OUString sSelectedFilterName = xFilter->getCurrentFilter();
+ FileFilterMap::const_iterator aIt = mFilterNameMap.find( sSelectedFilterName );
+ if ( aIt != mFilterNameMap.end() )
+ {
+ sSelectedFilters = aIt->second;
+ }
+ }
+ INetURLObject aURLObj( aPathSeq[0] );
+ ::rtl::OUString aPathStr = aURLObj.PathToFileName();
+ if ( aURLObj.GetProtocol() == INET_PROT_FILE )
+ {
+ sal_Int32 nSemicolonID = 0;
+ ::rtl::OUString sFirstFilter = sSelectedFilters.getToken( 0, ';' , nSemicolonID );
+ ::rtl::OUString sFileExtension = aURLObj.GetExtension();
+ if ( sFileExtension.equalsAscii("") )
+ {
+ sFileExtension = sFirstFilter.equalsAscii("*.*") ? sFileExtension : sFirstFilter.copy( sFirstFilter.indexOfAsciiL("*.", 2) + 2 );
+ aPathStr = sFileExtension.equalsAscii("") ? aPathStr : aPathStr + ::rtl::OUString::createFromAscii(".") + sFileExtension;
+ }
+ else
+ {
+ sal_Bool bValidFilter = sal_False;
+ FileFilterMap::const_iterator aIt = mFilterNameMap.begin();
+ while ( aIt != mFilterNameMap.end() )
+ {
+ sSelectedFilters = aIt->second;
+ nSemicolonID = 0;
+ do
+ {
+ ::rtl::OUString aFilterToken = sSelectedFilters.getToken( 0, ';' , nSemicolonID );
+ if ( aFilterToken.trim().equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("*.") + sFileExtension) )
+ {
+ bValidFilter = sal_True;
+ break;
+ }
+ } while ( nSemicolonID >= 0 );
+ if ( bValidFilter )
+ {
+ break;
+ }
+ aIt++;
+ }
+ if ( !bValidFilter )
+ {
+ sFileExtension = sFirstFilter.equalsAscii("*.*") ? ::rtl::OUString::createFromAscii("") : sFirstFilter.copy( sFirstFilter.indexOfAsciiL("*.", 2) + 2 );
+ aPathStr = sFileExtension.equalsAscii("") ? aPathStr : aPathStr + ::rtl::OUString::createFromAscii(".") + sFileExtension;
+ }
+ }
+ }
+ strRet <<= aPathStr;
+ }
+ }
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
+ }
+ return strRet;
+}
+
+//end add
+
uno::Reference< frame::XModel >
ScVbaApplication::getCurrentDocument() throw (css::uno::RuntimeException)
{
return getCurrentExcelDoc(mxContext);
}
+uno::Any SAL_CALL
+ScVbaApplication::MenuBars( const uno::Any& aIndex ) throw (uno::RuntimeException)
+{
+ uno::Reference< XCommandBars > xCommandBars( CommandBars( uno::Any() ), uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xMenuBars( new ScVbaMenuBars( this, mxContext, xCommandBars ) );
+ if ( aIndex.hasValue() )
+ {
+ return uno::Any ( xMenuBars->Item( aIndex, uno::Any() ) );
+ }
+
+ return uno::Any( xMenuBars );
+}
+
+//liuchen 2009-11-26 add the support of Application.International
+sal_Int32 SAL_CALL
+ConvertCountryCode(const OUString& language)
+{
+ sal_Int32 nCode = 0;
+
+ if( language == OUString::createFromAscii("ar") ) nCode = 966; // Arabic
+ else if ( language == OUString::createFromAscii("cs") ) nCode = 42; // Czech
+ else if ( language == OUString::createFromAscii("da") ) nCode = 45; // Danish
+ else if ( language == OUString::createFromAscii("de") ) nCode = 49; // German
+ else if ( language == OUString::createFromAscii("en") ) nCode = 1; // English
+ else if ( language == OUString::createFromAscii("es") ) nCode = 34; // Spanish
+ else if ( language == OUString::createFromAscii("el") ) nCode = 30; // Greek
+ else if ( language == OUString::createFromAscii("fa") ) nCode = 98; // Persian = Farsi
+ else if ( language == OUString::createFromAscii("fi") ) nCode = 358; // Finnish
+ else if ( language == OUString::createFromAscii("fr") ) nCode = 33; // French
+ else if ( language == OUString::createFromAscii("he") ) nCode = 972; // Hebrew
+ else if ( language == OUString::createFromAscii("hi") ) nCode = 91; // Indian = Hindi
+ else if ( language == OUString::createFromAscii("hu") ) nCode = 36; // Hungarian
+ else if ( language == OUString::createFromAscii("it") ) nCode = 39; // Italian
+ else if ( language == OUString::createFromAscii("ja") ) nCode = 81; // Japanese
+ else if ( language == OUString::createFromAscii("ko") ) nCode = 82; // Korean
+ else if ( language == OUString::createFromAscii("nl") ) nCode = 31; // Dutch
+ else if ( language == OUString::createFromAscii("no") ) nCode = 47; // Norwegian
+ else if ( language == OUString::createFromAscii("pl") ) nCode = 48; // Polish
+ else if ( language == OUString::createFromAscii("pt") ) nCode = 351; // Portuguese
+ else if ( language == OUString::createFromAscii("ru") ) nCode = 7; // Russian
+ else if ( language == OUString::createFromAscii("sv") ) nCode = 46; // Swedish
+ else if ( language == OUString::createFromAscii("th") ) nCode = 66; // Thai
+ else if ( language == OUString::createFromAscii("tk") ) nCode = 90; // Turkish
+ else if ( language == OUString::createFromAscii("ur") ) nCode = 92; // Urdu
+ else if ( language == OUString::createFromAscii("vi") ) nCode = 84; // Vietnamese
+ else if ( language == OUString::createFromAscii("zh") ) nCode = 86; // Simplified Chinese
+
+ return nCode;
+}
+
+uno::Any SAL_CALL
+ScVbaApplication::International( sal_Int32 Index ) throw (uno::RuntimeException)
+{
+ uno::Any aRet;
+ OUString str;
+ const LocaleDataWrapper* pLocaleData = ScGlobal::GetpLocaleData();
+ switch ( Index )
+ {
+ case excel::XlApplicationInternational::xlCountryCode:
+ aRet <<= ConvertCountryCode( pLocaleData->getLanguageCountryInfo().Language );
+ break;
+ case excel::XlApplicationInternational::xlDecimalSeparator:
+ str = pLocaleData->getNumDecimalSep();
+ aRet <<= str;
+ break;
+ case excel::XlApplicationInternational::xlDateSeparator:
+ str = pLocaleData->getDateSep();
+ aRet <<= str;
+ break;
+ default:
+ break;
+ }
+ return aRet;
+}
+//liuchen 2009-11-26 end
+
+//2009-12-11 add by limingl
+void SAL_CALL ScVbaApplication::Undo( ) throw (::com::sun::star::uno::RuntimeException)
+{
+ SfxAllItemSet reqList( SFX_APP()->GetPool() );
+ SfxRequest rReq(SID_UNDO, 0, reqList);
+ ScTabViewShell* pViewShell = excel::getCurrentBestViewShell( mxContext );
+
+ if (pViewShell != NULL)
+ {
+ pViewShell->ExecuteUndo(rReq);
+ }
+}
+//end
+
+double SAL_CALL ScVbaApplication::InchesToPoints( double Inches ) throw (uno::RuntimeException)
+{
+ // Convert a measurement from Inch to Point (1 inch = 72 points).
+ return MetricField::ConvertDoubleValue( Inches, 0, 0, FUNIT_INCH, FUNIT_POINT );
+}
+
rtl::OUString&
ScVbaApplication::getServiceImplName()
{
@@ -1182,3 +1809,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"ScVbaApplication",
"ooo.vba.excel.Application" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaapplication.hxx b/sc/source/ui/vba/vbaapplication.hxx
index a7be5feb1d27..9d865a513547 100644
--- a/sc/source/ui/vba/vbaapplication.hxx
+++ b/sc/source/ui/vba/vbaapplication.hxx
@@ -47,6 +47,7 @@ private:
sal_Bool m_bEnableEvents;
rtl::OUString getOfficePath( const rtl::OUString& sPath ) throw ( css::uno::RuntimeException );
+ css::uno::Reference< ov::XFileSearch > m_xFileSearch; //
protected:
virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() throw (css::uno::RuntimeException);
@@ -89,6 +90,7 @@ public:
virtual void SAL_CALL setDisplayFormulaBar( ::sal_Bool _displayformulabar ) throw ( css::uno::RuntimeException );
virtual css::uno::Reference< ov::XAssistant > SAL_CALL getAssistant() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::XFileSearch > SAL_CALL getFileSearch() throw (css::uno::RuntimeException); //liuchen 2009-8-18 add the support of Application.FileSearch
virtual css::uno::Reference< ov::excel::XWorkbook > SAL_CALL getThisWorkbook() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Workbooks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Worksheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
@@ -102,6 +104,17 @@ public:
virtual ::sal_Int32 SAL_CALL getCursor() throw (css::uno::RuntimeException);
virtual void SAL_CALL setCursor( ::sal_Int32 _cursor ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw (css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL getIteration() throw (css::uno::RuntimeException); //liuchen 2009-11-25 add the support of Iteration
+ virtual void SAL_CALL setIteration( sal_Bool bIteration ) throw (css::uno::RuntimeException); //liuchen 2009-11-25 add the support of Iteration
+ virtual sal_Int32 SAL_CALL getEnableCancelKey() throw (css::uno::RuntimeException); //liuchen 2009-11-26 add the support of EnableCancelKey
+ virtual void SAL_CALL setEnableCancelKey( sal_Int32 lEnableCancelKey ) throw (css::uno::RuntimeException); //liuchen 2009-11-26 add the support of EnableCancelKey
+
+ virtual sal_Int32 SAL_CALL getSheetsInNewWorkbook() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSheetsInNewWorkbook( sal_Int32 SheetsInNewWorkbook ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
virtual sal_Bool SAL_CALL getEnableEvents() throw (css::uno::RuntimeException);
virtual void SAL_CALL setEnableEvents( sal_Bool bEnable ) throw (css::uno::RuntimeException);
@@ -114,8 +127,16 @@ public:
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Intersect( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual void SAL_CALL Volatile( const css::uno::Any& Volatile ) throw (css::uno::RuntimeException );
- virtual void SAL_CALL DoEvents() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Caller( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL MenuBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL GetOpenFilename( const css::uno::Any& FileFilter, const css::uno::Any& FilterIndex, const css::uno::Any& Title, const css::uno::Any& ButtonText, const css::uno::Any& MultiSelect ) throw (css::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::ooo::vba::XFileDialog > SAL_CALL getFileDialog() throw (::com::sun::star::uno::RuntimeException); //liminl 2009-08-12 add
+ virtual css::uno::Any SAL_CALL International( sal_Int32 Index ) throw (css::uno::RuntimeException); //liuchen 2009-11-26
+ //2009-12-04 add by limingl
+ virtual css::uno::Any SAL_CALL GetSaveAsFilename( const ::com::sun::star::uno::Any& InitialFilename, const ::com::sun::star::uno::Any& FileFilter, const ::com::sun::star::uno::Any& FilterIndex, const ::com::sun::star::uno::Any& Title, const ::com::sun::star::uno::Any& ButtonText ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL Undo( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual double SAL_CALL InchesToPoints( double Inches ) throw (css::uno::RuntimeException);
+
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
diff --git a/sc/source/ui/vba/vbaassistant.cxx b/sc/source/ui/vba/vbaassistant.cxx
index 51105d60b0d4..714bb783f3cb 100644
--- a/sc/source/ui/vba/vbaassistant.cxx
+++ b/sc/source/ui/vba/vbaassistant.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -130,3 +131,5 @@ ScVbaAssistant::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx
index d563ba105108..eac7083a797c 100644
--- a/sc/source/ui/vba/vbaaxes.cxx
+++ b/sc/source/ui/vba/vbaaxes.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -201,3 +202,4 @@ ScVbaAxes::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaaxis.cxx b/sc/source/ui/vba/vbaaxis.cxx
index a9c91a4cea31..d51534264e38 100644
--- a/sc/source/ui/vba/vbaaxis.cxx
+++ b/sc/source/ui/vba/vbaaxis.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -668,3 +669,4 @@ ScVbaAxis::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaaxistitle.cxx b/sc/source/ui/vba/vbaaxistitle.cxx
index 89b12b6e2870..cc5b0d791b13 100644
--- a/sc/source/ui/vba/vbaaxistitle.cxx
+++ b/sc/source/ui/vba/vbaaxistitle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,3 +57,4 @@ ScVbaAxisTitle::getServiceNames()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx
index 4c87fa6203ae..7fbe157e2bdf 100644
--- a/sc/source/ui/vba/vbaborders.cxx
+++ b/sc/source/ui/vba/vbaborders.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -572,3 +573,5 @@ ScVbaBorders::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacharacters.cxx b/sc/source/ui/vba/vbacharacters.cxx
index 6c0079ac7a82..011b0a4a72e1 100644
--- a/sc/source/ui/vba/vbacharacters.cxx
+++ b/sc/source/ui/vba/vbacharacters.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -134,3 +135,4 @@ ScVbaCharacters::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx
index e2f446f93f2b..705f79ed42f9 100644
--- a/sc/source/ui/vba/vbachart.cxx
+++ b/sc/source/ui/vba/vbachart.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1251,3 +1252,4 @@ ScVbaChart::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbachartobject.cxx b/sc/source/ui/vba/vbachartobject.cxx
index 617a090b6d7a..eaa42d1cc309 100644
--- a/sc/source/ui/vba/vbachartobject.cxx
+++ b/sc/source/ui/vba/vbachartobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -208,3 +209,5 @@ ScVbaChartObject::getUnoObject() throw (script::BasicErrorException)
{
return uno::Reference< uno::XInterface >( xShape, uno::UNO_QUERY );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx
index 5117cfd75858..b8706b233462 100644
--- a/sc/source/ui/vba/vbachartobjects.cxx
+++ b/sc/source/ui/vba/vbachartobjects.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -192,3 +193,4 @@ ScVbaChartObjects::getServiceNames()
return sNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacharts.cxx b/sc/source/ui/vba/vbacharts.cxx
index da0c7789134b..d02e79e8d431 100644
--- a/sc/source/ui/vba/vbacharts.cxx
+++ b/sc/source/ui/vba/vbacharts.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118,3 +119,4 @@ ScVbaCharts::getServiceNames()
return sNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacharttitle.cxx b/sc/source/ui/vba/vbacharttitle.cxx
index e797c4a0269e..09f678704422 100644
--- a/sc/source/ui/vba/vbacharttitle.cxx
+++ b/sc/source/ui/vba/vbacharttitle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,3 +57,4 @@ ScVbaChartTitle::getServiceNames()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacomment.cxx b/sc/source/ui/vba/vbacomment.cxx
index 9c50a25b8b7c..f707fad1eb13 100644
--- a/sc/source/ui/vba/vbacomment.cxx
+++ b/sc/source/ui/vba/vbacomment.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,14 +34,23 @@
#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
#include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
#include <com/sun/star/sheet/XSheetCellRange.hpp>
+#include <com/sun/star/sheet/XCellAddressable.hpp>
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/XCell.hpp>
#include <com/sun/star/text/XText.hpp>
+#include <cellsuno.hxx>
+#include <postit.hxx>
+#include <svx/svdobj.hxx>
+#include <svx/svdocapt.hxx>
+#include <ooo/vba/msforms/XShape.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+
#include <vbahelper/vbashape.hxx>
#include "vbaglobals.hxx"
#include "vbacomments.hxx"
-
+#include "vbacommentshape.hxx"
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -178,7 +188,6 @@ ScVbaComment::Text( const uno::Any& aText, const uno::Any& aStart, const uno::An
aText >>= sText;
uno::Reference< text::XSimpleText > xAnnoText( getAnnotation(), uno::UNO_QUERY_THROW );
- rtl::OUString sAnnoText = xAnnoText->getString();
if ( aStart.hasValue() )
{
@@ -212,10 +221,12 @@ ScVbaComment::Text( const uno::Any& aText, const uno::Any& aStart, const uno::An
}
else if ( aText.hasValue() )
{
- xAnnoText->setString( sText );
- return sText;
+ uno::Reference< sheet::XCellAddressable > xCellAddr(mxRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW );
+ table::CellAddress aAddress = xCellAddr->getCellAddress();
+ getAnnotations()->insertNew( aAddress, sText );
}
+ rtl::OUString sAnnoText = xAnnoText->getString();
return sAnnoText;
}
@@ -237,3 +248,5 @@ ScVbaComment::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacomments.cxx b/sc/source/ui/vba/vbacomments.cxx
index 7a6d3d774937..c4c290da3b2a 100644
--- a/sc/source/ui/vba/vbacomments.cxx
+++ b/sc/source/ui/vba/vbacomments.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,3 +115,5 @@ ScVbaComments::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacommentshape.cxx b/sc/source/ui/vba/vbacommentshape.cxx
new file mode 100644
index 000000000000..4c0d15597ce7
--- /dev/null
+++ b/sc/source/ui/vba/vbacommentshape.cxx
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbacommentshape.hxx"
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+ScVbaCommentShape::ScVbaCommentShape( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape, const uno::Reference< excel::XComment >& xComment,
+ const uno::Reference< drawing::XShapes >& xShapes, const uno::Reference< frame::XModel >& xModel, sal_Int32 nType ) : ScVbaShape( xParent, xContext, xShape, xShapes, xModel, nType )
+{
+ m_xComment.set( xComment, uno::UNO_QUERY );
+}
+
+void SAL_CALL ScVbaCommentShape::Delete() throw (uno::RuntimeException)
+{
+ if ( m_xComment.is() )
+ {
+ m_xComment->Delete();
+ }
+}
diff --git a/sc/source/ui/vba/vbacommentshape.hxx b/sc/source/ui/vba/vbacommentshape.hxx
new file mode 100644
index 000000000000..d55de4b07c18
--- /dev/null
+++ b/sc/source/ui/vba/vbacommentshape.hxx
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef SC_VBA_COMMENTSHAPE_HXX
+#define SC_VBA_COMMENTSHAPE_HXX
+
+#include <ooo/vba/excel/XComment.hpp>
+#include <vbahelper/vbashape.hxx>
+
+class ScVbaCommentShape : public ScVbaShape
+{
+ css::uno::Reference< ooo::vba::excel::XComment > m_xComment;
+
+public:
+ ScVbaCommentShape( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape,
+ const css::uno::Reference< ooo::vba::excel::XComment >& xComment, const css::uno::Reference< css::drawing::XShapes >& xShapes, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nType );
+
+ // Methods
+ virtual void SAL_CALL Delete() throw (css::uno::RuntimeException);
+};
+#endif //SC_VBA_COMMENTSHAPE_HXX
diff --git a/sc/source/ui/vba/vbacondition.cxx b/sc/source/ui/vba/vbacondition.cxx
index 590d649ae561..321ca60d810f 100644
--- a/sc/source/ui/vba/vbacondition.cxx
+++ b/sc/source/ui/vba/vbacondition.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -173,3 +174,4 @@ ScVbaCondition< Ifc1 >::Operator(sal_Bool _bIncludeFormulaValue) throw ( script:
template class ScVbaCondition< excel::XFormatCondition >;
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbadialog.cxx b/sc/source/ui/vba/vbadialog.cxx
index 88a4c4ae67fd..7b2a0edb4103 100644
--- a/sc/source/ui/vba/vbadialog.cxx
+++ b/sc/source/ui/vba/vbadialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,42 +32,58 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-static const rtl::OUString aStringList[]=
+//liuchen 2009-7-27
+//solve the problem that "Application.Dialogs.Item(***).Show" and "Application.Dialogs.Count" cannot get the correct result
+struct DialogMatch
{
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Open" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormatCellDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertCell" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Print" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PasteSpecial" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ToolProtectionDocument" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ColumnWidth" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineName" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConfigureDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:HyperlinkDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertGraphic" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertObject" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PageFormatDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataSort" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:RowHeight" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoCorrectDlg" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConditionalFormatDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataConsolidate" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CreateNames" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FillSeries" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Validation") ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineLabelRange" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterAutoFilter" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterSpecialFilter" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoFormat" ) )
+ sal_Int32 nVbaDlgIndex;
+ rtl::OUString aOODlgName;
};
-const sal_Int32 nDialogSize = SAL_N_ELEMENTS( aStringList ) ;
+static const DialogMatch aDialogMatchList[] =
+{
+ { 1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Open" ) ) }, // xlDialogOpen -> .uno:Open
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormatCellDialog" ) ) }, // ??? -> .uno:FormatCellDialog
+ { 55, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertCell" ) ) }, // xlDialogInsert -> .uno:InsertCell
+ { 8, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Print" ) ) }, // xlDialogPrint -> .uno:Print
+ { 9, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrinterSetup" ) ) }, // xlDialogPrinterSetup -> .uno:PrinterSetup
+ { 53, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PasteSpecial" ) ) }, // xlDialogPasteSpecial -> .uno:PasteSpecial
+ { 28, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ToolProtectionDocument" ) ) }, // xlDialogProtectDocument -> uno:ToolProtectionDocument
+ { 47, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ColumnWidth" ) ) }, // xlDialogColumnWidth -> .uno:ColumnWidth
+ { 61, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineName" ) ) }, // xlDialogDefineName -> .uno:DefineName
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConfigureDialog" ) ) }, // ??? -> .uno:ConfigureDialog
+ { 596, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:HyperlinkDialog" ) ) }, // xlDialogInsertHyperlink -> .uno:HyperlinkDialog
+ { 342, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertGraphic" ) ) }, // xlDialogInsertPicture -> .uno:InsertGraphic
+ { 259, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertObject" ) ) }, // xlDialogInsertObject -> .uno:InsertObject
+ { 7, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PageFormatDialog" ) ) }, // xlDialogPageSetup -> .uno:PageFormatDialog
+ { 39, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataSort" ) ) }, // xlDialogSort -> .uno:DataSort
+ { 127, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:RowHeight" ) ) }, // xlDialogRowHeight -> .uno:RowHeight
+ { 485, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoCorrectDlg" ) ) }, // xlDialogAutoCorrect -> .uno:AutoCorrectDlg
+ { 583, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConditionalFormatDialog" ) ) }, // xlDialogCondiationalFormatting -> .uno:ConditionalFormatDialog
+ { 191, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataConsolidate" ) ) }, // xlDialogConsolidate -> .uno:DataConsolidate
+ { 62, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CreateNames" ) ) }, // xlDialogCreateNames -> .uno:CreateNames
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FillSeries" ) ) }, // ??? -> .uno:FillSeries
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Validation" ) ) }, // ??? -> .uno:Validation"
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineLabelRange" ) ) }, // ??? -> .uno:DefineLabelRange
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterAutoFilter" ) ) }, // ??? -> .uno:DataFilterAutoFilter
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterSpecialFilter" ) ) }, // ??? -> .uno:DataFilterSpecialFilter
+ { 269, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoFormat" ) ) } // xlDialogFormatAuto -> .uno:AutoFormat
+};
+
+const sal_Int32 nDialogSize = SAL_N_ELEMENTS( aDialogMatchList ) ;
+//liuchen modified 2009-2-27
rtl::OUString
ScVbaDialog::mapIndexToName( sal_Int32 nIndex )
{
- if( nIndex < nDialogSize )
- return aStringList[ nIndex ];
+ for (int i = 0; i < nDialogSize; i++)
+ {
+ if ( aDialogMatchList[i].nVbaDlgIndex == nIndex )
+ {
+ return aDialogMatchList[i].aOODlgName;
+ }
+ }
+
return rtl::OUString();
}
@@ -88,3 +105,10 @@ ScVbaDialog::getServiceNames()
}
return aServiceNames;
}
+
+//liuchen add 2009-7-27
+sal_Int32 ScVbaDialog::GetSupportedDialogCount()
+{
+ return nDialogSize;
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbadialog.hxx b/sc/source/ui/vba/vbadialog.hxx
index 40f4a4a83a11..086770f19357 100644
--- a/sc/source/ui/vba/vbadialog.hxx
+++ b/sc/source/ui/vba/vbadialog.hxx
@@ -45,6 +45,9 @@ public:
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+
+ //liuchen 2009-7-27
+ static sal_Int32 GetSupportedDialogCount();
};
#endif /* SC_VBA_DIALOG_HXX */
diff --git a/sc/source/ui/vba/vbadialogs.cxx b/sc/source/ui/vba/vbadialogs.cxx
index 67070879535b..361d1a45329c 100644
--- a/sc/source/ui/vba/vbadialogs.cxx
+++ b/sc/source/ui/vba/vbadialogs.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,5 +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 --git a/sc/source/ui/vba/vbadialogs.hxx b/sc/source/ui/vba/vbadialogs.hxx
index 9aab5daf11fe..6b5e1f9a8d90 100644
--- a/sc/source/ui/vba/vbadialogs.hxx
+++ b/sc/source/ui/vba/vbadialogs.hxx
@@ -44,6 +44,7 @@ public:
// XCollection
virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException); //liuchen 2009-7-27
// XDialogs
virtual void SAL_CALL Dummy() throw (css::uno::RuntimeException);
diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx
index 45667adf2f2c..5e9eab58e8c4 100644
--- a/sc/source/ui/vba/vbaeventshelper.cxx
+++ b/sc/source/ui/vba/vbaeventshelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -372,7 +373,15 @@ void ScVbaEventsListener::processWindowResizeMacro()
{
OSL_TRACE( "**** Attempt to FIRE MACRO **** " );
if( !mbDisposed )
- mrVbaEvents.processVbaEvent( WORKBOOK_WINDOWRESIZE, uno::Sequence< uno::Any >() );
+ {
+ try
+ {
+ mrVbaEvents.processVbaEvent( WORKBOOK_WINDOWRESIZE, uno::Sequence< uno::Any >() );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
}
// ============================================================================
@@ -751,3 +760,5 @@ extern sdecl::ServiceDecl const serviceDecl(
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafiledialog.cxx b/sc/source/ui/vba/vbafiledialog.cxx
new file mode 100644
index 000000000000..af85f5d8aee7
--- /dev/null
+++ b/sc/source/ui/vba/vbafiledialog.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbafiledialog.hxx"
+#include "comphelper/processfactory.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker2.hpp>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include "tools/urlobj.hxx"
+
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+
+ScVbaFileDialog::ScVbaFileDialog( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel )
+: ScVbaFileDialog_BASE( xParent, xContext, xModel )
+{
+ m_pFileDialogSelectedItems = new VbaFileDialogSelectedItems(xParent, xContext, (com::sun::star::container::XIndexAccess *)&m_FileDialogSelectedObj);
+}
+
+ScVbaFileDialog::~ScVbaFileDialog()
+{
+ if (m_pFileDialogSelectedItems != NULL)
+ {
+ delete m_pFileDialogSelectedItems;
+ }
+}
+
+rtl::OUString&
+ScVbaFileDialog::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaFileDialog") );
+ return sImplName;
+}
+
+css::uno::Sequence<rtl::OUString>
+ScVbaFileDialog::getServiceNames()
+{
+ static Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.FileDialog" ) );
+ }
+ return aServiceNames;
+
+}
+
+css::uno::Reference< ov::XFileDialogSelectedItems > SAL_CALL
+ScVbaFileDialog::getSelectedItems() throw (css::uno::RuntimeException)
+{
+ css::uno::Reference< ov::XFileDialogSelectedItems > xFileDlgSlc = (ov::XFileDialogSelectedItems *)m_pFileDialogSelectedItems;
+ return xFileDlgSlc;
+}
+
+::sal_Int32 SAL_CALL
+ScVbaFileDialog::Show( ) throw (::com::sun::star::uno::RuntimeException)
+{
+ // Returns an Integer indicating if user pressed "Open" button(-1) or "Cancel" button(0).
+ sal_Int32 nResult = -1;
+ try
+ {
+ m_sSelectedItems.realloc(0);
+
+ const ::rtl::OUString sServiceName = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FilePicker" );
+
+ Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
+ // Set the type of File Picker Dialog: TemplateDescription::FILEOPEN_SIMPLE.
+ Sequence< uno::Any > aDialogType( 1 );
+ aDialogType[0] <<= ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE;
+ Reference < ui::dialogs::XFilePicker > xFilePicker( xMSF->createInstanceWithArguments( sServiceName, aDialogType ), UNO_QUERY );
+ Reference < ui::dialogs::XFilePicker2 > xFilePicker2( xFilePicker, UNO_QUERY );
+ if ( xFilePicker.is() )
+ {
+ xFilePicker->setMultiSelectionMode(sal_True);
+ if ( xFilePicker->execute() )
+ {
+ sal_Bool bUseXFilePicker2 = sal_False;
+ Reference< lang::XServiceInfo > xServiceInfo( xFilePicker, UNO_QUERY );
+ if (xServiceInfo.is())
+ {
+ rtl::OUString sImplName = xServiceInfo->getImplementationName();
+ if (sImplName.equalsAscii("com.sun.star.comp.fpicker.VistaFileDialog") ||
+ sImplName.equalsAscii("com.sun.star.ui.dialogs.SalGtkFilePicker"))
+ {
+ bUseXFilePicker2 = sal_True;
+ }
+ }
+ if ( bUseXFilePicker2 && xFilePicker2.is() )
+ {
+ // On Linux, XFilePicker->getFiles() always return one selected file although we select
+ // more than one file, also on Vista XFilePicker->getFiles() does not work well too,
+ // so we call XFilePicker2->getSelectedFiles() to get selected files.
+ m_sSelectedItems = xFilePicker2->getSelectedFiles();
+ }
+ else
+ {
+ // If only one file is selected, the first entry of the sequence contains the complete path/filename in
+ // URL format. If multiple files are selected, the first entry of the sequence contains the path in URL
+ // format, and the other entries contains the names of the selected files without path information.
+ Sequence< rtl::OUString > aSelectedFiles = xFilePicker->getFiles();
+ sal_Int32 iFileCount = aSelectedFiles.getLength();
+ if ( iFileCount > 1 )
+ {
+ m_sSelectedItems.realloc( iFileCount - 1 );
+ INetURLObject aPath( aSelectedFiles[0] );
+ aPath.setFinalSlash();
+ for ( sal_Int32 i = 1; i < iFileCount; i++ )
+ {
+ if ( aSelectedFiles[i].indexOf ('/') > 0 || aSelectedFiles[i].indexOf ('\\') > 0 )
+ {
+ m_sSelectedItems[i - 1] = aSelectedFiles[i];
+ }
+ else
+ {
+ if ( i == 1 )
+ aPath.Append( aSelectedFiles[i] );
+ else
+ aPath.setName( aSelectedFiles[i] );
+ m_sSelectedItems[i - 1] = aPath.GetMainURL(INetURLObject::NO_DECODE);
+ }
+ }
+ }
+ else if ( iFileCount == 1 )
+ {
+ m_sSelectedItems = aSelectedFiles;
+ }
+ }
+
+ sal_Int32 iFileCount = m_sSelectedItems.getLength();
+ rtl::OUString aTemp;
+ for ( sal_Int32 i = 0; i < iFileCount; i++ )
+ {
+ INetURLObject aObj( m_sSelectedItems[i] );
+ if ( aObj.GetProtocol() == INET_PROT_FILE )
+ {
+ aTemp = aObj.PathToFileName();
+ m_sSelectedItems[i] = aTemp.getLength() > 0 ? aTemp : m_sSelectedItems[i];
+ }
+ }
+ }
+ else
+ {
+ nResult = 0;
+ }
+ }
+
+ m_FileDialogSelectedObj.SetSelectedFile(m_sSelectedItems);
+ }
+ catch( const uno::Exception& )
+ {
+ return 0;
+ }
+
+ return nResult;
+}
diff --git a/sc/source/ui/vba/vbafiledialog.hxx b/sc/source/ui/vba/vbafiledialog.hxx
new file mode 100644
index 000000000000..b38fc16e0c28
--- /dev/null
+++ b/sc/source/ui/vba/vbafiledialog.hxx
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _vbafiledialog_hxx_
+#define _vbafiledialog_hxx_
+
+#include <cppuhelper/implbase1.hxx>
+#include <vbahelper/vbadialogsbase.hxx>
+#include <ooo/vba/XFileDialog.hpp>
+#include "vbafiledialogselecteditems.hxx"
+
+
+typedef cppu::ImplInheritanceHelper1< VbaDialogsBase, ov::XFileDialog > ScVbaFileDialog_BASE;
+
+class ScVbaFileDialog : public ScVbaFileDialog_BASE
+{
+public:
+
+ ScVbaFileDialog( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ) ;
+ virtual ~ScVbaFileDialog() ;
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ //XFileDialog
+ virtual css::uno::Reference< ov::XFileDialogSelectedItems > SAL_CALL getSelectedItems() throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL Show( ) throw (::com::sun::star::uno::RuntimeException) ;
+
+private:
+ css::uno::Sequence < rtl::OUString > m_sSelectedItems;
+ VbaFileDialogSelectedItems *m_pFileDialogSelectedItems;
+ VbaFileDialogSelectedObj m_FileDialogSelectedObj;
+};
+
+#endif
diff --git a/sc/source/ui/vba/vbafiledialogselecteditems.cxx b/sc/source/ui/vba/vbafiledialogselecteditems.cxx
new file mode 100644
index 000000000000..ee3adb03342f
--- /dev/null
+++ b/sc/source/ui/vba/vbafiledialogselecteditems.cxx
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbafiledialogselecteditems.hxx"
+
+using namespace ::com::sun::star;
+
+VbaFileDialogSelectedItems::VbaFileDialogSelectedItems( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess
+ )
+ : FileDialogSelectedItems_BASE( xParent, xContext, xIndexAccess )
+{
+}
+
+
+rtl::OUString& VbaFileDialogSelectedItems::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaFileDialogSelectedItems") );
+ return sImplName;
+
+}
+css::uno::Sequence<rtl::OUString> VbaFileDialogSelectedItems::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.FileDialogSelectedItems" ) );
+ }
+ return aServiceNames;
+
+}
+
+css::uno::Any VbaFileDialogSelectedItems::createCollectionObject( const css::uno::Any& aSource )
+{
+ css::uno::Any aRet;
+ aRet = aSource;
+ return aRet;
+}
+
+
+css::uno::Type SAL_CALL
+VbaFileDialogSelectedItems::getElementType() throw (css::uno::RuntimeException)
+{
+ return ooo::vba::XFileDialogSelectedItems::static_type(0);
+}
+
+css::uno::Reference< css::container::XEnumeration > SAL_CALL
+VbaFileDialogSelectedItems::createEnumeration() throw (css::uno::RuntimeException)
+{
+ css::uno::Reference< css::container::XEnumeration > xEnumRet(m_xIndexAccess, css::uno::UNO_QUERY);
+ return xEnumRet;
+}
+
+
+//VbaFileDialogSelectedObj
+//////////////////////////////////////////////////////////////////////////
+
+VbaFileDialogSelectedObj::VbaFileDialogSelectedObj()
+{
+ m_nIndex = 0;
+}
+
+
+sal_Bool
+VbaFileDialogSelectedObj::SetSelectedFile(css::uno::Sequence<rtl::OUString> &sFList)
+{
+ m_sFileList = sFList;
+ return sal_True;
+}
+
+sal_Int32 SAL_CALL
+VbaFileDialogSelectedObj::getCount() throw(::com::sun::star::uno::RuntimeException)
+{
+ sal_Int32 nListCnt = m_sFileList.getLength();
+ return nListCnt;
+}
+
+::com::sun::star::uno::Any SAL_CALL VbaFileDialogSelectedObj::getByIndex( sal_Int32 nIndex )
+throw(::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException)
+{
+ css::uno::Any aRet;
+
+ if ( nIndex >= getCount() )
+ {
+ throw css::lang::IndexOutOfBoundsException();
+ }
+
+ return uno::makeAny(m_sFileList[nIndex]);
+}
+
+::com::sun::star::uno::Type SAL_CALL
+VbaFileDialogSelectedObj::getElementType()
+throw(::com::sun::star::uno::RuntimeException)
+{
+ return getCppuType((uno::Reference<com::sun::star::container::XIndexAccess>*)0);
+}
+
+sal_Bool SAL_CALL VbaFileDialogSelectedObj::hasElements()
+throw(::com::sun::star::uno::RuntimeException)
+{
+ return ( getCount() != 0 );
+}
+
+::sal_Bool SAL_CALL
+VbaFileDialogSelectedObj::hasMoreElements( )
+throw (uno::RuntimeException)
+{
+ if (getCount() > m_nIndex)
+ {
+ return sal_True;
+ }
+ return sal_False;
+}
+
+uno::Any SAL_CALL
+VbaFileDialogSelectedObj::nextElement( )
+throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ if (!hasMoreElements())
+ {
+ throw container::NoSuchElementException();
+ }
+
+ return uno::makeAny(m_sFileList[m_nIndex++]);
+}
diff --git a/sc/source/ui/vba/vbafiledialogselecteditems.hxx b/sc/source/ui/vba/vbafiledialogselecteditems.hxx
new file mode 100644
index 000000000000..272e00ef2d30
--- /dev/null
+++ b/sc/source/ui/vba/vbafiledialogselecteditems.hxx
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _vbafiledialogselecteditems_hxx_
+#define _vbafiledialogselecteditems_hxx_
+
+#include <ooo/vba/XFileDialogSelectedItems.hpp>
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/container/XIndexAccess.hpp>
+
+typedef CollTestImplHelper< ov::XFileDialogSelectedItems > FileDialogSelectedItems_BASE;
+
+
+class VbaFileDialogSelectedItems : public FileDialogSelectedItems_BASE
+{
+public:
+ VbaFileDialogSelectedItems( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess );
+
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+protected:
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+private:
+};
+
+
+class VbaFileDialogSelectedObj : public cppu::WeakImplHelper2<css::container::XIndexAccess, css::container::XEnumeration>
+{
+public:
+ VbaFileDialogSelectedObj();
+ sal_Bool SetSelectedFile(css::uno::Sequence<rtl::OUString> &sFList);
+ //XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex )
+ throw(::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
+
+ //XEnumeration
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL nextElement( ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+protected:
+private:
+ css::uno::Sequence<rtl::OUString> m_sFileList;
+ sal_Int32 m_nIndex;
+};
+
+#endif
diff --git a/sc/source/ui/vba/vbafilesearch.cxx b/sc/source/ui/vba/vbafilesearch.cxx
new file mode 100644
index 000000000000..9711a5316e4a
--- /dev/null
+++ b/sc/source/ui/vba/vbafilesearch.cxx
@@ -0,0 +1,242 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbafilesearch.hxx"
+#include "vbaapplication.hxx"
+#include "vbafoundfiles.hxx"
+#include <comphelper/processfactory.hxx>
+#include <tools/urlobj.hxx>
+#include <tools/wldcrd.hxx>
+#include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <vector>
+#include "unotools/viewoptions.hxx"
+#include <osl/file.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ucb;
+using namespace ::com::sun::star::lang;
+using namespace comphelper;
+
+static Reference< XSimpleFileAccess3 > getFileAccess( void )
+{
+ static Reference< XSimpleFileAccess3 > xSFI;
+ if( !xSFI.is() )
+ {
+ Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory();
+ if( xSMgr.is() )
+ {
+ xSFI = Reference< XSimpleFileAccess3 >( xSMgr->createInstance
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY );
+ }
+ }
+ return xSFI;
+}
+
+ScVbaFileSearch::ScVbaFileSearch( ScVbaApplication* pApp, const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext )
+ : ScVbaFileSearchImpl_BASE( xParent, xContext ), m_pApplication( pApp )
+{
+ NewSearch();
+}
+
+ScVbaFileSearch::~ScVbaFileSearch()
+{
+}
+
+::rtl::OUString SAL_CALL ScVbaFileSearch::getFileName() throw (css::uno::RuntimeException)
+{
+ return m_sFileName;
+}
+
+void SAL_CALL ScVbaFileSearch::setFileName(const ::rtl::OUString& _fileName ) throw (css::uno::RuntimeException)
+{
+ m_sFileName = _fileName;
+}
+
+::rtl::OUString SAL_CALL ScVbaFileSearch::getLookIn() throw (css::uno::RuntimeException)
+{
+ return m_sLookIn;
+}
+
+void SAL_CALL ScVbaFileSearch::setLookIn( const ::rtl::OUString& _lookIn ) throw (css::uno::RuntimeException)
+{
+ m_sLookIn = _lookIn;
+}
+
+sal_Bool SAL_CALL ScVbaFileSearch::getSearchSubFolders() throw (css::uno::RuntimeException)
+{
+ return m_bSearchSubFolders;
+}
+
+void SAL_CALL ScVbaFileSearch::setSearchSubFolders( sal_Bool _searchSubFolders ) throw (css::uno::RuntimeException)
+{
+ m_bSearchSubFolders = _searchSubFolders;
+}
+
+sal_Bool SAL_CALL ScVbaFileSearch::getMatchTextExactly() throw (css::uno::RuntimeException)
+{
+ return m_bMatchTextExactly;
+}
+
+void SAL_CALL ScVbaFileSearch::setMatchTextExactly( sal_Bool _matchTextExactly ) throw (css::uno::RuntimeException)
+{
+ m_bMatchTextExactly = _matchTextExactly;
+}
+
+static bool IsWildCard( const ::rtl::OUString& fileName )
+{
+ static sal_Char cWild1 = '*';
+ static sal_Char cWild2 = '?';
+
+ return ( ( fileName.indexOf( cWild1 ) >= 0 )
+ || ( fileName.indexOf( cWild2 ) >= 0 ) );
+}
+
+static void SearchWildCard(const WildCard& wildCard, const ::rtl::OUString& aDir, bool bSearchSubFolders, css::uno::Sequence< rtl::OUString >& aSearchedFiles)
+{
+ Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ Sequence< rtl::OUString > aDirSeq;
+ try
+ {
+ if ( xSFI.is() )
+ {
+ aDirSeq = xSFI->getFolderContents( aDir, bSearchSubFolders );
+ }
+ }
+ catch( css::uno::Exception& )
+ {
+ }
+ sal_Int32 nLength = aDirSeq.getLength();
+ for ( sal_Int32 i = 0; i < nLength; i++ )
+ {
+ rtl::OUString aURLStr = aDirSeq[i];
+ if ( xSFI->isFolder( aURLStr ) )
+ {
+ if ( bSearchSubFolders )
+ {
+ SearchWildCard( wildCard, aURLStr, true, aSearchedFiles );
+ }
+ }
+ else
+ {
+ INetURLObject aFileURL( aURLStr );
+ rtl::OUString aFileName = aFileURL.GetLastName( INetURLObject::DECODE_UNAMBIGUOUS );
+ if ( wildCard.Matches( aFileName.toAsciiLowerCase() ) )
+ {
+ sal_Int32 nFilesLength = aSearchedFiles.getLength();
+ aSearchedFiles.realloc( nFilesLength + 1 );
+ rtl::OUString sSystemPath;
+ ::osl::File::getSystemPathFromFileURL( aURLStr, sSystemPath );
+ aSearchedFiles[nFilesLength] = sSystemPath;
+ }
+ }
+ }
+}
+
+sal_Int32 SAL_CALL ScVbaFileSearch::Execute( ) throw (css::uno::RuntimeException)
+{
+ m_aSearchedFiles.realloc(0);
+ Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ if ( !xSFI.is() || !xSFI->isFolder( m_sLookIn ) )
+ {
+ return 0;
+ }
+
+ if ( m_sFileName == ::rtl::OUString::createFromAscii( "" ) )
+ {
+ return 1;
+ }
+
+ ::rtl::OUString aTempFileName = m_sFileName.toAsciiLowerCase();
+ if ( IsWildCard( aTempFileName ) )
+ {
+ bool bEndWithAsterisk = aTempFileName.endsWithAsciiL("*", 1);
+ bool bStartWithAsterisk = (aTempFileName.indexOf(::rtl::OUString::createFromAscii("*")) == 0);
+ if ( !bEndWithAsterisk && !bStartWithAsterisk )
+ {
+ aTempFileName = ::rtl::OUString::createFromAscii("*") + aTempFileName + ::rtl::OUString::createFromAscii("*");
+ }
+ }
+ else
+ {
+ aTempFileName = ::rtl::OUString::createFromAscii("*") + aTempFileName + ::rtl::OUString::createFromAscii("*");
+ }
+ WildCard wildCard( aTempFileName );
+ SearchWildCard( wildCard, m_sLookIn, m_bSearchSubFolders, m_aSearchedFiles );
+
+ return m_aSearchedFiles.getLength();
+}
+
+//liuchen 2009-11-5 set ScVbaApplication::getDefaultFilePath( ) as the InitPath for FileSearch
+ ::rtl::OUString ScVbaFileSearch::getInitPath() throw (css::uno::RuntimeException)
+{
+ String aPath;
+
+ if (m_pApplication != NULL)
+ {
+ aPath = m_pApplication->getDefaultFilePath();
+ }
+
+ return aPath;
+}
+
+void SAL_CALL ScVbaFileSearch::NewSearch( ) throw (css::uno::RuntimeException)
+{
+ m_sFileName = ::rtl::OUString::createFromAscii( "" );
+ m_sLookIn = getInitPath();
+ m_bSearchSubFolders = false;
+ m_bMatchTextExactly = false;
+ m_aSearchedFiles.realloc(0);
+}
+
+Reference< XFoundFiles > SAL_CALL ScVbaFileSearch::getFoundFiles() throw (css::uno::RuntimeException)
+{
+ css::uno::Reference< ov::XFoundFiles > xFoundFiles = new VbaFoundFiles(
+ mxParent, mxContext, (css::container::XIndexAccess *) new VbaFoundFilesEnum(m_aSearchedFiles) );
+ return xFoundFiles;
+}
+
+rtl::OUString& ScVbaFileSearch::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaFileSearch") );
+ return sImplName;
+}
+
+css::uno::Sequence< rtl::OUString > ScVbaFileSearch::getServiceNames()
+{
+ static css::uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.FileSearch") );
+ }
+ return aServiceNames;
+}
diff --git a/sc/source/ui/vba/vbafilesearch.hxx b/sc/source/ui/vba/vbafilesearch.hxx
new file mode 100644
index 000000000000..e82f14a94699
--- /dev/null
+++ b/sc/source/ui/vba/vbafilesearch.hxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef SC_VBA_FILESEARCH_HXX
+#define SC_VBA_FILESEARCH_HXX
+
+#include <ooo/vba/XFileSearch.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <vbahelper/vbahelperinterface.hxx>
+
+namespace css = ::com::sun::star;
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::XFileSearch > ScVbaFileSearchImpl_BASE;
+
+class ScVbaApplication;
+
+class ScVbaFileSearch : public ScVbaFileSearchImpl_BASE
+{
+private:
+ rtl::OUString m_sFileName;
+ rtl::OUString m_sLookIn;
+ sal_Bool m_bSearchSubFolders;
+ sal_Bool m_bMatchTextExactly;
+ ScVbaApplication* m_pApplication;
+ css::uno::Sequence< rtl::OUString > m_aSearchedFiles;
+
+ ::rtl::OUString getInitPath() throw (css::uno::RuntimeException);
+
+public:
+ ScVbaFileSearch( ScVbaApplication* pApp, const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ virtual ~ScVbaFileSearch();
+
+ // Attributes
+ virtual ::rtl::OUString SAL_CALL getFileName() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setFileName(const ::rtl::OUString& _fileName ) throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getLookIn() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLookIn(const ::rtl::OUString& _lookIn ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getSearchSubFolders() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSearchSubFolders( sal_Bool _searchSubFolders ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getMatchTextExactly() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMatchTextExactly( sal_Bool _matchTextExactly ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ::ooo::vba::XFoundFiles > SAL_CALL getFoundFiles() throw (css::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL Execute( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL NewSearch( ) throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence< rtl::OUString > getServiceNames();
+};
+
+#endif /* SC_VBA_FILESEARCH_HXX */
diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx
index 5894d3ea8c71..68ade5207674 100644
--- a/sc/source/ui/vba/vbafont.cxx
+++ b/sc/source/ui/vba/vbafont.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -499,3 +500,5 @@ ScVbaFont::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaformat.cxx b/sc/source/ui/vba/vbaformat.cxx
index 81e9e0ebe73b..53a3375b380d 100644
--- a/sc/source/ui/vba/vbaformat.cxx
+++ b/sc/source/ui/vba/vbaformat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -841,3 +842,4 @@ template class ScVbaFormat< excel::XStyle >;
template class ScVbaFormat< excel::XRange >;
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaformatcondition.cxx b/sc/source/ui/vba/vbaformatcondition.cxx
index 99d8a579956a..deed22ab287e 100644
--- a/sc/source/ui/vba/vbaformatcondition.cxx
+++ b/sc/source/ui/vba/vbaformatcondition.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -174,3 +175,5 @@ ScVbaFormatCondition::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx
index 8dd67843ec00..6eda5c654238 100644
--- a/sc/source/ui/vba/vbaformatconditions.cxx
+++ b/sc/source/ui/vba/vbaformatconditions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -299,3 +300,4 @@ ScVbaFormatConditions::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafoundfiles.cxx b/sc/source/ui/vba/vbafoundfiles.cxx
new file mode 100644
index 000000000000..78e61e8b8601
--- /dev/null
+++ b/sc/source/ui/vba/vbafoundfiles.cxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbafoundfiles.hxx"
+
+////////////////////////////////VbaFoundFilesEnum//////////////////////////////////////////
+VbaFoundFilesEnum::VbaFoundFilesEnum() : m_nIndex(0)
+{
+
+}
+
+VbaFoundFilesEnum::VbaFoundFilesEnum( css::uno::Sequence<rtl::OUString>& sFileList ) : m_nIndex(0), m_sFileList(sFileList)
+{
+
+}
+
+VbaFoundFilesEnum::~VbaFoundFilesEnum()
+{
+
+}
+
+void VbaFoundFilesEnum::SetFileList( css::uno::Sequence<rtl::OUString>& sFileList )
+{
+ m_nIndex = 0;
+ m_sFileList = sFileList;
+}
+
+sal_Int32 SAL_CALL VbaFoundFilesEnum::getCount() throw (css::uno::RuntimeException)
+{
+ return m_sFileList.getLength();
+}
+
+css::uno::Any SAL_CALL VbaFoundFilesEnum::getByIndex( sal_Int32 nIndex )
+ throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ if ( nIndex >= getCount() )
+ {
+ throw css::lang::IndexOutOfBoundsException();
+ }
+
+ return css::uno::makeAny( m_sFileList[nIndex] );
+}
+
+css::uno::Type SAL_CALL VbaFoundFilesEnum::getElementType() throw (css::uno::RuntimeException)
+{
+ return getCppuType((css::uno::Reference< css::container::XIndexAccess >*)0);
+}
+
+sal_Bool SAL_CALL VbaFoundFilesEnum::hasElements() throw (css::uno::RuntimeException)
+{
+ return ( getCount() != 0 );
+}
+
+sal_Bool SAL_CALL VbaFoundFilesEnum::hasMoreElements() throw (css::uno::RuntimeException)
+{
+ if ( getCount() > m_nIndex )
+ {
+ return sal_True;
+ }
+ return sal_False;
+}
+
+css::uno::Any SAL_CALL VbaFoundFilesEnum::nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ if ( !hasMoreElements() )
+ {
+ throw css::container::NoSuchElementException();
+ }
+
+ return css::uno::makeAny( m_sFileList[m_nIndex++] );
+}
+
+////////////////////////////////VbaFoundFiles//////////////////////////////////////////
+VbaFoundFiles::VbaFoundFiles( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess
+ ) : VbaFoundFilesImpl_BASE( xParent, xContext, xIndexAccess )
+{
+
+}
+
+VbaFoundFiles::~VbaFoundFiles()
+{
+
+}
+
+css::uno::Reference< css::container::XEnumeration > VbaFoundFiles::createEnumeration() throw (css::uno::RuntimeException)
+{
+ css::uno::Reference< css::container::XEnumeration > xEnumRet( m_xIndexAccess, css::uno::UNO_QUERY );
+ return xEnumRet;
+}
+
+css::uno::Any VbaFoundFiles::createCollectionObject( const css::uno::Any& aSource )
+{
+ return aSource;
+}
+
+css::uno::Type VbaFoundFiles::getElementType() throw (css::uno::RuntimeException)
+{
+ return ov::XFoundFiles::static_type(0);
+}
+
+rtl::OUString& VbaFoundFiles::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaFoundFiles") );
+ return sImplName;
+}
+
+css::uno::Sequence< rtl::OUString > VbaFoundFiles::getServiceNames()
+{
+ static css::uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.FoundFiles") );
+ }
+ return aServiceNames;
+}
diff --git a/sc/source/ui/vba/vbafoundfiles.hxx b/sc/source/ui/vba/vbafoundfiles.hxx
new file mode 100644
index 000000000000..b02d3bb91526
--- /dev/null
+++ b/sc/source/ui/vba/vbafoundfiles.hxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef SC_VBA_FOUNDFILES_HXX
+#define SC_VBA_FOUNDFILES_HXX
+
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <ooo/vba/XFoundFiles.hpp>
+#include <vbahelper/vbacollectionimpl.hxx>
+
+namespace css = ::com::sun::star;
+
+typedef CollTestImplHelper< ooo::vba::XFoundFiles > VbaFoundFilesImpl_BASE;
+
+class VbaFoundFilesEnum : public cppu::WeakImplHelper2< css::container::XIndexAccess, css::container::XEnumeration >
+{
+private:
+ sal_Int32 m_nIndex;
+ css::uno::Sequence< rtl::OUString > m_sFileList;
+
+public:
+ VbaFoundFilesEnum();
+ VbaFoundFilesEnum( css::uno::Sequence< rtl::OUString >& sFileList );
+ ~VbaFoundFilesEnum();
+
+ void SetFileList( css::uno::Sequence< rtl::OUString >& sFileList );
+
+ // XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ // XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException);
+
+ // XEnumeration
+ virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException);
+};
+
+class VbaFoundFiles : public VbaFoundFilesImpl_BASE
+{
+private:
+
+public:
+ VbaFoundFiles( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess );
+ virtual ~VbaFoundFiles();
+
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence< rtl::OUString > getServiceNames();
+};
+
+#endif /* SC_VBA_FOUNDFILES_HXX */
diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx
index 2f9f002d427d..e37a2bb933c0 100644
--- a/sc/source/ui/vba/vbaglobals.cxx
+++ b/sc/source/ui/vba/vbaglobals.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -248,6 +249,12 @@ ScVbaGlobals::getDebug() throw (uno::RuntimeException)
return uno::Any();
}
+uno::Any SAL_CALL
+ScVbaGlobals::MenuBars( const uno::Any& aIndex ) throw (uno::RuntimeException)
+{
+ return uno::Any( getApplication()->MenuBars(aIndex) );
+}
+
uno::Sequence< ::rtl::OUString > SAL_CALL
ScVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException)
{
@@ -303,3 +310,4 @@ extern sdecl::ServiceDecl const serviceDecl(
"ooo.vba.excel.Globals" );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaglobals.hxx b/sc/source/ui/vba/vbaglobals.hxx
index f22e5b19faa4..3108f5ab871c 100644
--- a/sc/source/ui/vba/vbaglobals.hxx
+++ b/sc/source/ui/vba/vbaglobals.hxx
@@ -84,6 +84,7 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > Sc
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XApplication > SAL_CALL getExcel() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL getDebug() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL MenuBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
// XMultiServiceFactory
diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx
index cc76b1e60125..62d71a08f4fc 100644
--- a/sc/source/ui/vba/vbahelper.cxx
+++ b/sc/source/ui/vba/vbahelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -756,3 +757,5 @@ ScVbaCellRangeAccess::GetDataSet( ScCellRangeObj* pRangeObj )
} // vba
} // ooo
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbahyperlink.cxx b/sc/source/ui/vba/vbahyperlink.cxx
index e37df1e118b4..2f3c5703203f 100644
--- a/sc/source/ui/vba/vbahyperlink.cxx
+++ b/sc/source/ui/vba/vbahyperlink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -244,3 +245,5 @@ extern sdecl::ServiceDecl const serviceDecl(
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbahyperlinks.cxx b/sc/source/ui/vba/vbahyperlinks.cxx
index 89a8109e6aa2..083607ff345d 100644
--- a/sc/source/ui/vba/vbahyperlinks.cxx
+++ b/sc/source/ui/vba/vbahyperlinks.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -291,3 +292,5 @@ uno::Any ScVbaHyperlinks::createCollectionObject( const uno::Any& rSource )
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaHyperlinks, "ooo.vba.excel.Hyperlinks" )
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx
index face47767bdc..733f394fabd4 100644
--- a/sc/source/ui/vba/vbainterior.cxx
+++ b/sc/source/ui/vba/vbainterior.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -415,3 +416,4 @@ ScVbaInterior::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenu.cxx b/sc/source/ui/vba/vbamenu.cxx
new file mode 100644
index 000000000000..237fd723a1b4
--- /dev/null
+++ b/sc/source/ui/vba/vbamenu.cxx
@@ -0,0 +1,84 @@
+/*
+ * 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@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"
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+ScVbaMenu::ScVbaMenu( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBarControl >& xCommandBarControl ) throw( uno::RuntimeException ) : Menu_BASE( xParent, xContext ), m_xCommandBarControl( xCommandBarControl )
+{
+}
+
+::rtl::OUString SAL_CALL
+ScVbaMenu::getCaption() throw ( uno::RuntimeException )
+{
+ return m_xCommandBarControl->getCaption();
+}
+
+void SAL_CALL
+ScVbaMenu::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException)
+{
+ m_xCommandBarControl->setCaption( _caption );
+}
+
+void SAL_CALL
+ScVbaMenu::Delete( ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ m_xCommandBarControl->Delete();
+}
+
+uno::Any SAL_CALL
+ScVbaMenu::MenuItems( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBarControl->Controls( uno::Any() ), uno::UNO_QUERY_THROW );
+ uno::Reference< excel::XMenuItems > xMenuItems( new ScVbaMenuItems( this, mxContext, xCommandBarControls ) );
+ if( aIndex.hasValue() )
+ {
+ return xMenuItems->Item( aIndex, uno::Any() );
+ }
+ return uno::makeAny( xMenuItems );
+}
+
+rtl::OUString&
+ScVbaMenu::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenu") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenu::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Menu" ) );
+ }
+ return aServiceNames;
+}
diff --git a/sc/source/ui/vba/vbamenu.hxx b/sc/source/ui/vba/vbamenu.hxx
new file mode 100644
index 000000000000..a297c6d38317
--- /dev/null
+++ b/sc/source/ui/vba/vbamenu.hxx
@@ -0,0 +1,54 @@
+/*
+ * 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@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
+
+#include <ooo/vba/excel/XMenu.hpp>
+#include <ooo/vba/XCommandBarControl.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::excel::XMenu > Menu_BASE;
+
+class ScVbaMenu : public Menu_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBarControl > m_xCommandBarControl;
+
+public:
+ ScVbaMenu( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBarControl >& xCommandBarControl ) throw( css::uno::RuntimeException );
+
+ virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL MenuItems( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif//SC_VBA_MENU_HXX
diff --git a/sc/source/ui/vba/vbamenubar.cxx b/sc/source/ui/vba/vbamenubar.cxx
new file mode 100644
index 000000000000..abf2c05a6f81
--- /dev/null
+++ b/sc/source/ui/vba/vbamenubar.cxx
@@ -0,0 +1,66 @@
+/*
+ * 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@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>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+ScVbaMenuBar::ScVbaMenuBar( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBar >& xCommandBar ) throw( uno::RuntimeException ) : MenuBar_BASE( xParent, xContext ), m_xCommandBar( xCommandBar )
+{
+}
+
+uno::Any SAL_CALL
+ScVbaMenuBar::Menus( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBar->Controls( uno::Any() ), uno::UNO_QUERY_THROW );
+ uno::Reference< excel::XMenus > xMenus( new ScVbaMenus( this, mxContext, xCommandBarControls ) );
+ if( aIndex.hasValue() )
+ {
+ return xMenus->Item( aIndex, uno::Any() );
+ }
+ return uno::makeAny( xMenus );
+}
+
+rtl::OUString&
+ScVbaMenuBar::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuBar") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenuBar::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuBar" ) );
+ }
+ return aServiceNames;
+}
diff --git a/sc/source/ui/vba/vbamenubar.hxx b/sc/source/ui/vba/vbamenubar.hxx
new file mode 100644
index 000000000000..6ba8f360bd28
--- /dev/null
+++ b/sc/source/ui/vba/vbamenubar.hxx
@@ -0,0 +1,50 @@
+/*
+ * 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@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
+
+#include <ooo/vba/excel/XMenuBar.hpp>
+#include <ooo/vba/XCommandBar.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::excel::XMenuBar > MenuBar_BASE;
+
+class ScVbaMenuBar : public MenuBar_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBar > m_xCommandBar;
+
+public:
+ ScVbaMenuBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBar >& xCommandBar ) throw( css::uno::RuntimeException );
+
+ virtual css::uno::Any SAL_CALL Menus( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif//SC_VBA_MENUBAR_HXX
diff --git a/sc/source/ui/vba/vbamenubars.cxx b/sc/source/ui/vba/vbamenubars.cxx
new file mode 100644
index 000000000000..a13bb492575d
--- /dev/null
+++ b/sc/source/ui/vba/vbamenubars.cxx
@@ -0,0 +1,137 @@
+/*
+ * 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@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>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuBarEnumeration_BASE;
+
+class MenuBarEnumeration : public MenuBarEnumeration_BASE
+{
+ uno::Reference< XHelperInterface > m_xParent;
+ uno::Reference< uno::XComponentContext > m_xContext;
+ uno::Reference< container::XEnumeration > m_xEnumeration;
+public:
+ MenuBarEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration )
+ {
+ }
+ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
+ {
+ return m_xEnumeration->hasMoreElements();
+ }
+ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
+ {
+ // FIXME: should be add menubar
+ if( hasMoreElements() )
+ {
+ uno::Reference< XCommandBar > xCommandBar( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
+ uno::Reference< excel::XMenuBar > xMenuBar( new ScVbaMenuBar( m_xParent, m_xContext, xCommandBar ) );
+ return uno::makeAny( xMenuBar );
+ }
+ else
+ throw container::NoSuchElementException();
+ return uno::Any();
+ }
+};
+
+ScVbaMenuBars::ScVbaMenuBars( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBars >& xCommandBars ) throw ( uno::RuntimeException ) : MenuBars_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBars( xCommandBars )
+{
+}
+
+ScVbaMenuBars::~ScVbaMenuBars()
+{
+}
+
+// XEnumerationAccess
+uno::Type SAL_CALL
+ScVbaMenuBars::getElementType() throw ( uno::RuntimeException )
+{
+ return excel::XMenuBar::static_type( 0 );
+}
+
+uno::Reference< container::XEnumeration >
+ScVbaMenuBars::createEnumeration() throw ( uno::RuntimeException )
+{
+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBars, uno::UNO_QUERY_THROW );
+ return uno::Reference< container::XEnumeration >( new MenuBarEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) );
+}
+
+uno::Any
+ScVbaMenuBars::createCollectionObject( const uno::Any& aSource )
+{
+ // make no sense
+ return aSource;
+}
+
+sal_Int32 SAL_CALL
+ScVbaMenuBars::getCount() throw(css::uno::RuntimeException)
+{
+ return m_xCommandBars->getCount();
+}
+
+// ScVbaCollectionBaseImpl
+uno::Any SAL_CALL
+ScVbaMenuBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException )
+{
+ sal_Int16 nIndex = 0;
+ aIndex >>= nIndex;
+ if( nIndex == excel::XlSheetType::xlWorksheet )
+ {
+ uno::Any aSource;
+ aSource <<= rtl::OUString::createFromAscii( "Worksheet Menu Bar" );
+ uno::Reference< XCommandBar > xCommandBar( m_xCommandBars->Item( aSource, uno::Any() ), uno::UNO_QUERY_THROW );
+ uno::Reference< excel::XMenuBar > xMenuBar( new ScVbaMenuBar( this, mxContext, xCommandBar ) );
+ return uno::makeAny( xMenuBar );
+ }
+
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+
+ return uno::Any();
+}
+
+// XHelperInterface
+rtl::OUString&
+ScVbaMenuBars::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuBars") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenuBars::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuBars" ) );
+ }
+ return aServiceNames;
+}
diff --git a/sc/source/ui/vba/vbamenubars.hxx b/sc/source/ui/vba/vbamenubars.hxx
new file mode 100644
index 000000000000..44cf96e5b010
--- /dev/null
+++ b/sc/source/ui/vba/vbamenubars.hxx
@@ -0,0 +1,61 @@
+/*
+ * 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@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
+
+#include <ooo/vba/excel/XMenuBars.hpp>
+#include <ooo/vba/excel/XMenuBar.hpp>
+#include <ooo/vba/XCommandBars.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <vbahelper/vbacollectionimpl.hxx>
+
+typedef CollTestImplHelper< ov::excel::XMenuBars > MenuBars_BASE;
+
+class ScVbaMenuBars : public MenuBars_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBars > m_xCommandBars;
+
+public:
+ ScVbaMenuBars( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBars >& xCommandBars ) throw (css::uno::RuntimeException);
+ virtual ~ScVbaMenuBars();
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+
+ virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& aIndex, const css::uno::Any& /*aIndex2*/ ) throw( css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif//SC_VBA_MENUBARS_HXX
diff --git a/sc/source/ui/vba/vbamenuitem.cxx b/sc/source/ui/vba/vbamenuitem.cxx
new file mode 100644
index 000000000000..42f276bc8bc9
--- /dev/null
+++ b/sc/source/ui/vba/vbamenuitem.cxx
@@ -0,0 +1,82 @@
+/*
+ * 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@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;
+using namespace ooo::vba;
+
+ScVbaMenuItem::ScVbaMenuItem( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBarControl >& xCommandBarControl ) throw( uno::RuntimeException ) : MenuItem_BASE( xParent, xContext ), m_xCommandBarControl( xCommandBarControl )
+{
+}
+
+::rtl::OUString SAL_CALL
+ScVbaMenuItem::getCaption() throw ( uno::RuntimeException )
+{
+ return m_xCommandBarControl->getCaption();
+}
+
+void SAL_CALL
+ScVbaMenuItem::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException)
+{
+ m_xCommandBarControl->setCaption( _caption );
+}
+
+::rtl::OUString SAL_CALL
+ScVbaMenuItem::getOnAction() throw ( uno::RuntimeException )
+{
+ return m_xCommandBarControl->getOnAction();
+}
+
+void SAL_CALL
+ScVbaMenuItem::setOnAction( const ::rtl::OUString& _onaction ) throw (uno::RuntimeException)
+{
+ m_xCommandBarControl->setOnAction( _onaction );
+}
+
+void SAL_CALL
+ScVbaMenuItem::Delete( ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ m_xCommandBarControl->Delete();
+}
+
+rtl::OUString&
+ScVbaMenuItem::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuItem") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenuItem::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuItem" ) );
+ }
+ return aServiceNames;
+}
diff --git a/sc/source/ui/vba/vbamenuitem.hxx b/sc/source/ui/vba/vbamenuitem.hxx
new file mode 100644
index 000000000000..eaccdbb6a113
--- /dev/null
+++ b/sc/source/ui/vba/vbamenuitem.hxx
@@ -0,0 +1,55 @@
+/*
+ * 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@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
+
+#include <ooo/vba/excel/XMenuItem.hpp>
+#include <ooo/vba/XCommandBarControl.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::excel::XMenuItem > MenuItem_BASE;
+
+class ScVbaMenuItem : public MenuItem_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBarControl > m_xCommandBarControl;
+
+public:
+ ScVbaMenuItem( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBarControl >& xCommandBarControl ) throw( css::uno::RuntimeException );
+
+ virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setOnAction( const ::rtl::OUString& _onaction ) throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif//SC_VBA_MENUITEM_HXX
diff --git a/sc/source/ui/vba/vbamenuitems.cxx b/sc/source/ui/vba/vbamenuitems.cxx
new file mode 100644
index 000000000000..f3a3f3efd4c0
--- /dev/null
+++ b/sc/source/ui/vba/vbamenuitems.cxx
@@ -0,0 +1,150 @@
+/*
+ * 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@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"
+#include <ooo/vba/office/MsoControlType.hpp>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuEnumeration_BASE;
+
+class MenuEnumeration : public MenuEnumeration_BASE
+{
+ uno::Reference< XHelperInterface > m_xParent;
+ uno::Reference< uno::XComponentContext > m_xContext;
+ uno::Reference< container::XEnumeration > m_xEnumeration;
+public:
+ MenuEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration )
+ {
+ }
+ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
+ {
+ return m_xEnumeration->hasMoreElements();
+ }
+ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
+ {
+ // FIXME: should be add menu
+ if( hasMoreElements() )
+ {
+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
+ if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup )
+ {
+ uno::Reference< excel::XMenu > xMenu( new ScVbaMenu( m_xParent, m_xContext, xCommandBarControl ) );
+ return uno::makeAny( xMenu );
+ }
+ else if( xCommandBarControl->getType() == office::MsoControlType::msoControlButton )
+ {
+ uno::Reference< excel::XMenuItem > xMenuItem( new ScVbaMenuItem( m_xParent, m_xContext, xCommandBarControl ) );
+ return uno::makeAny( xMenuItem );
+ }
+ nextElement();
+ }
+ else
+ throw container::NoSuchElementException();
+ return uno::Any();
+ }
+};
+
+ScVbaMenuItems::ScVbaMenuItems( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBarControls >& xCommandBarControls ) throw ( uno::RuntimeException ) : MenuItems_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBarControls( xCommandBarControls )
+{
+}
+
+// XEnumerationAccess
+uno::Type SAL_CALL
+ScVbaMenuItems::getElementType() throw ( uno::RuntimeException )
+{
+ return excel::XMenuItem::static_type( 0 );
+}
+
+uno::Reference< container::XEnumeration >
+ScVbaMenuItems::createEnumeration() throw ( uno::RuntimeException )
+{
+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBarControls, uno::UNO_QUERY_THROW );
+ return uno::Reference< container::XEnumeration >( new MenuEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) );
+}
+
+uno::Any
+ScVbaMenuItems::createCollectionObject( const uno::Any& aSource )
+{
+ // make no sense
+ return aSource;
+}
+
+sal_Int32 SAL_CALL
+ScVbaMenuItems::getCount() throw(css::uno::RuntimeException)
+{
+ // FIXME: should check if it is a popup menu
+ return m_xCommandBarControls->getCount();
+}
+
+// ScVbaCollectionBaseImpl
+uno::Any SAL_CALL
+ScVbaMenuItems::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException )
+{
+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW );
+ if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup )
+ return uno::makeAny( uno::Reference< excel::XMenu > ( new ScVbaMenu( this, mxContext, xCommandBarControl ) ) );
+ else if( xCommandBarControl->getType() == office::MsoControlType::msoControlButton )
+ return uno::makeAny( uno::Reference< excel::XMenuItem > ( new ScVbaMenuItem( this, mxContext, xCommandBarControl ) ) );
+ throw uno::RuntimeException();
+}
+
+uno::Reference< excel::XMenuItem > SAL_CALL ScVbaMenuItems::Add( const rtl::OUString& Caption, const css::uno::Any& OnAction, const css::uno::Any& /*ShortcutKey*/, const css::uno::Any& Before, const css::uno::Any& Restore, const css::uno::Any& /*StatusBar*/, const css::uno::Any& /*HelpFile*/, const css::uno::Any& /*HelpContextID*/ ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
+{
+ sal_Int32 nType = office::MsoControlType::msoControlButton;
+ uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add( uno::makeAny( nType ), uno::Any(), uno::Any(), Before, Restore );
+ xCommandBarControl->setCaption( Caption );
+ if( OnAction.hasValue() )
+ {
+ rtl::OUString sAction;
+ OnAction >>= sAction;
+ xCommandBarControl->setOnAction( sAction );
+ }
+ return uno::Reference< excel::XMenuItem >( new ScVbaMenuItem( this, mxContext, xCommandBarControl ) );
+}
+
+// XHelperInterface
+rtl::OUString&
+ScVbaMenuItems::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuItems") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenuItems::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuItems" ) );
+ }
+ return aServiceNames;
+}
diff --git a/sc/source/ui/vba/vbamenuitems.hxx b/sc/source/ui/vba/vbamenuitems.hxx
new file mode 100644
index 000000000000..17eee45a00e2
--- /dev/null
+++ b/sc/source/ui/vba/vbamenuitems.hxx
@@ -0,0 +1,60 @@
+/*
+ * 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@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
+
+#include <ooo/vba/excel/XMenuItems.hpp>
+#include <ooo/vba/excel/XMenuItem.hpp>
+#include <ooo/vba/XCommandBarControls.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <vbahelper/vbacollectionimpl.hxx>
+
+typedef CollTestImplHelper< ov::excel::XMenuItems > MenuItems_BASE;
+
+class ScVbaMenuItems : public MenuItems_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBarControls > m_xCommandBarControls;
+
+public:
+ ScVbaMenuItems( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBarControls >& xCommandBarControls ) throw( css::uno::RuntimeException );
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+
+ // Methods
+ virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::excel::XMenuItem > SAL_CALL Add( const rtl::OUString& Caption, const css::uno::Any& OnAction, const css::uno::Any& ShortcutKey, const css::uno::Any& Before, const css::uno::Any& Restore, const css::uno::Any& StatusBar, const css::uno::Any& HelpFile, const css::uno::Any& HelpContextID ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif//SC_VBA_MENUITEMS_HXX
diff --git a/sc/source/ui/vba/vbamenus.cxx b/sc/source/ui/vba/vbamenus.cxx
new file mode 100644
index 000000000000..057f8229dbbb
--- /dev/null
+++ b/sc/source/ui/vba/vbamenus.cxx
@@ -0,0 +1,136 @@
+/*
+ * 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@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>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuEnumeration_BASE;
+
+class MenuEnumeration : public MenuEnumeration_BASE
+{
+ uno::Reference< XHelperInterface > m_xParent;
+ uno::Reference< uno::XComponentContext > m_xContext;
+ uno::Reference< container::XEnumeration > m_xEnumeration;
+public:
+ MenuEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration )
+ {
+ }
+ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
+ {
+ return m_xEnumeration->hasMoreElements();
+ }
+ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
+ {
+ // FIXME: should be add menu
+ if( hasMoreElements() )
+ {
+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
+ if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup )
+ {
+ uno::Reference< excel::XMenu > xMenu( new ScVbaMenu( m_xParent, m_xContext, xCommandBarControl ) );
+ return uno::makeAny( xMenu );
+ }
+ nextElement();
+ }
+ else
+ throw container::NoSuchElementException();
+ return uno::Any();
+ }
+};
+
+ScVbaMenus::ScVbaMenus( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBarControls >& xCommandBarControls ) throw ( uno::RuntimeException ) : Menus_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBarControls( xCommandBarControls )
+{
+}
+
+// XEnumerationAccess
+uno::Type SAL_CALL
+ScVbaMenus::getElementType() throw ( uno::RuntimeException )
+{
+ return excel::XMenu::static_type( 0 );
+}
+
+uno::Reference< container::XEnumeration >
+ScVbaMenus::createEnumeration() throw ( uno::RuntimeException )
+{
+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBarControls, uno::UNO_QUERY_THROW );
+ return uno::Reference< container::XEnumeration >( new MenuEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) );
+}
+
+uno::Any
+ScVbaMenus::createCollectionObject( const uno::Any& aSource )
+{
+ // make no sense
+ return aSource;
+}
+
+sal_Int32 SAL_CALL
+ScVbaMenus::getCount() throw(css::uno::RuntimeException)
+{
+ // FIXME: should check if it is a popup menu
+ return m_xCommandBarControls->getCount();
+}
+
+// ScVbaCollectionBaseImpl
+uno::Any SAL_CALL
+ScVbaMenus::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException )
+{
+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW );
+ if( xCommandBarControl->getType() != office::MsoControlType::msoControlPopup )
+ throw uno::RuntimeException();
+ return uno::makeAny( uno::Reference< excel::XMenu > ( new ScVbaMenu( this, mxContext, xCommandBarControl ) ) );
+}
+
+uno::Reference< excel::XMenu > SAL_CALL ScVbaMenus::Add( const rtl::OUString& Caption, const css::uno::Any& Before, const css::uno::Any& Restore ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
+{
+ sal_Int32 nType = office::MsoControlType::msoControlPopup;
+ uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add( uno::makeAny( nType ), uno::Any(), uno::Any(), Before, Restore );
+ xCommandBarControl->setCaption( Caption );
+ return uno::Reference< excel::XMenu >( new ScVbaMenu( this, mxContext, xCommandBarControl ) );
+}
+
+// XHelperInterface
+rtl::OUString&
+ScVbaMenus::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenus") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenus::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Menus" ) );
+ }
+ return aServiceNames;
+}
diff --git a/sc/source/ui/vba/vbamenus.hxx b/sc/source/ui/vba/vbamenus.hxx
new file mode 100644
index 000000000000..4203cb19feac
--- /dev/null
+++ b/sc/source/ui/vba/vbamenus.hxx
@@ -0,0 +1,60 @@
+/*
+ * 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@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
+
+#include <ooo/vba/excel/XMenus.hpp>
+#include <ooo/vba/excel/XMenu.hpp>
+#include <ooo/vba/XCommandBarControls.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <vbahelper/vbacollectionimpl.hxx>
+
+typedef CollTestImplHelper< ov::excel::XMenus > Menus_BASE;
+
+class ScVbaMenus : public Menus_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBarControls > m_xCommandBarControls;
+
+public:
+ ScVbaMenus( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBarControls >& xCommandBarControls ) throw( css::uno::RuntimeException );
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+
+ // Methods
+ virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::excel::XMenu > SAL_CALL Add( const rtl::OUString& Caption, const css::uno::Any& Before, const css::uno::Any& Restore ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif//SC_VBA_MENUS_HXX
diff --git a/sc/source/ui/vba/vbaname.cxx b/sc/source/ui/vba/vbaname.cxx
index 464b167df250..71d42038f89b 100644
--- a/sc/source/ui/vba/vbaname.cxx
+++ b/sc/source/ui/vba/vbaname.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,8 +70,8 @@ ScVbaName::getWorkSheet() throw (css::uno::RuntimeException)
ScVbaName::getName() throw (css::uno::RuntimeException)
{
String sName;
- sName += UniString( getWorkSheet()->getName());
- sName += String::CreateFromAscii("!");
+ //sName += UniString( getWorkSheet()->getName()); //liuchen 2009-9-9 resolve the defect that the name get by macro code are not the same with that in UI (for example, if a name of "AA" is found in the UI "Define Names" dialog box, the result of get that name through macro code will be "Sheet1!AA")
+ //sName += String::CreateFromAscii("!");
sName += UniString ( mxNamedRange->getName() );
return ::rtl::OUString( sName );
}
@@ -107,78 +108,41 @@ ScVbaName::setVisible( sal_Bool /*bVisible*/ ) throw (css::uno::RuntimeException
::rtl::OUString
ScVbaName::getValue() throw (css::uno::RuntimeException)
{
- ::rtl::OUString sValue = mxNamedRange->getContent();
- ::rtl::OUString sSheetName = getWorkSheet()->getName();
- ::rtl::OUString sSegmentation = ::rtl::OUString::createFromAscii( ";" );
- ::rtl::OUString sNewSegmentation = ::rtl::OUString::createFromAscii( "," );
- ::rtl::OUString sResult;
- sal_Int32 nFrom = 0;
- sal_Int32 nTo = 0;
- nTo = sValue.indexOf( sSegmentation, nFrom );
- while ( nTo != -1 )
- {
- ::rtl::OUString sTmpValue = sValue.copy( nFrom, nTo - nFrom );
- if ( sTmpValue.toChar() == '$' )
- {
- ::rtl::OUString sTmp = sTmpValue.copy( 1 );
- sTmp = sTmp.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii(".")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("!"));
- sResult += sTmp;
- sResult += sNewSegmentation;
- }
- nFrom = nTo + 1;
- nTo = sValue.indexOf( sSegmentation, nFrom );
- }
- ::rtl::OUString sTmpValue = sValue.copy( nFrom );
- if ( sTmpValue.toChar() == '$' )
+ return getValue( formula::FormulaGrammar::GRAM_NATIVE_XL_A1 );
+}
+
+::rtl::OUString
+ScVbaName::getValue(const formula::FormulaGrammar::Grammar eGrammar) throw (css::uno::RuntimeException)
+{
+ rtl::OUString sValue = mxNamedRange->getContent();
+ ScDocShell* pDocShell = excel::getDocShell( mxModel );
+ ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL;
+ String aContent;
+ excel::CompileODFFormulaToExcel( pDoc, sValue, aContent, eGrammar );
+ if ( aContent.Len() > 0 )
{
- ::rtl::OUString sTmp = sTmpValue.copy(1);
- sTmp = sTmp.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii(".")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("!"));
- sResult += sTmp;
+ sValue = aContent;
}
- if (sResult.indexOf('=') != 0)
+ if ( sValue.indexOf('=') != 0 )
{
- sResult = ::rtl::OUString::createFromAscii("=") + sResult;
+ sValue = rtl::OUString::createFromAscii("=") + sValue;
}
- return sResult;
+ return sValue;
}
void
ScVbaName::setValue( const ::rtl::OUString & rValue ) throw (css::uno::RuntimeException)
{
- ::rtl::OUString sSheetName = getWorkSheet()->getName();
::rtl::OUString sValue = rValue;
- ::rtl::OUString sSegmentation = ::rtl::OUString::createFromAscii( "," );
- ::rtl::OUString sNewSegmentation = ::rtl::OUString::createFromAscii( ";" );
- ::rtl::OUString sResult;
- sal_Int32 nFrom = 0;
- sal_Int32 nTo = 0;
- if (sValue.indexOf('=') == 0)
+ ScDocShell* pDocShell = excel::getDocShell( mxModel );
+ ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL;
+ String aContent;
+ excel::CompileExcelFormulaToODF( pDoc, sValue, aContent );
+ if ( aContent.Len() > 0 )
{
- ::rtl::OUString sTmp = sValue.copy(1);
- sValue = sTmp;
+ sValue = aContent;
}
- nTo = sValue.indexOf( sSegmentation, nFrom );
- while ( nTo != -1 )
- {
- ::rtl::OUString sTmpValue = sValue.copy( nFrom, nTo - nFrom );
- sTmpValue = sTmpValue.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii("!")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("."));
- if (sTmpValue.copy(0, sSheetName.getLength()).equals(sSheetName))
- {
- sTmpValue = ::rtl::OUString::createFromAscii("$") + sTmpValue;
- }
- sTmpValue += sNewSegmentation;
- sResult += sTmpValue;
- nFrom = nTo + 1;
- nTo = sValue.indexOf( sSegmentation, nFrom );
- }
- ::rtl::OUString sTmpValue = sValue.copy( nFrom );
- sTmpValue = sTmpValue.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii("!")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("."));
- if (sTmpValue.copy(0, sSheetName.getLength()).equals(sSheetName))
- {
- sTmpValue = ::rtl::OUString::createFromAscii("$") + sTmpValue;
- }
- sResult += sTmpValue;
- mxNamedRange->setContent(sResult);
+ mxNamedRange->setContent( sValue );
}
::rtl::OUString
@@ -208,7 +172,7 @@ ScVbaName::setRefersToLocal( const ::rtl::OUString & rRefersTo ) throw (css::uno
::rtl::OUString
ScVbaName::getRefersToR1C1() throw (css::uno::RuntimeException)
{
- return getRefersTo();
+ return getValue( formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 );
}
void
@@ -220,7 +184,7 @@ ScVbaName::setRefersToR1C1( const ::rtl::OUString & rRefersTo ) throw (css::uno:
::rtl::OUString
ScVbaName::getRefersToR1C1Local() throw (css::uno::RuntimeException)
{
- return getRefersTo();
+ return getValue( formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 );
}
void
@@ -267,3 +231,4 @@ ScVbaName::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaname.hxx b/sc/source/ui/vba/vbaname.hxx
index 81b2555a4ce1..8e0aa3973aae 100644
--- a/sc/source/ui/vba/vbaname.hxx
+++ b/sc/source/ui/vba/vbaname.hxx
@@ -33,6 +33,8 @@
#include <vbahelper/vbahelperinterface.hxx>
+#include <formula/grammar.hxx>
+
class ScDocument;
typedef InheritedHelperInterfaceImpl1< ov::excel::XName > NameImpl_BASE;
@@ -48,6 +50,8 @@ class ScVbaName : public NameImpl_BASE
protected:
virtual css::uno::Reference< css::frame::XModel > getModel() { return mxModel; }
virtual css::uno::Reference< ov::excel::XWorksheet > getWorkSheet() throw (css::uno::RuntimeException);
+ // Get value by FormulaGrammar, such as FormulaGrammar::GRAM_NATIVE_XL_R1C1
+ virtual ::rtl::OUString SAL_CALL getValue(const formula::FormulaGrammar::Grammar eGrammar) throw (css::uno::RuntimeException);
public:
ScVbaName( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XNamedRange >& xName , const css::uno::Reference< css::sheet::XNamedRanges >& xNames , const css::uno::Reference< css::frame::XModel >& xModel );
diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx
index 9fd22bf89f7a..bee4fbb58856 100644
--- a/sc/source/ui/vba/vbanames.cxx
+++ b/sc/source/ui/vba/vbanames.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,6 +88,33 @@ ScVbaNames::getScDocument()
return pViewData->GetDocument();
}
+void GetRangeOrRefersTo( const css::uno::Any& RefersTo, const uno::Reference< uno::XComponentContext >& xContext, css::uno::Reference< excel::XRange >& xRange, rtl::OUString& sRefersTo )
+{
+ if ( RefersTo.getValueTypeClass() == uno::TypeClass_STRING )
+ {
+ RefersTo >>= sRefersTo;
+ }
+ else if ( RefersTo.getValueTypeClass() == uno::TypeClass_INTERFACE )
+ {
+ RefersTo >>= xRange;
+ }
+ else if ( RefersTo.hasValue() )
+ {
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( xContext );
+ try
+ {
+ if ( xConverter.is() )
+ {
+ uno::Any aConverted = xConverter->convertTo( RefersTo, getCppuType((rtl::OUString*)0) );
+ aConverted >>= sRefersTo;
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+}
+
css::uno::Any
ScVbaNames::Add( const css::uno::Any& Name ,
const css::uno::Any& RefersTo,
@@ -100,8 +128,9 @@ ScVbaNames::Add( const css::uno::Any& Name ,
const css::uno::Any& RefersToR1C1,
const css::uno::Any& RefersToR1C1Local ) throw (css::uno::RuntimeException)
{
-
+ rtl::OUString sSheetName;
rtl::OUString sName;
+ rtl::OUString sRefersTo;
uno::Reference< excel::XRange > xRange;
if ( Name.hasValue() )
Name >>= sName;
@@ -109,6 +138,12 @@ ScVbaNames::Add( const css::uno::Any& Name ,
NameLocal >>= sName;
if ( sName.getLength() != 0 )
{
+ sal_Int32 nTokenIndex = sName.indexOf('!');
+ if ( nTokenIndex >= 0 )
+ {
+ sSheetName = sName.copy( 0, nTokenIndex );
+ sName = sName.copy( nTokenIndex + 1 );
+ }
if ( !ScRangeData::IsNameValid( sName , getScDocument() ) )
{
::rtl::OUString sResult ;
@@ -121,19 +156,22 @@ ScVbaNames::Add( const css::uno::Any& Name ,
sResult = sName.copy( nIndex );
sName = sResult ;
if ( !ScRangeData::IsNameValid( sName , getScDocument() ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("This Name is a valid ."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("This Name is a invalid ."), uno::Reference< uno::XInterface >() );
}
}
if ( RefersTo.hasValue() || RefersToR1C1.hasValue() || RefersToR1C1Local.hasValue() )
{
if ( RefersTo.hasValue() )
- RefersTo >>= xRange;
+ GetRangeOrRefersTo( RefersTo, mxContext, xRange, sRefersTo );
if ( RefersToR1C1.hasValue() )
- RefersToR1C1 >>= xRange;
+ GetRangeOrRefersTo( RefersToR1C1, mxContext, xRange, sRefersTo );
if ( RefersToR1C1Local.hasValue() )
- RefersToR1C1Local >>= xRange;
+ GetRangeOrRefersTo( RefersToR1C1Local, mxContext, xRange, sRefersTo );
}
+ String aContent;
+ table::CellAddress aPosition;
+ RangeType nType = RT_NAME;
if ( xRange.is() )
{
ScVbaRange* pRange = dynamic_cast< ScVbaRange* >( xRange.get() );
@@ -146,19 +184,36 @@ ScVbaNames::Add( const css::uno::Any& Name ,
ScAddress aPos( static_cast< SCCOL >( aAddr.StartColumn ) , static_cast< SCROW >( aAddr.StartRow ) , static_cast< SCTAB >(aAddr.Sheet ) );
uno::Any xAny2 ;
String sRangeAdd = xRange->Address( xAny2, xAny2 , xAny2 , xAny2, xAny2 );
- String sTmp;
- sTmp += String::CreateFromAscii("$");
- sTmp += UniString(xRange->getWorksheet()->getName());
- sTmp += String::CreateFromAscii(".");
- sTmp += sRangeAdd;
- if ( mxNames.is() )
+ aContent += String::CreateFromAscii("$");
+ aContent += UniString(xRange->getWorksheet()->getName());
+ aContent += String::CreateFromAscii(".");
+ aContent += sRangeAdd;
+ aPosition = table::CellAddress( aAddr.Sheet , aAddr.StartColumn , aAddr.StartRow );
+ }
+ else
+ {
+ ScDocShell* pDocShell = excel::getDocShell( mxModel );
+ ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL;
+ excel::CompileExcelFormulaToODF( pDoc, sRefersTo, aContent );
+ if ( aContent.Len() == 0 )
+ {
+ aContent = sRefersTo;
+ }
+ }
+
+ uno::Reference< sheet::XNamedRange > xNewNamedRange;
+ if ( mxNames.is() )
+ {
+ if ( mxNames->hasByName( sName ) )
{
- RangeType nType = RT_NAME;
- table::CellAddress aCellAddr( aAddr.Sheet , aAddr.StartColumn , aAddr.StartRow );
- if ( mxNames->hasByName( sName ) )
- mxNames->removeByName(sName);
- mxNames->addNewByName( sName , rtl::OUString(sTmp) , aCellAddr , (sal_Int32)nType);
+ mxNames->removeByName( sName );
}
+ mxNames->addNewByName( sName, rtl::OUString( aContent ), aPosition, (sal_Int32) nType );
+ xNewNamedRange = uno::Reference< sheet::XNamedRange >( mxNames->getByName( sName ), uno::UNO_QUERY );
+ }
+ if ( xNewNamedRange.is() )
+ {
+ return uno::makeAny( uno::Reference< excel::XName >( new ScVbaName( mxParent, mxContext, xNewNamedRange ,mxNames , mxModel ) ) );
}
return css::uno::Any();
}
@@ -204,3 +259,4 @@ ScVbaNames::getServiceNames()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaoleobject.cxx b/sc/source/ui/vba/vbaoleobject.cxx
index a35ce4b3120f..ebf87bf5275d 100644
--- a/sc/source/ui/vba/vbaoleobject.cxx
+++ b/sc/source/ui/vba/vbaoleobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,7 +68,7 @@ ScVbaOLEObject::ScVbaOLEObject( const uno::Reference< XHelperInterface >& xParen
uno::Reference< uno::XInterface > SAL_CALL
ScVbaOLEObject::getObject() throw (uno::RuntimeException)
{
- return uno::Reference< uno::XInterface >( m_xControlShape, uno::UNO_QUERY_THROW );
+ return uno::Reference< uno::XInterface >( m_xControl, uno::UNO_QUERY_THROW );
}
sal_Bool SAL_CALL
@@ -162,3 +163,5 @@ ScVbaOLEObject::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaoleobjects.cxx b/sc/source/ui/vba/vbaoleobjects.cxx
index 69ba36cf8279..84cba7b96e92 100644
--- a/sc/source/ui/vba/vbaoleobjects.cxx
+++ b/sc/source/ui/vba/vbaoleobjects.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -183,3 +184,5 @@ ScVbaOLEObjects::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaoutline.cxx b/sc/source/ui/vba/vbaoutline.cxx
index ee4c78c73151..b42d81052d15 100644
--- a/sc/source/ui/vba/vbaoutline.cxx
+++ b/sc/source/ui/vba/vbaoutline.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,3 +64,5 @@ ScVbaOutline::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapagebreak.cxx b/sc/source/ui/vba/vbapagebreak.cxx
index 1103c10f54c8..8c28aada76f4 100644
--- a/sc/source/ui/vba/vbapagebreak.cxx
+++ b/sc/source/ui/vba/vbapagebreak.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -170,3 +171,4 @@ ScVbaVPageBreak::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapagebreaks.cxx b/sc/source/ui/vba/vbapagebreaks.cxx
index 25ccbb0f4cdc..e6c83ed618c7 100644
--- a/sc/source/ui/vba/vbapagebreaks.cxx
+++ b/sc/source/ui/vba/vbapagebreaks.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -115,10 +116,13 @@ sal_Int32 SAL_CALL RangePageBreaks::getCount( ) throw (uno::RuntimeException)
for( sal_Int32 i=0; i<nLength; i++ )
{
sal_Int32 nPos = aTablePageBreakData[i].Position;
- if( nPos > nUsedEnd )
- return nCount;
- if( nPos >= nUsedStart )
+
+ // VBA. minz@cn.ibm.com. All page breaks before the used range should be counted.
+ // And the page break at the end of the used range also should be counted.
+ if( nPos <= nUsedEnd + 1 )
nCount++;
+ else
+ return nCount;
}
return nCount;
@@ -144,26 +148,15 @@ uno::Any SAL_CALL RangePageBreaks::getByIndex( sal_Int32 Index ) throw (lang::In
sheet::TablePageBreakData RangePageBreaks::getTablePageBreakData( sal_Int32 nAPIItemIndex ) throw ( script::BasicErrorException, uno::RuntimeException)
{
- sal_Int32 index = -1;
sheet::TablePageBreakData aTablePageBreakData;
uno::Reference< excel::XWorksheet > xWorksheet( mxParent, uno::UNO_QUERY_THROW );
uno::Reference< excel::XRange > xRange = xWorksheet->getUsedRange();
- sal_Int32 nUsedStart = getAPIStartofRange( xRange );
- sal_Int32 nUsedEnd = getAPIEndIndexofRange( xRange, nUsedStart );
uno::Sequence<sheet::TablePageBreakData> aTablePageBreakDataList = getAllPageBreaks();
sal_Int32 nLength = aTablePageBreakDataList.getLength();
- for( sal_Int32 i=0; i<nLength; i++ )
- {
- aTablePageBreakData = aTablePageBreakDataList[i];
- sal_Int32 nPos = aTablePageBreakData.Position;
- if( nPos >= nUsedStart )
- index++;
- if( nPos > nUsedEnd )
- DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
- if( index == nAPIItemIndex )
- return aTablePageBreakData;
- }
+ //VBA. minz@cn.ibm.com. No need to filter the page break. All page breaks before the used range are counted.
+ if ( nAPIItemIndex < nLength && nAPIItemIndex>=0 )
+ aTablePageBreakData = aTablePageBreakDataList[nAPIItemIndex];
return aTablePageBreakData;
}
@@ -325,3 +318,4 @@ ScVbaVPageBreaks::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx
index d660ddbbfd77..3b1a8ae9a3cd 100644
--- a/sc/source/ui/vba/vbapagesetup.cxx
+++ b/sc/source/ui/vba/vbapagesetup.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,6 +38,9 @@
#include <ooo/vba/excel/XlPageOrientation.hpp>
#include <ooo/vba/excel/XlOrder.hpp>
#include <ooo/vba/excel/Constants.hpp>
+#include <i18npool/paper.hxx>
+#include <editeng/paperinf.hxx>
+#include <ooo/vba/excel/XlPaperSize.hpp>
using namespace ::com::sun::star;
using namespace ::ooo::vba;
@@ -624,3 +628,106 @@ 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 --git a/sc/source/ui/vba/vbapagesetup.hxx b/sc/source/ui/vba/vbapagesetup.hxx
index d2c001b225cf..f81ad5a7a29a 100644
--- a/sc/source/ui/vba/vbapagesetup.hxx
+++ b/sc/source/ui/vba/vbapagesetup.hxx
@@ -82,6 +82,8 @@ public:
virtual void SAL_CALL setCenterHorizontally( sal_Bool centerHorizontally ) throw (css::uno::RuntimeException);
virtual sal_Bool SAL_CALL getPrintHeadings() throw (css::uno::RuntimeException);
virtual void SAL_CALL setPrintHeadings( sal_Bool printHeadings ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getPaperSize() throw (css::uno::RuntimeException); //liuchen 2009-12-11
+ virtual void SAL_CALL setPaperSize( sal_Int32 paperSize ) throw (css::uno::RuntimeException); //liuchen 2009-12-11
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
diff --git a/sc/source/ui/vba/vbapalette.cxx b/sc/source/ui/vba/vbapalette.cxx
index d49ea47b5e4f..209dd2d8e564 100644
--- a/sc/source/ui/vba/vbapalette.cxx
+++ b/sc/source/ui/vba/vbapalette.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111,3 +112,5 @@ ScVbaPalette::getPalette() const
return new DefaultPalette();
return xIndex;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapane.cxx b/sc/source/ui/vba/vbapane.cxx
index 29d7a286b402..e034ffeead41 100644
--- a/sc/source/ui/vba/vbapane.cxx
+++ b/sc/source/ui/vba/vbapane.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -204,3 +205,5 @@ ScVbaPane::LargeScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any
// XHelperInterface
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaPane, "ooo.vba.excel.Pane" )
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapivotcache.cxx b/sc/source/ui/vba/vbapivotcache.cxx
index 322b42368b48..7b2b4c6ddf61 100644
--- a/sc/source/ui/vba/vbapivotcache.cxx
+++ b/sc/source/ui/vba/vbapivotcache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,17 @@ ScVbaPivotCache::ScVbaPivotCache( const uno::Reference< XHelperInterface >& xPar
{
}
+sal_Int32
+ScVbaPivotCache::getMissingItemsLimit() throw (css::uno::RuntimeException)
+{
+ return -1;
+}
+
+void
+ScVbaPivotCache::setMissingItemsLimit( sal_Int32 /*aValue*/ ) throw ( css::uno::RuntimeException)
+{
+}
+
void SAL_CALL
ScVbaPivotCache::Refresh() throw (css::uno::RuntimeException)
{
@@ -58,3 +70,4 @@ ScVbaPivotCache::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapivotcache.hxx b/sc/source/ui/vba/vbapivotcache.hxx
index dea3e35d18bd..3b88fe311f33 100644
--- a/sc/source/ui/vba/vbapivotcache.hxx
+++ b/sc/source/ui/vba/vbapivotcache.hxx
@@ -40,6 +40,10 @@ class ScVbaPivotCache : public PivotCacheImpl_BASE
css::uno::Reference< css::sheet::XDataPilotTable > m_xTable;
public:
ScVbaPivotCache( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XDataPilotTable >& xTable );
+
+ virtual ::sal_Int32 SAL_CALL getMissingItemsLimit() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMissingItemsLimit( ::sal_Int32 aValue ) throw ( css::uno::RuntimeException);
+
virtual void SAL_CALL Refresh() throw (css::uno::RuntimeException);
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
diff --git a/sc/source/ui/vba/vbapivottable.cxx b/sc/source/ui/vba/vbapivottable.cxx
index e5d78602dcdd..cffd07eeb5e1 100644
--- a/sc/source/ui/vba/vbapivottable.cxx
+++ b/sc/source/ui/vba/vbapivottable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,3 +62,5 @@ ScVbaPivotTable::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapivottables.cxx b/sc/source/ui/vba/vbapivottables.cxx
index fcbf347a3cd4..b7e090d1a841 100644
--- a/sc/source/ui/vba/vbapivottables.cxx
+++ b/sc/source/ui/vba/vbapivottables.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -92,3 +93,5 @@ ScVbaPivotTables::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapropvalue.cxx b/sc/source/ui/vba/vbapropvalue.cxx
index ff821d17f479..2fdbd16195fe 100644
--- a/sc/source/ui/vba/vbapropvalue.cxx
+++ b/sc/source/ui/vba/vbapropvalue.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,5 @@ ScVbaPropValue::setValue( const css::uno::Any& _value ) throw (css::uno::Runtime
{
m_pListener->setValueEvent( _value );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaquerytable.cxx b/sc/source/ui/vba/vbaquerytable.cxx
new file mode 100644
index 000000000000..d08fd302b2a8
--- /dev/null
+++ b/sc/source/ui/vba/vbaquerytable.cxx
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbaquerytable.hxx"
+#include "document.hxx"
+#include "docsh.hxx"
+#include "sfx2/lnkbase.hxx"
+#include "sfx2/linkmgr.hxx"
+#include "arealink.hxx"
+#include "vbarange.hxx"
+
+using namespace com::sun::star;
+
+
+ScVbaQueryTable::ScVbaQueryTable(const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext > & xContext,
+ ScDocument *pDocument ,
+ ScVbaRange *pParent
+ )
+//:QueryTable_Base(xParent, xContext)
+{
+ m_pDocument = pDocument;
+ m_pParent = pParent;
+}
+
+ScVbaQueryTable::~ScVbaQueryTable()
+{
+
+}
+
+::sal_Bool SAL_CALL
+ScVbaQueryTable::Refresh( const ::com::sun::star::uno::Any& aBackgroundQuery ) throw (::com::sun::star::uno::RuntimeException)
+{
+
+ //Get parent Info
+ sal_Int32 nRow = m_pParent->getRow();
+ sal_Int32 nClm = m_pParent->getColumn();
+ sal_Int16 nTab = m_pParent->getWorksheet()->getIndex() - 1; //The vba index begin from 1.
+ ScAddress crrRngAddr(nClm, nRow, nTab);
+
+ //Get link info
+ sfx2::LinkManager *pLinkMng = m_pDocument->GetLinkManager();
+ const ::sfx2::SvBaseLinks &rLinks = pLinkMng->GetLinks();
+ USHORT nCount = rLinks.Count();
+
+ for (USHORT i=0; i<nCount; i++)
+ {
+ ::sfx2::SvBaseLink* pBase = *rLinks[i];
+ if (pBase->ISA(ScAreaLink))
+ {
+
+ ScAreaLink *pAreaLink = (ScAreaLink *)pBase;
+ const ScRange &destRange = pAreaLink->GetDestArea();
+ if (destRange.In(crrRngAddr))
+ {
+ pBase->Update();
+ }
+ }
+ }
+
+ return sal_True;
+}
diff --git a/sc/source/ui/vba/vbaquerytable.hxx b/sc/source/ui/vba/vbaquerytable.hxx
new file mode 100644
index 000000000000..bf3ef4da4aa7
--- /dev/null
+++ b/sc/source/ui/vba/vbaquerytable.hxx
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef SC_VBA_QUERYTABLE_HXX
+#define SC_VBA_QUERYTABLE_HXX
+
+
+#include <ooo/vba/excel/XQueryTable.hpp>
+#include "vbahelper/vbahelperinterface.hxx"
+
+using namespace ::ooo::vba;
+typedef ::cppu::WeakImplHelper1<excel::XQueryTable> QueryTable_Base;
+
+class ScDocument;
+class ScVbaRange;
+
+class ScVbaQueryTable : public QueryTable_Base
+{
+private:
+ ScDocument *m_pDocument;
+ ScVbaRange *m_pParent;
+public:
+ ScVbaQueryTable(const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext > & xContext,
+ ScDocument *pDocument = NULL,
+ ScVbaRange *pParent = NULL
+ );
+ ~ScVbaQueryTable();
+ virtual ::sal_Bool SAL_CALL Refresh( const ::com::sun::star::uno::Any& aBackgroundQuery )
+ throw (::com::sun::star::uno::RuntimeException);
+
+};
+
+#endif
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 0724541278fa..c9dce622bf36 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,7 +44,6 @@
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/sheet/XSpreadsheetView.hpp>
#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
#include <com/sun/star/sheet/XSheetCellRange.hpp>
@@ -51,6 +51,7 @@
#include <com/sun/star/sheet/XSheetCellCursor.hpp>
#include <com/sun/star/sheet/XArrayFormulaRange.hpp>
#include <com/sun/star/sheet/XNamedRange.hpp>
+#include <com/sun/star/sheet/XNamedRanges.hpp>
#include <com/sun/star/sheet/XPrintAreas.hpp>
#include <com/sun/star/sheet/XCellRangesQuery.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -91,6 +92,15 @@
#include <com/sun/star/sheet/XSubTotalDescriptor.hpp>
#include <com/sun/star/sheet/GeneralFunction.hdl>
+#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
+#include <com/sun/star/sheet/XSheetAnnotations.hpp>
+
+#include <com/sun/star/sheet/XDataPilotTable.hpp>
+#include <com/sun/star/sheet/XDataPilotTable2.hpp>
+#include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
+#include <com/sun/star/sheet/DataPilotTablePositionData.hpp>
+#include <com/sun/star/sheet/DataPilotTablePositionType.hpp>
+
#include <ooo/vba/excel/XlPasteSpecialOperation.hpp>
#include <ooo/vba/excel/XlPasteType.hpp>
#include <ooo/vba/excel/Constants.hpp>
@@ -116,12 +126,15 @@
#include <ooo/vba/excel/XlSpecialCellsValue.hpp>
#include <ooo/vba/excel/XlConsolidationFunction.hpp>
#include <ooo/vba/excel/XlSearchDirection.hpp>
+#include <ooo/vba/excel/XlColumnDataType.hpp>
+#include <ooo/vba/excel/XlFilterAction.hpp>
#include <scitems.hxx>
#include <svl/srchitem.hxx>
#include <cellsuno.hxx>
#include <dbcolect.hxx>
#include "docfunc.hxx"
+#include <docuno.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/app.hxx>
@@ -132,6 +145,7 @@
#include <sc.hrc>
#include <globstr.hrc>
#include <unonames.hxx>
+#include <tools/stream.hxx>
#include "vbarange.hxx"
#include "vbafont.hxx"
@@ -143,8 +157,13 @@
#include "vbavalidation.hxx"
#include "vbahyperlinks.hxx"
+#include "vbapivottable.hxx"
+
+#include "asciiopt.hxx"
+#include "impex.hxx"
#include "tabvwsh.hxx"
#include "rangelst.hxx"
+#include "rangenam.hxx"
#include "convuno.hxx"
#include "compiler.hxx"
#include "attrib.hxx"
@@ -158,6 +177,8 @@
#include "vbaglobals.hxx"
#include "vbastyle.hxx"
+#include "vbaname.hxx"
+#include "vbanames.hxx"
#include <vector>
#include <vbahelper/vbacollectionimpl.hxx>
// begin test includes
@@ -362,55 +383,6 @@ ScVbaRangeAreas::createCollectionObject( const uno::Any& aSource )
return lcl_makeRange( mxParent, mxContext, aSource, mbIsRows, mbIsColumns );
}
-// assume that xIf is infact a ScCellRangesBase
-ScDocShell*
-getDocShellFromIf( const uno::Reference< uno::XInterface >& xIf ) throw ( uno::RuntimeException )
-{
- ScCellRangesBase* pUno = ScCellRangesBase::getImplementation( xIf );
- if ( !pUno )
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access underlying uno range object" ) ), uno::Reference< uno::XInterface >() );
- return pUno->GetDocShell();
-}
-
-ScDocShell*
-getDocShellFromRange( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException )
-{
- // need the ScCellRangesBase to get docshell
- uno::Reference< uno::XInterface > xIf( xRange, uno::UNO_QUERY_THROW );
- return getDocShellFromIf(xIf );
-}
-
-ScDocShell*
-getDocShellFromRanges( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) throw ( uno::RuntimeException )
-{
- // need the ScCellRangesBase to get docshell
- uno::Reference< uno::XInterface > xIf( xRanges, uno::UNO_QUERY_THROW );
- return getDocShellFromIf(xIf );
-}
-
-uno::Reference< frame::XModel > getModelFromXIf( const uno::Reference< uno::XInterface >& xIf ) throw ( uno::RuntimeException )
-{
- ScDocShell* pDocShell = getDocShellFromIf(xIf );
- return pDocShell->GetModel();
-}
-
-uno::Reference< frame::XModel > getModelFromRange( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException )
-{
- uno::Reference< uno::XInterface > xIf( xRange, uno::UNO_QUERY_THROW );
- return getModelFromXIf( xIf );
-}
-
-ScDocument*
-getDocumentFromRange( const uno::Reference< table::XCellRange >& xRange )
-{
- ScDocShell* pDocShell = getDocShellFromRange( xRange );
- if ( !pDocShell )
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access underlying docshell from uno range object" ) ), uno::Reference< uno::XInterface >() );
- ScDocument* pDoc = pDocShell->GetDocument();
- return pDoc;
-}
-
-
ScDocument*
ScVbaRange::getScDocument() throw (uno::RuntimeException)
{
@@ -418,9 +390,9 @@ ScVbaRange::getScDocument() throw (uno::RuntimeException)
{
uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW );
uno::Reference< table::XCellRange > xRange( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW );
- return getDocumentFromRange( xRange );
+ return excel::GetDocumentFromRange( xRange );
}
- return getDocumentFromRange( mxRange );
+ return excel::GetDocumentFromRange( mxRange );
}
ScDocShell*
@@ -430,9 +402,9 @@ ScVbaRange::getScDocShell() throw (uno::RuntimeException)
{
uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW );
uno::Reference< table::XCellRange > xRange( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW );
- return getDocShellFromRange( xRange );
+ return excel::GetDocShellFromRange( xRange );
}
- return getDocShellFromRange( mxRange );
+ return excel::GetDocShellFromRange( mxRange );
}
/*static*/ ScVbaRange* ScVbaRange::getImplementation( const uno::Reference< excel::XRange >& rxRange )
@@ -478,7 +450,7 @@ class NumFormatHelper
public:
NumFormatHelper( const uno::Reference< table::XCellRange >& xRange )
{
- mxSupplier.set( getModelFromRange( xRange ), uno::UNO_QUERY_THROW );
+ mxSupplier.set( excel::GetModelFromRange( xRange ), uno::UNO_QUERY_THROW );
mxRangeProps.set( xRange, uno::UNO_QUERY_THROW);
mxFormats = mxSupplier->getNumberFormats();
}
@@ -743,7 +715,15 @@ CellValueSetter::processValue( const uno::Any& aValue, const uno::Reference< tab
{
double nDouble = 0.0;
if ( aValue >>= nDouble )
+ {
xCell->setValue( nDouble );
+ uno::Reference< table::XCellRange > xRange( xCell, uno::UNO_QUERY_THROW );
+ NumFormatHelper cellNumFormat( xRange );
+ if ( cellNumFormat.isBooleanType() )
+ {
+ cellNumFormat.setNumberFormat( util::NumberFormat::NUMBER );
+ }
+ }
else
isExtracted = false;
break;
@@ -837,9 +817,10 @@ protected:
double aDblValue = 0.0;
if ( aValue >>= sFormula )
{
- // convert to CONV_OOO style formula string because XCell::setFormula
- // always compile it in CONV_OOO style. Perhaps css.sheet.FormulaParser
- // should be used in future to directly pass formula tokens.
+ // convert to GRAM_PODF_A1 style grammar because XCell::setFormula
+ // always compile it in that grammar. Perhaps
+ // css.sheet.FormulaParser should be used in future to directly
+ // pass formula tokens when that API stabilizes.
if ( m_eGrammar != formula::FormulaGrammar::GRAM_PODF_A1 && ( sFormula.trim().indexOf('=') == 0 ) )
{
uno::Reference< uno::XInterface > xIf( xCell, uno::UNO_QUERY_THROW );
@@ -1100,7 +1081,7 @@ public:
};
bool
-getCellRangesForAddress( USHORT& rResFlags, const rtl::OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention& eConv )
+getCellRangesForAddress( USHORT& rResFlags, const rtl::OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention& eConv, char cDelimiter = 0 )
{
ScDocument* pDoc = NULL;
@@ -1109,7 +1090,7 @@ getCellRangesForAddress( USHORT& rResFlags, const rtl::OUString& sAddress, ScDoc
pDoc = pDocSh->GetDocument();
String aString(sAddress);
USHORT nMask = SCA_VALID;
- rResFlags = rCellRanges.Parse( sAddress, pDoc, nMask, eConv, 0 );
+ rResFlags = rCellRanges.Parse( sAddress, pDoc, nMask, eConv, cDelimiter );
if ( rResFlags & SCA_VALID )
{
return true;
@@ -1144,6 +1125,25 @@ bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, S
formula::FormulaGrammar::AddressConvention eConv = aConv;
// spaces are illegal ( but the user of course can enter them )
rtl::OUString sAddress = (*it).trim();
+ // if a local name ( on the active sheet ) exists this will
+ // take precedence over a global with the same name
+ if ( !xNameAccess->hasByName( sAddress ) && pDocSh )
+ {
+ // try a local name
+ ScDocument* pDoc = pDocSh->GetDocument();
+ SCTAB nCurTab = pDocSh->GetCurTab();
+ if ( pDoc )
+ {
+ NameToNameMap* pMap = pDoc->GetLocalNameMap( nCurTab );
+ if ( pMap )
+ {
+ NameToNameMap::iterator itTmp = pMap->find( sAddress );
+ if ( itTmp != pMap->end() ) // found a mapping
+ sAddress = itTmp->second;
+ }
+ }
+ }
+ char aChar = 0;
if ( xNameAccess->hasByName( sAddress ) )
{
uno::Reference< sheet::XNamedRange > xNamed( xNameAccess->getByName( sAddress ), uno::UNO_QUERY_THROW );
@@ -1151,10 +1151,11 @@ bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, S
// As the address comes from OOO, the addressing
// style is may not be XL_A1
eConv = pDocSh->GetDocument()->GetAddressConvention();
+ aChar = ';';
}
USHORT nFlags = 0;
- if ( !getCellRangesForAddress( nFlags, sAddress, pDocSh, aCellRanges, eConv ) )
+ if ( !getCellRangesForAddress( nFlags, sAddress, pDocSh, aCellRanges, eConv, aChar ) )
return false;
bool bTabFromReferrer = !( nFlags & SCA_TAB_3D );
@@ -1248,7 +1249,7 @@ uno::Reference< sheet::XSheetCellRangeContainer > lclExpandToMerged( const uno::
ScUnoConversion::FillScRange( aScRange, aRangeAddr );
aScRanges.Append( aScRange );
}
- return new ScCellRangesObj( getDocShellFromRanges( rxCellRanges ), aScRanges );
+ return new ScCellRangesObj( excel::GetDocShellFromRanges( rxCellRanges ), aScRanges );
}
void lclExpandAndMerge( const uno::Reference< table::XCellRange >& rxCellRange, bool bMerge ) throw (uno::RuntimeException)
@@ -1294,7 +1295,7 @@ util::TriState lclGetMergedState( const uno::Reference< table::XCellRange >& rxC
of a merged range is part of this range are not covered. */
ScRange aScRange;
ScUnoConversion::FillScRange( aScRange, aRangeAddr );
- bool bHasMerged = getDocumentFromRange( rxCellRange )->HasAttrib( aScRange, HASATTR_MERGED | HASATTR_OVERLAPPED );
+ bool bHasMerged = excel::GetDocumentFromRange( rxCellRange )->HasAttrib( aScRange, HASATTR_MERGED | HASATTR_OVERLAPPED );
return bHasMerged ? util::TriState_INDETERMINATE : util::TriState_NO;
}
@@ -1311,6 +1312,28 @@ ScVbaRange::getRangeObjectForName(
return getRangeForName( xContext, sRangeName, pDocSh, refAddr, eConv );
}
+table::CellAddress ScVbaRange::getLeftUpperCellAddress()
+{
+ table::CellAddress aCellAddress;
+ uno::Reference< table::XCellRange > xCellRange = mxRange;
+ if ( mxRanges.is() && m_Areas.is() && m_Areas->getCount() > 1 )
+ {
+ uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY );
+ if ( xIndex.is() && xIndex->getCount() > 0 )
+ {
+ xCellRange.set( xIndex->getByIndex( 0 ), uno::UNO_QUERY );
+ }
+ }
+ if ( xCellRange.is() )
+ {
+ uno::Reference< sheet::XCellAddressable > xCellAddr( xCellRange->getCellByPosition( 0, 0 ), uno::UNO_QUERY );
+ if ( xCellAddr.is() )
+ {
+ aCellAddress = xCellAddr->getCellAddress();
+ }
+ }
+ return aCellAddress;
+}
table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam, ScDocShell* pDocSh, formula::FormulaGrammar::AddressConvention aConv = formula::FormulaGrammar::CONV_XL_A1) throw ( uno::RuntimeException )
{
@@ -1338,7 +1361,14 @@ table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam,
uno::Reference< excel::XRange > xRange;
aParam >>= xRange;
if ( xRange.is() )
+ {
+ ScVbaRange* pRange = dynamic_cast< ScVbaRange* >( xRange.get() );
+ if ( pRange && pDocSh && pRange->getScDocument() != pDocSh->GetDocument() )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid range" ) ), uno::Reference< uno::XInterface >() );
+ }
xRange->getCellRange() >>= xRangeParam;
+ }
break;
}
default:
@@ -1351,7 +1381,7 @@ uno::Reference< XCollection >
lcl_setupBorders( const uno::Reference< excel::XRange >& xParentRange, const uno::Reference<uno::XComponentContext>& xContext, const uno::Reference< table::XCellRange >& xRange ) throw( uno::RuntimeException )
{
uno::Reference< XHelperInterface > xParent( xParentRange, uno::UNO_QUERY_THROW );
- ScDocument* pDoc = getDocumentFromRange(xRange);
+ ScDocument* pDoc = excel::GetDocumentFromRange(xRange);
if ( !pDoc )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() );
ScVbaPalette aPalette( pDoc->GetDocumentShell() );
@@ -1359,8 +1389,21 @@ lcl_setupBorders( const uno::Reference< excel::XRange >& xParentRange, const uno
return borders;
}
+void lcl_NotifyRangeChanges( const uno::Reference< frame::XModel >& xModel, ScCellRangesBase* pUnoRangesBase )
+{
+ if ( xModel.is() && pUnoRangesBase )
+ {
+ ScModelObj* pModelObj = ScModelObj::getImplementation( xModel );
+ const ScRangeList& aCellRanges = pUnoRangesBase->GetRangeList();
+ if ( pModelObj && pModelObj->HasChangesListeners() )
+ {
+ pModelObj->NotifyChanges( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cell-change" ) ), aCellRanges );
+ }
+ }
+}
+
ScVbaRange::ScVbaRange( uno::Sequence< uno::Any> const & args,
- uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : ScVbaRange_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< beans::XPropertySet >( args, 1, false ), getModelFromXIf( getXSomethingFromArgs< uno::XInterface >( args, 1 ) ), true ), mbIsRows( sal_False ), mbIsColumns( sal_False )
+ uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : ScVbaRange_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< beans::XPropertySet >( args, 1, false ), excel::GetModelFromRange( getXSomethingFromArgs< uno::XInterface >( args, 1 ) ), true ), mbIsRows( sal_False ), mbIsColumns( sal_False )
{
mxRange.set( mxPropertySet, uno::UNO_QUERY );
mxRanges.set( mxPropertySet, uno::UNO_QUERY );
@@ -1377,7 +1420,7 @@ ScVbaRange::ScVbaRange( uno::Sequence< uno::Any> const & args,
}
ScVbaRange::ScVbaRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< table::XCellRange >& xRange, sal_Bool bIsRows, sal_Bool bIsColumns ) throw( lang::IllegalArgumentException )
-: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRange, uno::UNO_QUERY_THROW ), getModelFromRange( xRange), true ), mxRange( xRange ),
+: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRange, uno::UNO_QUERY_THROW ), excel::GetModelFromRange( xRange), true ), mxRange( xRange ),
mbIsRows( bIsRows ),
mbIsColumns( bIsColumns )
{
@@ -1392,7 +1435,7 @@ ScVbaRange::ScVbaRange( const uno::Reference< XHelperInterface >& xParent, const
}
ScVbaRange::ScVbaRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges, sal_Bool bIsRows, sal_Bool bIsColumns ) throw ( lang::IllegalArgumentException )
-: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRanges, uno::UNO_QUERY_THROW ), getModelFromXIf( uno::Reference< uno::XInterface >( xRanges, uno::UNO_QUERY_THROW ) ), true ), mxRanges( xRanges ),mbIsRows( bIsRows ), mbIsColumns( bIsColumns )
+: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRanges, uno::UNO_QUERY_THROW ), excel::GetModelFromRange( uno::Reference< uno::XInterface >( xRanges, uno::UNO_QUERY_THROW ) ), true ), mxRanges( xRanges ),mbIsRows( bIsRows ), mbIsColumns( bIsColumns )
{
uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW );
@@ -1431,7 +1474,53 @@ ScVbaRange::visitArray( ArrayVisitor& visitor )
}
}
+uno::Any SAL_CALL ScVbaRange::getName() throw (uno::RuntimeException)
+{
+ uno::Reference< excel::XName > xName;
+ ScDocShell* pDocShell = getScDocShell();
+ uno::Reference< frame::XModel > xModel = pDocShell ? pDocShell->GetModel() : NULL;
+ if ( !xModel.is() )
+ {
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid document" ), uno::Reference< uno::XInterface >() );
+ }
+ uno::Reference< beans::XPropertySet > xPropertySet( xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XNamedRanges > xNamedRanges( xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("NamedRanges")) , uno::UNO_QUERY_THROW );
+
+ uno::Reference< excel::XNames > xNames( new ScVbaNames( uno::Reference< XHelperInterface >(), mxContext , xNamedRanges , xModel ) );
+ sal_Int32 nCount = xNames->getCount();
+ ScCellRangesBase* pUnoRangesBase = getCellRangesBase();
+ if ( pUnoRangesBase && nCount > 0 )
+ {
+ ScRangeList aRangeList = pUnoRangesBase->GetRangeList();
+ for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ uno::Reference< excel::XName > xTmpName( xNames->Item( uno::makeAny( nIndex + 1 ), uno::Any() ), uno::UNO_QUERY );
+ if ( xTmpName.is() )
+ {
+ try
+ {
+ uno::Reference< excel::XRange > xRange = xTmpName->getRefersToRange();
+ if ( xRange.is() )
+ {
+ ScVbaRange* pRange = dynamic_cast< ScVbaRange* >( xRange.get() );
+ ScCellRangesBase* pCurRangesBase = pRange ? pRange->getCellRangesBase() : NULL;
+ if ( pCurRangesBase && aRangeList == pCurRangesBase->GetRangeList() )
+ {
+ xName = xTmpName;
+ break;
+ }
+ }
+ }
+ catch (const uno::Exception&)
+ {
+ }
+ }
+ }
+ }
+
+ return uno::makeAny( xName );
+}
uno::Any
ScVbaRange::getValue( ValueGetter& valueGetter) throw (uno::RuntimeException)
@@ -1521,6 +1610,9 @@ ScVbaRange::setValue( const uno::Any &aValue ) throw (uno::RuntimeException)
}
CellValueSetter valueSetter( aValue );
setValue( aValue, valueSetter );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
void
@@ -1529,6 +1621,9 @@ ScVbaRange::Clear() throw (uno::RuntimeException)
using namespace ::com::sun::star::sheet::CellFlags;
sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA | HARDATTR | EDITATTR | FORMATTED;
ClearContents( nFlags );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
//helper ClearContent
@@ -1569,6 +1664,9 @@ ScVbaRange::ClearContents() throw (uno::RuntimeException)
sheet::CellFlags::STRING | sheet::CellFlags::DATETIME |
sheet::CellFlags::FORMULA );
ClearContents( nClearFlags );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
void
@@ -1577,6 +1675,9 @@ ScVbaRange::ClearFormats() throw (uno::RuntimeException)
//FIXME: need to check if we need to combine sheet::CellFlags::FORMATTED
sal_Int32 nClearFlags = sheet::CellFlags::HARDATTR | sheet::CellFlags::FORMATTED | sheet::CellFlags::EDITATTR;
ClearContents( nClearFlags );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
void
@@ -1592,6 +1693,9 @@ ScVbaRange::setFormulaValue( const uno::Any& rFormula, formula::FormulaGrammar::
}
CellFormulaValueSetter formulaValueSetter( rFormula, getScDocument(), eGram );
setValue( rFormula, formulaValueSetter );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
uno::Any
@@ -1751,6 +1855,9 @@ ScVbaRange::fillSeries( sheet::FillDirection nFillDirection, sheet::FillMode nFi
uno::Reference< sheet::XCellSeries > xCellSeries(mxRange, uno::UNO_QUERY_THROW );
xCellSeries->fillSeries( nFillDirection, nFillMode, nFillDateMode, fStep, fEndValue );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
void
@@ -1890,7 +1997,16 @@ ScVbaRange::getFormulaArray() throw (uno::RuntimeException)
uno::Reference< sheet::XCellRangeFormula> xCellRangeFormula( mxRange, uno::UNO_QUERY_THROW );
uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
uno::Any aMatrix;
- aMatrix = xConverter->convertTo( uno::makeAny( xCellRangeFormula->getFormulaArray() ) , getCppuType((uno::Sequence< uno::Sequence< uno::Any > >*)0) ) ;
+
+ //VBA, minz@cn.ibm.com
+ uno::Sequence< uno::Sequence<rtl::OUString> > aFmArray = xCellRangeFormula->getFormulaArray();
+ if( aFmArray.getLength() )
+ {
+ if( aFmArray.getLength() == 1 && aFmArray[0].getLength() == 1 )
+ aMatrix <<= aFmArray[0][0];
+ else
+ aMatrix = xConverter->convertTo( uno::makeAny( xCellRangeFormula->getFormulaArray() ) , getCppuType((uno::Sequence< uno::Sequence< uno::Any > >*)0) ) ;
+ }
return aMatrix;
}
@@ -2061,29 +2177,65 @@ ScVbaRange::Cells( const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) thr
// set in the Any, we should convert as appropriate
// #FIXME - perhaps worth turning this into some sort of
// convertion routine e.g. bSuccess = getValueFromAny( nRow, nRowIndex, getCppuType((sal_Int32*)0) )
- if ( nRowIndex.hasValue() && !( nRowIndex >>= nRow ) )
+ uno::Any aRowIndexAny = nRowIndex;
+ if ( aRowIndexAny.getValueTypeClass() == uno::TypeClass_INTERFACE )
{
- uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
- uno::Any aConverted;
try
{
- aConverted = xConverter->convertTo( nRowIndex, getCppuType((sal_Int32*)0) );
- bIsIndex = ( aConverted >>= nRow );
+ aRowIndexAny = getDefaultPropByIntrospection( aRowIndexAny );
}
- catch( uno::Exception& ) {} // silence any errors
+ catch( uno::Exception& ) {}
}
- if ( bIsColumnIndex && !( nColumnIndex >>= nColumn ) )
+ else if ( aRowIndexAny.hasValue() && !( aRowIndexAny >>= nRow ) )
{
uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
uno::Any aConverted;
try
{
- aConverted = xConverter->convertTo( nColumnIndex, getCppuType((sal_Int32*)0) );
- bIsColumnIndex = ( aConverted >>= nColumn );
+ aConverted = xConverter->convertTo( aRowIndexAny, getCppuType((sal_Int32*)0) );
+ bIsIndex = ( aConverted >>= nRow );
}
catch( uno::Exception& ) {} // silence any errors
}
+ uno::Any aColumnAny = nColumnIndex;
+
+ if ( bIsColumnIndex )
+ {
+ // Column index can be a col address e.g Cells( 1, "B" ) etc.
+ rtl::OUString sCol;
+ if ( nColumnIndex >>= sCol )
+ {
+ ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 );
+ ScRange tmpRange;
+ USHORT flags = tmpRange.ParseCols( sCol, excel::GetDocumentFromRange( mxRange ), dDetails );
+ if ( ( flags & 0x200 ) != 0x200 )
+ throw uno::RuntimeException();
+ nColumn = tmpRange.aStart.Col() + 1;
+ }
+ else
+ {
+ if ( aColumnAny.getValueTypeClass() == uno::TypeClass_INTERFACE )
+ {
+ try
+ {
+ aColumnAny = getDefaultPropByIntrospection( aColumnAny );
+ }
+ catch( uno::Exception& ) {}
+ }
+ if ( !( aColumnAny >>= nColumn ) )
+ {
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
+ uno::Any aConverted;
+ try
+ {
+ aConverted = xConverter->convertTo( aColumnAny, getCppuType((sal_Int32*)0) );
+ bIsColumnIndex = ( aConverted >>= nColumn );
+ }
+ catch( uno::Exception& ) {} // silence any errors
+ }
+ }
+ }
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisRangeAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
uno::Reference< table::XCellRange > xSheetRange = thisRange.getCellRangeFromSheet();
@@ -2245,7 +2397,7 @@ ScVbaRange::Rows(const uno::Any& aIndex ) throw (uno::RuntimeException)
{
ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 );
ScRange tmpRange;
- tmpRange.ParseRows( sAddress, getDocumentFromRange( mxRange ), dDetails );
+ tmpRange.ParseRows( sAddress, excel::GetDocumentFromRange( mxRange ), dDetails );
nStartRow = tmpRange.aStart.Row();
nEndRow = tmpRange.aEnd.Row();
@@ -2292,7 +2444,7 @@ ScVbaRange::Columns(const uno::Any& aIndex ) throw (uno::RuntimeException)
{
ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 );
ScRange tmpRange;
- tmpRange.ParseCols( sAddress, getDocumentFromRange( mxRange ), dDetails );
+ tmpRange.ParseCols( sAddress, excel::GetDocumentFromRange( mxRange ), dDetails );
nStartCol = tmpRange.aStart.Col();
nEndCol = tmpRange.aEnd.Col();
@@ -2395,9 +2547,11 @@ ScVbaRange::Copy(const ::uno::Any& Destination) throw (uno::RuntimeException)
}
else
{
- uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange );
- Select();
- excel::implnCopy( xModel );
+ ScRange aRange;
+ RangeHelper thisRange( mxRange );
+ ScUnoConversion::FillScRange( aRange, thisRange.getCellRangeAddressable()->getRangeAddress() );
+ uno::Reference< frame::XModel > xModel = excel::GetModelFromRange( mxRange );
+ excel::implnCopyRange( xModel, aRange );
}
}
@@ -2419,8 +2573,9 @@ ScVbaRange::Cut(const ::uno::Any& Destination) throw (uno::RuntimeException)
uno::Reference< sheet::XCellRangeAddressable > xSource( mxRange, uno::UNO_QUERY);
xMover->moveRange( xDestination->getCellAddress(), xSource->getRangeAddress() );
}
- {
- uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange );
+ //VBA, minz@cn.ibm.com.
+ else {
+ uno::Reference< frame::XModel > xModel = excel::GetModelFromRange( mxRange );
Select();
excel::implnCut( xModel );
}
@@ -2740,8 +2895,6 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons
uno::Reference< frame::XModel > xModel( ( pShell ? pShell->GetModel() : NULL ), uno::UNO_QUERY_THROW );
uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
- // save old selection
- uno::Reference< uno::XInterface > xSel( xModel->getCurrentSelection() );
// select this range
xSelection->select( uno::makeAny( mxRange ) );
// set up defaults
@@ -2762,8 +2915,6 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons
USHORT nFlags = getPasteFlags(nPaste);
USHORT nFormulaBits = getPasteFormulaBits(nOperation);
excel::implnPasteSpecial(pShell->GetModel(), nFlags,nFormulaBits,bSkipBlanks,bTranspose);
- // restore selection
- xSelection->select( uno::makeAny( xSel ) );
}
uno::Reference< excel::XRange >
@@ -2984,7 +3135,16 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace
// OOo.org afaik
uno::Reference< util::XSearchDescriptor > xSearch( xDescriptor, uno::UNO_QUERY );
+ // Find all cells that being replaced, used to fire the range changed event.
+ uno::Reference< container::XIndexAccess > xIndexAccess = xReplace->findAll( xSearch );
xReplace->replaceAll( xSearch );
+
+ if ( xIndexAccess.is() && xIndexAccess->getCount() > 0 )
+ {
+ // Fires the range change event.
+ ScCellRangesBase* pScCellRangesBase = ScCellRangesBase::getImplementation( xIndexAccess ); //liuchen 2010-01-05
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), pScCellRangesBase ); //liuchen 2010-01-05 the original convert method will fail in SUSE
+ }
}
return sal_True; // always
}
@@ -3135,6 +3295,13 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
uno::Reference< uno::XInterface > xInterface = xStartCell.is() ? xSearch->findNext( xStartCell, xDescriptor) : xSearch->findFirst( xDescriptor );
uno::Reference< table::XCellRange > xCellRange( xInterface, uno::UNO_QUERY );
+ // if we are searching from a starting cell and failed to find a match
+ // then try from the begining
+ if ( !xCellRange.is() && xStartCell.is() )
+ {
+ xInterface = xSearch->findFirst( xDescriptor );
+ xCellRange.set( xInterface, uno::UNO_QUERY );
+ }
if ( xCellRange.is() )
{
uno::Reference< excel::XRange > xResultRange = new ScVbaRange( mxParent, mxContext, xCellRange );
@@ -3428,76 +3595,45 @@ ScVbaRange::End( ::sal_Int32 Direction ) throw (uno::RuntimeException)
return xRange->End( Direction );
}
+ table::CellAddress aAddress = getLeftUpperCellAddress();
+ SCTAB nTab = aAddress.Sheet;
+ SCCOL nCurX = aAddress.Column;
+ SCROW nCurY = aAddress.Row;
+ SCCOL nNewX = nCurX;
+ SCROW nNewY = nCurY;
- // #FIXME #TODO
- // euch! found my orig implementation sucked, so
- // trying this even suckier one ( really need to use/expose code in
- // around ScTabView::MoveCursorArea(), thats the bit that calcutes
- // where the cursor should go )
- // Main problem with this method is the ultra hacky attempt to preserve
- // the ActiveCell, there should be no need to go to these extreems
-
- // Save ActiveCell pos ( to restore later )
- uno::Any aDft;
- uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW );
- rtl::OUString sActiveCell = xApplication->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft );
-
- // position current cell upper left of this range
- Cells( uno::makeAny( (sal_Int32) 1 ), uno::makeAny( (sal_Int32) 1 ) )->Select();
+ ScDocShell* pDocShell = getScDocShell();
+ ScDocument* pDoc = pDocShell->GetDocument();
- uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange );
+ SCsCOL nMoveX = 0;
+ SCsROW nMoveY = 0;
+ switch ( Direction )
+ {
+ case excel::XlDirection::xlDown:
+ nMoveY = 1;
+ break;
+ case excel::XlDirection::xlUp:
+ nMoveY = -1;
+ break;
+ case excel::XlDirection::xlToLeft:
+ nMoveX = -1;
+ break;
+ case excel::XlDirection::xlToRight:
+ nMoveX = 1;
+ break;
+ default:
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid Direction" ) ), uno::Reference< uno::XInterface >() );
+ }
- SfxViewFrame* pViewFrame = excel::getViewFrame( xModel );
- if ( pViewFrame )
+ if ( pDoc )
{
- SfxAllItemSet aArgs( SFX_APP()->GetPool() );
- // Hoping this will make sure this slot is called
- // synchronously
- SfxBoolItem sfxAsync( SID_ASYNCHRON, sal_False );
- aArgs.Put( sfxAsync, sfxAsync.Which() );
- SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
-
- USHORT nSID = 0;
-
- switch( Direction )
- {
- case excel::XlDirection::xlDown:
- nSID = SID_CURSORBLKDOWN;
- break;
- case excel::XlDirection::xlUp:
- nSID = SID_CURSORBLKUP;
- break;
- case excel::XlDirection::xlToLeft:
- nSID = SID_CURSORBLKLEFT;
- break;
- case excel::XlDirection::xlToRight:
- nSID = SID_CURSORBLKRIGHT;
- break;
- default:
- throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": Invalid ColumnIndex" ) ), uno::Reference< uno::XInterface >() );
- }
- if ( pDispatcher )
- {
- pDispatcher->Execute( nSID, (SfxCallMode)SFX_CALLMODE_SYNCHRON, aArgs );
- }
+ pDoc->FindAreaPos( nNewX, nNewY, nTab, nMoveX, nMoveY );
}
- // result is the ActiveCell
- rtl::OUString sMoved = xApplication->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft );
-
- // restore old ActiveCell
- uno::Any aVoid;
-
- uno::Reference< excel::XRange > xOldActiveCell( xApplication->getActiveSheet()->Range( uno::makeAny( sActiveCell ), aVoid ), uno::UNO_QUERY_THROW );
- xOldActiveCell->Select();
-
- uno::Reference< excel::XRange > resultCell;
-
- resultCell.set( xApplication->getActiveSheet()->Range( uno::makeAny( sMoved ), aVoid ), uno::UNO_QUERY_THROW );
-
- // return result
-
- return resultCell;
+ ScRange aNewRange( (SCCOL)nNewX, (SCROW)nNewY, nTab, (SCCOL)nNewX, (SCROW)nNewY, nTab );
+ uno::Reference< table::XCellRange > xCellRange( new ScCellRangeObj( getScDocShell(), aNewRange ) );
+ uno::Reference< excel::XRange > xResultRange = new ScVbaRange( mxParent, mxContext, xCellRange );
+ return xResultRange;
}
bool
@@ -3515,7 +3651,7 @@ ScVbaRange::characters( const uno::Any& Start, const uno::Any& Length ) throw (u
if ( !isSingleCellRange() )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Can't create Characters property for multicell range ") ), uno::Reference< uno::XInterface >() );
uno::Reference< text::XSimpleText > xSimple(mxRange->getCellByPosition(0,0) , uno::UNO_QUERY_THROW );
- ScDocument* pDoc = getDocumentFromRange(mxRange);
+ ScDocument* pDoc = excel::GetDocumentFromRange(mxRange);
if ( !pDoc )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() );
@@ -3632,7 +3768,7 @@ ScVbaRange::getCalcColWidth( const table::CellRangeAddress& rAddress) throw (uno
double
ScVbaRange::getCalcRowHeight( const table::CellRangeAddress& rAddress ) throw (uno::RuntimeException)
{
- ScDocument* pDoc = getDocumentFromRange( mxRange );
+ ScDocument* pDoc = excel::GetDocumentFromRange( mxRange );
USHORT nWidth = pDoc->GetOriginalHeight( rAddress.StartRow, rAddress.Sheet );
double nPoints = lcl_TwipsToPoints( nWidth );
nPoints = lcl_Round2DecPlaces( nPoints );
@@ -3894,7 +4030,7 @@ ScVbaRange::setRowHeight( const uno::Any& _rowheight) throw (uno::RuntimeExcepti
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
USHORT nTwips = lcl_pointsToTwips( nHeight );
- ScDocShell* pDocShell = getDocShellFromRange( mxRange );
+ ScDocShell* pDocShell = excel::GetDocShellFromRange( mxRange );
ScDocFunc aFunc(*pDocShell);
SCCOLROW nRowArr[2];
nRowArr[0] = thisAddress.StartRow;
@@ -3907,7 +4043,7 @@ uno::Any SAL_CALL
ScVbaRange::getPageBreak() throw (uno::RuntimeException)
{
sal_Int32 nPageBreak = excel::XlPageBreak::xlPageBreakNone;
- ScDocShell* pShell = getDocShellFromRange( mxRange );
+ ScDocShell* pShell = excel::GetDocShellFromRange( mxRange );
if ( pShell )
{
RangeHelper thisRange( mxRange );
@@ -3920,7 +4056,7 @@ ScVbaRange::getPageBreak() throw (uno::RuntimeException)
uno::Reference< frame::XModel > xModel = pShell->GetModel();
if ( xModel.is() )
{
- ScDocument* pDoc = getDocumentFromRange( mxRange );
+ ScDocument* pDoc = excel::GetDocumentFromRange( mxRange );
ScBreakType nBreak = BREAK_NONE;
if ( !bColumn )
@@ -3945,7 +4081,7 @@ ScVbaRange::setPageBreak( const uno::Any& _pagebreak) throw (uno::RuntimeExcepti
sal_Int32 nPageBreak = 0;
_pagebreak >>= nPageBreak;
- ScDocShell* pShell = getDocShellFromRange( mxRange );
+ ScDocShell* pShell = excel::GetDocShellFromRange( mxRange );
if ( pShell )
{
RangeHelper thisRange( mxRange );
@@ -4039,7 +4175,7 @@ ScVbaRange::getWorksheet() throw (uno::RuntimeException)
uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW );
xRange.set( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW );
}
- ScDocShell* pDocShell = getDocShellFromRange(xRange);
+ ScDocShell* pDocShell = excel::GetDocShellFromRange(xRange);
RangeHelper rHelper(xRange);
// parent should be Thisworkbook
xSheet.set( new ScVbaWorksheet( uno::Reference< XHelperInterface >(), mxContext,rHelper.getSpreadSheet(),pDocShell->GetModel()) );
@@ -4094,63 +4230,44 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC
}
}
}
- uno::Reference< sheet::XSpreadsheetView > xView( getCurrentExcelDoc(xContext)->getCurrentController(), uno::UNO_QUERY );
- uno::Reference< table::XCellRange > xSheetRange( xView->getActiveSheet(), uno::UNO_QUERY_THROW );
- ScVbaRange* pRange = new ScVbaRange( excel::getUnoSheetModuleObj( xSheetRange ), xContext, xSheetRange );
- uno::Reference< excel::XRange > xVbSheetRange( pRange );
- return pRange->Range( Cell1, Cell2, true );
-}
-uno::Reference< sheet::XDatabaseRanges >
-lcl_GetDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException )
-{
- uno::Reference< frame::XModel > xModel;
- if ( pShell )
- xModel.set( pShell->GetModel(), uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW );
- uno::Reference< sheet::XDatabaseRanges > xDBRanges( xModelProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DatabaseRanges") ) ), uno::UNO_QUERY_THROW );
- return xDBRanges;
-}
-// returns the XDatabaseRange for the autofilter on sheet (nSheet)
-// also populates sName with the name of range
-uno::Reference< sheet::XDatabaseRange >
-lcl_GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName )
-{
- uno::Reference< container::XIndexAccess > xIndexAccess( lcl_GetDataBaseRanges( pShell ), uno::UNO_QUERY_THROW );
- uno::Reference< sheet::XDatabaseRange > xDataBaseRange;
- table::CellRangeAddress dbAddress;
- for ( sal_Int32 index=0; index < xIndexAccess->getCount(); ++index )
- {
- uno::Reference< sheet::XDatabaseRange > xDBRange( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW );
- uno::Reference< container::XNamed > xNamed( xDBRange, uno::UNO_QUERY_THROW );
- // autofilters work weirdly with openoffice, unnamed is the default
- // named range which is used to create an autofilter, but
- // its also possible that another name could be used
- // this also causes problems when an autofilter is created on
- // another sheet
- // ( but.. you can use any named range )
- dbAddress = xDBRange->getDataArea();
- if ( dbAddress.Sheet == nSheet )
- {
- sal_Bool bHasAuto = sal_False;
- uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW );
- xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ) ) >>= bHasAuto;
- if ( bHasAuto )
- {
- sName = xNamed->getName();
- xDataBaseRange=xDBRange;
- break;
- }
+ // Add these codes for supporting shortcut: Application.Range(Range1, Range2), Range1 or Range2 is not the range of current active sheet.
+ // If Range1 and Range2 are not in current active sheet, we should not use the active sheet, but use the sheet of Range1 and Range2.
+ // If Range1 and Range2 are not in the same sheet, we throw an exception.
+ uno::Reference< sheet::XSpreadsheet > xSpreadsheet;
+ uno::Reference< excel::XRange > xRange1( Cell1, uno::UNO_QUERY ), xRange2( Cell2, uno::UNO_QUERY );
+ if ( xRange1.is() )
+ {
+ RangeHelper thisRange( xRange1->getCellRange() );
+ xSpreadsheet = thisRange.getSpreadSheet();
+ }
+ else if ( xRange2.is() )
+ {
+ RangeHelper thisRange( xRange2->getCellRange() );
+ xSpreadsheet = thisRange.getSpreadSheet();
+ }
+ if ( !xSpreadsheet.is() )
+ {
+ uno::Reference< frame::XModel > xModel = getCurrentExcelDoc( xContext );
+ if ( xModel.is() )
+ {
+ uno::Reference< sheet::XSpreadsheetView > xView( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ xSpreadsheet = xView->getActiveSheet();
}
}
- return xDataBaseRange;
+
+ uno::Reference< table::XCellRange > xSheetRange( xSpreadsheet, uno::UNO_QUERY_THROW );
+ ScVbaRange* pRange = new ScVbaRange( excel::getUnoSheetModuleObj( xSheetRange ), xContext, xSheetRange );
+
+ uno::Reference< excel::XRange > xVbSheetRange( pRange );
+ return pRange->Range( Cell1, Cell2, true );
}
// Helper functions for AutoFilter
ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet )
{
rtl::OUString sName;
- lcl_GetAutoFiltRange( pDocShell, nSheet, sName );
+ excel::GetAutoFiltRange( pDocShell, nSheet, sName );
OSL_TRACE("lcl_GetDBData_Impl got autofilter range %s for sheet %d",
rtl::OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr() , nSheet );
ScDBData* pRet = NULL;
@@ -4317,7 +4434,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
ScDocShell* pShell = getScDocShell();
sal_Bool bHasAuto = sal_False;
rtl::OUString sAutofiltRangeName;
- uno::Reference< sheet::XDatabaseRange > xDataBaseRange = lcl_GetAutoFiltRange( pShell, nSheet, sAutofiltRangeName );
+ uno::Reference< sheet::XDatabaseRange > xDataBaseRange = excel::GetAutoFiltRange( pShell, nSheet, sAutofiltRangeName );
if ( xDataBaseRange.is() )
bHasAuto = true;
@@ -4350,7 +4467,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
autoFiltAddress = multiCellRange.getCellRangeAddressable()->getRangeAddress();
}
- uno::Reference< sheet::XDatabaseRanges > xDBRanges = lcl_GetDataBaseRanges( pShell );
+ uno::Reference< sheet::XDatabaseRanges > xDBRanges = excel::GetDataBaseRanges( pShell );
if ( xDBRanges.is() )
{
rtl::OUString sGenName( RTL_CONSTASCII_USTRINGPARAM("VBA_Autofilter_") );
@@ -4403,8 +4520,21 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
// Use the normal uno api, sometimes e.g. when you want to use ALL as the filter
// we can't use refresh as the uno interface doesn't have a concept of ALL
// in this case we just call the core calc functionality -
- bool bAll = false;;
- if ( ( Field >>= nField ) )
+ bool bAll = false;
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
+ bool bIsValidFieldValue = ( Field >>= nField );
+ if ( !bIsValidFieldValue && xConverter.is() )
+ {
+ try
+ {
+ uno::Any aConverted = xConverter->convertTo( Field, getCppuType( (sal_Int32*)0 ) );
+ bIsValidFieldValue = ( aConverted >>= nField );
+ }
+ catch( const uno::Exception& ex )
+ {
+ }
+ }
+ if ( bIsValidFieldValue )
{
uno::Reference< sheet::XSheetFilterDescriptor2 > xDesc(
xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY );
@@ -4435,7 +4565,19 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
bAll = true;
// not sure what the relationship between Criteria1 and Operator is,
// e.g. can you have a Operator without a Criteria ? in openoffice it
- if ( Operator.hasValue() && ( Operator >>= nOperator ) )
+ bool bIsValidOpValue = ( Operator.hasValue() && ( Operator >>= nOperator ) );
+ if ( Operator.hasValue() && !bIsValidOpValue && xConverter.is() )
+ {
+ try
+ {
+ uno::Any aConverted = xConverter->convertTo( Operator, getCppuType( (sal_Int32*)0 ) );
+ bIsValidOpValue = ( aConverted >>= nOperator );
+ }
+ catch( const uno::Exception& ex )
+ {
+ }
+ }
+ if ( bIsValidOpValue )
{
// if its a bottom/top Ten(Percent/Value) and there
// is no value specified for critera1 set it to 10
@@ -4583,7 +4725,7 @@ ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& CopyOrigin ) throw (u
{
// After the insert ( this range ) actually has moved
ScRange aRange( static_cast< SCCOL >( thisAddress.StartColumn ), static_cast< SCROW >( thisAddress.StartRow ), static_cast< SCTAB >( thisAddress.Sheet ), static_cast< SCCOL >( thisAddress.EndColumn ), static_cast< SCROW >( thisAddress.EndRow ), static_cast< SCTAB >( thisAddress.Sheet ) );
- uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getDocShellFromRange( mxRange ) , aRange ) );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( excel::GetDocShellFromRange( mxRange ) , aRange ) );
uno::Reference< excel::XRange > xVbaRange( new ScVbaRange( mxParent, mxContext, xRange, mbIsRows, mbIsColumns ) );
xVbaRange->PasteSpecial( uno::Any(), uno::Any(), uno::Any(), uno::Any() );
}
@@ -4607,7 +4749,7 @@ ScVbaRange::Autofit() throw (uno::RuntimeException)
if ( !( mbIsColumns || mbIsRows ) )
DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
- ScDocShell* pDocShell = getDocShellFromRange( mxRange );
+ ScDocShell* pDocShell = excel::GetDocShellFromRange( mxRange );
if ( pDocShell )
{
RangeHelper thisRange( mxRange );
@@ -4639,8 +4781,8 @@ ScVbaRange::Autofit() throw (uno::RuntimeException)
***************************************************************************************/
void SAL_CALL
ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any& DataType, const css::uno::Any& TextQualifier,
- const css::uno::Any& ConsecutinveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma,
- const css::uno::Any& Space, const css::uno::Any& Other, const css::uno::Any& OtherChar, const css::uno::Any& /*FieldInfo*/,
+ const css::uno::Any& ConsecutiveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma,
+ const css::uno::Any& Space, const css::uno::Any& Other, const css::uno::Any& OtherChar, const css::uno::Any& FieldInfo,
const css::uno::Any& DecimalSeparator, const css::uno::Any& ThousandsSeparator, const css::uno::Any& /*TrailingMinusNumbers*/ ) throw (css::uno::RuntimeException)
{
uno::Reference< excel::XRange > xRange;
@@ -4677,13 +4819,13 @@ ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any
OSL_TRACE("set TextQualifier\n");
}
- sal_Bool bConsecutinveDelimiter = sal_False;
- if( ConsecutinveDelimiter.hasValue() )
+ sal_Bool bConsecutiveDelimiter = sal_False;
+ if( ConsecutiveDelimiter.hasValue() )
{
- if( !( ConsecutinveDelimiter >>= bConsecutinveDelimiter ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "ConsecutinveDelimiter parameter should be a boolean" ),
+ if( !( ConsecutiveDelimiter >>= bConsecutiveDelimiter ) )
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "ConsecutiveDelimiter parameter should be a boolean" ),
uno::Reference< uno::XInterface >() );
- OSL_TRACE("set ConsecutinveDelimiter\n");
+ OSL_TRACE("set ConsecutiveDelimiter\n");
}
sal_Bool bTab = sal_False;
@@ -4735,7 +4877,13 @@ ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any
throw uno::RuntimeException( rtl::OUString::createFromAscii( "Other parameter should be a True" ),
uno::Reference< uno::XInterface >() );
}
- //TODO* FieldInfo Optional Variant. An array containing parse information for the individual columns of data. The interpretation depends on the value of DataType. When the data is delimited, this argument is an array of two-element arrays, with each two-element array specifying the conversion options for a particular column. The first element is the column number (1-based), and the second element is one of the xlColumnDataType constants specifying how the column is parsed.
+ // FieldInfo, Optional Variant. An array containing parse information for the individual columns of data.
+ // The interpretation depends on the value of DataType. When the data is delimited, this argument is an array
+ // of two-element arrays, with each two-element array specifying the conversion options for a particular column.
+ // The first element is the column number (1-based), and the second element is one of the xlColumnDataType
+ // constants specifying how the column is parsed.
+ uno::Sequence< uno::Sequence< uno::Any > > sFieldInfo;
+ FieldInfo >>= sFieldInfo;
rtl::OUString sDecimalSeparator;
if( DecimalSeparator.hasValue() )
@@ -4753,7 +4901,106 @@ ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any
uno::Reference< uno::XInterface >() );
OSL_TRACE("set ThousandsSpeparator\n" );
}
- //TODO* TrailingMinusNumbers Optional Variant. Numbers that begin with a minus character.
+ //TODO* TrailingMinusNumbers Optional Variant. Numbers that begin with a minus character.
+
+ // Get the destination range's left-upper cell address.
+ ScVbaRange* pDestVbaRange = dynamic_cast< ScVbaRange* >( xRange.get() );
+ ScAddress aScDestAddress;
+ if ( pDestVbaRange )
+ {
+ ScUnoConversion::FillScAddress( aScDestAddress, pDestVbaRange->getLeftUpperCellAddress() );
+ }
+
+ // Parse the value of parameter FieldInfo.
+ USHORT nCount = 0, nRealCount = 0;
+ xub_StrLen* pColumns = NULL;
+ BYTE* pFormats = NULL;
+ if ( sFieldInfo.getLength() > 0 )
+ {
+ nCount = sFieldInfo.getLength();
+ pColumns = new xub_StrLen[nCount];
+ pFormats = new BYTE[nCount];
+ USHORT nFormat = 1;
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
+ for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ if ( sFieldInfo[nIndex].getLength() >= 2 )
+ {
+ nFormat = 1;
+ try
+ {
+ uno::Any aConverted = xConverter->convertTo( sFieldInfo[nIndex][0], getCppuType((xub_StrLen*)0) );
+ aConverted >>= pColumns[nRealCount];
+ aConverted = xConverter->convertTo( sFieldInfo[nIndex][1], getCppuType((USHORT*)0) );
+ aConverted >>= nFormat;
+ }
+ catch( const uno::Exception& )
+ {
+ }
+ pFormats[nRealCount++] = nFormat;
+ }
+ }
+ }
+
+ sal_Unicode cTextQualifier = '"';
+ cTextQualifier = xlTextQualifier == excel::XlTextQualifier::xlTextQualifierNone ? '\0' : cTextQualifier;
+ cTextQualifier = xlTextQualifier == excel::XlTextQualifier::xlTextQualifierSingleQuote ? '\'' : cTextQualifier;
+
+ // Get field delimiters.
+ String rFieldDelimiters;
+ if ( bTab ) rFieldDelimiters += '\t';
+ if ( bSemicolon ) rFieldDelimiters += ';';
+ if ( bComma ) rFieldDelimiters += ',';
+ if ( bSpace ) rFieldDelimiters += ' ';
+ if ( bOther ) rFieldDelimiters += *sOtherChar.getStr();
+
+ // Get the text in current range to SvMemoryStream.
+ ScRange aSrcScRange;
+ ScCellRangesBase* pSrcCellRangesBase = getCellRangesBase();
+ if ( pSrcCellRangesBase )
+ {
+ ScRangeList aRangeList = pSrcCellRangesBase->GetRangeList();
+ if ( aRangeList.First() )
+ {
+ aSrcScRange = *aRangeList.First();
+ }
+ }
+ ScImportExport aExport( getScDocument(), aSrcScRange );
+ aExport.SetDelimiter( static_cast< sal_Unicode >( 0 ) );
+ SvMemoryStream aStream;
+ aStream.SetStreamCharSet( RTL_TEXTENCODING_UNICODE );
+ ScImportExport::SetNoEndianSwap( aStream );
+ aExport.ExportStream( aStream, String(), FORMAT_STRING );
+ aStream.Seek( 0 );
+
+ // Set ScAsciiOptions according to the input parameters.
+ ScAsciiOptions aOptions;
+ aOptions.SetFixedLen( !bDilimited );
+ aOptions.SetStartRow( 0 );
+ aOptions.SetColInfo( nRealCount, pColumns, pFormats );
+ if ( bDilimited )
+ {
+ aOptions.SetFieldSeps( rFieldDelimiters );
+ aOptions.SetMergeSeps( bConsecutiveDelimiter );
+ aOptions.SetTextSep( cTextQualifier );
+ }
+
+ // Split the String in to columns.
+ if ( pDestVbaRange && pDestVbaRange->getScDocument() )
+ {
+ ScImportExport aImport( pDestVbaRange->getScDocument(), aScDestAddress );
+ aImport.SetExtOptions( aOptions );
+ aImport.SetApi( false );
+ aImport.ImportStream( aStream, String(), FORMAT_STRING );
+ }
+ if ( pColumns )
+ {
+ DELETEZ( pColumns );
+ }
+ if ( pFormats )
+ {
+ DELETEZ( pFormats );
+ }
}
uno::Any SAL_CALL
@@ -4898,7 +5145,7 @@ uno::Any ScVbaRange::getShowDetail() throw ( css::uno::RuntimeException)
(thisAddress.StartColumn == thisAddress.EndColumn && thisAddress.EndColumn == aOutlineAddress.EndColumn ))
{
sal_Bool bColumn =thisAddress.StartRow == thisAddress.EndRow ? sal_False:sal_True;
- ScDocument* pDoc = getDocumentFromRange( mxRange );
+ ScDocument* pDoc = excel::GetDocumentFromRange( mxRange );
ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable(static_cast<SCTAB>(thisAddress.Sheet), sal_True);
const ScOutlineArray* pOutlineArray = bColumn ? pOutlineTable->GetColArray(): pOutlineTable->GetRowArray();
if( pOutlineArray )
@@ -4954,6 +5201,24 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail) throw ( css::uno::Ru
}
}
+//09-09-16 add by limingl
+::com::sun::star::uno::Reference< ::ooo::vba::excel::XQueryTable > SAL_CALL
+ScVbaRange::getQueryTable() throw (::com::sun::star::uno::RuntimeException)
+{
+ /*
+ if (m_pQueryTable == NULL)
+ {
+ m_pQueryTable = new ScVbaQueryTable(mxParent ,mxContext, getScDocument(), this); //add by limingl
+ }
+ //*/
+ if (!m_xQueryTable.is())
+ {
+ m_xQueryTable = new ScVbaQueryTable(mxParent ,mxContext, getScDocument(), this); //add by limingl
+ }
+
+ return m_xQueryTable;
+}
+//end add
uno::Reference< excel::XRange > SAL_CALL
ScVbaRange::MergeArea() throw (script::BasicErrorException, uno::RuntimeException)
{
@@ -4983,6 +5248,118 @@ ScVbaRange::MergeArea() throw (script::BasicErrorException, uno::RuntimeExceptio
return new ScVbaRange( mxParent, mxContext, mxRange );
}
+//2008-08-25 add by limingl
+//The recordset's member: Recordset.Fields.Item will get a Field obj.
+//Field.value is the column value.
+::sal_Int32 SAL_CALL
+ScVbaRange::CopyFromRecordset( const ::com::sun::star::uno::Any& Data, const ::com::sun::star::uno::Any& MaxRows, const ::com::sun::star::uno::Any& MaxColumns )
+throw (::com::sun::star::script::BasicErrorException, ::com::sun::star::uno::RuntimeException)
+{
+ uno::Sequence< uno::Any > aParams;
+ uno::Sequence< uno::Any > aFieldsParams(1);
+ uno::Sequence< sal_Int16 > aOutParamIndex;
+ uno::Sequence< uno::Any > aOutParam;
+ uno::Reference< uno::XInterface > xIntRes;
+ uno::Reference< uno::XInterface > xIntFields;
+ uno::Reference< uno::XInterface > xIntFld;
+ uno::Any aRet;
+ uno::Any aPar;
+ uno::Any aCrrCol;
+ uno::Any aCrrRow;
+ sal_Int16 nCrrCol = 0;
+ sal_Int32 nCrrRow = 0;
+ sal_Int32 nCol;
+ sal_Int32 nMaxRows = 0;
+ sal_Int32 nMaxColumns = 0;
+ sal_Bool bEof;
+// sal_Bool bColName = sal_True;
+ long lColCnt = 0;
+ if (MaxColumns.hasValue())
+ {
+ MaxColumns >>= nMaxColumns;
+ }
+
+ long lMaxCol = nMaxColumns;
+
+ if (MaxRows.hasValue())
+ {
+ MaxRows >>= nMaxRows;
+ }
+
+
+ Data >>= xIntRes;
+ uno::Reference< script::XInvocation > xInvRes(xIntRes, uno::UNO_QUERY_THROW);
+ rtl::OUString oMoveNext = rtl::OUString::createFromAscii("MoveNext") ;
+ rtl::OUString oEof = rtl::OUString::createFromAscii("EOF") ;
+ rtl::OUString oFields = rtl::OUString::createFromAscii("Fields") ;
+
+ if( !xInvRes->hasMethod(oMoveNext))
+ {
+ return -1;
+ }
+
+ //Get columns count
+ aRet = xInvRes->getValue(oFields);
+ aRet >>= xIntFields;
+ uno::Reference< script::XInvocation > xInvFields(xIntFields, uno::UNO_QUERY_THROW);
+ aRet = xInvFields->getValue( rtl::OUString::createFromAscii("Count")) ;
+ aRet >>= lColCnt;
+
+ //Set the assign column number
+ if (lMaxCol != 0)
+ {
+ if (lColCnt > lMaxCol)
+ {
+ lColCnt = lMaxCol;
+ }
+ }
+
+ aCrrRow <<= nCrrRow;
+ aCrrCol <<= nCrrCol;
+
+
+ //Get start position
+ uno::Reference< excel::XRange > xRngStartRow = Rows(uno::Any(sal_Int32(1)) );
+ uno::Reference< excel::XRange > xRngPos = xRngStartRow->Columns( uno::Any(sal_Int32(1)) );
+
+ while(1)
+ {//travel recordset
+ //get every column
+ for (long l = 0; l < lColCnt ; l++)
+ {
+ nCol = l;
+ aPar <<= nCol;
+ //get every field
+ aRet = xInvFields->invoke( rtl::OUString::createFromAscii("Item"), uno::Sequence< uno::Any >(&aPar,1) , aOutParamIndex,aOutParam);
+ aRet >>= xIntFld;
+ uno::Reference< script::XInvocation > xInvFld(xIntFld, uno::UNO_QUERY_THROW); //Get the Field obj
+
+ //set the field value
+ aRet = xInvFld->getValue( rtl::OUString::createFromAscii("Value") );
+ uno::Reference< excel::XRange > xRngToFill = xRngPos->Offset(aCrrRow,aCrrCol );
+
+ xRngToFill->setValue(aRet);
+ nCrrCol++;
+ aCrrCol <<= nCrrCol;
+ }
+
+ aRet = xInvRes->invoke(oMoveNext, aParams,aOutParamIndex,aOutParam );
+ aRet = xInvRes->getValue(oEof);
+ aRet >>= bEof;
+ if (bEof || ( nCrrRow >= nMaxRows && nMaxRows != 0) )
+ {//Arrive the end of recordset
+ break;
+ }
+
+ nCrrRow++;
+ aCrrRow <<= nCrrRow;
+ nCrrCol = 0;
+ aCrrCol <<= nCrrCol;
+ }
+
+ return 0;
+}
+//end add
void SAL_CALL
ScVbaRange::PrintOut( 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 ) throw (uno::RuntimeException)
{
@@ -5001,7 +5378,7 @@ ScVbaRange::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any&
{
ScVbaRange* pRange = getImplementation( xRange );
// initialise the doc shell and the printareas
- pShell = getDocShellFromRange( pRange->mxRange );
+ pShell = excel::GetDocShellFromRange( pRange->mxRange );
xPrintAreas.set( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW );
}
printAreas[ index - 1 ] = rangeAddress;
@@ -5087,7 +5464,7 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const
}
}
}
- ScDocShell* pDocSh= getDocShellFromRange( mxRange );
+ ScDocShell* pDocSh= excel::GetDocShellFromRange( mxRange );
FillCmd eCmd = FILL_AUTO;
FillDateCmd eDateCmd = FILL_DAY;
@@ -5210,13 +5587,8 @@ ScVbaRange::AutoOutline( ) throw (script::BasicErrorException, uno::RuntimeExce
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
- if ( isSingleCellRange() || mbIsRows )
- {
- uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW );
- xSheetOutline->autoOutline( thisAddress );
- }
- else
- DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
+ uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW );
+ xSheetOutline->autoOutline( thisAddress );
}
void SAL_CALL
@@ -5243,9 +5615,9 @@ ScVbaRange::groupUnGroup( bool bUnGroup ) throw ( script::BasicErrorException, u
{
if ( m_Areas->getCount() > 1 )
DebugHelper::exception(SbERR_METHOD_FAILED, STR_ERRORMESSAGE_APPLIESTOSINGLERANGEONLY);
- table::TableOrientation nOrient = table::TableOrientation_ROWS;
- if ( mbIsColumns )
- nOrient = table::TableOrientation_COLUMNS;
+ table::TableOrientation nOrient = table::TableOrientation_COLUMNS;
+ if ( mbIsRows )
+ nOrient = table::TableOrientation_ROWS;
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW );
@@ -5404,6 +5776,7 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw
bool bIsSingleCell = isSingleCellRange();
bool bIsMultiArea = ( m_Areas->getCount() > 1 );
ScVbaRange* pRangeToUse = this;
+ uno::Reference< excel::XRange > xUsedRange( getWorksheet()->getUsedRange() );
sal_Int32 nType = 0;
if ( !( _oType >>= nType ) )
DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
@@ -5464,7 +5837,6 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw
}
else if ( bIsSingleCell )
{
- uno::Reference< excel::XRange > xUsedRange = getWorksheet()->getUsedRange();
pRangeToUse = static_cast< ScVbaRange* >( xUsedRange.get() );
}
@@ -5639,6 +6011,183 @@ ScVbaRange::Subtotal( ::sal_Int32 _nGroupBy, ::sal_Int32 _nFunction, const uno::
}
}
+uno::Any SAL_CALL ScVbaRange::AdvancedFilter( sal_Int32 Action, const uno::Any& CriteriaRange,
+ const uno::Any& CopyToRange, const uno::Any& Unique ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ uno::Any aRet;
+ aRet <<= sal_True;
+
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
+ ScDocument* pDoc = getScDocument();
+ if ( !pDoc )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from range" ) ), uno::Reference< uno::XInterface >() );
+ }
+
+ // Action
+ if ( Action != excel::XlFilterAction::xlFilterInPlace && Action != excel::XlFilterAction::xlFilterCopy )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid input parameter" ) ), uno::Reference< uno::XInterface >() );
+ }
+ if ( m_Areas->getCount() > 1 )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid range" ) ), uno::Reference< uno::XInterface >() );
+ }
+
+ sal_Bool bCopyOut = ( Action != excel::XlFilterAction::xlFilterInPlace );
+ uno::Reference< sheet::XSheetFilterDescriptor > xFilterDesc;
+ uno::Reference< sheet::XSheetFilterable > xSheetFilter( mxRange, uno::UNO_QUERY_THROW );
+
+ // CriteriaRange
+ String aBuiltInCriteria; // Excel Built-In Filter Criteria.
+ ScRangeData* pData = NULL;
+ table::CellRangeAddress refParentAddr;
+ uno::Any aCriteriaRange = CriteriaRange;
+ formula::FormulaGrammar::AddressConvention aConv = formula::FormulaGrammar::CONV_XL_A1;
+ if ( aCriteriaRange.hasValue() && aCriteriaRange.getValueTypeClass() == uno::TypeClass_STRING )
+ {
+ rtl::OUString rRangeString;
+ aCriteriaRange >>= rRangeString;
+ aConv = excel::IsR1C1ReferFormat( pDoc, rRangeString ) ? formula::FormulaGrammar::CONV_XL_R1C1 : aConv;
+ }
+ else
+ {
+ // Get Excel BuiltIn Filter Criteria.
+ ScRangeName* pRangeNames = pDoc->GetRangeName();
+ const USHORT nCount = pRangeNames ? pRangeNames->GetCount() : 0;
+ for ( USHORT index = 0; index < nCount; index++ )
+ {
+ pData = ( ScRangeData* )( pRangeNames->At( index ) );
+ if ( pData && pData->HasType( RT_CRITERIA ) )
+ {
+ pData->GetSymbol( aBuiltInCriteria, formula::FormulaGrammar::GRAM_NATIVE_XL_A1 );
+ break;
+ }
+ }
+ aCriteriaRange = aBuiltInCriteria.Len() > 0 ? uno::makeAny( rtl::OUString( aBuiltInCriteria ) ) : aCriteriaRange;
+ }
+ if ( aCriteriaRange.hasValue() )
+ {
+ table::CellRangeAddress criteriaRangeAddress = getCellRangeAddressForVBARange( aCriteriaRange, getScDocShell(), aConv );
+ ScRange refRange;
+ ScUnoConversion::FillScRange( refRange, criteriaRangeAddress );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell(), refRange ) );
+ uno::Reference< sheet::XSheetFilterableEx > xCriteria( xRange, uno::UNO_QUERY );
+ if ( xCriteria.is() )
+ {
+ xFilterDesc = xCriteria->createFilterDescriptorByObject( xSheetFilter );
+ }
+ }
+ else if ( mxRange.is() )
+ {
+ uno::Reference< sheet::XSheetFilterableEx > xCriteria( mxRange, uno::UNO_QUERY );
+ if ( xCriteria.is() )
+ {
+ xFilterDesc = xCriteria->createFilterDescriptorByObject( xSheetFilter );
+ }
+ }
+
+ uno::Reference< beans::XPropertySet > xPropertySet( xFilterDesc, uno::UNO_QUERY );
+ if ( xPropertySet.is() )
+ {
+ xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_COPYOUT ) ), uno::makeAny( bCopyOut ) );
+ }
+
+ // CopyToRange
+ if ( bCopyOut && CopyToRange.hasValue() && xPropertySet.is() )
+ {
+ formula::FormulaGrammar::AddressConvention aTmpConv = formula::FormulaGrammar::CONV_XL_A1;
+ if ( CopyToRange.getValueTypeClass() == uno::TypeClass_STRING )
+ {
+ rtl::OUString rRangeString;
+ CopyToRange >>= rRangeString;
+ aTmpConv = excel::IsR1C1ReferFormat( pDoc, rRangeString ) ? formula::FormulaGrammar::CONV_XL_R1C1 : aConv;
+ }
+ ScRange refRange;
+ ScUnoConversion::FillScRange( refRange, getCellRangeAddressForVBARange( CopyToRange, getScDocShell(), aTmpConv ) );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell(), refRange ) );
+ uno::Reference< sheet::XCellAddressable > xCellAddr( xRange->getCellByPosition( 0, 0 ), uno::UNO_QUERY_THROW );
+ xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_OUTPOS ) ), uno::makeAny( xCellAddr->getCellAddress() ) );
+ }
+
+ // Unique
+ if ( xPropertySet.is() )
+ {
+ sal_Bool bUnique = sal_False;
+ uno::Any aUnique;
+ try
+ {
+ aUnique <<= bUnique;
+ aUnique = ( xConverter.is() && Unique.hasValue() ) ? xConverter->convertTo( Unique, getCppuType( ( sal_Bool* ) 0 ) ) : aUnique;
+ }
+ catch( const uno::Exception& )
+ {
+ }
+ xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_SKIPDUP ) ), aUnique );
+ }
+
+ // Do filter.
+ if ( xFilterDesc.is() )
+ {
+ xSheetFilter->filter( xFilterDesc );
+ }
+
+ return aRet;
+}
+
+//Add by minz@cn.ibm.com. Range.PivotTable.
+//Returns a PivotTable object that represents the PivotTable report containing the upper-left corner of the specified range.
+uno::Reference< excel::XPivotTable >
+ScVbaRange::PivotTable() throw (uno::RuntimeException)
+{
+ uno::Reference< excel::XPivotTable > xDestPVTable;
+
+ uno::Reference< sheet::XSpreadsheet > xSheet;
+ if ( mxRange.is() )
+ {
+ RangeHelper thisRange( mxRange );
+ xSheet = thisRange.getSpreadSheet();
+ }
+ else if ( mxRanges.is() )
+ {
+ uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW );
+ uno::Reference< table::XCellRange > xRange( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW );
+ RangeHelper thisRange( xRange );
+ xSheet = thisRange.getSpreadSheet();
+ }
+
+// RangeHelper thisRange( mxRange );
+// uno::Reference< sheet::XSpreadsheet > xSheet = thisRange.getSpreadSheet();
+ uno::Reference< sheet::XDataPilotTablesSupplier > xTables(xSheet, uno::UNO_QUERY_THROW ) ;
+ uno::Reference< container::XIndexAccess > xIndexAccess( xTables->getDataPilotTables(), uno::UNO_QUERY_THROW );
+ if ( xIndexAccess.is() )
+ {
+ //get the upper-left cell address
+ table::CellAddress aAddress = getLeftUpperCellAddress();
+
+ sal_Int32 nCount = xIndexAccess->getCount();
+ for (sal_Int32 i=0; i < nCount; i++)
+ {
+ uno::Reference< sheet::XDataPilotTable > xDPTable(xIndexAccess->getByIndex(i), uno::UNO_QUERY);
+ uno::Reference< sheet::XDataPilotTable2 > xDPTable2(xDPTable, uno::UNO_QUERY);
+
+ //check if the cell is in the pivot table
+ sheet::DataPilotTablePositionData posData = xDPTable2->getPositionData(aAddress);
+ table::CellRangeAddress aCellRangeAddress = xDPTable->getOutputRange();
+ ScRange aScRange( aCellRangeAddress.StartColumn, aCellRangeAddress.StartRow, aCellRangeAddress.Sheet,
+ aCellRangeAddress.EndColumn, aCellRangeAddress.EndRow, aCellRangeAddress.Sheet );
+ ScAddress aPos( aAddress.Column, aAddress.Row, aAddress.Sheet );
+ if( !(posData.PositionType == sheet::DataPilotTablePositionType::NOT_IN_TABLE) || aScRange.In( aPos ) )
+ {
+ xDestPVTable = new ScVbaPivotTable( mxContext, xDPTable );
+ break;
+ }
+ }
+ }
+ return xDestPVTable;
+}
+
+
rtl::OUString&
ScVbaRange::getServiceImplName()
{
@@ -5658,6 +6207,25 @@ ScVbaRange::getServiceNames()
return aServiceNames;
}
+sal_Bool SAL_CALL
+ScVbaRange::hasError() throw (uno::RuntimeException)
+{
+ double dResult = sal_False;
+ uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW );
+ uno::Reference< script::XInvocation > xInvoc( xApplication->WorksheetFunction(), uno::UNO_QUERY_THROW );
+
+ static rtl::OUString FunctionName( RTL_CONSTASCII_USTRINGPARAM("IsError" ) );
+ uno::Sequence< uno::Any > Params(1);
+ uno::Reference< excel::XRange > aRange( this );
+ Params[0] = uno::makeAny( aRange );
+ uno::Sequence< sal_Int16 > OutParamIndex;
+ uno::Sequence< uno::Any > OutParam;
+ xInvoc->invoke( FunctionName, Params, OutParamIndex, OutParam ) >>= dResult;
+ if ( dResult > 0.0 )
+ return sal_True;
+ return sal_False;
+}
+
namespace range
{
namespace sdecl = comphelper::service_decl;
@@ -5667,3 +6235,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"SvVbaRange",
"ooo.vba.excel.Range" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbarange.hxx b/sc/source/ui/vba/vbarange.hxx
index 84a65e7e2af5..ac745ef42279 100644
--- a/sc/source/ui/vba/vbarange.hxx
+++ b/sc/source/ui/vba/vbarange.hxx
@@ -35,6 +35,7 @@
#include <ooo/vba/excel/XFont.hpp>
#include <ooo/vba/excel/XComment.hpp>
#include <ooo/vba/XCollection.hpp>
+#include <ooo/vba/excel/XPivotTable.hpp>
#include <ooo/vba/excel/XlPasteType.hdl>
#include <ooo/vba/excel/XlPasteSpecialOperation.hdl>
@@ -49,6 +50,8 @@
#include <com/sun/star/sheet/FillDirection.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
+#include <com/sun/star/table/CellAddress.hpp>
+#include "vbaquerytable.hxx" //09-09-18 add by limingl
#include "vbaformat.hxx"
#include <formula/grammar.hxx>
@@ -97,6 +100,7 @@ class ScVbaRange : public ScVbaRange_BASE
sal_Bool mbIsRows;
sal_Bool mbIsColumns;
css::uno::Reference< ov::excel::XValidation > m_xValidation;
+ css::uno::Reference<excel::XQueryTable> m_xQueryTable; //09-09-16 add by limingl
double getCalcColWidth( const css::table::CellRangeAddress& ) throw (css::uno::RuntimeException);
double getCalcRowHeight( const css::table::CellRangeAddress& ) throw (css::uno::RuntimeException);
void visitArray( ArrayVisitor& vistor );
@@ -146,8 +150,10 @@ public:
const css::uno::Reference< css::uno::XComponentContext >& xContext,
const rtl::OUString& sRangeName, ScDocShell* pDocSh,
formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_XL_A1 ) throw ( css::uno::RuntimeException );
+ css::table::CellAddress getLeftUpperCellAddress();
// Attributes
+ virtual css::uno::Any SAL_CALL getName() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
virtual void SAL_CALL setValue( const css::uno::Any& aValue ) throw ( css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL getFormula() throw (css::uno::RuntimeException);
@@ -188,6 +194,7 @@ public:
virtual css::uno::Any SAL_CALL getPrefixCharacter() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL getShowDetail() throw (css::uno::RuntimeException);
virtual void SAL_CALL setShowDetail(const css::uno::Any& aShowDetail) throw (css::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::ooo::vba::excel::XQueryTable > SAL_CALL getQueryTable() throw (::com::sun::star::uno::RuntimeException); //09-09-16 add by limingl
// Methods
sal_Bool IsRows() { return mbIsRows; }
sal_Bool IsColumns() { return mbIsColumns; }
@@ -238,7 +245,7 @@ public:
virtual css::uno::Any SAL_CALL BorderAround( const css::uno::Any& LineStyle,
const css::uno::Any& Weight, const css::uno::Any& ColorIndex, const css::uno::Any& Color ) throw (css::uno::RuntimeException);
virtual void SAL_CALL TextToColumns( const css::uno::Any& Destination, const css::uno::Any& DataType, const css::uno::Any& TextQualifier,
- const css::uno::Any& ConsecutinveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma,
+ const css::uno::Any& ConsecutiveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma,
const css::uno::Any& Space, const css::uno::Any& Other, const css::uno::Any& OtherChar, const css::uno::Any& FieldInfo,
const css::uno::Any& DecimalSeparator, const css::uno::Any& ThousandsSeparator, const css::uno::Any& TrailingMinusNumbers ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Hyperlinks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
@@ -263,6 +270,11 @@ public:
virtual void SAL_CALL RemoveSubtotal( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL MergeArea() throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual void SAL_CALL Subtotal( ::sal_Int32 GroupBy, ::sal_Int32 Function, const css::uno::Sequence< ::sal_Int32 >& TotalList, const css::uno::Any& Replace, const css::uno::Any& PageBreaks, const css::uno::Any& SummaryBelowData ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL AdvancedFilter( ::sal_Int32 Action, const css::uno::Any& CriteriaRange, const css::uno::Any& CopyToRange, const css::uno::Any& Unique ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
+ virtual css::uno::Reference< ov::excel::XPivotTable > SAL_CALL PivotTable( ) throw (css::uno::RuntimeException);
+
+ virtual ::sal_Int32 SAL_CALL CopyFromRecordset( const ::com::sun::star::uno::Any& Data, const ::com::sun::star::uno::Any& MaxRows, const ::com::sun::star::uno::Any& MaxColumns ) throw (::com::sun::star::script::BasicErrorException, ::com::sun::star::uno::RuntimeException); //2008-08-25 add by limingl
// XEnumerationAccess
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
// XElementAccess
@@ -288,6 +300,8 @@ public:
static css::uno::Reference< ov::excel::XRange > ApplicationRange( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Any &Cell1, const css::uno::Any &Cell2 ) throw (css::uno::RuntimeException);
virtual sal_Bool SAL_CALL GoalSeek( const css::uno::Any& Goal, const css::uno::Reference< ov::excel::XRange >& ChangingCell ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL SpecialCells( const css::uno::Any& _oType, const css::uno::Any& _oValue) throw ( css::script::BasicErrorException );
+ // XErrorQuery
+ virtual ::sal_Bool SAL_CALL hasError( ) throw (css::uno::RuntimeException);
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
diff --git a/sc/source/ui/vba/vbaseriescollection.cxx b/sc/source/ui/vba/vbaseriescollection.cxx
index 8caa746beff0..1ccb7bda8f7f 100644
--- a/sc/source/ui/vba/vbaseriescollection.cxx
+++ b/sc/source/ui/vba/vbaseriescollection.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,3 +79,4 @@ ScVbaSeriesCollection::getServiceNames()
return sNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx
index 4bd0f1d60547..652c8e4f87b1 100644
--- a/sc/source/ui/vba/vbasheetobject.cxx
+++ b/sc/source/ui/vba/vbasheetobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -515,3 +516,5 @@ void ScVbaButton::implSetDefaultProperties() throw (uno::RuntimeException)
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx
index ced94db5ba76..3847209989f9 100644
--- a/sc/source/ui/vba/vbasheetobjects.cxx
+++ b/sc/source/ui/vba/vbasheetobjects.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -532,3 +533,5 @@ ScVbaButtons::ScVbaButtons(
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButtons, "ooo.vba.excel.Buttons" )
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbastyle.cxx b/sc/source/ui/vba/vbastyle.cxx
index b99b2e783101..83d72dd99c05 100644
--- a/sc/source/ui/vba/vbastyle.cxx
+++ b/sc/source/ui/vba/vbastyle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -184,3 +185,5 @@ ScVbaStyle::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx
index c323e2b3f6f6..b07d98e81b80 100644
--- a/sc/source/ui/vba/vbastyles.cxx
+++ b/sc/source/ui/vba/vbastyles.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -180,3 +181,5 @@ ScVbaStyles::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbatextboxshape.cxx b/sc/source/ui/vba/vbatextboxshape.cxx
index 0ef9e0f7393b..b5502fac9aa8 100644
--- a/sc/source/ui/vba/vbatextboxshape.cxx
+++ b/sc/source/ui/vba/vbatextboxshape.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,3 +65,5 @@ ScVbaTextBoxShape::characters( const uno::Any& Start, const uno::Any& Length ) t
ScVbaPalette aPalette( pDoc->GetDocumentShell() );
return new ScVbaCharacters( this, mxContext, aPalette, xSimple, Start, Length, sal_True );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbatextframe.cxx b/sc/source/ui/vba/vbatextframe.cxx
index b06777526c1f..dffbed8b511f 100644
--- a/sc/source/ui/vba/vbatextframe.cxx
+++ b/sc/source/ui/vba/vbatextframe.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,3 +77,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"ScVbaTextFrame",
"ooo.vba.excel.TextFrame" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx
index e2a768549e11..36662c87c598 100644
--- a/sc/source/ui/vba/vbavalidation.cxx
+++ b/sc/source/ui/vba/vbavalidation.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,6 +26,7 @@
*
************************************************************************/
#include "vbavalidation.hxx"
+#include "vbaformatcondition.hxx"
#include <com/sun/star/sheet/XSheetCondition.hpp>
#include <com/sun/star/sheet/ValidationType.hpp>
#include <com/sun/star/sheet/ValidationAlertStyle.hpp>
@@ -225,8 +227,10 @@ ScVbaValidation::Delete( ) throw (uno::RuntimeException)
lcl_setValidationProps( m_xRange, xProps );
}
+
+// Fix the defect that validatation cannot work when the input should be limited between a lower bound and an upper bound
void SAL_CALL
-ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const uno::Any& /*Operator*/, const uno::Any& Formula1, const uno::Any& Formula2 ) throw (uno::RuntimeException)
+ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const uno::Any& Operator, const uno::Any& Formula1, const uno::Any& Formula2 ) throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) );
uno::Reference< sheet::XSheetCondition > xCond( xProps, uno::UNO_QUERY_THROW );
@@ -291,6 +295,13 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un
xProps->setPropertyValue( ALERTSTYLE, uno::makeAny( eStyle ) );
+ //2009-11-11 fix the defect that validatation cannot work when the input should be limited between a lower bound and an upper bound
+ if ( Operator.hasValue() )
+ {
+ css::sheet::ConditionOperator conOperator = ScVbaFormatCondition::retrieveAPIOperator( Operator );
+ xCond->setOperator( conOperator );
+ }
+ //2009-11-11
if ( sFormula1.getLength() )
xCond->setFormula1( sFormula1 );
if ( sFormula2.getLength() )
@@ -331,3 +342,5 @@ ScVbaValidation::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index 10dad39341b7..a31d348ff7c8 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -856,3 +857,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"ScVbaWindow",
"ooo.vba.excel.Window" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx
index e21ca2c53090..f7a3e6acb589 100644
--- a/sc/source/ui/vba/vbawindows.cxx
+++ b/sc/source/ui/vba/vbawindows.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -257,3 +258,5 @@ ScVbaWindows::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 28469c4685a2..3e9fa27443cb 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,6 +37,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <ooo/vba/excel/XlFileFormat.hpp>
+#include <ooo/vba/excel/XApplication.hpp> //liuchen 2009-12-16
#include "scextopt.hxx"
#include "vbaworksheet.hxx"
@@ -125,7 +127,7 @@ ScVbaWorkbook::Colors( const ::uno::Any& Index ) throw (::script::BasicErrorExce
}
::sal_Int32 SAL_CALL
-ScVbaWorkbook::FileFormat( ) throw (::script::BasicErrorException, ::uno::RuntimeException)
+ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException)
{
sal_Int32 aFileFormat = 0;
rtl::OUString aFilterName;
@@ -185,6 +187,24 @@ ScVbaWorkbook::FileFormat( ) throw (::script::BasicErrorException, ::uno::Runti
return aFileFormat;
}
+//VBA by minz@cn.ibm.com. Convert Excel fileformat to OO file filter
+::rtl::OUString ScVbaWorkbook::convertFileFormat(sal_Int32 aFileFormat)
+{
+ rtl::OUString aFilterName;
+
+ switch(aFileFormat)
+ {
+ case excel::XlFileFormat::xlCSV:
+ aFilterName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text - txt - csv (StarCalc)" ) );
+ break;
+ case excel::XlFileFormat::xlExcel9795:
+ aFilterName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MS Excel 97" ) );
+ break;
+ }
+
+ return aFilterName;
+}
+
void
ScVbaWorkbook::init()
{
@@ -264,6 +284,12 @@ ScVbaWorkbook::Activate() throw (uno::RuntimeException)
VbaDocumentBase::Activate();
}
+void
+ScVbaWorkbook::Protect( const uno::Any &aPassword ) throw (uno::RuntimeException)
+{
+ VbaDocumentBase::Protect( aPassword );
+}
+
::sal_Bool
ScVbaWorkbook::getProtectStructure() throw (uno::RuntimeException)
{
@@ -299,6 +325,50 @@ ScVbaWorkbook::SaveCopyAs( const rtl::OUString& sFileName ) throw ( uno::Runtime
xStor->storeToURL( aURL, storeProps );
}
+//VBA by minz@cn.ibm.com. Add Workbook.SaveAs.
+void
+ScVbaWorkbook::SaveAs( const rtl::OUString& FileName, const uno::Any& FileFormat, const uno::Any& /*CreateBackup*/ ) throw ( uno::RuntimeException)
+{
+ rtl::OUString aURL;
+ osl::FileBase::getFileURLFromSystemPath( FileName, aURL );
+ //liuchen 2009-12-16 if the input parameter "FileName" takes the form as "MyFile", we need to get the current directory and combine the current directory and the file name
+ INetURLObject aFileNameURL( aURL );
+ aURL = aFileNameURL.GetMainURL( INetURLObject::NO_DECODE );
+ if ( aURL.getLength() == 0 )
+ {
+ uno::Reference< excel::XApplication > xApplication ( Application(),uno::UNO_QUERY_THROW );
+ rtl::OUString aPathStr = xApplication->getDefaultFilePath();
+ rtl::OUString aPathURLStr;
+ osl::FileBase::getFileURLFromSystemPath( aPathStr, aPathURLStr );
+ INetURLObject aPathURL( aPathURLStr );
+ aPathURL.Append( FileName );
+ aURL = aPathURL.GetMainURL( INetURLObject::NO_DECODE );
+ }
+ //liuchen 2009-12-16
+ uno::Reference< frame::XStorable > xStor( getModel(), uno::UNO_QUERY_THROW );
+
+ sal_Int32 aFileFormat = excel::XlFileFormat::xlExcel9795;
+ FileFormat >>= aFileFormat;
+
+ if ( FileName.indexOf('.') == -1 )
+ {
+ if ( aFileFormat == excel::XlFileFormat::xlExcel9795 )
+ {
+ aURL = aURL + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".xls" ) );
+ }
+ else if ( aFileFormat == excel::XlFileFormat::xlCSV )
+ {
+ aURL = aURL + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".csv" ) );
+ }
+ }
+
+ uno::Sequence< beans::PropertyValue > storeProps(1);
+ storeProps[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
+ storeProps[0].Value <<= convertFileFormat(aFileFormat);
+
+ xStor->storeAsURL( aURL, storeProps );
+}
+
css::uno::Any SAL_CALL
ScVbaWorkbook::Styles( const::uno::Any& Item ) throw (uno::RuntimeException)
{
@@ -361,3 +431,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"ScVbaWorkbook",
"ooo.vba.excel.Workbook" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworkbook.hxx b/sc/source/ui/vba/vbaworkbook.hxx
index 4aff58078403..a5ccea180dd3 100644
--- a/sc/source/ui/vba/vbaworkbook.hxx
+++ b/sc/source/ui/vba/vbaworkbook.hxx
@@ -41,6 +41,8 @@ class ScVbaWorkbook : public ScVbaWorkbook_BASE
static css::uno::Sequence< sal_Int32 > ColorData;
void initColorData( const css::uno::Sequence< sal_Int32 >& sColors );
void init();
+
+ ::rtl::OUString convertFileFormat(sal_Int32 aFileFormat);
protected:
ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext);
@@ -61,20 +63,25 @@ public:
virtual css::uno::Any SAL_CALL Sheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Windows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Protect( const css::uno::Any & aPassword ) throw (css::uno::RuntimeException);
// Amelia Wang
virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Styles( const css::uno::Any& Item ) throw (css::uno::RuntimeException);
virtual void SAL_CALL ResetColors( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Colors( const css::uno::Any& Index ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL FileFormat( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getFileFormat( ) throw (css::uno::RuntimeException);
virtual void SAL_CALL SaveCopyAs( const rtl::OUString& Filename ) throw ( css::uno::RuntimeException);
+ virtual void SAL_CALL SaveAs( const rtl::OUString& FileName, const css::uno::Any& FileFormat, const css::uno::Any& CreateBackup ) throw (css::uno::RuntimeException);
+
// code name
virtual ::rtl::OUString SAL_CALL getCodeName() throw ( css::uno::RuntimeException);
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+
+ virtual css::uno::Reference< css::frame::XModel > getDocModel() { return mxModel; }
};
#endif /* SC_VBA_WORKBOOK_HXX */
diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx
index 7efee1505dcb..67de260af9aa 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -365,3 +366,5 @@ ScVbaWorkbooks::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index d76aa7bd612e..ca00ef9ee495 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,6 +64,7 @@
#include <ooo/vba/excel/XlEnableSelection.hpp>
#include <ooo/vba/excel/XWorkbook.hpp>
#include <ooo/vba/XControlProvider.hpp>
+#include <ooo/vba/excel/XlSheetVisibility.hpp>
#include <comphelper/processfactory.hxx>
#include <vbahelper/vbashapes.hxx>
@@ -80,7 +82,7 @@
#include "cellsuno.hxx"
#include "drwlayer.hxx"
-
+#include "tabprotection.hxx"
#include "scextopt.hxx"
#include "vbaoutline.hxx"
#include "vbarange.hxx"
@@ -94,6 +96,7 @@
#include "vbaworksheets.hxx"
#include "vbahyperlinks.hxx"
#include "vbasheetobjects.hxx"
+#include "viewuno.hxx" //liuchen 2009-9-2
#define STANDARDWIDTH 2267
#define STANDARDHEIGHT 427
@@ -221,7 +224,7 @@ ScVbaWorksheet::setName(const ::rtl::OUString &rName ) throw (uno::RuntimeExcept
xNamed->setName( rName );
}
-sal_Bool
+::sal_Int32
ScVbaWorksheet::getVisible() throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps( getSheet(), uno::UNO_QUERY_THROW );
@@ -229,13 +232,33 @@ ScVbaWorksheet::getVisible() throw (uno::RuntimeException)
(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ) );
sal_Bool bRet = false;
aValue >>= bRet;
- return bRet;
+ if ( bRet )
+ {
+ return excel::XlSheetVisibility::xlSheetVisible;
+ }
+ else
+ {
+ return excel::XlSheetVisibility::xlSheetHidden;
+ }
}
void
-ScVbaWorksheet::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
+ScVbaWorksheet::setVisible( ::sal_Int32 _Visible ) throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps( getSheet(), uno::UNO_QUERY_THROW );
+
+ //VBA by minz@cn.ibm.com.
+ sal_Bool bVisible = true;
+ switch( _Visible )
+ {
+ case excel::XlSheetVisibility::xlSheetHidden:
+ case excel::XlSheetVisibility::xlSheetVeryHidden:
+ bVisible = false;
+ break;
+ case excel::XlSheetVisibility::xlSheetVisible:
+ bVisible = true;
+ break;
+ }
uno::Any aValue( bVisible );
xProps->setPropertyValue
(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ), aValue);
@@ -427,6 +450,18 @@ ScVbaWorksheet::getProtectContents()throw (uno::RuntimeException)
sal_Bool
ScVbaWorksheet::getProtectDrawingObjects() throw (uno::RuntimeException)
{
+ SCTAB nTab = 0;
+ rtl::OUString aSheetName = getName();
+ uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( getModel(), uno::UNO_QUERY_THROW );
+ bool bSheetExists = ScVbaWorksheets::nameExists (xSpreadDoc, aSheetName, nTab);
+ if ( bSheetExists )
+ {
+ uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
+ ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
+ ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+ if ( pProtect )
+ return pProtect->isOptionEnabled( ScTableProtection::OBJECTS );
+ }
return sal_False;
}
@@ -444,10 +479,30 @@ ScVbaWorksheet::Activate() throw (uno::RuntimeException)
xSpreadsheet->setActiveSheet(getSheet());
}
+//liuchen 2009-9-2, support expand (but not replace) the active sheet
void
-ScVbaWorksheet::Select() throw (uno::RuntimeException)
+ScVbaWorksheet::Select(const css::uno::Any& aReplace) throw (uno::RuntimeException)
{
- Activate();
+ sal_Bool bReplace = true;
+ if (aReplace.hasValue() && aReplace.getValueTypeClass() == uno::TypeClass_BOOLEAN)
+ {
+ aReplace >>= bReplace;
+ }
+
+ uno::Reference< sheet::XSpreadsheetView > xSpreadsheet(
+ getModel()->getCurrentController(), uno::UNO_QUERY_THROW );
+ ScTabViewObj* pTabView = static_cast< ScTabViewObj* >( xSpreadsheet.get() );
+
+ if (bReplace)
+ {
+ pTabView->selectSheet(getSheet(), false);
+ }
+ else
+ {
+ uno::Reference< sheet::XSpreadsheet > xOldActiveSheet = pTabView->getActiveSheet();
+ pTabView->selectSheet(getSheet(), true);
+ pTabView->selectSheet(xOldActiveSheet, true);
+ }
}
void
@@ -509,18 +564,42 @@ ScVbaWorksheet::Copy( const uno::Any& Before, const uno::Any& After ) throw (uno
return;
}
- uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( getModel(), uno::UNO_QUERY );
+ ScVbaWorksheet* pDestSheet = static_cast< ScVbaWorksheet* >(xSheet.get());
+ uno::Reference <sheet::XSpreadsheetDocument> xDestDoc( pDestSheet->getModel(), uno::UNO_QUERY );
+ uno::Reference <sheet::XSpreadsheetDocument> xSrcDoc( getModel(), uno::UNO_QUERY );
+
SCTAB nDest = 0;
+ SCTAB nSrc = 0;
rtl::OUString aSheetName = xSheet->getName();
- if ( ScVbaWorksheets::nameExists (xSpreadDoc, aSheetName, nDest ) )
+ bool bSameDoc = ( pDestSheet->getModel() == getModel() );
+ bool bDestSheetExists = ScVbaWorksheets::nameExists (xDestDoc, aSheetName, nDest );
+ bool bSheetExists = ScVbaWorksheets::nameExists (xSrcDoc, aCurrSheetName, nSrc );
+
+ // set sheet name to be newSheet name
+ aSheetName = aCurrSheetName;
+ SCTAB nDummy=0;
+ if ( bSheetExists && bDestSheetExists )
{
sal_Bool bAfter = After.hasValue();
if(bAfter)
nDest++;
- uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
- getNewSpreadsheetName(aSheetName,aCurrSheetName,xSpreadDoc);
- xSheets->copyByName(aCurrSheetName,aSheetName,nDest);
+ uno::Reference<sheet::XSpreadsheets> xSheets = xDestDoc->getSheets();
+ if ( bSameDoc || ScVbaWorksheets::nameExists( xDestDoc, aCurrSheetName, nDummy ) )
+ getNewSpreadsheetName(aSheetName,aCurrSheetName,xDestDoc);
+ if ( bSameDoc )
+ xSheets->copyByName(aCurrSheetName,aSheetName,nDest);
+ else
+ {
+ ScDocShell* pDestDocShell = excel::getDocShell( pDestSheet->getModel() );
+ ScDocShell* pSrcDocShell = excel::getDocShell( getModel() );
+ if ( pDestDocShell && pSrcDocShell )
+ pDestDocShell->TransferTab( *pSrcDocShell, static_cast<SCTAB>(nSrc), static_cast<SCTAB>(nDest), TRUE, TRUE );
+ }
}
+ // active the new sheet
+ uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW );
+ uno::Reference< excel::XWorksheet > xNewSheet( xApplication->Worksheets( uno::makeAny( aSheetName ) ), uno::UNO_QUERY_THROW );
+ xNewSheet->Activate();
}
@@ -572,13 +651,25 @@ ScVbaWorksheet::getSheetAtOffset(SCTAB offset) throw (uno::RuntimeException)
uno::Reference< excel::XWorksheet >
ScVbaWorksheet::getNext() throw (uno::RuntimeException)
{
- return getSheetAtOffset(static_cast<SCTAB>(1));
+ //VBA, minz@cn.ibm.com. catch the exception for index out of bound
+ try{
+ return getSheetAtOffset(static_cast<SCTAB>(1));
+ }catch( lang::IndexOutOfBoundsException& /*e*/ )
+ {
+ return NULL;
+ }
}
uno::Reference< excel::XWorksheet >
ScVbaWorksheet::getPrevious() throw (uno::RuntimeException)
{
- return getSheetAtOffset(-1);
+ //VBA, minz@cn.ibm.com. catch the exception for index out of bound
+ try{
+ return getSheetAtOffset(-1);
+ }catch( lang::IndexOutOfBoundsException& /*e*/ )
+ {
+ return NULL;
+ }
}
@@ -662,7 +753,7 @@ ScVbaWorksheet::ChartObjects( const uno::Any& Index ) throw (uno::RuntimeExcepti
uno::Reference< table::XTableChartsSupplier > xChartSupplier( getSheet(), uno::UNO_QUERY_THROW );
uno::Reference< table::XTableCharts > xTableCharts = xChartSupplier->getCharts();
- uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( mxSheet, uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( getSheet(), uno::UNO_QUERY_THROW ); //VBA, minz@cn.ibm.com.
mxCharts = new ScVbaChartObjects( this, mxContext, xTableCharts, xDrawPageSupplier );
}
if ( Index.hasValue() )
@@ -981,7 +1072,7 @@ ScVbaWorksheet::getCodeName() throw (css::uno::RuntimeException)
sal_Int16
ScVbaWorksheet::getSheetID() throw (uno::RuntimeException)
{
- uno::Reference< sheet::XCellRangeAddressable > xAddressable( mxSheet, uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XCellRangeAddressable > xAddressable( getSheet(), uno::UNO_QUERY_THROW ); //VBA. minz@cn.ibm.com. if ActiveSheet, mxSheet is null.
return xAddressable->getRangeAddress().Sheet;
}
@@ -1017,3 +1108,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"ScVbaWorksheet",
"ooo.vba.excel.Worksheet" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworksheet.hxx b/sc/source/ui/vba/vbaworksheet.hxx
index 78bcc2503a49..adcfd4af16fa 100644
--- a/sc/source/ui/vba/vbaworksheet.hxx
+++ b/sc/source/ui/vba/vbaworksheet.hxx
@@ -42,6 +42,7 @@
#include <ooo/vba/excel/XPageSetup.hpp>
#include <ooo/vba/excel/XHPageBreaks.hpp>
#include <ooo/vba/excel/XVPageBreaks.hpp>
+#include <com/sun/star/container/XNamed.hpp>
#include <vbahelper/vbahelperinterface.hxx>
#include "address.hxx"
@@ -91,8 +92,8 @@ public:
// Attributes
virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
virtual void SAL_CALL setName( const ::rtl::OUString &rName ) throw (css::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
- virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( ::sal_Int32 _Visible ) throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getStandardWidth() throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getStandardHeight() throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getProtectionMode() throw (css::uno::RuntimeException);
@@ -115,7 +116,7 @@ public:
// Methods
virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
- virtual void SAL_CALL Select() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Select(const css::uno::Any& aReplace) throw (css::uno::RuntimeException); //liuchen 2009-9-2, add the input parameter to support expand selection
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Move( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException) ;
virtual void SAL_CALL Copy( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException);
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
index 7fa5196a6b04..cb345950958b 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -499,3 +500,5 @@ ScVbaWorksheets::getServiceNames()
}
return false;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbawsfunction.cxx b/sc/source/ui/vba/vbawsfunction.cxx
index 60daa7303f2e..b87ec852b9a5 100644
--- a/sc/source/ui/vba/vbawsfunction.cxx
+++ b/sc/source/ui/vba/vbawsfunction.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,6 +61,18 @@ void lclConvertDoubleToBoolean( uno::Any& rAny )
}
}
+void lclConvertBooleanToDouble( uno::Any& rAny )
+{
+ sal_Bool bValue( sal_False );
+ if ( rAny >>= bValue )
+ {
+ if ( bValue )
+ rAny <<= double( 1.0 );
+ else
+ rAny <<= double( 0.0 );
+ }
+}
+
} // namespace
ScVbaWSFunction::ScVbaWSFunction( const uno::Reference< XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) :
@@ -84,9 +97,57 @@ ScVbaWSFunction::invoke(const rtl::OUString& FunctionName, const uno::Sequence<
uno::Any* pArrayEnd = pArray + aParamTemp.getLength();
for( ; pArray < pArrayEnd; ++pArray )
{
- uno::Reference< excel::XRange > myRange( *pArray, uno::UNO_QUERY );
- if( myRange.is() )
- *pArray = myRange->getCellRange();
+ switch( pArray->getValueType().getTypeClass() )
+ {
+ case uno::TypeClass_BOOLEAN:
+ lclConvertBooleanToDouble( *pArray );
+ break;
+ case uno::TypeClass_INTERFACE:
+ {
+ uno::Reference< excel::XRange > myRange( *pArray, uno::UNO_QUERY );
+ if( myRange.is() )
+ *pArray = myRange->getCellRange();
+ }
+ break;
+ case uno::TypeClass_SEQUENCE:
+ {
+ // the sheet.FunctionAccess service doesn't deal with Sequences, only Sequences of Sequence
+ uno::Type aType = pArray->getValueType();
+ if ( aType.equals( getCppuType( (uno::Sequence<sal_Int16>*)0 ) ) )
+ {
+ uno::Sequence< uno::Sequence< sal_Int16 > > aTmp(1);
+ (*pArray) >>= aTmp[ 0 ];
+ (*pArray) <<= aTmp;
+ }
+ else if ( aType.equals( getCppuType( (uno::Sequence<sal_Int32>*)0 ) ) )
+ {
+ uno::Sequence< uno::Sequence< sal_Int32 > > aTmp(1);
+ (*pArray) >>= aTmp[ 0 ];
+ (*pArray) <<= aTmp;
+ }
+ else if ( aType.equals( getCppuType( (uno::Sequence<double>*)0 ) ) )
+ {
+ uno::Sequence< uno::Sequence< double > > aTmp(1);
+ (*pArray) >>= aTmp[ 0 ];
+ (*pArray) <<= aTmp;
+ }
+ else if ( aType.equals( getCppuType( (uno::Sequence<rtl::OUString>*)0 ) ) )
+ {
+ uno::Sequence< uno::Sequence< rtl::OUString > > aTmp(1);
+ (*pArray) >>= aTmp[ 0 ];
+ (*pArray) <<= aTmp;
+ }
+ else if ( aType.equals( getCppuType( (uno::Sequence<uno::Any>*)0 ) ) )
+ {
+ uno::Sequence< uno::Sequence<uno::Any > > aTmp(1);
+ (*pArray) >>= aTmp[ 0 ];
+ (*pArray) <<= aTmp;
+ }
+ }
+ break;
+ default:
+ break;
+ }
OSL_TRACE("Param[%d] is %s", (int)(pArray - aParamTemp.getConstArray()), rtl::OUStringToOString( comphelper::anyToString( *pArray ), RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
@@ -257,3 +318,5 @@ ScVbaWSFunction::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx
index 2c80c154759d..115055b2f136 100644
--- a/sc/source/ui/view/auditsh.cxx
+++ b/sc/source/ui/view/auditsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -153,3 +154,4 @@ void ScAuditingShell::GetState( SfxItemSet& rSet )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellmergeoption.cxx b/sc/source/ui/view/cellmergeoption.cxx
index da531966cb19..ff5220ec907e 100644
--- a/sc/source/ui/view/cellmergeoption.cxx
+++ b/sc/source/ui/view/cellmergeoption.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,3 +73,5 @@ ScRange ScCellMergeOption::getFirstSingleRange() const
return getSingleRange(nTab);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index c880a29f8067..7cfa50a4e686 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1003,3 +1004,4 @@ void ScCellShell::GetState(SfxItemSet &rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index de05496a12d8..750d3648631e 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2193,3 +2194,5 @@ void ScCellShell::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTa
}
pTabViewShell->CellContentChanged(); // => PasteFromSystem() ???
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 2e318a920898..c619e34309fe 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -334,6 +335,20 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
break;
+ case SID_DATA_FORM:
+ {
+ ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+
+ AbstractScDataFormDlg* pDlg = pFact->CreateScDataFormDlg( pTabViewShell->GetDialogParent(),RID_SCDLG_DATAFORM, pTabViewShell);
+ DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+
+ pDlg->Execute();
+
+ rReq.Done();
+ }
+ break;
+
case SID_SUBTOTALS:
{
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -1401,3 +1416,4 @@ void __EXPORT ScCellShell::GetDBState( SfxItemSet& rSet )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index bd74d7794e65..a57835fdf54d 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -928,3 +929,4 @@ void ScCellShell::Execute( SfxRequest& rReq )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx
index bd4708805a7d..f5c4e70ae98a 100644
--- a/sc/source/ui/view/cellsh4.cxx
+++ b/sc/source/ui/view/cellsh4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -452,3 +453,4 @@ void ScCellShell::ExecutePage( SfxRequest& rReq )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx
index f2322f6de317..c94e08803594 100644
--- a/sc/source/ui/view/colrowba.cxx
+++ b/sc/source/ui/view/colrowba.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -415,3 +416,4 @@ BOOL ScRowBar::IsMirrored() // overloaded only for rows
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index b1969fbcdf70..299a7d665c2d 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -511,3 +512,4 @@ BOOL ScDBFunc::ImportData( const ScImportParam& rParam, BOOL bRecord )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/dbfunc2.cxx b/sc/source/ui/view/dbfunc2.cxx
index 54ddde9b7710..f789daea996d 100644
--- a/sc/source/ui/view/dbfunc2.cxx
+++ b/sc/source/ui/view/dbfunc2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,3 +76,4 @@ void ScDBFunc::UpdateCharts( BOOL bAllCharts )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 9004c5fc486f..2c2df72120fa 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2369,3 +2370,5 @@ void ScDBFunc::RepeatDB( BOOL bRecord )
else // "Keine Operationen auszufuehren"
ErrorMessage(STR_MSSG_REPEATDB_0);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/dbfunc4.cxx b/sc/source/ui/view/dbfunc4.cxx
index 870622293e37..a96dc2970875 100644
--- a/sc/source/ui/view/dbfunc4.cxx
+++ b/sc/source/ui/view/dbfunc4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -100,3 +101,4 @@ USHORT ScDBFunc::DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, BOOL b
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawattr.cxx b/sc/source/ui/view/drawattr.cxx
index fa7872617c03..36615b14525d 100644
--- a/sc/source/ui/view/drawattr.cxx
+++ b/sc/source/ui/view/drawattr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,3 +81,4 @@ SfxPoolItem* __EXPORT SvxDrawToolItem::Create( SvStream& rStream, USHORT nVer )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx
index ba250767c169..4270170e099a 100644
--- a/sc/source/ui/view/drawutil.cxx
+++ b/sc/source/ui/view/drawutil.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,3 +115,4 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawvie2.cxx b/sc/source/ui/view/drawvie2.cxx
index c760ce86a3d7..c047fcdbd6fe 100644
--- a/sc/source/ui/view/drawvie2.cxx
+++ b/sc/source/ui/view/drawvie2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,3 +61,4 @@ void ScDrawView::VCRemoveWin( Window* /* pWin */ )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx
index ffa1efe28654..3ef141f2c526 100644
--- a/sc/source/ui/view/drawvie3.cxx
+++ b/sc/source/ui/view/drawvie3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -180,3 +181,4 @@ void ScDrawView::UpdateIMap( SdrObject* pObj )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 3a28096d2853..c88274d65dab 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -392,3 +393,4 @@ void ScDrawView::SetMarkedOriginalSize()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 8a30a1ce9d39..d47136d8fc51 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -805,3 +806,5 @@ void ScDrawView::MarkDropObj( SdrObject* pObj )
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index e282cbef2881..01e5b5a9a3b1 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1198,3 +1199,4 @@ void ScEditShell::ExecuteTrans( SfxRequest& rReq )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 0e5e7ebb71b9..6b71dbc61514 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2269,3 +2270,5 @@ short ScFormatShell::GetCurrentNumberFormatType()
}
return nType;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/galwrap.cxx b/sc/source/ui/view/galwrap.cxx
index 1d92cb5f303a..2e5f8f831bad 100644
--- a/sc/source/ui/view/galwrap.cxx
+++ b/sc/source/ui/view/galwrap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,3 +78,4 @@ String GalleryGetFilterName()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridmerg.cxx b/sc/source/ui/view/gridmerg.cxx
index 5a1f501e38ca..31dba191b2fd 100644
--- a/sc/source/ui/view/gridmerg.cxx
+++ b/sc/source/ui/view/gridmerg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -172,3 +173,4 @@ void ScGridMerger::Flush()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 4fe8b2435e66..3d11b21e26ec 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -5856,3 +5857,5 @@ void ScGridWindow::flushOverlayManager()
// ---------------------------------------------------------------------------
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 3574426f731b..4aa2b1476759 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -144,7 +145,8 @@ bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent&
// Check if the mouse cursor is clicking on the popup arrow box.
mpFilterButton.reset(new ScDPFieldButton(this, &GetSettings().GetStyleSettings(), &pViewData->GetZoomX(), &pViewData->GetZoomY(), pDoc));
- mpFilterButton->setBoundingBox(aScrPos, aScrSize);
+ mpFilterButton->setBoundingBox(aScrPos, aScrSize, bLayoutRTL);
+ mpFilterButton->setPopupLeft(bLayoutRTL); // #i114944# AutoFilter button is left-aligned in RTL
Point aPopupPos;
Size aPopupSize;
mpFilterButton->getPopupBoundingBox(aPopupPos, aPopupSize);
@@ -367,6 +369,8 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove )
bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, ScDPObject* pDPObj)
{
+ BOOL bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
+
// Get the geometry of the cell.
Point aScrPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), eWhich);
long nSizeX, nSizeY;
@@ -375,7 +379,8 @@ bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddres
// Check if the mouse cursor is clicking on the popup arrow box.
ScDPFieldButton aBtn(this, &GetSettings().GetStyleSettings());
- aBtn.setBoundingBox(aScrPos, aScrSize);
+ aBtn.setBoundingBox(aScrPos, aScrSize, bLayoutRTL);
+ aBtn.setPopupLeft(false); // DataPilot popup is always right-aligned for now
Point aPopupPos;
Size aPopupSize;
aBtn.getPopupBoundingBox(aPopupPos, aPopupSize);
@@ -516,9 +521,16 @@ void ScGridWindow::DPLaunchFieldPopupMenu(
}
}
+ BOOL bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
+
Rectangle aCellRect(rScrPos, rScrSize);
const Size& rPopupSize = mpDPFieldPopup->getWindowSize();
- if (rScrSize.getWidth() > rPopupSize.getWidth())
+ if (bLayoutRTL)
+ {
+ // RTL: rScrPos is logical-left (visual right) position, always right-align with that
+ aCellRect.SetPos(Point(rScrPos.X() - rPopupSize.Width() + 1, rScrPos.Y()));
+ }
+ else if (rScrSize.getWidth() > rPopupSize.getWidth())
{
// If the cell width is larger than the popup window width, launch it
// right-aligned with the cell.
@@ -1044,3 +1056,4 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, BOOL bUp )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index f16c2fe1ada7..9d220008907e 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -441,3 +442,4 @@ void ScGridWindow::DrawMarkDropObj( SdrObject* pObj )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index c596e7e62c79..f86f79a1d25a 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1275,7 +1276,8 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2
pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
Point aScrPos = pViewData->GetScrPos( nCol, nRow, eWhich );
- aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1));
+ aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1), bLayoutRTL);
+ aCellBtn.setPopupLeft(bLayoutRTL); // #i114944# AutoFilter button is left-aligned in RTL
aCellBtn.setDrawBaseButton(false);
aCellBtn.setDrawPopupButton(true);
aCellBtn.setHasHiddenMember(bArrowState);
@@ -1299,17 +1301,13 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2
pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
long nPosX = aScrPos.X();
long nPosY = aScrPos.Y();
- if ( bLayoutRTL )
- {
- // overwrite the right, not left (visually) grid as long as the
- // left/right colors of the button borders aren't mirrored.
- nPosX -= nSizeX - 2;
- }
+ // bLayoutRTL is handled in setBoundingBox
String aStr;
pDoc->GetString(nCol, nRow, nTab, aStr);
aCellBtn.setText(aStr);
- aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1));
+ aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1), bLayoutRTL);
+ aCellBtn.setPopupLeft(false); // DataPilot popup is always right-aligned for now
aCellBtn.setDrawBaseButton(true);
aCellBtn.setDrawPopupButton(pInfo->bPopupButton);
aCellBtn.setHasHiddenMember(pInfo->bFilterActive);
@@ -1984,3 +1982,4 @@ void ScGridWindow::DataChanged( const DataChangedEvent& rDCEvt )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 4a9dbbaf98b6..1e4c09fd8c6b 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -343,14 +344,12 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) )
pObj = pHit;
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
{
aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
aHelpText = pInfo->GetHlink();
}
-#endif
}
}
}
@@ -437,3 +436,5 @@ com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
return xAccessible;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index 25f3c1c8f10a..f4a9fd4ddac2 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1044,3 +1045,4 @@ void ScHeaderControl::SetMarking( BOOL /* bSet */ )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index 568923f42838..301ba616e769 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -106,3 +107,5 @@ void __EXPORT ScHintWindow::Paint( const Rectangle& /* rRect */ )
aLineStart.Y() += nTextHeight;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/imapwrap.cxx b/sc/source/ui/view/imapwrap.cxx
index b2f4fb714775..88e78ccf1ee6 100644
--- a/sc/source/ui/view/imapwrap.cxx
+++ b/sc/source/ui/view/imapwrap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,4 @@ const ImageMap& ScIMapDlgGetMap( SvxIMapDlg* pDlg )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/invmerge.cxx b/sc/source/ui/view/invmerge.cxx
index a895dc5faec0..cb913677e962 100644
--- a/sc/source/ui/view/invmerge.cxx
+++ b/sc/source/ui/view/invmerge.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -190,3 +191,4 @@ void ScInvertMerger::AddRect( const Rectangle& rRect )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx
index 065ba5899817..3ab921f8956e 100644
--- a/sc/source/ui/view/notemark.cxx
+++ b/sc/source/ui/view/notemark.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -198,3 +199,4 @@ void ScNoteMarker::InvalidateWin()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx
index b1e82fd9217f..9fd8e497d3b7 100644
--- a/sc/source/ui/view/olinewin.cxx
+++ b/sc/source/ui/view/olinewin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1043,3 +1044,4 @@ void ScOutlineWindow::KeyInput( const KeyEvent& rKEvt )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/olkact.cxx b/sc/source/ui/view/olkact.cxx
index 248777f4e473..a5f63f5a15bd 100644
--- a/sc/source/ui/view/olkact.cxx
+++ b/sc/source/ui/view/olkact.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -280,3 +281,4 @@ void DeActivateOlk( ScViewData* /* pViewData */ )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 38622bf18752..2cf8bab95e61 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2479,3 +2480,4 @@ void ScOutputData::DrawClipMarks()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 74724b45b5be..32e3c6d9e0ab 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,7 +82,7 @@
#include <math.h>
//! Autofilter-Breite mit column.cxx zusammenfassen
-#define DROPDOWN_BITMAP_SIZE 17
+#define DROPDOWN_BITMAP_SIZE 18
#define DRAWTEXT_MAX 32767
@@ -1306,7 +1307,8 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
( static_cast<const ScMergeFlagAttr&>(rPattern.GetItem(ATTR_MERGE_FLAG)).GetValue() & SC_MF_AUTO ) &&
( !bBreak || pRefDevice == pFmtDevice ) )
{
- long nFilter = Min( nMergeSizeY, (long) DROPDOWN_BITMAP_SIZE );
+ // filter drop-down width is now independent from row height
+ const long nFilter = DROPDOWN_BITMAP_SIZE;
BOOL bFit = ( nNeeded + nFilter <= nMergeSizeX );
if ( bFit || bCellIsValue )
{
@@ -3731,20 +3733,11 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
eOrient!=SVX_ORIENTATION_STACKED &&
pInfo && pInfo->bAutoFilter)
{
- if (pRowInfo[nArrY].nHeight < DROPDOWN_BITMAP_SIZE)
- {
- if (bPixelToLogic)
- nAvailWidth -= pRefDevice->PixelToLogic(Size(0,pRowInfo[nArrY].nHeight)).Height();
- else
- nAvailWidth -= pRowInfo[nArrY].nHeight;
- }
+ // filter drop-down width is now independent from row height
+ if (bPixelToLogic)
+ nAvailWidth -= pRefDevice->PixelToLogic(Size(0,DROPDOWN_BITMAP_SIZE)).Height();
else
- {
- if (bPixelToLogic)
- nAvailWidth -= pRefDevice->PixelToLogic(Size(0,DROPDOWN_BITMAP_SIZE)).Height();
- else
- nAvailWidth -= DROPDOWN_BITMAP_SIZE;
- }
+ nAvailWidth -= DROPDOWN_BITMAP_SIZE;
long nComp = nEngineWidth;
if (nAvailWidth<nComp) nAvailWidth=nComp;
}
@@ -3917,3 +3910,4 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx
index 2c368937e156..b5bb920fb209 100644
--- a/sc/source/ui/view/output3.cxx
+++ b/sc/source/ui/view/output3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -274,3 +275,4 @@ void ScOutputData::DrawingSingle(const sal_uInt16 nLayer)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/overlayobject.cxx b/sc/source/ui/view/overlayobject.cxx
index 7f44f451188f..a477f30576b1 100644
--- a/sc/source/ui/view/overlayobject.cxx
+++ b/sc/source/ui/view/overlayobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,3 +103,5 @@ Primitive2DSequence ScOverlayDashedBorder::createOverlayObjectPrimitive2DSequenc
return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx
index 6a206ef3eb13..569e9bf876ad 100644
--- a/sc/source/ui/view/pfuncache.cxx
+++ b/sc/source/ui/view/pfuncache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -194,3 +195,4 @@ long ScPrintFuncCache::GetDisplayStart( SCTAB nTab ) const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/pgbrksh.cxx b/sc/source/ui/view/pgbrksh.cxx
index 0e792b2bb279..e1d493dd3f24 100644
--- a/sc/source/ui/view/pgbrksh.cxx
+++ b/sc/source/ui/view/pgbrksh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,3 +84,4 @@ ScPageBreakShell::~ScPageBreakShell()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx
index d52759f5353e..f23082e1a041 100644
--- a/sc/source/ui/view/pivotsh.cxx
+++ b/sc/source/ui/view/pivotsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -198,3 +199,4 @@ ScDPObject* ScPivotShell::GetCurrDPObject()
rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo() );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 3ab6dc140484..8a504720ea0a 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1611,3 +1612,5 @@ void ScPreview::DrawInvert( long nDragPos, USHORT nFlags )
}
}
//Issue51656 Add resizeable margin on page preview from maoyg
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/prevloc.cxx b/sc/source/ui/view/prevloc.cxx
index 9ddb63a6a6d4..22e24170fba0 100644
--- a/sc/source/ui/view/prevloc.cxx
+++ b/sc/source/ui/view/prevloc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -752,3 +753,4 @@ BOOL ScPreviewLocationData::GetMainCellRange( ScRange& rRange, Rectangle& rPixRe
return FALSE; // not found
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index d12c5492f883..ec316617e20e 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1232,3 +1233,4 @@ ScDocument* ScPreviewShell::GetDocument()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/prevwsh2.cxx b/sc/source/ui/view/prevwsh2.cxx
index 07af90f797aa..6677798f9dcf 100644
--- a/sc/source/ui/view/prevwsh2.cxx
+++ b/sc/source/ui/view/prevwsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -355,3 +356,4 @@ void __EXPORT ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 92434a17d12d..8180c1b8ea1e 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -3200,3 +3201,4 @@ ScJobSetup::ScJobSetup( SfxPrinter* pPrinter )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index 0d5d64964f5c..21d66c5a39be 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -432,3 +433,5 @@ ScValidityRefChildWin::~ScValidityRefChildWin()
pWindow = NULL;
}
//-->Added by PengYunQuan for Validity Cell Range Picker
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/scextopt.cxx b/sc/source/ui/view/scextopt.cxx
index fe5a91f54bd4..c9af56f00d33 100644
--- a/sc/source/ui/view/scextopt.cxx
+++ b/sc/source/ui/view/scextopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -223,3 +224,4 @@ void ScExtDocOptions::SetCodeName( SCTAB nTab, const String& rCodeName )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index 72ee0fdaadfa..292e155c132b 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -890,3 +891,4 @@ ScHeaderSelectionEngine::ScHeaderSelectionEngine( Window* pWindow, ScHeaderFunct
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/selectionstate.cxx b/sc/source/ui/view/selectionstate.cxx
index 0edd50a0b825..3412dd53f03a 100644
--- a/sc/source/ui/view/selectionstate.cxx
+++ b/sc/source/ui/view/selectionstate.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,3 +88,4 @@ bool operator==( const ScSelectionState& rL, const ScSelectionState& rR )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/spelldialog.cxx b/sc/source/ui/view/spelldialog.cxx
index ee13ee9fbf90..f2100ba6d918 100644
--- a/sc/source/ui/view/spelldialog.cxx
+++ b/sc/source/ui/view/spelldialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -277,3 +278,4 @@ bool ScSpellDialogChildWindow::IsSelectionChanged()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx
index ac6288028dfc..457395fd9deb 100644
--- a/sc/source/ui/view/spelleng.cxx
+++ b/sc/source/ui/view/spelleng.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -456,3 +457,4 @@ bool ScTextConversionEngine::NeedsConversion()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index 1048c903ec4a..daea22b78027 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,8 +55,9 @@
//==================================================================
ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) :
- TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_INSERTTAB |
- WB_RANGESELECT | WB_MULTISELECT | WB_DRAG | WB_SIZEABLE ) ),
+ TabBar( pParent,
+ WinBits(WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_RANGESELECT |
+ WB_MULTISELECT | WB_DRAG | WB_SIZEABLE) ),
DropTargetHelper( this ),
DragSourceHelper( this ),
pViewData( pData ),
@@ -94,6 +96,7 @@ ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) :
SetSplitHdl( LINK( pViewData->GetView(), ScTabView, TabBarResize ) );
EnableEditMode();
+ UpdateInputContext();
}
ScTabControl::~ScTabControl()
@@ -297,6 +300,17 @@ void ScTabControl::Select()
}
}
+void ScTabControl::UpdateInputContext()
+{
+ ScDocument* pDoc = pViewData->GetDocument();
+ WinBits nStyle = GetStyle();
+ if (pDoc->GetDocumentShell()->IsReadOnly())
+ // no insert sheet tab for readonly doc.
+ SetStyle((nStyle & ~WB_INSERTTAB));
+ else
+ SetStyle((nStyle | WB_INSERTTAB));
+}
+
void ScTabControl::UpdateStatus()
{
ScDocument* pDoc = pViewData->GetDocument();
@@ -648,3 +662,4 @@ void ScTabControl::Mirror()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabpopsh.cxx b/sc/source/ui/view/tabpopsh.cxx
index f5033d5d0df5..bb610ada84c0 100644
--- a/sc/source/ui/view/tabpopsh.cxx
+++ b/sc/source/ui/view/tabpopsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,3 +71,5 @@ void ScTabPopShell::DummyExec( SfxRequest& rReq )
void ScTabPopShell::DummyState( SfxItemSet& rSet )
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabsplit.cxx b/sc/source/ui/view/tabsplit.cxx
index 0f72e0e73d02..7babaad6d154 100644
--- a/sc/source/ui/view/tabsplit.cxx
+++ b/sc/source/ui/view/tabsplit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,3 +104,4 @@ void ScTabSplitter::SetFixed(BOOL bSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 9fe3800e0ef8..d988338eb62a 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2490,3 +2491,4 @@ void ScTabView::EnableRefInput(BOOL bFlag)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index ce068e0ef6b2..91e5cc3cc96a 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1280,3 +1281,4 @@ void ScTabView::UpdatePageBreakData( BOOL bForcePaint )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 983113760bb9..bffd30928982 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1419,9 +1420,11 @@ void ScTabView::MarkRange( const ScRange& rRange, BOOL bSetCursor, BOOL bContinu
{
SCCOL nAlignX = rRange.aStart.Col();
SCROW nAlignY = rRange.aStart.Row();
- if ( rRange.aStart.Col() == 0 && rRange.aEnd.Col() == MAXCOL )
+ bool bCol = ( rRange.aStart.Col() == 0 && rRange.aEnd.Col() == MAXCOL ) && !aViewData.GetDocument()->IsInVBAMode();
+ bool bRow = ( rRange.aStart.Row() == 0 && rRange.aEnd.Row() == MAXROW );
+ if ( bCol )
nAlignX = aViewData.GetPosX(WhichH(aViewData.GetActivePart()));
- if ( rRange.aStart.Row() == 0 && rRange.aEnd.Row() == MAXROW )
+ if ( bRow )
nAlignY = aViewData.GetPosY(WhichV(aViewData.GetActivePart()));
AlignToCursor( nAlignX, nAlignY, SC_FOLLOW_JUMP );
}
@@ -1535,6 +1538,7 @@ void ScTabView::SetTabNo( SCTAB nTab, BOOL bNew, BOOL bExtendSelection )
// nicht InputEnterHandler wegen Referenzeingabe !
ScDocument* pDoc = aViewData.GetDocument();
+
pDoc->MakeTable( nTab );
// Update pending row heights before switching the sheet, so Reschedule from the progress bar
@@ -2610,6 +2614,9 @@ void ScTabView::UpdateInputContext()
ScGridWindow* pWin = pGridWin[aViewData.GetActivePart()];
if (pWin)
pWin->UpdateInputContext();
+
+ if (pTabControl)
+ pTabControl->UpdateInputContext();
}
// GetGridWidth - Breite eines Ausgabebereichs (fuer ViewData)
@@ -2709,3 +2716,4 @@ void ScTabView::CheckNeedsRepaint()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index 00652e2f76d2..13ef6ca977b0 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -563,3 +564,4 @@ void ScTabView::InterpretVisible()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index c19efabad2f3..b23d252248b2 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -712,3 +713,4 @@ void ScTabView::ResetBrushDocument()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx
index 2fc2bba072d9..d5e166d121a7 100644
--- a/sc/source/ui/view/tabvwsh.cxx
+++ b/sc/source/ui/view/tabvwsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -115,3 +116,5 @@ IMPL_LINK( ScTabViewShell, HtmlOptionsHdl, void*, EMPTYARG )
GetViewFrame()->GetBindings().Invalidate(SID_DRAW_TEXT_MARQUEE);
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index 26e040ede0b0..81a011516cbd 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -478,3 +479,4 @@ BOOL ScTabViewShell::SelectObject( const String& rName )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 5f98cf3e1cb1..7eb78c81d003 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1233,3 +1234,4 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 7b944a32efe0..56e51c591466 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1762,6 +1763,13 @@ void ScTabViewShell::Construct( BYTE nForceDesignMode )
if ( pDocSh->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
{
SCTAB nInitTabCount = 3; //! konfigurierbar !!!
+ // Get the customized initial tab count, we only can set the count by VBA API currently.
+ const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
+ SCTAB nNewTabCount = rAppOpt.GetTabCountInNewSpreadsheet();
+ if ( nNewTabCount >= 1 && nNewTabCount <= MAXTAB )
+ {
+ nInitTabCount = nNewTabCount;
+ }
for (SCTAB i=1; i<nInitTabCount; i++)
pDoc->MakeTable(i,false);
}
@@ -2049,3 +2057,4 @@ void ScTabViewShell::GetTbxState( SfxItemSet& rSet )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx
index 1a3dd6928a17..c6cb9d5cfb37 100644
--- a/sc/source/ui/view/tabvwsh5.cxx
+++ b/sc/source/ui/view/tabvwsh5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -426,3 +427,4 @@ void ScTabViewShell::UpdateNumberFormatter(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh8.cxx b/sc/source/ui/view/tabvwsh8.cxx
index b3612fa0c6f2..2f4ca5c72bab 100644
--- a/sc/source/ui/view/tabvwsh8.cxx
+++ b/sc/source/ui/view/tabvwsh8.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,3 +103,4 @@ void ScTabViewShell::UIDeactivated( SfxInPlaceClient* pClient )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx
index 30f9c50fd925..3984465f1f50 100644
--- a/sc/source/ui/view/tabvwsh9.cxx
+++ b/sc/source/ui/view/tabvwsh9.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -293,3 +294,4 @@ void ScTabViewShell::GetImageMapState( SfxItemSet& rSet )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index c7f75d161b54..aaa55a4ad596 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -890,3 +891,4 @@ void ScTabViewShell::GetDrawOptState( SfxItemSet& rSet )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 8f4a203ea14d..f650b0bb68cd 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -498,3 +499,4 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 3b0ee60ef4e8..9bd1efdcd521 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -331,3 +332,4 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshd.cxx b/sc/source/ui/view/tabvwshd.cxx
index 4ef5186a25a0..45875808926f 100644
--- a/sc/source/ui/view/tabvwshd.cxx
+++ b/sc/source/ui/view/tabvwshd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -98,3 +99,4 @@ Window* ScTabViewShell::GetDialogParent()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index c0af39226c3f..07be1e04f39f 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -339,3 +340,4 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 5e0630b366f4..f9cd0eb20637 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -964,3 +965,4 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx
index b30b07c43cb9..f7aac8b56da4 100644
--- a/sc/source/ui/view/tabvwshg.cxx
+++ b/sc/source/ui/view/tabvwshg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -138,3 +139,4 @@ void ScTabViewShell::InsertURLButton( const String& rName, const String& rURL,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
index 480514741bae..c462c48abe9c 100644
--- a/sc/source/ui/view/tabvwshh.cxx
+++ b/sc/source/ui/view/tabvwshh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -291,3 +292,4 @@ bool ScTabViewShell::ExecuteRetypePassDlg(ScPasswordHash eDesiredHash)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index c36bcd51271c..4ffb4d6db889 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -3113,3 +3114,5 @@ void ScViewData::AddPixelsWhileBackward( long & rScrY, long nEndPixels,
++nRow;
rPosY = nRow;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index c2b8cf77a420..49f93c43ffac 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,6 +53,11 @@
#include <vcl/sound.hxx>
#include <vcl/waitobj.hxx>
+#include <basic/sbstar.hxx>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/script/XLibraryContainer.hpp>
+using namespace com::sun::star;
+
#include "viewfunc.hxx"
#include "sc.hrc"
@@ -2200,6 +2206,8 @@ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord )
WaitObject aWait( GetFrameWin() );
if (bRecord && !pDoc->IsUndoEnabled())
bRecord = FALSE;
+ if ( bVbaEnabled )
+ bRecord = FALSE;
while ( nNewTab > 0 && !pDoc->IsVisible( nNewTab ) )
--nNewTab;
@@ -2307,6 +2315,7 @@ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord )
pDocSh->PostPaintExtras();
pDocSh->SetDocumentModified();
+
SfxApplication* pSfxApp = SFX_APP(); // Navigator
pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
@@ -2451,8 +2460,8 @@ void ScViewFunc::ImportTables( ScDocShell* pSrcShell,
{
SCTAB nSrcTab = pSrcTabs[i];
SCTAB nDestTab1=nTab+i;
- ULONG nErrVal = pDoc->TransferTab( pSrcDoc, nSrcTab, nDestTab1,
- FALSE ); // no insert
+ ULONG nErrVal = pDocSh->TransferTab( *pSrcShell, nSrcTab, nDestTab1,
+ FALSE, FALSE ); // no insert
switch (nErrVal)
{
@@ -2470,25 +2479,6 @@ void ScViewFunc::ImportTables( ScDocShell* pSrcShell,
break;
}
- // TransferTab doesn't copy drawing objects with bInsertNew=FALSE
- if ( !bError )
- pDoc->TransferDrawPage( pSrcDoc, nSrcTab, nDestTab1 );
-
- if(!bError &&pSrcDoc->IsScenario(nSrcTab))
- {
- String aComment;
- Color aColor;
- USHORT nFlags;
-
- pSrcDoc->GetScenarioData(nSrcTab, aComment,aColor, nFlags);
- pDoc->SetScenario( nDestTab1,TRUE);
- pDoc->SetScenarioData( nTab+i,aComment,aColor,nFlags);
- BOOL bActive = pSrcDoc->IsActiveScenario(nSrcTab );
- pDoc->SetActiveScenario( nDestTab1, bActive );
- BOOL bVisible=pSrcDoc->IsVisible(nSrcTab);
- pDoc->SetVisible(nDestTab1,bVisible );
-
- }
}
if (bLink)
@@ -2672,33 +2662,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy )
nDestTab1 = nDestTab;
for(USHORT i=0;i<TheTabs.Count();i++)
{
- nErrVal = pDestDoc->TransferTab( pDoc, TheTabs[i], nDestTab1,
- FALSE ); // no insert
-
- // TransferTab doesn't copy drawing objects with bInsertNew=FALSE
- if ( nErrVal > 0 )
- pDestDoc->TransferDrawPage( pDoc, TheTabs[i], nDestTab1 );
-
- if(nErrVal>0 && pDoc->IsScenario(TheTabs[i]))
- {
- String aComment;
- Color aColor;
- USHORT nFlags;
-
- pDoc->GetScenarioData(TheTabs[i], aComment,aColor, nFlags);
- pDestDoc->SetScenario(nDestTab1,TRUE);
- pDestDoc->SetScenarioData(nDestTab1,aComment,aColor,nFlags);
- BOOL bActive = pDoc->IsActiveScenario(TheTabs[i]);
- pDestDoc->SetActiveScenario(nDestTab1, bActive );
-
- BOOL bVisible=pDoc->IsVisible(TheTabs[i]);
- pDestDoc->SetVisible(nDestTab1,bVisible );
-
- }
-
- if ( nErrVal > 0 && pDoc->IsTabProtected( TheTabs[i] ) )
- pDestDoc->SetTabProtection(nDestTab1, pDoc->GetTabProtection(TheTabs[i]));
-
+ nErrVal = pDestShell->TransferTab( *pDocShell, static_cast<SCTAB>(TheTabs[i]), static_cast<SCTAB>(nDestTab1), FALSE, FALSE );
nDestTab1++;
}
}
@@ -3192,3 +3156,4 @@ void ScViewFunc::SetValidation( const ScValidationData& rNew )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 24fab9ac2eba..184d4cba65c3 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -210,6 +211,7 @@
#include "drwtrans.hxx"
#include "docuno.hxx"
#include "clipparam.hxx"
+#include "undodat.hxx" // Amelia Wang
using namespace com::sun::star;
@@ -506,6 +508,76 @@ BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, BOOL bCut, BOOL bApi, BOOL bI
return bDone;
}
+// Copy the content of the Range into clipboard. Adding this method for VBA API: Range.Copy().
+BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRange& rRange, BOOL bCut, BOOL bApi, BOOL bIncludeObjects, BOOL bStopEdit )
+{
+ BOOL bDone = FALSE;
+ if ( bStopEdit )
+ UpdateInputLine();
+
+ ScRange aRange = rRange;
+ ScDocument* pDoc = GetViewData()->GetDocument();
+ if ( pDoc && !pDoc->HasSelectedBlockMatrixFragment( aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aStart.Tab() ) )
+ {
+ BOOL bSysClip = FALSE;
+ if ( !pClipDoc )
+ {
+ // Create one (deleted by ScTransferObj).
+ pClipDoc = new ScDocument( SCDOCMODE_CLIP );
+ bSysClip = TRUE;
+ }
+ if ( !bCut )
+ {
+ ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ if ( pChangeTrack )
+ pChangeTrack->ResetLastCut();
+ }
+
+ if ( bSysClip && bIncludeObjects )
+ {
+ BOOL bAnyOle = pDoc->HasOLEObjectsInArea( aRange );
+ // Update ScGlobal::pDrawClipDocShellRef.
+ ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) );
+ }
+
+ ScClipParam aClipParam( aRange, bCut );
+ pDoc->CopyToClip4VBA( aClipParam, pClipDoc, false, bIncludeObjects );
+ if ( bSysClip )
+ {
+ ScDrawLayer::SetGlobalDrawPersist(NULL);
+ ScGlobal::SetClipDocName( pDoc->GetDocumentShell()->GetTitle( SFX_TITLE_FULLNAME ) );
+ }
+ pClipDoc->ExtendMerge( aRange, TRUE );
+
+ if ( bSysClip )
+ {
+ ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ TransferableObjectDescriptor aObjDesc;
+ pDocSh->FillTransferableObjectDescriptor( aObjDesc );
+ aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
+
+ ScTransferObj* pTransferObj = new ScTransferObj( pClipDoc, aObjDesc );
+ uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj );
+ if ( ScGlobal::pDrawClipDocShellRef )
+ {
+ SfxObjectShellRef aPersistRef( &(*ScGlobal::pDrawClipDocShellRef) );
+ pTransferObj->SetDrawPersist( aPersistRef );
+ }
+ pTransferObj->CopyToClipboard( GetActiveWin() );
+ SC_MOD()->SetClipObject( pTransferObj, NULL );
+ }
+
+ bDone = TRUE;
+ }
+ else
+ {
+ if ( !bApi )
+ ErrorMessage(STR_MATRIXFRAGMENTERR);
+ }
+
+ return bDone;
+}
+
ScTransferObj* ScViewFunc::CopyToTransferable()
{
ScRange aRange;
@@ -1784,6 +1856,86 @@ BOOL ScViewFunc::LinkBlock( const ScRange& rSource, const ScAddress& rDestPos, B
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: */
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 164075c0afb1..52fe04459ad8 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -826,3 +827,4 @@ BOOL ScViewFunc::HasBookmarkAtCursor( SvxHyperlinkItem* pContent )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index dc4e96bbbf34..08d2e633a241 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -747,3 +748,4 @@ BOOL ScViewFunc::PasteDDE( const uno::Reference<datatransfer::XTransferable>& rx
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index eaa55f50a0e2..3aaae4e10f0d 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -358,3 +359,5 @@ void ScViewFunc::EditNote()
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index afa06ddfee3e..b01c7c53da35 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -452,3 +453,4 @@ BOOL ScViewFunc::ApplyGraphicToObject( SdrObject* pPickObj, const Graphic& rGrap
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 840bfda2131e..2997b71822e5 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -3031,3 +3032,4 @@ void ScViewFunc::InsertNameList()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index 6c2d804f72ee..050fb131bfae 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -638,3 +639,4 @@ void ScUpdateRect::GetContDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/waitoff.cxx b/sc/source/ui/view/waitoff.cxx
index 2e3c3e8476af..a3c768e85418 100644
--- a/sc/source/ui/view/waitoff.cxx
+++ b/sc/source/ui/view/waitoff.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,3 +69,4 @@ ScWaitCursorOff::~ScWaitCursorOff()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */