summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--avmedia/source/quicktime/player.cxx81
-rw-r--r--avmedia/source/quicktime/player.hxx2
-rw-r--r--avmedia/source/viewer/mediawindowbase_impl.cxx4
-rw-r--r--basic/inc/basic/basmgr.hxx2
-rw-r--r--basic/inc/basic/sbstar.hxx9
-rw-r--r--basic/source/basmgr/basmgr.cxx10
-rw-r--r--basic/source/classes/eventatt.cxx71
-rw-r--r--basic/source/classes/sb.cxx98
-rw-r--r--basic/source/classes/sbxmod.cxx73
-rw-r--r--basic/source/runtime/step2.cxx53
-rw-r--r--connectivity/inc/connectivity/FValue.hxx12
-rwxr-xr-xconnectivity/qa/connectivity/tools/DbaseDatabase.java3
-rw-r--r--connectivity/qa/connectivity/tools/HsqlDatabase.java3
-rw-r--r--connectivity/source/commontools/FValue.cxx154
-rw-r--r--connectivity/source/commontools/TDatabaseMetaDataBase.cxx6
-rw-r--r--connectivity/source/drivers/file/quotedstring.cxx2
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx47
-rw-r--r--connectivity/source/drivers/hsqldb/makefile.mk1
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/makefile.mk113
-rw-r--r--connectivity/source/drivers/mozab/makefile.mk44
-rw-r--r--connectivity/source/drivers/mozab/makefile_mozab.mk128
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/makefile.mk101
-rw-r--r--connectivity/source/inc/resource/hsqldb_res.hrc1
-rw-r--r--connectivity/source/parse/sqlnode.cxx14
-rw-r--r--connectivity/source/resource/conn_shared_res.src5
-rw-r--r--desktop/source/app/app.cxx7
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx28
-rw-r--r--desktop/source/migration/pages.cxx2
-rw-r--r--embeddedobj/source/general/docholder.cxx21
-rw-r--r--fpicker/source/aqua/SalAquaPicker.cxx5
-rw-r--r--framework/inc/macros/registration.hxx6
-rw-r--r--framework/inc/properties.h17
-rw-r--r--framework/inc/services.h1
-rw-r--r--framework/inc/services/layoutmanager.hxx38
-rw-r--r--framework/source/helper/popupmenucontrollerbase.cxx6
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx302
-rw-r--r--framework/source/layoutmanager/makefile.mk2
-rw-r--r--framework/source/register/makefile.mk2
-rw-r--r--framework/source/uielement/fontmenucontroller.cxx4
-rw-r--r--framework/source/uielement/fontsizemenucontroller.cxx4
-rw-r--r--framework/source/uielement/headermenucontroller.cxx4
-rw-r--r--framework/source/uielement/objectmenucontroller.cxx4
-rw-r--r--framework/source/xml/menuconfiguration.cxx4
-rw-r--r--linguistic/source/hyphdsp.cxx14
-rw-r--r--linguistic/source/spelldsp.cxx11
-rw-r--r--linguistic/source/thesdsp.cxx8
-rw-r--r--officecfg/registry/data/org/openoffice/VCL.xcu16
-rw-r--r--oovbaapi/genconstidl/makefile.mk6
-rw-r--r--oovbaapi/ooo/vba/ControlProvider.idl54
-rw-r--r--oovbaapi/ooo/vba/XApplicationBase.idl66
-rw-r--r--oovbaapi/ooo/vba/XCommandBar.idl3
-rw-r--r--oovbaapi/ooo/vba/XCommandBarButton.idl52
-rw-r--r--oovbaapi/ooo/vba/XCommandBarControl.idl2
-rw-r--r--oovbaapi/ooo/vba/XCommandBarPopup.idl52
-rw-r--r--oovbaapi/ooo/vba/XControlProvider.idl (renamed from oovbaapi/ooo/vba/XGlobals.idl)37
-rw-r--r--oovbaapi/ooo/vba/XDialogBase.idl58
-rw-r--r--oovbaapi/ooo/vba/XDialogsBase.idl60
-rw-r--r--oovbaapi/ooo/vba/XDocumentBase.idl67
-rw-r--r--oovbaapi/ooo/vba/XDocumentProperties.idl71
-rw-r--r--oovbaapi/ooo/vba/XDocumentProperty.idl106
-rw-r--r--oovbaapi/ooo/vba/XDocumentsBase.idl55
-rw-r--r--oovbaapi/ooo/vba/XFontBase.idl71
-rw-r--r--oovbaapi/ooo/vba/XGlobalsBase.idl53
-rw-r--r--oovbaapi/ooo/vba/XPageSetupBase.idl67
-rw-r--r--oovbaapi/ooo/vba/XWindowBase.idl62
-rw-r--r--oovbaapi/ooo/vba/excel/Globals.idl (renamed from oovbaapi/ooo/vba/Globals.idl)12
-rw-r--r--oovbaapi/ooo/vba/excel/TextFrame.idl53
-rw-r--r--oovbaapi/ooo/vba/excel/XApplication.idl14
-rw-r--r--oovbaapi/ooo/vba/excel/XDialog.idl7
-rw-r--r--oovbaapi/ooo/vba/excel/XDialogs.idl11
-rw-r--r--oovbaapi/ooo/vba/excel/XFont.idl13
-rw-r--r--oovbaapi/ooo/vba/excel/XGlobals.idl86
-rw-r--r--oovbaapi/ooo/vba/excel/XPageSetup.idl9
-rw-r--r--oovbaapi/ooo/vba/excel/XTextFrame.idl14
-rw-r--r--oovbaapi/ooo/vba/excel/XVPageBreak.idl54
-rw-r--r--oovbaapi/ooo/vba/excel/XVPageBreaks.idl71
-rw-r--r--oovbaapi/ooo/vba/excel/XWindow.idl9
-rw-r--r--oovbaapi/ooo/vba/excel/XWorkbook.idl17
-rw-r--r--oovbaapi/ooo/vba/excel/XWorkbooks.idl3
-rw-r--r--oovbaapi/ooo/vba/excel/XWorksheet.idl3
-rw-r--r--oovbaapi/ooo/vba/excel/makefile.mk7
-rw-r--r--oovbaapi/ooo/vba/makefile.mk17
-rw-r--r--oovbaapi/ooo/vba/msforms/XControl.idl1
-rw-r--r--oovbaapi/ooo/vba/msforms/XShape.idl17
-rw-r--r--oovbaapi/ooo/vba/msforms/XShapeRange.idl16
-rw-r--r--oovbaapi/ooo/vba/msforms/XShapes.idl1
-rw-r--r--oovbaapi/ooo/vba/msforms/XTextFrame.idl50
-rw-r--r--oovbaapi/ooo/vba/msforms/makefile.mk1
-rw-r--r--oovbaapi/ooo/vba/word/XAddin.idl61
-rw-r--r--oovbaapi/ooo/vba/word/XAddins.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XApplication.idl70
-rw-r--r--oovbaapi/ooo/vba/word/XAutoTextEntries.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XAutoTextEntry.idl59
-rw-r--r--oovbaapi/ooo/vba/word/XBookmark.idl61
-rw-r--r--oovbaapi/ooo/vba/word/XBookmarks.idl61
-rw-r--r--oovbaapi/ooo/vba/word/XBorder.idl59
-rw-r--r--oovbaapi/ooo/vba/word/XBorders.idl59
-rw-r--r--oovbaapi/ooo/vba/word/XDialog.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XDialogs.idl54
-rw-r--r--oovbaapi/ooo/vba/word/XDocument.idl75
-rw-r--r--oovbaapi/ooo/vba/word/XDocuments.idl58
-rw-r--r--oovbaapi/ooo/vba/word/XField.idl52
-rw-r--r--oovbaapi/ooo/vba/word/XFields.idl62
-rw-r--r--oovbaapi/ooo/vba/word/XFind.idl87
-rw-r--r--oovbaapi/ooo/vba/word/XFont.idl58
-rw-r--r--oovbaapi/ooo/vba/word/XGlobals.idl62
-rw-r--r--oovbaapi/ooo/vba/word/XHeaderFooter.idl59
-rw-r--r--oovbaapi/ooo/vba/word/XOptions.idl68
-rw-r--r--oovbaapi/ooo/vba/word/XPageSetup.idl63
-rw-r--r--oovbaapi/ooo/vba/word/XPane.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XPanes.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XParagraph.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XParagraphFormat.idl70
-rw-r--r--oovbaapi/ooo/vba/word/XParagraphs.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XRange.idl78
-rw-r--r--oovbaapi/ooo/vba/word/XReplacement.idl54
-rw-r--r--oovbaapi/ooo/vba/word/XSection.idl58
-rw-r--r--oovbaapi/ooo/vba/word/XSections.idl57
-rw-r--r--oovbaapi/ooo/vba/word/XSelection.idl89
-rw-r--r--oovbaapi/ooo/vba/word/XStyle.idl58
-rw-r--r--oovbaapi/ooo/vba/word/XStyles.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XSystem.idl56
-rw-r--r--oovbaapi/ooo/vba/word/XTable.idl86
-rw-r--r--oovbaapi/ooo/vba/word/XTables.idl79
-rw-r--r--oovbaapi/ooo/vba/word/XTemplate.idl56
-rw-r--r--oovbaapi/ooo/vba/word/XVariable.idl60
-rw-r--r--oovbaapi/ooo/vba/word/XVariables.idl57
-rw-r--r--oovbaapi/ooo/vba/word/XView.idl57
-rw-r--r--oovbaapi/ooo/vba/word/XWindow.idl62
-rw-r--r--oovbaapi/ooo/vba/word/XWrapFormat.idl48
-rw-r--r--oovbaapi/ooo/vba/word/makefile.mk90
-rw-r--r--oovbaapi/prj/build.lst3
-rw-r--r--oovbaapi/util/makefile.mk1
-rw-r--r--sfx2/inc/sfx2/childwin.hxx6
-rw-r--r--sfx2/inc/sfx2/mnuitem.hxx9
-rw-r--r--sfx2/inc/sfx2/objsh.hxx5
-rw-r--r--sfx2/source/control/bindings.cxx5
-rw-r--r--sfx2/source/doc/docfile.cxx11
-rw-r--r--sfx2/source/doc/makefile.mk8
-rw-r--r--sfx2/source/doc/objcont.cxx50
-rw-r--r--sfx2/source/doc/objmisc.cxx7
-rw-r--r--sfx2/source/doc/objserv.cxx16
-rwxr-xr-xsfx2/source/doc/sfxacldetect.cxx108
-rw-r--r--sfx2/source/menu/mnuitem.cxx20
-rw-r--r--sfx2/source/menu/virtmenu.cxx20
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx24
-rw-r--r--shell/inc/internal/config.hxx5
-rw-r--r--shell/inc/internal/utilities.hxx20
-rw-r--r--shell/prj/d.lst3
-rw-r--r--shell/source/tools/lngconvex/lngconvex.cxx31
-rw-r--r--shell/source/win32/shlxthandler/infotips/infotips.cxx2
-rw-r--r--shell/source/win32/shlxthandler/makefile.mk13
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx6
-rw-r--r--shell/source/win32/shlxthandler/propsheets/propsheets.cxx3
-rw-r--r--shell/source/win32/shlxthandler/res/makefile.mk10
-rw-r--r--shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx20
-rw-r--r--shell/source/win32/shlxthandler/util/utilities.cxx15
-rw-r--r--svx/inc/fmhelp.hrc165
-rw-r--r--svx/inc/svx/msvbahelper.hxx58
-rw-r--r--svx/inc/svx/numitem.hxx30
-rw-r--r--svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx5
-rw-r--r--svx/inc/svx/selectioncontroller.hxx11
-rw-r--r--svx/inc/svx/svdedxv.hxx17
-rw-r--r--svx/prj/d.lst1
-rw-r--r--svx/source/cui/cuicharmap.cxx5
-rw-r--r--svx/source/cui/numpages.cxx133
-rw-r--r--svx/source/dialog/hyperdlg.cxx6
-rw-r--r--svx/source/editeng/editdoc.cxx11
-rw-r--r--svx/source/fmcomp/gridcell.cxx4
-rw-r--r--svx/source/intro/intro_tmpl.hrc210
-rw-r--r--svx/source/items/numitem.cxx504
-rw-r--r--svx/source/msfilter/makefile.mk6
-rw-r--r--svx/source/msfilter/msvbahelper.cxx384
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx107
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx37
-rw-r--r--svx/source/svdraw/selectioncontroller.cxx11
-rw-r--r--svx/source/svdraw/svdedxv.cxx226
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx48
-rw-r--r--svx/source/svdraw/svdpage.cxx8
-rw-r--r--svx/source/table/tablecontroller.cxx82
-rw-r--r--svx/source/table/tablecontroller.hxx4
-rw-r--r--svx/util/hidother.src7
-rw-r--r--ucb/source/ucp/webdav/DAVResourceAccess.cxx5
-rw-r--r--ucb/source/ucp/webdav/NeonSession.cxx7
-rw-r--r--vbahelper/inc/vbahelper/helperdecl.hxx58
-rw-r--r--vbahelper/inc/vbahelper/vbaapplicationbase.hxx64
-rw-r--r--vbahelper/inc/vbahelper/vbacollectionimpl.hxx257
-rw-r--r--vbahelper/inc/vbahelper/vbadialogbase.hxx54
-rw-r--r--vbahelper/inc/vbahelper/vbadialogsbase.hxx54
-rw-r--r--vbahelper/inc/vbahelper/vbadllapi.h44
-rw-r--r--vbahelper/inc/vbahelper/vbadocumentbase.hxx73
-rw-r--r--vbahelper/inc/vbahelper/vbadocumentsbase.hxx69
-rw-r--r--vbahelper/inc/vbahelper/vbafontbase.hxx99
-rw-r--r--vbahelper/inc/vbahelper/vbaglobalbase.hxx53
-rw-r--r--vbahelper/inc/vbahelper/vbahelper.hxx231
-rw-r--r--vbahelper/inc/vbahelper/vbahelperinterface.hxx121
-rw-r--r--vbahelper/inc/vbahelper/vbapagesetupbase.hxx70
-rw-r--r--vbahelper/inc/vbahelper/vbapropvalue.hxx60
-rw-r--r--vbahelper/inc/vbahelper/vbashape.hxx118
-rw-r--r--vbahelper/inc/vbahelper/vbashaperange.hxx89
-rw-r--r--vbahelper/inc/vbahelper/vbashapes.hxx84
-rw-r--r--vbahelper/inc/vbahelper/vbatextframe.hxx70
-rw-r--r--vbahelper/inc/vbahelper/vbawindowbase.hxx66
-rw-r--r--vbahelper/prj/build.lst6
-rw-r--r--vbahelper/prj/d.lst27
-rw-r--r--vbahelper/source/msforms/makefile.mk79
-rw-r--r--vbahelper/source/msforms/service.cxx83
-rw-r--r--vbahelper/source/msforms/vbabutton.cxx74
-rw-r--r--vbahelper/source/msforms/vbabutton.hxx51
-rw-r--r--vbahelper/source/msforms/vbacheckbox.cxx112
-rw-r--r--vbahelper/source/msforms/vbacheckbox.hxx61
-rw-r--r--vbahelper/source/msforms/vbacombobox.cxx183
-rw-r--r--vbahelper/source/msforms/vbacombobox.hxx80
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx539
-rw-r--r--vbahelper/source/msforms/vbacontrol.hxx114
-rw-r--r--vbahelper/source/msforms/vbacontrols.cxx232
-rw-r--r--vbahelper/source/msforms/vbacontrols.hxx62
-rw-r--r--vbahelper/source/msforms/vbaframe.cxx93
-rw-r--r--vbahelper/source/msforms/vbaframe.hxx58
-rw-r--r--vbahelper/source/msforms/vbaimage.cxx59
-rw-r--r--vbahelper/source/msforms/vbaimage.hxx48
-rw-r--r--vbahelper/source/msforms/vbalabel.cxx88
-rw-r--r--vbahelper/source/msforms/vbalabel.hxx56
-rw-r--r--vbahelper/source/msforms/vbalistbox.cxx290
-rw-r--r--vbahelper/source/msforms/vbalistbox.hxx90
-rw-r--r--vbahelper/source/msforms/vbalistcontrolhelper.cxx146
-rw-r--r--vbahelper/source/msforms/vbalistcontrolhelper.hxx20
-rw-r--r--vbahelper/source/msforms/vbamultipage.cxx132
-rw-r--r--vbahelper/source/msforms/vbamultipage.hxx65
-rw-r--r--vbahelper/source/msforms/vbapages.cxx80
-rw-r--r--vbahelper/source/msforms/vbapages.hxx64
-rw-r--r--vbahelper/source/msforms/vbaprogressbar.cxx78
-rw-r--r--vbahelper/source/msforms/vbaprogressbar.hxx59
-rw-r--r--vbahelper/source/msforms/vbaradiobutton.cxx107
-rw-r--r--vbahelper/source/msforms/vbaradiobutton.hxx55
-rw-r--r--vbahelper/source/msforms/vbascrollbar.cxx139
-rw-r--r--vbahelper/source/msforms/vbascrollbar.hxx66
-rw-r--r--vbahelper/source/msforms/vbaspinbutton.cxx109
-rw-r--r--vbahelper/source/msforms/vbaspinbutton.hxx61
-rw-r--r--vbahelper/source/msforms/vbatextbox.cxx137
-rw-r--r--vbahelper/source/msforms/vbatextbox.hxx59
-rw-r--r--vbahelper/source/msforms/vbatogglebutton.cxx108
-rw-r--r--vbahelper/source/msforms/vbatogglebutton.hxx63
-rw-r--r--vbahelper/source/msforms/vbauserform.cxx227
-rw-r--r--vbahelper/source/msforms/vbauserform.hxx77
-rw-r--r--vbahelper/source/vbahelper/makefile.mk80
-rw-r--r--vbahelper/source/vbahelper/vbaapplicationbase.cxx218
-rw-r--r--vbahelper/source/vbahelper/vbacolorformat.cxx190
-rw-r--r--vbahelper/source/vbahelper/vbacolorformat.hxx128
-rw-r--r--vbahelper/source/vbahelper/vbacommandbar.cxx212
-rw-r--r--vbahelper/source/vbahelper/vbacommandbar.hxx83
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrol.cxx259
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrol.hxx122
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrols.cxx256
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrols.hxx75
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.cxx282
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.hxx110
-rw-r--r--vbahelper/source/vbahelper/vbacommandbars.cxx238
-rw-r--r--vbahelper/source/vbahelper/vbacommandbars.hxx71
-rw-r--r--vbahelper/source/vbahelper/vbadialogbase.cxx51
-rw-r--r--vbahelper/source/vbahelper/vbadialogsbase.cxx47
-rw-r--r--vbahelper/source/vbahelper/vbadocumentbase.cxx228
-rw-r--r--vbahelper/source/vbahelper/vbadocumentsbase.cxx305
-rw-r--r--vbahelper/source/vbahelper/vbafillformat.cxx202
-rw-r--r--vbahelper/source/vbahelper/vbafillformat.hxx74
-rw-r--r--vbahelper/source/vbahelper/vbafontbase.cxx309
-rw-r--r--vbahelper/source/vbahelper/vbaglobalbase.cxx126
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx1199
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx.rej45
-rw-r--r--vbahelper/source/vbahelper/vbalineformat.cxx458
-rw-r--r--vbahelper/source/vbahelper/vbalineformat.hxx85
-rw-r--r--vbahelper/source/vbahelper/vbapagesetupbase.cxx325
-rw-r--r--vbahelper/source/vbahelper/vbapictureformat.cxx147
-rw-r--r--vbahelper/source/vbahelper/vbapictureformat.hxx64
-rw-r--r--vbahelper/source/vbahelper/vbapropvalue.cxx48
-rw-r--r--vbahelper/source/vbahelper/vbashape.cxx676
-rw-r--r--vbahelper/source/vbahelper/vbashaperange.cxx382
-rw-r--r--vbahelper/source/vbahelper/vbashapes.cxx491
-rw-r--r--vbahelper/source/vbahelper/vbatextframe.cxx169
-rw-r--r--vbahelper/source/vbahelper/vbawindowbase.cxx180
-rw-r--r--vbahelper/util/makefile.mk104
-rw-r--r--vbahelper/util/msforms.map9
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx20
-rw-r--r--xmloff/source/forms/gridcolumnproptranslator.cxx10
-rw-r--r--xmloff/source/text/txtimp.cxx48
-rw-r--r--xmloff/source/text/txtparae.cxx31
-rw-r--r--xmloff/source/text/txtstyli.cxx60
287 files changed, 20956 insertions, 1499 deletions
diff --git a/avmedia/source/quicktime/player.cxx b/avmedia/source/quicktime/player.cxx
index a66c77e3f4..aa2d86d340 100644
--- a/avmedia/source/quicktime/player.cxx
+++ b/avmedia/source/quicktime/player.cxx
@@ -100,8 +100,6 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
if ((result == noErr) && (mnVersion >= QT701))
{
// we have version 7.01 or later, initialize
- mpMovie = [QTMovie movie];
- [mpMovie retain];
mbInitialized = true;
}
[pool release];
@@ -111,43 +109,57 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
Player::~Player()
{
- if( mbInitialized )
+ if( mpMovie )
{
- if( mpMovie )
- {
- [mpMovie release];
- mpMovie = nil;
- }
-
+ [mpMovie release];
+ mpMovie = nil;
}
}
+// ------------------------------------------------------------------------------
+QTMovie* Player::getMovie()
+{
+ OSL_ASSERT( mpMovie );
+ return mpMovie;
+}
// ------------------------------------------------------------------------------
bool Player::create( const ::rtl::OUString& rURL )
{
bool bRet = false;
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- NSString* aNSStr = [[[NSString alloc] initWithCharacters: rURL.getStr() length: rURL.getLength()]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] ;
-// NSString * aNSStringEscaped = [aNSStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
- NSURL* aURL = [NSURL URLWithString:aNSStr ];
-
- // create the Movie
-
+ // create the Movie
if( mbInitialized )
{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+ if( mpMovie )
+ {
+ [mpMovie release];
+ mpMovie = nil;
+ }
+
+ NSString* aNSStr = [[[NSString alloc] initWithCharacters: rURL.getStr() length: rURL.getLength()]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] ;
+ NSURL* aURL = [NSURL URLWithString:aNSStr ];
- mpMovie = [mpMovie initWithURL:aURL error:nil];
+
+ NSError* pErr = nil;
+ mpMovie = [QTMovie movieWithURL:aURL error:&pErr];
if(mpMovie)
{
[mpMovie retain];
maURL = rURL;
bRet = true;
}
+ if( pErr )
+ {
+ OSL_TRACE( "NSMovie create failed with error %ld (%s)",
+ (long)[pErr code],
+ [[pErr localizedDescription] cString]
+ );
+ }
+ [pool release];
}
-
- [pool release];
return bRet;
}
@@ -159,10 +171,10 @@ void SAL_CALL Player::start( )
{
OSL_TRACE ("Player::start");
- if ( mbInitialized && mpMovie )
- {
+ if( mpMovie )
+ {
[mpMovie play];
- }
+ }
}
// ------------------------------------------------------------------------------
@@ -171,11 +183,10 @@ void SAL_CALL Player::stop( )
throw (uno::RuntimeException)
{
OSL_TRACE ("Player::stop");
- if ( mpMovie )
+ if( mpMovie )
{
- [mpMovie stop];
+ [mpMovie stop];
}
-
}
// ------------------------------------------------------------------------------
@@ -185,7 +196,7 @@ sal_Bool SAL_CALL Player::isPlaying()
{
bool bRet = false;
- if ( mbInitialized )
+ if ( mpMovie )
{
if ([mpMovie rate] != 0)
{
@@ -219,11 +230,11 @@ void SAL_CALL Player::setMediaTime( double fTime )
throw (uno::RuntimeException)
{
OSL_TRACE ("Player::setMediaTime");
-
- if ( mpMovie )
- {
- [mpMovie setCurrentTime: QTMakeTimeWithTimeInterval(fTime)];
- }
+
+ if ( mpMovie )
+ {
+ [mpMovie setCurrentTime: QTMakeTimeWithTimeInterval(fTime)];
+ }
}
// ------------------------------------------------------------------------------
@@ -243,7 +254,6 @@ double SAL_CALL Player::getMediaTime( )
{
stop();
}
-
return position;
}
@@ -256,7 +266,6 @@ void SAL_CALL Player::setStopTime( double fTime )
OSL_TRACE ("Player::setStopTime %f", fTime);
mnStopTime = fTime;
-
}
// ------------------------------------------------------------------------------
@@ -264,9 +273,7 @@ void SAL_CALL Player::setStopTime( double fTime )
double SAL_CALL Player::getStopTime( )
throw (uno::RuntimeException)
{
- double fRet = 0.0;
-
- fRet = mnStopTime;
+ double fRet = mnStopTime;
return fRet;
}
@@ -277,7 +284,7 @@ void SAL_CALL Player::setRate( double fRate )
throw (uno::RuntimeException)
{
OSL_TRACE ("Player::setRate");
-
+
// Quicktime: 0 = stop, 1 = normal speed, 2 = double speed, -1 = normal speed backwards
if ( mpMovie )
{
diff --git a/avmedia/source/quicktime/player.hxx b/avmedia/source/quicktime/player.hxx
index 6698381e23..ccc360e5ef 100644
--- a/avmedia/source/quicktime/player.hxx
+++ b/avmedia/source/quicktime/player.hxx
@@ -83,7 +83,7 @@ public:
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
- QTMovie* getMovie() { return mpMovie; }
+ QTMovie* getMovie();
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr;
diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx
index d7b42104ed..8fb63bdfc5 100644
--- a/avmedia/source/viewer/mediawindowbase_impl.cxx
+++ b/avmedia/source/viewer/mediawindowbase_impl.cxx
@@ -147,9 +147,9 @@ void MediaWindowBaseImpl::stopPlayingInternal( bool bStop )
if( isPlaying() )
{
if( bStop )
- mxPlayer->start();
- else
mxPlayer->stop();
+ else
+ mxPlayer->start();
}
}
diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx
index 3285c09527..7230d2cee1 100644
--- a/basic/inc/basic/basmgr.hxx
+++ b/basic/inc/basic/basmgr.hxx
@@ -231,6 +231,8 @@ public:
::com::sun::star::uno::Any
SetGlobalUNOConstant( const sal_Char* _pAsciiName, const ::com::sun::star::uno::Any& _rValue );
+ /** retrieves a global constant in the basic library, referring to some UNO object, returns true if a value is found ( value is in aOut ) false otherwise. */
+ bool GetGlobalUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut );
/** determines whether there are password-protected modules whose size exceedes the
legacy module size
@param _out_rModuleNames
diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
index f71d1ff2fd..0d61e9bad6 100644
--- a/basic/inc/basic/sbstar.hxx
+++ b/basic/inc/basic/sbstar.hxx
@@ -74,6 +74,11 @@ class StarBASIC : public SbxObject
BOOL bDocBasic;
BasicLibInfo* pLibInfo; // Info block for basic manager
SbLanguageMode eLanguageMode; // LanguageMode of the basic object
+ BOOL bQuit;
+
+ SbxObjectRef pVBAGlobals;
+ SbxObject* getVBAGlobals( );
+
protected:
BOOL CError( SbError, const String&, xub_StrLen, xub_StrLen, xub_StrLen );
private:
@@ -196,6 +201,10 @@ public:
SbxObjectRef getRTL( void ) { return pRtl; }
BOOL IsDocBasic() { return bDocBasic; }
+ SbxVariable* VBAFind( const String& rName, SbxClassType t );
+ bool GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut );
+ void QuitAndExitApplication();
+ BOOL IsQuitApplication() { return bQuit; };
};
#ifndef __SB_SBSTARBASICREF_HXX
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 9c690f1c8d..284177b61b 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -47,6 +47,7 @@
#include <basic/sbuno.hxx>
#include <basic/basmgr.hxx>
+#include <sbunoobj.hxx>
#include "basrid.hxx"
#include "sbintern.hxx"
#include <sb.hrc>
@@ -1767,6 +1768,15 @@ BasicError* BasicManager::GetNextError()
DBG_CHKTHIS( BasicManager, 0 );
return pErrorMgr->GetNextError();
}
+bool BasicManager::GetGlobalUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut )
+{
+ bool bRes = false;
+ StarBASIC* pStandardLib = GetStdLib();
+ OSL_PRECOND( pStandardLib, "BasicManager::SetGlobalUNOConstant: no lib to insert into!" );
+ if ( pStandardLib )
+ bRes = pStandardLib->GetUNOConstant( _pAsciiName, aOut );
+ return bRes;
+}
Any BasicManager::SetGlobalUNOConstant( const sal_Char* _pAsciiName, const Any& _rValue )
{
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 7776b57829..b0c8f4b3c3 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -95,53 +95,48 @@ Any sbxToUnoValue( SbxVariable* pVar );
Reference< frame::XModel > getModelFromBasic( SbxObject* pBasic )
{
- Reference< frame::XModel > xModel;
-
- SbxObject* basicChosen = pBasic;
-
- if ( basicChosen == NULL)
+ OSL_PRECOND( pBasic != NULL, "getModelFromBasic: illegal call!" );
+ if ( !pBasic )
+ return NULL;
+
+ // look for the ThisComponent variable, first in the parent (which
+ // might be the document's Basic), then in the parent's parent (which might be
+ // the application Basic)
+ const ::rtl::OUString sThisComponent( RTL_CONSTASCII_USTRINGPARAM( "ThisComponent" ) );
+ SbxVariable* pThisComponent = NULL;
+
+ SbxObject* pLookup = pBasic->GetParent();
+ while ( pLookup && !pThisComponent )
{
- OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" );
- return xModel;
+ pThisComponent = pLookup->Find( sThisComponent, SbxCLASS_OBJECT );
+ pLookup = pLookup->GetParent();
}
- SbxObject* p = pBasic;
- SbxObject* pParent = p->GetParent();
- SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL;
-
- if( pParentParent )
+ if ( !pThisComponent )
{
- basicChosen = pParentParent;
+ OSL_TRACE("Failed to get ThisComponent");
+ // the application Basic, at the latest, should have this variable
+ return NULL;
}
- else if( pParent )
+
+ Any aThisComponent( sbxToUnoValue( pThisComponent ) );
+ Reference< frame::XModel > xModel( aThisComponent, UNO_QUERY );
+ if ( !xModel.is() )
{
- basicChosen = pParent;
+ // it's no XModel. Okay, ThisComponent nowadays is allowed to be a controller.
+ Reference< frame::XController > xController( aThisComponent, UNO_QUERY );
+ if ( xController.is() )
+ xModel = xController->getModel();
}
+ if ( !xModel.is() )
+ return NULL;
- Any aModel;
- SbxVariable *pCompVar = basicChosen->Find( UniString(RTL_CONSTASCII_USTRINGPARAM("ThisComponent")), SbxCLASS_OBJECT );
+#if OSL_DEBUG_LEVEL > 0
+ OSL_TRACE("Have model ThisComponent points to url %s",
+ ::rtl::OUStringToOString( xModel->getURL(),
+ RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+#endif
- if ( pCompVar )
- {
- aModel = sbxToUnoValue( pCompVar );
- if ( sal_False == ( aModel >>= xModel ) ||
- !xModel.is() )
- {
- OSL_TRACE("Failed to extract model from thisComponent ");
- return xModel;
- }
- else
- {
- OSL_TRACE("Have model ThisComponent points to url %s",
- ::rtl::OUStringToOString( xModel->getURL(),
- RTL_TEXTENCODING_ASCII_US ).pData->buffer );
-
- }
- }
- else
- {
- OSL_TRACE("Failed to get ThisComponent");
- }
return xModel;
}
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 6b22b4f280..a217ebc49c 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -65,7 +65,29 @@ SV_IMPL_VARARR(SbTextPortions,SbTextPortion)
TYPEINIT1(StarBASIC,SbxObject)
#define RTLNAME "@SBRTL"
+// i#i68894#
+const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") );
+const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
+
+SbxObject* StarBASIC::getVBAGlobals( )
+{
+ if ( !pVBAGlobals )
+ pVBAGlobals = (SbUnoObject*)Find( aVBAHook , SbxCLASS_DONTCARE );
+ return pVBAGlobals;
+}
+
+// i#i68894#
+SbxVariable* StarBASIC::VBAFind( const String& rName, SbxClassType t )
+{
+ if( rName == aThisComponent )
+ return NULL;
+ // rename to init globals
+ if ( getVBAGlobals( ) )
+ return pVBAGlobals->Find( rName, t );
+ return NULL;
+
+}
// Create array for conversion SFX <-> VB error code
struct SFX_VB_ErrorItem
{
@@ -303,32 +325,32 @@ SbxObject* SbTypeFactory::cloneTypeObjectImpl( const SbxObject& rTypeObj )
if( pProp )
{
SbxProperty* pNewProp = new SbxProperty( *pProp );
- if( pVar->GetType() & SbxARRAY )
- {
- SbxBase* pParObj = pVar->GetObject();
- SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
- SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
- INT32 lb = 0;
- INT32 ub = 0;
-
- pDest->setHasFixedSize( pSource->hasFixedSize() );
- if ( pSource->GetDims() && pSource->hasFixedSize() )
- {
- for ( INT32 j = 1 ; j <= pSource->GetDims(); ++j )
- {
- pSource->GetDim32( (INT32)j, lb, ub );
- pDest->AddDim32( lb, ub );
- }
- }
- else
- pDest->unoAddDim( 0, -1 ); // variant array
-
- USHORT nSavFlags = pVar->GetFlags();
- pNewProp->ResetFlag( SBX_FIXED );
- // need to reset the FIXED flag
- // when calling PutObject ( because the type will not match Object )
- pNewProp->PutObject( pDest );
- pNewProp->SetFlags( nSavFlags );
+ if( pVar->GetType() & SbxARRAY )
+ {
+ SbxBase* pParObj = pVar->GetObject();
+ SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
+ SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
+ INT32 lb = 0;
+ INT32 ub = 0;
+
+ pDest->setHasFixedSize( pSource->hasFixedSize() );
+ if ( pSource->GetDims() && pSource->hasFixedSize() )
+ {
+ for ( INT32 j = 1 ; j <= pSource->GetDims(); ++j )
+ {
+ pSource->GetDim32( (INT32)j, lb, ub );
+ pDest->AddDim32( lb, ub );
+ }
+ }
+ else
+ pDest->unoAddDim( 0, -1 ); // variant array
+
+ USHORT nSavFlags = pVar->GetFlags();
+ pNewProp->ResetFlag( SBX_FIXED );
+ // need to reset the FIXED flag
+ // when calling PutObject ( because the type will not match Object )
+ pNewProp->PutObject( pDest );
+ pNewProp->SetFlags( nSavFlags );
}
pProps->PutDirect( pNewProp, i );
}
@@ -445,8 +467,8 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
SbProcedureProperty* pNewProp = new SbProcedureProperty
( pProcedureProp->GetName(), pProcedureProp->GetType() );
// ( pProcedureProp->GetName(), pProcedureProp->GetType(), this );
- pNewProp->SetFlags( nFlags_ ); // Copy flags
- pNewProp->ResetFlag( SBX_NO_BROADCAST ); // except the Broadcast if it was set
+ pNewProp->SetFlags( nFlags_ ); // Copy flags
+ pNewProp->ResetFlag( SBX_NO_BROADCAST ); // except the Broadcast if it was set
pProcedureProp->SetFlags( nFlags_ );
pProps->PutDirect( pNewProp, i );
StartListening( pNewProp->GetBroadcaster(), TRUE );
@@ -681,6 +703,8 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic )
pRtl = new SbiStdObject( String( RTL_CONSTASCII_USTRINGPARAM(RTLNAME) ), this );
// Search via StarBasic is always global
SetFlag( SBX_GBLSEARCH );
+ pVBAGlobals = NULL;
+ bQuit = FALSE;
}
// #51727 Override SetModified so that the modified state
@@ -995,6 +1019,12 @@ SbxVariable* StarBASIC::FindVarInCurrentScopy
return pVar;
}
+void StarBASIC::QuitAndExitApplication()
+{
+ Stop();
+ bQuit = TRUE;
+}
+
void StarBASIC::Stop()
{
SbiInstance* p = pINST;
@@ -1533,6 +1563,18 @@ BOOL StarBASIC::LoadOldModules( SvStream& )
return FALSE;
}
+bool StarBASIC::GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut )
+{
+ bool bRes = false;
+ ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) );
+ SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( Find( sVarName, SbxCLASS_DONTCARE ) );
+ if ( pGlobs )
+ {
+ aOut = pGlobs->getUnoAny();
+ bRes = true;
+ }
+ return bRes;
+}
//========================================================================
// #118116 Implementation Collection object
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 21b31020f9..c96f55c981 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -69,6 +69,11 @@
#endif
#include <stdio.h>
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <comphelper/processfactory.hxx>
+#include <vcl/svapp.hxx>
+ using namespace ::com::sun::star;
TYPEINIT1(SbModule,SbxObject)
@@ -84,7 +89,63 @@ SV_IMPL_VARARR(SbiBreakpoints,USHORT)
SV_IMPL_VARARR(HighlightPortions, HighlightPortion)
+class AsyncQuitHandler
+{
+ AsyncQuitHandler() {}
+ AsyncQuitHandler( const AsyncQuitHandler&);
+public:
+ static AsyncQuitHandler& instance()
+ {
+ static AsyncQuitHandler dInst;
+ return dInst;
+ }
+ void QuitApplication()
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
+ if ( xFactory.is() )
+ {
+ uno::Reference< frame::XDesktop > xDeskTop( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop") ) ), uno::UNO_QUERY );
+ if ( xDeskTop.is() )
+ xDeskTop->terminate();
+ }
+ }
+ DECL_LINK( OnAsyncQuit, void* );
+};
+
+IMPL_LINK( AsyncQuitHandler, OnAsyncQuit, void*, /*pNull*/ )
+{
+ QuitApplication();
+ return 0L;
+}
+
+#if 0
+bool UnlockControllerHack( StarBASIC* pBasic )
+{
+ bool bRes = false;
+ if ( pBasic && pBasic->IsDocBasic() )
+ {
+ uno::Any aUnoVar;
+ ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( "ThisComponent" ) );
+ SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( pBasic->Find( sVarName, SbxCLASS_DONTCARE ) );
+ if ( pGlobs )
+ aUnoVar = pGlobs->getUnoAny();
+ uno::Reference< frame::XModel > xModel( aUnoVar, uno::UNO_QUERY);
+ if ( xModel.is() )
+ {
+ try
+ {
+ xModel->unlockControllers();
+ bRes = true;
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ }
+ return bRes;
+}
+#endif
/////////////////////////////////////////////////////////////////////////////
// Ein BASIC-Modul hat EXTSEARCH gesetzt, damit die im Modul enthaltenen
@@ -696,6 +757,13 @@ USHORT SbModule::Run( SbMethod* pMeth )
pINST->nCallLvl--; // Call-Level wieder runter
StarBASIC::FatalError( SbERR_STACK_OVERFLOW );
}
+
+ // VBA always ensure screenupdating is enabled after completing
+ StarBASIC* pBasic = PTR_CAST(StarBASIC,GetParent());
+#if 0
+ if ( pBasic && pBasic->IsDocBasic() && !pINST )
+ UnlockControllerHack( pBasic );
+#endif
if( bDelInst )
{
// #57841 Uno-Objekte, die in RTL-Funktionen gehalten werden,
@@ -705,6 +773,11 @@ USHORT SbModule::Run( SbMethod* pMeth )
delete pINST;
pINST = NULL;
}
+ if ( pBasic && pBasic->IsDocBasic() && pBasic->IsQuitApplication() && !pINST )
+ {
+ Application::PostUserEvent( LINK( &AsyncQuitHandler::instance(), AsyncQuitHandler, OnAsyncQuit ), NULL );
+ }
+
return nRes;
}
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 2589207ac9..dbc8712063 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -56,57 +56,6 @@ using com::sun::star::uno::Reference;
SbxVariable* getVBAConstant( const String& rName );
-const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") );
-const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
-// i#i68894#
-SbxArray* getVBAGlobals( )
-{
- static SbxArrayRef pArray;
- static bool isInitialised = false;
- if ( isInitialised )
- return pArray;
- Reference < XComponentContext > xCtx;
- Reference < XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
- xCtx.set( xProps->getPropertyValue( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))),
- UNO_QUERY_THROW );
- SbUnoObject dGlobs( String( RTL_CONSTASCII_USTRINGPARAM("ExcelGlobals") ), xCtx->getValueByName( ::rtl::OUString::createFromAscii( "/singletons/ooo.vba.theGlobals") ) );
-
- SbxVariable *vba = dGlobs.Find( String( RTL_CONSTASCII_USTRINGPARAM("getGlobals") ) , SbxCLASS_DONTCARE );
-
- if ( vba )
- {
- pArray = static_cast<SbxArray *>(vba->GetObject());
- isInitialised = true;
- return pArray;
- }
- return NULL;
-}
-
-// i#i68894#
-SbxVariable* VBAFind( const String& rName, SbxClassType t )
-{
- if( rName == aThisComponent )
- return NULL;
-
- SbxArray *pVBAGlobals = getVBAGlobals( );
- for (USHORT i = 0; pVBAGlobals && i < pVBAGlobals->Count(); i++)
- {
- SbxVariable *pElem = pVBAGlobals->Get( i );
- if (!pElem || !pElem->IsObject())
- continue;
- SbxObject *pVba = static_cast<SbxObject *>(pElem->GetObject());
- SbxVariable *pVbaVar = pVba ? pVba->Find( rName, t ) : NULL;
- if( pVbaVar )
- {
- return pVbaVar;
- }
- }
- return NULL;
-
-}
-
// Suchen eines Elements
// Die Bits im String-ID:
// 0x8000 - Argv ist belegt
@@ -191,7 +140,7 @@ SbxVariable* SbiRuntime::FindElement
if ( bVBAEnabled )
{
// Try Find in VBA symbols space
- pElem = VBAFind( aName, SbxCLASS_DONTCARE );
+ pElem = rBasic.VBAFind( aName, SbxCLASS_DONTCARE );
if ( pElem )
bSetName = false; // don't overwrite uno name
else
diff --git a/connectivity/inc/connectivity/FValue.hxx b/connectivity/inc/connectivity/FValue.hxx
index 6fdbae4389..8bcfa0eaed 100644
--- a/connectivity/inc/connectivity/FValue.hxx
+++ b/connectivity/inc/connectivity/FValue.hxx
@@ -44,9 +44,15 @@
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/sdb/XColumn.hpp>
namespace connectivity
{
+ namespace detail
+ {
+ class IValueSource;
+ }
+
class OOO_DLLPUBLIC_DBTOOLS ORowSetValue
{
union
@@ -361,6 +367,12 @@ namespace connectivity
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow);
void fill(const ::com::sun::star::uno::Any& _rValue);
+
+ void fill( const sal_Int32 _nType,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn );
+
+ private:
+ void impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const detail::IValueSource& _rValueSource );
};
/// ORowSetValueDecorator decorates a ORowSetValue so the value is "refcounted"
diff --git a/connectivity/qa/connectivity/tools/DbaseDatabase.java b/connectivity/qa/connectivity/tools/DbaseDatabase.java
index be41dfae39..c97d7804df 100755
--- a/connectivity/qa/connectivity/tools/DbaseDatabase.java
+++ b/connectivity/qa/connectivity/tools/DbaseDatabase.java
@@ -65,7 +65,8 @@ public class DbaseDatabase extends AbstractDatabase
private void createDBDocument() throws Exception
{
final File documentFile = File.createTempFile("dbase", ".odb");
- documentFile.deleteOnExit();
+ if ( documentFile.exists() )
+ documentFile.delete();
final File subPath = new File(documentFile.getParent() + File.separator + documentFile.getName().replaceAll(".odb", "") + File.separator );
subPath.mkdir();
//subPath.deleteOnExit();
diff --git a/connectivity/qa/connectivity/tools/HsqlDatabase.java b/connectivity/qa/connectivity/tools/HsqlDatabase.java
index b1af0c118e..036edd9a6a 100644
--- a/connectivity/qa/connectivity/tools/HsqlDatabase.java
+++ b/connectivity/qa/connectivity/tools/HsqlDatabase.java
@@ -71,7 +71,8 @@ public class HsqlDatabase extends AbstractDatabase
private void createDBDocument() throws Exception
{
final File documentFile = File.createTempFile("testdb", ".odb");
- documentFile.deleteOnExit();
+ if ( documentFile.exists() )
+ documentFile.delete();
m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath(documentFile);
m_databaseDocument = (XOfficeDatabaseDocument) UnoRuntime.queryInterface(
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index 37e91d22c8..3068acde8b 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -40,13 +40,16 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/logfile.hxx>
-using namespace connectivity;
-using namespace dbtools;
+using namespace ::dbtools;
using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::io;
+namespace connectivity
+{
+
namespace {
static sal_Bool isStorageCompatible(sal_Int32 _eType1, sal_Int32 _eType2)
{
@@ -1809,6 +1812,107 @@ void ORowSetValue::setSigned(sal_Bool _bMod)
}
}
}
+
+// -----------------------------------------------------------------------------
+namespace detail
+{
+ class SAL_NO_VTABLE IValueSource
+ {
+ public:
+ virtual ::rtl::OUString getString() const = 0;
+ virtual sal_Bool getBoolean() const = 0;
+ virtual sal_Int8 getByte() const = 0;
+ virtual sal_Int16 getShort() const = 0;
+ virtual sal_Int32 getInt() const = 0;
+ virtual sal_Int64 getLong() const = 0;
+ virtual float getFloat() const = 0;
+ virtual double getDouble() const = 0;
+ virtual Date getDate() const = 0;
+ virtual Time getTime() const = 0;
+ virtual DateTime getTimestamp() const = 0;
+ virtual Sequence< sal_Int8 > getBytes() const = 0;
+ virtual Reference< XInputStream > getBinaryStream() const = 0;
+ virtual Reference< XInputStream > getCharacterStream() const = 0;
+ virtual sal_Bool wasNull() const = 0;
+
+ virtual ~IValueSource() { }
+ };
+
+ class RowValue : public IValueSource
+ {
+ public:
+ RowValue( const Reference< XRow >& _xRow, const sal_Int32 _nPos )
+ :m_xRow( _xRow )
+ ,m_nPos( _nPos )
+ {
+ }
+
+ // IValueSource
+ virtual ::rtl::OUString getString() const { return m_xRow->getString( m_nPos ); };
+ virtual sal_Bool getBoolean() const { return m_xRow->getBoolean( m_nPos ); };
+ virtual sal_Int8 getByte() const { return m_xRow->getByte( m_nPos ); };
+ virtual sal_Int16 getShort() const { return m_xRow->getShort( m_nPos ); }
+ virtual sal_Int32 getInt() const { return m_xRow->getInt( m_nPos ); }
+ virtual sal_Int64 getLong() const { return m_xRow->getLong( m_nPos ); }
+ virtual float getFloat() const { return m_xRow->getFloat( m_nPos ); };
+ virtual double getDouble() const { return m_xRow->getDouble( m_nPos ); };
+ virtual Date getDate() const { return m_xRow->getDate( m_nPos ); };
+ virtual Time getTime() const { return m_xRow->getTime( m_nPos ); };
+ virtual DateTime getTimestamp() const { return m_xRow->getTimestamp( m_nPos ); };
+ virtual Sequence< sal_Int8 > getBytes() const { return m_xRow->getBytes( m_nPos ); };
+ virtual Reference< XInputStream > getBinaryStream() const { return m_xRow->getBinaryStream( m_nPos ); };
+ virtual Reference< XInputStream > getCharacterStream() const { return m_xRow->getCharacterStream( m_nPos ); };
+ virtual sal_Bool wasNull() const { return m_xRow->wasNull( ); };
+
+ private:
+ const Reference< XRow > m_xRow;
+ const sal_Int32 m_nPos;
+ };
+
+ class ColumnValue : public IValueSource
+ {
+ public:
+ ColumnValue( const Reference< XColumn >& _rxColumn )
+ :m_xColumn( _rxColumn )
+ {
+ }
+
+ // IValueSource
+ virtual ::rtl::OUString getString() const { return m_xColumn->getString(); };
+ virtual sal_Bool getBoolean() const { return m_xColumn->getBoolean(); };
+ virtual sal_Int8 getByte() const { return m_xColumn->getByte(); };
+ virtual sal_Int16 getShort() const { return m_xColumn->getShort(); }
+ virtual sal_Int32 getInt() const { return m_xColumn->getInt(); }
+ virtual sal_Int64 getLong() const { return m_xColumn->getLong(); }
+ virtual float getFloat() const { return m_xColumn->getFloat(); };
+ virtual double getDouble() const { return m_xColumn->getDouble(); };
+ virtual Date getDate() const { return m_xColumn->getDate(); };
+ virtual Time getTime() const { return m_xColumn->getTime(); };
+ virtual DateTime getTimestamp() const { return m_xColumn->getTimestamp(); };
+ virtual Sequence< sal_Int8 > getBytes() const { return m_xColumn->getBytes(); };
+ virtual Reference< XInputStream > getBinaryStream() const { return m_xColumn->getBinaryStream(); };
+ virtual Reference< XInputStream > getCharacterStream() const { return m_xColumn->getCharacterStream(); };
+ virtual sal_Bool wasNull() const { return m_xColumn->wasNull( ); };
+
+ private:
+ const Reference< XColumn > m_xColumn;
+ };
+}
+
+// -----------------------------------------------------------------------------
+void ORowSetValue::fill( const sal_Int32 _nType, const Reference< XColumn >& _rxColumn )
+{
+ detail::ColumnValue aColumnValue( _rxColumn );
+ impl_fill( _nType, sal_True, aColumnValue );
+}
+
+// -----------------------------------------------------------------------------
+void ORowSetValue::fill( sal_Int32 _nPos, sal_Int32 _nType, sal_Bool _bNullable, const Reference< XRow>& _xRow )
+{
+ detail::RowValue aRowValue( _xRow, _nPos );
+ impl_fill( _nType, _bNullable, aRowValue );
+}
+
// -----------------------------------------------------------------------------
void ORowSetValue::fill(sal_Int32 _nPos,
sal_Int32 _nType,
@@ -1819,10 +1923,8 @@ void ORowSetValue::fill(sal_Int32 _nPos,
}
// -----------------------------------------------------------------------------
-void ORowSetValue::fill(sal_Int32 _nPos,
- sal_Int32 _nType,
- sal_Bool _bNullable,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow)
+void ORowSetValue::impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const detail::IValueSource& _rValueSource )
+
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill (2)" );
sal_Bool bReadData = sal_True;
@@ -1833,63 +1935,63 @@ void ORowSetValue::fill(sal_Int32 _nPos,
case DataType::DECIMAL:
case DataType::NUMERIC:
case DataType::LONGVARCHAR:
- (*this) = _xRow->getString(_nPos);
+ (*this) = _rValueSource.getString();
break;
case DataType::BIGINT:
if ( isSigned() )
- (*this) = _xRow->getLong(_nPos);
+ (*this) = _rValueSource.getLong();
else
- (*this) = _xRow->getString(_nPos);
+ (*this) = _rValueSource.getString();
break;
case DataType::FLOAT:
- (*this) = _xRow->getFloat(_nPos);
+ (*this) = _rValueSource.getFloat();
break;
case DataType::DOUBLE:
case DataType::REAL:
- (*this) = _xRow->getDouble(_nPos);
+ (*this) = _rValueSource.getDouble();
break;
case DataType::DATE:
- (*this) = _xRow->getDate(_nPos);
+ (*this) = _rValueSource.getDate();
break;
case DataType::TIME:
- (*this) = _xRow->getTime(_nPos);
+ (*this) = _rValueSource.getTime();
break;
case DataType::TIMESTAMP:
- (*this) = _xRow->getTimestamp(_nPos);
+ (*this) = _rValueSource.getTimestamp();
break;
case DataType::BINARY:
case DataType::VARBINARY:
case DataType::LONGVARBINARY:
- (*this) = _xRow->getBytes(_nPos);
+ (*this) = _rValueSource.getBytes();
break;
case DataType::BIT:
case DataType::BOOLEAN:
- (*this) = _xRow->getBoolean(_nPos);
+ (*this) = _rValueSource.getBoolean();
break;
case DataType::TINYINT:
if ( isSigned() )
- (*this) = _xRow->getByte(_nPos);
+ (*this) = _rValueSource.getByte();
else
- (*this) = _xRow->getShort(_nPos);
+ (*this) = _rValueSource.getShort();
break;
case DataType::SMALLINT:
if ( isSigned() )
- (*this) = _xRow->getShort(_nPos);
+ (*this) = _rValueSource.getShort();
else
- (*this) = _xRow->getInt(_nPos);
+ (*this) = _rValueSource.getInt();
break;
case DataType::INTEGER:
if ( isSigned() )
- (*this) = _xRow->getInt(_nPos);
+ (*this) = _rValueSource.getInt();
else
- (*this) = _xRow->getLong(_nPos);
+ (*this) = _rValueSource.getLong();
break;
case DataType::CLOB:
- (*this) = ::com::sun::star::uno::makeAny(_xRow->getCharacterStream(_nPos));
+ (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getCharacterStream());
setTypeKind(DataType::CLOB);
break;
case DataType::BLOB:
- (*this) = ::com::sun::star::uno::makeAny(_xRow->getBinaryStream(_nPos));
+ (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getBinaryStream());
setTypeKind(DataType::BLOB);
break;
default:
@@ -1897,7 +1999,7 @@ void ORowSetValue::fill(sal_Int32 _nPos,
bReadData = false;
break;
}
- if ( bReadData && _bNullable && _xRow->wasNull() )
+ if ( bReadData && _bNullable && _rValueSource.wasNull() )
setNull();
setTypeKind(_nType);
}
@@ -2043,3 +2145,5 @@ void ORowSetValue::fill(const Any& _rValue)
break;
}
}
+
+} // namespace connectivity
diff --git a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
index 1a763b0c10..0fb5336bba 100644
--- a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
+++ b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
@@ -144,7 +144,8 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) throw(SQ
::dbtools::throwGenericSQLException(sError,*this);
}
}
-
+
+ ::connectivity::ODatabaseMetaDataResultSet::ORows aTypeInfoRows;
while( xRet->next() )
{
::connectivity::ODatabaseMetaDataResultSet::ORow aRow;
@@ -169,8 +170,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) throw(SQ
else
++aIter;
}
- m_aTypeInfoRows.push_back(aRow);
+ aTypeInfoRows.push_back(aRow);
}
+ m_aTypeInfoRows = aTypeInfoRows;
}
}
::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
diff --git a/connectivity/source/drivers/file/quotedstring.cxx b/connectivity/source/drivers/file/quotedstring.cxx
index 2b78034b2d..e35c3c0caf 100644
--- a/connectivity/source/drivers/file/quotedstring.cxx
+++ b/connectivity/source/drivers/file/quotedstring.cxx
@@ -152,7 +152,6 @@ namespace connectivity
// Vorzeitiger Abbruch der Schleife moeglich, denn
// wir haben, was wir wollten.
nStartPos = i+1;
- *pData = 0;
break;
}
else
@@ -161,6 +160,7 @@ namespace connectivity
}
}
} // for( xub_StrLen i = nStartPos; i < nLen; ++i )
+ *pData = 0;
_rStr.ReleaseBufferAccess(xub_StrLen(pData - pStart));
}
}
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index 243aa6b802..e00cb38da2 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -55,6 +55,7 @@
#include <connectivity/dbexception.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <unotools/confignode.hxx>
+#include <unotools/ucbstreamhelper.hxx>
#include "resource/hsqldb_res.hrc"
#include "resource/sharedresources.hxx"
@@ -70,6 +71,8 @@ namespace connectivity
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::embed;
+ using namespace ::com::sun::star::io;
+ using namespace ::com::sun::star::task;
using namespace ::com::sun::star::reflection;
namespace hsqldb
@@ -259,6 +262,50 @@ namespace connectivity
makeAny( lcl_getPermittedJavaMethods_nothrow( m_xFactory ) )
);
aProperties.put( "SystemProperties", Sequence< NamedValue >( &aPermittedClasses, 1 ) );
+
+ const ::rtl::OUString sProperties( RTL_CONSTASCII_USTRINGPARAM( "properties" ) );
+ ::rtl::OUString sMessage;
+ try
+ {
+ if ( !bIsNewDatabase && xStorage->isStreamElement(sProperties) )
+ {
+ Reference<XStream > xStream = xStorage->openStreamElement(sProperties,ElementModes::READ);
+ if ( xStream.is() )
+ {
+ ::std::auto_ptr<SvStream> pStream( ::utl::UcbStreamHelper::CreateStream(xStream) );
+ if ( pStream.get() )
+ {
+ ByteString sLine;
+ while ( pStream->ReadLine(sLine) )
+ {
+ if ( sLine.Equals("version=",0,sizeof("version=")-1) )
+ {
+ sLine = sLine.GetToken(1,'=');
+ const sal_Int32 nMajor = sLine.GetToken(0,'.').ToInt32();
+ const sal_Int32 nMinor = sLine.GetToken(1,'.').ToInt32();
+ const sal_Int32 nMicro = sLine.GetToken(2,'.').ToInt32();
+ if ( nMajor > 1
+ || ( nMajor == 1 && nMinor > 8 )
+ || ( nMajor == 1 && nMinor == 8 && nMicro > 0 ) )
+ {
+ ::connectivity::SharedResources aResources;
+ sMessage = aResources.getResourceString(STR_ERROR_NEW_VERSION);
+ }
+ break;
+ }
+ }
+ }
+ } // if ( xStream.is() )
+ ::comphelper::disposeComponent(xStream);
+ }
+ }
+ catch(Exception&)
+ {
+ }
+ if ( sMessage.getLength() )
+ {
+ ::dbtools::throwGenericSQLException(sMessage ,*this);
+ }
// readonly?
Reference<XPropertySet> xProp(xStorage,UNO_QUERY);
diff --git a/connectivity/source/drivers/hsqldb/makefile.mk b/connectivity/source/drivers/hsqldb/makefile.mk
index 9ed5acb17d..c61e4b297b 100644
--- a/connectivity/source/drivers/hsqldb/makefile.mk
+++ b/connectivity/source/drivers/hsqldb/makefile.mk
@@ -102,6 +102,7 @@ SHL1STDLIBS=\
$(DBTOOLSLIB) \
$(JVMFWKLIB) \
$(COMPHELPERLIB) \
+ $(TOOLSLIB) \
$(UNOTOOLSLIB)
diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
index 9b4b05868c..00f76ddeb8 100644
--- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk
+++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
@@ -30,37 +30,35 @@
#*************************************************************************
CALL_CDECL=TRUE
-#mozilla specific stuff.
-MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT)
-MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla
-#End of mozilla specific stuff.
-
PRJ=..$/..$/..$/..
PRJINC=..$/..$/..
PRJNAME=connectivity
TARGET=mozbootstrap
-USE_DEFFILE=TRUE
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
.IF "$(OS)" == "OS2"
all:
@echo " Not building under OS/2"
.ENDIF
# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
+USE_DEFFILE=TRUE
+ENABLE_EXCEPTIONS=TRUE
+VISIBILITY_HIDDEN=TRUE
+
+# --- begin of mozilla specific stuff
+MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT)
+MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla
+# --- end of mozilla specific stuff
.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/version.mk
+.INCLUDE : ../makefile_mozab.mk
+
+INCPRE += -I../mozillasrc
-#mozilla specific stuff.
# --- Files -------------------------------------
SLOFILES += \
@@ -93,95 +91,6 @@ SLOFILES += \
$(SLO)$/MNSProfileDirServiceProvider.obj
.ENDIF
-CDEFS += -DMOZILLA_INTERNAL_API
-
-.IF "$(GUI)"=="UNX"
-.IF "$(COMNAME)"=="sunpro5"
-CFLAGS += -features=tmplife
-#This flag is needed to build mozilla 1.7 code
-.ENDIF # "$(COMNAME)"=="sunpro5"
-.ENDIF
-
-MOZINC = . -I.. -I..$/mozillasrc -I$(MOZ_INC) -I$(MOZ_INC)$/nspr -I$(MOZ_INC)$/xpcom \
- -I$(MOZ_INC)$/string -I$(MOZ_INC)$/rdf -I$(MOZ_INC)$/msgbase \
- -I$(MOZ_INC)$/addrbook -I$(MOZ_INC)$/mork -I$(MOZ_INC)$/locale \
- -I$(MOZ_INC)$/pref -I$(MOZ_INC)$/mime -I$(MOZ_INC)$/chrome \
- -I$(MOZ_INC)$/necko -I$(MOZ_INC)$/intl -I$(MOZ_INC)$/profile \
- -I$(MOZ_INC)$/embed_base -I$(MOZ_INC)$/mozldap -I$(MOZ_INC)$/uconv\
- -I$(MOZ_INC)$/xpcom_obsolete -I$(MOZ_INC)$/content
-
-.IF "$(GUI)" == "WNT"
-.IF "$(COM)" == "GCC"
-INCPOST += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL
-CFLAGSCXX += \
- -fno-rtti -Wall -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long
-.ELSE
-.IF "$(DBG_LEVEL)" == "0"
-INCPRE += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DDMSVC4 -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \
- -UDEBUG
-CFLAGS += -GR- -W3 -Gy -MD -UDEBUG
-.ELSE
-INCPRE += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DDMSVC4 -DDEVELOPER_DEBUG -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DDEBUG_Administrator -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \
- -UDEBUG
-CFLAGS += -Zi -GR- -W3 -Gy -MDd -UDEBUG
-.IF "$(CCNUMVER)" >= "001399999999"
-CDEFS += -D_STL_NOFORCE_MANIFEST
-.ENDIF
-.ENDIF
-.ENDIF
-.ENDIF
-.IF "$(GUI)" == "UNX"
-INCPOST += $(MOZINC)
-CDEFS+= -DMOZILLA_CLIENT \
- -DXP_UNIX
-.IF "$(OS)" == "LINUX"
-CFLAGS += -fPIC -g
-CDEFS+= -DOJI
-
-CFLAGSCXX += \
- -fno-rtti -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long -pthread
-CDEFS += -DTRACING
-.ELIF "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX"
-CFLAGS += -fPIC
-CFLAGSCXX += \
- -fno-rtti -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long -Wno-deprecated
-CDEFS += -DTRACING
-.ENDIF
-
-SHL1TARGET_NAME=$(TARGET)$(MOZAB_MAJOR)
-
-.ENDIF # MACOSX
-
# --- Targets ----------------------------------
.INCLUDE : target.mk
diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk
index 677e605096..76161dc321 100644
--- a/connectivity/source/drivers/mozab/makefile.mk
+++ b/connectivity/source/drivers/mozab/makefile.mk
@@ -43,38 +43,28 @@ all:
@echo " see http://www.mozilla.org/issues/show_bug.cgi?id=91209"
.ENDIF
-#mozilla specific stuff.
+# --- begin of mozilla specific stuff
MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT)
MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla
.IF "$(OS)"=="WNT"
-.IF "$(USE_SHELL)"=="4nt"
-MOZ_EMBED_LIB := $(shell @+-dir /ba:f $(MOZ_LIB)$/embed_base_s.lib 2>NUL )
-MOZ_REG_LIB := $(shell @+-dir /ba:f $(MOZ_LIB)$/mozreg_s.lib 2>NUL )
-.ELSE #"$(USE_SHELL)"=="4nt"
-MOZ_EMBED_LIB := $(shell @-test -f $(MOZ_LIB)$/embed_base_s.lib && echo $(MOZ_LIB)$/embed_base_s.lib )
-MOZ_REG_LIB := $(shell @-test -f $(MOZ_LIB)$/mozreg_s.lib && echo $(MOZ_LIB)$/mozreg_s.lib )
-.ENDIF
+ MOZ_EMBED_LIB := $(shell @-test -f $(MOZ_LIB)$/embed_base_s.lib && echo $(MOZ_LIB)$/embed_base_s.lib )
+ MOZ_REG_LIB := $(shell @-test -f $(MOZ_LIB)$/mozreg_s.lib && echo $(MOZ_LIB)$/mozreg_s.lib )
-.IF X"$(MOZ_EMBED_LIB)"=="X"
-MOZ_EMBED_LIB := $(MOZ_LIB)$/baseembed_s.lib
-.ENDIF
-.IF X"$(MOZ_REG_LIB)" == "X"
-MOZ_REG_LIB := $(MOZ_LIB)$/mozreg.lib
-.ENDIF
-.ENDIF
+ MOZ_EMBED_LIB *:= $(MOZ_LIB)$/baseembed_s.lib
+ MOZ_REG_LIB *:= $(MOZ_LIB)$/mozreg.lib
+
+ .IF "$(COM)"=="GCC"
+ MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom -lxpcom_core
+ .ELSE
+ LIB += $(MOZ_LIB)
+ MOZ_LIB_XPCOM= $(MOZ_EMBED_LIB) $(MOZ_LIB)$/nspr4.lib $(MOZ_REG_LIB) $(MOZ_LIB)$/xpcom.lib $(MOZ_LIB)$/xpcom_core.lib
+ .ENDIF
-.IF "$(OS)"=="WNT"
-.IF "$(COM)"=="GCC"
-MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom -lxpcom_core
-.ELSE
-LIB += $(MOZ_LIB)
-MOZ_LIB_XPCOM= $(MOZ_EMBED_LIB) $(MOZ_LIB)$/nspr4.lib $(MOZ_REG_LIB) $(MOZ_LIB)$/xpcom.lib $(MOZ_LIB)$/xpcom_core.lib
-.ENDIF
.ELSE "$(OS)"=="WNT"
-MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lnspr4 -lxpcom_core -lmozreg_s -lembed_base_s
+ MOZ_LIB_XPCOM = -L$(MOZ_LIB) -lnspr4 -lxpcom_core -lmozreg_s -lembed_base_s
.ENDIF
-#End of mozilla specific stuff.
+# --- end of mozilla specific stuff
USE_DEFFILE=TRUE
ENABLE_EXCEPTIONS=TRUE
@@ -87,10 +77,6 @@ COMPONENT_CONFIG_SCHEMA=$(TARGET)2.xcs
# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
@@ -121,7 +107,6 @@ DEF1NAME= $(SHL1TARGET)
DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \
$(SLB)$/$(TARGET).lib
DEFLIB1NAME=$(TARGET)
-#DEF1EXPORTFILE= exports.dxp
# --- Files -------------------------------------
@@ -165,6 +150,7 @@ DEPOBJFILES=$(SLO2FILES)
# --- MOZAB BASE Library -----------------------------------
SHL2VERSIONMAP= $(TARGET2).map
+SHL2NOCHECK=TRUE
SHL2TARGET= $(TARGET2)$(DLLPOSTFIX)
SHL2OBJS=$(SLO2FILES)
SHL2STDLIBS=\
diff --git a/connectivity/source/drivers/mozab/makefile_mozab.mk b/connectivity/source/drivers/mozab/makefile_mozab.mk
new file mode 100644
index 0000000000..28b56ec2a8
--- /dev/null
+++ b/connectivity/source/drivers/mozab/makefile_mozab.mk
@@ -0,0 +1,128 @@
+#*************************************************************************
+#
+# 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
+#
+# 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.
+#
+#*************************************************************************
+
+CDEFS += -DMOZILLA_INTERNAL_API
+
+.IF "$(GUI)"=="UNX"
+ .IF "$(COMNAME)"=="sunpro5"
+ CFLAGS += -features=tmplife
+ #This flag is needed to build mozilla 1.7 code
+ .ENDIF # "$(COMNAME)"=="sunpro5"
+.ENDIF
+
+MOZINC = . \
+ -I.. \
+ -I$(MOZ_INC) \
+ -I$(MOZ_INC)$/nspr \
+ -I$(MOZ_INC)$/xpcom \
+ -I$(MOZ_INC)$/string \
+ -I$(MOZ_INC)$/rdf \
+ -I$(MOZ_INC)$/msgbase \
+ -I$(MOZ_INC)$/addrbook \
+ -I$(MOZ_INC)$/mork \
+ -I$(MOZ_INC)$/locale \
+ -I$(MOZ_INC)$/pref \
+ -I$(MOZ_INC)$/mime \
+ -I$(MOZ_INC)$/chrome \
+ -I$(MOZ_INC)$/necko \
+ -I$(MOZ_INC)$/intl \
+ -I$(MOZ_INC)$/profile \
+ -I$(MOZ_INC)$/embed_base \
+ -I$(MOZ_INC)$/mozldap \
+ -I$(MOZ_INC)$/uconv \
+ -I$(MOZ_INC)$/xpcom_obsolete \
+ -I$(MOZ_INC)$/content
+
+.IF "$(GUI)" == "WNT"
+ CDEFS += \
+ -DMOZILLA_CLIENT \
+ -DXP_PC \
+ -DXP_WIN \
+ -DXP_WIN32 \
+ -DOJI \
+ -DWIN32 \
+ -D_X86_ \
+ -D_WINDOWS \
+ -DMOZ_XUL \
+ -DMOZ_REFLOW_PERF \
+ -DMOZ_REFLOW_PERF_DSP
+ .IF "$(COM)" == "GCC"
+ INCPOST += $(MOZINC)
+ CFLAGSCXX += \
+ -fno-rtti \
+ -Wall \
+ -Wconversion \
+ -Wpointer-arith \
+ -Wcast-align \
+ -Woverloaded-virtual \
+ -Wsynth \
+ -Wno-long-long
+ .ELSE # .IF "$(COM)" == "GCC"
+ INCPRE += $(MOZINC)
+ .IF "$(DBG_LEVEL)" != "0"
+ .IF "$(CCNUMVER)" >= "001399999999"
+ CDEFS += -D_STL_NOFORCE_MANIFEST
+ .ENDIF # .IF "$(CCNUMVER)" >= "001399999999"
+ .ENDIF # .IF "$(DBG_LEVEL)" != "0"
+ .ENDIF # .IF "$(COM)" == "GCC"
+.ENDIF # .IF "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "UNX"
+ INCPOST += $(MOZINC)
+ CDEFS+= -DMOZILLA_CLIENT \
+ -DXP_UNIX
+ .IF "$(OS)" == "LINUX"
+ CFLAGS += -fPIC -g
+ CDEFS += -DOJI
+ CFLAGSCXX += \
+ -fno-rtti \
+ -Wconversion \
+ -Wpointer-arith \
+ -Wcast-align \
+ -Woverloaded-virtual \
+ -Wsynth \
+ -Wno-long-long \
+ -pthread
+ CDEFS += -DTRACING
+ .ELIF "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX"
+ CFLAGS += -fPIC
+ CFLAGSCXX += \
+ -fno-rtti \
+ -Wconversion \
+ -Wpointer-arith \
+ -Wcast-align \
+ -Woverloaded-virtual \
+ -Wsynth \
+ -Wno-long-long \
+ -Wno-deprecated
+ CDEFS += -DTRACING
+ .ENDIF # "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX"
+
+ SHL1TARGET_NAME=$(TARGET)$(MOZAB_MAJOR)
+
+.ENDIF # "$(GUI)" == "UNX"
+
diff --git a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
index e31d4c7e41..1e5b39e0f1 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
+++ b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
@@ -40,16 +40,12 @@ PRJINC=..$/..$/..
PRJNAME=connectivity
TARGET=mozabsrc
+# --- Settings ----------------------------------
+
USE_DEFFILE=TRUE
ENABLE_EXCEPTIONS=TRUE
VISIBILITY_HIDDEN=TRUE
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-
.INCLUDE : settings.mk
.IF ("$(SYSTEM_MOZILLA)" == "YES" && "$(WITH_MOZILLA)" == "YES") || "$(WITH_MOZILLA)" == "NO" || "$(OS)" == "OS2"
@@ -61,8 +57,10 @@ dummy:
.INCLUDE : $(PRJ)$/version.mk
+.INCLUDE : ../makefile_mozab.mk
+
+INCPRE += -I../bootstrap
-#mozilla specific stuff.
# --- Files -------------------------------------
SLOFILES = \
@@ -74,98 +72,9 @@ SLOFILES = \
$(SLO)$/MNSMozabProxy.obj \
$(SLO)$/MNSTerminateListener.obj \
$(SLO)$/MLdapAttributeMap.obj \
-
-
-CDEFS += -DMOZILLA_INTERNAL_API
-.IF "$(GUI)"=="UNX"
-.IF "$(COMNAME)"=="sunpro5"
-CFLAGS += -features=tmplife
-#This flag is needed to build mozilla 1.7 code
-.ENDIF # "$(COMNAME)"=="sunpro5"
.ENDIF
-MOZINC = . -I.. -I..$/bootstrap -I$(MOZ_INC) -I$(MOZ_INC)$/nspr -I$(MOZ_INC)$/xpcom \
- -I$(MOZ_INC)$/string -I$(MOZ_INC)$/rdf -I$(MOZ_INC)$/msgbase \
- -I$(MOZ_INC)$/addrbook -I$(MOZ_INC)$/mork -I$(MOZ_INC)$/locale \
- -I$(MOZ_INC)$/pref -I$(MOZ_INC)$/mime -I$(MOZ_INC)$/chrome \
- -I$(MOZ_INC)$/necko -I$(MOZ_INC)$/intl -I$(MOZ_INC)$/profile \
- -I$(MOZ_INC)$/embed_base -I$(MOZ_INC)$/mozldap -I$(MOZ_INC)$/uconv\
- -I$(MOZ_INC)$/xpcom_obsolete -I$(MOZ_INC)$/content
-
-.IF "$(GUI)" == "WNT"
-.IF "$(COM)"=="GCC"
-INCPOST += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL
-CFLAGSCXX += \
- -fno-rtti -Wall -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long
-.ELSE
-.IF "$(DBG_LEVEL)" == "0"
-INCPRE += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DDMSVC4 -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \
- -UDEBUG
-CFLAGS += -GR- -W3 -Gy -MD -UDEBUG
-.ELSE
-INCPRE += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DDMSVC4 -DDEVELOPER_DEBUG -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DDEBUG_Administrator -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \
- -UDEBUG
-CFLAGS += -Zi -GR- -W3 -Gy -MDd -UDEBUG
-.IF "$(CCNUMVER)" >= "001399999999"
-CDEFS += -D_STL_NOFORCE_MANIFEST
-.ENDIF
-.ENDIF
-.ENDIF
-.ENDIF
-.IF "$(GUI)" == "UNX"
-INCPOST += $(MOZINC)
-CDEFS+= -DMOZILLA_CLIENT \
- -DXP_UNIX
-.IF "$(OS)" == "LINUX"
-CFLAGS += -fPIC -g
-CDEFS+= -DOJI
-
-CFLAGSCXX += \
- -fno-rtti -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long -pthread
-CDEFS += -DTRACING
-.ELIF "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX"
-CFLAGS += -fPIC
-CFLAGSCXX += \
- -fno-rtti -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long -Wno-deprecated
-CDEFS += -DTRACING
-.ENDIF
-.ENDIF
-
-SHL1TARGET_NAME=$(TARGET)$(MOZAB_MAJOR)
-
-.ENDIF # MACOSX
-
# --- Targets ----------------------------------
.INCLUDE : target.mk
diff --git a/connectivity/source/inc/resource/hsqldb_res.hrc b/connectivity/source/inc/resource/hsqldb_res.hrc
index a56fea79e8..e649cd9786 100644
--- a/connectivity/source/inc/resource/hsqldb_res.hrc
+++ b/connectivity/source/inc/resource/hsqldb_res.hrc
@@ -44,6 +44,7 @@
#define STR_NO_TABLE_EDITOR_DIALOG ( STR_HSQLDB_BASE + 3 )
#define STR_NO_TABLENAME ( STR_HSQLDB_BASE + 4 )
#define STR_NO_DOCUMENTUI ( STR_HSQLDB_BASE + 5 )
+#define STR_ERROR_NEW_VERSION ( STR_HSQLDB_BASE + 6 )
#endif // CONNECTIVITY_RESOURCE_HSQLDB_HRC
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index b4da3ba026..a359c64df1 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -2074,18 +2074,18 @@ void OSQLParseNode::absorptions(OSQLParseNode*& pSearchCondition)
if ( SQL_ISRULE(p2ndSearch,boolean_primary) )
p2ndSearch = p2ndSearch->getChild(1);
- if ( *p2ndSearch->getChild(0) == *pSearchCondition->getChild(2-nPos) )
+ if ( *p2ndSearch->getChild(0) == *pSearchCondition->getChild(2-nPos) ) // a and ( a or b) -> a or b
{
pNewNode = pSearchCondition->removeAt((sal_uInt32)0);
replaceAndReset(pSearchCondition,pNewNode);
}
- else if ( *p2ndSearch->getChild(2) == *pSearchCondition->getChild(2-nPos) )
+ else if ( *p2ndSearch->getChild(2) == *pSearchCondition->getChild(2-nPos) ) // a and ( b or a) -> a or b
{
pNewNode = pSearchCondition->removeAt((sal_uInt32)2);
replaceAndReset(pSearchCondition,pNewNode);
}
- else if ( p2ndSearch->getByRule(OSQLParseNode::boolean_term) )
+ else if ( p2ndSearch->getByRule(OSQLParseNode::search_condition) )
{
// a and ( b or c ) -> ( a and b ) or ( a and c )
// ( b or c ) and a -> ( a and b ) or ( a and c )
@@ -2096,7 +2096,13 @@ void OSQLParseNode::absorptions(OSQLParseNode*& pSearchCondition)
OSQLParseNode* p1stAnd = MakeANDNode(pA,pB);
OSQLParseNode* p2ndAnd = MakeANDNode(new OSQLParseNode(*pA),pC);
pNewNode = MakeORNode(p1stAnd,p2ndAnd);
- replaceAndReset(pSearchCondition,pNewNode);
+ OSQLParseNode* pNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
+ pNode->append(new OSQLParseNode(::rtl::OUString::createFromAscii("("),SQL_NODE_PUNCTUATION));
+ pNode->append(pNewNode);
+ pNode->append(new OSQLParseNode(::rtl::OUString::createFromAscii(")"),SQL_NODE_PUNCTUATION));
+ OSQLParseNode::eraseBraces(p1stAnd);
+ OSQLParseNode::eraseBraces(p2ndAnd);
+ replaceAndReset(pSearchCondition,pNode);
}
}
// a or a and b || a or b and a
diff --git a/connectivity/source/resource/conn_shared_res.src b/connectivity/source/resource/conn_shared_res.src
index ea3fb4e065..bfa1b29c6d 100644
--- a/connectivity/source/resource/conn_shared_res.src
+++ b/connectivity/source/resource/conn_shared_res.src
@@ -645,3 +645,8 @@ String STR_NO_DOCUMENTUI
{
Text [ en-US ] = "The provided DocumentUI is not allowed to be NULL.";
};
+String STR_ERROR_NEW_VERSION
+{
+ Text = "The connection could not be established. The database was created by a newer version of %PRODUCTNAME.";
+};
+
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 7f937bbd79..aadf6bc625 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1468,6 +1468,13 @@ void Desktop::Main()
xContainerWindow = xBackingFrame->getContainerWindow();
if (xContainerWindow.is())
{
+ // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank"
+ // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior,
+ // otherwise documents loaded into this frame will later on miss functionality depending on the style.
+ Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
+ OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" );
+ pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT );
+
SetSplashScreenProgress(75);
Sequence< Any > lArgs(1);
lArgs[0] <<= xContainerWindow;
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index ea05a7394b..2620a1f29a 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -284,8 +284,8 @@ private:
css::uno::Reference< css::uno::XComponentContext > m_context;
UpdateDialog & m_dialog;
std::vector< dp_gui::TUpdateListEntry > m_vExtensionList;
- css::uno::Reference< css::deployment::XUpdateInformationProvider >
- m_updateInformation;
+ css::uno::Reference< css::deployment::XUpdateInformationProvider > m_updateInformation;
+ css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHdl;
// guarded by Application::GetSolarMutex():
css::uno::Reference< css::task::XAbortChannel > m_abort;
@@ -302,7 +302,21 @@ UpdateDialog::Thread::Thread(
m_updateInformation(
css::deployment::UpdateInformationProvider::create(context)),
m_stop(false)
-{}
+{
+ if( m_context.is() )
+ {
+ css::uno::Reference< css::lang::XMultiComponentFactory > xServiceManager( m_context->getServiceManager() );
+
+ if( xServiceManager.is() )
+ {
+ m_xInteractionHdl = css::uno::Reference< css::task::XInteractionHandler > (
+ xServiceManager->createInstanceWithContext( OUSTR( "com.sun.star.task.InteractionHandler" ), m_context),
+ css::uno::UNO_QUERY );
+ if ( m_xInteractionHdl.is() )
+ m_updateInformation->setInteractionHandler( m_xInteractionHdl );
+ }
+ }
+}
void UpdateDialog::Thread::stop() {
css::uno::Reference< css::task::XAbortChannel > abort;
@@ -327,7 +341,11 @@ UpdateDialog::Thread::Entry::Entry(
version(theVersion)
{}
-UpdateDialog::Thread::~Thread() {}
+UpdateDialog::Thread::~Thread()
+{
+ if ( m_xInteractionHdl.is() )
+ m_updateInformation->setInteractionHandler( css::uno::Reference< css::task::XInteractionHandler > () );
+}
void UpdateDialog::Thread::execute()
{
@@ -1260,7 +1278,7 @@ IMPL_LINK( UpdateDialog, hyperlink_clicked, svt::FixedHyperlink*, pHyperlink )
{
css::uno::Reference< css::system::XSystemShellExecute > xSystemShellExecute(
m_context->getServiceManager()->createInstanceWithContext(
- ::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" ),
+ OUSTR( "com.sun.star.system.SystemShellExecute" ),
m_context), css::uno::UNO_QUERY_THROW);
//throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
xSystemShellExecute->execute(
diff --git a/desktop/source/migration/pages.cxx b/desktop/source/migration/pages.cxx
index b430e235c0..544ea04dee 100644
--- a/desktop/source/migration/pages.cxx
+++ b/desktop/source/migration/pages.cxx
@@ -373,9 +373,11 @@ UserPage::UserPage( svt::OWizardMachine* parent, const ResId& resid)
SvtUserOptions aUserOpt;
m_edFirst.SetText(aUserOpt.GetFirstName());
m_edLast.SetText(aUserOpt.GetLastName());
+#if 0
rtl::OUString aUserName;
vos::OSecurity().getUserName( aUserName );
aUserOpt.SetID( aUserName );
+#endif
m_edInitials.SetText(aUserOpt.GetID());
if (m_lang == LANGUAGE_RUSSIAN)
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx
index 69e8baed31..b52c8b7c43 100644
--- a/embeddedobj/source/general/docholder.cxx
+++ b/embeddedobj/source/general/docholder.cxx
@@ -83,6 +83,7 @@
#include <rtl/process.h>
#include <comphelper/processfactory.hxx>
+#include <comphelper/namedvaluecollection.hxx>
#include "docholder.hxx"
#include "commonembobj.hxx"
@@ -1025,20 +1026,14 @@ sal_Bool DocumentHolder::LoadDocToFrame( sal_Bool bInPlace )
if ( xDoc.is() )
{
// load new document in to the frame
- uno::Reference< frame::XComponentLoader > xComponentLoader( m_xFrame, uno::UNO_QUERY );
- if( !xComponentLoader.is() )
- throw uno::RuntimeException();
+ uno::Reference< frame::XComponentLoader > xComponentLoader( m_xFrame, uno::UNO_QUERY_THROW );
- uno::Sequence< beans::PropertyValue > aArgs( bInPlace ? 3 : 2 );
- aArgs[0].Name = ::rtl::OUString::createFromAscii( "Model" );
- aArgs[0].Value <<= m_xComponent;
- aArgs[1].Name = ::rtl::OUString::createFromAscii( "ReadOnly" );
- aArgs[1].Value <<= m_bReadOnly;
+ ::comphelper::NamedValueCollection aArgs;
+ aArgs.put( "Model", m_xComponent );
+ aArgs.put( "ReadOnly", m_bReadOnly );
+ //aArgs.put( "Hidden", sal_True );
if ( bInPlace )
- {
- aArgs[2].Name = ::rtl::OUString::createFromAscii( "PluginMode" );
- aArgs[2].Value <<= sal_Int16(1);
- }
+ aArgs.put( "PluginMode", sal_Int16(1) );
::rtl::OUString sUrl;
uno::Reference< lang::XServiceInfo> xServiceInfo(xDoc,uno::UNO_QUERY);
if ( xServiceInfo.is()
@@ -1055,7 +1050,7 @@ sal_Bool DocumentHolder::LoadDocToFrame( sal_Bool bInPlace )
xComponentLoader->loadComponentFromURL( sUrl,
rtl::OUString::createFromAscii( "_self" ),
0,
- aArgs );
+ aArgs.getPropertyValues() );
return sal_True;
}
diff --git a/fpicker/source/aqua/SalAquaPicker.cxx b/fpicker/source/aqua/SalAquaPicker.cxx
index 8face272e4..c084c71a25 100644
--- a/fpicker/source/aqua/SalAquaPicker.cxx
+++ b/fpicker/source/aqua/SalAquaPicker.cxx
@@ -208,7 +208,10 @@ int SalAquaPicker::run()
}
if (retVal == NSFileHandlingPanelOKButton) {
- implsetDisplayDirectory([[NSURL fileURLWithPath:[m_pDialog directory]] OUStringForInfo:FULLPATH]);
+ NSString* pDir = [m_pDialog directory];
+ if (pDir) {
+ implsetDisplayDirectory([[NSURL fileURLWithPath:pDir] OUStringForInfo:FULLPATH]);
+ }
}
DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal);
diff --git a/framework/inc/macros/registration.hxx b/framework/inc/macros/registration.hxx
index 153f588322..f79d22edbe 100644
--- a/framework/inc/macros/registration.hxx
+++ b/framework/inc/macros/registration.hxx
@@ -139,7 +139,7 @@ ________________________________________________________________________________
// define helper to get information about service environment
//*****************************************************************************************************************
#define COMPONENTGETIMPLEMENTATIONENVIRONMENT \
- extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvironmentTypeName , \
+ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvironmentTypeName , \
uno_Environment** ) \
{ \
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; \
@@ -150,7 +150,7 @@ ________________________________________________________________________________
// define registration of service
//*****************************************************************************************************************
#define COMPONENTWRITEINFO( INFOS ) \
- extern "C" sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/ , \
+ extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/ , \
void* pRegistryKey ) \
{ \
LOG_REGISTRATION_WRITEINFO( "\t[start]\n" ) \
@@ -185,7 +185,7 @@ ________________________________________________________________________________
// define method to instanciate new services
//*****************************************************************************************************************
#define COMPONENTGETFACTORY( IFFACTORIES ) \
- extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplementationName , \
+ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName , \
void* pServiceManager , \
void* /*pRegistryKey*/ ) \
{ \
diff --git a/framework/inc/properties.h b/framework/inc/properties.h
index 9bead3c4e7..e246964b69 100644
--- a/framework/inc/properties.h
+++ b/framework/inc/properties.h
@@ -193,25 +193,26 @@ namespace framework{
//_______________________________________________
/** properties for "LayoutManager" class */
-#define LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER "MenuBarCloser"
-#define LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS "AutomaticToolbars"
-#define LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY "RefreshContextToolbarVisibility"
-#define LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI "HideCurrentUI"
-#define LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT "LockCount"
+#define LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER "MenuBarCloser"
+#define LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS "AutomaticToolbars"
+#define LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY "RefreshContextToolbarVisibility"
+#define LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI "HideCurrentUI"
+#define LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT "LockCount"
+#define LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE "PreserveContentSize"
#define LAYOUTMANAGER_PROPNAME_MENUBARCLOSER ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER )
#define LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS )
#define LAYOUTMANAGER_PROPNAME_REFRESHVISIBILITY ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY )
#define LAYOUTMANAGER_PROPNAME_HIDECURRENTUI ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI )
#define LAYOUTMANAGER_PROPNAME_LOCKCOUNT ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT )
+#define LAYOUTMANAGER_PROPNAME_PRESERVE_CONTENT_SIZE ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE )
#define LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER 0
#define LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS 1
#define LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY 2
#define LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI 3
#define LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT 4
-
-#define LAYOUTMANAGER_PROPCOUNT 5
+#define LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE 5
//_______________________________________________
/** properties for "UICommandDescription" class */
@@ -271,7 +272,7 @@ namespace framework{
#define TABWINDOWSERVICE_PROPNAME_WINDOW ::rtl::OUString::createFromAscii( TABWINDOWSERVICE_PROPNAME_ASCII_WINDOW )
#define TABWINDOWSERVICE_PROPHANDLE_WINDOW 0
-#define TABWINDOWSERVICE_PROPCOUNT 1
+#define TABWINDOWSERVICE_PROPCOUNT 1
//_______________________________________________
/** properties of tabreg service */
diff --git a/framework/inc/services.h b/framework/inc/services.h
index 5d3d248b3c..853553a82b 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -127,6 +127,7 @@ namespace framework{
#define SERVICENAME_IMAGEMANAGER DECLARE_ASCII("com.sun.star.ui.ImageManager" )
#define SERVICENAME_TABWINDOWSERVICE DECLARE_ASCII("com.sun.star.ui.dialogs.TabContainerWindow" )
#define SERVICENAME_WINDOWCONTENTFACTORYMANAGER DECLARE_ASCII("com.sun.star.ui.WindowContentFactoryManager" )
+#define SERVICENAME_DISPLAYACCESS DECLARE_ASCII("com.sun.star.awt.DisplayAccess" )
//_________________________________________________________________________________________________________________
// used implementationnames by framework
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index 7df1747c7b..8955e2b19e 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -69,6 +69,7 @@
#include <com/sun/star/ui/XUIElementFactory.hpp>
#include <com/sun/star/frame/XInplaceLayout.hpp>
#include <com/sun/star/ui/DockingArea.hpp>
+#include <com/sun/star/awt/XTopWindow2.hpp>
#include <com/sun/star/awt/XDockableWindow.hpp>
#include <com/sun/star/awt/XDockableWindowListener.hpp>
#include <com/sun/star/frame/XMenuBarMergingAcceptor.hpp>
@@ -78,8 +79,9 @@
// other includes
//_________________________________________________________________________________________________________________
#include <cppuhelper/propshlp.hxx>
+#include <cppuhelper/implbase9.hxx>
#include <cppuhelper/interfacecontainer.hxx>
-#include <cppuhelper/weak.hxx>
+#include <comphelper/propertycontainer.hxx>
#include <vcl/wintypes.hxx>
#include <svtools/miscopt.hxx>
#include <vcl/toolbox.hxx>
@@ -89,22 +91,23 @@ class MenuBar;
namespace framework
{
class GlobalSettings;
- class LayoutManager : public css::lang::XTypeProvider ,
- public css::lang::XServiceInfo ,
- public ::com::sun::star::frame::XLayoutManager ,
- public css::awt::XWindowListener ,
- public css::frame::XFrameActionListener ,
- public ::com::sun::star::ui::XUIConfigurationListener ,
- public ::com::sun::star::frame::XInplaceLayout ,
- public css::awt::XDockableWindowListener ,
- public ::com::sun::star::frame::XMenuBarMergingAcceptor,
- public css::frame::XLayoutManagerEventBroadcaster ,
+ typedef ::cppu::WeakImplHelper9 < ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::frame::XLayoutManager
+ , ::com::sun::star::awt::XWindowListener
+ , ::com::sun::star::frame::XFrameActionListener
+ , ::com::sun::star::ui::XUIConfigurationListener
+ , ::com::sun::star::frame::XInplaceLayout
+ , ::com::sun::star::awt::XDockableWindowListener
+ , ::com::sun::star::frame::XMenuBarMergingAcceptor
+ , ::com::sun::star::frame::XLayoutManagerEventBroadcaster
+ > LayoutManager_Base;
+ typedef ::comphelper::OPropertyContainer LayoutManager_PBase;
+ class LayoutManager : public LayoutManager_Base ,
// base classes
// Order is neccessary for right initialization!
private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
public ::cppu::OBroadcastHelper ,
- public ::cppu::OPropertySetHelper , // => XPropertySet / XFastPropertySet / XMultiPropertySet
- public ::cppu::OWeakObject // => XWeak, XInterface
+ public LayoutManager_PBase
{
public:
enum { DOCKINGAREAS_COUNT = 4 };
@@ -388,6 +391,7 @@ namespace framework
// layouting methods
sal_Bool implts_compareRectangles( const ::com::sun::star::awt::Rectangle& rRect1, const ::com::sun::star::awt::Rectangle& rRect2 );
+ sal_Bool implts_resizeContainerWindow( const ::com::sun::star::awt::Size& rContainerSize, const ::com::sun::star::awt::Point& rComponentPos );
::Size implts_getTopBottomDockingAreaSizes();
::Size implts_getContainerWindowOutputSize();
::com::sun::star::awt::Rectangle implts_getDockingAreaWindowSizes();
@@ -399,7 +403,8 @@ namespace framework
void implts_findNextDockingPos( ::com::sun::star::ui::DockingArea DockingArea, const ::Size& aUIElementSize, ::Point& rVirtualPos, ::Point& rPixelPos );
::com::sun::star::awt::Rectangle implts_calcDockingAreaSizes();
void implts_setDockingAreaWindowSizes( const com::sun::star::awt::Rectangle& rBorderSpace );
- sal_Bool implts_doLayout( sal_Bool bForceRequestBorderSpace );
+ sal_Bool implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_Bool bOuterResize );
+ void implts_doLayout_notify( sal_Bool bOuterResize );
// internal methods to control status/progress bar
::Size implts_getStatusBarSize();
@@ -449,15 +454,15 @@ namespace framework
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException);
- static const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > impl_getStaticPropertyDescriptor();
-
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; /** reference to factory, which has created this instance. */
css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer;
+ css::uno::Reference< css::container::XIndexAccess > m_xDisplayAccess;
css::uno::Reference< css::frame::XFrame > m_xFrame;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xModuleCfgMgr;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xDocCfgMgr;
css::uno::WeakReference< css::frame::XModel > m_xModel;
css::uno::Reference< css::awt::XWindow > m_xContainerWindow;
+ css::uno::Reference< css::awt::XTopWindow2 > m_xContainerTopWindow;
css::uno::Reference< css::awt::XWindow > m_xDockAreaWindows[DOCKINGAREAS_COUNT];
sal_Int32 m_nLockCount;
UIElementVector m_aUIElements;
@@ -474,6 +479,7 @@ namespace framework
bool m_bStoreWindowState;
bool m_bHideCurrentUI;
bool m_bGlobalSettings;
+ bool m_bPreserveContentSize;
DockingOperation m_eDockOperation;
UIElement m_aDockUIElement;
css::awt::Rectangle m_aDockingArea;
diff --git a/framework/source/helper/popupmenucontrollerbase.cxx b/framework/source/helper/popupmenucontrollerbase.cxx
index e8215eccca..8b6f75aa53 100644
--- a/framework/source/helper/popupmenucontrollerbase.cxx
+++ b/framework/source/helper/popupmenucontrollerbase.cxx
@@ -186,7 +186,9 @@ void SAL_CALL PopupMenuControllerBase::highlight( const css::awt::MenuEvent& ) t
void PopupMenuControllerBase::impl_select(const Reference< XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL)
{
Sequence<PropertyValue> aArgs;
- _xDispatch->dispatch( aURL, aArgs );
+ OSL_ENSURE(_xDispatch.is(),"PopupMenuControllerBase::impl_select: No dispatch");
+ if ( _xDispatch.is() )
+ _xDispatch->dispatch( aURL, aArgs );
}
void SAL_CALL PopupMenuControllerBase::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
@@ -204,7 +206,7 @@ void SAL_CALL PopupMenuControllerBase::select( const css::awt::MenuEvent& rEvent
xServiceManager = m_xServiceManager;
aLock.unlock();
- if ( xPopupMenu.is() && xDispatch.is() )
+ if ( xPopupMenu.is() )
{
VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu );
if ( pPopupMenu )
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index f4d4f2ce7e..03b9b02e66 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -67,17 +67,13 @@
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/XSystemDependentMenuPeer.hpp>
-#ifndef _COM_SUN_STAR_LANG_XYSTEMDEPENDENT_HPP_
#include <com/sun/star/lang/SystemDependent.hpp>
-#endif
#include <com/sun/star/awt/VclWindowPeerAttribute.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
-#ifndef _COM_SUN_STAR_UI_XMODULEUICONFIGURATIONMANAGER_HPP_
#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
-#endif
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/UIElementType.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
@@ -92,18 +88,18 @@
// other includes
//_________________________________________________________________________________________________________________
#include <svtools/imgdef.hxx>
+#include <tools/diagnose_ex.h>
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/dockingarea.hxx>
#include <vcl/svapp.hxx>
#include <vcl/i18nhelp.hxx>
#include <vcl/wall.hxx>
-#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
#include <toolkit/unohlp.hxx>
-#endif
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/uno3.hxx>
#include <rtl/logfile.hxx>
#include <svtools/cmdoptions.hxx>
@@ -354,40 +350,8 @@ static void impl_setDockingWindowVisibility( const css::uno::Reference< css::lan
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_14 ( LayoutManager ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( ::com::sun::star::frame::XLayoutManager ),
- DIRECT_INTERFACE( css::awt::XWindowListener ),
- DIRECT_INTERFACE( css::frame::XFrameActionListener ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIConfigurationListener ),
- DIRECT_INTERFACE( ::com::sun::star::frame::XInplaceLayout ),
- DIRECT_INTERFACE( css::awt::XDockableWindowListener ),
- DIRECT_INTERFACE( ::com::sun::star::frame::XMenuBarMergingAcceptor ),
- DIRECT_INTERFACE( css::frame::XLayoutManagerEventBroadcaster ),
- DERIVED_INTERFACE( css::lang::XEventListener, css::frame::XFrameActionListener ),
- DIRECT_INTERFACE( ::com::sun::star::beans::XMultiPropertySet ),
- DIRECT_INTERFACE( ::com::sun::star::beans::XFastPropertySet ),
- DIRECT_INTERFACE( ::com::sun::star::beans::XPropertySet )
- )
-
-DEFINE_XTYPEPROVIDER_14 ( LayoutManager ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- ::com::sun::star::frame::XLayoutManager ,
- css::awt::XWindowListener ,
- css::frame::XFrameActionListener ,
- css::lang::XEventListener ,
- ::com::sun::star::ui::XUIConfigurationListener ,
- ::com::sun::star::frame::XInplaceLayout ,
- css::awt::XDockableWindowListener ,
- ::com::sun::star::frame::XMenuBarMergingAcceptor ,
- css::frame::XLayoutManagerEventBroadcaster ,
- ::com::sun::star::beans::XMultiPropertySet ,
- ::com::sun::star::beans::XFastPropertySet ,
- ::com::sun::star::beans::XPropertySet
- )
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( LayoutManager, LayoutManager_Base, LayoutManager_PBase )
+IMPLEMENT_FORWARD_XINTERFACE2( LayoutManager, LayoutManager_Base, LayoutManager_PBase )
DEFINE_XSERVICEINFO_MULTISERVICE ( LayoutManager ,
::cppu::OWeakObject ,
@@ -398,15 +362,14 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( LayoutManager ,
DEFINE_INIT_SERVICE ( LayoutManager, {} )
-LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceManager ) :
- ThreadHelpBase( &Application::GetSolarMutex() )
+LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceManager )
+ : LayoutManager_Base ( )
+ , ThreadHelpBase ( &Application::GetSolarMutex() )
, ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aLock.getShareableOslMutex() )
- , ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
- , ::cppu::OWeakObject ( )
+ , LayoutManager_PBase ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
, m_xSMGR( xServiceManager )
- , m_xURLTransformer( Reference< XURLTransformer >( xServiceManager->createInstance(
- SERVICENAME_URLTRANSFORMER),
- UNO_QUERY ))
+ , m_xURLTransformer( xServiceManager->createInstance( SERVICENAME_URLTRANSFORMER ), UNO_QUERY )
+ , m_xDisplayAccess( xServiceManager->createInstance( SERVICENAME_DISPLAYACCESS ), UNO_QUERY )
, m_nLockCount( 0 )
, m_bActive( sal_False )
, m_bInplaceMenuSet( sal_False )
@@ -421,6 +384,7 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
, m_bStoreWindowState( sal_False )
, m_bHideCurrentUI( false )
, m_bGlobalSettings( sal_False )
+ , m_bPreserveContentSize( false )
, m_eDockOperation( DOCKOP_ON_COLROW )
, m_pInplaceMenuBar( NULL )
, m_xModuleManager( Reference< XModuleManager >(
@@ -462,6 +426,15 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
m_aAsyncLayoutTimer.SetTimeout( 50 );
m_aAsyncLayoutTimer.SetTimeoutHdl( LINK( this, LayoutManager, AsyncLayoutHdl ) );
+
+
+ registerProperty( LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS, LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS, css::beans::PropertyAttribute::TRANSIENT, &m_bAutomaticToolbars, ::getCppuType( &m_bAutomaticToolbars ) );
+ registerProperty( LAYOUTMANAGER_PROPNAME_HIDECURRENTUI, LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI, css::beans::PropertyAttribute::TRANSIENT, &m_bHideCurrentUI, ::getCppuType( &m_bHideCurrentUI ) );
+ registerProperty( LAYOUTMANAGER_PROPNAME_LOCKCOUNT, LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT, css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY, &m_nLockCount, getCppuType( &m_nLockCount ) );
+ registerProperty( LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER, css::beans::PropertyAttribute::TRANSIENT, &m_bMenuBarCloser, ::getCppuType( &m_bMenuBarCloser ) );
+ const sal_Bool bRefreshVisibility = sal_False;
+ registerPropertyNoMember( LAYOUTMANAGER_PROPNAME_REFRESHVISIBILITY, LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY, css::beans::PropertyAttribute::TRANSIENT, ::getCppuType( &bRefreshVisibility ), &bRefreshVisibility );
+ registerProperty( LAYOUTMANAGER_PROPNAME_PRESERVE_CONTENT_SIZE, LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE, css::beans::PropertyAttribute::TRANSIENT, &m_bPreserveContentSize, ::getCppuType( &m_bPreserveContentSize ) );
}
LayoutManager::~LayoutManager()
@@ -3240,7 +3213,7 @@ void LayoutManager::implts_updateUIElementsVisibleState( sal_Bool bSetVisible )
if ( bSetVisible )
{
implts_createNonContextSensitiveToolBars();
- doLayout();
+ implts_doLayout_notify( sal_False );
}
else
{
@@ -3516,7 +3489,7 @@ sal_Bool LayoutManager::implts_showProgressBar()
if ( !pWindow->IsVisible() )
{
pWindow->Show();
- doLayout();
+ implts_doLayout_notify( sal_False );
}
return sal_True;
}
@@ -3557,7 +3530,7 @@ sal_Bool LayoutManager::implts_hideProgressBar()
( bHideStatusBar || bInternalStatusBar ))
{
pWindow->Hide();
- doLayout();
+ implts_doLayout_notify( sal_False );
return sal_True;
}
@@ -3829,6 +3802,7 @@ throw ( RuntimeException )
{
m_aDockingArea = css::awt::Rectangle();
m_xContainerWindow = m_xDockingAreaAcceptor->getContainerWindow();
+ m_xContainerTopWindow.set( m_xContainerWindow, UNO_QUERY );
m_xContainerWindow->addWindowListener( Reference< css::awt::XWindowListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ));
// we always must keep a connection to the window of our frame for resize events
@@ -3913,7 +3887,7 @@ throw ( RuntimeException )
implts_createNonContextSensitiveToolBars();
}
implts_sortUIElements();
- implts_doLayout( sal_True );
+ implts_doLayout( sal_True, sal_False );
}
}
@@ -5477,26 +5451,33 @@ throw (RuntimeException)
implts_notifyListeners( css::frame::LayoutManagerEvents::UNLOCK, a );
if ( bDoLayout )
- doLayout();
+ implts_doLayout_notify( sal_True );
}
void SAL_CALL LayoutManager::doLayout()
throw (RuntimeException)
{
- sal_Bool bLayouted = implts_doLayout( sal_False );
+ implts_doLayout_notify( sal_True );
+}
+void LayoutManager::implts_doLayout_notify( sal_Bool bOuterResize )
+{
+ sal_Bool bLayouted = implts_doLayout( sal_False, bOuterResize );
if ( bLayouted )
implts_notifyListeners( css::frame::LayoutManagerEvents::LAYOUT, Any() );
}
-sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace )
+sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_Bool bOuterResize )
{
RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::LayoutManager::implts_doLayout" );
sal_Bool bNoLock( sal_False );
css::awt::Rectangle aCurrBorderSpace;
Reference< css::awt::XWindow > xContainerWindow;
+ Reference< css::awt::XTopWindow2 > xContainerTopWindow;
+ Reference< css::awt::XWindow > xComponentWindow;
Reference< XDockingAreaAcceptor > xDockingAreaAcceptor;
+ bool bPreserveContentSize( false );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
ReadGuard aReadLock( m_aLock );
@@ -5507,8 +5488,11 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace )
bNoLock = ( m_nLockCount == 0 );
xContainerWindow = m_xContainerWindow;
+ xContainerTopWindow = m_xContainerTopWindow;
+ xComponentWindow = m_xFrame->getComponentWindow();
xDockingAreaAcceptor = m_xDockingAreaAcceptor;
aCurrBorderSpace = m_aDockingArea;
+ bPreserveContentSize = m_bPreserveContentSize;
aReadLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -5516,7 +5500,8 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace )
if ( bNoLock &&
xDockingAreaAcceptor.is() &&
- xContainerWindow.is() )
+ xContainerWindow.is() &&
+ xComponentWindow.is() )
{
bLayouted = sal_True;
@@ -5532,11 +5517,44 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace )
if ( !bEqual || bForceRequestBorderSpace || bMustDoLayout )
{
- bGotRequestedBorderSpace = xDockingAreaAcceptor->requestDockingAreaSpace( aBorderSpace );
- if ( bGotRequestedBorderSpace )
+ // we always resize the content window (instead of the complete container window) if we're not set up
+ // to (attempt to) preserve the content window's size
+ if ( bOuterResize && !bPreserveContentSize )
+ bOuterResize = sal_False;
+
+ // maximized windows can resized their content window only, not their container window
+ if ( bOuterResize && xContainerTopWindow.is() && xContainerTopWindow->getIsMaximized() )
+ bOuterResize = sal_False;
+
+ // if the component window does not have a size (yet), then we can't use it to calc the container
+ // window size
+ css::awt::Rectangle aComponentRect = xComponentWindow->getPosSize();
+ if ( bOuterResize && ( aComponentRect.Width == 0 ) && ( aComponentRect.Height == 0 ) )
+ bOuterResize = sal_False;
+
+ bGotRequestedBorderSpace = sal_False;
+ if ( bOuterResize )
{
- xDockingAreaAcceptor->setDockingAreaSpace( aBorderSpace );
+ Reference< awt::XDevice > xDevice( xContainerWindow, uno::UNO_QUERY );
+ awt::DeviceInfo aContainerInfo = xDevice->getInfo();
+ awt::Size aRequestedSize( aComponentRect.Width + aContainerInfo.LeftInset + aContainerInfo.RightInset + aBorderSpace.X + aBorderSpace.Width,
+ aComponentRect.Height + aContainerInfo.TopInset + aContainerInfo.BottomInset + aBorderSpace.Y + aBorderSpace.Height );
+ awt::Point aComponentPos( aBorderSpace.X, aBorderSpace.Y );
+
+ bGotRequestedBorderSpace = implts_resizeContainerWindow( aRequestedSize, aComponentPos );
+ }
+
+ // if we did not do an container window resize, or it failed, then use the DockingAcceptor as usual
+ if ( !bGotRequestedBorderSpace )
+ {
+ bGotRequestedBorderSpace = xDockingAreaAcceptor->requestDockingAreaSpace( aBorderSpace );
+ if ( bGotRequestedBorderSpace )
+ xDockingAreaAcceptor->setDockingAreaSpace( aBorderSpace );
+ }
+
+ if ( bGotRequestedBorderSpace )
+ {
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
aWriteGuard.lock();
m_aDockingArea = aBorderSpace;
@@ -5603,6 +5621,52 @@ sal_Bool LayoutManager::implts_compareRectangles( const css::awt::Rectangle& rRe
( rRect1.Height == rRect2.Height ));
}
+sal_Bool LayoutManager::implts_resizeContainerWindow( const awt::Size& rContainerSize,
+ const awt::Point& rComponentPos )
+{
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ ReadGuard aReadLock( m_aLock );
+ Reference< awt::XWindow > xContainerWindow = m_xContainerWindow;
+ Reference< awt::XTopWindow2 > xContainerTopWindow = m_xContainerTopWindow;
+ Reference< awt::XWindow > xComponentWindow = m_xFrame->getComponentWindow();
+ Reference< container::XIndexAccess > xDisplayAccess = m_xDisplayAccess;
+ aReadLock.unlock();
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+
+ // calculate the maximum size we have for the container window
+ awt::Rectangle aWorkArea;
+ try
+ {
+ sal_Int32 nDisplay = xContainerTopWindow->getDisplay();
+ Reference< beans::XPropertySet > xDisplayInfo( xDisplayAccess->getByIndex( nDisplay ), UNO_QUERY_THROW );
+ OSL_VERIFY( xDisplayInfo->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WorkArea" ) ) ) >>= aWorkArea );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ if ( ( aWorkArea.Width > 0 ) && ( aWorkArea.Height > 0 ) )
+ {
+ if ( ( rContainerSize.Width > aWorkArea.Width )
+ || ( rContainerSize.Height > aWorkArea.Height )
+ )
+ return sal_False;
+ // Strictly, this is not correct. If we have a multi-screen display (css.awt.DisplayAccess.MultiDisplay == true),
+ // the the "effective work area" would be much larger than the work area of a single display, since we could in theory
+ // position the container window across multiple screens.
+ // However, this should suffice as a heuristics here ... (nobody really wants to check whethere the different screens are
+ // stacked horizontally or vertically, whether their work areas can really be combined, or are separated by non-work-areas,
+ // and the like ... right?)
+ }
+
+ // resize our container window
+ xContainerWindow->setPosSize( 0, 0, rContainerSize.Width, rContainerSize.Height, css::awt::PosSize::SIZE );
+ // position the component window
+ xComponentWindow->setPosSize( rComponentPos.X, rComponentPos.Y, 0, 0, css::awt::PosSize::POS );
+ return sal_True;
+}
+
void SAL_CALL LayoutManager::setVisible( sal_Bool bVisible )
throw (::com::sun::star::uno::RuntimeException)
{
@@ -7028,7 +7092,7 @@ IMPL_LINK( LayoutManager, AsyncLayoutHdl, Timer *, EMPTYARG )
aReadLock.unlock();
implts_setDockingAreaWindowSizes( aDockingArea );
- implts_doLayout( sal_True );
+ implts_doLayout( sal_True, sal_False );
return 0;
}
@@ -7079,7 +7143,8 @@ throw ( RuntimeException )
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
implts_reset( sal_True );
- implts_doLayout( sal_True );
+ implts_doLayout( sal_True, sal_False );
+ implts_doLayout( sal_True, sal_True );
}
else if (( aEvent.Action == FrameAction_FRAME_UI_ACTIVATED ) ||
( aEvent.Action == FrameAction_FRAME_UI_DEACTIVATING ))
@@ -7106,7 +7171,6 @@ throw ( RuntimeException )
// SAFE AREA -----------------------------------------------------------------------------------------------
implts_reset( sal_False );
-
}
}
@@ -7148,6 +7212,7 @@ throw( RuntimeException )
}
m_xInplaceMenuBar.clear();
m_xContainerWindow.clear();
+ m_xContainerTopWindow.clear();
implts_destroyDockingAreaWindows();
if ( m_xModuleCfgMgr.is() )
@@ -7198,6 +7263,7 @@ throw( RuntimeException )
}
m_xInplaceMenuBar.clear();
m_xContainerWindow.clear();
+ m_xContainerTopWindow.clear();
}
else if ( rEvent.Source == Reference< XInterface >( m_xDocCfgMgr, UNO_QUERY ))
{
@@ -7412,65 +7478,21 @@ sal_Bool SAL_CALL LayoutManager::convertFastPropertyValue( Any& aConverted
sal_Int32 nHandle ,
const Any& aValue ) throw( com::sun::star::lang::IllegalArgumentException )
{
- // Initialize state with FALSE !!!
- // (Handle can be invalid)
- sal_Bool bReturn = sal_False;
-
- switch( nHandle )
- {
- case LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER :
- bReturn = PropHelper::willPropertyBeChanged(
- com::sun::star::uno::makeAny(m_bMenuBarCloser),
- aValue,
- aOldValue,
- aConvertedValue);
- break;
- case LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS:
- bReturn = PropHelper::willPropertyBeChanged(
- com::sun::star::uno::makeAny(m_bAutomaticToolbars),
- aValue,
- aOldValue,
- aConvertedValue);
- break;
- case LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY:
- bReturn = PropHelper::willPropertyBeChanged(
- com::sun::star::uno::makeAny(sal_False),
- aValue,
- aOldValue,
- aConvertedValue);
- break;
- case LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI:
- bReturn = PropHelper::willPropertyBeChanged(
- com::sun::star::uno::makeAny(m_bHideCurrentUI),
- aValue,
- aOldValue,
- aConvertedValue);
- break;
- }
-
- // Return state of operation.
- return bReturn ;
+ return LayoutManager_PBase::convertFastPropertyValue( aConvertedValue, aOldValue, nHandle, aValue );
}
void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle ,
const com::sun::star::uno::Any& aValue ) throw( com::sun::star::uno::Exception )
{
+ if ( nHandle != LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY )
+ LayoutManager_PBase::setFastPropertyValue_NoBroadcast( nHandle, aValue );
+
switch( nHandle )
{
case LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER:
- {
- sal_Bool bCloserState = sal_False;
- aValue >>= bCloserState;
- implts_setMenuBarCloser( bCloserState );
- break;
- }
- case LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS:
- {
- sal_Bool bValue = sal_Bool();
- if ( aValue >>= bValue )
- m_bAutomaticToolbars = bValue;
+ implts_updateMenuBarClose();
break;
- }
+
case LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY:
{
sal_Bool bValue = sal_Bool();
@@ -7478,40 +7500,17 @@ void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32
implts_refreshContextToolbarsVisibility();
break;
}
+
case LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI:
- {
- sal_Bool bValue = sal_Bool();
- if ( aValue >>= bValue )
- {
- m_bHideCurrentUI = bValue;
- implts_setCurrentUIVisibility( !bValue );
- }
+ implts_setCurrentUIVisibility( !m_bHideCurrentUI );
break;
- }
}
}
void SAL_CALL LayoutManager::getFastPropertyValue( com::sun::star::uno::Any& aValue ,
sal_Int32 nHandle ) const
{
- switch( nHandle )
- {
- case LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER:
- aValue <<= m_bMenuBarCloser;
- break;
- case LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS:
- aValue <<= m_bAutomaticToolbars;
- break;
- case LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY:
- aValue <<= sal_False;
- break;
- case LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI:
- aValue <<= m_bHideCurrentUI;
- break;
- case LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT:
- aValue <<= m_nLockCount;
- break;
- }
+ LayoutManager_PBase::getFastPropertyValue( aValue, nHandle );
}
::cppu::IPropertyArrayHelper& SAL_CALL LayoutManager::getInfoHelper()
@@ -7530,9 +7529,9 @@ void SAL_CALL LayoutManager::getFastPropertyValue( com::sun::star::uno::Any& aVa
if( pInfoHelper == NULL )
{
// Define static member to give structure of properties to baseclass "OPropertySetHelper".
- // "impl_getStaticPropertyDescriptor" is a non exported and static funtion, who will define a static propertytable.
- // "sal_True" say: Table is sorted by name.
- static ::cppu::OPropertyArrayHelper aInfoHelper( impl_getStaticPropertyDescriptor(), sal_True );
+ uno::Sequence< beans::Property > aProperties;
+ describeProperties( aProperties );
+ static ::cppu::OPropertyArrayHelper aInfoHelper( aProperties, sal_True );
pInfoHelper = &aInfoHelper;
}
}
@@ -7564,28 +7563,5 @@ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CA
return (*pInfo);
}
-const com::sun::star::uno::Sequence< com::sun::star::beans::Property > LayoutManager::impl_getStaticPropertyDescriptor()
-{
- // Create a new static property array to initialize sequence!
- // Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
- // Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
- // It's necessary for methods of OPropertySetHelper.
- // ATTENTION:
- // YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
-
- static const com::sun::star::beans::Property pProperties[] =
- {
- com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS, LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ),
- com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_HIDECURRENTUI, LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ),
- com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_LOCKCOUNT, LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT, ::getCppuType((const sal_Int32*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT|com::sun::star::beans::PropertyAttribute::READONLY ),
- com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ),
- com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_REFRESHVISIBILITY, LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT )
- };
- // Use it to initialize sequence!
- static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, LAYOUTMANAGER_PROPCOUNT );
- // Return static "PropertyDescriptor"
- return lPropertyDescriptor;
-}
-
} // namespace framework
diff --git a/framework/source/layoutmanager/makefile.mk b/framework/source/layoutmanager/makefile.mk
index b9b6bcf248..3af616971a 100644
--- a/framework/source/layoutmanager/makefile.mk
+++ b/framework/source/layoutmanager/makefile.mk
@@ -39,6 +39,8 @@ ENABLE_EXCEPTIONS= TRUE
.INCLUDE : settings.mk
+VISIBILITY_HIDDEN = TRUE
+
# --- Generate -----------------------------------------------------
SLOFILES= \
diff --git a/framework/source/register/makefile.mk b/framework/source/register/makefile.mk
index 1e15c55bd2..7d7f00e945 100644
--- a/framework/source/register/makefile.mk
+++ b/framework/source/register/makefile.mk
@@ -40,6 +40,8 @@ LIBTARGET= NO
.INCLUDE : settings.mk
+VISIBILITY_HIDDEN = TRUE
+
# --- Generate -----------------------------------------------------
SLOFILES= \
diff --git a/framework/source/uielement/fontmenucontroller.cxx b/framework/source/uielement/fontmenucontroller.cxx
index 320e7ffbe1..24e879b5ad 100644
--- a/framework/source/uielement/fontmenucontroller.cxx
+++ b/framework/source/uielement/fontmenucontroller.cxx
@@ -188,7 +188,9 @@ void FontMenuController::impl_select(const Reference< XDispatch >& _xDispatch,co
m_xFrame,
aTargetURL,
Sequence<PropertyValue>());
- _xDispatch->dispatch( aTargetURL, aArgs );
+ OSL_ENSURE(_xDispatch.is(),"FontMenuController::impl_select: No dispatch");
+ if ( _xDispatch.is() )
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
void SAL_CALL FontMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx
index e3ff3f2033..56a14f4ba4 100644
--- a/framework/source/uielement/fontsizemenucontroller.cxx
+++ b/framework/source/uielement/fontsizemenucontroller.cxx
@@ -326,7 +326,9 @@ void FontSizeMenuController::impl_select(const Reference< XDispatch >& _xDispatc
Sequence<PropertyValue> aArgs;
if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
UiEventLogHelper(::rtl::OUString::createFromAscii("FontSizeMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- _xDispatch->dispatch( aTargetURL, aArgs );
+ OSL_ENSURE(_xDispatch.is(),"FontSizeMenuController::impl_select: No dispatch");
+ if ( _xDispatch.is() )
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
// XPopupMenuController
diff --git a/framework/source/uielement/headermenucontroller.cxx b/framework/source/uielement/headermenucontroller.cxx
index 7882abbb94..3ab8386c87 100644
--- a/framework/source/uielement/headermenucontroller.cxx
+++ b/framework/source/uielement/headermenucontroller.cxx
@@ -254,7 +254,9 @@ void HeaderMenuController::impl_select(const Reference< XDispatch >& _xDispatch,
Sequence<PropertyValue> aArgs;
if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
UiEventLogHelper(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(m_bFooter ? "FooterMenuController" : "HeaderMenuController"))).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- _xDispatch->dispatch( aTargetURL, aArgs );
+ OSL_ENSURE(_xDispatch.is(),"HeaderMenuController::impl_select: No dispatch");
+ if ( _xDispatch.is() )
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
void SAL_CALL HeaderMenuController::updatePopupMenu() throw (::com::sun::star::uno::RuntimeException)
diff --git a/framework/source/uielement/objectmenucontroller.cxx b/framework/source/uielement/objectmenucontroller.cxx
index accc576f31..16be5513e2 100644
--- a/framework/source/uielement/objectmenucontroller.cxx
+++ b/framework/source/uielement/objectmenucontroller.cxx
@@ -160,7 +160,9 @@ void ObjectMenuController::impl_select(const Reference< XDispatch >& _xDispatch,
Sequence<PropertyValue> aArgs;
if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
UiEventLogHelper(::rtl::OUString::createFromAscii("ObjectMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- _xDispatch->dispatch( aTargetURL, aArgs );
+ OSL_ENSURE(_xDispatch.is(),"ObjectMenuController::impl_select: No dispatch");
+ if ( _xDispatch.is() )
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
}
diff --git a/framework/source/xml/menuconfiguration.cxx b/framework/source/xml/menuconfiguration.cxx
index 7dbe62e38a..2c540fd4c3 100644
--- a/framework/source/xml/menuconfiguration.cxx
+++ b/framework/source/xml/menuconfiguration.cxx
@@ -44,10 +44,6 @@
#include <xml/saxnamespacefilter.hxx>
#include <services.h>
-#ifndef _FRAMEWORK_SERVICES_LAYOUTMANAGER_HXX_
-#include <services/layoutmanager.hxx>
-#endif
-
#ifndef _FRAMEWORK_UIELEMENT_ROOTITEMCONTAINER_HXX_
#include <uielement/rootitemcontainer.hxx>
#endif
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index 7bc8c343af..3922e9f04d 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -275,7 +275,8 @@ Reference< XHyphenatedWord > SAL_CALL
return xRes;
// search for entry with that language
- LangSvcEntries_Hyph *pEntry = aSvcMap[ nLanguage ].get();
+ HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
BOOL bWordModified = FALSE;
if (!pEntry || (nMaxLeading < 0 || nMaxLeading > nWordLen))
@@ -418,7 +419,8 @@ Reference< XHyphenatedWord > SAL_CALL
return xRes;
// search for entry with that language
- LangSvcEntries_Hyph *pEntry = aSvcMap[ nLanguage ].get();
+ HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
BOOL bWordModified = FALSE;
if (!pEntry || !(0 <= nIndex && nIndex <= nWordLen - 2))
@@ -555,7 +557,8 @@ Reference< XPossibleHyphens > SAL_CALL
return xRes;
// search for entry with that language
- LangSvcEntries_Hyph *pEntry = aSvcMap[ nLanguage ].get();
+ HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (!pEntry)
{
@@ -713,8 +716,9 @@ Sequence< OUString >
// search for entry with that language and use data from that
INT16 nLanguage = LocaleToLanguage( rLocale );
- HyphenatorDispatcher *pThis = (HyphenatorDispatcher *) this;
- const LangSvcEntries_Hyph *pEntry = pThis->aSvcMap[ nLanguage ].get();
+ HyphenatorDispatcher *pThis = (HyphenatorDispatcher *) this;
+ const HyphSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) );
+ const LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (pEntry)
{
aRes = pEntry->aSvcImplNames;
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx
index e88a509ccb..6f0682e3b8 100644
--- a/linguistic/source/spelldsp.cxx
+++ b/linguistic/source/spelldsp.cxx
@@ -330,7 +330,8 @@ BOOL SpellCheckerDispatcher::isValid_Impl(
return bRes;
// search for entry with that language
- LangSvcEntries_Spell *pEntry = aSvcMap[ nLanguage ].get();
+ SpellSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (!pEntry)
{
@@ -497,7 +498,8 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
return xRes;
// search for entry with that language
- LangSvcEntries_Spell *pEntry = aSvcMap[ nLanguage ].get();
+ SpellSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (!pEntry)
{
@@ -847,8 +849,9 @@ Sequence< OUString >
// search for entry with that language and use data from that
INT16 nLanguage = LocaleToLanguage( rLocale );
- SpellCheckerDispatcher *pThis = (SpellCheckerDispatcher *) this;
- const LangSvcEntries_Spell *pEntry = pThis->aSvcMap[ nLanguage ].get();
+ SpellCheckerDispatcher *pThis = (SpellCheckerDispatcher *) this;
+ const SpellSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) );
+ const LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (pEntry)
aRes = pEntry->aSvcImplNames;
diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx
index 9ba9f9f9ce..3f3e7eddec 100644
--- a/linguistic/source/thesdsp.cxx
+++ b/linguistic/source/thesdsp.cxx
@@ -136,7 +136,8 @@ Sequence< Reference< XMeaning > > SAL_CALL
return aMeanings;
// search for entry with that language
- LangSvcEntries_Thes *pEntry = aSvcMap[ nLanguage ].get();
+ ThesSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Thes *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (!pEntry)
{
@@ -264,8 +265,9 @@ Sequence< OUString >
// search for entry with that language and use data from that
INT16 nLanguage = LocaleToLanguage( rLocale );
- ThesaurusDispatcher *pThis = (ThesaurusDispatcher *) this;
- const LangSvcEntries_Thes *pEntry = pThis->aSvcMap[ nLanguage ].get();
+ ThesaurusDispatcher *pThis = (ThesaurusDispatcher *) this;
+ const ThesSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) );
+ const LangSvcEntries_Thes *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (pEntry)
aRes = pEntry->aSvcImplNames;
diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu b/officecfg/registry/data/org/openoffice/VCL.xcu
index c053414a20..ef84c557b7 100644
--- a/officecfg/registry/data/org/openoffice/VCL.xcu
+++ b/officecfg/registry/data/org/openoffice/VCL.xcu
@@ -1651,9 +1651,9 @@
<value>Default,Serif</value>
</prop>
</node>
- <node oor:name="bitstreamveramono" oor:op="replace">
+ <node oor:name="bitstreamverasansmono" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>dejavumono</value>
+ <value>dejavusansmono;couriernew;liberationmono</value>
</prop>
<prop oor:name="SubstFontsHTML"><value>monospace</value></prop>
<prop oor:name="FontWeight"><value>Normal</value></prop>
@@ -2380,7 +2380,7 @@
</node>
<node oor:name="couriernew" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>cumberland;cumberlandamt;liberationmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
+ <value>cumberland;cumberlandamt;liberationmono;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
</prop>
<prop oor:name="SubstFontsMS"><value></value></prop>
<prop oor:name="SubstFontsPS"><value>Courier</value></prop>
@@ -2391,7 +2391,7 @@
</node>
<node oor:name="cumberland" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>cumberlandamt;couriernew;liberationmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
+ <value>cumberlandamt;couriernew;liberationmono;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
</prop>
<prop oor:name="SubstFontsMS">
<value>Courier New</value>
@@ -2414,7 +2414,7 @@
</node>
<node oor:name="cumberlandamt" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>cumberland;couriernew;liberationmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
+ <value>cumberland;couriernew;liberationmono;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
</prop>
<prop oor:name="SubstFontsMS">
<value>Courier New</value>
@@ -2501,9 +2501,9 @@
<value>Default,Serif</value>
</prop>
</node>
- <node oor:name="dejavumono" oor:op="replace">
+ <node oor:name="dejavusansmono" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>bitstreamveramono</value>
+ <value>bitstreamverasansmono;couriernew;liberationmono</value>
</prop>
<prop oor:name="SubstFontsHTML"><value>monospace</value></prop>
<prop oor:name="FontWeight"><value>Normal</value></prop>
@@ -4742,7 +4742,7 @@
</node>
<node oor:name="liberationmono" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>cumberland;cumberlandamt;couriernew;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
+ <value>cumberland;cumberlandamt;couriernew;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
</prop>
<prop oor:name="SubstFontsMS">
<value>Courier New</value>
diff --git a/oovbaapi/genconstidl/makefile.mk b/oovbaapi/genconstidl/makefile.mk
index 95363d56c3..6f2036cfde 100644
--- a/oovbaapi/genconstidl/makefile.mk
+++ b/oovbaapi/genconstidl/makefile.mk
@@ -56,18 +56,16 @@ MYDONEFILES += $(foreach,i,$(MYSYMFILES) $(MISC)$/$(i:b).done)
ALLTAR: GENIDL
-GENIDL : $(MY_GEN_IDL_PATH) $(MYDONEFILES)
+GENIDL : $(MYDONEFILES)
GENRDB : GENIDL $(MYURDFILES)
$(MISC)$/%.done : %.api
+ @@-$(MKDIR) $(MY_GEN_IDL_PATH)
@echo Processing $?
$(PERL) api-to-idl.pl $? $(MY_GEN_IDL_PATH)
@$(TOUCH) $@
-$(MY_GEN_IDL_PATH) :
- @@-$(MKDIR) $@
-
CLEAN :
@$(RM) $(MY_GEN_IDL_PATH)$/*.idl
@$(RM) $(foreach,i,$(MYSYMFILES) $(MISC)$/$(i:b).done)
diff --git a/oovbaapi/ooo/vba/ControlProvider.idl b/oovbaapi/ooo/vba/ControlProvider.idl
new file mode 100644
index 0000000000..4db6ce82fd
--- /dev/null
+++ b/oovbaapi/ooo/vba/ControlProvider.idl
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * 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: XGlobals.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_ControlProvider_idl__
+#define __ooo_vba_ControlProvider_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __com_sun_star_frame_XModel_idl__
+#include <com/sun/star/frame/XModel.idl>
+#endif
+
+
+module ooo { module vba {
+
+interface XControlProvider;
+
+service ControlProvider
+{
+ interface ::ooo::vba::XControlProvider;
+};
+
+}; };
+
+#endif
+
diff --git a/oovbaapi/ooo/vba/XApplicationBase.idl b/oovbaapi/ooo/vba/XApplicationBase.idl
new file mode 100644
index 0000000000..b99c416563
--- /dev/null
+++ b/oovbaapi/ooo/vba/XApplicationBase.idl
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef __ooo_vba_XApplicationBase_idl__
+#define __ooo_vba_XApplicationBase_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba {
+//=============================================================================
+
+interface XApplicationBase
+{
+ interface ::ooo::vba::XHelperInterface;
+
+ [attribute] boolean ScreenUpdating;
+ [attribute] boolean DisplayStatusBar;
+ [attribute, readonly] string Version;
+
+ void Quit();
+
+ any CommandBars( [in] any aIndex );
+ void Run([in] string MacroName, [in] /*Optional*/ any varg1, [in] /*Optional*/ any varg2, [in] /*Optional*/ any varg3, [in] /*Optional*/ any varg4, [in] /*Optional*/ any varg5, [in] /*Optional*/ any varg6, [in] /*Optional*/ any varg7, [in] /*Optional*/ any varg8, [in] /*Optional*/ any varg9, [in] /*Optional*/ any varg10, [in] /*Optional*/ any varg11, [in] /*Optional*/ any varg12, [in] /*Optional*/ any varg13, [in] /*Optional*/ any varg14, [in] /*Optional*/ any varg15, [in] /*Optional*/ any varg16, [in] /*Optional*/ any varg17, [in] /*Optional*/ any varg18, [in] /*Optional*/ any varg19, [in] /*Optional*/ any varg20, [in] /*Optional*/ any varg21, [in] /*Optional*/ any varg22, [in] /*Optional*/ any varg23, [in] /*Optional*/ any varg24, [in] /*Optional*/ any varg25, [in] /*Optional*/ any varg26, [in] /*Optional*/ any varg27, [in] /*Optional*/ any varg28, [in] /*Optional*/ any varg29, [in] /*Optional*/ any varg30);
+ float CentimetersToPoints([in] float Centimeters );
+};
+
+}; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/XCommandBar.idl b/oovbaapi/ooo/vba/XCommandBar.idl
index 59fa285ae1..e0b178181d 100644
--- a/oovbaapi/ooo/vba/XCommandBar.idl
+++ b/oovbaapi/ooo/vba/XCommandBar.idl
@@ -54,9 +54,12 @@ interface XCommandBar
[attribute] string Name;
[attribute] boolean Visible;
+ [attribute] boolean Enabled;
void Delete() raises ( com::sun::star::script::BasicErrorException );
any Controls( [in] any Index ) raises ( com::sun::star::script::BasicErrorException );
+ long Type() raises ( com::sun::star::script::BasicErrorException );
+ any FindControl( [in] any Type, [in] any Id, [in] any Tag, [in] any Visible, [in] any Recursive ) raises ( com::sun::star::script::BasicErrorException );
};
}; };
diff --git a/oovbaapi/ooo/vba/XCommandBarButton.idl b/oovbaapi/ooo/vba/XCommandBarButton.idl
new file mode 100644
index 0000000000..c93f236c15
--- /dev/null
+++ b/oovbaapi/ooo/vba/XCommandBarButton.idl
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef __ooo_vba_XCommandBarButton_idl__
+#define __ooo_vba_XCommandBarButton_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+//=============================================================================
+
+module ooo { module vba {
+//=============================================================================
+
+interface XCommandBarButton: com::sun::star::uno::XInterface
+{
+};
+
+}; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/XCommandBarControl.idl b/oovbaapi/ooo/vba/XCommandBarControl.idl
index 02cf8bafc8..c40394e29d 100644
--- a/oovbaapi/ooo/vba/XCommandBarControl.idl
+++ b/oovbaapi/ooo/vba/XCommandBarControl.idl
@@ -54,6 +54,8 @@ interface XCommandBarControl
[attribute] string Caption;
[attribute] string OnAction;
[attribute] boolean Visible;
+ [attribute, readonly] long Type;
+ [attribute] boolean Enabled;
void Delete() raises ( com::sun::star::script::BasicErrorException );
any Controls( [in] any Index ) raises ( com::sun::star::script::BasicErrorException );
diff --git a/oovbaapi/ooo/vba/XCommandBarPopup.idl b/oovbaapi/ooo/vba/XCommandBarPopup.idl
new file mode 100644
index 0000000000..cfcecfe6b4
--- /dev/null
+++ b/oovbaapi/ooo/vba/XCommandBarPopup.idl
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef __ooo_vba_XCommandBarPopup_idl__
+#define __ooo_vba_XCommandBarPopup_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+//=============================================================================
+
+module ooo { module vba {
+//=============================================================================
+
+interface XCommandBarPopup: com::sun::star::uno::XInterface
+{
+};
+
+}; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/XGlobals.idl b/oovbaapi/ooo/vba/XControlProvider.idl
index 6758d108cb..cd0c68d1cf 100644
--- a/oovbaapi/ooo/vba/XGlobals.idl
+++ b/oovbaapi/ooo/vba/XControlProvider.idl
@@ -27,41 +27,38 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef __ooo_vba_XGlobals_idl__
-#define __ooo_vba_XGlobals_idl__
+#ifndef __ooo_vba_XControlProvider_idl__
+#define __ooo_vba_XControlProvider_idl__
#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
#endif
-#ifndef __ooo_vba_excel_XApplication_idl__
-#include <ooo/vba/excel/XApplication.idl>
+
+#ifndef __com_sun_star_frame_XModel_idl__
+#include <com/sun/star/frame/XModel.idl>
#endif
-#ifndef __ooo_vba_excel_XWorkbook_idl__
-#include <ooo/vba/excel/XWorkbook.idl>
+
+#ifndef __com_sun_star_awt_XControl_idl__
+#include <com/sun/star/awt/XControl.idl>
#endif
-#ifndef __ooo_vba_excel_XWorksheet_idl__
-#include <ooo/vba/excel/XWorksheet.idl>
+
+#ifndef __com_sun_star_drawing_XControlShape_idl__
+#include <com/sun/star/drawing/XControlShape.idl>
+#endif
+#ifndef __ooo_vba_msforms_XControl_idl__
+#include <ooo/vba/msforms/XControl.idl>
#endif
module ooo { module vba {
-interface XGlobals: com::sun::star::uno::XInterface
+interface XControlProvider
{
- // FIXME, need better way to expose globals
- sequence< any > getGlobals();
+ ::ooo::vba::msforms::XControl createControl( [in] ::com::sun::star::drawing::XControlShape xControl, [in] ::com::sun::star::frame::XModel xDocOwner );
+ ::ooo::vba::msforms::XControl createUserformControl( [in] ::com::sun::star::awt::XControl xControl, [in] ::com::sun::star::awt::XControl xDialog, [in] ::com::sun::star::frame::XModel xDocOwner );
- [attribute, readonly] ooo::vba::excel::XApplication Application;
- [attribute, readonly] ooo::vba::excel::XWorkbook ActiveWorkbook;
- [attribute, readonly] ooo::vba::excel::XWorksheet ActiveSheet;
- any WorkSheets( [in] any aIndex );
- any WorkBooks( [in] any aIndex );
- any Sheets( [in] any aIndex );
- any Range( [in] any Cell1, [in] any Cell2 );
- any Names( [in] any Index );
};
}; };
#endif
-
diff --git a/oovbaapi/ooo/vba/XDialogBase.idl b/oovbaapi/ooo/vba/XDialogBase.idl
new file mode 100644
index 0000000000..7954364e74
--- /dev/null
+++ b/oovbaapi/ooo/vba/XDialogBase.idl
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * 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: XDialog.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_XDialog_idl__
+#define __ooo_vba_XDialog_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba {
+
+//=============================================================================
+
+interface XDialogBase
+{
+ interface ::ooo::vba::XHelperInterface;
+
+ void Show();
+};
+
+}; };
+
+#endif
+
diff --git a/oovbaapi/ooo/vba/XDialogsBase.idl b/oovbaapi/ooo/vba/XDialogsBase.idl
new file mode 100644
index 0000000000..7a33e82002
--- /dev/null
+++ b/oovbaapi/ooo/vba/XDialogsBase.idl
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * 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: XDialogs.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_XDialogs_idl__
+#define __ooo_vba_XDialogs_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+//=============================================================================
+
+module ooo { module vba {
+
+//interface XDialogs : ::ooo::vba::XCollection
+interface XDialogsBase
+{
+ interface ::ooo::vba::XHelperInterface;
+
+ [attribute, readonly] long Count;
+ any Item( [in] any Index );
+};
+
+}; };
+
+#endif
+
diff --git a/oovbaapi/ooo/vba/XDocumentBase.idl b/oovbaapi/ooo/vba/XDocumentBase.idl
new file mode 100644
index 0000000000..1e4c7f5737
--- /dev/null
+++ b/oovbaapi/ooo/vba/XDocumentBase.idl
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef __ooo_vba_XDocumentBase_idl__
+#define __ooo_vba_XDocumentBase_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba {
+//=============================================================================
+
+interface XDocumentBase
+{
+ interface ::ooo::vba::XHelperInterface;
+
+ [attribute, readonly] string Name;
+ [attribute, readonly] string Path;
+ [attribute, readonly] string FullName;
+ [attribute] boolean Saved;
+
+ void Close([in] any SaveChanges, [in] any FileName, [in] any RouteWorkBook);
+ void Save();
+ void Activate();
+ void Protect( [in] any Password );
+ void Unprotect( [in] any Password );
+};
+
+}; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/XDocumentProperties.idl b/oovbaapi/ooo/vba/XDocumentProperties.idl
new file mode 100644
index 0000000000..2bf926c3b6
--- /dev/null
+++ b/oovbaapi/ooo/vba/XDocumentProperties.idl
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * 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: XDocument.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_XDocumentProperties_idl__
+#define __ooo_vba_XDocumentProperties_idl__
+
+#ifndef __com_sun_star_script_BasicErrorException_idl__
+#include <com/sun/star/script/BasicErrorException.idl>
+#endif
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+module ooo { module vba {
+interface XDocumentProperty;
+interface XDocumentProperties
+{
+ interface XCollection;
+ /** Creates a new custom document property.
+ * You can only add a new document property to the custom DocumentProperties collection. Depending on value of
+ * boolean LinkSource, either (False) Value or (True) LinkSource must be provided.
+ * @param Name (Required String. The name of the property.
+ * @param LinkToContent Specifies whether the property is linked to the contents of the container document. If this argument is True, the LinkSource argument is required; if it's False, the value argument is required.
+ * @param Type The data type of the property. Can be one of the following MsoDocProperties constants:
+ * msoPropertyTypeBoolean, msoPropertyTypeDate, msoPropertyTypeFloat, msoPropertyTypeNumber, or msoPropertyTypeString.
+ * @param Value The value of the property, if it's not linked to the contents of the container document.
+ * The value is converted to match the data type specified by the type argument, if it can't be converted, an error occurs.
+ * If LinkToContent is True, the Value argument is ignored and the new document property is assigned a default value
+ * until the linked property values are updated by the container application (usually when the document is saved).
+ * @param LinkSource Ignored if LinkToContent is False. The source of the linked property. The container application determines
+ * what types of source linking you can use.
+ */
+ XDocumentProperty Add([in] string Name, [in] boolean LinkToContent, [in] /* MsoDocProperties */ byte Type, [in] any Value,
+ [in] /*optional*/ any LinkSource)
+ raises (com::sun::star::script::BasicErrorException);
+};
+
+}; };
+
+#endif
+
diff --git a/oovbaapi/ooo/vba/XDocumentProperty.idl b/oovbaapi/ooo/vba/XDocumentProperty.idl
new file mode 100644
index 0000000000..1357b1ef72
--- /dev/null
+++ b/oovbaapi/ooo/vba/XDocumentProperty.idl
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * 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: XDocument.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_XDocumentProperty_idl__
+#define __ooo_vba_XDocumentProperty_idl__
+
+#ifndef __com_sun_star_script_BasicErrorException_idl__
+#include <com/sun/star/script/BasicErrorException.idl>
+#endif
+#ifndef __com_sun_star_script_XDefaultProperty_idl__
+#include <com/sun/star/script/XDefaultProperty.idl>
+#endif
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba {
+
+/**
+ * Specific built-in document property. Use CustomDocumentProperties(index),
+ * where index is the name or index number of the custom document property,
+ * to return a DocumentProperty object that represents a specific custom document property.
+ */
+interface XDocumentProperty
+{
+
+ interface com::sun::star::script::XDefaultProperty;
+ interface ooo::vba::XHelperInterface;
+
+ void Delete()
+ raises (com::sun::star::script::BasicErrorException);
+
+ /** Required String. The name of the property.
+ */
+ string getName()
+ raises (com::sun::star::script::BasicErrorException);
+
+ void setName([in] string Name)
+ raises (com::sun::star::script::BasicErrorException);
+
+ /** The data type of the property.
+ * Can be one of the following MsoDocProperties constants:
+ * msoPropertyTypeBoolean, msoPropertyTypeDate, msoPropertyTypeFloat,
+ * msoPropertyTypeNumber, or msoPropertyTypeString.
+ */
+ byte getType()
+ raises (com::sun::star::script::BasicErrorException);
+
+ void setType([in] byte Type)
+ raises (com::sun::star::script::BasicErrorException);
+
+ /** If true, then LinkSource has a valid value. */
+ boolean getLinkToContent()
+ raises (com::sun::star::script::BasicErrorException);
+
+ void setLinkToContent([in] boolean LinkToContent)
+ raises (com::sun::star::script::BasicErrorException);
+
+ /** If LinkToContent is false, then this contains the value of the property
+ * The data type of the value will match the Type property.
+ */
+ any getValue()
+ raises (com::sun::star::script::BasicErrorException);
+
+ void setValue([in] any Value)
+ raises (com::sun::star::script::BasicErrorException);
+
+ /** If LinkToContent is false, then this contains the value of the property */
+ string getLinkSource()
+ raises (com::sun::star::script::BasicErrorException);
+
+ void setLinkSource([in] string LinkSource)
+ raises (com::sun::star::script::BasicErrorException);
+};
+
+}; };
+
+#endif
+
diff --git a/oovbaapi/ooo/vba/XDocumentsBase.idl b/oovbaapi/ooo/vba/XDocumentsBase.idl
new file mode 100644
index 0000000000..25a2a7ce64
--- /dev/null
+++ b/oovbaapi/ooo/vba/XDocumentsBase.idl
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * 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: XDocumentsBase.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_XDocumentsBase_idl__
+#define __ooo_vba_XDocumentsBase_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba {
+
+//=============================================================================
+
+interface XDocumentsBase
+{
+ interface ::ooo::vba::XCollection;
+};
+
+}; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/XFontBase.idl b/oovbaapi/ooo/vba/XFontBase.idl
new file mode 100644
index 0000000000..93f8d25203
--- /dev/null
+++ b/oovbaapi/ooo/vba/XFontBase.idl
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * 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: XFont.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_XFont_idl__
+#define __ooo_vba_XFont_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
+#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+//=============================================================================
+
+module ooo { module vba {
+
+interface XFontBase
+{
+ interface ::ooo::vba::XHelperInterface;
+
+ [attribute] any Size;
+ [attribute] any ColorIndex;
+ [attribute] any Color;
+ [attribute] any Bold;
+ [attribute] any Underline;
+ [attribute] any Strikethrough;
+ [attribute] any Shadow;
+ [attribute] any Italic;
+ [attribute] any Subscript;
+ [attribute] any Superscript;
+ [attribute] any Name;
+};
+
+//=============================================================================
+
+}; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/XGlobalsBase.idl b/oovbaapi/ooo/vba/XGlobalsBase.idl
new file mode 100644
index 0000000000..f3465b08bd
--- /dev/null
+++ b/oovbaapi/ooo/vba/XGlobalsBase.idl
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * 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: XGlobals.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_XGlobalsBase_idl__
+#define __ooo_vba_XGlobalsBase_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+#ifndef __com_sun_star_lang_XMultiServiceFactory
+#include <com/sun/star/lang/XMultiServiceFactory.idl>
+#endif
+module ooo { module vba {
+interface XGlobalsBase
+{
+ interface ::ooo::vba::XHelperInterface;
+ interface ::com::sun::star::lang::XMultiServiceFactory;
+};
+
+}; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/XPageSetupBase.idl b/oovbaapi/ooo/vba/XPageSetupBase.idl
new file mode 100644
index 0000000000..c69c251996
--- /dev/null
+++ b/oovbaapi/ooo/vba/XPageSetupBase.idl
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * 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$
+ * $Revision$
+ *
+ * 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 __ooo_vba_XPageSetupBase_idl__
+#define __ooo_vba_XPageSetupBase_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+//=============================================================================
+
+module ooo { module vba {
+
+//=============================================================================
+
+
+interface XPageSetupBase
+{
+
+ interface ::ooo::vba::XHelperInterface;
+
+ //Attributes
+ [attribute] double TopMargin;
+ [attribute] double BottomMargin;
+ [attribute] double RightMargin;
+ [attribute] double LeftMargin;
+ [attribute] long Orientation;
+};
+
+//=============================================================================
+
+}; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/XWindowBase.idl b/oovbaapi/ooo/vba/XWindowBase.idl
new file mode 100644
index 0000000000..63b95982ff
--- /dev/null
+++ b/oovbaapi/ooo/vba/XWindowBase.idl
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef __ooo_vba_XHelperWindow_idl__
+#define __ooo_vba_XHelperWindow_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba {
+//=============================================================================
+
+interface XWindowBase
+{
+ interface ::ooo::vba::XHelperInterface;
+
+ [attribute] long Height;
+ [attribute] long Left;
+ [attribute] long Top;
+ [attribute] boolean Visible;
+ [attribute] long Width;
+};
+
+}; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/Globals.idl b/oovbaapi/ooo/vba/excel/Globals.idl
index 21863c3b10..f06be2bf56 100644
--- a/oovbaapi/ooo/vba/Globals.idl
+++ b/oovbaapi/ooo/vba/excel/Globals.idl
@@ -28,21 +28,21 @@
*
************************************************************************/
-#ifndef __ooo_vba_Globals_idl__
-#define __ooo_vba_Globals_idl__
+#ifndef __ooo_vba_excel_Globals_idl__
+#define __ooo_vba_excel_Globals_idl__
-#ifndef __ooo_vba_XGlobals_idl__
-#include <ooo/vba/XGlobals.idl>
+#ifndef __ooo_vba_excel_XGlobals_idl__
+#include <ooo/vba/excel/XGlobals.idl>
#endif
#include <com/sun/star/uno/XComponentContext.idl>
#include <com/sun/star/table/XCellRange.idl>
-module ooo { module vba {
+module ooo { module vba { module excel {
service Globals : XGlobals
{
};
-}; };
+}; }; };
#endif
diff --git a/oovbaapi/ooo/vba/excel/TextFrame.idl b/oovbaapi/ooo/vba/excel/TextFrame.idl
new file mode 100644
index 0000000000..2b6b5cd31f
--- /dev/null
+++ b/oovbaapi/ooo/vba/excel/TextFrame.idl
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef __ooo_vba_excel_TextFrame_idl__
+#define __ooo_vba_excel_TextFrame_idl__
+
+#ifndef __ooo_vba_excel_XTextFrame_idl__
+#include <ooo/vba/excel/XTextFrame.idl>
+#endif
+
+#include <com/sun/star/uno/XComponentContext.idl>
+
+module ooo { module vba { module excel {
+service TextFrame : XTextFrame
+{
+ //createTextFrame( [in] ::ooo::vba::XHelperInterface Parent, [in] ::com::sun::star::frame::XModel xModel );
+};
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl
index be0cf98087..ec7c119047 100644
--- a/oovbaapi/ooo/vba/excel/XApplication.idl
+++ b/oovbaapi/ooo/vba/excel/XApplication.idl
@@ -42,10 +42,6 @@
#include <ooo/vba/XAssistant.idl>
#endif
-#ifndef __ooo_vba_XCommandBars_idl__
-#include <ooo/vba/XCommandBars.idl>
-#endif
-
module ooo { module vba { module excel {
interface XRange;
@@ -56,10 +52,10 @@ interface XWorksheetFunction;
interface XWindow;
interface XWorksheet;
-interface XApplication
+interface XApplication : com::sun::star::uno::XInterface
{
- interface ::ooo::vba::XHelperInterface;
+// interface ::ooo::vba::XHelperInterface;
[attribute, readonly] any Selection;
[attribute, readonly] XWorkbook ActiveWorkbook;
@@ -74,14 +70,11 @@ interface XApplication
// to determine this
[attribute, readonly] XWorkbook ThisWorkbook;
[attribute, readonly] string Name;
- [attribute] boolean ScreenUpdating;
- [attribute] boolean DisplayStatusBar;
[attribute] boolean DisplayAlerts;
[attribute] boolean DisplayFormulaBar;
[attribute] any CutCopyMode;
[attribute] any StatusBar;
[attribute] long Cursor;
- [attribute, readonly] string Version;
void setDefaultFilePath([in] string DefaultFilePath) raises(com::sun::star::script::BasicErrorException);
@@ -90,7 +83,7 @@ interface XApplication
string LibraryPath() raises(com::sun::star::script::BasicErrorException);
string TemplatesPath() raises(com::sun::star::script::BasicErrorException);
string PathSeparator() raises(com::sun::star::script::BasicErrorException);
- any CommandBars( [in] any aIndex );
+ //any CommandBars( [in] any aIndex );
any Workbooks( [in] any aIndex );
any Worksheets( [in] any aIndex );
any Windows( [in] any aIndex );
@@ -110,6 +103,7 @@ interface XApplication
raises(com::sun::star::script::BasicErrorException);
void Volatile([in] any Volatile);
void DoEvents();
+ any Caller( [in] any aIndex );
};
}; }; };
diff --git a/oovbaapi/ooo/vba/excel/XDialog.idl b/oovbaapi/ooo/vba/excel/XDialog.idl
index 1aec6eaab5..c9900f432e 100644
--- a/oovbaapi/ooo/vba/excel/XDialog.idl
+++ b/oovbaapi/ooo/vba/excel/XDialog.idl
@@ -45,13 +45,8 @@ module ooo { module vba { module excel {
//=============================================================================
-interface XApplication;
-
-interface XDialog
+interface XDialog : com::sun::star::uno::XInterface
{
- interface ::ooo::vba::XHelperInterface;
-
- void Show();
};
}; }; };
diff --git a/oovbaapi/ooo/vba/excel/XDialogs.idl b/oovbaapi/ooo/vba/excel/XDialogs.idl
index f6ce44ed35..9daa8308cc 100644
--- a/oovbaapi/ooo/vba/excel/XDialogs.idl
+++ b/oovbaapi/ooo/vba/excel/XDialogs.idl
@@ -33,9 +33,6 @@
#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
#endif
-#ifndef __ooo_vba_XCollection_idl__
-#include <ooo/vba/XCollection.idl>
-#endif
#ifndef __ooo_vba_XHelperInterface_idl__
#include <ooo/vba/XHelperInterface.idl>
@@ -44,15 +41,9 @@
//=============================================================================
module ooo { module vba { module excel {
-interface XApplication;
-//=============================================================================
-//interface XDialogs : ::ooo::vba::XCollection
-interface XDialogs
+interface XDialogs : com::sun::star::uno::XInterface
{
- interface ::ooo::vba::XHelperInterface;
-
- [attribute, readonly] long Count;
any Item( [in] any Index );
};
diff --git a/oovbaapi/ooo/vba/excel/XFont.idl b/oovbaapi/ooo/vba/excel/XFont.idl
index 3a96e58033..b3fc95b548 100644
--- a/oovbaapi/ooo/vba/excel/XFont.idl
+++ b/oovbaapi/ooo/vba/excel/XFont.idl
@@ -47,22 +47,9 @@ module ooo { module vba { module excel {
interface XFont
{
- interface ::ooo::vba::XHelperInterface;
-
- [attribute] any Size;
[attribute] any StandardFontSize;
[attribute] any StandardFont;
[attribute] any FontStyle;
- [attribute] any ColorIndex;
- [attribute] any Color;
- [attribute] any Bold;
- [attribute] any Underline;
- [attribute] any Strikethrough;
- [attribute] any Shadow;
- [attribute] any Italic;
- [attribute] any Subscript;
- [attribute] any Superscript;
- [attribute] any Name;
[attribute] any OutlineFont;
};
diff --git a/oovbaapi/ooo/vba/excel/XGlobals.idl b/oovbaapi/ooo/vba/excel/XGlobals.idl
new file mode 100644
index 0000000000..05e6f02a44
--- /dev/null
+++ b/oovbaapi/ooo/vba/excel/XGlobals.idl
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * 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: XGlobals.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_excel_XGlobals_idl__
+#define __ooo_vba_excel_XGlobals_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+#ifndef __com_sun_star_script_BasicErrorException_idl__
+#include <com/sun/star/script/BasicErrorException.idl>
+#endif
+#ifndef __ooo_vba_excel_XWorkbook_idl__
+#include <ooo/vba/excel/XWorkbook.idl>
+#endif
+#ifndef __ooo_vba_excel_XWorksheet_idl__
+#include <ooo/vba/excel/XWorksheet.idl>
+#endif
+#ifndef __ooo_vba_XAssistant_idl__
+#include <ooo/vba/XAssistant.idl>
+#endif
+
+module ooo { module vba { module excel {
+interface XRange;
+interface XWindow;
+interface XGlobals: com::sun::star::uno::XInterface
+{
+ [attribute, readonly] ooo::vba::excel::XWorkbook ActiveWorkbook;
+ [attribute, readonly] ooo::vba::excel::XWorksheet ActiveSheet;
+ [attribute, readonly] ooo::vba::excel::XWindow ActiveWindow;
+ [attribute, readonly] ooo::vba::excel::XRange ActiveCell;
+ [attribute, readonly] ooo::vba::XAssistant Assistant;
+ [attribute, readonly] any Selection;
+ [attribute, readonly] XWorkbook ThisWorkbook;
+
+ void Calculate() raises(com::sun::star::script::BasicErrorException);
+ XRange Cells([in] any RowIndex, [in] any ColumnIndex);
+ XRange Columns([in] any aIndex);
+ any CommandBars( [in] any aIndex );
+ any Evaluate( [in] string Name );
+XRange Intersect([in] XRange Arg1, [in] XRange Arg2, [in] /*Optional*/ any Arg3, [in] /*Optional*/ any Arg4, [in] /*Optional*/ any Arg5, [in] /*Optional*/ any Arg6, [in] /*Optional*/ any Arg7, [in] /*Optional*/ any Arg8, [in] /*Optional*/ any Arg9, [in] /*Optional*/ any Arg10, [in] /*Optional*/ any Arg11, [in] /*Optional*/ any Arg12, [in] /*Optional*/ any Arg13, [in] /*Optional*/ any Arg14, [in] /*Optional*/ any Arg15, [in] /*Optional*/ any Arg16, [in] /*Optional*/ any Arg17, [in] /*Optional*/ any Arg18, [in] /*Optional*/ any Arg19, [in] /*Optional*/ any Arg20, [in] /*Optional*/ any Arg21, [in] /*Optional*/ any Arg22, [in] /*Optional*/ any Arg23, [in] /*Optional*/ any Arg24, [in] /*Optional*/ any Arg25, [in] /*Optional*/ any Arg26, [in] /*Optional*/ any Arg27, [in] /*Optional*/ any Arg28, [in] /*Optional*/ any Arg29, [in] /*Optional*/ any Arg30)
+ raises(com::sun::star::script::BasicErrorException);
+ any WorkSheets( [in] any aIndex );
+ any WorkBooks( [in] any aIndex );
+ any WorksheetFunction();
+ any Windows( [in] any aIndex );
+ any Sheets( [in] any aIndex );
+ any Range( [in] any Cell1, [in] any Cell2 );
+ XRange Rows([in] any aIndex);
+ any Names( [in] any Index );
+ XRange Union([in] XRange Arg1, [in] XRange Arg2, [in] /*Optional*/ any Arg3, [in] /*Optional*/ any Arg4, [in] /*Optional*/ any Arg5, [in] /*Optional*/ any Arg6, [in] /*Optional*/ any Arg7, [in] /*Optional*/ any Arg8, [in] /*Optional*/ any Arg9, [in] /*Optional*/ any Arg10, [in] /*Optional*/ any Arg11, [in] /*Optional*/ any Arg12, [in] /*Optional*/ any Arg13, [in] /*Optional*/ any Arg14, [in] /*Optional*/ any Arg15, [in] /*Optional*/ any Arg16, [in] /*Optional*/ any Arg17, [in] /*Optional*/ any Arg18, [in] /*Optional*/ any Arg19, [in] /*Optional*/ any Arg20, [in] /*Optional*/ any Arg21, [in] /*Optional*/ any Arg22, [in] /*Optional*/ any Arg23, [in] /*Optional*/ any Arg24, [in] /*Optional*/ any Arg25, [in] /*Optional*/ any Arg26, [in] /*Optional*/ any Arg27, [in] /*Optional*/ any Arg28, [in] /*Optional*/ any Arg29, [in] /*Optional*/ any Arg30)
+ raises(com::sun::star::script::BasicErrorException);
+
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/excel/XPageSetup.idl b/oovbaapi/ooo/vba/excel/XPageSetup.idl
index 03ed927338..6a0832856f 100644
--- a/oovbaapi/ooo/vba/excel/XPageSetup.idl
+++ b/oovbaapi/ooo/vba/excel/XPageSetup.idl
@@ -45,20 +45,15 @@ module ooo { module vba { module excel {
//=============================================================================
-interface XPageSetup
+interface XPageSetup : com::sun::star::uno::XInterface
{
- interface ::ooo::vba::XHelperInterface;
+// interface ::ooo::vba::XHelperInterface;
//Attributes
[attribute] string PrintArea;
- [attribute] double TopMargin;
- [attribute] double BottomMargin;
- [attribute] double RightMargin;
- [attribute] double LeftMargin;
[attribute] double HeaderMargin;
[attribute] double FooterMargin;
- [attribute] long Orientation;
[attribute] any FitToPagesTall;
[attribute] any FitToPagesWide;
[attribute] any Zoom;
diff --git a/oovbaapi/ooo/vba/excel/XTextFrame.idl b/oovbaapi/ooo/vba/excel/XTextFrame.idl
index 534b2561ea..4962be54d2 100644
--- a/oovbaapi/ooo/vba/excel/XTextFrame.idl
+++ b/oovbaapi/ooo/vba/excel/XTextFrame.idl
@@ -34,21 +34,9 @@
#include <ooo/vba/XHelperInterface.idl>
#endif
-#ifndef __ooo_vba_excel_XCharacters_idl__
-#include <ooo/vba/excel/XCharacters.idl>
-#endif
-
module ooo { module vba { module excel {
-interface XTextFrame : ooo::vba::XHelperInterface
+interface XTextFrame : com::sun::star::uno::XInterface
{
- [attribute] boolean AutoSize;
- [attribute] float MarginBottom;
- [attribute] float MarginTop;
- [attribute] float MarginLeft;
- [attribute] float MarginRight;
- XCharacters Characters();
- /*I don't find it in msdn
- Range TextRange();*/
};
}; }; };
#endif
diff --git a/oovbaapi/ooo/vba/excel/XVPageBreak.idl b/oovbaapi/ooo/vba/excel/XVPageBreak.idl
new file mode 100644
index 0000000000..c4a750207e
--- /dev/null
+++ b/oovbaapi/ooo/vba/excel/XVPageBreak.idl
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * 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: XVPageBreak.idl,v $
+ * $Revision: 1.0 $
+ *
+ * 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 __ooo_vba_excel_XVPageBreak_idl__
+#define __ooo_vba_excel_XVPageBreak_idl__
+
+#ifndef __ooo_vba_excel_XPageBreak_idl__
+#include <ooo/vba/excel/XPageBreak.idl>
+#endif
+
+//=============================================================================
+
+module ooo { module vba { module excel {
+
+//=============================================================================
+
+interface XVPageBreak
+{
+ interface ::ooo::vba::excel::XPageBreak;
+};
+
+//=============================================================================
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/excel/XVPageBreaks.idl b/oovbaapi/ooo/vba/excel/XVPageBreaks.idl
new file mode 100644
index 0000000000..654d3367bc
--- /dev/null
+++ b/oovbaapi/ooo/vba/excel/XVPageBreaks.idl
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * 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: XVPageBreaks.idl,v $
+ * $Revision: 1.0 $
+ *
+ * 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 __ooo_vba_excel_XVPageBreaks_idl__
+#define __ooo_vba_excel_XVPageBreaks_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+#ifndef __com_sun_star_helper_script_BasicErrorException_idl__
+#include <com/sun/star/script/BasicErrorException.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+//=============================================================================
+
+module ooo { module vba { module excel {
+
+//=============================================================================
+
+//interface XVPageBreak;
+
+interface XVPageBreaks
+{
+ interface ooo::vba::XCollection;
+
+ //Methods
+ any Add( [in] any Before ) raises( com::sun::star::script::BasicErrorException );
+};
+
+//=============================================================================
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/excel/XWindow.idl b/oovbaapi/ooo/vba/excel/XWindow.idl
index 2baf8995ab..89fee31b85 100644
--- a/oovbaapi/ooo/vba/excel/XWindow.idl
+++ b/oovbaapi/ooo/vba/excel/XWindow.idl
@@ -46,10 +46,8 @@ module ooo { module vba { module excel {
interface XRange;
interface XWorksheet;
interface XPane;
-interface XWindow
+interface XWindow : com::sun::star::uno::XInterface
{
- interface ::ooo::vba::XHelperInterface;
-
[attribute] any Caption;
[attribute] boolean DisplayGridlines;
[attribute] boolean DisplayHeadings;
@@ -58,8 +56,6 @@ interface XWindow
[attribute] boolean DisplayVerticalScrollBar;
[attribute] boolean DisplayWorkbookTabs;
[attribute] boolean FreezePanes;
- [attribute] long Height;
- [attribute] long Left;
[attribute] boolean Split;
[attribute] long SplitColumn;
[attribute] double SplitHorizontal;
@@ -67,10 +63,7 @@ interface XWindow
[attribute] double SplitVertical;
[attribute] any ScrollColumn;
[attribute] any ScrollRow;
- [attribute] long Top;
[attribute] any View;
- [attribute] boolean Visible;
- [attribute] long Width;
[attribute] any WindowState;
[attribute] any Zoom;
any SelectedSheets( [in] any aIndex );
diff --git a/oovbaapi/ooo/vba/excel/XWorkbook.idl b/oovbaapi/ooo/vba/excel/XWorkbook.idl
index d4d9167d78..99b55f4a3c 100644
--- a/oovbaapi/ooo/vba/excel/XWorkbook.idl
+++ b/oovbaapi/ooo/vba/excel/XWorkbook.idl
@@ -48,31 +48,20 @@ interface XWorksheet;
interface XWorksheets;
interface XStyles;
-interface XWorkbook
+interface XWorkbook : com::sun::star::uno::XInterface
{
- interface ::ooo::vba::XHelperInterface;
-
- [attribute, readonly] string Name;
- [attribute, readonly] string Path;
- [attribute, readonly] string FullName;
[attribute, readonly] boolean ProtectStructure;
[attribute, readonly] XWorksheet ActiveSheet;
- [attribute] boolean Saved;
[attribute, readonly] string CodeName;
+ [attribute] boolean PrecisionAsDisplayed;
any Worksheets([in] any sheet);
any Styles([in] any Index );
any Sheets([in] any sheet);
any Windows([in] any index );
- void Close([in] any SaveChanges, [in] any FileName, [in] any RouteWorkBook);
- void Protect( [in] any Password );
- void Unprotect( [in] any Password );
- void Save();
- void Activate();
void ResetColors() raises (com::sun::star::script::BasicErrorException);
-
+ void Activate();
any Names( [in] any Index );
-
any Colors([in] any Index) raises (com::sun::star::script::BasicErrorException);
long FileFormat() raises (com::sun::star::script::BasicErrorException);
void SaveCopyAs( [in] string Filename );
diff --git a/oovbaapi/ooo/vba/excel/XWorkbooks.idl b/oovbaapi/ooo/vba/excel/XWorkbooks.idl
index 955e553f15..fb6a40b1f6 100644
--- a/oovbaapi/ooo/vba/excel/XWorkbooks.idl
+++ b/oovbaapi/ooo/vba/excel/XWorkbooks.idl
@@ -45,9 +45,8 @@ module ooo { module vba { module excel {
//=============================================================================
-interface XWorkbooks
+interface XWorkbooks : com::sun::star::uno::XInterface
{
- interface ::ooo::vba::XCollection;
any Add();
any Open([in] string Filename, [in] any UpdateLinks, [in] any ReadOnly, [in] any Format, [in] any Password, [in] any WriteResPassword, [in] any IgnoreReadOnlyRecommended, [in] any Origin, [in] any Delimiter, [in] any Editable, [in] any Notify, [in] any Converter, [in] any AddToMru);
diff --git a/oovbaapi/ooo/vba/excel/XWorksheet.idl b/oovbaapi/ooo/vba/excel/XWorksheet.idl
index 7a00aeaf2b..905239b48d 100644
--- a/oovbaapi/ooo/vba/excel/XWorksheet.idl
+++ b/oovbaapi/ooo/vba/excel/XWorksheet.idl
@@ -53,6 +53,7 @@ interface XRange;
interface XOutline;
interface XPageSetup;
interface XHPageBreaks;
+interface XVPageBreaks;
interface XWorksheet
{
interface ::ooo::vba::XHelperInterface;
@@ -70,6 +71,7 @@ interface XWorksheet
[attribute, readonly] XWorksheet Previous;
[attribute, readonly] string CodeName;
[attribute, readonly] short Index;
+ [attribute] long EnableSelection;
void Activate();
void Calculate( );
@@ -88,6 +90,7 @@ interface XWorksheet
XOutline Outline();
XPageSetup PageSetup();
any HPageBreaks([in] any Index);
+ any VPageBreaks([in] any Index);
any OLEObjects([in] any Index);
void ShowDataForm();
any Shapes([in] any Index);
diff --git a/oovbaapi/ooo/vba/excel/makefile.mk b/oovbaapi/ooo/vba/excel/makefile.mk
index 764c073e68..4ffa89f94c 100644
--- a/oovbaapi/ooo/vba/excel/makefile.mk
+++ b/oovbaapi/ooo/vba/excel/makefile.mk
@@ -46,7 +46,9 @@ dummy:
# ------------------------------------------------------------------------
-IDLFILES= XApplication.idl\
+IDLFILES= XGlobals.idl\
+ Globals.idl\
+ XApplication.idl\
XComment.idl\
XComments.idl\
XRange.idl\
@@ -103,6 +105,9 @@ IDLFILES= XApplication.idl\
XPageBreak.idl \
XHPageBreak.idl \
XHPageBreaks.idl \
+ XVPageBreak.idl \
+ XVPageBreaks.idl \
+ TextFrame.idl \
# ------------------------------------------------------------------
diff --git a/oovbaapi/ooo/vba/makefile.mk b/oovbaapi/ooo/vba/makefile.mk
index 99a11e5ac0..f137e419f6 100644
--- a/oovbaapi/ooo/vba/makefile.mk
+++ b/oovbaapi/ooo/vba/makefile.mk
@@ -47,7 +47,6 @@ dummy:
.IF "$(L10N_framework)"=""
IDLFILES=\
XErrObject.idl \
- XGlobals.idl \
XCollection.idl\
XVBAToOOEventDescGen.idl\
XPropValue.idl\
@@ -57,7 +56,21 @@ IDLFILES=\
XCommandBarControls.idl\
XCommandBar.idl\
XCommandBars.idl\
- Globals.idl\
+ XCommandBarPopup.idl\
+ XCommandBarButton.idl\
+ XControlProvider.idl\
+ ControlProvider.idl\
+ XApplicationBase.idl\
+ XWindowBase.idl\
+ XDocumentBase.idl\
+ XDocumentsBase.idl\
+ XGlobalsBase.idl\
+ XDocumentProperty.idl\
+ XDocumentProperties.idl\
+ XFontBase.idl\
+ XDialogsBase.idl\
+ XDialogBase.idl\
+ XPageSetupBase.idl \
# ------------------------------------------------------------------
.ENDIF
diff --git a/oovbaapi/ooo/vba/msforms/XControl.idl b/oovbaapi/ooo/vba/msforms/XControl.idl
index 30901fb729..cef5ff25bd 100644
--- a/oovbaapi/ooo/vba/msforms/XControl.idl
+++ b/oovbaapi/ooo/vba/msforms/XControl.idl
@@ -61,6 +61,7 @@ interface XControl
[attribute] double Left;
[attribute] double Top;
[attribute] string Name;
+ [attribute] string ControlTipText;
};
//=============================================================================
diff --git a/oovbaapi/ooo/vba/msforms/XShape.idl b/oovbaapi/ooo/vba/msforms/XShape.idl
index a1ac36dd27..90047e642b 100644
--- a/oovbaapi/ooo/vba/msforms/XShape.idl
+++ b/oovbaapi/ooo/vba/msforms/XShape.idl
@@ -34,10 +34,6 @@
#include <ooo/vba/XHelperInterface.idl>
#endif
-#ifndef __ooo_vba_excel_XTextFrame_idl__
-#include <ooo/vba/excel/XTextFrame.idl>
-#endif
-
#ifndef __ooo_vba_msforms_XLineFormat_idl__
#include <ooo/vba/msforms/XLineFormat.idl>
#endif
@@ -66,14 +62,13 @@ interface XShape : ooo::vba::XHelperInterface
[attribute, readonly] XLineFormat Line;
[attribute, readonly] XFillFormat Fill;
[attribute, readonly] XPictureFormat PictureFormat;
+ [attribute] boolean LockAspectRatio;
+ [attribute] boolean LockAnchor;
+ [attribute] long RelativeHorizontalPosition;
+ [attribute] long RelativeVerticalPosition;
- /*
- using in word
- [attribute] RelativeHorizontalPosition
- [attribute] RelativeVerticalPosition
- [attribute] XWrapFormat WrapFormat;
- */
- ooo::vba::excel::XTextFrame TextFrame();
+ any TextFrame();
+ any WrapFormat();
void Delete();
void ZOrder( [in] long ZOrderCmd );
void IncrementRotation( [in] double Increment );
diff --git a/oovbaapi/ooo/vba/msforms/XShapeRange.idl b/oovbaapi/ooo/vba/msforms/XShapeRange.idl
index 1b39485dfd..0ae1883d26 100644
--- a/oovbaapi/ooo/vba/msforms/XShapeRange.idl
+++ b/oovbaapi/ooo/vba/msforms/XShapeRange.idl
@@ -44,9 +44,25 @@
module ooo { module vba { module msforms {
+interface XLineFormat;
+interface XFillFormat;
interface XShapeRange
{
interface ooo::vba::XCollection;
+
+ [attribute] double Height;
+ [attribute] double Width;
+ [attribute] double Left;
+ [attribute] double Top;
+ [attribute, readonly] XLineFormat Line;
+ [attribute, readonly] XFillFormat Fill;
+ [attribute] boolean LockAspectRatio;
+ [attribute] boolean LockAnchor;
+ [attribute] long RelativeHorizontalPosition;
+ [attribute] long RelativeVerticalPosition;
+
+ any TextFrame();
+ any WrapFormat();
void Select();
XShape Group();
void IncrementRotation( [in] double Increment );
diff --git a/oovbaapi/ooo/vba/msforms/XShapes.idl b/oovbaapi/ooo/vba/msforms/XShapes.idl
index 3ba31ab8a6..7d7e26d422 100644
--- a/oovbaapi/ooo/vba/msforms/XShapes.idl
+++ b/oovbaapi/ooo/vba/msforms/XShapes.idl
@@ -51,6 +51,7 @@ interface XShapes
*/
any AddLine( [in] long StartX, [in] long StartY, [in] long endX, [in] long endY );
any AddShape([in] long ShapeType, [in] long StartX, [in] long StartY, [in] long endX, [in] long endY );
+ any AddTextbox([in] long Orientation, [in] long Left, [in] long Top, [in] long Width, [in] long Height );
};
}; }; };
diff --git a/oovbaapi/ooo/vba/msforms/XTextFrame.idl b/oovbaapi/ooo/vba/msforms/XTextFrame.idl
new file mode 100644
index 0000000000..b702ecfa8e
--- /dev/null
+++ b/oovbaapi/ooo/vba/msforms/XTextFrame.idl
@@ -0,0 +1,50 @@
+/*************************************************************************
+ *
+ * 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: XTextFrame.idl,v $
+ * $Revision: 1.3 $
+ *
+ * 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 __ooo_vba_msforms_XTextFrame_idl__
+#define __ooo_vba_msforms_XTextFrame_idl__
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module msforms {
+interface XTextFrame : ooo::vba::XHelperInterface
+{
+ [attribute] boolean AutoSize;
+ [attribute] float MarginBottom;
+ [attribute] float MarginTop;
+ [attribute] float MarginLeft;
+ [attribute] float MarginRight;
+ any Characters();
+ /*I don't find it in msdn
+ Range TextRange();*/
+};
+}; }; };
+#endif
diff --git a/oovbaapi/ooo/vba/msforms/makefile.mk b/oovbaapi/ooo/vba/msforms/makefile.mk
index f654993144..012cc7b91a 100644
--- a/oovbaapi/ooo/vba/msforms/makefile.mk
+++ b/oovbaapi/ooo/vba/msforms/makefile.mk
@@ -71,6 +71,7 @@ IDLFILES=\
XSpinButton.idl \
XImage.idl \
XControls.idl \
+ XTextFrame.idl \
# ------------------------------------------------------------------
diff --git a/oovbaapi/ooo/vba/word/XAddin.idl b/oovbaapi/ooo/vba/word/XAddin.idl
new file mode 100644
index 0000000000..7139013179
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XAddin.idl
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XAddin_idl__
+#define __ooo_vba_word_XAddin_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+#ifndef __com_sun_star_container_XNamed_idl__
+#include <com/sun/star/container/XNamed.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XAddin
+{
+ interface ooo::vba::XHelperInterface;
+ interface ::com::sun::star::container::XNamed;
+
+ [attribute, readonly] string Path;
+ [attribute, readonly] boolean Autoload;
+ [attribute] boolean Installed;
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XAddins.idl b/oovbaapi/ooo/vba/word/XAddins.idl
new file mode 100644
index 0000000000..b1cf10bf11
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XAddins.idl
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XAddins_idl__
+#define __ooo_vba_word_XAddins_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+
+interface XAddins
+{
+ interface ::ooo::vba::XCollection;
+};
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/word/XApplication.idl b/oovbaapi/ooo/vba/word/XApplication.idl
new file mode 100644
index 0000000000..8e8403085d
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XApplication.idl
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * 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: XApplication.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_word_XApplication_idl__
+#define __ooo_vba_word_XApplication_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XDocument;
+interface XWindow;
+interface XSystem;
+interface XOptions;
+interface XSelection;
+interface XApplication : com::sun::star::uno::XInterface
+{
+ [attribute, readonly] XDocument ActiveDocument;
+ [attribute, readonly] XWindow ActiveWindow;
+ [attribute, readonly] string Name;
+ [attribute, readonly] ooo::vba::word::XSystem System;
+ [attribute, readonly] ooo::vba::word::XOptions Options;
+ [attribute, readonly] ooo::vba::word::XSelection Selection;
+ [attribute] boolean DisplayAutoCompleteTips;
+ [attribute] long EnableCancelKey;
+
+ any CommandBars( [in] any aIndex );
+ any Documents( [in] any aIndex );
+ any Addins( [in] any aIndex );
+ any Dialogs( [in] any aIndex );
+ float CentimetersToPoints([in] float Centimeters );
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XAutoTextEntries.idl b/oovbaapi/ooo/vba/word/XAutoTextEntries.idl
new file mode 100644
index 0000000000..117bf0e516
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XAutoTextEntries.idl
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XAutoTextEntries_idl__
+#define __ooo_vba_word_XAutoTextEntries_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+
+interface XAutoTextEntries
+{
+ interface ::ooo::vba::XCollection;
+};
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/word/XAutoTextEntry.idl b/oovbaapi/ooo/vba/word/XAutoTextEntry.idl
new file mode 100644
index 0000000000..37ce70136a
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XAutoTextEntry.idl
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XAutoTextEntry_idl__
+#define __ooo_vba_word_XAutoTextEntry_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+#ifndef __com_sun_star_container_XNamed_idl__
+#include <com/sun/star/container/XNamed.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XRange;
+interface XAutoTextEntry
+{
+ interface ooo::vba::XHelperInterface;
+
+ XRange Insert([in] XRange Where, [in] /*Optional*/ any RichText);
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XBookmark.idl b/oovbaapi/ooo/vba/word/XBookmark.idl
new file mode 100644
index 0000000000..dd78d73380
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XBookmark.idl
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XBookmark_idl__
+#define __ooo_vba_word_XBookmark_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+#ifndef __com_sun_star_container_XNamed_idl__
+#include <com/sun/star/container/XNamed.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XBookmark
+{
+ interface ooo::vba::XHelperInterface;
+ interface ::com::sun::star::container::XNamed;
+
+ void Delete();
+ void Select();
+ any Range();
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XBookmarks.idl b/oovbaapi/ooo/vba/word/XBookmarks.idl
new file mode 100644
index 0000000000..df4019e3a9
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XBookmarks.idl
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XBookmarks_idl__
+#define __ooo_vba_word_XBookmarks_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+
+interface XBookmarks
+{
+ interface ::ooo::vba::XCollection;
+
+ [attribute] long DefaultSorting;
+ [attribute] boolean ShowHidden;
+
+ any Add( [in] string Name, [in] any Range );
+ boolean Exists( [in] string Name );
+};
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/word/XBorder.idl b/oovbaapi/ooo/vba/word/XBorder.idl
new file mode 100644
index 0000000000..c417fe2c34
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XBorder.idl
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * 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: XBorder.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_word_XBorder_idl__
+#define __ooo_vba_word_XBorder_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+//=============================================================================
+
+module ooo { module vba { module word {
+
+
+//=============================================================================
+interface XBorder
+{
+ interface ::ooo::vba::XHelperInterface;
+
+ [attribute] any LineStyle;
+};
+
+//=============================================================================
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XBorders.idl b/oovbaapi/ooo/vba/word/XBorders.idl
new file mode 100644
index 0000000000..284ffd0b67
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XBorders.idl
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * 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: XBorders.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_word_XBorders_idl__
+#define __ooo_vba_word_XBorders_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+interface XBorders
+{
+ interface ooo::vba::XCollection;
+
+ [attribute] boolean Shadow;
+};
+
+//=============================================================================
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XDialog.idl b/oovbaapi/ooo/vba/word/XDialog.idl
new file mode 100644
index 0000000000..9c31fa78e8
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XDialog.idl
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * 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: XDialog.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_word_XDialog_idl__
+#define __ooo_vba_word_XDialog_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+
+interface XDialog : com::sun::star::uno::XInterface
+{
+};
+
+}; }; };
+
+#endif
+
diff --git a/oovbaapi/ooo/vba/word/XDialogs.idl b/oovbaapi/ooo/vba/word/XDialogs.idl
new file mode 100644
index 0000000000..92c58ad41e
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XDialogs.idl
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * 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: XDialogs.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_word_XDialogs_idl__
+#define __ooo_vba_word_XDialogs_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+interface XDialogs : com::sun::star::uno::XInterface
+{
+
+ any Item( [in] any Index );
+};
+
+}; }; };
+
+#endif
+
diff --git a/oovbaapi/ooo/vba/word/XDocument.idl b/oovbaapi/ooo/vba/word/XDocument.idl
new file mode 100644
index 0000000000..7c4e3abd98
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XDocument.idl
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * 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: XDocument.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_word_XDocument_idl__
+#define __ooo_vba_word_XDocument_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+#ifndef __ooo_vba_word_XRange_idl__
+#include <ooo/vba/word/XRange.idl>
+#endif
+
+#ifndef __com_sun_star_script_XInvocation_idl__
+#include <com/sun/star/script/XInvocation.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XDocument : com::sun::star::script::XInvocation
+{
+ [attribute, readonly] XRange Content;
+ [attribute] any AttachedTemplate;
+
+ XRange Range( [in] any Start, [in] any End );
+ any BuiltInDocumentProperties( [in] any index );
+ any CustomDocumentProperties( [in] any index );
+ any Bookmarks( [in] any aIndex );
+ any Variables( [in] any aIndex );
+ any Paragraphs( [in] any aIndex );
+ any Styles( [in] any aIndex );
+ any Tables( [in] any aIndex );
+ any Fields( [in] any aIndex );
+ any Shapes([in] any Index);
+ any Sections([in] any Index);
+ void Activate();
+ any PageSetup();
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XDocuments.idl b/oovbaapi/ooo/vba/word/XDocuments.idl
new file mode 100644
index 0000000000..ef6d09ba0b
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XDocuments.idl
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XDocuments_idl__
+#define __ooo_vba_word_XDocuments_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+
+interface XDocuments : com::sun::star::uno::XInterface
+{
+ any Add([in] any Template, [in] any NewTemplate, [in] any DocumentType, [in] any Visible);
+ any Open([in] string Filename, [in] any ConfirmConversions, [in] any ReadOnly, [in] any AddToRecentFiles, [in] any PasswordDocument, [in] any PasswordTemplate, [in] any Revert, [in] any WritePasswordDocument, [in] any WritePasswordTemplate, [in] any Format, [in] any Encoding, [in] any Visible, [in] any OpenAndRepair, [in] any DocumentDirection, [in] any NoEncodingDialog, [in] any XMLTransform);
+
+ void Close([in] any SaveChanges,[in] any OriginalFormat,[in] any RouteDocument);
+};
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/word/XField.idl b/oovbaapi/ooo/vba/word/XField.idl
new file mode 100644
index 0000000000..19d3d3b34c
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XField.idl
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: XField.idl,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: jsc $ $Date: 2007/02/09 08:35:01 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef __ooo_vba_word_XField_idl__
+#define __ooo_vba_word_XField_idl__
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+module ooo { module vba { module word {
+
+interface XField
+{
+ interface ::ooo::vba::XHelperInterface;
+};
+
+}; }; };
+
+#endif
+
diff --git a/oovbaapi/ooo/vba/word/XFields.idl b/oovbaapi/ooo/vba/word/XFields.idl
new file mode 100644
index 0000000000..78266ace3f
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XFields.idl
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: XFields.idl,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: jsc $ $Date: 2007/02/09 08:45:13 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef __ooo_vba_word__XFields_idl__
+#define __ooo_vba_word__XFields_idl__
+
+#ifndef __ooo_vba_HelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XRange;
+interface XField;
+interface XFields
+{
+ interface ooo::vba::XCollection;
+
+ XField Add([in] XRange Range, [in] any Type, [in] any Text,[in] any PreserveFormatting);
+ long Update();
+};
+
+}; }; };
+
+#endif
+
diff --git a/oovbaapi/ooo/vba/word/XFind.idl b/oovbaapi/ooo/vba/word/XFind.idl
new file mode 100644
index 0000000000..e42ac6f940
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XFind.idl
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XFind_idl__
+#define __ooo_vba_word_XFind_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XFind
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute] string Text;
+ [attribute] any Replacement;
+ [attribute] boolean Forward;
+ [attribute] long Wrap;
+ [attribute] boolean Format;
+ [attribute] boolean MatchCase;
+ [attribute] boolean MatchWholeWord;
+ [attribute] boolean MatchWildcards;
+ [attribute] boolean MatchSoundsLike;
+ [attribute] boolean MatchAllWordForms;
+ [attribute] any Style;
+
+ boolean Execute([in] /* string */ any FindText,
+ [in] /* boolean */ any MatchCase,
+ [in] /* boolean */ any MatchWholeWord,
+ [in] /* boolean */ any MatchWildcards,
+ [in] /* boolean */ any MatchSoundsLike,
+ [in] /* boolean */ any MatchAllWordForms,
+ [in] /* boolean */ any Forward,
+ [in] /* long */ any Wrap,
+ [in] /* boolean */ any Format,
+ [in] /* string */ any ReplaceWith,
+ [in] /* boolean */ any Replace,
+ [in] /* boolean */ any MatchKashida,
+ [in] /* boolean */ any MatchDiacritics,
+ [in] /* boolean */ any MatchAlefHamza,
+ [in] /* boolean */ any MatchControl,
+ [in] /* boolean */ any MatchPrefix,
+ [in] /* boolean */ any MatchSuffix,
+ [in] /* boolean */ any MatchPhrase,
+ [in] /* boolean */ any IgnoreSpace,
+ [in] /* boolean */ any IgnorePunct );
+ void ClearFormatting();
+
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XFont.idl b/oovbaapi/ooo/vba/word/XFont.idl
new file mode 100644
index 0000000000..53fc1bb753
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XFont.idl
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * 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: XFont.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_word_XFont_idl__
+#define __ooo_vba_word_XFont_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
+#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+interface XFont : com::sun::star::uno::XInterface
+{
+};
+
+//=============================================================================
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XGlobals.idl b/oovbaapi/ooo/vba/word/XGlobals.idl
new file mode 100644
index 0000000000..9198ee6c13
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XGlobals.idl
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * 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: XGlobals.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_word_XGlobals_idl__
+#define __ooo_vba_word_XGlobals_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+interface XDocument;
+interface XWindow;
+interface XSystem;
+interface XOptions;
+interface XSelection;
+interface XGlobals : com::sun::star::uno::XInterface
+{
+ [attribute, readonly] XDocument ActiveDocument;
+ [attribute, readonly] XWindow ActiveWindow;
+ [attribute, readonly] string Name;
+ [attribute, readonly] ooo::vba::word::XSystem System;
+ [attribute, readonly] ooo::vba::word::XOptions Options;
+ [attribute, readonly] ooo::vba::word::XSelection Selection;
+ any CommandBars( [in] any aIndex );
+ any Documents( [in] any aIndex );
+ any Addins( [in] any aIndex );
+ any Dialogs( [in] any aIndex );
+ float CentimetersToPoints([in] float Centimeters );
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XHeaderFooter.idl b/oovbaapi/ooo/vba/word/XHeaderFooter.idl
new file mode 100644
index 0000000000..7dd1a39ec9
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XHeaderFooter.idl
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XHeaderFooter_idl__
+#define __ooo_vba_word_XHeaderFooter_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XRange;
+interface XHeaderFooter
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute, readonly] boolean IsHeader;
+ [attribute] boolean LinkToPrevious;
+ [attribute, readonly] XRange Range;
+ //[attribute, readonly] XShapers Shapes ;
+ any Shapes([in] any Index);
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XOptions.idl b/oovbaapi/ooo/vba/word/XOptions.idl
new file mode 100644
index 0000000000..13bb65ebfc
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XOptions.idl
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XOptions_idl__
+#define __ooo_vba_word_XOptions_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XOptions
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute] long DefaultBorderLineStyle;
+ [attribute] long DefaultBorderLineWidth;
+ [attribute] long DefaultBorderColorIndex;
+ [attribute] boolean ReplaceSelection;
+ [attribute] boolean MapPaperSize;
+ [attribute] boolean AutoFormatAsYouTypeApplyHeadings;
+ [attribute] boolean AutoFormatAsYouTypeApplyBulletedLists;
+ [attribute] boolean AutoFormatAsYouTypeApplyNumberedLists;
+ [attribute] boolean AutoFormatAsYouTypeFormatListItemBeginning;
+ [attribute] boolean AutoFormatAsYouTypeDefineStyles;
+ [attribute] boolean AutoFormatApplyHeadings;
+ [attribute] boolean AutoFormatApplyLists;
+ [attribute] boolean AutoFormatApplyBulletedLists;
+
+ any DefaultFilePath( [in] long Path );
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XPageSetup.idl b/oovbaapi/ooo/vba/word/XPageSetup.idl
new file mode 100644
index 0000000000..ca8e944607
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XPageSetup.idl
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * 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$
+ * $Revision$
+ *
+ * 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 __ooo_vba_word_XPageSetup_idl__
+#define __ooo_vba_word_XPageSetup_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+
+
+interface XPageSetup : com::sun::star::uno::XInterface
+{
+ [attribute] double Gutter;
+ [attribute] double HeaderDistance;
+ [attribute] double FooterDistance;
+ [attribute] boolean DifferentFirstPageHeaderFooter;
+ [attribute] long SectionStart;
+};
+
+//=============================================================================
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XPane.idl b/oovbaapi/ooo/vba/word/XPane.idl
new file mode 100644
index 0000000000..db506dd634
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XPane.idl
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XPane_idl__
+#define __ooo_vba_word_XPane_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XPane
+{
+ interface ooo::vba::XHelperInterface;
+
+ any View();
+ void Close();
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XPanes.idl b/oovbaapi/ooo/vba/word/XPanes.idl
new file mode 100644
index 0000000000..ba0154c604
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XPanes.idl
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XPanes_idl__
+#define __ooo_vba_word_XPanes_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+
+interface XPanes
+{
+ interface ::ooo::vba::XCollection;
+};
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/word/XParagraph.idl b/oovbaapi/ooo/vba/word/XParagraph.idl
new file mode 100644
index 0000000000..79ad7ae83a
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XParagraph.idl
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XParagraph_idl__
+#define __ooo_vba_word_XParagraph_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XRange;
+interface XParagraph
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute, readonly] XRange Range;
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XParagraphFormat.idl b/oovbaapi/ooo/vba/word/XParagraphFormat.idl
new file mode 100644
index 0000000000..df6d584345
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XParagraphFormat.idl
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XParagraphFormat_idl__
+#define __ooo_vba_word_XParagraphFormat_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+
+module ooo { module vba { module word {
+
+interface XParagraphFormat
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute] long Alignment;
+ [attribute] float FirstLineIndent;
+ [attribute] any KeepTogether;
+ [attribute] any KeepWithNext;
+ [attribute] any Hyphenation;
+ [attribute] float LineSpacing;
+ [attribute] long LineSpacingRule;
+ [attribute] any NoLineNumber;
+ [attribute] long OutlineLevel;
+ [attribute] any PageBreakBefore;
+ [attribute] float SpaceBefore;
+ [attribute] float SpaceAfter;
+ [attribute] float LeftIndent;
+ [attribute] float RightIndent;
+ [attribute] any TabStops;
+ [attribute] any WidowControl;
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XParagraphs.idl b/oovbaapi/ooo/vba/word/XParagraphs.idl
new file mode 100644
index 0000000000..d5b916a168
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XParagraphs.idl
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XParagraphs_idl__
+#define __ooo_vba_word_XParagraphs_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+
+interface XParagraphs
+{
+ interface ::ooo::vba::XCollection;
+};
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/word/XRange.idl b/oovbaapi/ooo/vba/word/XRange.idl
new file mode 100644
index 0000000000..47e688e64c
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XRange.idl
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XRange_idl__
+#define __ooo_vba_word_XRange_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __com_sun_star_text_XTextRange_idl__
+#include <com/sun/star/text/XTextRange.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+
+module ooo { module vba { module word {
+
+interface XParagraphFormat;
+interface XStyle;
+interface XFont;
+interface XRange
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute] string Text;
+ [attribute] XParagraphFormat ParagraphFormat;
+ [attribute] XStyle Style;
+ [attribute,readonly] ::com::sun::star::text::XTextRange XTextRange;
+ // Of course Font is NOT readonly, #FIXME #TODO
+ // readonly though will force an error attempting to write
+ [attribute, readonly] XFont Font;
+ [attribute] long LanguageID;
+ [attribute] long Start;
+ [attribute] long End;
+
+ void InsertBreak( [in] any Type );
+ void Select();
+ void InsertParagraph();
+ void InsertParagraphBefore();
+ void InsertParagraphAfter();
+ any PageSetup();
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XReplacement.idl b/oovbaapi/ooo/vba/word/XReplacement.idl
new file mode 100644
index 0000000000..daae501598
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XReplacement.idl
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XReplacement_idl__
+#define __ooo_vba_word_XReplacement_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XReplacement
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute] string Text;
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XSection.idl b/oovbaapi/ooo/vba/word/XSection.idl
new file mode 100644
index 0000000000..c79a24b352
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XSection.idl
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XSection_idl__
+#define __ooo_vba_word_XSection_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XSection
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute] boolean ProtectedForForms;
+
+ any Headers();
+ any Footers();
+ any PageSetup();
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XSections.idl b/oovbaapi/ooo/vba/word/XSections.idl
new file mode 100644
index 0000000000..6e9d2a2ee3
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XSections.idl
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XSections_idl__
+#define __ooo_vba_word_XSections_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+
+interface XSections
+{
+ interface ::ooo::vba::XCollection;
+
+ any PageSetup();
+};
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/word/XSelection.idl b/oovbaapi/ooo/vba/word/XSelection.idl
new file mode 100644
index 0000000000..44026da26a
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XSelection.idl
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XSelection_idl__
+#define __ooo_vba_word_XSelection_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+
+module ooo { module vba { module word {
+
+interface XRange;
+interface XParagraphFormat;
+interface XFind;
+interface XFont;
+interface XStyle;
+interface XHeaderFooter;
+interface XSelection
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute] string Text;
+ [attribute, readonly] XRange Range;
+ [attribute] XParagraphFormat ParagraphFormat;
+ [attribute, readonly] XFind Find;
+ [attribute] XStyle Style;
+ [attribute, readonly] XFont Font;
+ [attribute, readonly] XHeaderFooter HeaderFooter;
+ [attribute] long LanguageID;
+ [attribute] long Start;
+ [attribute] long End;
+
+ any Tables( [in] any aIndex );
+ any Fields( [in] any aIndex );
+ void TypeText( [in] string Text );
+ void HomeKey( [in] any Unit, [in] any Extend );
+ void EndKey( [in] any Unit, [in] any Extend );
+ void Delete( [in] any Unit, [in] any Count );
+ void MoveRight( [in] any Unit, [in] any Count, [in] any Extend );
+ void MoveLeft( [in] any Unit, [in] any Count, [in] any Extend );
+ void MoveDown( [in] any Unit, [in] any Count, [in] any Extend );
+ void TypeParagraph();
+ void InsertParagraph();
+ void InsertParagraphBefore();
+ void InsertParagraphAfter();
+ void TypeBackspace();
+ XRange GoTo( [in] any What, [in] any Which, [in] any Count, [in] any Name );
+ any Information( [in] long Type );
+ void InsertBreak( [in] any Type );
+ any ShapeRange();
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XStyle.idl b/oovbaapi/ooo/vba/word/XStyle.idl
new file mode 100644
index 0000000000..af19517265
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XStyle.idl
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XStyle_idl__
+#define __ooo_vba_word_XStyle_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XFont;
+interface XStyle
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute] string Name;
+ [attribute] long LanguageID;
+ [attribute, readonly] long Type;
+ [attribute, readonly] XFont Font;
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XStyles.idl b/oovbaapi/ooo/vba/word/XStyles.idl
new file mode 100644
index 0000000000..312551a4bb
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XStyles.idl
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XStyles_idl__
+#define __ooo_vba_word_XStyles_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+
+interface XStyles
+{
+ interface ::ooo::vba::XCollection;
+};
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/word/XSystem.idl b/oovbaapi/ooo/vba/word/XSystem.idl
new file mode 100644
index 0000000000..5a23f5604f
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XSystem.idl
@@ -0,0 +1,56 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XSystem_idl__
+#define __ooo_vba_word_XSystem_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+
+module ooo { module vba { module word {
+
+interface XSystem
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute] long Cursor;
+ any PrivateProfileString( [in] string Filename, [in] string Section, [in] string Key );
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XTable.idl b/oovbaapi/ooo/vba/word/XTable.idl
new file mode 100644
index 0000000000..f677da6bd1
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XTable.idl
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: XTable.idl,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: jsc $ $Date: 2007/02/09 08:35:01 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef __ooo_vba_word_XTable_idl__
+#define __ooo_vba_word_XTable_idl__
+
+#ifndef __com_sun_star_script_BasicErrorException_idl__
+#include <com/sun/star/script/BasicErrorException.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+module ooo { module vba { module word {
+
+interface XRange;
+
+interface XTable
+{
+ interface ::ooo::vba::XHelperInterface;
+ [attribute, readonly ] string Name; // for debug only
+
+ XRange Range() raises (com::sun::star::script::BasicErrorException);
+
+ /**
+ select the table
+ */
+ void Select()
+ raises (com::sun::star::script::BasicErrorException);
+
+ /**
+ delete the table
+ */
+ void Delete()
+ raises (com::sun::star::script::BasicErrorException);
+
+ /**
+ convert the table to text
+ @param Separator the separator used for the text where cell separation was
+ @return XRange a range containing the text
+ @throw BasicErrorException when the conversion cannot be done
+ */
+/*
+ XRange ConvertToText([in] any Separator, [in] any NestedTables)
+ raises(com::sun::star::script::BasicErrorException);
+*/
+ any Borders( [in] any aIndex );
+
+};
+
+}; }; };
+
+#endif
+
diff --git a/oovbaapi/ooo/vba/word/XTables.idl b/oovbaapi/ooo/vba/word/XTables.idl
new file mode 100644
index 0000000000..f09f27fb78
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XTables.idl
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: XTables.idl,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: jsc $ $Date: 2007/02/09 08:45:13 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef __ooo_vba_word__XTables_idl__
+#define __ooo_vba_word__XTables_idl__
+
+#ifndef __ooo_vba_HelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+#ifndef __ooo_vba_word_XTable_idl__
+#include <ooo/vba/word/XTable.idl>
+#endif
+
+#ifndef __com_sun_star_script_BasicErrorException_idl__
+#include <com/sun/star/script/BasicErrorException.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XRange;
+
+interface XTables
+{
+ interface ooo::vba::XCollection;
+ /** Creates a new Table, optionally with a name.
+ <p>Creates a new table at the current cursor position. </p>
+ @param range
+ @returns
+ reference to the new table.
+ */
+ XTable Add([in] XRange Range, [in] any NumRows, [in] any NumColumns,
+ /*optional*/ [in] any DefaultTableBehavior,
+ /*optional*/ [in] any AutoFitBehavior)
+ raises(com::sun::star::script::BasicErrorException);
+
+
+};
+
+}; }; };
+
+#endif
+
diff --git a/oovbaapi/ooo/vba/word/XTemplate.idl b/oovbaapi/ooo/vba/word/XTemplate.idl
new file mode 100644
index 0000000000..a2bd1d724a
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XTemplate.idl
@@ -0,0 +1,56 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XTemplate_idl__
+#define __ooo_vba_word_XTemplate_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XTemplate
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute, readonly] string Name;
+
+ any AutoTextEntries( [in] any aIndex );
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XVariable.idl b/oovbaapi/ooo/vba/word/XVariable.idl
new file mode 100644
index 0000000000..c31897a194
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XVariable.idl
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XVariable_idl__
+#define __ooo_vba_word_XVariable_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+#ifndef __com_sun_star_container_XNamed_idl__
+#include <com/sun/star/container/XNamed.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XVariable
+{
+ interface ooo::vba::XHelperInterface;
+ interface ::com::sun::star::container::XNamed;
+
+ [attribute] any Value;
+ [attribute, readonly] long Index;
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XVariables.idl b/oovbaapi/ooo/vba/word/XVariables.idl
new file mode 100644
index 0000000000..d219669fd6
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XVariables.idl
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XVariables_idl__
+#define __ooo_vba_word_XVariables_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XCollection_idl__
+#include <ooo/vba/XCollection.idl>
+#endif
+
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+
+interface XVariables
+{
+ interface ::ooo::vba::XCollection;
+
+ any Add( [in] string Name, [in] any Value );
+};
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/word/XView.idl b/oovbaapi/ooo/vba/word/XView.idl
new file mode 100644
index 0000000000..1800d683e4
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XView.idl
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 __ooo_vba_word_XView_idl__
+#define __ooo_vba_word_XView_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+
+interface XView
+{
+ interface ooo::vba::XHelperInterface;
+
+ [attribute] long SeekView;
+ [attribute] long SplitSpecial;
+ [attribute] boolean TableGridLines;
+ [attribute] long Type;
+};
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XWindow.idl b/oovbaapi/ooo/vba/word/XWindow.idl
new file mode 100644
index 0000000000..91984eb80c
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XWindow.idl
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * 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: XWindow.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_word_XWindow_idl__
+#define __ooo_vba_word_XWindow_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+//=============================================================================
+
+module ooo { module vba { module word {
+
+//=============================================================================
+//interface XPane;
+interface XWindow : com::sun::star::uno::XInterface
+{
+ [attribute] any View;
+ void Activate();
+ void Close([in] any SaveChanges, [in] any RouteDocument);
+ any Panes( [in] any aIndex ); // this is a fake api for it seems not support in Write
+ any ActivePane(); // this is a fake api for it seems not support in Write
+};
+
+//=============================================================================
+
+}; }; };
+
+#endif
+
+
diff --git a/oovbaapi/ooo/vba/word/XWrapFormat.idl b/oovbaapi/ooo/vba/word/XWrapFormat.idl
new file mode 100644
index 0000000000..386feb320f
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XWrapFormat.idl
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * 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: XWrapFormat.idl,v $
+ * $Revision: 1.3 $
+ *
+ * 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 __ooo_vba_word_XWrapFormat_idl__
+#define __ooo_vba_word_XWrapFormat_idl__
+
+#ifndef __ooo_vba_XHelperInterface_idl__
+#include <ooo/vba/XHelperInterface.idl>
+#endif
+
+module ooo { module vba { module word {
+interface XWrapFormat : ooo::vba::XHelperInterface
+{
+ [attribute] long Type;
+ [attribute] long Side;
+ [attribute] float DistanceTop;
+ [attribute] float DistanceBottom;
+ [attribute] float DistanceLeft;
+ [attribute] float DistanceRight;
+};
+}; }; };
+#endif
diff --git a/oovbaapi/ooo/vba/word/makefile.mk b/oovbaapi/ooo/vba/word/makefile.mk
new file mode 100644
index 0000000000..a5b2e64e57
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/makefile.mk
@@ -0,0 +1,90 @@
+#*************************************************************************
+#
+# 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: makefile.mk,v $
+#
+# $Revision: 1.4 $
+#
+# 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.
+#
+#*************************************************************************
+PRJ=..$/..$/..
+
+PRJNAME=oovapi
+
+TARGET=word
+PACKAGE=ooo$/vba$/Word
+
+# --- Settings -----------------------------------------------------
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+# ------------------------------------------------------------------------
+
+
+IDLFILES= XGlobals.idl\
+ XApplication.idl \
+ XDocument.idl \
+ XWindow.idl \
+ XSystem.idl \
+ XRange.idl \
+ XBookmark.idl \
+ XBookmarks.idl \
+ XVariable.idl \
+ XVariables.idl \
+ XView.idl \
+ XPane.idl \
+ XPanes.idl \
+ XOptions.idl \
+ XSelection.idl \
+ XTemplate.idl \
+ XParagraphFormat.idl \
+ XAutoTextEntries.idl \
+ XAutoTextEntry.idl \
+ XParagraphs.idl \
+ XParagraph.idl \
+ XFind.idl \
+ XReplacement.idl \
+ XStyle.idl \
+ XStyles.idl \
+ XFont.idl \
+ XTable.idl \
+ XTables.idl \
+ XField.idl \
+ XFields.idl \
+ XBorder.idl \
+ XBorders.idl \
+ XDocuments.idl \
+ XHeaderFooter.idl \
+ XAddins.idl \
+ XAddin.idl \
+ XDialogs.idl \
+ XDialog.idl \
+ XWrapFormat.idl \
+ XPageSetup.idl \
+ XSection.idl \
+ XSections.idl \
+
+# ------------------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/oovbaapi/prj/build.lst b/oovbaapi/prj/build.lst
index bc34a4f376..e6d23a3bed 100644
--- a/oovbaapi/prj/build.lst
+++ b/oovbaapi/prj/build.lst
@@ -4,5 +4,6 @@ ovba oovbaapi\genconstidl nmake - all ovba_genconstidl NULL
ovba oovbaapi\ooo\vba\constants nmake - all ovba_constants ovba_genconstidl NULL
ovba oovbaapi\ooo\vba nmake - all ovba_vba NULL
ovba oovbaapi\ooo\vba\excel nmake - all ovba_excel NULL
+ovba oovbaapi\ooo\vba\word nmake - all ovba_word NULL
ovba oovbaapi\ooo\vba\msforms nmake - all ovba_msforms NULL
-ovba oovbaapi\util nmake - all ovba_util ovba_vba ovba_excel ovba_msforms ovba_constants ovba_genconstidl NULL
+ovba oovbaapi\util nmake - all ovba_util ovba_vba ovba_excel ovba_word ovba_msforms ovba_constants ovba_genconstidl NULL
diff --git a/oovbaapi/util/makefile.mk b/oovbaapi/util/makefile.mk
index 9fbd349b08..e5ccb5da5f 100644
--- a/oovbaapi/util/makefile.mk
+++ b/oovbaapi/util/makefile.mk
@@ -50,6 +50,7 @@ dummy:
UNOIDLDBFILES= \
$(UCR)$/vba.db \
$(UCR)$/excel.db \
+ $(UCR)$/word.db \
$(UCR)$/msforms.db \
$(UCR)$/constants.db
diff --git a/sfx2/inc/sfx2/childwin.hxx b/sfx2/inc/sfx2/childwin.hxx
index e0a103daed..e9b7bc7cde 100644
--- a/sfx2/inc/sfx2/childwin.hxx
+++ b/sfx2/inc/sfx2/childwin.hxx
@@ -205,8 +205,10 @@ public:
void SetPosSizePixel(const Point& rPoint, Size& rSize);
Point GetPosPixel()
{ return pWindow->GetPosPixel(); }
- void Hide();
- void Show( USHORT nFlags );
+//<!--Modified by PengYunQuan for Validity Cell Range Picker
+ virtual void Hide();
+ virtual void Show( USHORT nFlags );
+//-->Modified by PengYunQuan for Validity Cell Range Picker
sal_uInt16 GetFlags() const
{ return GetInfo().nFlags; }
sal_Bool CanGetFocus() const;
diff --git a/sfx2/inc/sfx2/mnuitem.hxx b/sfx2/inc/sfx2/mnuitem.hxx
index 8ab848b2bc..fd06202cd3 100644
--- a/sfx2/inc/sfx2/mnuitem.hxx
+++ b/sfx2/inc/sfx2/mnuitem.hxx
@@ -90,9 +90,9 @@ public:
virtual void StateChanged( USHORT nSID, SfxItemState eState,
const SfxPoolItem* pState );
- static SfxMenuControl* CreateControl( USHORT nId, Menu &, SfxBindings & );
- static SfxUnoMenuControl*
- CreateControl( const String&, USHORT, Menu&, SfxBindings&, SfxVirtualMenu* );
+ static SfxMenuControl* CreateControl( USHORT nId, Menu &, SfxBindings & );
+ static SfxUnoMenuControl* CreateControl( const String&, USHORT, Menu&, SfxBindings&, SfxVirtualMenu* );
+ static SfxUnoMenuControl* CreateControl( const String&, USHORT, Menu&, const String& sItemText, const String& sHelpText, SfxBindings&, SfxVirtualMenu* );
static BOOL IsSpecialControl( USHORT nId, SfxModule* );
static void RegisterMenuControl(SfxModule*, SfxMenuCtrlFactory*);
@@ -104,6 +104,9 @@ class SfxUnoMenuControl : public SfxMenuControl
public:
SfxUnoMenuControl( const String&, USHORT nId, Menu&,
SfxBindings&, SfxVirtualMenu* );
+ SfxUnoMenuControl( const String&, USHORT nId, Menu&,
+ const String&, const String&,
+ SfxBindings&, SfxVirtualMenu* );
~SfxUnoMenuControl();
void Select();
};
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index d9996b0d4b..00f12803e0 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -261,6 +261,7 @@ public:
TYPEINFO();
SFX_DECL_INTERFACE(SFX_INTERFACE_SFXDOCSH)
+ static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
/* Stampit disable/enable cancel button for print jobs
default = true = enable! */
void Stamp_SetPrintCancelState(sal_Bool bState);
@@ -303,6 +304,9 @@ public:
sal_Bool IsReadOnlyUI() const;
void SetNoName();
sal_Bool IsInModalMode() const;
+ //<!--Added by PengYunQuan for Validity Cell Range Picker
+ virtual sal_Bool AcceptStateUpdate() const;
+ //-->Added by PengYunQuan for Validity Cell Range Picker
sal_Bool HasModalViews() const;
sal_Bool IsHelpDocument() const;
@@ -889,6 +893,7 @@ public:
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
SfxObjectShell* GetObjectShell() const
{ return pObjSh; }
+
};
#endif
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 02efe0aeba..f66e60c814 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1711,7 +1711,10 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer )
// modifying the SfxObjectInterface-stack without SfxBindings => nothing to do
SfxViewFrame* pFrame = pDispatcher->GetFrame();
- if ( (pFrame && pFrame->GetObjectShell()->IsInModalMode()) || pSfxApp->IsDowning() || !pImp->pCaches->Count() )
+ //<!--Modified by PengYunQuan for Validity Cell Range Picker
+ //if ( (pFrame && pFrame->GetObjectShell()->IsInModalMode()) || pSfxApp->IsDowning() || !pImp->pCaches->Count() )
+ if ( (pFrame && !pFrame->GetObjectShell()->AcceptStateUpdate()) || pSfxApp->IsDowning() || !pImp->pCaches->Count() )
+ //-->Modified by PengYunQuan for Validity Cell Range Picker
{
DBG_PROFSTOP(SfxBindingsNextJob_Impl0);
return sal_True;
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index f44ac7c3ec..445508e2e1 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -155,6 +155,8 @@ using namespace ::com::sun::star::io;
#define MAX_REDIRECT 5
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath );
+
//==========================================================
namespace {
@@ -1145,6 +1147,15 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
}
catch( uno::Exception )
{}
+
+ if ( !bContentReadonly )
+ {
+ // the file is not readonly, check the ACL
+
+ String aPhysPath;
+ if ( ::utl::LocalFileHelper::ConvertURLToPhysicalName( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aPhysPath ) )
+ bContentReadonly = IsReadonlyAccordingACL( aPhysPath.GetBuffer() );
+ }
}
// do further checks only if the file not readonly in fs
diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk
index 1b42844491..66fd03175a 100644
--- a/sfx2/source/doc/makefile.mk
+++ b/sfx2/source/doc/makefile.mk
@@ -86,11 +86,19 @@ SLOFILES = \
$(SLO)$/DocumentMetadataAccess.obj \
$(SLO)$/Metadatable.obj \
$(SLO)$/sfxmodelfactory.obj \
+ $(SLO)$/sfxacldetect.obj \
$(SLO)$/docstoragemodifylistener.obj \
$(SLO)$/querytemplate.obj
# $(SLO)$/applet.obj \
+.IF "$(GUI)" == "WNT"
+
+#HACK TO DISABLE PCH
+NOOPTFILES= \
+ $(SLO)$/sfxacldetect.obj
+.ENDIF
+
# --- Tagets -------------------------------------------------------
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 8398679302..d63d1fc17e 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -1423,31 +1423,35 @@ sal_Bool SfxObjectShell::IsHelpDocument() const
void SfxObjectShell::ResetFromTemplate( const String& rTemplateName, const String& rFileName )
{
- uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties());
- xDocProps->setTemplateURL( ::rtl::OUString() );
- xDocProps->setTemplateName( ::rtl::OUString() );
- xDocProps->setTemplateDate( util::DateTime() );
- xDocProps->resetUserData( ::rtl::OUString() );
-
- // TODO/REFACTOR:
- // Title?
-
- if( ::utl::LocalFileHelper::IsLocalFile( rFileName ) )
+ // only care about reseting this data for openoffice formats otherwise
+ if ( IsOwnStorageFormat_Impl( *GetMedium()) )
{
- String aFoundName;
- if( SFX_APP()->Get_Impl()->GetDocumentTemplates()->GetFull( String(), rTemplateName, aFoundName ) )
+ uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties());
+ xDocProps->setTemplateURL( ::rtl::OUString() );
+ xDocProps->setTemplateName( ::rtl::OUString() );
+ xDocProps->setTemplateDate( util::DateTime() );
+ xDocProps->resetUserData( ::rtl::OUString() );
+
+ // TODO/REFACTOR:
+ // Title?
+
+ if( ::utl::LocalFileHelper::IsLocalFile( rFileName ) )
{
- INetURLObject aObj( rFileName );
- xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) );
- xDocProps->setTemplateName( rTemplateName );
-
- ::DateTime now;
- xDocProps->setTemplateDate( util::DateTime(
- now.Get100Sec(), now.GetSec(), now.GetMin(),
- now.GetHour(), now.GetDay(), now.GetMonth(),
- now.GetYear() ) );
-
- SetQueryLoadTemplate( sal_True );
+ String aFoundName;
+ if( SFX_APP()->Get_Impl()->GetDocumentTemplates()->GetFull( String(), rTemplateName, aFoundName ) )
+ {
+ INetURLObject aObj( rFileName );
+ xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) );
+ xDocProps->setTemplateName( rTemplateName );
+
+ ::DateTime now;
+ xDocProps->setTemplateDate( util::DateTime(
+ now.Get100Sec(), now.GetSec(), now.GetMin(),
+ now.GetHour(), now.GetDay(), now.GetMonth(),
+ now.GetYear() ) );
+
+ SetQueryLoadTemplate( sal_True );
+ }
}
}
}
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index ff4ed98058..57f6aab335 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -491,6 +491,13 @@ sal_Bool SfxObjectShell::IsInModalMode() const
return pImp->bModalMode || pImp->bRunningMacro;
}
+//<!--Added by PengYunQuan for Validity Cell Range Picker
+sal_Bool SfxObjectShell::AcceptStateUpdate() const
+{
+ return !IsInModalMode();
+}
+//-->Added by PengYunQuan for Validity Cell Range Picker
+
//-------------------------------------------------------------------------
sal_Bool SfxObjectShell::HasModalViews() const
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 8cf35d3533..20ea6dfa77 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1512,3 +1512,19 @@ void SfxObjectShell::SignScriptingContent()
ImplSign( TRUE );
}
+// static
+const uno::Sequence<sal_Int8>& SfxObjectShell::getUnoTunnelId()
+{
+ static uno::Sequence<sal_Int8> * pSeq = 0;
+ if( !pSeq )
+ {
+ osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
+ if( !pSeq )
+ {
+ static uno::Sequence< sal_Int8 > aSeq( 16 );
+ rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
+ pSeq = &aSeq;
+ }
+ }
+ return *pSeq;
+}
diff --git a/sfx2/source/doc/sfxacldetect.cxx b/sfx2/source/doc/sfxacldetect.cxx
new file mode 100755
index 0000000000..94370e9a1c
--- /dev/null
+++ b/sfx2/source/doc/sfxacldetect.cxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * 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: shutdowniconw32.cxx,v $
+ * $Revision: 1.48 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifdef WNT
+
+// necessary to include system headers without warnings
+#ifdef _MSC_VER
+#pragma warning(disable:4668 4917)
+#endif
+
+#include <windows.h>
+#include <lmaccess.h>
+#include <sal/types.h>
+
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath )
+{
+ sal_Bool bResult = sal_False;
+
+ sal_uInt32 nFDSize = 0;
+ GetFileSecurityW( pFilePath, DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, NULL, 0, &nFDSize );
+ if ( nFDSize )
+ {
+ PSECURITY_DESCRIPTOR pFileDescr = reinterpret_cast< PSECURITY_DESCRIPTOR >( malloc( nFDSize ) );
+ if ( GetFileSecurityW( pFilePath, DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, pFileDescr, nFDSize, &nFDSize ) )
+ {
+ HANDLE hToken = NULL;
+ if ( OpenThreadToken( GetCurrentThread(), TOKEN_DUPLICATE|TOKEN_QUERY, TRUE, &hToken )
+ || OpenProcessToken( GetCurrentProcess(), TOKEN_DUPLICATE|TOKEN_QUERY, &hToken) )
+ {
+ HANDLE hImpersonationToken = NULL;
+ if ( DuplicateToken( hToken, SecurityImpersonation, &hImpersonationToken) )
+ {
+ sal_uInt32 nDesiredAccess = ACCESS_WRITE;
+ GENERIC_MAPPING aGenericMapping = { ACCESS_READ, ACCESS_WRITE, 0, ACCESS_READ | ACCESS_WRITE };
+ MapGenericMask( &nDesiredAccess, &aGenericMapping );
+
+ PRIVILEGE_SET aPrivilegeSet;
+ sal_uInt32 nPrivilegeSetSize = sizeof( PRIVILEGE_SET );
+
+ sal_uInt32 nGrantedAccess;
+ BOOL bAccessible = TRUE;
+ if ( AccessCheck( pFileDescr,
+ hImpersonationToken,
+ nDesiredAccess,
+ &aGenericMapping,
+ &aPrivilegeSet,
+ &nPrivilegeSetSize,
+ &nGrantedAccess,
+ &bAccessible ) )
+ {
+ bResult = !bAccessible;
+ }
+
+ CloseHandle( hImpersonationToken );
+ }
+
+ CloseHandle( hToken );
+ }
+ }
+
+ free( pFileDescr );
+ }
+
+ return bResult;
+}
+
+#else // this is UNX
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sfx2.hxx"
+
+
+#include <sal/types.h>
+
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* )
+{
+ // to be implemented
+ return sal_False;
+}
+
+#endif
+
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 50eaf3d549..8c1e42a44e 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -542,6 +542,13 @@ SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd,
return new SfxUnoMenuControl( rCmd, nId, rMenu, rBindings, pVirt );
}
+SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd,
+ USHORT nId, Menu& rMenu, const String& sItemText, const String& sHelpText,
+ SfxBindings& rBindings, SfxVirtualMenu* pVirt)
+{
+ return new SfxUnoMenuControl( rCmd, nId, rMenu, sItemText, sHelpText, rBindings, pVirt);
+}
+
SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, USHORT nSlotId,
Menu& rMenu, SfxBindings& rBindings, SfxVirtualMenu* pVirt )
: SfxMenuControl( nSlotId, rBindings )
@@ -554,6 +561,19 @@ SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, USHORT nSlotId,
pUnoCtrl->GetNewDispatch();
}
+SfxUnoMenuControl::SfxUnoMenuControl(
+ const String& rCmd, USHORT nSlotId, Menu& /*rMenu*/,
+ const String& rItemText, const String& rHelpText,
+ SfxBindings& rBindings, SfxVirtualMenu* pVirt)
+ : SfxMenuControl( nSlotId, rBindings )
+{
+ Bind( pVirt, nSlotId, rItemText, rHelpText, rBindings);
+ UnBind();
+ pUnoCtrl = new SfxUnoControllerItem( this, rBindings, rCmd );
+ pUnoCtrl->acquire();
+ pUnoCtrl->GetNewDispatch();
+}
+
SfxUnoMenuControl::~SfxUnoMenuControl()
{
pUnoCtrl->UnBind();
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index 9c251c0456..b1eb2bd3d8 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -417,8 +417,12 @@ void SfxVirtualMenu::CreateFromSVMenu()
DELETEZ( pPopup );
}
+ const String sItemText = pSVMenu->GetItemText(nSlotId);
+ const String sHelpText = pSVMenu->GetHelpText(nSlotId);
+
if ( pPopup )
{
+
SfxMenuControl *pMnuCtrl =
SfxMenuControl::CreateControl(nSlotId, *pPopup, *pBindings);
@@ -434,10 +438,8 @@ void SfxVirtualMenu::CreateFromSVMenu()
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count() );
- (pItems+nPos)->Bind( 0, nSlotId, pSVMenu->GetItemText(nSlotId),
- pSVMenu->GetHelpText(nSlotId), *pBindings);
- pMnuCtrl->Bind( this, nSlotId, pSVMenu->GetItemText(nSlotId),
- pSVMenu->GetHelpText(nSlotId), *pBindings);
+ (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings);
+ pMnuCtrl->Bind( this, nSlotId, sItemText, sHelpText, *pBindings);
if ( Application::GetSettings().GetStyleSettings().GetUseImagesInMenus() )
{
@@ -473,7 +475,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
{
pMnuCtrl->Bind( this, nSlotId,
*new SfxVirtualMenu(nSlotId, this, *pPopup, bHelpInitialized, *pBindings, bOLE, bResCtor),
- pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId),
+ sItemText, sHelpText,
*pBindings );
}
}
@@ -510,12 +512,12 @@ void SfxVirtualMenu::CreateFromSVMenu()
if ( aCmd.Len() && (( nSlotId < SID_SFX_START ) || ( nSlotId > SHRT_MAX )) )
{
// try to create control via comand name
- pMnuCtrl = SfxMenuControl::CreateControl( aCmd, nSlotId, *pSVMenu, *pBindings, this );
+ pMnuCtrl = SfxMenuControl::CreateControl( aCmd, nSlotId, *pSVMenu, sItemText, sHelpText, *pBindings, this );
if ( pMnuCtrl )
{
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count());
- (pItems+nPos)->Bind( 0, nSlotId, pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId), *pBindings);
+ (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings);
}
}
@@ -527,13 +529,13 @@ void SfxVirtualMenu::CreateFromSVMenu()
{
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count());
- (pItems+nPos)->Bind( 0, nSlotId, pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId), *pBindings);
+ (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings);
}
else
// take default control
pMnuCtrl = (pItems+nPos);
- pMnuCtrl->Bind( this, nSlotId, pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId), *pBindings);
+ pMnuCtrl->Bind( this, nSlotId, sItemText, sHelpText, *pBindings);
}
if ( Application::GetSettings().GetStyleSettings().GetUseImagesInMenus() )
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 5a64421423..c4b9e49aef 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -81,6 +81,7 @@
#include <vos/mutex.hxx>
#include <osl/mutex.hxx>
+#include <tools/diagnose_ex.h>
#include <comphelper/sequence.hxx>
#include <rtl/ustrbuf.hxx>
#include <toolkit/helper/convert.hxx>
@@ -706,6 +707,29 @@ void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame
SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame() ;
pActFrame->Enable( TRUE );
pActFrame->GetDispatcher()->Lock( FALSE );
+
+ if ( ( m_pData->m_pViewShell->GetObjectShell() != NULL )
+ && ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+ )
+ {
+ SfxViewFrame* pViewFrm = m_pData->m_pViewShell->GetViewFrame();
+ if ( !pViewFrm->GetFrame()->IsInPlace() )
+ {
+ // for outplace embedded objects, we want the layout manager to keep the content window
+ // size constant, if possible
+ try
+ {
+ uno::Reference< beans::XPropertySet > xFrameProps( m_pData->m_xFrame, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xLayouterProps(
+ xFrameProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) ), uno::UNO_QUERY_THROW );
+ xLayouterProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PreserveContentSize" ) ), uno::makeAny( sal_True ) );
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
}
}
}
diff --git a/shell/inc/internal/config.hxx b/shell/inc/internal/config.hxx
index 21c4387c1c..caf33f39a3 100644
--- a/shell/inc/internal/config.hxx
+++ b/shell/inc/internal/config.hxx
@@ -39,8 +39,13 @@
#include <tchar.h>
#endif
+#ifdef _AMD64_
+#define MODULE_NAME TEXT("shlxthdl_x64.dll")
+#define MODULE_NAME_FILTER TEXT("ooofilt_x64.dll")
+#else
#define MODULE_NAME TEXT("shlxthdl.dll")
#define MODULE_NAME_FILTER TEXT("ooofilt.dll")
+#endif
#define COLUMN_HANDLER_DESCRIPTIVE_NAME TEXT("OpenOffice.org Column Handler")
#define INFOTIP_HANDLER_DESCRIPTIVE_NAME TEXT("OpenOffice.org Infotip Handler")
diff --git a/shell/inc/internal/utilities.hxx b/shell/inc/internal/utilities.hxx
index 9d5b43117c..ebdf60519f 100644
--- a/shell/inc/internal/utilities.hxx
+++ b/shell/inc/internal/utilities.hxx
@@ -47,6 +47,7 @@
#include "internal/types.hxx"
#include <string>
+#include <strsafe.h>
//---------------------------------
/** Convert a string to a wstring
@@ -89,4 +90,23 @@ bool HasOnlySpaces(const std::wstring& String);
LCID LocaleSetToLCID( const LocaleSet_t & Locale );
#endif
+//----------------------------------------------------------
+#ifdef DEBUG
+inline void OutputDebugStringFormat( LPCSTR pFormat, ... )
+{
+ CHAR buffer[1024];
+ va_list args;
+
+ va_start( args, pFormat );
+ StringCchVPrintfA( buffer, sizeof(buffer), pFormat, args );
+ OutputDebugStringA( buffer );
+}
+#else
+static inline void OutputDebugStringFormat( LPCSTR, ... )
+{
+}
+#endif
+//----------------------------------------------------------
+
+
#endif
diff --git a/shell/prj/d.lst b/shell/prj/d.lst
index 98d4a6215f..d623a55c2d 100644
--- a/shell/prj/d.lst
+++ b/shell/prj/d.lst
@@ -4,6 +4,9 @@
..\%__SRC%\lib\*.uno.so %_DEST%\lib%_EXT%\*.uno.so
..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
..\%__SRC%\bin\*.exe %_DEST%\bin%_EXT%\*.exe
+..\%__SRC%\bin\x64\shlxthdl.dll %_DEST%\bin%_EXT%\shlxthdl_x64.dll
+..\%__SRC%\bin\x64\ooofiltproxy.dll %_DEST%\bin%_EXT%\ooofiltproxy_x64.dll
+..\%__SRC%\bin\x64\ooofilt.dll %_DEST%\bin%_EXT%\ooofilt_x64.dll
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a
diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx
index e5fa02155f..927e626a48 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -65,6 +65,7 @@
#include <sstream>
#include <iterator>
#include <algorithm>
+#include <string>
namespace /* private */
{
@@ -324,6 +325,8 @@ private:
iso_lang_identifier active_iso_lang_;
};
+typedef std::map< unsigned short , std::string , std::less< unsigned short > > shortmap;
+
//###########################################
void add_group_entries(
Config& aConfig,
@@ -334,21 +337,35 @@ void add_group_entries(
aConfig.SetGroup(GroupName);
size_t key_count = aConfig.GetKeyCount();
+ shortmap map;
for (size_t i = 0; i < key_count; i++)
{
ByteString iso_lang = aConfig.GetKeyName(sal::static_int_cast<USHORT>(i));
ByteString key_value_utf8 = aConfig.ReadKey(sal::static_int_cast<USHORT>(i));
+ iso_lang_identifier myiso_lang( iso_lang );
+ LanguageType ltype = MsLangId::convertIsoNamesToLanguage(myiso_lang.language(), myiso_lang.country());
+ if( ( ltype & 0x0200 ) == 0 && map[ ltype ].empty() )
+ {
+ Substitutor.set_language(iso_lang_identifier(iso_lang));
- Substitutor.set_language(iso_lang_identifier(iso_lang));
-
- key_value_utf8.EraseLeadingAndTrailingChars('\"');
+ key_value_utf8.EraseLeadingAndTrailingChars('\"');
- OUString key_value_utf16 =
- rtl::OStringToOUString(key_value_utf8, RTL_TEXTENCODING_UTF8);
+ OUString key_value_utf16 =
+ rtl::OStringToOUString(key_value_utf8, RTL_TEXTENCODING_UTF8);
- Substitutor.add_substitution(
- GroupName.GetBuffer(), make_winrc_unicode_string(key_value_utf16));
+ Substitutor.add_substitution(
+ GroupName.GetBuffer(), make_winrc_unicode_string(key_value_utf16));
+ map[ static_cast<unsigned short>(ltype) ] = std::string( iso_lang.GetBuffer() );
+ }
+ else
+ {
+ if( !map[ ltype ].empty() )
+ {
+ printf("ERROR: Duplicated ms id %d found for the languages %s and %s !!!! This does not work in microsoft resources\nPlease remove one!\n", ltype , map[ ltype ].c_str() , iso_lang.GetBuffer());
+ exit( -1 );
+ }
+ }
}
}
diff --git a/shell/source/win32/shlxthandler/infotips/infotips.cxx b/shell/source/win32/shlxthandler/infotips/infotips.cxx
index 2b0826fa45..4ebe4c642a 100644
--- a/shell/source/win32/shlxthandler/infotips/infotips.cxx
+++ b/shell/source/win32/shlxthandler/infotips/infotips.cxx
@@ -45,6 +45,8 @@
#include <stdio.h>
#include <utility>
#include <stdlib.h>
+
+
#define MAX_STRING 80
#define KB 1024.0
const std::wstring WSPACE = std::wstring(SPACE);
diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk
index 07eea87f02..479f8c0b6c 100644
--- a/shell/source/win32/shlxthandler/makefile.mk
+++ b/shell/source/win32/shlxthandler/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -123,17 +123,17 @@ SHL1STDLIBS_X64+=\
$(SHELL32LIB_X64)\
$(KERNEL32LIB_X64)\
$(GDI32LIB_X64)\
- $(MSVCRT_X64) \
- $(MSVCPRT_X64) \
$(USER32LIB_X64) \
- $(OLDNAMESLIB_X64) \
- $(GDIPLUSLIB_X64)
+ $(GDIPLUSLIB_X64) \
+ $(MSVCRT_X64) \
+ $(MSVCPRT_X64) \
+ $(OLDNAMESLIB_X64)
SHL1LIBS_X64+=$(SLB_X64)$/util.lib\
$(SLB_X64)$/ooofilereader.lib
SHL1OBJS_X64=$(SLOFILES_X64)
SHL1DEF_X64=$(MISC_X64)$/$(SHL1TARGET).def
-SHL1RES_X64=$(RES_X64)$/$(TARGET)_x64.res
+SHL1RES_X64=$(RES_X64)$/$(TARGET).res
DEF1NAME_X64=$(SHL1TARGET_X64)
DEF1EXPORTFILE_X64=exports.dxp
@@ -144,3 +144,4 @@ DEF1EXPORTFILE_X64=exports.dxp
.INCLUDE : set_wntx64.mk
.INCLUDE : target.mk
.INCLUDE : tg_wntx64.mk
+
diff --git a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx
index b3bbe22964..4836eb34bb 100644
--- a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx
@@ -42,6 +42,7 @@
#ifdef __MINGW32__
#include <basetyps.h>
#endif
+#include "internal/config.hxx"
/*
@@ -87,8 +88,9 @@ void Init()
{
TCHAR buff[MAX_PATH];
GetModuleFileName(hThisLibrary, buff, (sizeof(buff)/sizeof(TCHAR)));
- PathTruncateFileName(buff);
- lstrcat(buff, TEXT("ooofilt.dll"));
+ PathTruncateFileName(buff);
+
+ lstrcat(buff, MODULE_NAME_FILTER);
hOoofilt = LoadLibraryEx(buff, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
index c901c7be42..7172fa8348 100644
--- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
+++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
@@ -177,7 +177,6 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize(
HRESULT STDMETHODCALLTYPE CPropertySheet::AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
{
-
PROPSHEETPAGE psp;
// add the summary property page
@@ -309,7 +308,6 @@ BOOL CALLBACK CPropertySheet::PropPageStatisticsProc(HWND hwnd, UINT uiMsg, WPAR
//##################################
void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
{
-
CMetaInfoReader metaInfo(m_szFileName);
SetWindowText(GetDlgItem(hwnd,IDC_TITLE), metaInfo.getTagData( META_INFO_TITLE ).c_str() );
@@ -335,7 +333,6 @@ void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
*/
void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
{
-
CMetaInfoReader metaInfo(m_szFileName);
document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, &metaInfo);
diff --git a/shell/source/win32/shlxthandler/res/makefile.mk b/shell/source/win32/shlxthandler/res/makefile.mk
index 08893506b2..8f8c776383 100644
--- a/shell/source/win32/shlxthandler/res/makefile.mk
+++ b/shell/source/win32/shlxthandler/res/makefile.mk
@@ -53,9 +53,19 @@ ULFDIR:=$(COMMONMISC)$/$(TARGET)
.ELSE # "$(WITH_LANG)"!=""
ULFDIR:=.
.ENDIF # "$(WITH_LANG)"!=""
+
# --- Targets ------------------------------------------------------
+.IF "$(BUILD_X64)"!=""
+$(RES)$/x64$/$(TARGET).res : $(RES)$/$(TARGET).res
+ -$(MKDIR) $(RES)$/x64
+ @@cp $< $@
+.ENDIF # "$(BUILD_X64)"!=""
+
+.INCLUDE : set_wntx64.mk
.INCLUDE : target.mk
+.INCLUDE : tg_wntx64.mk
+
# Generate the native Windows resource file
diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
index 9c9952e057..0c77dc22f3 100644
--- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
+++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
@@ -30,19 +30,21 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_shell.hxx"
+
#include "internal/global.hxx"
#ifndef INFOTIPS_HXX_INCLUDED
#include "internal/thumbviewer.hxx"
#endif
#include "internal/shlxthdl.hxx"
-#include "internal/utilities.hxx"
#include "internal/registry.hxx"
#include "internal/fileextensions.hxx"
#include "internal/config.hxx"
#include "internal/zipfile.hxx"
+#include "internal/utilities.hxx"
#include "internal/resource.h"
+
#include <stdio.h>
#include <utility>
#include <stdlib.h>
@@ -212,15 +214,15 @@ HRESULT STDMETHODCALLTYPE StreamOnZipBuffer::Read(void *pv, ULONG cb, ULONG *pcb
HRESULT STDMETHODCALLTYPE StreamOnZipBuffer::Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *)
{
- size_t size = ref_zip_buffer_.size();
- size_t p = 0;
+ __int64 size = (__int64) ref_zip_buffer_.size();
+ __int64 p = 0;
switch (dwOrigin)
{
case STREAM_SEEK_SET:
break;
case STREAM_SEEK_CUR:
- p = pos_;
+ p = (__int64) pos_;
break;
case STREAM_SEEK_END:
p = size - 1;
@@ -229,10 +231,11 @@ HRESULT STDMETHODCALLTYPE StreamOnZipBuffer::Seek(LARGE_INTEGER dlibMove, DWORD
HRESULT hr = STG_E_INVALIDFUNCTION;
- p += dlibMove.LowPart;
- if (p < size)
+ p += dlibMove.QuadPart;
+
+ if ( ( p >= 0 ) && (p < size) )
{
- pos_ = p;
+ pos_ = (size_t) p;
hr = S_OK;
}
return hr;
@@ -295,7 +298,7 @@ HRESULT STDMETHODCALLTYPE StreamOnZipBuffer::Clone(IStream **)
CThumbviewer::CThumbviewer(long RefCnt) :
ref_count_(RefCnt)
-{
+{
InterlockedIncrement(&g_DllRefCnt);
thumbnail_size_.cx = 0;
@@ -468,6 +471,7 @@ HRESULT STDMETHODCALLTYPE CThumbviewer::Extract(HBITMAP *phBmpImage)
}
catch(std::exception&)
{
+ OutputDebugStringFormat( "CThumbviewer Extract ERROR!\n" );
hr = E_FAIL;
}
return hr;
diff --git a/shell/source/win32/shlxthandler/util/utilities.cxx b/shell/source/win32/shlxthandler/util/utilities.cxx
index d76e0c9df7..eaffd4f023 100644
--- a/shell/source/win32/shlxthandler/util/utilities.cxx
+++ b/shell/source/win32/shlxthandler/util/utilities.cxx
@@ -32,12 +32,9 @@
#include "precompiled_shell.hxx"
-#include "internal/utilities.hxx"
#include "internal/config.hxx"
#include "internal/dbgmacros.hxx"
-
-
-
+#include "internal/utilities.hxx"
//-----------------------------
// constants
@@ -87,15 +84,9 @@ std::wstring GetResString(int ResId)
{
wchar_t szResStr[MAX_RES_STRING];
- #if OSL_DEBUG_LEVEL > 0
- int rc =
- #endif
- LoadStringW(
- GetModuleHandleW(MODULE_NAME),
- ResId,
- szResStr,
- sizeof(szResStr));
+ int rc = LoadStringW( GetModuleHandleW(MODULE_NAME), ResId, szResStr, sizeof(szResStr) );
+ OutputDebugStringFormat( "GetResString: read %d chars\n", rc );
ENSURE(rc, "String resource not found");
return std::wstring(szResStr);
diff --git a/svx/inc/fmhelp.hrc b/svx/inc/fmhelp.hrc
index 0d00d17f39..b984e74c38 100644
--- a/svx/inc/fmhelp.hrc
+++ b/svx/inc/fmhelp.hrc
@@ -33,106 +33,75 @@
// include -----------------------------------------------------------
#include <svtools/solar.hrc>
-// in solar.hrc
-//#define HID_FORMS_START (HID_LIB_START+4000)
-//#define HID_FORMS_END (HID_LIB_START+4999)
-
// Help-Ids --------------------------------------------------------------
-// insgesamt 200
-#define HID_DLG_DBINFO (HID_FORMS_START + 0)
-#define HID_DLG_DBMSG (HID_FORMS_START + 1)
-
-#define HID_FM_OTHER_START (HID_FORMS_START + 300)
-#define HID_FORM_NAVIGATOR (HID_FM_OTHER_START + 0)
-#define HID_FORM_NAVIGATOR_WIN (HID_FM_OTHER_START + 1)
-#define HID_FIELD_SEL (HID_FM_OTHER_START + 2)
-#define HID_FIELD_SEL_WIN (HID_FM_OTHER_START + 3)
-#define HID_FILTER_NAVIGATOR (HID_FM_OTHER_START + 4)
-#define HID_FILTER_NAVIGATOR_WIN (HID_FM_OTHER_START + 5)
-
-#define HID_FORM_DLG_START (HID_FORMS_START + 400)
-// FREE
-// FREE
-// FREE
-#define HID_FM_PROPDLG_WINDOW (HID_FORM_DLG_START + 3)
-#define HID_FM_PROPDLG_CONTAINER (HID_FORM_DLG_START + 4)
-#define HID_FM_PROPDLG_TABCTR (HID_FORM_DLG_START + 5)
-#define HID_FM_PROPDLG_TAB_GENERAL (HID_FORM_DLG_START + 6)
-#define HID_FM_PROPDLG_TAB_DATA (HID_FORM_DLG_START + 7)
-#define HID_FM_PROPDLG_TAB_EVT (HID_FORM_DLG_START + 8)
-#define HID_FM_DLG_SEARCH (HID_FORM_DLG_START + 9)
-
-#define HID_SEARCH_TEXT (HID_FORM_DLG_START + 10)
-#define HID_SEARCH_ALLFIELDS (HID_FORM_DLG_START + 11)
-#define HID_SEARCH_SINGLEFIELD (HID_FORM_DLG_START + 12)
-#define HID_SEARCH_FIELDSELECTION (HID_FORM_DLG_START + 13)
-#define HID_SEARCH_POSITION (HID_FORM_DLG_START + 14)
-#define HID_SEARCH_FORMATTER (HID_FORM_DLG_START + 15)
-#define HID_SEARCH_CASE (HID_FORM_DLG_START + 16)
-#define HID_SEARCH_BACKWARD (HID_FORM_DLG_START + 17)
-#define HID_SEARCH_STARTOVER (HID_FORM_DLG_START + 18)
-#define HID_SEARCH_WILDCARD (HID_FORM_DLG_START + 19)
-#define HID_SEARCH_REGULAR (HID_FORM_DLG_START + 20)
-#define HID_SEARCH_APPROX (HID_FORM_DLG_START + 21)
-#define HID_SEARCH_APPROXSETTINGS (HID_FORM_DLG_START + 22)
-#define HID_SEARCH_BTN_SEARCH (HID_FORM_DLG_START + 23)
-#define HID_SEARCH_BTN_CLOSE (HID_FORM_DLG_START + 24)
-
-#define HID_TABORDER_CONTROLS (HID_FORM_DLG_START + 25)
-
-#define HID_CONTROLS_DATE_N_TIME (HID_FORM_DLG_START + 26)
-#define HID_FM_DLG_PARAM (HID_FORM_DLG_START + 27)
-
-#define HID_GRID_TRAVEL_FIRST (HID_FORM_DLG_START + 28)
-#define HID_GRID_TRAVEL_PREV (HID_FORM_DLG_START + 29)
-#define HID_GRID_TRAVEL_NEXT (HID_FORM_DLG_START + 30)
-#define HID_GRID_TRAVEL_LAST (HID_FORM_DLG_START + 31)
-#define HID_GRID_TRAVEL_NEW (HID_FORM_DLG_START + 32)
-#define HID_GRID_TRAVEL_ABSOLUTE (HID_FORM_DLG_START + 33)
-#define HID_GRID_NUMBEROFRECORDS (HID_FORM_DLG_START + 34)
-
-#define UID_SEARCH_RECORDSTATUS (HID_FORM_DLG_START + 35)
-
-#define UID_FORMPROPBROWSER_FRAME (HID_FORM_DLG_START + 37)
-#define UID_ABSOLUTE_RECORD_WINDOW (HID_FORM_DLG_START + 38)
-
-#define HID_DATA_NAVIGATOR_WIN (HID_FM_OTHER_START + 39)
-#define HID_XFORMS_ADDDATAITEM_DLG (HID_FM_OTHER_START + 40)
-#define HID_XFORMS_ADDCONDITION_DLG (HID_FM_OTHER_START + 41)
-#define HID_XFORMS_NAMESPACEITEM_DLG (HID_FM_OTHER_START + 42)
-#define HID_XFORMS_NAMESPACEITEM_LIST (HID_FM_OTHER_START + 43)
-#define HID_XFORMS_MANAGENAMESPACE_DLG (HID_FM_OTHER_START + 44)
-
-#define HID_TP_XFORMS_INSTANCE (HID_FM_OTHER_START + 45)
-#define HID_TP_XFORMS_SUBMISSION (HID_FM_OTHER_START + 46)
-#define HID_TP_XFORMS_BINDING (HID_FM_OTHER_START + 47)
-
-#define HID_MN_XFORMS_MODELS_ADD (HID_FM_OTHER_START + 48)
-#define HID_MN_XFORMS_MODELS_EDIT (HID_FM_OTHER_START + 49)
-#define HID_MN_XFORMS_MODELS_REMOVE (HID_FM_OTHER_START + 50)
-#define HID_MN_XFORMS_INSTANCES_ADD (HID_FM_OTHER_START + 51)
-#define HID_MN_XFORMS_INSTANCES_EDIT (HID_FM_OTHER_START + 52)
-#define HID_MN_XFORMS_INSTANCES_REMOVE (HID_FM_OTHER_START + 53)
-#define HID_MN_XFORMS_SHOW_DETAILS (HID_FM_OTHER_START + 54)
-#define HID_XFORMS_TOOLBOX (HID_FM_OTHER_START + 55)
-#define HID_XFORMS_TOOLBOX_ITEM_ADD (HID_FM_OTHER_START + 56)
-#define HID_XFORMS_TOOLBOX_ITEM_ADD_ELEMENT (HID_FM_OTHER_START + 57)
-#define HID_XFORMS_TOOLBOX_ITEM_ADD_ATTRIBUTE (HID_FM_OTHER_START + 58)
-#define HID_XFORMS_TOOLBOX_ITEM_EDIT (HID_FM_OTHER_START + 59)
-#define HID_XFORMS_TOOLBOX_ITEM_REMOVE (HID_FM_OTHER_START + 60)
-#define HID_XFORMS_ITEMS_LIST (HID_FM_OTHER_START + 61)
-#define HID_XFORMS_MODELS_LIST (HID_FM_OTHER_START + 62)
-#define HID_XFORMS_MODELS_MENUBTN (HID_FM_OTHER_START + 63)
-#define HID_XFORMS_INSTANCES_MENUBTN (HID_FM_OTHER_START + 64)
-#define HID_XFORMS_ADDSUBMISSION_DLG (HID_FM_OTHER_START + 65)
-#define HID_XFORMS_ADDMODEL_DLG (HID_FM_OTHER_START + 66)
-#define HID_XFORMS_ADDINSTANCE_DLG (HID_FM_OTHER_START + 67)
-#define HID_XFORMS_MID_INSERT_CONTROL (HID_FM_OTHER_START + 68)
-#define HID_XFORMS_TAB_CONTROL (HID_FM_OTHER_START + 69)
-
-// if you add a new define here, please adjust the overflow check
-// at the end of the file!!
+#define HID_DLG_DBMSG ( HID_FORMS_START + 1)
+#define HID_FORM_NAVIGATOR ( HID_FORMS_START + 2)
+#define HID_FORM_NAVIGATOR_WIN ( HID_FORMS_START + 3)
+#define HID_FIELD_SEL ( HID_FORMS_START + 4)
+#define HID_FIELD_SEL_WIN ( HID_FORMS_START + 5)
+#define HID_FILTER_NAVIGATOR ( HID_FORMS_START + 6)
+#define HID_FILTER_NAVIGATOR_WIN ( HID_FORMS_START + 7)
+#define HID_FM_DLG_SEARCH ( HID_FORMS_START + 8)
+#define HID_SEARCH_TEXT ( HID_FORMS_START + 9)
+#define HID_SEARCH_ALLFIELDS ( HID_FORMS_START + 10)
+#define HID_SEARCH_SINGLEFIELD ( HID_FORMS_START + 11)
+#define HID_SEARCH_FIELDSELECTION ( HID_FORMS_START + 12)
+#define HID_SEARCH_POSITION ( HID_FORMS_START + 13)
+#define HID_SEARCH_FORMATTER ( HID_FORMS_START + 14)
+#define HID_SEARCH_CASE ( HID_FORMS_START + 15)
+#define HID_SEARCH_BACKWARD ( HID_FORMS_START + 16)
+#define HID_SEARCH_STARTOVER ( HID_FORMS_START + 17)
+#define HID_SEARCH_WILDCARD ( HID_FORMS_START + 18)
+#define HID_SEARCH_REGULAR ( HID_FORMS_START + 19)
+#define HID_SEARCH_APPROX ( HID_FORMS_START + 20)
+#define HID_SEARCH_APPROXSETTINGS ( HID_FORMS_START + 21)
+#define HID_SEARCH_BTN_SEARCH ( HID_FORMS_START + 22)
+#define HID_SEARCH_BTN_CLOSE ( HID_FORMS_START + 23)
+#define HID_CONTROLS_DATE_N_TIME ( HID_FORMS_START + 24)
+#define HID_GRID_TRAVEL_FIRST ( HID_FORMS_START + 25)
+#define HID_GRID_TRAVEL_PREV ( HID_FORMS_START + 26)
+#define HID_GRID_TRAVEL_NEXT ( HID_FORMS_START + 27)
+#define HID_GRID_TRAVEL_LAST ( HID_FORMS_START + 28)
+#define HID_GRID_TRAVEL_NEW ( HID_FORMS_START + 29)
+#define HID_GRID_TRAVEL_ABSOLUTE ( HID_FORMS_START + 30)
+#define HID_GRID_NUMBEROFRECORDS ( HID_FORMS_START + 31)
+#define UID_SEARCH_RECORDSTATUS ( HID_FORMS_START + 32)
+#define UID_FORMPROPBROWSER_FRAME ( HID_FORMS_START + 33)
+#define UID_ABSOLUTE_RECORD_WINDOW ( HID_FORMS_START + 34)
+#define HID_DATA_NAVIGATOR_WIN ( HID_FORMS_START + 35)
+#define HID_XFORMS_ADDDATAITEM_DLG ( HID_FORMS_START + 36)
+#define HID_XFORMS_ADDCONDITION_DLG ( HID_FORMS_START + 37)
+#define HID_XFORMS_NAMESPACEITEM_DLG ( HID_FORMS_START + 38)
+#define HID_XFORMS_NAMESPACEITEM_LIST ( HID_FORMS_START + 39)
+#define HID_XFORMS_MANAGENAMESPACE_DLG ( HID_FORMS_START + 40)
+#define HID_TP_XFORMS_INSTANCE ( HID_FORMS_START + 41)
+#define HID_TP_XFORMS_SUBMISSION ( HID_FORMS_START + 42)
+#define HID_TP_XFORMS_BINDING ( HID_FORMS_START + 43)
+#define HID_MN_XFORMS_MODELS_ADD ( HID_FORMS_START + 44)
+#define HID_MN_XFORMS_MODELS_EDIT ( HID_FORMS_START + 45)
+#define HID_MN_XFORMS_MODELS_REMOVE ( HID_FORMS_START + 46)
+#define HID_MN_XFORMS_INSTANCES_ADD ( HID_FORMS_START + 47)
+#define HID_MN_XFORMS_INSTANCES_EDIT ( HID_FORMS_START + 48)
+#define HID_MN_XFORMS_INSTANCES_REMOVE ( HID_FORMS_START + 49)
+#define HID_MN_XFORMS_SHOW_DETAILS ( HID_FORMS_START + 50)
+#define HID_XFORMS_TOOLBOX ( HID_FORMS_START + 51)
+#define HID_XFORMS_TOOLBOX_ITEM_ADD ( HID_FORMS_START + 52)
+#define HID_XFORMS_TOOLBOX_ITEM_ADD_ELEMENT ( HID_FORMS_START + 53)
+#define HID_XFORMS_TOOLBOX_ITEM_ADD_ATTRIBUTE ( HID_FORMS_START + 54)
+#define HID_XFORMS_TOOLBOX_ITEM_EDIT ( HID_FORMS_START + 55)
+#define HID_XFORMS_TOOLBOX_ITEM_REMOVE ( HID_FORMS_START + 56)
+#define HID_XFORMS_ITEMS_LIST ( HID_FORMS_START + 57)
+#define HID_XFORMS_MODELS_LIST ( HID_FORMS_START + 58)
+#define HID_XFORMS_MODELS_MENUBTN ( HID_FORMS_START + 59)
+#define HID_XFORMS_INSTANCES_MENUBTN ( HID_FORMS_START + 60)
+#define HID_XFORMS_ADDSUBMISSION_DLG ( HID_FORMS_START + 61)
+#define HID_XFORMS_ADDMODEL_DLG ( HID_FORMS_START + 62)
+#define HID_XFORMS_ADDINSTANCE_DLG ( HID_FORMS_START + 63)
+#define HID_XFORMS_MID_INSERT_CONTROL ( HID_FORMS_START + 64)
+#define HID_XFORMS_TAB_CONTROL ( HID_FORMS_START + 65)
+ // if you add a new define here, please adjust the overflow check
+ // at the end of the file!!
// -----------------------------------------------------------------------
diff --git a/svx/inc/svx/msvbahelper.hxx b/svx/inc/svx/msvbahelper.hxx
new file mode 100644
index 0000000000..294f26e6fc
--- /dev/null
+++ b/svx/inc/svx/msvbahelper.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 _MSVBAHELPER_HXX
+#define _MSVBAHELPER_HXX
+
+#include <sfx2/objsh.hxx>
+#include "svx/svxdllapi.h"
+
+namespace ooo { namespace vba
+{
+ class SVX_DLLPUBLIC VBAMacroResolvedInfo
+ {
+ SfxObjectShell* mpDocContext;
+ bool mbFound;
+ String msResolvedMacro;
+ public:
+ VBAMacroResolvedInfo() : mpDocContext(NULL), mbFound( false ){}
+ void SetResolved( bool bRes ) { mbFound = bRes; }
+ bool IsResolved() { return mbFound; }
+ void SetMacroDocContext(SfxObjectShell* pShell ) { mpDocContext = pShell; }
+ SfxObjectShell* MacroDocContext() { return mpDocContext; }
+ String ResolvedMacro() { return msResolvedMacro; }
+ void SetResolvedMacro(const String& sMacro ) { msResolvedMacro = sMacro; }
+ };
+
+ SVX_DLLPUBLIC String makeMacroURL( const String& sMacroName );
+ SVX_DLLPUBLIC VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& sMod, bool bSearchGlobalTemplates = false );
+ SVX_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller );
+} }
+
+#endif
diff --git a/svx/inc/svx/numitem.hxx b/svx/inc/svx/numitem.hxx
index d3d8b57aa2..c7138df5f2 100644
--- a/svx/inc/svx/numitem.hxx
+++ b/svx/inc/svx/numitem.hxx
@@ -76,12 +76,6 @@ namespace com{namespace sun{ namespace star{
#define SVX_NO_NUM 200 // Markierung fuer keine Numerierung
#define SVX_NO_NUMLEVEL 0x20
-// --> OD 2008-01-10 #newlistlevelattrs# - no longer used
-//#define NUMITEM_VERSION_01 0x01
-//#define NUMITEM_VERSION_02 0x02
-//#define NUMITEM_VERSION_03 0x03
-// <--
-
#define LINK_TOKEN 0x80 //indicate linked bitmaps - for use in dialog only
class SVX_DLLPUBLIC SvxNumberType
{
@@ -191,14 +185,10 @@ public:
SvxNumPositionAndSpaceMode ePositionAndSpaceMode = LABEL_WIDTH_AND_POSITION );
// <--
SvxNumberFormat(const SvxNumberFormat& rFormat);
- // --> OD 2008-01-09 #newlistlevelattrs# - no longer used
-// SvxNumberFormat(SvStream &rStream);
- // <--
+ SvxNumberFormat(SvStream &rStream);
virtual ~SvxNumberFormat();
- // --> OD 2008-01-09 #newlistlevelattrs# - no longer used
-// SvStream& Store(SvStream &rStream, FontToSubsFontConverter pConverter);
- // <--
+ SvStream& Store(SvStream &rStream, FontToSubsFontConverter pConverter);
SvxNumberFormat& operator=( const SvxNumberFormat& );
BOOL operator==( const SvxNumberFormat& ) const;
@@ -304,9 +294,7 @@ public:
= SvxNumberFormat::LABEL_WIDTH_AND_POSITION );
// <--
SvxNumRule(const SvxNumRule& rCopy);
- // --> OD 2008-01-09 #newlistlevelattrs# - no longer used
-// SvxNumRule(SvStream &rStream);
- // <--
+ SvxNumRule(SvStream &rStream);
virtual ~SvxNumRule();
int operator==( const SvxNumRule& ) const;
@@ -314,9 +302,7 @@ public:
SvxNumRule& operator=( const SvxNumRule& );
- // --> OD 2008-01-09 #newlistlevelattrs# - no longer used
-// SvStream& Store(SvStream &rStream);
- // <--
+ SvStream& Store(SvStream &rStream);
const SvxNumberFormat* Get(USHORT nLevel)const;
const SvxNumberFormat& GetLevel(USHORT nLevel)const;
@@ -354,11 +340,9 @@ public:
virtual ~SvxNumBulletItem();
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- // --> OD 2008-01-09 #newlistlevelattrs# - no longer used
-// virtual SfxPoolItem* Create(SvStream &, USHORT) const;
-// virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const;
-// virtual USHORT GetVersion( USHORT nFileVersion ) const;
- // <--
+ virtual SfxPoolItem* Create(SvStream &, USHORT) const;
+ USHORT GetVersion( USHORT nFileVersion ) const;
+ virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const;
virtual int operator==( const SfxPoolItem& ) const;
SvxNumRule* GetNumRule() const {return pNumRule;}
diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
index 5d8c47d515..3216c857da 100644
--- a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
+++ b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
@@ -105,8 +105,11 @@ namespace sdr { namespace contact {
// support for Primitive2D
virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+ // visibility check
+ virtual bool isPrimitiveVisible( const DisplayInfo& _rDisplayInfo ) const;
+
private:
- ViewObjectContactOfUnoControl(); // never implemented
+ ViewObjectContactOfUnoControl(); // never implemented
ViewObjectContactOfUnoControl( const ViewObjectContactOfUnoControl& ); // never implemented
ViewObjectContactOfUnoControl& operator=( const ViewObjectContactOfUnoControl& ); // never implemented
};
diff --git a/svx/inc/svx/selectioncontroller.hxx b/svx/inc/svx/selectioncontroller.hxx
index 4359cc6563..2965b00304 100644
--- a/svx/inc/svx/selectioncontroller.hxx
+++ b/svx/inc/svx/selectioncontroller.hxx
@@ -33,6 +33,8 @@
#include "svx/svxdllapi.h"
+#include <boost/shared_ptr.hpp>
+
#include <cppuhelper/weak.hxx>
class KeyEvent;
@@ -70,6 +72,15 @@ public:
virtual bool GetMarkedObjModel( SdrPage* pNewPage );
virtual bool PasteObjModel( const SdrModel& rModel );
+
+ /** returns a format paint brush set from the current selection */
+ virtual bool TakeFormatPaintBrush( boost::shared_ptr< SfxItemSet >& rFormatSet );
+
+ /** applies a format paint brush set from the current selection.
+ if bNoCharacterFormats is true, no character attributes are changed.
+ if bNoParagraphFormats is true, no paragraph attributes are changed.
+ */
+ virtual bool ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats );
};
}
diff --git a/svx/inc/svx/svdedxv.hxx b/svx/inc/svx/svdedxv.hxx
index c6599092e2..35dda79124 100644
--- a/svx/inc/svx/svdedxv.hxx
+++ b/svx/inc/svx/svdedxv.hxx
@@ -41,6 +41,8 @@
// Vorausdeklarationen
//************************************************************
+#include <boost/shared_ptr.hpp>
+
class SdrOutliner;
class OutlinerView;
class EditStatus;
@@ -282,6 +284,21 @@ public:
rtl::Reference< sdr::SelectionController > getSelectionController() const { return mxSelectionController; }
+ /** returns true if the shape identified by its inventor and identifier supports format paint brush operation */
+ virtual bool SupportsFormatPaintbrush( UINT32 nObjectInventor, UINT16 nObjectIdentifier ) const;
+
+ /** returns a format paint brush set from the current selection */
+ virtual bool TakeFormatPaintBrush( boost::shared_ptr< SfxItemSet >& rFormatSet );
+
+ /** applies a format paint brush set from the current selection.
+ if bNoCharacterFormats is true, no character attributes are changed.
+ if bNoParagraphFormats is true, no paragraph attributes are changed.
+ */
+ virtual void ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats );
+
+ /** helper function for selections with multiple SdrText for one SdrTextObj (f.e. tables ) */
+ void ApplyFormatPaintBrushToText( SfxItemSet& rFormatSet, SdrTextObj& rTextObj, SdrText* pText, bool bNoCharacterFormats, bool bNoParagraphFormats );
+
protected:
virtual void OnBeginPasteOrDrop( PasteOrDropInfos* pInfos );
virtual void OnEndPasteOrDrop( PasteOrDropInfos* pInfos );
diff --git a/svx/prj/d.lst b/svx/prj/d.lst
index 7edc2fbc9c..acbb689082 100644
--- a/svx/prj/d.lst
+++ b/svx/prj/d.lst
@@ -658,5 +658,6 @@ mkdir: %_DEST%\inc%_EXT%\svx\sdr\table
..\inc\svx\selectioncontroller.hxx %_DEST%\inc%_EXT%\svx\selectioncontroller.hxx
..\inc\svx\helperhittest3d.hxx %_DEST%\inc%_EXT%\svx\helperhittest3d.hxx
..\inc\svx\optimprove.hxx %_DEST%\inc%_EXT%\svx\optimprove.hxx
+..\inc\svx\msvbahelper.hxx %_DEST%\inc%_EXT%\svx\msvbahelper.hxx
..\%__SRC%\bin\*-layout.zip %_DEST%\pck%_EXT%\*.*
diff --git a/svx/source/cui/cuicharmap.cxx b/svx/source/cui/cuicharmap.cxx
index a66c7b3c10..d06d962c86 100644
--- a/svx/source/cui/cuicharmap.cxx
+++ b/svx/source/cui/cuicharmap.cxx
@@ -71,11 +71,12 @@ SvxCharacterMap::SvxCharacterMap( Window* pParent, BOOL bOne, const SfxItemSet*
if ( pItem )
bOne = pItem->GetValue();
+ mpCharMapData = new SvxCharMapData( this, bOne, &DIALOG_MGR() );
+
SFX_ITEMSET_ARG( pSet, pCharItem, SfxInt32Item, SID_ATTR_CHAR, FALSE );
if ( pCharItem )
- SetChar( pItem->GetValue() );
+ SetChar( pCharItem->GetValue() );
- mpCharMapData = new SvxCharMapData( this, bOne, &DIALOG_MGR() );
SFX_ITEMSET_ARG( pSet, pDisableItem, SfxBoolItem, FN_PARAM_2, FALSE );
if ( pDisableItem && pDisableItem->GetValue() )
diff --git a/svx/source/cui/numpages.cxx b/svx/source/cui/numpages.cxx
index ce2ae1563f..6069efd2cb 100644
--- a/svx/source/cui/numpages.cxx
+++ b/svx/source/cui/numpages.cxx
@@ -378,12 +378,24 @@ int SvxSingleNumPickTabPage::DeactivatePage(SfxItemSet *_pSet)
void SvxSingleNumPickTabPage::Reset( const SfxItemSet& rSet )
{
- nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
-
- const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
-
+ const SfxPoolItem* pItem;
+// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
+ //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
+ SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
+ if(eState != SFX_ITEM_SET)
+ {
+ nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+ eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
+
+ if( eState != SFX_ITEM_SET )
+ {
+ pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+ eState = SFX_ITEM_SET;
+ }
+ }
+ DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*rItem.GetNumRule());
+ pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
if(!pActNum)
pActNum = new SvxNumRule(*pSaveNum);
@@ -564,12 +576,24 @@ int SvxBulletPickTabPage::DeactivatePage(SfxItemSet *_pSet)
void SvxBulletPickTabPage::Reset( const SfxItemSet& rSet )
{
- nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
-
- const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
-
+ const SfxPoolItem* pItem;
+ //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
+ SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
+ if(eState != SFX_ITEM_SET)
+ {
+ nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+ eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
+
+ if( eState != SFX_ITEM_SET )
+ {
+ pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+ eState = SFX_ITEM_SET;
+ }
+
+ }
+ DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*rItem.GetNumRule());
+ pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
@@ -789,12 +813,24 @@ int SvxNumPickTabPage::DeactivatePage(SfxItemSet *_pSet)
void SvxNumPickTabPage::Reset( const SfxItemSet& rSet )
{
- nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
-
- const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
-
+ const SfxPoolItem* pItem;
+ //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
+ SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
+ if(eState != SFX_ITEM_SET)
+ {
+ nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+ eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
+
+ if( eState != SFX_ITEM_SET )
+ {
+ pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+ eState = SFX_ITEM_SET;
+ }
+
+ }
+ DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*rItem.GetNumRule());
+ pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
if(!pActNum)
@@ -1089,12 +1125,24 @@ BOOL SvxBitmapPickTabPage::FillItemSet( SfxItemSet& rSet )
void SvxBitmapPickTabPage::Reset( const SfxItemSet& rSet )
{
- nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
-
- const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
-
+ const SfxPoolItem* pItem;
+ //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
+ SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
+ if(eState != SFX_ITEM_SET)
+ {
+ nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+ eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
+
+ if( eState != SFX_ITEM_SET )
+ {
+ pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+ eState = SFX_ITEM_SET;
+ }
+
+ }
+ DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*rItem.GetNumRule());
+ pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
if(!pActNum)
pActNum = new SvxNumRule(*pSaveNum);
@@ -1516,12 +1564,24 @@ BOOL SvxNumOptionsTabPage::FillItemSet( SfxItemSet& rSet )
--------------------------------------------------*/
void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet )
{
- nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
-
- const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
-
+ const SfxPoolItem* pItem;
+ //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
+ SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
+ if(eState != SFX_ITEM_SET)
+ {
+ nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+ eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
+
+ if( eState != SFX_ITEM_SET )
+ {
+ pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+ eState = SFX_ITEM_SET;
+ }
+
+ }
+ DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*rItem.GetNumRule());
+ pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
// Ebenen einfuegen
if(!aLevelLB.GetEntryCount())
@@ -1565,7 +1625,6 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet )
pPreviewWIN->SetNumRule(pActNum);
aSameLevelCB.Check(pActNum->IsContinuousNumbering());
- const SfxPoolItem* pItem = 0;
//ColorListBox bei Bedarf fuellen
if ( pActNum->IsFeatureSupported( NUM_BULLET_COLOR ) )
{
@@ -3409,12 +3468,24 @@ BOOL SvxNumPositionTabPage::FillItemSet( SfxItemSet& rSet )
--------------------------------------------------*/
void SvxNumPositionTabPage::Reset( const SfxItemSet& rSet )
{
- nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
-
- const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
-
+ const SfxPoolItem* pItem;
+ //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
+ SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
+ if(eState != SFX_ITEM_SET)
+ {
+ nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+ eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
+
+ if( eState != SFX_ITEM_SET )
+ {
+ pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+ eState = SFX_ITEM_SET;
+ }
+
+ }
+ DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*rItem.GetNumRule());
+ pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
// Ebenen einfuegen
if(!aLevelLB.GetEntryCount())
diff --git a/svx/source/dialog/hyperdlg.cxx b/svx/source/dialog/hyperdlg.cxx
index 3bb5f0b6b1..efbe2e850b 100644
--- a/svx/source/dialog/hyperdlg.cxx
+++ b/svx/source/dialog/hyperdlg.cxx
@@ -78,9 +78,11 @@ SvxHlinkDlgWrapper::SvxHlinkDlgWrapper( Window* _pParent, USHORT nId,
pWindow = mpDlg->GetWindow();
((MyStruct*)pImp)->bVisible = FALSE;
- if ( pInfo->aSize.Width() != 0 && pInfo->aSize.Height() != 0 )
+ Window* pTopWindow = 0;
+ if ( pInfo->aSize.Width() != 0 && pInfo->aSize.Height() != 0 &&
+ (0 != (pTopWindow = SFX_APP()->GetTopWindow())))
{
- Size aParentSize( SFX_APP()->GetTopWindow()->GetSizePixel() );
+ Size aParentSize( pTopWindow->GetSizePixel() );
Size aDlgSize ( GetSizePixel () );
if( aParentSize.Width() < pInfo->aPos.X() )
diff --git a/svx/source/editeng/editdoc.cxx b/svx/source/editeng/editdoc.cxx
index 7160a4197a..d5f9ee16ee 100644
--- a/svx/source/editeng/editdoc.cxx
+++ b/svx/source/editeng/editdoc.cxx
@@ -1427,9 +1427,11 @@ XubString EditDoc::GetParaAsString( ContentNode* pNode, USHORT nStartPos, USHORT
else
pNextFeature = 0; // Feature interessiert unten nicht
-
DBG_ASSERT( nEnd >= nIndex, "Ende vorm Index?" );
- aStr += XubString( *pNode, nIndex, nEnd-nIndex );
+ //!! beware of sub string length of -1 which is also defined as STRING_LEN and
+ //!! thus would result in adding the whole sub string up to the end of the node !!
+ if (nEnd > nIndex)
+ aStr += XubString( *pNode, nIndex, nEnd - nIndex );
if ( pNextFeature )
{
@@ -1790,7 +1792,12 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi
}
if ( bChanged )
+ {
+ // char attributes need to be sorted by start again
+ pNode->GetCharAttribs().ResortAttribs();
+
SetModified( TRUE );
+ }
return bChanged;
}
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index f79731a982..9d8bbdd0fc 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -2080,7 +2080,7 @@ SpinField* DbCurrencyField::createField( Window* _pParent, WinBits _nFieldStyle,
//------------------------------------------------------------------------------
double DbCurrencyField::GetCurrency(const Reference< ::com::sun::star::sdb::XColumn >& _rxField, const Reference< XNumberFormatter >& xFormatter) const
{
- volatile double fValue = GetValue(_rxField, xFormatter);
+ double fValue = GetValue(_rxField, xFormatter);
if (m_nScale)
{
// OSL_TRACE("double = %.64f ",fValue);
@@ -2158,7 +2158,7 @@ sal_Bool DbCurrencyField::commitControl()
Any aVal;
if (aText.Len() != 0) // nicht null
{
- volatile double fValue = ((LongCurrencyField*)m_pWindow)->GetValue();
+ double fValue = ((LongCurrencyField*)m_pWindow)->GetValue();
if (m_nScale)
{
fValue /= ::rtl::math::pow10Exp(1.0, m_nScale);
diff --git a/svx/source/intro/intro_tmpl.hrc b/svx/source/intro/intro_tmpl.hrc
index ad3a628213..f724cd476e 100644
--- a/svx/source/intro/intro_tmpl.hrc
+++ b/svx/source/intro/intro_tmpl.hrc
@@ -59,6 +59,7 @@ ItemList = \
< "Jost Ammon" ; > ; \
< "Paolo Amodio" ; > ; \
< "Abdullah Anar" ; > ; \
+ < "Gene Anaya" ; > ; \
< "Christian Andersen" ; > ; \
< "Frank J. Andersen" ; > ; \
< "Jan Moller Andersen" ; > ; \
@@ -94,7 +95,9 @@ ItemList = \
< "David Bartlett" ; > ; \
< "Sascha Ballach" ; > ; \
< "Stefan Baltzer" ; > ; \
+ < "Jayant Balraj Madavi" ; > ; \
< "Claudio Bandaloukas" ; > ; \
+ < "Omar Bar-or" ; > ; \
< "Hrega Basu" ; > ; \
< "Mathias Bauer" ; > ; \
< "Martin Baulig" ; > ; \
@@ -119,6 +122,7 @@ ItemList = \
< "Zaheda Bhorat" ; > ; \
< "Andreas Bille" ; > ; \
< "Oliver Bietzer" ; > ; \
+ < "Eric Bischoff" ; > ; \
< "Marissa Bishop" ; > ; \
< "Torkil Bladt" ; > ; \
< "Martin Blapp" ; > ; \
@@ -134,6 +138,7 @@ ItemList = \
< "Csaba Borbola" ; > ; \
< "Gregor Bornemann" ; > ; \
< "Thorsten Bosbach" ; > ; \
+ < "Eric Bosdonnat" ; > ; \
< "Daniel Boss" ; > ; \
< "David Boswell" ; > ; \
< "Freddy Boswell" ; > ; \
@@ -179,6 +184,8 @@ ItemList = \
< "Kimmy Chen" ; > ; \
< "Robert Chen" ; > ; \
< "Yu Aaron Cheng" ; > ; \
+ < "Jian Hong Cheng" ; > ; \
+ < "Xiuzhi Cheng" ; > ; \
< "Allan B. Christensen" ; > ; \
< "Steen Christensen" ; > ; \
< "Marco Ciampa" ; > ; \
@@ -190,6 +197,7 @@ ItemList = \
< "Vicky Chan" ; > ; \
< "Michael J. Cole" ; > ; \
< "Urska Colner" ; > ; \
+ < "Alexandro Colorado" ; > ; \
< "Compaq Computer Corperation" ; > ; \
< "Karen Conatser" ; > ; \
< "Confucian Pro. Technology" ; > ; \
@@ -197,11 +205,13 @@ ItemList = \
< "Lee Corbin" ; > ; \
< "Dietmar Cordes" ; > ; \
< "Berend Cornelius" ; > ; \
+ < "Clayton Cornell" ; > ; \
< "Jesus Corrius" ; > ; \
< "Martin Coxall" ; > ; \
< "Joszef Csongradi" ; > ; \
< "Alessandro Cumin" ; > ; \
< "Johannes Czerwinski" ; > ; \
+ < "Michael Cziebalski" ; > ; \
< "Valentina Dagiene" ; > ; \
< "Richard Daley" ; > ; \
< "Viktoras Dagys" ; > ; \
@@ -218,9 +228,11 @@ ItemList = \
< "Francois Dechelle" ; > ; \
< "Andrea Decorte" ; > ; \
< "Martijn Dekkers" ; > ; \
+ < "Andrew Dent" ; > ; \
< "Westley Alan Dent" ; > ; \
< "Luiz Augusto Von Dentz" ; > ; \
< "Helge Delfs" ; > ; \
+ < "Naren Devaiah" ; > ; \
< "Frederic Juan Diaz" ; > ; \
< "Scott Dietrich" ; > ; \
< "Frederik Dietz" ; > ; \
@@ -230,8 +242,10 @@ ItemList = \
< "Vitor Domingos" ; > ; \
< "Jean-Francois Donikian" ; > ; \
< "Simford Dong" ; > ; \
+ < "Nitri Dongre" ; > ; \
< "Thomas Doru" ; > ; \
< "Willem van Dorp" ; > ; \
+ < "Radek Doulik" ; > ; \
< "Davide Dozza" ; > ; \
< "Derek Dreger" ; > ; \
< "Carsten Driesner" ; > ; \
@@ -249,9 +263,11 @@ ItemList = \
< "Rene Engelhard" ; > ; \
< "Mina Erickson" ; > ; \
< "Peter Eriksen" ; > ; \
+ < "Per Eriksson" ; > ; \
< "Alberto Escudero-Pascual" ; > ; \
< "Fabalabs Software GmbH" ; > ; \
< "Charles Anthony Fannan" ; > ; \
+ < "Jean-Baptiste Faure" ; > ; \
< "Ralf-Michael Fehr" ; > ; \
< "Vladimir Fedak" ; > ; \
< "Zoltan Fekete" ; > ; \
@@ -261,6 +277,7 @@ ItemList = \
< "Claudio Ferreira" ; > ; \
< "Raquel Fares Ferreira" ; > ; \
< "Marco Fiemozzi" ; > ; \
+ < "Claudio F Filho" ; > ; \
< "Pierre de Filippis" ; > ; \
< "Jan Firich" ; > ; \
< "Andre Fischer" ; > ; \
@@ -271,6 +288,7 @@ ItemList = \
< "Kenneth Foskey" ; > ; \
< "Duncan Foster" ; > ; \
< "Tim Foster" ; > ; \
+ < "David Franser" ; > ; \
< "Peter Frandsen" ; > ; \
< "Gary Frederick" ; > ; \
< "Nils Fuhrmann" ; > ; \
@@ -280,8 +298,11 @@ ItemList = \
< "Tom Garland" ; > ; \
< "Wolfram Garten" ; > ; \
< "Martin Gallwey" ; > ; \
+ < "Pierre-Andre Galmes" ; > ; \
< "Roberto Galoppini" ; > ; \
< "Tony Galmiche" ; > ; \
+ < "Sunil Gandhi" ; > ; \
+ < "Zemin Gao" ; > ; \
< "Sophie Gautier" ; > ; \
< "Kathy Gavin" ; > ; \
< "Alexander Gelfenbain" ; > ; \
@@ -327,6 +348,7 @@ ItemList = \
< "Chris Halls" ; > ; \
< "Arne Christian Harseth" ; > ; \
< "Syamsul Anuar Abdul Hamid" ; > ; \
+ < "Bo Han" ; > ; \
< "Ove Hanebring" ; > ; \
< "Jens K. Hansen" ; > ; \
< "Martin Willemoes Hansen" ; > ; \
@@ -423,6 +445,9 @@ ItemList = \
< "Byrial Ole Jensen" ; > ; \
< "Ricky Hugh Jensen" ; > ; \
< "Tatjiana Jevsikova" ; > ; \
+ < "Berry Jia" ; > ; \
+ < "Mingfei Jia" ; > ; \
+ < "Chuang Jiang" ; > ; \
< "Jiao Jianhua" ; > ; \
< "Gary Johnston" ; > ; \
< "Dewi Jones" ; > ; \
@@ -430,6 +455,7 @@ ItemList = \
< "Anders Colding Jorgesen" ; > ; \
< "Peter Junge" ; > ; \
< "Christian Junker" ; > ; \
+ < "Pascal Junck" ; > ; \
< "Henrik Just" ; > ; \
< "Christian Kaas" ; > ; \
< "Yukata Kachi" ; > ; \
@@ -438,16 +464,19 @@ ItemList = \
< "masahisa kamataki" ; > ; \
< "Tim Kampa" ; > ; \
< "Petr Kania" ; > ; \
- < "Tim Kampa" ; > ; \
< "Mick Kappenburg" ; > ; \
< "Etsushi Kato" ; > ; \
< "Yosuke Kato" ; > ; \
+ < "Hirano Kazunari" ; > ; \
+ < "Mihaela Kedikova" ; > ; \
< "Juergen Keil" ; > ; \
< "Lina Kemmel" ; > ; \
< "Darren Kenny" ; > ; \
+ < "Dhanajay Keskar" ; > ; \
< "Ilja Ketris" ; > ; \
< "Philipp Kewisch Ketris" ; > ; \
< "Ossama Khayat" ; > ; \
+ < "Volodymyr Khrystynych" ; > ; \
< "Ilja Ketris" ; > ; \
< "Hermann Kienlein" ; > ; \
< "Artem Khvat" ; > ; \
@@ -462,6 +491,7 @@ ItemList = \
< "Thomas Klarhoefer" ; > ; \
< "Sven Klawitter" ; > ; \
< "Branislav Klocok" ; > ; \
+ < "Matthias Klose" ; > ; \
< "Halfdan Holger Knudsen" ; > ; \
< "Rune Tendal Kock" ; > ; \
< "Magdy Samuel Abdel Koddous" ; > ; \
@@ -473,6 +503,7 @@ ItemList = \
< "Uros Kositer" ; > ; \
< "Peter Kosmalla" ; > ; \
< "Nobuhiro Koura" ; > ; \
+ < "Lazlo Kovacs" ; > ; \
< "Martin Kretzchmar" ; > ; \
< "Ramesh Krishnamagaru" ; > ; \
< "Jayamohan Krishnasamy" ; > ; \
@@ -498,6 +529,7 @@ ItemList = \
< "Dr. Swapnil Vishnu Lale" ; > ; \
< "Antti Lampinen/Kongo Group" ; > ; \
< "Massimo Lanfranconi" ; > ; \
+ < "Marcus Lange" ; > ; \
< "Peter Lange" ; > ; \
< "Thomas Lange" ; > ; \
< "Lars Langhans" ; > ; \
@@ -518,21 +550,36 @@ ItemList = \
< "Yoann Le Bars" ; > ; \
< "Armin Le Grand" ; > ; \
< "Brigitte Le Grand" ; > ; \
+ < "Jakob Lechner" ; > ; \
+ < "Michael Leibowitz" ; > ; \
< "Serge Le Louarne" ; > ; \
< "Dong Lee" ; > ; \
< "Kenneth Lee" ; > ; \
< "Gregory Leffler" ; > ; \
< "Hercule Li" ; > ; \
+ < "Hui Li" ; > ; \
+ < "Jian Li" ; > ; \
< "Tommy C. Li" ; > ; \
< "Wind Li" ; > ; \
+ < "Xing Li" ; > ; \
+ < "Ping Liao" ; > ; \
< "Xin Liao" ; > ; \
+ < "Weike Liang" ; > ; \
< "Rony Liemmukda" ; > ; \
+ < "Tor Lillqvist" ; > ; \
< "Patranun Limudomporn" ; > ; \
< "Archie Lin" ; > ; \
< "Fong Lin" ; > ; \
< "Martha J. Lindeman" ; > ; \
< "Joachim Lingner" ; > ; \
< "Christian Lippka" ; > ; \
+ < "Chen Liu" ; > ; \
+ < "Jianli Liu" ; > ; \
+ < "Mindy Liu" ; > ; \
+ < "Tao Liu" ; > ; \
+ < "YiSong Liu" ; > ; \
+ < "Yu Liu" ; > ; \
+ < "Yuhua Liu" ; > ; \
< "ALT Linux Russia" ; > ; \
< "Jonathan S. Lister" ; > ; \
< "Vedran Ljubovic" ; > ; \
@@ -544,6 +591,7 @@ ItemList = \
< "Anthony Long" ; > ; \
< "Roberto Loprieno" ; > ; \
< "Riccardo Losselli" ; > ; \
+ < "Jackson Low" ; > ; \
< "Patrick Luby" ; > ; \
< "Christoph Lukasiak" ; > ; \
< "Robert Ludvik" ; > ; \
@@ -551,17 +599,23 @@ ItemList = \
< "Edgardo Lugaresi" ; > ; \
< "Gavin Lu" ; > ; \
< "Morton Lund" ; > ; \
+ < "Jingrong Luo" ; > ; \
< "Zaoliang Luo" ; > ; \
< "Ian Lynch" ; > ; \
+ < "Jun Ma" ; > ; \
< "Thomas J.L. MacDermott" ; > ; \
< "Marcio A. Macendo" ; > ; \
< "George Machitidze" ; > ; \
< "Diane Mackay" ; > ; \
+ < "Prasad Madhav" ; > ; \
< "Jorgen Madsen" ; > ; \
< "Ove Madsen" ; > ; \
< "Martin Maher" ; > ; \
+ < "Babak Mahbod" ; > ; \
+ < "Nakata Maho " ; > ; \
< "Wad Mahsckoff" ; > ; \
< "Milena Majorosova" ; > ; \
+ < "Yonggang Mao" ; > ; \
< "Libor Maly" ; > ; \
< "Mandrake Soft S.A." ; > ; \
< "Libor Maly" ; > ; \
@@ -600,15 +654,18 @@ ItemList = \
< "Aaron R. Meck" ; > ; \
< "Nirav Mehta" ; > ; \
< "Michael Meeks" ; > ; \
+ < "Frederico Mena-Quintero" ; > ; \
< "James Meng" ; > ; \
< "Frank Meies" ; > ; \
< "Antonius Tjipke Meinen" ; > ; \
+ < "Ismael Merzaq" ; > ; \
< "Andreas Meyer" ; > ; \
< "Markus Meyer" ; > ; \
< "Rolf Meyer" ; > ; \
< "Djapparova Meruert" ; > ; \
< "Ismael Merzaq" ; > ; \
< "Michael Mi" ; > ; \
+ < "Bjoern Michaelsen" ; > ; \
< "Boris Michelsz" ; > ; \
< "Bjoern Milcke" ; > ; \
< "Marcin Milkowski" ; > ; \
@@ -616,6 +673,7 @@ ItemList = \
< "Aleksander Mikhailov-Erlich" ; > ; \
< "Paul A. Miller" ; > ; \
< "Arkadiusz Miskiewicz" ; > ; \
+ < "Petr Mladek" ; > ; \
< "Erica Modena" ; > ; \
< "Filip Molcan" ; > ; \
< "Tadeusz Mollun" ; > ; \
@@ -639,6 +697,7 @@ ItemList = \
< "National Centre for Software Technology, India" ; > ; \
< "Takamichi Nara" ; > ; \
< "Peter Naulls" ; > ; \
+ < "Jan Navratil" ; > ; \
< "Niklas Nebel" ; > ; \
< "Ales Nehyba" ; > ; \
< "Christoph Neumann" ; > ; \
@@ -650,11 +709,13 @@ ItemList = \
< "Jan Normann Nielsen" ; > ; \
< "Ko-haw Nieh" ; > ; \
< "Peter Van Nieuwenhoven" ; > ; \
+ < "Jan Nieuwenhuizen" ; > ; \
< "Dhiraj Nilange" ; > ; \
< "Sofia Nilsson" ; > ; \
< "Kazutoshi Nimura" ; > ; \
< "Jes Drost Nissen" ; > ; \
< "Sofia Nilsson" ; > ; \
+ < "Christoph Noack" ; > ; \
< "Bertram Nolte" ; > ; \
< "Niels Nordmann" ; > ; \
< "Michael Novati" ; > ; \
@@ -683,6 +744,7 @@ ItemList = \
< "Subiaco Paola" ; > ; \
< "Kannada Ganaka Parishat" ; > ; \
< "Anna Parovel" ; > ; \
+ < "Pierre Pasteau" ; > ; \
< "Shripad Patki" ; > ; \
< "Andreas Pauley" ; > ; \
< "Viktorija Paulikaite" ; > ; \
@@ -719,13 +781,16 @@ ItemList = \
< "Nicola Previati" ; > ; \
< "Rhoslyn Prys" ; > ; \
< "Jaroslaw Jan Pyszny" ; > ; \
+ < "Jonathan Pryor" ; > ; \
< "Zhang Qingbin" ; > ; \
+ < "Canghua Qu" ; > ; \
< "Volker Quetschke" ; > ; \
< "Tino Rachui" ; > ; \
< "Radostin Radnev" ; > ; \
< "Pramod Raghavendra" ; > ; \
< "Adam Rambousek" ; > ; \
< "Jacqueline Rahemipour" ; > ; \
+ < "Goran Rakic" ; > ; \
< "Adam Rambousek" ; > ; \
< "Kay Ramme" ; > ; \
< "Klaus Ramstock" ; > ; \
@@ -748,6 +813,7 @@ ItemList = \
< "Kjell Arne Rekaa" ; > ; \
< "Frco. Javier Rial" ; > ; \
< "Nicholas Richards" ; > ; \
+ < "Georg Richter" ; > ; \
< "Jozef Riha" ; > ; \
< "Michael Lee Rilee" ; > ; \
< "Modestas Rimkus" ; > ; \
@@ -822,6 +888,7 @@ ItemList = \
< "Syed Ahmad Shazali" ; > ; \
< "Darragh Sherwin" ; > ; \
< "Gia Shervashidze" ; > ; \
+ < "Wei Guo Shi" ; > ; \
< "Norikatsu Shigemura" ; > ; \
< "Bernhard Siaud" ; > ; \
< "Joerg Sievers" ; > ; \
@@ -830,11 +897,13 @@ ItemList = \
< "Keld Jorn Simonsen" ; > ; \
< "Michael Sicotte" ; > ; \
< "Clytie Ann Siddall" ; > ; \
+ < "Raul Siddahartha" ; > ; \
< "SIL International (Freddy Boswell)" ; > ; \
< "Mukund Sivaraman" ; > ; \
< "Manoranjan Kr. Singh" ; > ; \
< "G. Roderick Singleton" ; > ; \
< "Joerg Skottke" ; > ; \
+ < "Sarah Smith" ; > ; \
< "Timothy P. Smith" ; > ; \
< "Colm Smyth" ; > ; \
< "Javier Sola" ; > ; \
@@ -860,9 +929,11 @@ ItemList = \
< "Erik William Strack" ; > ; \
< "Daniel Strome" ; > ; \
< "Fridrich Strba" ; > ; \
+ < "Keith Stribley" ; > ; \
< "Ulf Stroehler" ; > ; \
< "Daniel Strome" ; > ; \
< "Louis Suarez-Potts" ; > ; \
+ < "Muthu Subramanian" ; > ; \
< "Matthias Suess" ; > ; \
< "Tae Hoon Suk of Intellikorea Ca., Ltd." ; > ; \
< "Arthit Suriyawongkul" ; > ; \
@@ -880,7 +951,9 @@ ItemList = \
< "Christina Taliaferro" ; > ; \
< "Makoto Takizawa" ; > ; \
< "Masaki Tamakoshi" ; > ; \
+ < "Quanfa Tang" ; > ; \
< "Alberto Di Taranto" ; > ; \
+ < "David Tardon" ; > ; \
< "Uday K. Tashildar" ; > ; \
< "Stefan Taxhet" ; > ; \
< "William Terry" ; > ; \
@@ -896,6 +969,7 @@ ItemList = \
< "James M. Thompson" ; > ; \
< "Holger Thon" ; > ; \
< "Alexander Thurgood" ; > ; \
+ < "Caio Tiago Oliveira" ; > ; \
< "Lukas Tinkl" ; > ; \
< "Gerhard Tonn" ; > ; \
< "Istvan Torda" ; > ; \
@@ -944,6 +1018,7 @@ ItemList = \
< "William Wan" ; > ; \
< "Funda Wang" ; > ; \
< "Polly Wang" ; > ; \
+ < "Xu Ming Wang" ; > ; \
< "Yi Wang" ; > ; \
< "Sangay Wangchuk" ; > ; \
< "Matthew Wardrop" ; > ; \
@@ -954,6 +1029,7 @@ ItemList = \
< "Martin Webermann" ; > ; \
< "Donata Wegener" ; > ; \
< "Law Yee Wei" ; > ; \
+ < "Zhao Wei" ; > ; \
< "Michel Weimerskirch" ; > ; \
< "Prof. Dr. Eduard Werner" ; > ; \
< "Michael Wever" ; > ; \
@@ -974,19 +1050,25 @@ ItemList = \
< "Eugene T.S. Wong" ; > ; \
< "Pui Lam Wong" ; > ; \
< "Minna Wu" ; > ; \
+ < "Yan Wu" ; > ; \
< "Stephan Wunderlich" ; > ; \
< "Simos Xenitellis" ; > ; \
< "Shun Min Serena Xiao" ; > ; \
< "Nat Friedman for Ximian" ; > ; \
+ < "Antonio Xu" ; > ; \
+ < "Dehua Xu" ; > ; \
< "Gary Yang" ; > ; \
< "Yukiharu Yabuki" ; > ; \
< "Kliment Pavlov Yanev" ; > ; \
< "Taniguchi Yasuaki" ; > ; \
< "Oleg Yegorov" ; > ; \
+ < "Steve Yin" ; > ; \
< "Kunihiko Yokota" ; > ; \
< "Kim Il Yong" ; > ; \
< "Kohei Yoshida" ; > ; \
< "Deltasoft Yu" ; > ; \
+ < "Guoqiang Yu" ; > ; \
+ < "Xiaoyang Yu" ; > ; \
< "Gary Yuen" ; > ; \
< "Christian Zagrodnick" ; > ; \
< "George Zahopulos" ; > ; \
@@ -996,7 +1078,10 @@ ItemList = \
< "Fuxin Zhang" ; > ; \
< "Joy Zhang" ; > ; \
< "Lei Phill Zhang" ; > ; \
+ < "Xiaofei Zhang" ; > ; \
+ < "Jianwei Zhao" ; > ; \
< "May Zhang" ; > ; \
+ < "Jeremy Zheng" ; > ; \
< "Thorsten Ziehm" ; > ; \
< "Stefan Ziel" ; > ; \
< "Jan Zitniak" ; > ; \
@@ -1015,7 +1100,7 @@ ItemList = \
< "" ; > ; \
< "FUNCTIONAL STAFF" ; 8 ; > ; \
< "" ; > ; \
- < "Sabine Schroeder" ; > ; \
+ < "Sabine Huetsch" ; > ; \
< "" ; > ; \
< "OpenOffice.org COORDINATION" ; 8 ; > ; \
< "" ; > ; \
@@ -1026,13 +1111,14 @@ ItemList = \
< "Matthias Huetsch" ; > ; \
< "Kay Ramme" ; > ; \
< "" ; > ; \
- < "SUN SIGMA BLACK BELT" ; 8 ; > ; \
- < "" ; > ; \
- < "Stefan Zimmermann" ; > ; \
- < "" ; > ; \
< "PROGRAM MANAGEMENT" ; 8 ; > ; \
< "" ; > ; \
+ < "Joost Andrae" ; > ; \
+ < "Martin Damboldt" ; > ; \
+ < "Martin Hollmichel" ; > ; \
< "Andre Kuemmel" ; > ; \
+ < "Marcus Lange" ; > ; \
+ < "Uwe Luebbers" ; > ; \
< "" ; > ; \
< "" ; > ; \
< "%PRODUCTNAME DEVELOPMENT" ; 8 ; > ; \
@@ -1047,7 +1133,6 @@ ItemList = \
< "ODF" ; 8 ; > ; \
< "" ; > ; \
< "Svante Schubert" ; > ; \
- < "Lars Behrmann" ; > ; \
< "" ; > ; \
< "DESIGN" ; 8 ; > ; \
< "" ; > ; \
@@ -1068,10 +1153,9 @@ ItemList = \
< "Thomas Lange" ; > ; \
< "Andreas Martens" ; > ; \
< "Frank Meies" ; > ; \
+ < "Bjoern Michaelsen" ; > ; \
< "Andreas Schluens" ; > ; \
< "Oliver Specht" ; > ; \
- < "Gunnar Timm" ; > ; \
- < "Daniel Vogelheim" ; > ; \
< "Oliver-Rainer Wittmann" ; > ; \
< "Michael Stahl" ; > ; \
< "Mikhail Voitenko" ; > ; \
@@ -1081,8 +1165,6 @@ ItemList = \
< "Kai Ahrens" ; > ; \
< "" ; > ; \
< "Volker Ahrendt" ; > ; \
- < "Thorsten Behrens" ; > ; \
- < "Michael Buettner" ; > ; \
< "Herbert Duerr" ; > ; \
< "Andre Fischer" ; > ; \
< "Ilko Hoepping" ; > ; \
@@ -1100,9 +1182,9 @@ ItemList = \
< "Kai Sommerfeld" ; > ; \
< "" ; > ; \
< "Stephan Bergmann" ; > ; \
- < "Oliver Braun" ; > ; \
< "Andreas Bregas" ; > ; \
< "Steffen Grund" ; > ; \
+ < "Mihaela Kedikova" ; > ; \
< "Tobias Krause" ; > ; \
< "Joachim Lingner" ; > ; \
< "Christoph Neumann" ; > ; \
@@ -1112,7 +1194,7 @@ ItemList = \
< "Dirk Voelzke" ; > ; \
< "" ; > ; \
< "" ; > ; \
- < "%PRODUCTNAME PIM & CALC" ; 8 ; > ; \
+ < "%PRODUCTNAME CALC" ; 8 ; > ; \
< "" ; > ; \
< "Stephan Schaefer" ; > ; \
< "" ; > ; \
@@ -1120,32 +1202,15 @@ ItemList = \
< "Daniel Boelzle" ; > ; \
< "Berend Cornelius" ; > ; \
< "Ingrid Halama" ; > ; \
- < "Philipp Kewisch" ; > ; \
< "Bjoern Milcke" ; > ; \
< "Niklas Nebel" ; > ; \
- < "Frank Neumann" ; > ; \
< "Eike Rathke" ; > ; \
< "Daniel Rentz" ; > ; \
< "" ; > ; \
< "" ; > ; \
- < "%PRODUCTNAME CONFIGURATION MANAGER" ; 8 ; > ; \
- < "" ; > ; \
- < "Dirk Grobler" ; > ; \
- < "" ; > ; \
- < "Joerg Barfurth" ; > ; \
- < "Rodrigo Fernandez-Vizarra Bonet" ; > ; \
- < "Katell Galard" ; > ; \
- < "Geoff Higgins" ; > ; \
- < "Stephen Lewis" ; > ; \
- < "Cyrille Moureaux" ; > ; \
- < "Thomas Pfohe" ; > ; \
- < "Klaus Ruehl" ; > ; \
- < "" ; > ; \
- < "" ; > ; \
< "USER EXPERIENCE" ; 8 ; > ; \
< "" ; > ; \
- < "Lutz Hoeger" ; > ; \
- < "" ; > ; \
+ < "Andreas Bartel" ; > ; \
< "Bettina Haberer" ; > ; \
< "Christian Jansen" ; > ; \
< "Frank Loehmann" ; > ; \
@@ -1156,28 +1221,22 @@ ItemList = \
< "" ; > ; \
< "Nils Fuhrmann" ; > ; \
< "" ; > ; \
- < "PROGRAM MANAGEMENT" ; 8 ; > ; \
< "" ; > ; \
- < "Joost Andrae" ; > ; \
- < "Martin Damboldt" ; > ; \
- < "Martin Hollmichel" ; > ; \
- < "" ; > ; \
- < "RELEASE ENGINEERING & DEVELOPMENT TOOLS" ; 8 ; > ; \
- < "" ; > ; \
- < "Joerg Jahnke" ; > ; \
+ < "RELEASE ENGINEERING " ; 8 ; > ; \
< "" ; > ; \
- < "RELEASE ENGINEERING" ; 8 ; > ; \
+ < "Ruediger Timm" ; > ; \
< "" ; > ; \
< "Oliver Bolte" ; > ; \
< "Vladimir Glazounov" ; > ; \
< "Ivo Hinkelmann" ; > ; \
< "Hans-Joachim Lankenau" ; > ; \
< "Jens-Heiner Rechtien" ; > ; \
- < "Ruediger Timm" ; > ; \
< "Kurt Zenker" ; > ; \
< "" ; > ; \
< "DEVELOPMENT TOOLS" ; 8 ; > ; \
< "" ; > ; \
+ < "Joerg Jahnke" ; > ; \
+ < "" ; > ; \
< "Bernd Eilers" ; > ; \
< "Gregor Hartmann" ; > ; \
< "Frank Mau" ; > ; \
@@ -1213,12 +1272,10 @@ ItemList = \
< "Marc Neumann" ; > ; \
< "Wolfram Garten" ; > ; \
< "Christian Guenther" ; > ; \
- < "Fredrik Haegg" ; > ; \
< "" ; > ; \
< "QA %PRODUCTNAME INFRASTRUCTURE" ; 8 ; > ; \
< "" ; > ; \
< "Olaf Felka" ; > ; \
- < "Uwe Luebbers" ; > ; \
< "Thorsten Martens" ; > ; \
< "Joerg W. Skottke" ; > ; \
< "Andreas Treumann" ; > ; \
@@ -1238,83 +1295,30 @@ ItemList = \
< "Martina Waller" ; > ; \
< "" ; > ; \
< "" ; > ; \
- < "GLOBALIZATION" ; 8 ; > ; \
- < "" ; > ; \
- < "Management" ; 8 ; > ; \
- < "" ; > ; \
- < "Tom Garland" ; > ; \
- < "Michelle Hills" ; > ; \
- < "Shinobu Matsuzuka" ; > ; \
- < "" ; > ; \
- < "PROGRAM MANAGEMENT" ; 8 ; > ; \
+ < "GLOBALIZATION PROGRAM MANAGEMENT" ; 8 ; > ; \
< "" ; > ; \
< "Rafaella Braconi" ; > ; \
< "" ; > ; \
- < "Engineering and Testing" ; 8 ; > ; \
- < "" ; > ; \
- < "Ales Cernosek" ; > ; \
- < "Petr Dudacek" ; > ; \
- < "Karl Hong" ; > ; \
- < "Naoyuki Ishimura" ; > ; \
- < "Aijin Kim" ; > ; \
- < "Ian McDonnell" ; > ; \
- < "Kazuhiro Hatake Takabatake " ; > ; \
- < "Lei Phill Zhang" ; > ; \
- < "May Zhang" ; > ; \
- < "" ; > ; \
- < "Translation Management" ; 8 ; > ; \
- < "" ; > ; \
- < "Monica Badia" ; > ; \
- < "Sofia Nilsson" ; > ; \
- < "Kaoru Oguru" ; > ; \
- < "Joy Zhang" ; > ; \
- < "" ; > ; \
- < "Documentation & Tools" ; 8 ; > ; \
- < "" ; > ; \
- < "Yu Aaron Cheng" ; > ; \
- < "Sven Klawitter" ; > ; \
- < "Hiroko Matano" ; > ; \
- < "Boris Steiner" ; > ; \
- < "Michal Touzin" ; > ; \
- < "" ; > ; \
- < "" ; > ; \
< "MARKETING & OPERATIONS" ; 8 ; > ; \
< "" ; > ; \
- < "PRODUCT & PROGRAM MANAGMENT" ; 8 ; > ; \
+ < "PRODUCT MANAGMENT" ; 8 ; > ; \
< "" ; > ; \
< "Goetz Wohlberg" ; > ; \
+ < "Lutz Hoeger" ; > ; \
< "" ; > ; \
< "MARKETING" ; 8 ; > ; \
< "" ; > ; \
- < "Alexei Koudriachov" ; > ; \
- < "Ashish Mukharji" ; > ; \
- < "Manish Punjabi" ; > ; \
- < "Erwin Tenhumberg" ; > ; \
+ < "Rosana Ardila Biela" ; > ; \
+ < "Kay Koll" ; > ; \
< "Iyer Venkatesan" ; > ; \
- < "Jennifer Winger" ; > ; \
< "" ; > ; \
< "OPERATIONS" ; 8 ; > ; \
< "" ; > ; \
- < "Scott Citta" ; > ; \
- < "Jane Cooley" ; > ; \
- < "Lisa Medlin" ; > ; \
< "Parker Proffitt" ; > ; \
< "" ; > ; \
- < "TECHNICAL TRAINING, MARKET &" ; 8 ; > ; \
- < "BUSINESS DEVELOPMENT" ; 8 ; > ; \
- < "" ; > ; \
- < "Matthew Baier" ; > ; \
- < "Herve Bernard" ; > ; \
- < "Kay Koll" ; > ; \
- < "Ted Tudor" ; > ; \
- < "Jane Worden" ; > ; \
- < "Sophia Zheng " ; > ; \
- < "" ; > ; \
- < "ADDITIONAL FUNCTIONS" ; 8 ; > ; \
+ < "SUN SIGMA BLACK BELT" ; 8 ; > ; \
< "" ; > ; \
- < "Bill Lane" ; > ; \
- < "Douglas Lenser" ; > ; \
- < "Frank Psotka" ; > ; \
+ < "Stefan Zimmermann" ; > ; \
< "" ; > ; \
};\
diff --git a/svx/source/items/numitem.cxx b/svx/source/items/numitem.cxx
index 32a493b5bd..a77a49c5ed 100644
--- a/svx/source/items/numitem.cxx
+++ b/svx/source/items/numitem.cxx
@@ -62,6 +62,11 @@
#define DEF_WRITER_LSPACE 500 //Standardeinrueckung
#define DEF_DRAW_LSPACE 800 //Standardeinrueckung
+#define NUMITEM_VERSION_01 0x01
+#define NUMITEM_VERSION_02 0x02
+#define NUMITEM_VERSION_03 0x03
+#define NUMITEM_VERSION_04 0x04
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
@@ -224,157 +229,184 @@ SvxNumberFormat::~SvxNumberFormat()
/* -----------------08.12.98 11:14-------------------
*
* --------------------------------------------------*/
-//SvxNumberFormat::SvxNumberFormat(SvStream &rStream)
-//{
-// USHORT nVersion;
-// rStream >> nVersion;
-
-// USHORT nUSHORT;
-// rStream >> nUSHORT;
-// SetNumberingType((sal_Int16)nUSHORT);
-// rStream >> nUSHORT;
-// eNumAdjust = (SvxAdjust)nUSHORT;
-// rStream >> nUSHORT;
-// nInclUpperLevels = (BYTE)nUSHORT;
-// rStream >> nUSHORT;
-// nStart = nUSHORT;
-// rStream >> nUSHORT;
-// cBullet = nUSHORT;
-
-// short nShort;
-// rStream >> nShort;
-// nFirstLineOffset = nShort;
-// rStream >> nShort;
-// nAbsLSpace = nShort;
-// rStream >> nShort;
-// nLSpace = nShort;
-
-// rStream >> nShort;
-// nCharTextDistance = nShort;
-// rtl_TextEncoding eEnc = gsl_getSystemTextEncoding();
-// rStream.ReadByteString(sPrefix, eEnc);
-// rStream.ReadByteString(sSuffix, eEnc);
-// rStream.ReadByteString(sCharStyleName, eEnc);
-// rStream >> nUSHORT;
-// if(nUSHORT)
-// {
-// SvxBrushItem aHelper(0);
-// pGraphicBrush = (SvxBrushItem*) aHelper.Create( rStream, BRUSH_GRAPHIC_VERSION );
-// }
-// else
-// pGraphicBrush = 0;
-
-// rStream >> nUSHORT;
-// eVertOrient = (sal_Int16)nUSHORT;
-
-// rStream >> nUSHORT;
-// if(nUSHORT)
-// {
-// pBulletFont = new Font;
-// rStream >> *pBulletFont;
-// if(!pBulletFont->GetCharSet())
-// pBulletFont->SetCharSet(rStream.GetStreamCharSet());
-// }
-// else
-// pBulletFont = 0;
-// rStream >> aGraphicSize;
-
-// rStream >> nBulletColor;
-// rStream >> nUSHORT;
-// nBulletRelSize = nUSHORT;
-// rStream >> nUSHORT;
-// SetShowSymbol((BOOL)nUSHORT);
-
-// if( nVersion < NUMITEM_VERSION_03 )
-// cBullet = ByteString::ConvertToUnicode( (sal_Char)cBullet,
-// (pBulletFont&&pBulletFont->GetCharSet()) ? pBulletFont->GetCharSet()
-// : RTL_TEXTENCODING_SYMBOL );
-// if(pBulletFont)
-// {
-// BOOL bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50;
-// if(bConvertBulletFont)
-// {
-
-// FontToSubsFontConverter pConverter =
-// CreateFontToSubsFontConverter(pBulletFont->GetName(),
-// FONTTOSUBSFONT_IMPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS);
-// if(pConverter)
-// {
-// cBullet = ConvertFontToSubsFontChar(pConverter, cBullet);
-// String sFontName = GetFontToSubsFontName(pConverter);
-// pBulletFont->SetName(sFontName);
-// DestroyFontToSubsFontConverter(pConverter);
-// }
-// }
-// }
-//}
+SvxNumberFormat::SvxNumberFormat(SvStream &rStream)
+: mePositionAndSpaceMode( LABEL_WIDTH_AND_POSITION ),
+ meLabelFollowedBy( LISTTAB ),
+ mnListtabPos( 0 ),
+ mnFirstLineIndent( 0 ),
+ mnIndentAt( 0 )
+{
+
+ USHORT nVersion;
+ rStream >> nVersion;
+
+ USHORT nUSHORT;
+ rStream >> nUSHORT;
+ SetNumberingType((sal_Int16)nUSHORT);
+ rStream >> nUSHORT;
+ eNumAdjust = (SvxAdjust)nUSHORT;
+ rStream >> nUSHORT;
+ nInclUpperLevels = (BYTE)nUSHORT;
+ rStream >> nUSHORT;
+ nStart = nUSHORT;
+ rStream >> nUSHORT;
+ cBullet = nUSHORT;
+
+ short nShort;
+ rStream >> nShort;
+ nFirstLineOffset = nShort;
+ rStream >> nShort;
+ nAbsLSpace = nShort;
+ rStream >> nShort;
+ nLSpace = nShort;
+
+ rStream >> nShort;
+ nCharTextDistance = nShort;
+ rtl_TextEncoding eEnc = gsl_getSystemTextEncoding();
+ rStream.ReadByteString(sPrefix, eEnc);
+ rStream.ReadByteString(sSuffix, eEnc);
+ rStream.ReadByteString(sCharStyleName, eEnc);
+ rStream >> nUSHORT;
+ if(nUSHORT)
+ {
+ SvxBrushItem aHelper(0);
+ pGraphicBrush = (SvxBrushItem*) aHelper.Create( rStream, BRUSH_GRAPHIC_VERSION );
+ }
+ else
+ pGraphicBrush = 0;
+
+ rStream >> nUSHORT;
+ eVertOrient = (sal_Int16)nUSHORT;
+
+ rStream >> nUSHORT;
+ if(nUSHORT)
+ {
+ pBulletFont = new Font;
+ rStream >> *pBulletFont;
+ if(!pBulletFont->GetCharSet())
+ pBulletFont->SetCharSet(rStream.GetStreamCharSet());
+ }
+ else
+ pBulletFont = 0;
+ rStream >> aGraphicSize;
+
+ rStream >> nBulletColor;
+ rStream >> nUSHORT;
+ nBulletRelSize = nUSHORT;
+ rStream >> nUSHORT;
+ SetShowSymbol((BOOL)nUSHORT);
+
+ if( nVersion < NUMITEM_VERSION_03 )
+ cBullet = ByteString::ConvertToUnicode( (sal_Char)cBullet,
+ (pBulletFont&&pBulletFont->GetCharSet()) ? pBulletFont->GetCharSet()
+ : RTL_TEXTENCODING_SYMBOL );
+ if(pBulletFont)
+ {
+ BOOL bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50;
+ if(bConvertBulletFont)
+ {
+
+ FontToSubsFontConverter pConverter =
+ CreateFontToSubsFontConverter(pBulletFont->GetName(),
+ FONTTOSUBSFONT_IMPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS);
+ if(pConverter)
+ {
+ cBullet = ConvertFontToSubsFontChar(pConverter, cBullet);
+ String sFontName = GetFontToSubsFontName(pConverter);
+ pBulletFont->SetName(sFontName);
+ DestroyFontToSubsFontConverter(pConverter);
+ }
+ }
+ }
+
+ if( NUMITEM_VERSION_04 <= nVersion )
+ {
+ rStream >> nUSHORT;
+ mePositionAndSpaceMode = (SvxNumPositionAndSpaceMode) nUSHORT;
+ rStream >> nUSHORT;
+ meLabelFollowedBy = ( SvxNumLabelFollowedBy ) nUSHORT;
+ long nLong;
+ rStream >> nLong;
+ mnListtabPos = nLong;
+ rStream >> nLong;
+ mnFirstLineIndent = nLong;
+ rStream >> nLong;
+ mnIndentAt = nLong;
+ }
+}
/* -----------------08.12.98 11:14-------------------
*
* --------------------------------------------------*/
-// --> OD 2008-01-09 #newlistlevelattrs# - no longer used
-//SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pConverter)
-//{
-// if(pConverter && pBulletFont)
-// {
-// cBullet = ConvertFontToSubsFontChar(pConverter, cBullet);
-// String sFontName = GetFontToSubsFontName(pConverter);
-// pBulletFont->SetName(sFontName);
-// }
-
-// rStream << (USHORT)NUMITEM_VERSION_03;
-
-// rStream << (USHORT)GetNumberingType();
-// rStream << (USHORT)eNumAdjust;
-// rStream << (USHORT)nInclUpperLevels;
-// rStream << nStart;
-// rStream << (USHORT)cBullet;
-
-// rStream << nFirstLineOffset;
-// rStream << nAbsLSpace;
-// rStream << nLSpace;
-
-// rStream << nCharTextDistance;
-// rtl_TextEncoding eEnc = gsl_getSystemTextEncoding();
-// rStream.WriteByteString(sPrefix, eEnc);
-// rStream.WriteByteString(sSuffix, eEnc);
-// rStream.WriteByteString(sCharStyleName, eEnc);
-// if(pGraphicBrush)
-// {
-// rStream << (USHORT)1;
-
-// // #75113# in SD or SI force bullet itself to be stored,
-// // for that purpose throw away link when link and graphic
-// // are present, so Brush save is forced
-// if(pGraphicBrush->GetGraphicLink() && pGraphicBrush->GetGraphic())
-// {
-// String aEmpty;
-// pGraphicBrush->SetGraphicLink(aEmpty);
-// }
-
-// pGraphicBrush->Store(rStream, BRUSH_GRAPHIC_VERSION);
-// }
-// else
-// rStream << (USHORT)0;
-
-// rStream << (USHORT)eVertOrient;
-// if(pBulletFont)
-// {
-// rStream << (USHORT)1;
-// rStream << *pBulletFont;
-// }
-// else
-// rStream << (USHORT)0;
-// rStream << aGraphicSize;
-
-// Color nTempColor = nBulletColor;
-// if(COL_AUTO == nBulletColor.GetColor())
-// nTempColor = COL_BLACK;
-// rStream << nTempColor;
-// rStream << nBulletRelSize;
-// rStream << (USHORT)IsShowSymbol();
-// return rStream;
-//}
-// <--
+SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pConverter)
+{
+ if(pConverter && pBulletFont)
+ {
+ cBullet = ConvertFontToSubsFontChar(pConverter, cBullet);
+ String sFontName = GetFontToSubsFontName(pConverter);
+ pBulletFont->SetName(sFontName);
+ }
+
+ rStream << (USHORT)NUMITEM_VERSION_04;
+
+ rStream << (USHORT)GetNumberingType();
+ rStream << (USHORT)eNumAdjust;
+ rStream << (USHORT)nInclUpperLevels;
+ rStream << nStart;
+ rStream << (USHORT)cBullet;
+
+ rStream << nFirstLineOffset;
+ rStream << nAbsLSpace;
+ rStream << nLSpace;
+
+ rStream << nCharTextDistance;
+ rtl_TextEncoding eEnc = gsl_getSystemTextEncoding();
+ rStream.WriteByteString(sPrefix, eEnc);
+ rStream.WriteByteString(sSuffix, eEnc);
+ rStream.WriteByteString(sCharStyleName, eEnc);
+ if(pGraphicBrush)
+ {
+ rStream << (USHORT)1;
+
+ // #75113# in SD or SI force bullet itself to be stored,
+ // for that purpose throw away link when link and graphic
+ // are present, so Brush save is forced
+ if(pGraphicBrush->GetGraphicLink() && pGraphicBrush->GetGraphic())
+ {
+ String aEmpty;
+ pGraphicBrush->SetGraphicLink(aEmpty);
+ }
+
+ pGraphicBrush->Store(rStream, BRUSH_GRAPHIC_VERSION);
+ }
+ else
+ rStream << (USHORT)0;
+
+ rStream << (USHORT)eVertOrient;
+ if(pBulletFont)
+ {
+ rStream << (USHORT)1;
+ rStream << *pBulletFont;
+ }
+ else
+ rStream << (USHORT)0;
+ rStream << aGraphicSize;
+
+ Color nTempColor = nBulletColor;
+ if(COL_AUTO == nBulletColor.GetColor())
+ nTempColor = COL_BLACK;
+ rStream << nTempColor;
+ rStream << nBulletRelSize;
+ rStream << (USHORT)IsShowSymbol();
+
+ rStream << ( USHORT ) mePositionAndSpaceMode;
+ rStream << ( USHORT ) meLabelFollowedBy;
+ rStream << ( long ) mnListtabPos;
+ rStream << ( long ) mnFirstLineIndent;
+ rStream << ( long ) mnIndentAt;
+
+ return rStream;
+}
+
/* -----------------------------23.02.01 11:10--------------------------------
---------------------------------------------------------------------------*/
@@ -839,80 +871,79 @@ SvxNumRule::SvxNumRule(const SvxNumRule& rCopy)
/* -----------------08.12.98 11:07-------------------
*
* --------------------------------------------------*/
-//SvxNumRule::SvxNumRule(SvStream &rStream)
-//{
-// ++nRefCount;
-// LanguageType eLang = Application::GetSettings().GetLanguage();
-// aLocale = SvxCreateLocale(eLang);
-// USHORT nVersion;
-// USHORT nTemp;
-// rStream >> nVersion;
-// rStream >> nLevelCount;
-// rStream >> nTemp;
-// nFeatureFlags = nTemp;
-// rStream >> nTemp;
-// bContinuousNumbering = (BOOL)nTemp;
-// rStream >> nTemp;
-// eNumberingType = (SvxNumRuleType)nTemp;
-// memset( aFmts, 0, sizeof( aFmts ));
-
-// for(USHORT i = 0; i < SVX_MAX_NUM; i++)
-// {
-// USHORT nSet;
-// rStream >> nSet;
-// if(nSet)
-// aFmts[i] = new SvxNumberFormat(rStream);
-// else
-// aFmts[i] = 0;
-// aFmtsSet[i] = aFmts[i] ? TRUE : FALSE;
-// }
-// if(NUMITEM_VERSION_02 <= nVersion)
-// {
-// USHORT nShort;
-// rStream >> nShort;
-// nFeatureFlags = nShort;
-// }
-//}
+SvxNumRule::SvxNumRule(SvStream &rStream)
+{
+ ++nRefCount;
+ LanguageType eLang = Application::GetSettings().GetLanguage();
+ aLocale = SvxCreateLocale(eLang);
+ USHORT nVersion;
+ USHORT nTemp;
+ rStream >> nVersion;
+ rStream >> nLevelCount;
+ rStream >> nTemp;
+ nFeatureFlags = nTemp;
+ rStream >> nTemp;
+ bContinuousNumbering = (BOOL)nTemp;
+ rStream >> nTemp;
+ eNumberingType = (SvxNumRuleType)nTemp;
+ memset( aFmts, 0, sizeof( aFmts ));
+
+ for(USHORT i = 0; i < SVX_MAX_NUM; i++)
+ {
+ USHORT nSet;
+ rStream >> nSet;
+ if(nSet)
+ aFmts[i] = new SvxNumberFormat(rStream);
+ else
+ aFmts[i] = 0;
+ aFmtsSet[i] = aFmts[i] ? TRUE : FALSE;
+ }
+ if(NUMITEM_VERSION_02 <= nVersion)
+ {
+ USHORT nShort;
+ rStream >> nShort;
+ nFeatureFlags = nShort;
+ }
+}
/* -----------------08.12.98 11:07-------------------
*
* --------------------------------------------------*/
-// --> OD 2008-01-09 #newlistlevelattrs# - no longer used
-//SvStream& SvxNumRule::Store(SvStream &rStream)
-//{
-// rStream<<(USHORT)NUMITEM_VERSION_03;
-// rStream<<nLevelCount;
-// //first save of nFeatureFlags for old versions
-// rStream<<(USHORT)nFeatureFlags;
-// rStream<<(USHORT)bContinuousNumbering;
-// rStream<<(USHORT)eNumberingType;
-
-// FontToSubsFontConverter pConverter = 0;
-// BOOL bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50;
-// for(USHORT i = 0; i < SVX_MAX_NUM; i++)
-// {
-// if(aFmts[i])
-// {
-// rStream << USHORT(1);
-// if(bConvertBulletFont && aFmts[i]->GetBulletFont())
-// {
-// if(!pConverter)
-// pConverter =
-// CreateFontToSubsFontConverter(aFmts[i]->GetBulletFont()->GetName(),
-// FONTTOSUBSFONT_EXPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS);
-// }
-// aFmts[i]->Store(rStream, pConverter);
-// }
-// else
-// rStream << USHORT(0);
-// }
-// //second save of nFeatureFlags for new versions
-// rStream<<(USHORT)nFeatureFlags;
-// if(pConverter)
-// DestroyFontToSubsFontConverter(pConverter);
-
-// return rStream;
-//}
+SvStream& SvxNumRule::Store(SvStream &rStream)
+{
+ rStream<<(USHORT)NUMITEM_VERSION_03;
+ rStream<<nLevelCount;
+ //first save of nFeatureFlags for old versions
+ rStream<<(USHORT)nFeatureFlags;
+ rStream<<(USHORT)bContinuousNumbering;
+ rStream<<(USHORT)eNumberingType;
+
+ FontToSubsFontConverter pConverter = 0;
+ BOOL bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50;
+ for(USHORT i = 0; i < SVX_MAX_NUM; i++)
+ {
+ if(aFmts[i])
+ {
+ rStream << USHORT(1);
+ if(bConvertBulletFont && aFmts[i]->GetBulletFont())
+ {
+ if(!pConverter)
+ pConverter =
+ CreateFontToSubsFontConverter(aFmts[i]->GetBulletFont()->GetName(),
+ FONTTOSUBSFONT_EXPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS);
+ }
+ aFmts[i]->Store(rStream, pConverter);
+ }
+ else
+ rStream << USHORT(0);
+ }
+ //second save of nFeatureFlags for new versions
+ rStream<<(USHORT)nFeatureFlags;
+ if(pConverter)
+ DestroyFontToSubsFontConverter(pConverter);
+
+ return rStream;
+}
/* -----------------27.10.98 10:41-------------------
*
@@ -1179,32 +1210,23 @@ SfxPoolItem* SvxNumBulletItem::Clone( SfxItemPool * ) const
/* -----------------08.12.98 10:43-------------------
*
* --------------------------------------------------*/
-// --> OD 2008-01-09 #newlistlevelattrs# - no longer used
-//SfxPoolItem* SvxNumBulletItem::Create(SvStream &rStream, USHORT) const
-//{
-// SvxNumRule aRule(rStream);
-// return new SvxNumBulletItem(aRule, Which() );
-//}
-// <--
-/* -----------------08.12.98 10:43-------------------
- *
- * --------------------------------------------------*/
-// --> OD 2008-01-09 #newlistlevelattrs# - no longer used
-//SvStream& SvxNumBulletItem::Store(SvStream &rStream, USHORT /*nItemVersion*/ )const
-//{
-// pNumRule->Store(rStream);
-// return rStream;
-//}
-// <--
+SfxPoolItem* SvxNumBulletItem::Create(SvStream &rStream, USHORT) const
+{
+ SvxNumRule aRule(rStream);
+ return new SvxNumBulletItem(aRule, Which() );
+}
+USHORT SvxNumBulletItem::GetVersion( USHORT /*nFileVersion*/ ) const
+{
+ return NUMITEM_VERSION_03;
+}
/* -----------------08.12.98 10:43-------------------
*
* --------------------------------------------------*/
-// --> OD 2008-01-10 #newlistlevelattrs# - no longer used
-//USHORT SvxNumBulletItem::GetVersion( USHORT /*nFileVersion*/ ) const
-//{
-// return NUMITEM_VERSION_03;
-//}
-// <--
+SvStream& SvxNumBulletItem::Store(SvStream &rStream, USHORT /*nItemVersion*/ )const
+{
+ pNumRule->Store(rStream);
+ return rStream;
+}
/* -----------------08.12.98 10:43-------------------
*
diff --git a/svx/source/msfilter/makefile.mk b/svx/source/msfilter/makefile.mk
index adbe8b1048..53eab95a5b 100644
--- a/svx/source/msfilter/makefile.mk
+++ b/svx/source/msfilter/makefile.mk
@@ -54,7 +54,8 @@ LIB1OBJFILES= \
$(SLO)$/svxmsbas.obj \
$(SLO)$/msocximex.obj \
$(SLO)$/mscodec.obj \
- $(SLO)$/msfiltertracer.obj
+ $(SLO)$/msfiltertracer.obj \
+ $(SLO)$/msvbahelper.obj\
LIB2TARGET= $(SLB)$/$(TARGET)-core.lib
LIB2OBJFILES= \
@@ -70,7 +71,8 @@ EXCEPTIONSFILES= \
$(SLO)$/msocximex.obj \
$(SLO)$/msoleexp.obj \
$(SLO)$/svxmsbas.obj \
- $(SLO)$/msfiltertracer.obj
+ $(SLO)$/msfiltertracer.obj \
+ $(SLO)$/msvbahelper.obj\
.INCLUDE : target.mk
diff --git a/svx/source/msfilter/msvbahelper.cxx b/svx/source/msfilter/msvbahelper.cxx
new file mode 100644
index 0000000000..2f9c330d91
--- /dev/null
+++ b/svx/source/msfilter/msvbahelper.cxx
@@ -0,0 +1,384 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 "precompiled_svx.hxx"
+#include <svx/msvbahelper.hxx>
+#include <basic/sbx.hxx>
+#include <basic/sbstar.hxx>
+#include <basic/basmgr.hxx>
+#include <basic/sbmod.hxx>
+#include <basic/sbmeth.hxx>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
+#include <tools/urlobj.hxx>
+#include <osl/file.hxx>
+
+using namespace ::com::sun::star;
+
+const static rtl::OUString sUrlPart0 = rtl::OUString::createFromAscii( "vnd.sun.star.script:");
+const static rtl::OUString sUrlPart1 = rtl::OUString::createFromAscii( "?language=Basic&location=document");
+
+namespace ooo { namespace vba {
+
+String makeMacroURL( const String& sMacroName )
+{
+ return sUrlPart0.concat( sMacroName ).concat( sUrlPart1 ) ;
+}
+
+SfxObjectShell* findShellForUrl( const rtl::OUString& sMacroURLOrPath )
+{
+ SfxObjectShell* pFoundShell=NULL;
+ SfxObjectShell* pShell = SfxObjectShell::GetFirst();
+ INetURLObject aObj;
+ aObj.SetURL( sMacroURLOrPath );
+ bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+ rtl::OUString aURL;
+ if ( bIsURL )
+ aURL = sMacroURLOrPath;
+ else
+ {
+ osl::FileBase::getFileURLFromSystemPath( sMacroURLOrPath, aURL );
+ aObj.SetURL( aURL );
+ }
+ OSL_TRACE("Trying to find shell for url %s", rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+ while ( pShell )
+ {
+
+ uno::Reference< frame::XModel > xModel = pShell->GetModel();
+ // are we searching for a template? if so we have to cater for the
+ // fact that in openoffice a document opened from a template is always
+ // a new document :/
+ if ( xModel.is() )
+ {
+ OSL_TRACE("shell 0x%x has model with url %s and we look for %s", pShell
+ , rtl::OUStringToOString( xModel->getURL(), RTL_TEXTENCODING_UTF8 ).getStr()
+ , rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ).getStr()
+ );
+ if ( sMacroURLOrPath.endsWithIgnoreAsciiCaseAsciiL( ".dot", 4 ) )
+ {
+ uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( xModel, uno::UNO_QUERY );
+ if( xDocInfoSupp.is() )
+ {
+ uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
+ rtl::OUString sCurrName = xDocProps->getTemplateName();
+ if( sMacroURLOrPath.lastIndexOf( sCurrName ) >= 0 )
+ {
+ pFoundShell = pShell;
+ break;
+ }
+ }
+ }
+ else
+ {
+ if ( aURL.equals( xModel->getURL() ) )
+ {
+ pFoundShell = pShell;
+ break;
+ }
+ }
+ }
+ pShell = SfxObjectShell::GetNext( *pShell );
+ }
+ return pFoundShell;
+}
+
+// sMod can be empty ( but we really need the library to search in )
+// if sMod is empty and a macro is found then sMod is updated
+bool hasMacro( SfxObjectShell* pShell, const String& sLibrary, String& sMod, const String& sMacro )
+{
+ bool bFound = false;
+ if ( sLibrary.Len() && sMacro.Len() )
+ {
+ OSL_TRACE("** Searching for %s.%s in library %s"
+ ,rtl::OUStringToOString( sMod, RTL_TEXTENCODING_UTF8 ).getStr()
+ ,rtl::OUStringToOString( sMacro, RTL_TEXTENCODING_UTF8 ).getStr()
+ ,rtl::OUStringToOString( sLibrary, RTL_TEXTENCODING_UTF8 ).getStr() );
+ BasicManager* pBasicMgr = pShell-> GetBasicManager();
+ if ( pBasicMgr )
+ {
+ StarBASIC* pBasic = pBasicMgr->GetLib( sLibrary );
+ if ( !pBasic )
+ {
+ USHORT nId = pBasicMgr->GetLibId( sLibrary );
+ pBasicMgr->LoadLib( nId );
+ pBasic = pBasicMgr->GetLib( sLibrary );
+ }
+ if ( pBasic )
+ {
+ if ( sMod.Len() ) // we wish to find the macro is a specific module
+ {
+ SbModule* pModule = pBasic->FindModule( sMod );
+ if ( pModule )
+ {
+ SbxArray* pMethods = pModule->GetMethods();
+ if ( pMethods )
+ {
+ SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Find( sMacro, SbxCLASS_METHOD ) );
+ if ( pMethod )
+ bFound = true;
+ }
+ }
+ }
+ else if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pBasic->Find( sMacro, SbxCLASS_METHOD ) ) )
+ {
+ if( SbModule* pModule = pMethod->GetModule() )
+ {
+ sMod = pModule->GetName();
+ bFound = true;
+ }
+ }
+ }
+ }
+ }
+ return bFound;
+}
+void parseMacro( const rtl::OUString& sMacro, String& sContainer, String& sModule, String& sProcedure )
+{
+ sal_Int32 nMacroDot = sMacro.lastIndexOf( '.' );
+
+ if ( nMacroDot != -1 )
+ {
+ sProcedure = sMacro.copy( nMacroDot + 1 );
+
+ sal_Int32 nContainerDot = sMacro.lastIndexOf( '.', nMacroDot - 1 );
+ if ( nContainerDot != -1 )
+ {
+ sModule = sMacro.copy( nContainerDot + 1, nMacroDot - nContainerDot - 1 );
+ sContainer = sMacro.copy( 0, nContainerDot );
+ }
+ else
+ sModule = sMacro.copy( 0, nMacroDot );
+ }
+ else
+ sProcedure = sMacro;
+}
+
+VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& MacroName, bool bSearchGlobalTemplates )
+{
+ VBAMacroResolvedInfo aRes;
+ if ( !pShell )
+ return aRes;
+ aRes.SetMacroDocContext( pShell );
+ // parse the macro name
+ sal_Int32 nDocSepIndex = MacroName.indexOfAsciiL( "!", 1 );
+ String sMacroUrl = MacroName;
+
+ String sContainer;
+ String sModule;
+ String sProcedure;
+
+ if( nDocSepIndex > 0 )
+ {
+ // macro specified by document name
+ // find document shell for document name and call ourselves
+ // recursively
+
+ // assume for now that the document name is *this* document
+ String sDocUrlOrPath = MacroName.copy( 0, nDocSepIndex );
+ sMacroUrl = MacroName.copy( nDocSepIndex + 1 );
+ OSL_TRACE("doc search, current shell is 0x%x", pShell );
+ SfxObjectShell* pFoundShell = findShellForUrl( sDocUrlOrPath );
+ OSL_TRACE("doc search, after find, found shell is 0x%x", pFoundShell );
+ aRes = resolveVBAMacro( pFoundShell, sMacroUrl );
+ }
+ else
+ {
+ // macro is contained in 'this' document ( or code imported from a template
+ // where that template is a global template or perhaps the template this
+ // document is created from )
+
+ // macro format = Container.Module.Procedure
+ parseMacro( MacroName, sContainer, sModule, sProcedure );
+ uno::Reference< lang::XMultiServiceFactory> xSF( pShell->GetModel(), uno::UNO_QUERY);
+ uno::Reference< container::XNameContainer > xPrjNameCache;
+ if ( xSF.is() )
+ xPrjNameCache.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAProjectNameProvider" ) ) ), uno::UNO_QUERY );
+
+ std::vector< rtl::OUString > sSearchList;
+
+ if ( sContainer.Len() > 0 )
+ {
+ // get the Project associated with the Container
+ if ( xPrjNameCache.is() )
+ {
+ if ( xPrjNameCache->hasByName( sContainer ) )
+ {
+ rtl::OUString sProject;
+ xPrjNameCache->getByName( sContainer ) >>= sProject;
+ sContainer = sProject;
+ }
+ }
+ sSearchList.push_back( sContainer ); // First Lib to search
+ }
+ else
+ {
+ // Ok, if we have no Container specified then we need to search them in order, this document, template this document created from, global templates,
+ // get the name of Project/Library for 'this' document
+ rtl::OUString sThisProject;
+ BasicManager* pBasicMgr = pShell-> GetBasicManager();
+ if ( pBasicMgr )
+ {
+ if ( pBasicMgr->GetName().Len() )
+ sThisProject = pBasicMgr->GetName();
+ else // cater for the case where VBA is not enabled
+ sThisProject = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") );
+ }
+ sSearchList.push_back( sThisProject ); // First Lib to search
+ if ( xPrjNameCache.is() )
+ {
+ // is this document created from a template?
+ uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( pShell->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
+
+ rtl::OUString sCreatedFrom = xDocProps->getTemplateURL();
+ if ( sCreatedFrom.getLength() )
+ {
+ INetURLObject aObj;
+ aObj.SetURL( sCreatedFrom );
+ bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+ rtl::OUString aURL;
+ if ( bIsURL )
+ aURL = sCreatedFrom;
+ else
+ {
+ osl::FileBase::getFileURLFromSystemPath( sCreatedFrom, aURL );
+ aObj.SetURL( aURL );
+ }
+ sCreatedFrom = aObj.GetLastName();
+ }
+
+ sal_Int32 nIndex = sCreatedFrom.lastIndexOf( '.' );
+ if ( nIndex != -1 )
+ sCreatedFrom = sCreatedFrom.copy( 0, nIndex );
+
+ rtl::OUString sPrj;
+ if ( sCreatedFrom.getLength() && xPrjNameCache->hasByName( sCreatedFrom ) )
+ {
+ xPrjNameCache->getByName( sCreatedFrom ) >>= sPrj;
+ // Make sure we don't double up with this project
+ if ( !sPrj.equals( sThisProject ) )
+ sSearchList.push_back( sPrj );
+ }
+
+ // get list of global template Names
+ uno::Sequence< rtl::OUString > sTemplateNames = xPrjNameCache->getElementNames();
+ sal_Int32 nLen = sTemplateNames.getLength();
+ for ( sal_Int32 index = 0; ( bSearchGlobalTemplates && index < nLen ); ++index )
+ {
+
+ if ( !sCreatedFrom.equals( sTemplateNames[ index ] ) )
+ {
+ if ( xPrjNameCache->hasByName( sTemplateNames[ index ] ) )
+ {
+ xPrjNameCache->getByName( sTemplateNames[ index ] ) >>= sPrj;
+ // Make sure we don't double up with this project
+ if ( !sPrj.equals( sThisProject ) )
+ sSearchList.push_back( sPrj );
+ }
+ }
+
+ }
+ }
+ }
+ std::vector< rtl::OUString >::iterator it_end = sSearchList.end();
+ for ( std::vector< rtl::OUString >::iterator it = sSearchList.begin(); it != it_end; ++it )
+ {
+ bool bRes = hasMacro( pShell, *it, sModule, sProcedure );
+ if ( bRes )
+ {
+ aRes.SetResolved( true );
+ aRes.SetMacroDocContext( pShell );
+ sContainer = *it;
+ break;
+ }
+ }
+ }
+ aRes.SetResolvedMacro( sProcedure.Insert( '.', 0 ).Insert( sModule, 0).Insert( '.', 0 ).Insert( sContainer, 0 ) );
+
+ return aRes;
+}
+
+// Treat the args as possible inouts ( convertion at bottom of method )
+sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, uno::Sequence< uno::Any >& aArgs, uno::Any& /*aRet*/, const uno::Any& aCaller )
+{
+ sal_Bool bRes = sal_False;
+ if ( !pShell )
+ return bRes;
+ rtl::OUString sUrl = makeMacroURL( sMacroName );
+
+ uno::Sequence< sal_Int16 > aOutArgsIndex;
+ uno::Sequence< uno::Any > aOutArgs;
+
+ try
+ {
+ uno::Reference< script::provider::XScriptProvider > xScriptProvider;
+ uno::Reference< script::provider::XScriptProviderSupplier > xSPS( pShell->GetModel(), uno::UNO_QUERY_THROW );
+
+ xScriptProvider.set( xSPS->getScriptProvider(), uno::UNO_QUERY_THROW );
+
+ uno::Reference< script::provider::XScript > xScript( xScriptProvider->getScript( sUrl ), uno::UNO_QUERY_THROW );
+
+ if ( aCaller.hasValue() )
+ {
+ uno::Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY );
+ if ( xProps.is() )
+ {
+ uno::Sequence< uno::Any > aCallerHack(1);
+ aCallerHack[ 0 ] = aCaller;
+ xProps->setPropertyValue( rtl::OUString::createFromAscii( "Caller" ), uno::makeAny( aCallerHack ) );
+ }
+ }
+
+
+ xScript->invoke( aArgs, aOutArgsIndex, aOutArgs );
+
+ sal_Int32 nLen = aOutArgs.getLength();
+ // convert any out params to seem like they were inouts
+ if ( nLen )
+ {
+ for ( sal_Int32 index=0; index < nLen; ++index )
+ {
+ sal_Int32 nOutIndex = aOutArgsIndex[ index ];
+ aArgs[ nOutIndex ] = aOutArgs[ index ];
+ }
+ }
+
+ bRes = sal_True;
+ }
+ catch ( uno::Exception& e )
+ {
+ bRes = sal_False;
+ }
+ return bRes;
+}
+} } // vba // ooo
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index a629e79129..f4075576ae 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -75,6 +75,52 @@
#include <boost/shared_ptr.hpp>
#include <boost/bind.hpp>
+/*
+
+Form controls (more precise: UNO Controls) in the drawing layer are ... prone to breakage, since they have some
+specialities which the drawing layer currently doesn't capture too well. In particular, having a living VCL
+window as child of the document window, and coupling this Window to a drawing layer object, makes things
+difficult sometimes.
+
+Below is a list of issues which existed in the past. Whenever you change code here, you're encouraged to
+verify those issues are still fixed. (Whenever you have some additional time, you're encouraged to write
+an automatic test for one or more of those issues for which this is possible :)
+
+http://www.openoffice.org/issues/show_bug.cgi?id=105992
+zooming documents containg (alive) form controls improperly positions the controls
+
+http://www.openoffice.org/issues/show_bug.cgi?id=104362
+crash when copy a control
+
+http://www.openoffice.org/issues/show_bug.cgi?id=104544
+Gridcontrol duplicated after design view on/off
+
+http://www.openoffice.org/issues/show_bug.cgi?id=102089
+print preview shows control elements with property printable=false
+
+http://www.openoffice.org/issues/show_bug.cgi?id=102090
+problem with setVisible on TextControl
+
+http://www.openoffice.org/issues/show_bug.cgi?id=103138
+loop when insert a control in draw
+
+http://www.openoffice.org/issues/show_bug.cgi?id=101398
+initially-displaying a document with many controls is very slow
+
+http://www.openoffice.org/issues/show_bug.cgi?id=72429
+repaint error in form wizard in bugdoc database
+
+http://www.openoffice.org/issues/show_bug.cgi?id=72694
+form control artifacts when scrolling a text fast
+
+
+issues in the old (Sun-internal) bug tracking system:
+
+#110592#
+form controls being in redlining or in hidden section are visible in alive-mode
+
+*/
+
//........................................................................
namespace sdr { namespace contact {
//........................................................................
@@ -841,11 +887,6 @@ namespace sdr { namespace contact {
protected:
virtual ::drawinglayer::primitive2d::Primitive2DSequence
- get2DDecomposition(
- const ::drawinglayer::geometry::ViewInformation2D& rViewInformation
- ) const;
-
- virtual ::drawinglayer::primitive2d::Primitive2DSequence
createLocalDecomposition(
const ::drawinglayer::geometry::ViewInformation2D& rViewInformation
) const;
@@ -1056,10 +1097,10 @@ namespace sdr { namespace contact {
namespace
{
- static void lcl_resetFlag( bool& rbFlag )
- {
- rbFlag = false;
- }
+ static void lcl_resetFlag( bool& rbFlag )
+ {
+ rbFlag = false;
+ }
}
//--------------------------------------------------------------------
@@ -1082,8 +1123,8 @@ namespace sdr { namespace contact {
}
m_bCreatingControl = true;
- ::comphelper::ScopeGuard aGuard( ::boost::bind( lcl_resetFlag, ::boost::ref( m_bCreatingControl ) ) );
-
+ ::comphelper::ScopeGuard aGuard( ::boost::bind( lcl_resetFlag, ::boost::ref( m_bCreatingControl ) ) );
+
if ( m_aControl.is() )
{
if ( m_pOutputDeviceForWindow == &_rDevice )
@@ -1588,19 +1629,6 @@ namespace sdr { namespace contact {
}
//--------------------------------------------------------------------
- ::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::get2DDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const
- {
- #if OSL_DEBUG_LEVEL > 1
- ::basegfx::B2DVector aScale, aTranslate;
- double fRotate, fShearX;
- _rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX );
- #endif
- if ( m_pVOCImpl->hasControl() )
- impl_positionAndZoomControl( _rViewInformation );
- return BasePrimitive2D::get2DDecomposition( _rViewInformation );
- }
-
- //--------------------------------------------------------------------
::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::createLocalDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const
{
#if OSL_DEBUG_LEVEL > 1
@@ -1737,13 +1765,40 @@ namespace sdr { namespace contact {
// our control already died.
// TODO: Is it worth re-creating the control? Finally, this is a pathological situation, it means some instance
// disposed the control though it doesn't own it. So, /me thinks we should not bother here.
- return drawinglayer::primitive2d::Primitive2DSequence();
-
+ return drawinglayer::primitive2d::Primitive2DSequence();
+
+ // ignore existing controls which are in alive mode and manually switched to "invisible"
+ // #102090# / 2009-06-05 / frank.schoenheit@sun.com
+ const ControlHolder& rControl( m_pImpl->getExistentControl() );
+ if ( rControl.is() && !rControl.isDesignMode() && !rControl.isVisible() )
+ return drawinglayer::primitive2d::Primitive2DSequence();
+
::drawinglayer::primitive2d::Primitive2DReference xPrimitive( new LazyControlCreationPrimitive2D( m_pImpl ) );
return ::drawinglayer::primitive2d::Primitive2DSequence( &xPrimitive, 1 );
}
//--------------------------------------------------------------------
+ bool ViewObjectContactOfUnoControl::isPrimitiveVisible( const DisplayInfo& _rDisplayInfo ) const
+ {
+ VOCGuard aGuard( *m_pImpl );
+
+ if ( m_pImpl->hasControl() )
+ {
+ const ::drawinglayer::geometry::ViewInformation2D& rViewInformation( GetObjectContact().getViewInformation2D() );
+ #if OSL_DEBUG_LEVEL > 1
+ ::basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX );
+ #endif
+
+ if ( !rViewInformation.getViewport().isEmpty() )
+ m_pImpl->positionAndZoomControl( rViewInformation.getObjectToViewTransformation() );
+ }
+
+ return ViewObjectContactOfSdrObj::isPrimitiveVisible( _rDisplayInfo );
+ }
+
+ //--------------------------------------------------------------------
void ViewObjectContactOfUnoControl::propertyChange()
{
// graphical invalidate at all views
diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
index 31fe3da220..c016d8e557 100644
--- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
+++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
@@ -370,8 +370,41 @@ namespace sdr
OverlayManager::ImpDrawMembers(aBufferRememberedRangeLogic, getOutputDevice());
}
- // #i80730# removed: VCL hack for transparent child windows
- // No longer needed, checked in DEV300 m54
+ // VCL hack for transparent child windows
+ // Problem is e.g. a radiobuttion form control in life mode. The used window
+ // is a transparence vcl childwindow. This flag only allows the parent window to
+ // paint into the child windows area, but there is no mechanism which takes
+ // care for a repaint of the child window. A transparent child window is NOT
+ // a window which always keeps it's content consistent over the parent, but it's
+ // more like just a paint flag for the parent.
+ // To get the update, the windows in question are updated manulally here.
+ if(bTargetIsWindow)
+ {
+ Window& rWindow = static_cast< Window& >(rmOutputDevice);
+
+ if(rWindow.IsChildTransparentModeEnabled() && rWindow.GetChildCount())
+ {
+ const Rectangle aRegionRectanglePixel(
+ maBufferRememberedRangePixel.getMinX(), maBufferRememberedRangePixel.getMinY(),
+ maBufferRememberedRangePixel.getMaxX(), maBufferRememberedRangePixel.getMaxY());
+
+ for(sal_uInt16 a(0); a < rWindow.GetChildCount(); a++)
+ {
+ Window* pCandidate = rWindow.GetChild(a);
+
+ if(pCandidate && pCandidate->IsPaintTransparent())
+ {
+ const Rectangle aCandidatePosSizePixel(pCandidate->GetPosPixel(), pCandidate->GetSizePixel());
+
+ if(aCandidatePosSizePixel.IsOver(aRegionRectanglePixel))
+ {
+ pCandidate->Invalidate(INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN);
+ pCandidate->Update();
+ }
+ }
+ }
+ }
+ }
// #i80730# restore visibility of VCL cursor
if(bCursorWasEnabled)
diff --git a/svx/source/svdraw/selectioncontroller.cxx b/svx/source/svdraw/selectioncontroller.cxx
index fc3e991f65..7e0014f1e0 100644
--- a/svx/source/svdraw/selectioncontroller.cxx
+++ b/svx/source/svdraw/selectioncontroller.cxx
@@ -31,6 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+#include <tools/debug.hxx>
#include <svx/selectioncontroller.hxx>
namespace sdr
@@ -103,4 +104,14 @@ bool SelectionController::PasteObjModel( const SdrModel& /*rModel*/ )
return false;
}
+bool SelectionController::TakeFormatPaintBrush( boost::shared_ptr< SfxItemSet >& /*rFormatSet*/ )
+{
+ return false;
+}
+
+bool SelectionController::ApplyFormatPaintBrush( SfxItemSet& /*rFormatSet*/, bool /*bNoCharacterFormats*/, bool /*bNoParagraphFormats*/ )
+{
+ return false;
+}
+
}
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index adca082371..2336af2f5f 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -30,6 +30,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+
+#include <com/sun/star/i18n/WordType.hpp>
+
#include <svtools/accessibilityoptions.hxx>
#include <svx/svdedxv.hxx>
@@ -46,6 +49,7 @@
#include <vcl/cursor.hxx>
#include <svx/unotext.hxx>
+#include <svx/editeng.hxx>
#include <svx/editobj.hxx>
#include <svx/outlobj.hxx>
#include <svx/scripttypeitem.hxx>
@@ -60,7 +64,6 @@
#include "svx/svdetc.hxx" // fuer GetDraftFillColor
#include "svx/svdotable.hxx"
#include <svx/selectioncontroller.hxx>
-
#ifdef DBG_UTIL
#include <svdibrow.hxx>
#endif
@@ -69,6 +72,7 @@
#include <svx/svddrgv.hxx> // fuer SetSolidDragging()
#include "svdstr.hrc" // Namen aus der Resource
#include "svdglob.hxx" // StringCache
+#include "globl3d.hxx"
#include <svx/outliner.hxx>
#include <svx/adjitem.hxx>
@@ -1923,3 +1927,223 @@ void SdrObjEditView::OnEndPasteOrDrop( PasteOrDropInfos* )
// applications can derive from these virtual methods to do something before a drop or paste operation
}
+bool SdrObjEditView::SupportsFormatPaintbrush( UINT32 nObjectInventor, UINT16 nObjectIdentifier ) const
+{
+ if( nObjectInventor != SdrInventor && nObjectInventor != E3dInventor )
+ return false;
+ switch(nObjectIdentifier)
+ {
+ case OBJ_NONE:
+ case OBJ_GRUP:
+ return false;
+ case OBJ_LINE:
+ case OBJ_RECT:
+ case OBJ_CIRC:
+ case OBJ_SECT:
+ case OBJ_CARC:
+ case OBJ_CCUT:
+ case OBJ_POLY:
+ case OBJ_PLIN:
+ case OBJ_PATHLINE:
+ case OBJ_PATHFILL:
+ case OBJ_FREELINE:
+ case OBJ_FREEFILL:
+ case OBJ_SPLNLINE:
+ case OBJ_SPLNFILL:
+ case OBJ_TEXT:
+ case OBJ_TEXTEXT:
+ case OBJ_TITLETEXT:
+ case OBJ_OUTLINETEXT:
+ case OBJ_GRAF:
+ case OBJ_OLE2:
+ case OBJ_TABLE:
+ return true;
+ case OBJ_EDGE:
+ case OBJ_CAPTION:
+ return false;
+ case OBJ_PATHPOLY:
+ case OBJ_PATHPLIN:
+ return true;
+ case OBJ_PAGE:
+ case OBJ_MEASURE:
+ case OBJ_DUMMY:
+ case OBJ_FRAME:
+ case OBJ_UNO:
+ return false;
+ case OBJ_CUSTOMSHAPE:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static const USHORT* GetFormatRangeImpl( bool bTextOnly )
+{
+ static const USHORT gRanges[] = {
+ SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST,
+ SDRATTR_GRAF_FIRST, SDRATTR_GRAF_LAST,
+ SDRATTR_TABLE_FIRST, SDRATTR_TABLE_LAST,
+ XATTR_LINE_FIRST, XATTR_LINE_LAST,
+ XATTR_FILL_FIRST, XATTRSET_FILL,
+ EE_PARA_START, EE_PARA_END,
+ EE_CHAR_START, EE_CHAR_END,
+ 0,0
+ };
+ return &gRanges[ bTextOnly ? 10 : 0];
+}
+
+bool SdrObjEditView::TakeFormatPaintBrush( boost::shared_ptr< SfxItemSet >& rFormatSet )
+{
+ if( mxSelectionController.is() && mxSelectionController->TakeFormatPaintBrush(rFormatSet) )
+ return true;
+
+ const SdrMarkList& rMarkList = GetMarkedObjectList();
+ if( rMarkList.GetMarkCount() >= 1 )
+ {
+ OutlinerView* pOLV = GetTextEditOutlinerView();
+
+ rFormatSet.reset( new SfxItemSet( GetModel()->GetItemPool(), GetFormatRangeImpl( pOLV != NULL ) ) );
+ if( pOLV )
+ {
+ rFormatSet->Put( pOLV->GetAttribs() );
+ }
+ else
+ {
+ const BOOL bOnlyHardAttr = FALSE;
+ rFormatSet->Put( GetAttrFromMarked(bOnlyHardAttr) );
+ }
+ return true;
+ }
+
+ return false;
+}
+
+static SfxItemSet CreatePaintSet( const USHORT *pRanges, SfxItemPool& rPool, const SfxItemSet& rSourceSet, const SfxItemSet& rTargetSet, bool bNoCharacterFormats, bool bNoParagraphFormats )
+{
+ SfxItemSet aPaintSet( rPool, pRanges );
+
+ while( *pRanges )
+ {
+ USHORT nWhich = *pRanges++;
+ const USHORT nLastWhich = *pRanges++;
+
+ if( bNoCharacterFormats && (nWhich == EE_CHAR_START) )
+ continue;
+
+ if( bNoParagraphFormats && (nWhich == EE_PARA_START ) )
+ continue;
+
+ for( ; nWhich < nLastWhich; nWhich++ )
+ {
+ const SfxPoolItem* pSourceItem = rSourceSet.GetItem( nWhich );
+ const SfxPoolItem* pTargetItem = rTargetSet.GetItem( nWhich );
+
+ if( (pSourceItem && !pTargetItem) || (pSourceItem && pTargetItem && !((*pSourceItem) == (*pTargetItem)) ) )
+ {
+ aPaintSet.Put( *pSourceItem );
+ }
+ }
+ }
+ return aPaintSet;
+}
+
+void SdrObjEditView::ApplyFormatPaintBrushToText( SfxItemSet& rFormatSet, SdrTextObj& rTextObj, SdrText* pText, bool bNoCharacterFormats, bool bNoParagraphFormats )
+{
+ OutlinerParaObject* pParaObj = pText ? pText->GetOutlinerParaObject() : 0;
+ if(pParaObj)
+ {
+ SdrOutliner& rOutliner = rTextObj.ImpGetDrawOutliner();
+ rOutliner.SetText(*pParaObj);
+
+ sal_uInt32 nParaCount(rOutliner.GetParagraphCount());
+
+ if(nParaCount)
+ {
+ for(sal_uInt16 nPara = 0; nPara < nParaCount; nPara++)
+ {
+ if( !bNoCharacterFormats )
+ rOutliner.QuickRemoveCharAttribs( nPara, /* remove all */0 );
+
+ SfxItemSet aSet(rOutliner.GetParaAttribs(nPara));
+ aSet.Put(CreatePaintSet( GetFormatRangeImpl(true), *aSet.GetPool(), rFormatSet, aSet, bNoCharacterFormats, bNoParagraphFormats ) );
+ rOutliner.SetParaAttribs(nPara, aSet);
+ }
+
+ OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount);
+ rOutliner.Clear();
+
+ rTextObj.NbcSetOutlinerParaObjectForText(pTemp,pText);
+ }
+ }
+}
+
+void SdrObjEditView::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats )
+{
+ if( !mxSelectionController.is() || !mxSelectionController->ApplyFormatPaintBrush( rFormatSet, bNoCharacterFormats, bNoParagraphFormats ) )
+ {
+ const SdrMarkList& rMarkList = GetMarkedObjectList();
+ SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ OutlinerView* pOLV = GetTextEditOutlinerView();
+
+ const SfxItemSet& rShapeSet = pObj->GetMergedItemSet();
+
+ if( !pOLV )
+ {
+ // if not in text edit mode (aka the user selected text or clicked on a word)
+ // apply formating attributes to selected shape
+ // All formating items (see ranges above) that are unequal in selected shape and
+ // the format paintbrush are hard set on the selected shape.
+
+ const USHORT* pRanges = rFormatSet.GetRanges();
+ bool bTextOnly = true;
+
+ while( *pRanges )
+ {
+ if( (*pRanges != EE_PARA_START) && (*pRanges != EE_CHAR_START) )
+ {
+ bTextOnly = false;
+ break;
+ }
+ pRanges += 2;
+ }
+
+ if( !bTextOnly )
+ {
+ SfxItemSet aPaintSet( CreatePaintSet( GetFormatRangeImpl(false), *rShapeSet.GetPool(), rFormatSet, rShapeSet, bNoCharacterFormats, bNoParagraphFormats ) );
+ const BOOL bReplaceAll = FALSE;
+ SetAttrToMarked(aPaintSet, bReplaceAll);
+ }
+
+ // now apply character and paragraph formating to text, if the shape has any
+ SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>(pObj);
+ if( pTextObj )
+ {
+ sal_Int32 nText = pTextObj->getTextCount();
+
+ while( --nText >= 0 )
+ {
+ SdrText* pText = pTextObj->getText( nText );
+ ApplyFormatPaintBrushToText( rFormatSet, *pTextObj, pText, bNoCharacterFormats, bNoParagraphFormats );
+ }
+ }
+ }
+ else
+ {
+ ::Outliner* pOutliner = pOLV->GetOutliner();
+ if( pOutliner )
+ {
+ const EditEngine& rEditEngine = pOutliner->GetEditEngine();
+
+ ESelection aSel( pOLV->GetSelection() );
+ if( !aSel.HasRange() )
+ pOLV->SetSelection( rEditEngine.GetWord( aSel, com::sun::star::i18n::WordType::DICTIONARY_WORD ) );
+
+ const BOOL bRemoveParaAttribs = !bNoParagraphFormats;
+ pOLV->RemoveAttribsKeepLanguages( bRemoveParaAttribs );
+ SfxItemSet aSet( pOLV->GetAttribs() );
+ SfxItemSet aPaintSet( CreatePaintSet(GetFormatRangeImpl(true), *aSet.GetPool(), rFormatSet, aSet, bNoCharacterFormats, bNoParagraphFormats ) );
+ pOLV->SetAttribs( aPaintSet );
+ }
+ }
+ }
+}
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index de1f8dd626..8cc1ede0ec 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -800,32 +800,47 @@ void SdrTextObj::impDecomposeBlockTextPrimitive(
const bool bVerticalWritintg(rSdrBlockTextPrimitive.getOutlinerParaObject().IsVertical());
const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight));
- // check if block text is used (only one of them can be true)
- const bool bHorizontalIsBlock(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg);
- const bool bVerticalIsBlock(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg);
-
- // set minimal paper size hor/ver if needed
- if(bHorizontalIsBlock)
- {
- rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0));
- }
- else if(bVerticalIsBlock)
- {
- rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight));
- }
-
if(bIsCell)
{
// cell text is formated neither like a text object nor like a object
// text, so use a special setup here
rOutliner.SetMaxAutoPaperSize(aAnchorTextSize);
+
+ // #i106214# To work with an unchangeable PaperSize (CellSize in
+ // this case) Set(Min|Max)AutoPaperSize and SetPaperSize have to be used.
+ // #i106214# This was not completely correct; to still measure the real
+ // text height to allow vertical adjust (and vice versa for VerticalWritintg)
+ // only one aspect has to be set, but the other one to zero
+ if(bVerticalWritintg)
+ {
+ // measure the horizontal text size
+ rOutliner.SetMinAutoPaperSize(Size(0, aAnchorTextSize.Height()));
+ }
+ else
+ {
+ // measure the vertical text size
+ rOutliner.SetMinAutoPaperSize(Size(aAnchorTextSize.Width(), 0));
+ }
+
rOutliner.SetPaperSize(aAnchorTextSize);
rOutliner.SetUpdateMode(true);
rOutliner.SetText(rSdrBlockTextPrimitive.getOutlinerParaObject());
- rOutliner.SetControlWord(nOriginalControlWord);
}
else
{
+ // check if block text is used (only one of them can be true)
+ const bool bHorizontalIsBlock(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg);
+ const bool bVerticalIsBlock(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg);
+
+ // set minimal paper size hor/ver if needed
+ if(bHorizontalIsBlock)
+ {
+ rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0));
+ }
+ else if(bVerticalIsBlock)
+ {
+ rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight));
+ }
if((rSdrBlockTextPrimitive.getWordWrap() || IsTextFrame()) && !rSdrBlockTextPrimitive.getUnlimitedPage())
{
@@ -854,9 +869,10 @@ void SdrTextObj::impDecomposeBlockTextPrimitive(
rOutliner.SetPaperSize(aNullSize);
rOutliner.SetUpdateMode(true);
rOutliner.SetText(rSdrBlockTextPrimitive.getOutlinerParaObject());
- rOutliner.SetControlWord(nOriginalControlWord);
}
+ rOutliner.SetControlWord(nOriginalControlWord);
+
// now get back the layouted text size from outliner
const Size aOutlinerTextSiz(rOutliner.GetPaperSize());
const basegfx::B2DVector aOutlinerScale(aOutlinerTextSiz.Width(), aOutlinerTextSiz.Height());
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 8f4d8cd94c..dfbba7b02a 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -671,7 +671,13 @@ const Rectangle& SdrObjList::GetAllObjSnapRect() const
const Rectangle& SdrObjList::GetAllObjBoundRect() const
{
- if (bRectsDirty) {
+ // #i106183# for deep group hierarchies like in chart2, the invalidates
+ // through the hierarchy are not correct; use a 2nd hint for the needed
+ // recalculation. Future versions will have no bool flag at all, but
+ // just aOutRect in empty state to representate an invalid state, thus
+ // it's a step in the right direction.
+ if (bRectsDirty || aOutRect.IsEmpty())
+ {
((SdrObjList*)this)->RecalcRects();
((SdrObjList*)this)->bRectsDirty=FALSE;
}
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 4d6eb39511..d81d768830 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -2514,6 +2514,88 @@ bool SvxTableController::PasteObject( SdrTableObj* pPasteTableObj )
return true;
}
+bool SvxTableController::TakeFormatPaintBrush( boost::shared_ptr< SfxItemSet >& /*rFormatSet*/ )
+{
+ // SdrView::TakeFormatPaintBrush() is enough
+ return false;
+}
+
+bool SvxTableController::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats )
+{
+ if( mbCellSelectionMode )
+ {
+ SdrTextObj* pTableObj = dynamic_cast<SdrTextObj*>( mxTableObj.get() );
+ if( !pTableObj )
+ return false;
+
+ const bool bUndo = mpModel && mpModel->IsUndoEnabled();
+
+ if( bUndo )
+ mpModel->BegUndo( ImpGetResStr(STR_TABLE_NUMFORMAT) );
+
+ CellPos aStart, aEnd;
+ getSelectedCells( aStart, aEnd );
+
+ SfxItemSet aAttr(*rFormatSet.GetPool(), rFormatSet.GetRanges());
+ aAttr.Put(rFormatSet, TRUE);
+
+ const bool bFrame = (rFormatSet.GetItemState( SDRATTR_TABLE_BORDER ) == SFX_ITEM_SET) || (rFormatSet.GetItemState( SDRATTR_TABLE_BORDER_INNER ) == SFX_ITEM_SET);
+
+ if( bFrame )
+ {
+ aAttr.ClearItem( SDRATTR_TABLE_BORDER );
+ aAttr.ClearItem( SDRATTR_TABLE_BORDER_INNER );
+ }
+
+ const USHORT* pRanges = rFormatSet.GetRanges();
+ bool bTextOnly = true;
+
+ while( *pRanges )
+ {
+ if( (*pRanges != EE_PARA_START) && (*pRanges != EE_CHAR_START) )
+ {
+ bTextOnly = true;
+ break;
+ }
+ pRanges += 2;
+ }
+
+ const bool bReplaceAll = false;
+ for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
+ {
+ for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
+ {
+ CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
+ if( xCell.is() )
+ {
+ if( bUndo )
+ xCell->AddUndo();
+ if( !bTextOnly )
+ xCell->SetMergedItemSetAndBroadcast(aAttr, bReplaceAll);
+
+ SdrText* pText = static_cast< SdrText* >( xCell.get() );
+ mpView->ApplyFormatPaintBrushToText( rFormatSet, *pTableObj, pText, bNoCharacterFormats, bNoParagraphFormats );
+ }
+ }
+ }
+
+ if( bFrame )
+ {
+ ApplyBorderAttr( rFormatSet );
+ }
+
+ UpdateTableShape();
+
+ if( bUndo )
+ mpModel->EndUndo();
+
+ return true;
+
+ }
+ return false;
+}
+
+
// --------------------------------------------------------------------
IMPL_LINK( SvxTableController, UpdateHdl, void *, EMPTYARG )
diff --git a/svx/source/table/tablecontroller.hxx b/svx/source/table/tablecontroller.hxx
index b4eecf0902..24d9a27ff4 100644
--- a/svx/source/table/tablecontroller.hxx
+++ b/svx/source/table/tablecontroller.hxx
@@ -57,6 +57,7 @@ public:
SVX_DLLPRIVATE SvxTableController( SdrObjEditView* pView, const SdrObject* pObj );
SVX_DLLPRIVATE virtual ~SvxTableController();
+ // from sdr::SelectionController
SVX_DLLPRIVATE virtual bool onKeyInput(const KeyEvent& rKEvt, Window* pWin);
SVX_DLLPRIVATE virtual bool onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
SVX_DLLPRIVATE virtual bool onMouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
@@ -72,6 +73,9 @@ public:
SVX_DLLPRIVATE virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const;
SVX_DLLPRIVATE virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr );
+ SVX_DLLPRIVATE virtual bool TakeFormatPaintBrush( boost::shared_ptr< SfxItemSet >& rFormatSet );
+ SVX_DLLPRIVATE virtual bool ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats );
+
// slots
SVX_DLLPRIVATE void onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs = 0 );
SVX_DLLPRIVATE void onDelete( sal_uInt16 nSId );
diff --git a/svx/util/hidother.src b/svx/util/hidother.src
index 5bce7c359e..b4a5b7674a 100644
--- a/svx/util/hidother.src
+++ b/svx/util/hidother.src
@@ -71,11 +71,6 @@ hidspecial HID_FIELD_SEL_WIN { HelpID =HID_FIELD_SEL_WIN ;};
hidspecial HID_FILTER_NAVIGATOR { HelpID =HID_FILTER_NAVIGATOR ;};
hidspecial HID_FILTER_NAVIGATOR_WIN { HelpID =HID_FILTER_NAVIGATOR_WIN ;};
-hidspecial HID_FM_PROPDLG_TABCTR { HelpID =HID_FM_PROPDLG_TABCTR ;};
-hidspecial HID_FM_PROPDLG_TAB_GENERAL { HelpID =HID_FM_PROPDLG_TAB_GENERAL;};
-hidspecial HID_FM_PROPDLG_TAB_DATA { HelpID =HID_FM_PROPDLG_TAB_DATA ;};
-hidspecial HID_FM_PROPDLG_TAB_EVT { HelpID =HID_FM_PROPDLG_TAB_EVT ;};
-
hidspecial HID_VALUESET_SINGLENUM { HelpID = HID_VALUESET_SINGLENUM ;};
hidspecial HID_VALUESET_BULLET { HelpID = HID_VALUESET_BULLET ;};
hidspecial HID_VALUESET_NUM { HelpID = HID_VALUESET_NUM ;};
@@ -88,8 +83,6 @@ hidspecial HID_TPPAGE_FULLSIZE { HelpId = HID_TPPAGE_FULLSIZE ;};
hidspecial HID_OPTINET2_CTL_COOKIES { HelpId = HID_OPTINET2_CTL_COOKIES ;};
hidspecial HID_OPTPATH_CTL_PATH { HelpId = HID_OPTPATH_CTL_PATH ;};
-hidspecial HID_TABORDER_CONTROLS { HelpId = HID_TABORDER_CONTROLS ;};
-
hidspecial HID_POPUP_LINEEND { HelpId = HID_POPUP_LINEEND ;};
hidspecial HID_POPUP_LINEEND_CTRL { HelpId = HID_POPUP_LINEEND_CTRL ;};
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
index e203c897c8..f26caaedc2 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
@@ -555,8 +555,9 @@ void DAVResourceAccess::GET(
void DAVResourceAccess::ABORT()
throw( DAVException )
{
- initialize();
- m_xSession->ABORT();
+ // 17.11.09 (tkr): abort currently disabled caused by issue i106766
+ // initialize();
+ // m_xSession->ABORT();
}
//=========================================================================
namespace {
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index 338d58445f..2600c10c51 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -1319,8 +1319,11 @@ void NeonSession::POST( const rtl::OUString & inPath,
void NeonSession::ABORT()
throw ( DAVException )
{
- if (NULL !=m_pHttpSession)
- ne_close_connection(m_pHttpSession);
+ // 11.11.09 (tkr): The following code lines causing crashes if closing a ongoing connection. It turned out that this existing solution doesn't work in multi-threading environments.
+ // So I disabled them in 3.2. . Issue #73893# should fix it in OOo 3.3.
+
+ //if (NULL !=m_pHttpSession)
+ // ne_close_connection(m_pHttpSession);
}
// -------------------------------------------------------------------
diff --git a/vbahelper/inc/vbahelper/helperdecl.hxx b/vbahelper/inc/vbahelper/helperdecl.hxx
new file mode 100644
index 0000000000..7a0b495a3c
--- /dev/null
+++ b/vbahelper/inc/vbahelper/helperdecl.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * 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: helperdecl.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 OOVBAAPI_SERV_DECL
+#define OOVBAAPI_SERV_DECL
+#include <comphelper/servicedecl.hxx>
+#include <ooo/vba/XHelperInterface.hpp>
+
+namespace comphelper {
+namespace service_decl {
+template <typename ImplT_, typename WithArgsT = with_args<false> >
+struct vba_service_class_ : public serviceimpl_base< detail::OwnServiceImpl<ImplT_>, WithArgsT >
+{
+ typedef serviceimpl_base< detail::OwnServiceImpl<ImplT_>, WithArgsT > baseT;
+ /** Default ctor. Implementation class without args, expecting
+ component context as single argument.
+ */
+ vba_service_class_() : baseT() {}
+ template <typename PostProcessFuncT>
+ /** Ctor to pass a post processing function/functor.
+
+ @tpl PostProcessDefaultT let your compiler deduce this
+ @param postProcessFunc function/functor that gets the yet unacquired
+ ImplT_ pointer returning a
+ uno::Reference<uno::XInterface>
+ */
+ explicit vba_service_class_( PostProcessFuncT const& postProcessFunc ) : baseT( postProcessFunc ) {}
+};
+
+} // namespace service_decl
+} // namespace comphelper
+#endif
diff --git a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx
new file mode 100644
index 0000000000..ac6fa402ea
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * 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: vbaapplicationbase.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 VBA_APPLICATION_BASE_HXX
+#define VBA_APPLICATION_BASE_HXX
+
+#include <ooo/vba/XHelperInterface.hpp>
+#include <ooo/vba/XApplicationBase.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <sfx2/objsh.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::XApplicationBase > ApplicationBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaApplicationBase : public ApplicationBase_BASE
+{
+protected:
+ VbaApplicationBase( const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ virtual ~VbaApplicationBase();
+
+ virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() throw (css::uno::RuntimeException) = 0;
+public:
+ // XHelperInterface ( parent is itself )
+ virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return this; }
+
+ virtual sal_Bool SAL_CALL getScreenUpdating() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setScreenUpdating(sal_Bool bUpdate) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getDisplayStatusBar() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getVersion() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Run( const ::rtl::OUString& MacroName, const css::uno::Any& varg1, const css::uno::Any& varg2, const css::uno::Any& varg3, const css::uno::Any& varg4, const css::uno::Any& varg5, const css::uno::Any& varg6, const css::uno::Any& varg7, const css::uno::Any& varg8, const css::uno::Any& varg9, const css::uno::Any& varg10, const css::uno::Any& varg11, const css::uno::Any& varg12, const css::uno::Any& varg13, const css::uno::Any& varg14, const css::uno::Any& varg15, const css::uno::Any& varg16, const css::uno::Any& varg17, const css::uno::Any& varg18, const css::uno::Any& varg19, const css::uno::Any& varg20, const css::uno::Any& varg21, const css::uno::Any& varg22, const css::uno::Any& varg23, const css::uno::Any& varg24, const css::uno::Any& varg25, const css::uno::Any& varg26, const css::uno::Any& varg27, const css::uno::Any& varg28, const css::uno::Any& varg29, const css::uno::Any& varg30 ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL CentimetersToPoints( float _Centimeters ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Quit( ) throw (::com::sun::star::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif
diff --git a/vbahelper/inc/vbahelper/vbacollectionimpl.hxx b/vbahelper/inc/vbahelper/vbacollectionimpl.hxx
new file mode 100644
index 0000000000..84a1d170aa
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbacollectionimpl.hxx
@@ -0,0 +1,257 @@
+/*************************************************************************
+ *
+ * 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: vbacollectionimpl.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 OOVBAAPI_VBA_COLLECTION_IMPL_HXX
+#define OOVBAAPI_VBA_COLLECTION_IMPL_HXX
+
+#include <ooo/vba/XCollection.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/script/XDefaultMethod.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+#include "vbahelper/vbahelper.hxx"
+#include "vbahelper/vbahelperinterface.hxx"
+
+#include <vector>
+
+typedef ::cppu::WeakImplHelper1< css::container::XEnumeration > EnumerationHelper_BASE;
+
+class VBAHELPER_DLLPUBLIC EnumerationHelperImpl : public EnumerationHelper_BASE
+{
+protected:
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+ css::uno::Reference< css::container::XEnumeration > m_xEnumeration;
+public:
+
+ EnumerationHelperImpl( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XEnumeration >& xEnumeration ) throw ( css::uno::RuntimeException ) : m_xContext( xContext ), m_xEnumeration( xEnumeration ) { }
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException) { return m_xEnumeration->hasMoreElements(); }
+};
+
+// a wrapper class for a providing a XIndexAccess, XNameAccess, XEnumerationAccess impl based on providing a vector of interfaces
+// only requirement is the object needs to implement XName
+
+
+
+typedef ::cppu::WeakImplHelper3< css::container::XNameAccess, css::container::XIndexAccess, css::container::XEnumerationAccess > XNamedCollectionHelper_BASE;
+
+template< typename Ifc1 >
+class VBAHELPER_DLLPUBLIC XNamedObjectCollectionHelper : public XNamedCollectionHelper_BASE
+{
+public:
+typedef std::vector< css::uno::Reference< Ifc1 > > XNamedVec;
+private:
+
+ class XNamedEnumerationHelper : public EnumerationHelper_BASE
+ {
+ XNamedVec mXNamedVec;
+ typename XNamedVec::iterator mIt;
+ public:
+ XNamedEnumerationHelper( const XNamedVec& sMap ) : mXNamedVec( sMap ), mIt( mXNamedVec.begin() ) {}
+
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException)
+ {
+ return ( mIt != mXNamedVec.end() );
+ }
+
+ virtual css::uno::Any SAL_CALL nextElement( ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {
+ if ( hasMoreElements() )
+ return css::uno::makeAny( *mIt++ );
+ throw css::container::NoSuchElementException();
+ }
+ };
+
+protected:
+ XNamedVec mXNamedVec;
+ typename XNamedVec::iterator cachePos;
+public:
+ XNamedObjectCollectionHelper( const XNamedVec& sMap ) : mXNamedVec( sMap ), cachePos(mXNamedVec.begin()) {}
+ // XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType( ) throw (css::uno::RuntimeException) { return Ifc1::static_type(0); }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (css::uno::RuntimeException) { return ( mXNamedVec.size() > 0 ); }
+ // XNameAcess
+ virtual css::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {
+ if ( !hasByName(aName) )
+ throw css::container::NoSuchElementException();
+ return css::uno::makeAny( *cachePos );
+ }
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< rtl::OUString > sNames( mXNamedVec.size() );
+ rtl::OUString* pString = sNames.getArray();
+ typename XNamedVec::iterator it = mXNamedVec.begin();
+ typename XNamedVec::iterator it_end = mXNamedVec.end();
+
+ for ( ; it != it_end; ++it, ++pString )
+ {
+ css::uno::Reference< css::container::XNamed > xName( *it, css::uno::UNO_QUERY_THROW );
+ *pString = xName->getName();
+ }
+ return sNames;
+ }
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException)
+ {
+ cachePos = mXNamedVec.begin();
+ typename XNamedVec::iterator it_end = mXNamedVec.end();
+ for ( ; cachePos != it_end; ++cachePos )
+ {
+ css::uno::Reference< css::container::XNamed > xName( *cachePos, css::uno::UNO_QUERY_THROW );
+ if ( aName.equals( xName->getName() ) )
+ break;
+ }
+ return ( cachePos != it_end );
+ }
+
+ // XElementAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (css::uno::RuntimeException) { return mXNamedVec.size(); }
+ virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException )
+ {
+ if ( Index < 0 || Index >= getCount() )
+ throw css::lang::IndexOutOfBoundsException();
+
+ return css::uno::makeAny( mXNamedVec[ Index ] );
+
+ }
+ // XEnumerationAccess
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) throw (css::uno::RuntimeException)
+ {
+ return new XNamedEnumerationHelper( mXNamedVec );
+ }
+};
+
+// including a HelperInterface implementation
+template< typename Ifc1 >
+class ScVbaCollectionBase : public InheritedHelperInterfaceImpl< Ifc1 >
+{
+typedef InheritedHelperInterfaceImpl< Ifc1 > BaseColBase;
+protected:
+ css::uno::Reference< css::container::XIndexAccess > m_xIndexAccess;
+ css::uno::Reference< css::container::XNameAccess > m_xNameAccess;
+
+ virtual css::uno::Any getItemByStringIndex( const rtl::OUString& sIndex ) throw (css::uno::RuntimeException)
+ {
+ if ( !m_xNameAccess.is() )
+ throw css::uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScVbaCollectionBase string index access not supported by this object") ), css::uno::Reference< css::uno::XInterface >() );
+
+ return createCollectionObject( m_xNameAccess->getByName( sIndex ) );
+ }
+
+ virtual css::uno::Any getItemByIntIndex( const sal_Int32 nIndex ) throw (css::uno::RuntimeException)
+ {
+ if ( !m_xIndexAccess.is() )
+ throw css::uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScVbaCollectionBase numeric index access not supported by this object") ), css::uno::Reference< css::uno::XInterface >() );
+ if ( nIndex <= 0 )
+ {
+ throw css::lang::IndexOutOfBoundsException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "index is 0 or negative" ) ),
+ css::uno::Reference< css::uno::XInterface >() );
+ }
+ // need to adjust for vba index ( for which first element is 1 )
+ return createCollectionObject( m_xIndexAccess->getByIndex( nIndex - 1 ) );
+ }
+public:
+ ScVbaCollectionBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) : BaseColBase( xParent, xContext ), m_xIndexAccess( xIndexAccess ){ m_xNameAccess.set(m_xIndexAccess, css::uno::UNO_QUERY); }
+ //XCollection
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException)
+ {
+ return m_xIndexAccess->getCount();
+ }
+
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw (css::uno::RuntimeException)
+ {
+ if ( Index1.getValueTypeClass() != css::uno::TypeClass_STRING )
+ {
+ sal_Int32 nIndex = 0;
+
+ if ( ( Index1 >>= nIndex ) != sal_True )
+ {
+ rtl::OUString message;
+ message = rtl::OUString::createFromAscii(
+ "Couldn't convert index to Int32");
+ throw css::lang::IndexOutOfBoundsException( message,
+ css::uno::Reference< css::uno::XInterface >() );
+ }
+ return getItemByIntIndex( nIndex );
+ }
+ rtl::OUString aStringSheet;
+
+ Index1 >>= aStringSheet;
+ return getItemByStringIndex( aStringSheet );
+ }
+ // XDefaultMethod
+ ::rtl::OUString SAL_CALL getDefaultMethodName( ) throw (css::uno::RuntimeException)
+ {
+ const static rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM("Item") );
+ return sName;
+ }
+ // XEnumerationAccess
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException) = 0;
+
+ // XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) = 0;
+ // XElementAccess
+ virtual ::sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException)
+ {
+ return ( m_xIndexAccess->getCount() > 0 );
+ }
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) = 0;
+
+};
+
+typedef ::cppu::WeakImplHelper1<ov::XCollection> XCollection_InterfacesBASE;
+
+typedef ScVbaCollectionBase< XCollection_InterfacesBASE > CollImplBase1;
+// compatible with the old collections ( pre XHelperInterface base class ) ( some internal objects still use this )
+class VBAHELPER_DLLPUBLIC ScVbaCollectionBaseImpl : public CollImplBase1
+{
+public:
+ ScVbaCollectionBaseImpl( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) throw( css::uno::RuntimeException ) : CollImplBase1( xParent, xContext, xIndexAccess){}
+
+};
+
+template <typename Ifc> // where Ifc must implement XCollectionTest
+class VBAHELPER_DLLPUBLIC CollTestImplHelper : public ScVbaCollectionBase< ::cppu::WeakImplHelper1< Ifc > >
+{
+typedef ScVbaCollectionBase< ::cppu::WeakImplHelper1< Ifc > > ImplBase1;
+
+public:
+ CollTestImplHelper( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) throw( css::uno::RuntimeException ) : ImplBase1( xParent, xContext, xIndexAccess ) {}
+};
+
+
+#endif //SC_VBA_COLLECTION_IMPL_HXX
diff --git a/vbahelper/inc/vbahelper/vbadialogbase.hxx b/vbahelper/inc/vbahelper/vbadialogbase.hxx
new file mode 100644
index 0000000000..08bfa5f9fc
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbadialogbase.hxx
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * 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: vbadialog.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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 VBA_DIALOG_BASE_HXX
+#define VBA_DIALOG_BASE_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/XDialogBase.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ov::XDialogBase > VbaDialogBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaDialogBase : public VbaDialogBase_BASE
+{
+protected:
+ sal_Int32 mnIndex;
+ css::uno::Reference< css::frame::XModel > m_xModel;
+public:
+ VbaDialogBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nIndex ):VbaDialogBase_BASE( xParent, xContext ), mnIndex( nIndex ), m_xModel( xModel ) {}
+ virtual ~VbaDialogBase() {}
+
+ // Methods
+ virtual void SAL_CALL Show() throw (css::uno::RuntimeException);
+ virtual rtl::OUString mapIndexToName( sal_Int32 nIndex ) = 0;
+};
+
+#endif /* VBA_DIALOG_BASE_HXX */
diff --git a/vbahelper/inc/vbahelper/vbadialogsbase.hxx b/vbahelper/inc/vbahelper/vbadialogsbase.hxx
new file mode 100644
index 0000000000..43b8ae1f64
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbadialogsbase.hxx
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * 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: vbadialogs.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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 VBA_DIALOGS_BASE_HXX
+#define VBA_DIALOGS_BASE_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/XHelperInterface.hpp>
+#include <ooo/vba/XDialogsBase.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ov::XDialogsBase > VbaDialogsBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaDialogsBase : public VbaDialogsBase_BASE
+{
+protected:
+ css::uno::Reference< css::frame::XModel > m_xModel;
+public:
+ VbaDialogsBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ): VbaDialogsBase_BASE( xParent, xContext ), m_xModel( xModel ) {}
+ virtual ~VbaDialogsBase() {}
+
+ // XCollection
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
+};
+
+#endif /* VBA_DIALOGS_BASE_HXX */
diff --git a/vbahelper/inc/vbahelper/vbadllapi.h b/vbahelper/inc/vbahelper/vbadllapi.h
new file mode 100644
index 0000000000..8d815fc9d5
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbadllapi.h
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * 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: svldllapi.h,v $
+ * $Revision: 1.4 $
+ *
+ * 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 INCLUDED_VBADLLAPI_H
+#define INCLUDED_VBADLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(VBAHELPER_DLLIMPLEMENTATION)
+#define VBAHELPER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define VBAHELPER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define VBAHELPER_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_SVLDLLAPI_H */
+
diff --git a/vbahelper/inc/vbahelper/vbadocumentbase.hxx b/vbahelper/inc/vbahelper/vbadocumentbase.hxx
new file mode 100644
index 0000000000..9042c88e9c
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbadocumentbase.hxx
@@ -0,0 +1,73 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 VBA_DOCUMENTBASE_HXX
+#define VBA_DOCUMENTBASE_HXX
+
+#include <com/sun/star/frame/XModel.hpp>
+#include <ooo/vba/XDocumentBase.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::XDocumentBase > VbaDocumentBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaDocumentBase : public VbaDocumentBase_BASE
+{
+protected:
+ css::uno::Reference< css::frame::XModel > mxModel;
+protected:
+ virtual css::uno::Reference< css::frame::XModel > getModel() { return mxModel; }
+ VbaDocumentBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext);
+public:
+ VbaDocumentBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ css::uno::Reference< css::frame::XModel > xModel );
+ VbaDocumentBase( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext );
+ virtual ~VbaDocumentBase() {}
+
+ // Attributes
+ virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getPath() throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getFullName() throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getSaved() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSaved( sal_Bool bSave ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL Close( const css::uno::Any &bSaveChanges,
+ const css::uno::Any &aFileName,
+ const css::uno::Any &bRouteWorkbook ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Protect( const css::uno::Any & aPassword ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Unprotect( const css::uno::Any &aPassword ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Save() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* VBA_DOCUMENTBASE_HXX */
diff --git a/vbahelper/inc/vbahelper/vbadocumentsbase.hxx b/vbahelper/inc/vbahelper/vbadocumentsbase.hxx
new file mode 100644
index 0000000000..06168b5d1e
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbadocumentsbase.hxx
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile:
+ * $Revision:
+ *
+ * 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 VBA_WORKBOOKS_HXX
+#define VBA_WORKBOOKS_HXX
+
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/XDocumentsBase.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+
+typedef CollTestImplHelper< ooo::vba::XDocumentsBase > VbaDocumentsBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaDocumentsBase : public VbaDocumentsBase_BASE
+{
+public:
+ enum DOCUMENT_TYPE
+ {
+ WORD_DOCUMENT = 1,
+ EXCEL_DOCUMENT
+ };
+
+private:
+ DOCUMENT_TYPE meDocType;
+
+public:
+ VbaDocumentsBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, DOCUMENT_TYPE eDocType ) throw (css::uno::RuntimeException);
+ virtual ~VbaDocumentsBase() {}
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) = 0;
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException) = 0;
+
+ // VbaDocumentsBase_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) = 0;
+
+ // XDocumentsBase
+ virtual css::uno::Any SAL_CALL Add() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Close( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Open( const ::rtl::OUString& Filename, const css::uno::Any& ReadOnly, const css::uno::Sequence< css::beans::PropertyValue >& rProps ) throw (css::uno::RuntimeException);
+};
+
+#endif /* SC_VBA_WORKBOOKS_HXX */
diff --git a/vbahelper/inc/vbahelper/vbafontbase.hxx b/vbahelper/inc/vbahelper/vbafontbase.hxx
new file mode 100644
index 0000000000..2821e38db8
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbafontbase.hxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * 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: vbafont.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 VBAHELPER_FONTBASE_HXX
+#define VBAHELPER_FONTBASE_HXX
+
+#include <cppuhelper/implbase1.hxx>
+
+#include <ooo/vba/XFontBase.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+// use local constants there is no need to expose these constants
+// externally. Looking at the Format->Character dialog it seem that
+// these may infact be even be calculated. Leave hardcoded for now
+// #FIXEME #TBD investigate the code for dialog mentioned above
+
+// The font baseline is not specified.
+const short NORMAL = 0;
+
+// specifies a superscripted.
+const short SUPERSCRIPT = 33;
+
+// specifies a subscripted.
+const short SUBSCRIPT = -33;
+
+// specifies a hight of superscripted font
+ const sal_Int8 SUPERSCRIPTHEIGHT = 58;
+
+// specifies a hight of subscripted font
+const sal_Int8 SUBSCRIPTHEIGHT = 58;
+
+// specifies a hight of normal font
+const short NORMALHEIGHT = 100;
+
+typedef InheritedHelperInterfaceImpl1< ov::XFontBase > VbaFontBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaFontBase : public VbaFontBase_BASE
+{
+protected:
+ css::uno::Reference< css::beans::XPropertySet > mxFont;
+ css::uno::Reference< css::container::XIndexAccess > mxPalette;
+public:
+ VbaFontBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xPalette, css::uno::Reference< css::beans::XPropertySet > xPropertySet ) throw ( css::uno::RuntimeException );
+ virtual ~VbaFontBase();// {}
+
+ // Attributes
+ virtual css::uno::Any SAL_CALL getSize() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSize( const css::uno::Any& _size ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getColorIndex() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setColorIndex( const css::uno::Any& _colorindex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getBold() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setBold( const css::uno::Any& _bold ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getUnderline() throw (css::uno::RuntimeException) = 0;
+ virtual void SAL_CALL setUnderline( const css::uno::Any& _underline ) throw (css::uno::RuntimeException) = 0;
+ virtual css::uno::Any SAL_CALL getStrikethrough() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setStrikethrough( const css::uno::Any& _strikethrough ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getShadow() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setShadow( const css::uno::Any& _shadow ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getItalic() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setItalic( const css::uno::Any& _italic ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getSubscript() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSubscript( const css::uno::Any& _subscript ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getSuperscript() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSuperscript( const css::uno::Any& _superscript ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setName( const css::uno::Any& _name ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getColor() throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL setColor( const css::uno::Any& _color ) throw (css::uno::RuntimeException) ;
+};
+
+#endif
+
diff --git a/vbahelper/inc/vbahelper/vbaglobalbase.hxx b/vbahelper/inc/vbahelper/vbaglobalbase.hxx
new file mode 100644
index 0000000000..d12040decc
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbaglobalbase.hxx
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * 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: vbaapplicationbase.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 VBA_GLOBAL_BASE_HXX
+#define VBA_GLOBAL_BASE_HXX
+
+#include "vbahelperinterface.hxx"
+#include <ooo/vba/XGlobalsBase.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ov::XGlobalsBase > Globals_BASE;
+class VBAHELPER_DLLPUBLIC VbaGlobalsBase : public Globals_BASE
+
+{
+protected:
+
+ bool hasServiceName( const rtl::OUString& serviceName );
+ void init( const css::uno::Sequence< css::beans::PropertyValue >& aInitArgs );
+
+public:
+ VbaGlobalsBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const rtl::OUString& sDocCtxName );
+ virtual ~VbaGlobalsBase(){};
+ // XMultiServiceFactory
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) throw (css::uno::Exception, css::uno::RuntimeException);
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const css::uno::Sequence< css::uno::Any >& Arguments ) throw (css::uno::Exception, css::uno::RuntimeException);
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw (css::uno::RuntimeException);
+};
+#endif
diff --git a/vbahelper/inc/vbahelper/vbahelper.hxx b/vbahelper/inc/vbahelper/vbahelper.hxx
new file mode 100644
index 0000000000..b508404894
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbahelper.hxx
@@ -0,0 +1,231 @@
+/*************************************************************************
+ *
+ * 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: vbahelper.hxx,v $
+ * $Revision: 1.5.32.1 $
+ *
+ * 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 OOVBAAPI_VBA_HELPER_HXX
+#define OOVBAAPI_VBA_HELPER_HXX
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/beans/XIntrospectionAccess.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/script/BasicErrorException.hpp>
+#include <com/sun/star/script/XTypeConverter.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XDevice.hpp>
+#include <basic/sberrors.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+#include <sfx2/dispatch.hxx>
+//#include <ooo/vba/msforms/XShape.hpp>
+#include <vcl/pointr.hxx>
+#define VBAHELPER_DLLIMPLEMENTATION
+#include <vbahelper/vbadllapi.h>
+#include <memory>
+namespace css = ::com::sun::star;
+
+namespace ooo
+{
+ namespace vba
+ {
+ template < class T >
+ css::uno::Reference< T > getXSomethingFromArgs( css::uno::Sequence< css::uno::Any > const & args, sal_Int32 nPos, bool bCanBeNull = true ) throw (css::lang::IllegalArgumentException)
+ {
+ if ( args.getLength() < ( nPos + 1) )
+ throw css::lang::IllegalArgumentException();
+ css::uno::Reference< T > aSomething( args[ nPos ], css::uno::UNO_QUERY );
+ if ( !bCanBeNull && !aSomething.is() )
+ throw css::lang::IllegalArgumentException();
+ return aSomething;
+ }
+ VBAHELPER_DLLPUBLIC SfxObjectShell* getSfxObjShell( const css::uno::Reference< css::frame::XModel >& xModel ) throw ( css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::uno::XInterface > createVBAUnoAPIService( SfxObjectShell* pShell, const sal_Char* _pAsciiName ) throw (css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::uno::XInterface > createVBAUnoAPIServiceWithArgs( SfxObjectShell* pShell, const sal_Char* _pAsciiName, const css::uno::Sequence< css::uno::Any >& aArgs ) throw (css::uno::RuntimeException);
+ css::uno::Reference< css::frame::XModel > getCurrentDoc( const rtl::OUString& sKey ) throw (css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentExcelDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentWordDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::beans::XIntrospectionAccess > getIntrospectionAccess( const css::uno::Any& aObject ) throw (css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::script::XTypeConverter > getTypeConverter( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+
+ VBAHELPER_DLLPUBLIC void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl) ;
+ VBAHELPER_DLLPUBLIC void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl, css::uno::Sequence< css::beans::PropertyValue >& sProps ) ;
+ VBAHELPER_DLLPUBLIC void dispatchExecute(SfxViewShell* pView, USHORT nSlot, SfxCallMode nCall = SFX_CALLMODE_SYNCHRON );
+ VBAHELPER_DLLPUBLIC sal_Int32 OORGBToXLRGB( sal_Int32 );
+ VBAHELPER_DLLPUBLIC sal_Int32 XLRGBToOORGB( sal_Int32 );
+ VBAHELPER_DLLPUBLIC css::uno::Any OORGBToXLRGB( const css::uno::Any& );
+ VBAHELPER_DLLPUBLIC css::uno::Any XLRGBToOORGB( const css::uno::Any& );
+ // provide a NULL object that can be passed as variant so that
+ // the object when passed to IsNull will return true. aNULL
+ // contains an empty object reference
+ VBAHELPER_DLLPUBLIC const css::uno::Any& aNULL();
+ VBAHELPER_DLLPUBLIC void PrintOutHelper( SfxViewShell* pViewShell, const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, sal_Bool bSelection );
+ VBAHELPER_DLLPUBLIC void PrintPreviewHelper( const css::uno::Any& EnableChanges, SfxViewShell* );
+
+ VBAHELPER_DLLPUBLIC rtl::OUString getAnyAsString( const css::uno::Any& pvargItem ) throw ( css::uno::RuntimeException );
+ VBAHELPER_DLLPUBLIC rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike = false); // needs to be in an uno service ( already this code is duplicated in basic )
+ VBAHELPER_DLLPUBLIC double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical);
+ VBAHELPER_DLLPUBLIC double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical);
+ VBAHELPER_DLLPUBLIC double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical);
+ VBAHELPER_DLLPUBLIC sal_Int32 getPointerStyle( const css::uno::Reference< css::frame::XModel >& );
+ VBAHELPER_DLLPUBLIC void setCursorHelper( const css::uno::Reference< css::frame::XModel >& xModel, const Pointer& rPointer, sal_Bool bOverWrite );
+ VBAHELPER_DLLPUBLIC void setDefaultPropByIntrospection( const css::uno::Any& aObj, const css::uno::Any& aValue ) throw ( css::uno::RuntimeException );
+ VBAHELPER_DLLPUBLIC css::uno::Any getPropertyValue( const css::uno::Sequence< css::beans::PropertyValue >& aProp, const rtl::OUString& aName );
+ VBAHELPER_DLLPUBLIC sal_Bool setPropertyValue( css::uno::Sequence< css::beans::PropertyValue >& aProp, const rtl::OUString& aName, const css::uno::Any& aValue );
+
+class VBAHELPER_DLLPUBLIC Millimeter
+{
+//Factor to translate between points and hundredths of millimeters:
+private:
+ static const double factor;
+
+ double m_nMillimeter;
+
+public:
+ Millimeter();
+
+ Millimeter(double mm);
+
+ void set(double mm);
+ void setInPoints(double points) ;
+ void setInHundredthsOfOneMillimeter(double hmm);
+ double get();
+ double getInHundredthsOfOneMillimeter();
+ double getInPoints();
+ static sal_Int32 getInHundredthsOfOneMillimeter(double points);
+ static double getInPoints(int _hmm);
+};
+
+class VBAHELPER_DLLPUBLIC AbstractGeometryAttributes // probably should replace the ShapeHelper below
+{
+public:
+ virtual ~AbstractGeometryAttributes() {}
+ virtual double getLeft() = 0;
+ virtual void setLeft( double ) = 0;
+ virtual double getTop() = 0;
+ virtual void setTop( double ) = 0;
+ virtual double getHeight() = 0;
+ virtual void setHeight( double ) = 0;
+ virtual double getWidth() = 0;
+ virtual void setWidth( double ) = 0;
+};
+
+namespace msforms {
+ class XShape;
+}
+
+class VBAHELPER_DLLPUBLIC ShapeHelper
+{
+protected:
+ css::uno::Reference< css::drawing::XShape > xShape;
+public:
+ ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape) throw (css::script::BasicErrorException );
+
+ double getHeight();
+
+ void setHeight(double _fheight) throw ( css::script::BasicErrorException );
+
+ double getWidth();
+
+ void setWidth(double _fWidth) throw ( css::script::BasicErrorException );
+
+ double getLeft();
+
+ void setLeft(double _fLeft);
+
+ double getTop();
+
+ void setTop(double _fTop);
+};
+
+class VBAHELPER_DLLPUBLIC ConcreteXShapeGeometryAttributes : public AbstractGeometryAttributes
+{
+ std::auto_ptr< ShapeHelper > m_pShapeHelper;
+public:
+ ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape );
+ virtual double getLeft();
+ virtual void setLeft( double nLeft );
+ virtual double getTop();
+ virtual void setTop( double nTop );
+ virtual double getHeight();
+ virtual void setHeight( double nHeight );
+ virtual double getWidth();
+ virtual void setWidth( double nWidth);
+};
+#define VBA_LEFT "PositionX"
+#define VBA_TOP "PositionY"
+class VBAHELPER_DLLPUBLIC UserFormGeometryHelper : public AbstractGeometryAttributes
+{
+
+ css::uno::Reference< css::beans::XPropertySet > mxModel;
+public:
+ UserFormGeometryHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::awt::XControl >& xControl );
+ virtual double getLeft();
+ virtual void setLeft( double nLeft );
+ virtual double getTop();
+ virtual void setTop( double nTop );
+ virtual double getHeight();
+ virtual void setHeight( double nHeight );
+ virtual double getWidth();
+ virtual void setWidth( double nWidth);
+};
+
+class VBAHELPER_DLLPUBLIC ContainerUtilities
+{
+
+public:
+ static rtl::OUString getUniqueName( const css::uno::Sequence< ::rtl::OUString >& _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator);
+ static rtl::OUString getUniqueName( const css::uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix );
+
+ static sal_Int32 FieldInList( const css::uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString );
+};
+
+// really just a a place holder to ease the porting pain
+class VBAHELPER_DLLPUBLIC DebugHelper
+{
+public:
+ static void exception( const rtl::OUString& DetailedMessage, const css::uno::Exception& ex, int err, const rtl::OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException );
+
+ static void exception( int err, const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException );
+
+ static void exception( css::uno::Exception& ex ) throw( css::script::BasicErrorException );
+};
+ } // openoffice
+} // org
+
+namespace ov = ooo::vba;
+
+#ifdef DEBUG
+# define SC_VBA_FIXME(a) OSL_TRACE( a )
+# define SC_VBA_STUB() SC_VBA_FIXME(( "%s - stubbed\n", __FUNCTION__ ))
+#else
+# define SC_VBA_FIXME(a)
+# define SC_VBA_STUB()
+#endif
+
+#endif
diff --git a/vbahelper/inc/vbahelper/vbahelperinterface.hxx b/vbahelper/inc/vbahelper/vbahelperinterface.hxx
new file mode 100644
index 0000000000..0e65c5b131
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbahelperinterface.hxx
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * 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: vbahelperinterface.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 OOVBAAPI_VBA_HELPERINTERFACE_HXX
+#define OOVBAAPI_VBA_HELPERINTERFACE_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/XHelperInterface.hpp>
+#include <vbahelper/vbahelper.hxx>
+#include <com/sun/star/container/XNameAccess.hpp>
+
+// use this class when you have an a object like
+// interface XAnInterface which contains XHelperInterface in its inheritance hierarchy
+// interface XAnInterface
+// {
+// interface XHelperInterface;
+// [attribute, string] name;
+// }
+// or
+// interface XAnInterface : XHelperInterface;
+// {
+// [attribute, string] name;
+// }
+//
+// then this class can provide a default implementation of XHelperInterface,
+// you can use it like this
+// typedef InheritedHelperInterfaceImpl< XAnInterface > > AnInterfaceImpl_BASE;
+// class AnInterfaceImpl : public AnInterfaceImpl_BASE
+// {
+// public:
+// AnInterface( const Reference< HelperInterface >& xParent ) : AnInterfaceImpl_BASE( xParent ) {}
+// // implement XAnInterface methods only, no need to implement the XHelperInterface
+// // methods
+// virtual void setName( const OUString& );
+// virtual OUString getName();
+// }
+//
+const ::rtl::OUString sHelperServiceName( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.HelperServiceBase" ) );
+
+template< typename Ifc1 >
+class VBAHELPER_DLLPUBLIC InheritedHelperInterfaceImpl : public Ifc1
+{
+protected:
+ css::uno::WeakReference< ov::XHelperInterface > mxParent;
+ css::uno::Reference< css::uno::XComponentContext > mxContext;
+public:
+ InheritedHelperInterfaceImpl() {}
+ InheritedHelperInterfaceImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : mxParent( xParent ), mxContext( xContext ) {}
+ virtual rtl::OUString& getServiceImplName() = 0;
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames() = 0;
+
+ // XHelperInterface Methods
+ virtual ::sal_Int32 SAL_CALL getCreator() throw (css::script::BasicErrorException, css::uno::RuntimeException)
+ {
+ return 0x53756E4F;
+ }
+ virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return mxParent; }
+
+ virtual css::uno::Any SAL_CALL Application( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) {
+ // The application could certainly be passed around in the context - seems
+ // to make sense
+ css::uno::Reference< css::container::XNameAccess > xNameAccess( mxContext, css::uno::UNO_QUERY_THROW );
+ return xNameAccess->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Application" ) ) );
+ }
+
+
+ // XServiceInfo Methods
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException) { return getServiceImplName(); }
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< rtl::OUString > sServices = getSupportedServiceNames();
+ const rtl::OUString* pStart = sServices.getConstArray();
+ const rtl::OUString* pEnd = pStart + sServices.getLength();
+ for ( ; pStart != pEnd ; ++pStart )
+ if ( (*pStart).equals( ServiceName ) )
+ return sal_True;
+ return sal_False;
+ }
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< rtl::OUString > aNames = getServiceNames();;
+ return aNames;
+ }
+ };
+
+template< typename Ifc1 >
+class VBAHELPER_DLLPUBLIC InheritedHelperInterfaceImpl1 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > >
+
+{
+typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > > Base;
+public:
+ InheritedHelperInterfaceImpl1< Ifc1 > ( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {}
+
+};
+#endif
diff --git a/vbahelper/inc/vbahelper/vbapagesetupbase.hxx b/vbahelper/inc/vbahelper/vbapagesetupbase.hxx
new file mode 100644
index 0000000000..bc77cd8e58
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbapagesetupbase.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * 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$
+ * $Revision$
+ *
+ * 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 VBA_PAGESETUPBASE_HXX
+#define VBA_PAGESETUPBASE_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/XPageSetupBase.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::XPageSetupBase > VbaPageSetupBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaPageSetupBase : public VbaPageSetupBase_BASE
+{
+protected:
+ css::uno::Reference< css::frame::XModel > mxModel;
+ css::uno::Reference< css::beans::XPropertySet > mxPageProps;
+ sal_Int32 mnOrientLandscape;
+ sal_Int32 mnOrientPortrait;
+
+ VbaPageSetupBase( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+public:
+ virtual ~VbaPageSetupBase(){}
+
+ // Attribute
+ virtual double SAL_CALL getTopMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTopMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getBottomMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setBottomMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getRightMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRightMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getLeftMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLeftMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getHeaderMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeaderMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getFooterMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setFooterMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getOrientation() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (css::uno::RuntimeException);
+};
+#endif
diff --git a/vbahelper/inc/vbahelper/vbapropvalue.hxx b/vbahelper/inc/vbahelper/vbapropvalue.hxx
new file mode 100644
index 0000000000..d56d7992ce
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbapropvalue.hxx
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * 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: vbapropvalue.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_PROPVALULE_HXX
+#define SC_VBA_PROPVALULE_HXX
+#include <ooo/vba/XPropValue.hpp>
+#include <cppuhelper/implbase1.hxx>
+
+#include <vbahelper/vbahelper.hxx>
+
+typedef ::cppu::WeakImplHelper1< ov::XPropValue > PropValueImpl_BASE;
+
+class VBAHELPER_DLLPUBLIC PropListener
+{
+public:
+ virtual void setValueEvent( const css::uno::Any& value ) = 0;
+ virtual css::uno::Any getValueEvent() = 0;
+};
+
+
+class VBAHELPER_DLLPUBLIC ScVbaPropValue : public PropValueImpl_BASE
+{
+ PropListener* m_pListener;
+public:
+ ScVbaPropValue( PropListener* pListener );
+
+ // Attributes
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+
+ rtl::OUString SAL_CALL getDefaultPropertyName() throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+
+};
+#endif //SC_VBA_PROPVALULE_HXX
diff --git a/vbahelper/inc/vbahelper/vbashape.hxx b/vbahelper/inc/vbahelper/vbashape.hxx
new file mode 100644
index 0000000000..e0479ca63e
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbashape.hxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * 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: vbashape.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_SHAPE_HXX
+#define SC_VBA_SHAPE_HXX
+
+#include <ooo/vba/office/MsoShapeType.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <ooo/vba/msforms/XShape.hpp>
+#include <ooo/vba/msforms/XLineFormat.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef ::cppu::WeakImplHelper2< ov::msforms::XShape, css::lang::XEventListener > ListeningShape;
+
+typedef InheritedHelperInterfaceImpl< ListeningShape > ScVbaShape_BASE;
+
+class VBAHELPER_DLLPUBLIC ScVbaShape : public ScVbaShape_BASE
+{
+private:
+protected:
+ std::auto_ptr< ov::ShapeHelper > m_pShapeHelper;
+ css::uno::Reference< css::drawing::XShape > m_xShape;
+ css::uno::Reference< css::drawing::XShapes > m_xShapes;
+ css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
+ sal_Int32 m_nType;
+ css::uno::Reference< css::frame::XModel > m_xModel;
+ css::uno::Any m_aRange;
+ virtual void addListeners();
+ virtual void removeShapeListener() throw( css::uno::RuntimeException );
+ virtual void removeShapesListener() throw( css::uno::RuntimeException );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+public:
+ ScVbaShape( 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< css::drawing::XShapes >& xShapes, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nType ) throw ( css::lang::IllegalArgumentException );
+ ScVbaShape( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::frame::XModel >& xModel ) throw ( css::lang::IllegalArgumentException );
+ virtual ~ScVbaShape();
+ css::uno::Any getRange() { return m_aRange; };
+ void setRange( css::uno::Any aRange ) { m_aRange = aRange; };
+
+ static sal_Int32 getType( const css::uno::Reference< css::drawing::XShape > xShape ) throw (css::uno::RuntimeException);
+
+ // Attributes
+ virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setName( const rtl::OUString& _name ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setWidth( double _width ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getLeft() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLeft( double _left ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getTop() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getZOrderPosition() throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getRotation() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRotation( double _rotation ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XLineFormat > SAL_CALL getLine() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XFillFormat > SAL_CALL getFill() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XPictureFormat > SAL_CALL getPictureFormat() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getLockAspectRatio() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLockAspectRatio( ::sal_Bool _lockaspectratio ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getLockAnchor() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLockAnchor( ::sal_Bool _lockanchor ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRelativeHorizontalPosition() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRelativeHorizontalPosition( ::sal_Int32 _relativehorizontalposition ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRelativeVerticalPosition() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual css::uno::Any SAL_CALL SAL_CALL TextFrame( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL SAL_CALL WrapFormat( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Delete() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ZOrder( sal_Int32 ZOrderCmd ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL IncrementRotation( double Increment ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL IncrementLeft( double Increment ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL IncrementTop( double Increment ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ScaleHeight( double Factor, sal_Bool RelativeToOriginalSize, sal_Int32 Scale ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ScaleWidth( double Factor, sal_Bool RelativeToOriginalSize, sal_Int32 Scale ) throw (css::uno::RuntimeException);
+ // Replace??
+ virtual void SAL_CALL Select( const css::uno::Any& Replace ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL ShapeRange( const css::uno::Any& index ) throw ( css::uno::RuntimeException );
+ // XEventListener
+ virtual void SAL_CALL disposing( const css::lang::EventObject& rEventObject ) throw( css::uno::RuntimeException );
+};
+#endif//SC_VBA_SHAPE_HXX
diff --git a/vbahelper/inc/vbahelper/vbashaperange.hxx b/vbahelper/inc/vbahelper/vbashaperange.hxx
new file mode 100644
index 0000000000..c35eb611f8
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbashaperange.hxx
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * 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: vbashaperange.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_SHAPERANGE_HXX
+#define SC_VBA_SHAPERANGE_HXX
+
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <ooo/vba/msforms/XShapeRange.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/msforms/XLineFormat.hpp>
+#include <ooo/vba/msforms/XFillFormat.hpp>
+
+typedef CollTestImplHelper< ov::msforms::XShapeRange > ScVbaShapeRange_BASE;
+
+class VBAHELPER_DLLPUBLIC ScVbaShapeRange : public ScVbaShapeRange_BASE
+{
+private:
+ css::uno::Reference< css::drawing::XDrawPage > m_xDrawPage;
+ css::uno::Reference< css::drawing::XShapes > m_xShapes;
+ sal_Int32 m_nShapeGroupCount;
+protected:
+ css::uno::Reference< css::frame::XModel > m_xModel;
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ css::uno::Reference< css::drawing::XShapes > getShapes() throw (css::uno::RuntimeException) ;
+public:
+ ScVbaShapeRange( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xShapes, const css::uno::Reference< css::drawing::XDrawPage>& xDrawShape, const css::uno::Reference< css::frame::XModel >& xModel );
+
+ // Methods
+ virtual void SAL_CALL Select( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ::ooo::vba::msforms::XShape > SAL_CALL Group() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL IncrementRotation( double Increment ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL IncrementLeft( double Increment ) throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL IncrementTop( double Increment ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setWidth( double _width ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getLeft() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLeft( double _left ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getTop() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XLineFormat > SAL_CALL getLine() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XFillFormat > SAL_CALL getFill() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getLockAspectRatio() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLockAspectRatio( ::sal_Bool _lockaspectratio ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getLockAnchor() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLockAnchor( ::sal_Bool _lockanchor ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRelativeHorizontalPosition() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRelativeHorizontalPosition( ::sal_Int32 _relativehorizontalposition ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRelativeVerticalPosition() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL SAL_CALL TextFrame( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL SAL_CALL WrapFormat( ) 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);
+ // ScVbaCollectionBaseImpl
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+};
+
+#endif//SC_VBA_SHAPERANGE_HXX
diff --git a/vbahelper/inc/vbahelper/vbashapes.hxx b/vbahelper/inc/vbahelper/vbashapes.hxx
new file mode 100644
index 0000000000..3d520e543c
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbashapes.hxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * 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: vbashapes.hxx,v $
+ * $Revision: 1.3.32.1 $
+ *
+ * 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_SHAPES_HXX
+#define SC_VBA_SHAPES_HXX
+
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <ooo/vba/msforms/XShapes.hpp>
+
+#include <vbahelper/vbahelperinterface.hxx>
+
+#include <vbahelper/vbacollectionimpl.hxx>
+
+typedef CollTestImplHelper< ov::msforms::XShapes > ScVbaShapes_BASE;
+
+class VBAHELPER_DLLPUBLIC ScVbaShapes : public ScVbaShapes_BASE
+{
+private:
+ css::uno::Reference< css::drawing::XShapes > m_xShapes;
+ css::uno::Reference< css::drawing::XDrawPage > m_xDrawPage;
+ sal_Int32 m_nNewShapeCount;
+ void initBaseCollection();
+protected:
+ css::uno::Reference< css::frame::XModel > m_xModel;
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ virtual css::uno::Reference< css::container::XIndexAccess > getShapesByArrayIndices( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
+ css::uno::Reference< css::drawing::XShape > createShape( rtl::OUString service ) throw (css::uno::RuntimeException);
+ css::uno::Any AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, css::uno::Any aRange ) throw (css::uno::RuntimeException);
+ css::uno::Any AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, css::uno::Any aRange ) throw (css::uno::RuntimeException);
+ css::uno::Any AddTextboxInWriter( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (css::uno::RuntimeException);
+ rtl::OUString createName( rtl::OUString sName );
+ css::uno::Any AddShape( const rtl::OUString& sService, const rtl::OUString& sName, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (css::uno::RuntimeException);
+ //TODO helperapi using a writer document
+ //css::awt::Point calculateTopLeftMargin( css::uno::Reference< ov::XHelperInterface > xDocument );
+
+public:
+ ScVbaShapes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess > xShapes, const css::uno::Reference< css::frame::XModel >& xModel );
+ static void setDefaultShapeProperties( css::uno::Reference< css::drawing::XShape > xShape ) throw (css::uno::RuntimeException);
+ static void setShape_NameProperty( css::uno::Reference< css::drawing::XShape > xShape, rtl::OUString sName );
+ //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 void SAL_CALL SelectAll() throw (css::uno::RuntimeException);
+ //helper::calc
+ virtual css::uno::Any SAL_CALL AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_Int32 endY ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL AddShape( sal_Int32 _nType, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL AddTextbox( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XShapeRange > SAL_CALL Range( const css::uno::Any& shapes ) throw (css::uno::RuntimeException);
+ // ScVbaCollectionBaseImpl
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& Index2 ) throw (css::uno::RuntimeException);
+};
+
+#endif//SC_VBA_SHAPES_HXX
diff --git a/vbahelper/inc/vbahelper/vbatextframe.hxx b/vbahelper/inc/vbahelper/vbatextframe.hxx
new file mode 100644
index 0000000000..0b7d9ec272
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbatextframe.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * 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: vbatextframe.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 VBA_TEXTFRAME_HXX
+#define VBA_TEXTFRAME_HXX
+#include <ooo/vba/msforms/XTextFrame.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::msforms::XTextFrame > VbaTextFrame_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaTextFrame : public VbaTextFrame_BASE
+{
+protected:
+ css::uno::Reference< css::drawing::XShape > m_xShape;
+ css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
+protected:
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ virtual void setAsMSObehavior();
+ sal_Int32 getMargin( rtl::OUString sMarginType );
+ void setMargin( rtl::OUString sMarginType, float fMargin );
+public:
+ VbaTextFrame( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext , css::uno::Reference< css::drawing::XShape > xShape);
+ virtual ~VbaTextFrame() {}
+ // Attributes
+ virtual sal_Bool SAL_CALL getAutoSize() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setAutoSize( sal_Bool _autosize ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getMarginBottom() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMarginBottom( float _marginbottom ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getMarginTop() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMarginTop( float _margintop ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getMarginLeft() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMarginLeft( float _marginleft ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getMarginRight() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMarginRight( float _marginright ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual css::uno::Any SAL_CALL Characters( ) throw (css::uno::RuntimeException);
+
+};
+
+#endif//SC_VBA_TEXTFRAME_HXX
diff --git a/vbahelper/inc/vbahelper/vbawindowbase.hxx b/vbahelper/inc/vbahelper/vbawindowbase.hxx
new file mode 100644
index 0000000000..a9ee0e2d02
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbawindowbase.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 VBA_WINDOWBASE_HXX
+#define VBA_WINDOWBASE_HXX
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/XWindowBase.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/awt/XDevice.hpp>
+
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1<ov::XWindowBase > WindowBaseImpl_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaWindowBase : public WindowBaseImpl_BASE
+{
+protected:
+ css::uno::Reference< css::frame::XModel > m_xModel;
+public:
+ VbaWindowBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel );
+ VbaWindowBase( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext > const& xContext );
+
+ // XWindowBase
+ virtual sal_Int32 SAL_CALL getHeight() throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL setHeight( sal_Int32 _height ) throw (css::uno::RuntimeException) ;
+ virtual sal_Int32 SAL_CALL getLeft() throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL setLeft( sal_Int32 _left ) throw (css::uno::RuntimeException) ;
+ virtual sal_Int32 SAL_CALL getTop() throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL setTop( sal_Int32 _top ) throw (css::uno::RuntimeException) ;
+ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getWidth() throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL setWidth( sal_Int32 _width ) throw (css::uno::RuntimeException) ;
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif //VBA_WINDOWBASE_HXX
diff --git a/vbahelper/prj/build.lst b/vbahelper/prj/build.lst
new file mode 100644
index 0000000000..a38a6dcbd6
--- /dev/null
+++ b/vbahelper/prj/build.lst
@@ -0,0 +1,6 @@
+vba vbahelper : oovbaapi basic sfx2 svx cppuhelper vcl comphelper svtools tools sal NULL
+vba vbahelper usr1 - all vba_mkout NULL
+#vba vbahelper\inc nmake - all vba_inc NULL
+vba vbahelper\source\vbahelper nmake - all vba_vbahelper NULL
+vba vbahelper\source\msforms nmake - all vba_msforms NULL
+vba vbahelper\util nmake - all vba_util vba_vbahelper vba_msforms NULL
diff --git a/vbahelper/prj/d.lst b/vbahelper/prj/d.lst
new file mode 100644
index 0000000000..d7b61d1e5a
--- /dev/null
+++ b/vbahelper/prj/d.lst
@@ -0,0 +1,27 @@
+..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%
+..\%__SRC%\lib\lib*.dylib %_DEST%\lib%_EXT%
+..\%__SRC%\lib\ivbahelper.lib %_DEST%\lib%_EXT%\vbahelper.lib
+..\%__SRC%\lib\vbahelp*.* %_DEST%\lib%_EXT%\vba*.*
+..\%__SRC%\bin\vbahelper*.* %_DEST%\bin%_EXT%\vbahelper*.*
+..\%__SRC%\bin\msforms*.* %_DEST%\bin%_EXT%\msforms*.*
+
+mkdir: %_DEST%\inc%_EXT%\basic
+..\inc\vbahelper\vbacollectionimpl.hxx %_DEST%\inc%_EXT%\vbahelper\vbacollectionimpl.hxx
+..\inc\vbahelper\vbahelper.hxx %_DEST%\inc%_EXT%\vbahelper\vbahelper.hxx
+..\inc\vbahelper\helperdecl.hxx %_DEST%\inc%_EXT%\vbahelper\helperdecl.hxx
+..\inc\vbahelper\vbahelperinterface.hxx %_DEST%\inc%_EXT%\vbahelper\vbahelperinterface.hxx
+..\inc\vbahelper\vbaapplicationbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbaapplicationbase.hxx
+..\inc\vbahelper\vbafontbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbafontbase.hxx
+..\inc\vbahelper\vbadllapi.h %_DEST%\inc%_EXT%\vbahelper\vbadllapi.h
+..\inc\vbahelper\vbawindowbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbawindowbase.hxx
+..\inc\vbahelper\vbadocumentbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbadocumentbase.hxx
+..\inc\vbahelper\vbadocumentsbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbadocumentsbase.hxx
+..\inc\vbahelper\vbapropvalue.hxx %_DEST%\inc%_EXT%\vbahelper\vbapropvalue.hxx
+..\inc\vbahelper\vbaglobalbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbaglobalbase.hxx
+..\inc\vbahelper\vbadialogbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbadialogbase.hxx
+..\inc\vbahelper\vbadialogsbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbadialogsbase.hxx
+..\inc\vbahelper\vbashape.hxx %_DEST%\inc%_EXT%\vbahelper\vbashape.hxx
+..\inc\vbahelper\vbashapes.hxx %_DEST%\inc%_EXT%\vbahelper\vbashapes.hxx
+..\inc\vbahelper\vbatextframe.hxx %_DEST%\inc%_EXT%\vbahelper\vbatextframe.hxx
+..\inc\vbahelper\vbashaperange.hxx %_DEST%\inc%_EXT%\vbahelper\vbashaperange.hxx
+..\inc\vbahelper\vbapagesetupbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbapagesetupbase.hxx
diff --git a/vbahelper/source/msforms/makefile.mk b/vbahelper/source/msforms/makefile.mk
new file mode 100644
index 0000000000..1d550c8409
--- /dev/null
+++ b/vbahelper/source/msforms/makefile.mk
@@ -0,0 +1,79 @@
+#*************************************************************************
+#
+# 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: makefile.mk,v $
+#
+# $Revision: 1.45 $
+#
+# 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.
+#
+#*************************************************************************
+
+PRJ=..$/..
+PRJNAME=vbahelper
+TARGET=msforms
+
+ENABLE_EXCEPTIONS=TRUE
+VISIBILITY_HIDDEN=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+SLOFILES=\
+ $(SLO)$/vbacontrol.obj \
+ $(SLO)$/vbacontrols.obj \
+ $(SLO)$/vbabutton.obj \
+ $(SLO)$/vbacombobox.obj \
+ $(SLO)$/vbalabel.obj \
+ $(SLO)$/vbatextbox.obj \
+ $(SLO)$/vbaradiobutton.obj \
+ $(SLO)$/vbalistbox.obj \
+ $(SLO)$/vbatogglebutton.obj \
+ $(SLO)$/vbacheckbox.obj \
+ $(SLO)$/vbaframe.obj \
+ $(SLO)$/vbascrollbar.obj \
+ $(SLO)$/vbaprogressbar.obj \
+ $(SLO)$/vbamultipage.obj \
+ $(SLO)$/vbalistcontrolhelper.obj \
+ $(SLO)$/vbaspinbutton.obj \
+ $(SLO)$/vbaimage.obj \
+ $(SLO)$/vbapages.obj \
+ $(SLO)$/vbauserform.obj \
+ $(SLO)$/service.obj \
+
+# #FIXME vbapropvalue needs to move to vbahelper
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+ALLTAR : \
+ $(MISC)$/$(TARGET).don \
+
+$(SLOFILES) : $(MISC)$/$(TARGET).don
+
+$(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+ +$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
+ echo $@
+
diff --git a/vbahelper/source/msforms/service.cxx b/vbahelper/source/msforms/service.cxx
new file mode 100644
index 0000000000..b91cc9a30f
--- /dev/null
+++ b/vbahelper/source/msforms/service.cxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * 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: service.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "cppuhelper/implementationentry.hxx"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/registry/XRegistryKey.hpp"
+#include "comphelper/servicedecl.hxx"
+
+// =============================================================================
+// component exports
+// =============================================================================
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+namespace sdecl = comphelper::service_decl;
+
+// reference service helper(s)
+namespace controlprovider
+{
+extern sdecl::ServiceDecl const serviceDecl;
+}
+
+namespace userform
+{
+extern sdecl::ServiceDecl const serviceDecl;
+}
+
+extern "C"
+{
+ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
+ const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
+ {
+ OSL_TRACE("In component_getImplementationEnv");
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+ }
+
+ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
+ {
+ OSL_TRACE("In component_writeInfo");
+
+ // Component registration
+ return component_writeInfoHelper( pServiceManager, pRegistryKey,
+ controlprovider::serviceDecl, userform::serviceDecl );
+ }
+
+ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
+ registry::XRegistryKey * pRegistryKey )
+ {
+ OSL_TRACE("In component_getFactory for %s", pImplName );
+ void* pRet = component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, controlprovider::serviceDecl, userform::serviceDecl );
+ OSL_TRACE("Ret is 0x%x", pRet);
+ return pRet;
+ }
+}
diff --git a/vbahelper/source/msforms/vbabutton.cxx b/vbahelper/source/msforms/vbabutton.cxx
new file mode 100644
index 0000000000..51641e2d06
--- /dev/null
+++ b/vbahelper/source/msforms/vbabutton.cxx
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * 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: vbabutton.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 "vbabutton.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+ScVbaButton::ScVbaButton( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+}
+
+// Attributes
+rtl::OUString SAL_CALL
+ScVbaButton::getCaption() throw (css::uno::RuntimeException)
+{
+ rtl::OUString Label;
+ m_xProps->getPropertyValue( LABEL ) >>= Label;
+ return Label;
+}
+
+void SAL_CALL
+ScVbaButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+}
+
+rtl::OUString&
+ScVbaButton::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaButton") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaButton::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Button" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbabutton.hxx b/vbahelper/source/msforms/vbabutton.hxx
new file mode 100644
index 0000000000..818f245645
--- /dev/null
+++ b/vbahelper/source/msforms/vbabutton.hxx
@@ -0,0 +1,51 @@
+/*************************************************************************
+ *
+ * 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: vbabutton.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_BUTTON_HXX
+#define SC_VBA_BUTTON_HXX
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/msforms/XButton.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+
+typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XButton > ButtonImpl_BASE;
+
+class ScVbaButton : public ButtonImpl_BASE
+{
+public:
+ ScVbaButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+ // Attributes
+ virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif //SC_VBA_BUTTON_HXX
diff --git a/vbahelper/source/msforms/vbacheckbox.cxx b/vbahelper/source/msforms/vbacheckbox.cxx
new file mode 100644
index 0000000000..e8df157811
--- /dev/null
+++ b/vbahelper/source/msforms/vbacheckbox.cxx
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbacheckbox.hxx"
+#include <vbahelper/helperdecl.hxx>
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") );
+ScVbaCheckbox::ScVbaCheckbox( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : CheckBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+}
+
+// Attributes
+rtl::OUString SAL_CALL
+ScVbaCheckbox::getCaption() throw (css::uno::RuntimeException)
+{
+ rtl::OUString Label;
+ m_xProps->getPropertyValue( LABEL ) >>= Label;
+ return Label;
+}
+
+void SAL_CALL
+ScVbaCheckbox::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+}
+
+uno::Any SAL_CALL
+ScVbaCheckbox::getValue() throw (css::uno::RuntimeException)
+{
+ sal_Int16 nValue = -1;
+ m_xProps->getPropertyValue( STATE ) >>= nValue;
+ if( nValue != 0 )
+ nValue = -1;
+// return uno::makeAny( nValue );
+// I must be missing something MSO says value should be -1 if selected, 0 if not
+// selected
+ return uno::makeAny( ( nValue == -1 ) ? sal_True : sal_False );
+}
+
+void SAL_CALL
+ScVbaCheckbox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeException)
+{
+ sal_Int16 nValue = 0;
+ sal_Bool bValue = false;
+ if( _value >>= nValue )
+ {
+ if( nValue == -1)
+ nValue = 1;
+ }
+ else if ( _value >>= bValue )
+ {
+ if ( bValue )
+ nValue = 1;
+ }
+ m_xProps->setPropertyValue( STATE, uno::makeAny( nValue ) );
+}
+rtl::OUString&
+ScVbaCheckbox::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCheckbox") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaCheckbox::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.CheckBox" ) );
+ }
+ return aServiceNames;
+}
+
diff --git a/vbahelper/source/msforms/vbacheckbox.hxx b/vbahelper/source/msforms/vbacheckbox.hxx
new file mode 100644
index 0000000000..f3374db011
--- /dev/null
+++ b/vbahelper/source/msforms/vbacheckbox.hxx
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_CHECKBOX_HXX
+#define SC_VBA_CHECKBOX_HXX
+#include <cppuhelper/implbase2.hxx>
+#include <ooo/vba/msforms/XRadioButton.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+
+typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XRadioButton, css::script::XDefaultProperty > CheckBoxImpl_BASE;
+
+class ScVbaCheckbox : public CheckBoxImpl_BASE
+{
+public:
+ ScVbaCheckbox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+ // Attributes
+ virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ // XDefaultProperty
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif //SC_VBA_CHECKBOX_HXX
diff --git a/vbahelper/source/msforms/vbacombobox.cxx b/vbahelper/source/msforms/vbacombobox.cxx
new file mode 100644
index 0000000000..9824358ac6
--- /dev/null
+++ b/vbahelper/source/msforms/vbacombobox.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * 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: vbacombobox.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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 "vbacombobox.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+//SelectedItems list of integer indexes
+//StringItemList list of items
+
+const static rtl::OUString TEXT( RTL_CONSTASCII_USTRINGPARAM("Text") );
+const static rtl::OUString SELECTEDITEMS( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") );
+const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") );
+const static rtl::OUString CONTROLSOURCEPROP( RTL_CONSTASCII_USTRINGPARAM("DataFieldProperty") );
+
+ScVbaComboBox::ScVbaComboBox( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper, bool bDialogType ) : ComboBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ), mbDialogType( bDialogType )
+{
+ mpListHelper.reset( new ListControlHelper( m_xProps ) );
+ // grab the default value property name
+ m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
+}
+
+// Attributes
+
+
+// Value, [read] e.g. getValue returns the value of ooo Text propery e.g. the value in
+// the drop down
+uno::Any SAL_CALL
+ScVbaComboBox::getValue() throw (uno::RuntimeException)
+{
+ return m_xProps->getPropertyValue( sSourceName );
+}
+
+void SAL_CALL
+ScVbaComboBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeException)
+{
+ sal_Int16 nIndex = 0;
+ if( _value >>= nIndex )
+ {
+ uno::Sequence< rtl::OUString > sItems;
+ m_xProps->getPropertyValue( ITEMS ) >>= sItems;
+ if( ( nIndex >= 0 ) && ( sItems.getLength() > nIndex ) )
+ {
+ rtl::OUString sText = sItems[ nIndex ];
+ m_xProps->setPropertyValue( TEXT, uno::makeAny( sText ) );
+ }
+ }
+}
+
+uno::Any SAL_CALL
+ScVbaComboBox::getListIndex() throw (uno::RuntimeException)
+{
+ uno::Sequence< rtl::OUString > sItems;
+ m_xProps->getPropertyValue( ITEMS ) >>= sItems;
+ // should really return the item that has focus regardless of
+ // it been selected
+ if ( sItems.getLength() > 0 )
+ {
+ rtl::OUString sText = getText();
+ sal_Int32 nLen = sItems.getLength();
+ for ( sal_Int32 index = 0; sText.getLength() && index < nLen; ++index )
+ {
+ if ( sItems[ index ].equals( sText ) )
+ {
+ OSL_TRACE("getListIndex returning %d", index );
+ return uno::makeAny( index );
+ }
+
+ }
+ }
+ OSL_TRACE("getListIndex returning %d", -1 );
+ return uno::makeAny( sal_Int32( -1 ) );
+}
+
+// Value, [write]e.g. setValue sets the value in the drop down, and if the value is one
+// of the values in the list then the selection is also set
+void SAL_CALL
+ScVbaComboBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( sSourceName, _value );
+}
+
+// see Value
+
+::rtl::OUString SAL_CALL
+ScVbaComboBox::getText() throw (uno::RuntimeException)
+{
+ rtl::OUString result;
+ getValue() >>= result;
+ return result;
+}
+
+void SAL_CALL
+ScVbaComboBox::setText( const ::rtl::OUString& _text ) throw (uno::RuntimeException)
+{
+ setValue( uno::makeAny( _text ) ); // seems the same
+}
+
+// Methods
+void SAL_CALL
+ScVbaComboBox::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) throw (uno::RuntimeException)
+{
+ mpListHelper->AddItem( pvargItem, pvargIndex );
+}
+
+void SAL_CALL
+ScVbaComboBox::removeItem( const uno::Any& index ) throw (uno::RuntimeException)
+ {
+ mpListHelper->removeItem( index );
+}
+
+void SAL_CALL
+ScVbaComboBox::Clear( ) throw (uno::RuntimeException)
+ {
+ mpListHelper->Clear();
+ }
+
+void SAL_CALL
+ScVbaComboBox::setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException)
+{
+ ScVbaControl::setRowSource( _rowsource );
+ mpListHelper->setRowSource( _rowsource );
+ }
+
+sal_Int32 SAL_CALL
+ScVbaComboBox::getListCount() throw (uno::RuntimeException)
+{
+ return mpListHelper->getListCount();
+}
+
+uno::Any SAL_CALL
+ScVbaComboBox::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn ) throw (uno::RuntimeException)
+{
+ return mpListHelper->List( pvargIndex, pvarColumn );
+ }
+
+rtl::OUString&
+ScVbaComboBox::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaComboBox") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaComboBox::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ComboBox" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbacombobox.hxx b/vbahelper/source/msforms/vbacombobox.hxx
new file mode 100644
index 0000000000..05aa433aa2
--- /dev/null
+++ b/vbahelper/source/msforms/vbacombobox.hxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * 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: vbacombobox.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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_COMBOBOX_HXX
+#define SC_VBA_COMBOBOX_HXX
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/script/XDefaultProperty.hpp>
+#include <ooo/vba/msforms/XComboBox.hpp>
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/propertycontainer.hxx>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+
+#include "vbacontrol.hxx"
+#include "vbalistcontrolhelper.hxx"
+#include <vbahelper/vbahelper.hxx>
+
+typedef cppu::ImplInheritanceHelper2<ScVbaControl, ov::msforms::XComboBox, css::script::XDefaultProperty > ComboBoxImpl_BASE;
+class ScVbaComboBox : public ComboBoxImpl_BASE
+{
+ std::auto_ptr< ListControlHelper > mpListHelper;
+ rtl::OUString sSourceName;
+ rtl::OUString msDftPropName;
+ bool mbDialogType;
+
+public:
+ ScVbaComboBox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper, bool bDialogType = false );
+
+ // Attributes
+ virtual css::uno::Any SAL_CALL getListIndex() throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getListCount() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setListIndex( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Clear( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL List( const css::uno::Any& pvargIndex, const css::uno::Any& pvarColumn ) throw (css::uno::RuntimeException);
+ // XControl
+ virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
+
+ // XDefaultProperty
+ ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif //
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
new file mode 100644
index 0000000000..54a4345cbd
--- /dev/null
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -0,0 +1,539 @@
+/*************************************************************************
+ *
+ * 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: vbacontrol.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 <com/sun/star/form/FormComponentType.hpp>
+#include <com/sun/star/awt/XControlModel.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XWindow2.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XControlShape.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/view/XControlAccess.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/form/binding/XBindableValue.hpp>
+#include <com/sun/star/form/binding/XListEntrySink.hpp>
+#include <com/sun/star/table/CellAddress.hpp>
+#include <com/sun/star/table/CellRangeAddress.hpp>
+#include <ooo/vba/XControlProvider.hpp>
+#ifdef VBA_OOBUILD_HACK
+#include <svtools/bindablecontrolhelper.hxx>
+#endif
+#include"vbacontrol.hxx"
+#include"vbacombobox.hxx"
+#include "vbabutton.hxx"
+#include "vbalabel.hxx"
+#include "vbatextbox.hxx"
+#include "vbaradiobutton.hxx"
+#include "vbalistbox.hxx"
+#include "vbatogglebutton.hxx"
+#include "vbacheckbox.hxx"
+#include "vbaframe.hxx"
+#include "vbascrollbar.hxx"
+#include "vbaprogressbar.hxx"
+#include "vbamultipage.hxx"
+#include "vbaspinbutton.hxx"
+#include "vbaimage.hxx"
+#include <vbahelper/helperdecl.hxx>
+
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+uno::Reference< css::awt::XWindowPeer >
+ScVbaControl::getWindowPeer() throw (uno::RuntimeException)
+{
+ uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY );
+
+ uno::Reference< awt::XControlModel > xControlModel;
+ uno::Reference< css::awt::XWindowPeer > xWinPeer;
+ if ( !xControlShape.is() )
+ {
+ // would seem to be a Userform control
+ uno::Reference< awt::XControl > xControl( m_xControl, uno::UNO_QUERY_THROW );
+ xWinPeer = xControl->getPeer();
+ return xWinPeer;
+ }
+ // form control
+ xControlModel.set( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+
+ uno::Reference< view::XControlAccess > xControlAccess( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ try
+ {
+ uno::Reference< awt::XControl > xControl( xControlAccess->getControl( xControlModel ), uno::UNO_QUERY );
+ xWinPeer = xControl->getPeer();
+ }
+ catch( uno::Exception )
+ {
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "The Control does not exsit" ),
+ uno::Reference< uno::XInterface >() );
+ }
+ return xWinPeer;
+}
+
+//ScVbaControlListener
+class ScVbaControlListener: public cppu::WeakImplHelper1< lang::XEventListener >
+{
+private:
+ ScVbaControl *pControl;
+public:
+ ScVbaControlListener( ScVbaControl *pTmpControl );
+ virtual ~ScVbaControlListener();
+ virtual void SAL_CALL disposing( const lang::EventObject& rEventObject ) throw( uno::RuntimeException );
+};
+
+ScVbaControlListener::ScVbaControlListener( ScVbaControl *pTmpControl ): pControl( pTmpControl )
+{
+}
+
+ScVbaControlListener::~ScVbaControlListener()
+{
+}
+
+void SAL_CALL
+ScVbaControlListener::disposing( const lang::EventObject& ) throw( uno::RuntimeException )
+{
+ if( pControl )
+ {
+ pControl->removeResouce();
+ pControl = NULL;
+ }
+}
+
+//ScVbaControl
+
+ScVbaControl::ScVbaControl( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ControlImpl_BASE( xParent, xContext ), m_xControl( xControl ), m_xModel( xModel )
+{
+ //add listener
+ m_xEventListener.set( new ScVbaControlListener( this ) );
+ setGeometryHelper( pGeomHelper );
+ uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
+ xComponent->addEventListener( m_xEventListener );
+
+ //init m_xProps
+ uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY ) ;
+ uno::Reference< awt::XControl> xUserFormControl( m_xControl, uno::UNO_QUERY ) ;
+ if ( xControlShape.is() ) // form control
+ m_xProps.set( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+ else if ( xUserFormControl.is() ) // userform control
+ m_xProps.set( xUserFormControl->getModel(), uno::UNO_QUERY_THROW );
+}
+
+ScVbaControl::~ScVbaControl()
+{
+ if( m_xControl.is() )
+{
+ uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
+ xComponent->removeEventListener( m_xEventListener );
+}
+}
+
+void
+ScVbaControl::setGeometryHelper( AbstractGeometryAttributes* pHelper )
+{
+ mpGeometryHelper.reset( pHelper );
+}
+
+void ScVbaControl::removeResouce() throw( uno::RuntimeException )
+{
+ uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
+ xComponent->removeEventListener( m_xEventListener );
+ m_xControl= NULL;
+ m_xProps = NULL;
+}
+
+//In design model has different behavior
+sal_Bool SAL_CALL ScVbaControl::getEnabled() throw (uno::RuntimeException)
+{
+ uno::Any aValue = m_xProps->getPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) ) );
+ sal_Bool bRet = false;
+ aValue >>= bRet;
+ return bRet;
+}
+
+void SAL_CALL ScVbaControl::setEnabled( sal_Bool bVisible ) throw (uno::RuntimeException)
+{
+ uno::Any aValue( bVisible );
+ m_xProps->setPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) ), aValue);
+
+}
+
+sal_Bool SAL_CALL ScVbaControl::getVisible() throw (uno::RuntimeException)
+{
+ sal_Bool bVisible( sal_True );
+ m_xProps->getPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableVisible" ) )) >>= bVisible;
+ return bVisible;
+}
+
+void SAL_CALL ScVbaControl::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
+{
+ uno::Any aValue( bVisible );
+ m_xProps->setPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableVisible" ) ), aValue);
+}
+double SAL_CALL ScVbaControl::getHeight() throw (uno::RuntimeException)
+{
+ return mpGeometryHelper->getHeight();
+}
+void SAL_CALL ScVbaControl::setHeight( double _height ) throw (uno::RuntimeException)
+{
+ mpGeometryHelper->setHeight( _height );
+}
+
+double SAL_CALL ScVbaControl::getWidth() throw (uno::RuntimeException)
+{
+ return mpGeometryHelper->getWidth();
+}
+void SAL_CALL ScVbaControl::setWidth( double _width ) throw (uno::RuntimeException)
+{
+ mpGeometryHelper->setWidth( _width );
+}
+
+double SAL_CALL
+ScVbaControl::getLeft() throw (uno::RuntimeException)
+{
+ return mpGeometryHelper->getLeft();
+}
+
+void SAL_CALL
+ScVbaControl::setLeft( double _left ) throw (uno::RuntimeException)
+{
+ mpGeometryHelper->setLeft( _left );
+
+}
+
+double SAL_CALL
+ScVbaControl::getTop() throw (uno::RuntimeException)
+{
+ return mpGeometryHelper->getTop();
+}
+
+void SAL_CALL
+ScVbaControl::setTop( double _top ) throw (uno::RuntimeException)
+{
+ mpGeometryHelper->setTop( _top );
+}
+
+uno::Reference< uno::XInterface > SAL_CALL
+ScVbaControl::getObject() throw (uno::RuntimeException)
+{
+ uno::Reference< msforms::XControl > xRet( this );
+ return xRet;
+}
+
+void SAL_CALL ScVbaControl::SetFocus() throw (uno::RuntimeException)
+{
+ uno::Reference< awt::XWindow > xWin( m_xControl, uno::UNO_QUERY_THROW );
+ xWin->setFocus();
+}
+
+rtl::OUString SAL_CALL
+ScVbaControl::getControlSource() throw (uno::RuntimeException)
+{
+// #FIXME I *hate* having these upstream differences
+// but this is necessary until I manage to upstream other
+// dependant parts
+#ifdef VBA_OOBUILD_HACK
+ rtl::OUString sControlSource;
+ uno::Reference< form::binding::XBindableValue > xBindable( m_xProps, uno::UNO_QUERY );
+ if ( xBindable.is() )
+ {
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFac( m_xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.table.CellAddressConversion" ))), uno::UNO_QUERY );
+ uno::Reference< beans::XPropertySet > xProps( xBindable->getValueBinding(), uno::UNO_QUERY_THROW );
+ table::CellAddress aAddress;
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BoundCell") ) ) >>= aAddress;
+ xConvertor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Address") ), uno::makeAny( aAddress ) );
+ xConvertor->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("XL_A1_Representation") ) ) >>= sControlSource;
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ return sControlSource;
+#else
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("getControlSource not supported") ), uno::Reference< uno::XInterface >()); // not supported
+#endif
+}
+
+void SAL_CALL
+ScVbaControl::setControlSource( const rtl::OUString& _controlsource ) throw (uno::RuntimeException)
+{
+#ifdef VBA_OOBUILD_HACK
+ rtl::OUString sEmpty;
+ svt::BindableControlHelper::ApplyListSourceAndBindableData( m_xModel, m_xProps, _controlsource, sEmpty );
+#else
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("setControlSource not supported ") ).concat( _controlsource ), uno::Reference< uno::XInterface >()); // not supported
+#endif
+}
+
+rtl::OUString SAL_CALL
+ScVbaControl::getRowSource() throw (uno::RuntimeException)
+{
+#ifdef VBA_OOBUILD_HACK
+ rtl::OUString sRowSource;
+ uno::Reference< form::binding::XListEntrySink > xListSink( m_xProps, uno::UNO_QUERY );
+ if ( xListSink.is() )
+ {
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFac( m_xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.table.CellRangeAddressConversion" ))), uno::UNO_QUERY );
+
+ uno::Reference< beans::XPropertySet > xProps( xListSink->getListEntrySource(), uno::UNO_QUERY_THROW );
+ table::CellRangeAddress aAddress;
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellRange") ) ) >>= aAddress;
+ xConvertor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Address")), uno::makeAny( aAddress ) );
+ xConvertor->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("XL_A1_Representation") ) ) >>= sRowSource;
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ return sRowSource;
+#else
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("getRowSource not supported") ), uno::Reference< uno::XInterface >()); // not supported
+#endif
+}
+
+void SAL_CALL
+ScVbaControl::setRowSource( const rtl::OUString& _rowsource ) throw (uno::RuntimeException)
+{
+#ifdef VBA_OOBUILD_HACK
+ rtl::OUString sEmpty;
+ svt::BindableControlHelper::ApplyListSourceAndBindableData( m_xModel, m_xProps, sEmpty, _rowsource );
+#else
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("setRowSource not supported ") ).concat( _rowsource ), uno::Reference< uno::XInterface >()); // not supported
+#endif
+}
+
+rtl::OUString SAL_CALL
+ScVbaControl::getName() throw (uno::RuntimeException)
+{
+ rtl::OUString sName;
+ m_xProps->getPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= sName;
+ return sName;
+
+}
+
+void SAL_CALL
+ScVbaControl::setName( const rtl::OUString& _name ) throw (uno::RuntimeException)
+{
+ m_xProps->setPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ), uno::makeAny( _name ) );
+ }
+
+rtl::OUString SAL_CALL
+ScVbaControl::getControlTipText() throw (css::uno::RuntimeException)
+{
+ rtl::OUString sName;
+ m_xProps->getPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) ) ) >>= sName;
+ return sName;
+}
+
+void SAL_CALL
+ScVbaControl::setControlTipText( const rtl::OUString& rsToolTip ) throw (css::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) ), uno::makeAny( rsToolTip ) );
+}
+//ScVbaControlFactory
+
+ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel ): m_xContext( xContext ), m_xControl( xControl ), m_xModel( xModel )
+{
+}
+
+ScVbaControl* ScVbaControlFactory::createControl() throw (uno::RuntimeException)
+{
+ return createControl( m_xModel );
+}
+ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< uno::XInterface >& xParent ) throw (uno::RuntimeException)
+{
+ uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY );
+ if ( xControlShape.is() ) // form controls
+ return createControl( xControlShape, xParent );
+ uno::Reference< awt::XControl > xControl( m_xControl, uno::UNO_QUERY );
+ if ( !xControl.is() )
+ throw uno::RuntimeException(); // really we should be more informative
+ return createControl( xControl, xParent );
+
+}
+
+ScVbaControl* ScVbaControlFactory::createControl(const uno::Reference< drawing::XControlShape >& xControlShape, const uno::Reference< uno::XInterface >& /*xParent*/ ) throw (uno::RuntimeException)
+{
+ uno::Reference< beans::XPropertySet > xProps( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+ sal_Int32 nClassId = -1;
+ const static rtl::OUString sClassId( RTL_CONSTASCII_USTRINGPARAM("ClassId") );
+ xProps->getPropertyValue( sClassId ) >>= nClassId;
+ uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess
+ switch( nClassId )
+ {
+ case form::FormComponentType::COMBOBOX:
+ return new ScVbaComboBox( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::COMMANDBUTTON:
+ return new ScVbaButton( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::FIXEDTEXT:
+ return new ScVbaLabel( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::TEXTFIELD:
+ return new ScVbaTextBox( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::RADIOBUTTON:
+ return new ScVbaRadioButton( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::LISTBOX:
+ return new ScVbaListBox( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::SPINBUTTON:
+ return new ScVbaSpinButton( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::IMAGECONTROL:
+ return new ScVbaImage( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ default:
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Donot support this Control Type." ), uno::Reference< uno::XInterface >() );
+ }
+}
+
+ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< awt::XControl >& xControl, const uno::Reference< uno::XInterface >& xParent ) throw (uno::RuntimeException)
+{
+ uno::Reference< beans::XPropertySet > xProps( xControl->getModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< lang::XServiceInfo > xServiceInfo( xProps, uno::UNO_QUERY_THROW );
+ ScVbaControl* pControl = NULL;
+ uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess
+ if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCheckBoxModel") ) ) )
+ pControl = new ScVbaCheckbox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ) ) )
+ pControl = new ScVbaRadioButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlEditModel") ) ) )
+ pControl = new ScVbaTextBox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ), true );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlButtonModel") ) ) )
+ {
+ sal_Bool bToggle = sal_False;
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toggle") ) ) >>= bToggle;
+ if ( bToggle )
+ pControl = new ScVbaToggleButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ else
+ pControl = new ScVbaButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ }
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlComboBoxModel") ) ) )
+ pControl = new ScVbaComboBox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ), true );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) ) )
+ pControl = new ScVbaListBox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedTextModel") ) ) )
+ pControl = new ScVbaLabel( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlImageControlModel") ) ) )
+ pControl = new ScVbaImage( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ) )
+ pControl = new ScVbaProgressBar( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ) )
+ pControl = new ScVbaFrame( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ) ) )
+ pControl = new ScVbaScrollBar( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ) )
+ pControl = new ScVbaMultiPage( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ), xParent );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) ) )
+ pControl = new ScVbaSpinButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ else
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Unsupported control " ), uno::Reference< uno::XInterface >() );
+ return pControl;
+}
+
+rtl::OUString&
+ScVbaControl::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaControl") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaControl::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Control" ) );
+ }
+ return aServiceNames;
+}
+
+
+
+typedef cppu::WeakImplHelper1< XControlProvider > ControlProvider_BASE;
+class ControlProviderImpl : public ControlProvider_BASE
+{
+ uno::Reference< uno::XComponentContext > m_xCtx;
+public:
+ ControlProviderImpl( const uno::Reference< uno::XComponentContext >& xCtx ) : m_xCtx( xCtx ) {}
+ virtual uno::Reference< msforms::XControl > SAL_CALL createControl( const uno::Reference< drawing::XControlShape >& xControl, const uno::Reference< frame::XModel >& xDocOwner ) throw (uno::RuntimeException);
+ virtual uno::Reference< msforms::XControl > SAL_CALL createUserformControl( const uno::Reference< awt::XControl >& xControl, const uno::Reference< awt::XControl >& xDialog, const uno::Reference< frame::XModel >& xDocOwner ) throw (uno::RuntimeException);
+};
+
+uno::Reference< msforms::XControl > SAL_CALL
+ControlProviderImpl::createControl( const uno::Reference< drawing::XControlShape >& xControlShape, const uno::Reference< frame::XModel >& xDocOwner ) throw (uno::RuntimeException)
+{
+ uno::Reference< msforms::XControl > xControlToReturn;
+ if ( xControlShape.is() )
+ {
+ ScVbaControlFactory controlFactory( m_xCtx, xControlShape, xDocOwner );
+ xControlToReturn.set( controlFactory.createControl( xDocOwner ) );
+ }
+ return xControlToReturn;
+
+}
+uno::Reference< msforms::XControl > SAL_CALL
+ControlProviderImpl::createUserformControl( const uno::Reference< awt::XControl >& xControl, const uno::Reference< awt::XControl >& xDialog, const uno::Reference< frame::XModel >& xDocOwner ) throw (uno::RuntimeException)
+{
+ uno::Reference< msforms::XControl > xControlToReturn;
+ if ( xControl.is() && xDialog.is() )
+ {
+
+ ScVbaControlFactory controlFactory( m_xCtx, xControl, xDocOwner );
+ xControlToReturn.set( controlFactory.createControl( xDialog->getModel() ) );
+ ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xControlToReturn.get() );
+ pControl->setGeometryHelper( new UserFormGeometryHelper( m_xCtx, xControl ) );
+ }
+ return xControlToReturn;
+}
+
+namespace controlprovider
+{
+namespace sdecl = comphelper::service_decl;
+sdecl::class_<ControlProviderImpl, sdecl::with_args<false> > serviceImpl;
+extern sdecl::ServiceDecl const serviceDecl(
+ serviceImpl,
+ "ControlProviderImpl",
+ "ooo.vba.ControlProvider" );
+}
+
+
diff --git a/vbahelper/source/msforms/vbacontrol.hxx b/vbahelper/source/msforms/vbacontrol.hxx
new file mode 100644
index 0000000000..3c9a128ece
--- /dev/null
+++ b/vbahelper/source/msforms/vbacontrol.hxx
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * 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: vbacontrol.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_CONTROL_HXX
+#define SC_VBA_CONTROL_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/script/XDefaultProperty.hpp>
+#include <com/sun/star/drawing/XControlShape.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <ooo/vba/msforms/XControl.hpp>
+
+#include <vbahelper/vbahelper.hxx>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <memory>
+
+//typedef ::cppu::WeakImplHelper1< ov::msforms::XControl > ControlImpl_BASE;
+typedef InheritedHelperInterfaceImpl1< ov::msforms::XControl > ControlImpl_BASE;
+
+class ScVbaControl : public ControlImpl_BASE
+{
+private:
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > m_xEventListener;
+protected:
+ std::auto_ptr< ov::AbstractGeometryAttributes > mpGeometryHelper;
+ css::uno::Reference< css::beans::XPropertySet > m_xProps;
+ css::uno::Reference< css::uno::XInterface > m_xControl;
+ css::uno::Reference< css::frame::XModel > m_xModel;
+
+ virtual css::uno::Reference< css::awt::XWindowPeer > getWindowPeer() throw (css::uno::RuntimeException);
+public:
+ ScVbaControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pHelper );
+ virtual ~ScVbaControl();
+ // This class will own the helper, so make sure it is allocated from
+ // the heap
+ void setGeometryHelper( ov::AbstractGeometryAttributes* pHelper );
+ // XControl
+ virtual sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setEnabled( sal_Bool _enabled ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setWidth( double _width ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getLeft() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLeft( double _left ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getTop() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL SetFocus( ) throw (css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getObject() throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getControlSource() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setControlSource( const rtl::OUString& _controlsource ) throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getRowSource() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setName( const rtl::OUString& _name ) throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getControlTipText() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setControlTipText( const rtl::OUString& ) throw (css::uno::RuntimeException);
+ //remove resouce because ooo.vba.excel.XControl is a wrapper of com.sun.star.drawing.XControlShape
+ virtual void removeResouce() throw( css::uno::RuntimeException );
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+
+class ScVbaControlFactory
+{
+public:
+ ScVbaControlFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel );
+ ScVbaControl* createControl() throw ( css::uno::RuntimeException );
+ ScVbaControl* createControl( const css::uno::Reference< css::uno::XInterface >& xParent ) throw ( css::uno::RuntimeException );
+private:
+ ScVbaControl* createControl( const css::uno::Reference< css::awt::XControl >&, const css::uno::Reference< css::uno::XInterface >& ) throw ( css::uno::RuntimeException );
+ ScVbaControl* createControl( const css::uno::Reference< css::drawing::XControlShape >&, const css::uno::Reference< css::uno::XInterface >& ) throw ( css::uno::RuntimeException );
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+ css::uno::Reference< css::uno::XInterface > m_xControl;
+ css::uno::Reference< css::frame::XModel > m_xModel;
+};
+
+#endif//SC_VBA_CONTROL_HXX
diff --git a/vbahelper/source/msforms/vbacontrols.cxx b/vbahelper/source/msforms/vbacontrols.cxx
new file mode 100644
index 0000000000..2f08f9f5b0
--- /dev/null
+++ b/vbahelper/source/msforms/vbacontrols.cxx
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * 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$
+ * $Revision$
+ *
+ * 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 "vbacontrols.hxx"
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/awt/XControlContainer.hpp>
+#include <ooo/vba//XControlProvider.hpp>
+#include <hash_map>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+typedef ::cppu::WeakImplHelper2< container::XNameAccess, container::XIndexAccess > ArrayWrapImpl;
+
+typedef std::hash_map< rtl::OUString, sal_Int32, ::rtl::OUStringHash,
+ ::std::equal_to< ::rtl::OUString > > ControlIndexMap;
+typedef std::vector< uno::Reference< awt::XControl > > ControlVec;
+
+class ControlArrayWrapper : public ArrayWrapImpl
+{
+ uno::Reference< awt::XControlContainer > mxDialog;
+ uno::Sequence< ::rtl::OUString > msNames;
+ ControlVec mControls;
+ ControlIndexMap mIndices;
+
+ rtl::OUString getControlName( const uno::Reference< awt::XControl >& xCtrl )
+ {
+ uno::Reference< beans::XPropertySet > xProp( xCtrl->getModel(), uno::UNO_QUERY );
+ rtl::OUString sName;
+ xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= sName;
+ return sName;
+ }
+
+public:
+
+ ControlArrayWrapper( const uno::Reference< awt::XControl >& xDialog )
+ {
+ mxDialog.set( xDialog, uno::UNO_QUERY_THROW );
+ uno::Sequence< uno::Reference< awt::XControl > > sXControls = mxDialog->getControls();
+
+ msNames.realloc( sXControls.getLength() );
+ for ( sal_Int32 i = 0; i < sXControls.getLength(); ++i )
+ {
+ uno::Reference< awt::XControl > xCtrl = sXControls[ i ];
+ msNames[ i ] = getControlName( xCtrl );
+ mControls.push_back( xCtrl );
+ mIndices[ msNames[ i ] ] = i;
+ }
+ }
+
+ // XElementAccess
+ virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException)
+ {
+ return awt::XControl::static_type(0);
+ }
+
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
+ {
+ return ( mControls.size() > 0 );
+ }
+
+ // XNameAcess
+ virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( !hasByName( aName ) )
+ throw container::NoSuchElementException();
+ return getByIndex( mIndices[ aName ] );
+ }
+
+ virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException)
+ {
+ return msNames;
+ }
+
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException)
+ {
+ ControlIndexMap::iterator it = mIndices.find( aName );
+ return it != mIndices.end();
+ }
+
+ // XElementAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (css::uno::RuntimeException)
+ {
+ return mControls.size();
+ }
+
+ virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
+ {
+ if ( Index < 0 || Index >= static_cast< sal_Int32 >( mControls.size() ) )
+ throw lang::IndexOutOfBoundsException();
+ return uno::makeAny( mControls[ Index ] );
+ }
+};
+
+
+class ControlsEnumWrapper : public EnumerationHelper_BASE
+{
+ uno::Reference<XHelperInterface > m_xParent;
+ uno::Reference<uno::XComponentContext > m_xContext;
+ uno::Reference<container::XIndexAccess > m_xIndexAccess;
+ uno::Reference<awt::XControl > m_xDlg;
+ sal_Int32 nIndex;
+
+public:
+
+ ControlsEnumWrapper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess, const uno::Reference< awt::XControl >& xDlg ) : m_xParent( xParent ), m_xContext( xContext), m_xIndexAccess( xIndexAccess ), m_xDlg( xDlg ), nIndex( 0 ) {}
+
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex < m_xIndexAccess->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( nIndex < m_xIndexAccess->getCount() )
+ {
+ uno::Reference< frame::XModel > xModel;
+ uno::Reference< awt::XControl > xControl;
+ m_xIndexAccess->getByIndex( nIndex++ ) >>= xControl;
+
+ uno::Reference<lang::XMultiComponentFactory > xServiceManager( m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
+ uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.ControlProvider" ) ), m_xContext ), uno::UNO_QUERY_THROW );
+
+ uno::Reference< msforms::XControl > xVBAControl( xControlProvider->createUserformControl( xControl, m_xDlg, xModel ) );
+ return uno::makeAny( xVBAControl );
+ }
+ throw container::NoSuchElementException();
+ }
+
+};
+
+
+uno::Reference<container::XIndexAccess >
+lcl_controlsWrapper( const uno::Reference< awt::XControl >& xDlg )
+{
+ return new ControlArrayWrapper( xDlg );
+}
+
+ScVbaControls::ScVbaControls( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext,
+ const css::uno::Reference< awt::XControl >& xDialog )
+ : ControlsImpl_BASE( xParent, xContext, lcl_controlsWrapper( xDialog ) )
+{
+ mxDialog.set( xDialog, uno::UNO_QUERY_THROW );
+}
+
+uno::Reference< container::XEnumeration >
+ScVbaControls::createEnumeration() throw (uno::RuntimeException)
+{
+ uno::Reference< container::XEnumeration > xEnum( new ControlsEnumWrapper( mxParent, mxContext, m_xIndexAccess, mxDialog ) );
+ if ( !xEnum.is() )
+ throw uno::RuntimeException();
+ return xEnum;
+}
+
+uno::Any
+ScVbaControls::createCollectionObject( const css::uno::Any& aSource )
+{
+ // Create control from awt::XControl
+ uno::Reference< awt::XControl > xControl;
+ aSource >>= xControl;
+ uno::Reference< frame::XModel > xModel;
+ uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
+ uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.ControlProvider" ) ), mxContext ), uno::UNO_QUERY_THROW );
+
+ uno::Reference< msforms::XControl > xVBAControl( xControlProvider->createUserformControl( xControl, mxDialog, xModel ) );
+
+ return uno::makeAny( xVBAControl );
+}
+
+void SAL_CALL
+ScVbaControls::Move( double cx, double cy ) throw (uno::RuntimeException)
+{
+ uno::Reference< container::XEnumeration > xEnum( createEnumeration() );
+ while ( xEnum->hasMoreElements() )
+ {
+ uno::Reference< msforms::XControl > xControl( xEnum->nextElement(), uno::UNO_QUERY_THROW );
+ xControl->setLeft( xControl->getLeft() + cx );
+ xControl->setTop( xControl->getTop() + cy );
+ }
+}
+
+uno::Type
+ScVbaControls::getElementType() throw (uno::RuntimeException)
+{
+ return ooo::vba::msforms::XControl::static_type(0);
+}
+rtl::OUString&
+ScVbaControls::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaControls") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaControls::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Controls" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbacontrols.hxx b/vbahelper/source/msforms/vbacontrols.hxx
new file mode 100644
index 0000000000..6382cee0ad
--- /dev/null
+++ b/vbahelper/source/msforms/vbacontrols.hxx
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * 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$
+ * $Revision$
+ *
+ * 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_CONTROLS_HXX
+#define SC_VBA_CONTROLS_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/msforms/XControls.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <vbahelper/vbahelper.hxx>
+
+typedef CollTestImplHelper< ov::msforms::XControls > ControlsImpl_BASE;
+
+class ScVbaControls : public ControlsImpl_BASE
+{
+ css::uno::Reference< css::awt::XControl > mxDialog;
+protected:
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+public:
+ ScVbaControls( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::awt::XControl >& xDialog );
+ // XControls
+ virtual void SAL_CALL Move( double cx, double cy ) 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);
+
+ // ScVbaCollectionBaseImpl
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+
+};
+#endif //SC_VBA_OLEOBJECTS_HXX
+
diff --git a/vbahelper/source/msforms/vbaframe.cxx b/vbahelper/source/msforms/vbaframe.cxx
new file mode 100644
index 0000000000..1a27d2a316
--- /dev/null
+++ b/vbahelper/source/msforms/vbaframe.cxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbaframe.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+ScVbaFrame::ScVbaFrame( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : FrameImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+}
+
+// Attributes
+rtl::OUString SAL_CALL
+ScVbaFrame::getCaption() throw (css::uno::RuntimeException)
+{
+ rtl::OUString Label;
+ m_xProps->getPropertyValue( LABEL ) >>= Label;
+ return Label;
+}
+
+void SAL_CALL
+ScVbaFrame::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+}
+
+uno::Any SAL_CALL
+ScVbaFrame::getValue() throw (css::uno::RuntimeException)
+{
+ return uno::makeAny( getCaption() );
+}
+
+void SAL_CALL
+ScVbaFrame::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
+{
+ rtl::OUString sCaption;
+ _value >>= sCaption;
+ setCaption( sCaption );
+}
+
+rtl::OUString&
+ScVbaFrame::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaFrame") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaFrame::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbaframe.hxx b/vbahelper/source/msforms/vbaframe.hxx
new file mode 100644
index 0000000000..071b5b09d0
--- /dev/null
+++ b/vbahelper/source/msforms/vbaframe.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_FRAME_HXX
+#define SC_VBA_FRAME_HXX
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/msforms/XLabel.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+
+typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XLabel > FrameImpl_BASE;
+
+class ScVbaFrame : public FrameImpl_BASE
+{
+public:
+ ScVbaFrame( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+ // Attributes
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) 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);
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif //SC_VBA_LABEL_HXX
diff --git a/vbahelper/source/msforms/vbaimage.cxx b/vbahelper/source/msforms/vbaimage.cxx
new file mode 100644
index 0000000000..6a8571e2dd
--- /dev/null
+++ b/vbahelper/source/msforms/vbaimage.cxx
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * 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$
+ * $Revision$
+ *
+ * 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 "vbaimage.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+ScVbaImage::ScVbaImage( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ImageImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+}
+
+rtl::OUString&
+ScVbaImage::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaImage") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaImage::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Image" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbaimage.hxx b/vbahelper/source/msforms/vbaimage.hxx
new file mode 100644
index 0000000000..d64f1c36db
--- /dev/null
+++ b/vbahelper/source/msforms/vbaimage.hxx
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * 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$
+ * $Revision$
+ *
+ * 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_IMAGE_HXX
+#define SC_VBA_IMAGE_HXX
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/msforms/XImage.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+
+typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XImage > ImageImpl_BASE;
+
+class ScVbaImage : public ImageImpl_BASE
+{
+public:
+ ScVbaImage( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif //SC_VBA_IMAGE_HXX
diff --git a/vbahelper/source/msforms/vbalabel.cxx b/vbahelper/source/msforms/vbalabel.cxx
new file mode 100644
index 0000000000..c07bf96008
--- /dev/null
+++ b/vbahelper/source/msforms/vbalabel.cxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * 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: vbalabel.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 "vbalabel.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+ScVbaLabel::ScVbaLabel( const css::uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : LabelImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+}
+
+// Attributes
+rtl::OUString SAL_CALL
+ScVbaLabel::getCaption() throw (css::uno::RuntimeException)
+{
+ rtl::OUString Label;
+ m_xProps->getPropertyValue( LABEL ) >>= Label;
+ return Label;
+}
+
+void SAL_CALL
+ScVbaLabel::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+}
+uno::Any SAL_CALL
+ScVbaLabel::getValue() throw (css::uno::RuntimeException)
+{
+ return uno::makeAny( getCaption() );
+}
+
+void SAL_CALL
+ScVbaLabel::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
+{
+ rtl::OUString sCaption;
+ _value >>= sCaption;
+ setCaption( sCaption );
+}
+
+
+rtl::OUString&
+ScVbaLabel::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaLabel") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaLabel::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Label" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbalabel.hxx b/vbahelper/source/msforms/vbalabel.hxx
new file mode 100644
index 0000000000..3afd65296f
--- /dev/null
+++ b/vbahelper/source/msforms/vbalabel.hxx
@@ -0,0 +1,56 @@
+/*************************************************************************
+ *
+ * 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: vbalabel.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_LABEL_HXX
+#define SC_VBA_LABEL_HXX
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/msforms/XLabel.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <cppuhelper/implbase2.hxx>
+
+typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XLabel, css::script::XDefaultProperty > LabelImpl_BASE;
+
+class ScVbaLabel : public LabelImpl_BASE
+{
+public:
+ ScVbaLabel( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+ // Attributes
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) 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);
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ // XDefaultProperty
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+};
+#endif //SC_VBA_LABEL_HXX
diff --git a/vbahelper/source/msforms/vbalistbox.cxx b/vbahelper/source/msforms/vbalistbox.cxx
new file mode 100644
index 0000000000..7c4f42a34d
--- /dev/null
+++ b/vbahelper/source/msforms/vbalistbox.cxx
@@ -0,0 +1,290 @@
+/*************************************************************************
+ *
+ * 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: vbalistbox.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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 <com/sun/star/form/validation/XValidatableFormComponent.hpp>
+
+#include "vbalistbox.hxx"
+#include <vector>
+#include <comphelper/anytostring.hxx>
+#include <com/sun/star/script/ArrayWrapper.hpp>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+const static rtl::OUString TEXT( RTL_CONSTASCII_USTRINGPARAM("Text") );
+const static rtl::OUString SELECTEDITEMS( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") );
+const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") );
+
+
+ScVbaListBox::ScVbaListBox( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ListBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+ mpListHelper.reset( new ListControlHelper( m_xProps ) );
+}
+
+// Attributes
+void SAL_CALL
+ScVbaListBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeException)
+{
+ sal_Int32 nIndex = 0;
+ _value >>= nIndex;
+ uno::Reference< XPropValue > xPropVal( Selected( nIndex ), uno::UNO_QUERY_THROW );
+ xPropVal->setValue( uno::makeAny( sal_True ) );
+}
+
+uno::Any SAL_CALL
+ScVbaListBox::getListIndex() throw (uno::RuntimeException)
+{
+ uno::Sequence< sal_Int16 > sSelection;
+ m_xProps->getPropertyValue( SELECTEDITEMS ) >>= sSelection;
+ if ( sSelection.getLength() == 0 )
+ return uno::Any( sal_Int32( -1 ) );
+ return uno::Any( sSelection[ 0 ] );
+}
+
+uno::Any SAL_CALL
+ScVbaListBox::getValue() throw (uno::RuntimeException)
+{
+ uno::Sequence< sal_Int16 > sSelection;
+ uno::Sequence< rtl::OUString > sItems;
+ m_xProps->getPropertyValue( SELECTEDITEMS ) >>= sSelection;
+ m_xProps->getPropertyValue( ITEMS ) >>= sItems;
+ if( getMultiSelect() )
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
+ uno::Any aRet;
+ if ( sSelection.getLength() )
+ aRet = uno::makeAny( sItems[ sSelection[ 0 ] ] );
+ return aRet;
+}
+
+void SAL_CALL
+ScVbaListBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
+{
+ if( getMultiSelect() )
+ {
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
+ }
+ rtl::OUString sValue = getAnyAsString( _value );
+ uno::Sequence< rtl::OUString > sList;
+ m_xProps->getPropertyValue( ITEMS ) >>= sList;
+ uno::Sequence< sal_Int16 > nList;
+ sal_Int16 nLength = static_cast<sal_Int16>( sList.getLength() );
+ sal_Int16 nValue = -1;
+ sal_Int16 i = 0;
+ for( i = 0; i < nLength; i++ )
+ {
+ if( sList[i].equals( sValue ) )
+ {
+ nValue = i;
+ break;
+ }
+ }
+ if( nValue == -1 )
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
+
+ uno::Sequence< sal_Int16 > nSelectedIndices(1);
+ nSelectedIndices[ 0 ] = nValue;
+ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nSelectedIndices ) );
+ m_xProps->setPropertyValue( TEXT, uno::makeAny( sValue ) );
+}
+
+::rtl::OUString SAL_CALL
+ScVbaListBox::getText() throw (uno::RuntimeException)
+{
+ rtl::OUString result;
+ getValue() >>= result;
+ return result;
+}
+
+void SAL_CALL
+ScVbaListBox::setText( const ::rtl::OUString& _text ) throw (uno::RuntimeException)
+{
+ setValue( uno::makeAny( _text ) ); // seems the same
+}
+
+sal_Bool SAL_CALL
+ScVbaListBox::getMultiSelect() throw (css::uno::RuntimeException)
+{
+ sal_Bool bMultiSelect = sal_False;
+ m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ) ) >>= bMultiSelect;
+ return bMultiSelect;
+}
+
+void SAL_CALL
+ScVbaListBox::setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ), uno::makeAny( _multiselect ) );
+}
+
+css::uno::Any SAL_CALL
+ScVbaListBox::Selected( sal_Int32 index ) throw (css::uno::RuntimeException)
+{
+ uno::Sequence< rtl::OUString > sList;
+ m_xProps->getPropertyValue( ITEMS ) >>= sList;
+ sal_Int16 nLength = static_cast< sal_Int16 >( sList.getLength() );
+ // no choice but to do a horror cast as internally
+ // the indices are but sal_Int16
+ sal_Int16 nIndex = static_cast< sal_Int16 >( index );
+ if( nIndex < 0 || nIndex >= nLength )
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Error Number." ), uno::Reference< uno::XInterface >() );
+ m_nIndex = nIndex;
+ return uno::makeAny( uno::Reference< XPropValue > ( new ScVbaPropValue( this ) ) );
+}
+
+// Methods
+void SAL_CALL
+ScVbaListBox::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) throw (uno::RuntimeException)
+{
+ mpListHelper->AddItem( pvargItem, pvargIndex );
+ }
+
+void SAL_CALL
+ScVbaListBox::removeItem( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ mpListHelper->removeItem( index );
+}
+
+void SAL_CALL
+ScVbaListBox::Clear( ) throw (uno::RuntimeException)
+{
+ mpListHelper->Clear();
+}
+
+// this is called when something like the following vba code is used
+// to set the selected state of particular entries in the Listbox
+// ListBox1.Selected( 3 ) = false
+//PropListener
+void
+ScVbaListBox::setValueEvent( const uno::Any& value )
+{
+ sal_Bool bValue = sal_False;
+ if( !(value >>= bValue) )
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Invalid type\n. need boolean." ), uno::Reference< uno::XInterface >() );
+ uno::Sequence< sal_Int16 > nList;
+ m_xProps->getPropertyValue( SELECTEDITEMS ) >>= nList;
+ sal_Int16 nLength = static_cast<sal_Int16>( nList.getLength() );
+ sal_Int16 nIndex = m_nIndex;
+ for( sal_Int16 i = 0; i < nLength; i++ )
+ {
+ if( nList[i] == nIndex )
+ {
+ if( bValue )
+ return;
+ else
+ {
+ for( ; i < nLength - 1; i++ )
+ {
+ nList[i] = nList[i + 1];
+ }
+ nList.realloc( nLength - 1 );
+ //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
+ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nList ) );
+ return;
+ }
+ }
+ }
+ if( bValue )
+ {
+ if( getMultiSelect() )
+ {
+ nList.realloc( nLength + 1 );
+ nList[nLength] = nIndex;
+ }
+ else
+ {
+ nList.realloc( 1 );
+ nList[0] = nIndex;
+ }
+ //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
+ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nList ) );
+ }
+}
+
+// this is called when something like the following vba code is used
+// to determine the selected state of particular entries in the Listbox
+// msgbox ListBox1.Selected( 3 )
+
+css::uno::Any
+ScVbaListBox::getValueEvent()
+{
+ uno::Sequence< sal_Int16 > nList;
+ m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) ) ) >>= nList;
+ sal_Int32 nLength = nList.getLength();
+ sal_Int32 nIndex = m_nIndex;
+
+ for( sal_Int32 i = 0; i < nLength; i++ )
+ {
+ if( nList[i] == nIndex )
+ return uno::makeAny( sal_True );
+ }
+
+ return uno::makeAny( sal_False );
+}
+
+void SAL_CALL
+ScVbaListBox::setRowSource( const rtl::OUString& _rowsource ) throw (uno::RuntimeException)
+{
+ ScVbaControl::setRowSource( _rowsource );
+ mpListHelper->setRowSource( _rowsource );
+}
+
+sal_Int32 SAL_CALL
+ScVbaListBox::getListCount() throw (uno::RuntimeException)
+{
+ return mpListHelper->getListCount();
+}
+
+uno::Any SAL_CALL
+ScVbaListBox::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn ) throw (uno::RuntimeException)
+{
+ return mpListHelper->List( pvargIndex, pvarColumn );
+}
+
+rtl::OUString&
+ScVbaListBox::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaListBox") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaListBox::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ScVbaListBox" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbalistbox.hxx b/vbahelper/source/msforms/vbalistbox.hxx
new file mode 100644
index 0000000000..3f41fcd633
--- /dev/null
+++ b/vbahelper/source/msforms/vbalistbox.hxx
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * 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: vbalistbox.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_LISTBOX_HXX
+#define SC_VBA_LISTBOX_HXX
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/script/XDefaultProperty.hpp>
+#include <ooo/vba/msforms/XListBox.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbapropvalue.hxx>
+#include "vbalistcontrolhelper.hxx"
+#include <vbahelper/vbahelper.hxx>
+
+typedef cppu::ImplInheritanceHelper2<ScVbaControl, ov::msforms::XListBox, css::script::XDefaultProperty > ListBoxImpl_BASE;
+class ScVbaListBox : public ListBoxImpl_BASE
+ ,public PropListener
+{
+ std::auto_ptr< ListControlHelper > mpListHelper;
+ rtl::OUString sSourceName;
+ rtl::OUString msDftPropName;
+
+ sal_Int16 m_nIndex;
+
+public:
+ ScVbaListBox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+
+ // Attributes
+ virtual css::uno::Any SAL_CALL getListIndex() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setListIndex( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getListCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getMultiSelect() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Selected( ::sal_Int32 index ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Clear( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL List( const css::uno::Any& pvargIndex, const css::uno::Any& pvarColumn ) throw (css::uno::RuntimeException);
+ // XControl
+ virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
+
+ // XDefaultProperty
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+
+ //PropListener
+ virtual void setValueEvent( const css::uno::Any& value );
+ virtual css::uno::Any getValueEvent();
+
+
+};
+
+#endif //
diff --git a/vbahelper/source/msforms/vbalistcontrolhelper.cxx b/vbahelper/source/msforms/vbalistcontrolhelper.cxx
new file mode 100644
index 0000000000..36683ae6f7
--- /dev/null
+++ b/vbahelper/source/msforms/vbalistcontrolhelper.cxx
@@ -0,0 +1,146 @@
+#include <vbalistcontrolhelper.hxx>
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") );
+
+void SAL_CALL
+ListControlHelper::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) throw (uno::RuntimeException)
+{
+ if ( pvargItem.hasValue() )
+ {
+ uno::Sequence< rtl::OUString > sList;
+ m_xProps->getPropertyValue( ITEMS ) >>= sList;
+
+ sal_Int32 nIndex = sList.getLength();
+
+ if ( pvargIndex.hasValue() )
+ pvargIndex >>= nIndex;
+
+ rtl::OUString sString = getAnyAsString( pvargItem );
+
+ // if no index specified or item is to be appended to end of
+ // list just realloc the array and set the last item
+ if ( nIndex == sList.getLength() )
+ {
+ sal_Int32 nOldSize = sList.getLength();
+ sList.realloc( nOldSize + 1 );
+ sList[ nOldSize ] = sString;
+ }
+ else
+ {
+ // just copy those elements above the one to be inserted
+ std::vector< rtl::OUString > sVec;
+ // reserve just the amount we need to copy
+ sVec.reserve( sList.getLength() - nIndex );
+
+ // point at first element to copy
+ rtl::OUString* pString = sList.getArray() + nIndex;
+ const rtl::OUString* pEndString = sList.getArray() + sList.getLength();
+ // insert the new element
+ sVec.push_back( sString );
+ // copy elements
+ for ( ; pString != pEndString; ++pString )
+ sVec.push_back( *pString );
+
+ sList.realloc( sList.getLength() + 1 );
+
+ // point at first element to be overwritten
+ pString = sList.getArray() + nIndex;
+ pEndString = sList.getArray() + sList.getLength();
+ std::vector< rtl::OUString >::iterator it = sVec.begin();
+ for ( ; pString != pEndString; ++pString, ++it)
+ *pString = *it;
+ //
+ }
+
+ m_xProps->setPropertyValue( ITEMS, uno::makeAny( sList ) );
+
+ }
+}
+
+void SAL_CALL
+ListControlHelper::removeItem( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ sal_Int32 nIndex = 0;
+ // for int index
+ if ( index >>= nIndex )
+ {
+ uno::Sequence< rtl::OUString > sList;
+ m_xProps->getPropertyValue( ITEMS ) >>= sList;
+ if( nIndex < 0 || nIndex > ( sList.getLength() - 1 ) )
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid index" ), uno::Reference< uno::XInterface > () );
+ if( sList.hasElements() )
+ {
+ if( sList.getLength() == 1 )
+ {
+ Clear();
+ return;
+ }
+ for( sal_Int32 i = nIndex; i < ( sList.getLength()-1 ); i++ )
+ {
+ sList[i] = sList[i+1];
+ }
+ sList.realloc( sList.getLength() - 1 );
+ }
+
+ m_xProps->setPropertyValue( ITEMS, uno::makeAny( sList ) );
+ }
+}
+
+void SAL_CALL
+ListControlHelper::Clear( ) throw (uno::RuntimeException)
+{
+ // urk, setValue doesn't seem to work !!
+ //setValue( uno::makeAny( sal_Int16() ) );
+ m_xProps->setPropertyValue( ITEMS, uno::makeAny( uno::Sequence< rtl::OUString >() ) );
+}
+
+void SAL_CALL
+ListControlHelper::setRowSource( const rtl::OUString& _rowsource ) throw (uno::RuntimeException)
+{
+ if ( _rowsource.getLength() == 0 )
+ Clear();
+}
+
+sal_Int32 SAL_CALL
+ListControlHelper::getListCount() throw (uno::RuntimeException)
+{
+ uno::Sequence< rtl::OUString > sList;
+ m_xProps->getPropertyValue( ITEMS ) >>= sList;
+ return sList.getLength();
+}
+
+uno::Any SAL_CALL
+ListControlHelper::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn ) throw (uno::RuntimeException)
+{
+ uno::Sequence< rtl::OUString > sList;
+ m_xProps->getPropertyValue( ITEMS ) >>= sList;
+ sal_Int16 nLength = static_cast< sal_Int16 >( sList.getLength() );
+ uno::Any aRet;
+ if ( pvargIndex.hasValue() )
+ {
+ sal_Int16 nIndex = -1;
+ pvargIndex >>= nIndex;
+ if( nIndex < 0 || nIndex >= nLength )
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Bad row Index" ), uno::Reference< uno::XInterface >() );
+ aRet <<= sList[ nIndex ];
+ }
+ else if ( pvarColumn.hasValue() ) // pvarColumn on its own would be bad
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Bad column Index" ), uno::Reference< uno::XInterface >() );
+ else // List() ( e.g. no args )
+ {
+ uno::Sequence< uno::Sequence< rtl::OUString > > sReturnArray( nLength );
+ for ( sal_Int32 i = 0; i < nLength; ++i )
+ {
+ sReturnArray[ i ].realloc( 10 );
+ sReturnArray[ i ][ 0 ] = sList[ i ];
+ }
+ aRet = uno::makeAny( sReturnArray );
+ }
+ return aRet;
+}
diff --git a/vbahelper/source/msforms/vbalistcontrolhelper.hxx b/vbahelper/source/msforms/vbalistcontrolhelper.hxx
new file mode 100644
index 0000000000..6b332ab9d8
--- /dev/null
+++ b/vbahelper/source/msforms/vbalistcontrolhelper.hxx
@@ -0,0 +1,20 @@
+#ifndef SC_VBA_LISTCONTROLHELPER
+#define SC_VBA_LISTCONTROLHELPER
+
+#include <vbahelper/vbahelper.hxx>
+
+class ListControlHelper
+{
+ css::uno::Reference< css::beans::XPropertySet > m_xProps;
+
+public:
+ ListControlHelper( const css::uno::Reference< css::beans::XPropertySet >& rxControl ) : m_xProps( rxControl ){}
+ virtual ~ListControlHelper() {}
+ virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getListCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL List( const css::uno::Any& pvargIndex, const css::uno::Any& pvarColumn ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Clear( ) throw (css::uno::RuntimeException);
+};
+#endif
diff --git a/vbahelper/source/msforms/vbamultipage.cxx b/vbahelper/source/msforms/vbamultipage.cxx
new file mode 100644
index 0000000000..bc288340ec
--- /dev/null
+++ b/vbahelper/source/msforms/vbamultipage.cxx
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbamultipage.hxx"
+#include <ooo/vba/XCollection.hpp>
+#include "vbapages.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+// uno servicename com.sun.star.awt.UnoControlProgressBarMode
+const rtl::OUString SVALUE( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") );
+const rtl::OUString SVALUEMAX( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") );
+const rtl::OUString SSTEP( RTL_CONSTASCII_USTRINGPARAM("Step") );
+
+typedef cppu::WeakImplHelper1< container::XIndexAccess > PagesImpl_Base;
+class PagesImpl : public PagesImpl_Base
+{
+ sal_Int32 mnPages;
+public:
+ PagesImpl( sal_Int32 nPages ) : mnPages( nPages ) {}
+ virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException) { return mnPages; }
+ virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, ::uno::RuntimeException)
+ {
+ if ( Index < 0 || Index > mnPages )
+ throw lang::IndexOutOfBoundsException();
+ return uno::makeAny( uno::Reference< uno::XInterface >() );
+ }
+ // XElementAccess
+ virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException)
+ {
+ // no Pages object yet #FIXME
+ //return msforms::XPage::static_type(0);
+ return uno::XInterface::static_type(0);
+ }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
+ {
+ return ( mnPages > 0 );
+ }
+};
+uno::Reference< container::XIndexAccess >
+ScVbaMultiPage::getPages( sal_Int32 nPages )
+{
+ return new PagesImpl( nPages );
+}
+
+ScVbaMultiPage::ScVbaMultiPage( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper, const uno::Reference< uno::XInterface >& xDialog ) : MultiPageImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+ mxDialogProps.set( xDialog, uno::UNO_QUERY_THROW );
+ // set dialog step to value of multipage pseudo model
+ setValue(getValue());
+}
+
+// Attributes
+sal_Int32 SAL_CALL
+ScVbaMultiPage::getValue() throw (css::uno::RuntimeException)
+{
+ sal_Int32 nValue = 0;
+ m_xProps->getPropertyValue( SVALUE ) >>= nValue;
+ return nValue;
+}
+
+void SAL_CALL
+ScVbaMultiPage::setValue( const sal_Int32 _value ) throw (::com::sun::star::uno::RuntimeException)
+{
+ // track change in dialog ( dialog value is 1 based, 0 is a special value )
+ m_xProps->setPropertyValue( SVALUE, uno::makeAny( _value ) );
+ mxDialogProps->setPropertyValue( SSTEP, uno::makeAny( _value + 1) );
+}
+
+
+rtl::OUString&
+ScVbaMultiPage::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMultiPage") );
+ return sImplName;
+}
+
+uno::Any SAL_CALL
+ScVbaMultiPage::Pages( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ sal_Int32 nValue = 0;
+ m_xProps->getPropertyValue( SVALUEMAX ) >>= nValue;
+ uno::Reference< XCollection > xColl( new ScVbaPages( this, mxContext, getPages( nValue ) ) );
+ if ( !index.hasValue() )
+ return uno::makeAny( xColl );
+ return xColl->Item( uno::makeAny( index ), uno::Any() );
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaMultiPage::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.MultiPage" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbamultipage.hxx b/vbahelper/source/msforms/vbamultipage.hxx
new file mode 100644
index 0000000000..b0214f684d
--- /dev/null
+++ b/vbahelper/source/msforms/vbamultipage.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_MULTIPAGE_HXX
+#define SC_VBA_MULTIPAGE_HXX
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/msforms/XMultiPage.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+//#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XMultiPage > MultiPageImpl_BASE;
+
+class ScVbaMultiPage : public MultiPageImpl_BASE
+{
+ css::uno::Reference< css::container::XIndexAccess > getPages( sal_Int32 nPages );
+ css::uno::Reference< css::beans::XPropertySet > mxDialogProps;
+public:
+ ScVbaMultiPage( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper, const css::uno::Reference< css::uno::XInterface >& xDialog );
+ // Attributes
+ virtual sal_Int32 SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( sal_Int32 _value ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Pages( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ // XDefaultProperty
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+};
+#endif //SC_VBA_LABEL_HXX
diff --git a/vbahelper/source/msforms/vbapages.cxx b/vbahelper/source/msforms/vbapages.cxx
new file mode 100644
index 0000000000..1959b6f981
--- /dev/null
+++ b/vbahelper/source/msforms/vbapages.cxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbapages.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+ScVbaPages::ScVbaPages( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xPages ) throw( lang::IllegalArgumentException ) : ScVbaPages_BASE( xParent, xContext, xPages )
+{
+}
+
+uno::Type SAL_CALL
+ScVbaPages::getElementType() throw (uno::RuntimeException)
+{
+ // return msforms::XPage::static_type(0);
+ return uno::XInterface::static_type(0);
+}
+
+uno::Any
+ScVbaPages::createCollectionObject( const css::uno::Any& aSource )
+{
+ return aSource;
+}
+
+rtl::OUString&
+ScVbaPages::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPages") );
+ return sImplName;
+}
+
+uno::Reference< container::XEnumeration > SAL_CALL
+ScVbaPages::createEnumeration() throw (uno::RuntimeException)
+{
+ return uno::Reference< container::XEnumeration >();
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaPages::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.Pages" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbapages.hxx b/vbahelper/source/msforms/vbapages.hxx
new file mode 100644
index 0000000000..7ae49ca9a3
--- /dev/null
+++ b/vbahelper/source/msforms/vbapages.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_PAGES_HXX
+#define SC_VBA_PAGES_HXX
+
+#include <ooo/vba/office/MsoShapeType.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <ooo/vba/msforms/XPages.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+#include <vbahelper/vbacollectionimpl.hxx>
+typedef CollTestImplHelper<
+ov::msforms::XPages > ScVbaPages_BASE;
+
+class ScVbaPages : public ScVbaPages_BASE
+{
+protected:
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+public:
+ ScVbaPages( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xPages ) throw ( css::lang::IllegalArgumentException );
+ virtual ~ScVbaPages() {}
+ // 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);
+ // ScVbaPages_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+
+};
+#endif//SC_VBA_SHAPE_HXX
diff --git a/vbahelper/source/msforms/vbaprogressbar.cxx b/vbahelper/source/msforms/vbaprogressbar.cxx
new file mode 100644
index 0000000000..fc6eae8ddb
--- /dev/null
+++ b/vbahelper/source/msforms/vbaprogressbar.cxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbaprogressbar.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+// uno servicename com.sun.star.awt.UnoControlProgressBarMode
+const rtl::OUString SVALUE( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") );
+
+ScVbaProgressBar::ScVbaProgressBar( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ProgressBarImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+}
+
+// Attributes
+uno::Any SAL_CALL
+ScVbaProgressBar::getValue() throw (css::uno::RuntimeException)
+{
+ return m_xProps->getPropertyValue( SVALUE );
+}
+
+void SAL_CALL
+ScVbaProgressBar::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( SVALUE, _value );
+}
+
+rtl::OUString&
+ScVbaProgressBar::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaProgressBar") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaProgressBar::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Label" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbaprogressbar.hxx b/vbahelper/source/msforms/vbaprogressbar.hxx
new file mode 100644
index 0000000000..86cbae4e89
--- /dev/null
+++ b/vbahelper/source/msforms/vbaprogressbar.hxx
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_PROGRESSBAR_HXX
+#define SC_VBA_PROGRESSBAR_HXX
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/msforms/XProgressBar.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <cppuhelper/implbase2.hxx>
+
+typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XProgressBar, css::script::XDefaultProperty > ProgressBarImpl_BASE;
+
+class ScVbaProgressBar : public ProgressBarImpl_BASE
+{
+public:
+ ScVbaProgressBar( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+ // Attributes
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ // XDefaultProperty
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+};
+#endif //SC_VBA_LABEL_HXX
diff --git a/vbahelper/source/msforms/vbaradiobutton.cxx b/vbahelper/source/msforms/vbaradiobutton.cxx
new file mode 100644
index 0000000000..1ae3ff4953
--- /dev/null
+++ b/vbahelper/source/msforms/vbaradiobutton.cxx
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * 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: vbaradiobutton.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 "vbaradiobutton.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") );
+ScVbaRadioButton::ScVbaRadioButton( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : RadioButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+}
+
+// Attributes
+rtl::OUString SAL_CALL
+ScVbaRadioButton::getCaption() throw (css::uno::RuntimeException)
+{
+ rtl::OUString Label;
+ m_xProps->getPropertyValue( LABEL ) >>= Label;
+ return Label;
+}
+
+void SAL_CALL
+ScVbaRadioButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+}
+
+uno::Any SAL_CALL
+ScVbaRadioButton::getValue() throw (css::uno::RuntimeException)
+{
+ sal_Int16 nValue = -1;
+ m_xProps->getPropertyValue( STATE ) >>= nValue;
+ if( nValue != 0 )
+ nValue = -1;
+// return uno::makeAny( nValue );
+// I must be missing something MSO says value should be -1 if selected, 0 if not
+// selected
+ return uno::makeAny( ( nValue == -1 ) ? sal_True : sal_False );
+
+}
+
+void SAL_CALL
+ScVbaRadioButton::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
+{
+ sal_Int16 nValue = 0;
+ sal_Bool bValue = sal_False;
+ if( _value >>= nValue )
+ {
+ if( nValue == -1)
+ nValue = 1;
+ }
+ else if ( _value >>= bValue )
+ {
+ if ( bValue )
+ nValue = 1;
+ }
+ m_xProps->setPropertyValue( STATE, uno::makeAny( nValue ) );
+}
+
+rtl::OUString&
+ScVbaRadioButton::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaRadioButton") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaRadioButton::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.RadioButton" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbaradiobutton.hxx b/vbahelper/source/msforms/vbaradiobutton.hxx
new file mode 100644
index 0000000000..9a09dffae5
--- /dev/null
+++ b/vbahelper/source/msforms/vbaradiobutton.hxx
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * 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: vbaradiobutton.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_RADIOBUTTON_HXX
+#define SC_VBA_RADIOBUTTON_HXX
+#include <ooo/vba/msforms/XRadioButton.hpp>
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <cppuhelper/implbase2.hxx>
+
+typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XRadioButton, css::script::XDefaultProperty > RadioButtonImpl_BASE;
+
+class ScVbaRadioButton : public RadioButtonImpl_BASE
+{
+public:
+ ScVbaRadioButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+ // Attributes
+ virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue(const com::sun::star::uno::Any&) throw (css::uno::RuntimeException);
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ // XDefaultProperty
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+
+};
+#endif //SC_VBA_RADIOBUTTON_HXX
diff --git a/vbahelper/source/msforms/vbascrollbar.cxx b/vbahelper/source/msforms/vbascrollbar.cxx
new file mode 100644
index 0000000000..ec0f12e614
--- /dev/null
+++ b/vbahelper/source/msforms/vbascrollbar.cxx
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbascrollbar.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+const static rtl::OUString LARGECHANGE( RTL_CONSTASCII_USTRINGPARAM("BlockIncrement") );
+const static rtl::OUString SMALLCHANGE( RTL_CONSTASCII_USTRINGPARAM("LineIncrement") );
+const static rtl::OUString ORIENTATION( RTL_CONSTASCII_USTRINGPARAM("Orientation") );
+const static rtl::OUString SCROLLVALUE( RTL_CONSTASCII_USTRINGPARAM("ScrollValue") );
+const static rtl::OUString SCROLLMAX( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMax") );
+const static rtl::OUString SCROLLMIN( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMin") );
+
+ScVbaScrollBar::ScVbaScrollBar( const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ScrollBarImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+}
+
+// Attributes
+uno::Any SAL_CALL
+ScVbaScrollBar::getValue() throw (css::uno::RuntimeException)
+{
+ return m_xProps->getPropertyValue( SCROLLVALUE );
+}
+
+void SAL_CALL
+ScVbaScrollBar::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( SCROLLVALUE, _value );
+}
+
+::sal_Int32 SAL_CALL
+ScVbaScrollBar::getMax() throw (uno::RuntimeException)
+{
+ sal_Int32 nMax = 0;
+ m_xProps->getPropertyValue( SCROLLMAX ) >>= nMax;
+ return nMax;
+}
+
+void SAL_CALL
+ScVbaScrollBar::setMax( sal_Int32 nVal ) throw (uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( SCROLLMAX, uno::makeAny( nVal ) );
+}
+
+::sal_Int32 SAL_CALL
+ScVbaScrollBar::getMin() throw (uno::RuntimeException)
+{
+ sal_Int32 nVal = 0;
+ m_xProps->getPropertyValue( SCROLLMIN ) >>= nVal;
+ return nVal;
+}
+
+void SAL_CALL
+ScVbaScrollBar::setMin( sal_Int32 nVal ) throw (uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( SCROLLMIN, uno::makeAny( nVal ) );
+}
+
+void SAL_CALL
+ScVbaScrollBar::setLargeChange( ::sal_Int32 _largechange ) throw (uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( LARGECHANGE, uno::makeAny( _largechange ) );
+}
+
+::sal_Int32 SAL_CALL
+ScVbaScrollBar::getLargeChange() throw (uno::RuntimeException)
+{
+ sal_Int32 nVal = 0;
+ m_xProps->getPropertyValue( LARGECHANGE ) >>= nVal;
+ return nVal;
+}
+
+::sal_Int32 SAL_CALL
+ScVbaScrollBar::getSmallChange() throw (uno::RuntimeException)
+{
+ sal_Int32 nSmallChange = 0;
+ m_xProps->getPropertyValue( SMALLCHANGE ) >>= nSmallChange;
+ return nSmallChange;
+}
+
+void SAL_CALL
+ScVbaScrollBar::setSmallChange( ::sal_Int32 _smallchange ) throw (uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( SMALLCHANGE, uno::makeAny( _smallchange ) );
+}
+
+rtl::OUString&
+ScVbaScrollBar::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaScrollBar") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaScrollBar::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbascrollbar.hxx b/vbahelper/source/msforms/vbascrollbar.hxx
new file mode 100644
index 0000000000..459f610a71
--- /dev/null
+++ b/vbahelper/source/msforms/vbascrollbar.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_SCROLLBAR_HXX
+#define SC_VBA_SCROLLBAR_HXX
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/msforms/XScrollBar.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+
+typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XScrollBar > ScrollBarImpl_BASE;
+
+class ScVbaScrollBar : public ScrollBarImpl_BASE
+{
+public:
+ ScVbaScrollBar( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+ // Attributes
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMax() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMax( ::sal_Int32 _max ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMin( ::sal_Int32 _min ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getLargeChange() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLargeChange( ::sal_Int32 _largechange ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getSmallChange() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSmallChange( ::sal_Int32 _smallchange ) throw (css::uno::RuntimeException);
+
+
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif //SC_VBA_LABEL_HXX
diff --git a/vbahelper/source/msforms/vbaspinbutton.cxx b/vbahelper/source/msforms/vbaspinbutton.cxx
new file mode 100644
index 0000000000..cfbbeb21f3
--- /dev/null
+++ b/vbahelper/source/msforms/vbaspinbutton.cxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbaspinbutton.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+const static rtl::OUString ORIENTATION( RTL_CONSTASCII_USTRINGPARAM("Orientation") );
+const static rtl::OUString SPINVALUE( RTL_CONSTASCII_USTRINGPARAM("SpinValue") );
+const static rtl::OUString SPINMAX( RTL_CONSTASCII_USTRINGPARAM("SpinValueMax") );
+const static rtl::OUString SPINMIN( RTL_CONSTASCII_USTRINGPARAM("SpinValueMin") );
+
+ScVbaSpinButton::ScVbaSpinButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : SpinButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+}
+
+// Attributes
+uno::Any SAL_CALL
+ScVbaSpinButton::getValue() throw (css::uno::RuntimeException)
+{
+ return m_xProps->getPropertyValue( SPINVALUE );
+}
+
+void SAL_CALL
+ScVbaSpinButton::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( SPINVALUE, _value );
+}
+
+::sal_Int32 SAL_CALL
+ScVbaSpinButton::getMax() throw (uno::RuntimeException)
+{
+ sal_Int32 nMax = 0;
+ m_xProps->getPropertyValue( SPINMAX ) >>= nMax;
+ return nMax;
+}
+
+void SAL_CALL
+ScVbaSpinButton::setMax( sal_Int32 nVal ) throw (uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( SPINMAX, uno::makeAny( nVal ) );
+}
+
+::sal_Int32 SAL_CALL
+ScVbaSpinButton::getMin() throw (uno::RuntimeException)
+{
+ sal_Int32 nVal = 0;
+ m_xProps->getPropertyValue( SPINMIN ) >>= nVal;
+ return nVal;
+}
+
+void SAL_CALL
+ScVbaSpinButton::setMin( sal_Int32 nVal ) throw (uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( SPINMIN, uno::makeAny( nVal ) );
+}
+
+rtl::OUString&
+ScVbaSpinButton::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaSpinButton") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaSpinButton::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbaspinbutton.hxx b/vbahelper/source/msforms/vbaspinbutton.hxx
new file mode 100644
index 0000000000..8f1d6e3d4d
--- /dev/null
+++ b/vbahelper/source/msforms/vbaspinbutton.hxx
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_SPINBUTTON_HXX
+#define SC_VBA_SPINBUTTON_HXX
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/msforms/XSpinButton.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+
+typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XSpinButton > SpinButtonImpl_BASE;
+
+class ScVbaSpinButton : public SpinButtonImpl_BASE
+{
+public:
+ ScVbaSpinButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+ // Attributes
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMax() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMax( ::sal_Int32 _max ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMin( ::sal_Int32 _min ) throw (css::uno::RuntimeException);
+
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif //SC_VBA_SPINBUTTON_HXX
diff --git a/vbahelper/source/msforms/vbatextbox.cxx b/vbahelper/source/msforms/vbatextbox.cxx
new file mode 100644
index 0000000000..511a306d90
--- /dev/null
+++ b/vbahelper/source/msforms/vbatextbox.cxx
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * 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: vbatextbox.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 <com/sun/star/text/XTextRange.hpp>
+
+#include "vbatextbox.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+
+ScVbaTextBox::ScVbaTextBox( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper, bool bDialog ) : TextBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ), mbDialog( bDialog )
+{
+}
+
+// Attributes
+uno::Any SAL_CALL
+ScVbaTextBox::getValue() throw (css::uno::RuntimeException)
+{
+ return uno::makeAny( getText() );
+}
+
+void SAL_CALL
+ScVbaTextBox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeException)
+{
+ rtl::OUString sVal = getAnyAsString( _value );
+ setText( sVal );
+}
+
+//getString() will cause some imfo lose.
+rtl::OUString SAL_CALL
+ScVbaTextBox::getText() throw (css::uno::RuntimeException)
+{
+ uno::Any aValue;
+ aValue = m_xProps->getPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) ) );
+ rtl::OUString sString;
+ aValue >>= sString;
+ return sString;
+}
+
+void SAL_CALL
+ScVbaTextBox::setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException)
+{
+ if ( !mbDialog )
+ {
+ uno::Reference< text::XTextRange > xTextRange( m_xProps, uno::UNO_QUERY_THROW );
+ xTextRange->setString( _text );
+}
+ else
+ m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), uno::makeAny( _text ) );
+}
+
+sal_Int32 SAL_CALL
+ScVbaTextBox::getMaxLength() throw (css::uno::RuntimeException)
+{
+ uno::Any aValue;
+ aValue = m_xProps->getPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxTextLen" ) ) );
+ sal_Int32 nMaxLength = 0;
+ aValue >>= nMaxLength;
+ return nMaxLength;
+}
+
+void SAL_CALL
+ScVbaTextBox::setMaxLength( sal_Int32 _maxlength ) throw (css::uno::RuntimeException)
+{
+ uno::Any aValue( _maxlength );
+ m_xProps->setPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxTextLen" ) ), aValue);
+}
+
+sal_Bool SAL_CALL
+ScVbaTextBox::getMultiline() throw (css::uno::RuntimeException)
+{
+ uno::Any aValue;
+ aValue = m_xProps->getPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ) );
+ sal_Bool bRet = false;
+ aValue >>= bRet;
+ return bRet;
+}
+
+void SAL_CALL
+ScVbaTextBox::setMultiline( sal_Bool _multiline ) throw (css::uno::RuntimeException)
+{
+ uno::Any aValue( _multiline );
+ m_xProps->setPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ), aValue);
+}
+
+rtl::OUString&
+ScVbaTextBox::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaTextBox") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaTextBox::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.TextBox" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/msforms/vbatextbox.hxx b/vbahelper/source/msforms/vbatextbox.hxx
new file mode 100644
index 0000000000..4e26f6f99f
--- /dev/null
+++ b/vbahelper/source/msforms/vbatextbox.hxx
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * 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: vbatextbox.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_TEXTBOX_HXX
+#define SC_VBA_TEXTBOX_HXX
+#include <cppuhelper/implbase2.hxx>
+#include <ooo/vba/msforms/XTextBox.hpp>
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+
+typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XTextBox, css::script::XDefaultProperty > TextBoxImpl_BASE;
+
+class ScVbaTextBox : public TextBoxImpl_BASE
+{
+ bool mbDialog;
+public:
+ ScVbaTextBox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper, bool bDialog = false );
+ // Attributes
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getMaxLength() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMaxLength( sal_Int32 _maxlength ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getMultiline() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMultiline( sal_Bool _multiline ) throw (css::uno::RuntimeException);
+ // XDefaultProperty
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif //SC_VBA_TEXTBOX_HXX
diff --git a/vbahelper/source/msforms/vbatogglebutton.cxx b/vbahelper/source/msforms/vbatogglebutton.cxx
new file mode 100644
index 0000000000..2b6230cbcd
--- /dev/null
+++ b/vbahelper/source/msforms/vbatogglebutton.cxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbatogglebutton.hxx"
+#include <vector>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+const static rtl::OUString TOGGLE( RTL_CONSTASCII_USTRINGPARAM("Toggle") );
+const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") );
+ScVbaToggleButton::ScVbaToggleButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : ToggleButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+{
+ OSL_TRACE("ScVbaToggleButton(ctor)");
+ m_xProps->setPropertyValue( TOGGLE, uno::makeAny( sal_True ) );
+}
+
+ScVbaToggleButton::~ScVbaToggleButton()
+{
+ OSL_TRACE("~ScVbaToggleButton(dtor)");
+}
+
+// Attributes
+rtl::OUString SAL_CALL
+ScVbaToggleButton::getCaption() throw (css::uno::RuntimeException)
+{
+ rtl::OUString Label;
+ m_xProps->getPropertyValue( LABEL ) >>= Label;
+ return Label;
+}
+
+void SAL_CALL
+ScVbaToggleButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+}
+
+uno::Any SAL_CALL
+ScVbaToggleButton::getValue() throw (uno::RuntimeException)
+{
+ sal_Int16 nState = 0;
+ m_xProps->getPropertyValue( STATE ) >>= nState;
+ return uno::makeAny( nState ? sal_Int16( -1 ) : sal_Int16( 0 ) );
+}
+
+void SAL_CALL
+ScVbaToggleButton::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
+{
+ sal_Int16 nState = 0;
+ _value >>= nState;
+ OSL_TRACE( "nState - %d", nState );
+ nState = ( nState == -1 ) ? 1 : 0;
+ OSL_TRACE( "nState - %d", nState );
+ m_xProps->setPropertyValue( STATE, uno::makeAny( nState ) );
+}
+
+rtl::OUString&
+ScVbaToggleButton::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaToggleButton") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaToggleButton::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ToggleButton" ) );
+ }
+ return aServiceNames;
+}
+
diff --git a/vbahelper/source/msforms/vbatogglebutton.hxx b/vbahelper/source/msforms/vbatogglebutton.hxx
new file mode 100644
index 0000000000..1932d514cc
--- /dev/null
+++ b/vbahelper/source/msforms/vbatogglebutton.hxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_TOGGLEBUTTON_HXX
+#define SC_VBA_TOGGLEBUTTON_HXX
+#include <cppuhelper/implbase2.hxx>
+#include <ooo/vba/msforms/XToggleButton.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+
+typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XToggleButton, css::script::XDefaultProperty > ToggleButtonImpl_BASE;
+
+class ScVbaToggleButton : public ToggleButtonImpl_BASE
+{
+ rtl::OUString msDftPropName;
+public:
+ ScVbaToggleButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+ ~ScVbaToggleButton();
+ // Attributes
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) 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);
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ // XDefaultProperty
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+};
+#endif //SC_VBA_TOGGLEBUTTON_HXX
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
new file mode 100644
index 0000000000..463da446c5
--- /dev/null
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -0,0 +1,227 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include <vbahelper/helperdecl.hxx>
+#include "vbauserform.hxx"
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XControlContainer.hpp>
+#include <com/sun/star/beans/PropertyConcept.hpp>
+#include <basic/sbx.hxx>
+#include <basic/sbstar.hxx>
+#include <basic/sbmeth.hxx>
+#include "vbacontrols.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+// some little notes
+// XDialog implementation has the following interesting bits
+// a Controls property ( which is an array of the container controls )
+// each item in the controls array is a XControl, where the model is
+// basically a property bag
+// additionally the XDialog instance has itself a model
+// this model has a ControlModels ( array of models ) property
+// the models in ControlModels can be accessed by name
+// also the XDialog is a XControl ( to access the model above
+
+ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& xContext ) throw ( lang::IllegalArgumentException ) : ScVbaUserForm_BASE( getXSomethingFromArgs< XHelperInterface >( aArgs, 0 ), xContext, getXSomethingFromArgs< uno::XInterface >( aArgs, 1 ), getXSomethingFromArgs< frame::XModel >( aArgs, 2 ), static_cast< ooo::vba::AbstractGeometryAttributes* >(0) ), mbDispose( true )
+{
+ m_xDialog.set( m_xControl, uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
+ m_xProps.set( xControl->getModel(), uno::UNO_QUERY_THROW );
+ setGeometryHelper( new UserFormGeometryHelper( xContext, xControl ) );
+}
+
+ScVbaUserForm::~ScVbaUserForm()
+{
+}
+
+void SAL_CALL
+ScVbaUserForm::Show( ) throw (uno::RuntimeException)
+{
+ OSL_TRACE("ScVbaUserForm::Show( )");
+ short aRet = 0;
+ mbDispose = true;
+ if ( m_xDialog.is() )
+ aRet = m_xDialog->execute();
+ OSL_TRACE("ScVbaUserForm::Show() execute returned %d", aRet);
+ if ( mbDispose )
+ {
+ try
+ {
+ uno::Reference< lang::XComponent > xComp( m_xDialog, uno::UNO_QUERY_THROW );
+ m_xDialog = NULL;
+ xComp->dispose();
+ mbDispose = false;
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+}
+
+rtl::OUString SAL_CALL
+ScVbaUserForm::getCaption() throw (::com::sun::star::uno::RuntimeException)
+{
+ rtl::OUString sCaption;
+ m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ) ) >>= sCaption;
+ return sCaption;
+}
+void
+ScVbaUserForm::setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ), uno::makeAny( _caption ) );
+}
+
+void SAL_CALL
+ScVbaUserForm::Hide( ) throw (uno::RuntimeException)
+{
+ mbDispose = false; // hide not dispose
+ if ( m_xDialog.is() )
+ m_xDialog->endExecute();
+}
+
+void SAL_CALL
+ScVbaUserForm::RePaint( ) throw (uno::RuntimeException)
+{
+ // do nothing
+}
+
+void SAL_CALL
+ScVbaUserForm::UnloadObject( ) throw (uno::RuntimeException)
+{
+ mbDispose = true;
+ if ( m_xDialog.is() )
+ m_xDialog->endExecute();
+}
+
+rtl::OUString&
+ScVbaUserForm::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaUserForm") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaUserForm::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.UserForm" ) );
+ }
+ return aServiceNames;
+}
+
+uno::Reference< beans::XIntrospectionAccess > SAL_CALL
+ScVbaUserForm::getIntrospection( ) throw (uno::RuntimeException)
+{
+ return uno::Reference< beans::XIntrospectionAccess >();
+}
+
+uno::Any SAL_CALL
+ScVbaUserForm::invoke( const ::rtl::OUString& /*aFunctionName*/, const uno::Sequence< uno::Any >& /*aParams*/, uno::Sequence< ::sal_Int16 >& /*aOutParamIndex*/, uno::Sequence< uno::Any >& /*aOutParam*/ ) throw (lang::IllegalArgumentException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException)
+{
+ throw uno::RuntimeException(); // unsupported operation
+}
+
+void SAL_CALL
+ScVbaUserForm::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException)
+{
+ uno::Any aObject = getValue( aPropertyName );
+ // The Object *must* support XDefaultProperty here because getValue will
+ // only return properties that are Objects ( e.g. controls )
+ // e.g. Userform1.aControl = something
+ // 'aControl' has to support XDefaultProperty to make sense here
+ uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW );
+ rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName();
+ uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) );
+ uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW );
+ xPropSet->setPropertyValue( aDfltPropName, aValue );
+}
+
+uno::Any SAL_CALL
+ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName );
+ ScVbaControlFactory aFac( mxContext, xControl, m_xModel );
+ uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) );
+ ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() );
+ pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) );
+ return uno::makeAny( xVBAControl );
+}
+
+::sal_Bool SAL_CALL
+ScVbaUserForm::hasMethod( const ::rtl::OUString& /*aName*/ ) throw (uno::RuntimeException)
+{
+ return sal_False;
+}
+uno::Any SAL_CALL
+ScVbaUserForm::Controls( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xControls( new ScVbaControls( this, mxContext, xDialogControl ) );
+ if ( index.hasValue() )
+ return uno::makeAny( xControls->Item( index, uno::Any() ) );
+ return uno::makeAny( xControls );
+}
+
+::sal_Bool SAL_CALL
+ScVbaUserForm::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
+{
+ uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY );
+ OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is() );
+ if ( xControl.is() )
+ {
+ uno::Reference< container::XNameAccess > xNameAccess( xControl->getModel(), uno::UNO_QUERY_THROW );
+ sal_Bool bRes = xNameAccess->hasByName( aName );
+ OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d ---> %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is(), bRes );
+ return bRes;
+ }
+ return sal_False;
+}
+
+namespace userform
+{
+namespace sdecl = comphelper::service_decl;
+sdecl::vba_service_class_<ScVbaUserForm, sdecl::with_args<true> > serviceImpl;
+extern sdecl::ServiceDecl const serviceDecl(
+ serviceImpl,
+ "ScVbaUserForm",
+ "ooo.vba.msforms.UserForm" );
+}
+
diff --git a/vbahelper/source/msforms/vbauserform.hxx b/vbahelper/source/msforms/vbauserform.hxx
new file mode 100644
index 0000000000..be93dc78ea
--- /dev/null
+++ b/vbahelper/source/msforms/vbauserform.hxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_USERFORM_HXX
+#define SC_VBA_USERFORM_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/msforms/XUserForm.hpp>
+#include <com/sun/star/awt/XDialog.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+
+#include <vbahelper/vbahelperinterface.hxx>
+#include "vbacontrol.hxx"
+
+//typedef InheritedHelperInterfaceImpl1< ov::msforms::XUserForm > ScVbaUserForm_BASE;
+typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XUserForm > ScVbaUserForm_BASE;
+
+class ScVbaUserForm : public ScVbaUserForm_BASE
+{
+private:
+ css::uno::Reference< css::awt::XDialog > m_xDialog;
+ bool mbDispose;
+protected:
+public:
+ ScVbaUserForm( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException );
+ virtual ~ScVbaUserForm();
+ // XUserForm
+ virtual void SAL_CALL RePaint( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Show( ) throw (css::uno::RuntimeException);
+ // XIntrospection
+ virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw (css::beans::UnknownPropertyException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCaption() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL Hide( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL UnloadObject( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif
diff --git a/vbahelper/source/vbahelper/makefile.mk b/vbahelper/source/vbahelper/makefile.mk
new file mode 100644
index 0000000000..a8a4167948
--- /dev/null
+++ b/vbahelper/source/vbahelper/makefile.mk
@@ -0,0 +1,80 @@
+#*************************************************************************
+#
+# 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: makefile.mk,v $
+#
+# $Revision: 1.45 $
+#
+# 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.
+#
+#*************************************************************************
+
+PRJ=..$/../
+PRJNAME=vbahelper
+TARGET=vbahelperbits
+
+ENABLE_EXCEPTIONS := TRUE
+VISIBILITY_HIDDEN=TRUE
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+SLOFILES=\
+ $(SLO)$/vbahelper.obj \
+ $(SLO)$/vbapropvalue.obj \
+ $(SLO)$/vbacommandbars.obj \
+ $(SLO)$/vbacommandbar.obj \
+ $(SLO)$/vbacommandbarcontrols.obj \
+ $(SLO)$/vbacommandbarcontrol.obj \
+ $(SLO)$/vbacommandbarhelper.obj \
+ $(SLO)$/vbaapplicationbase.obj \
+ $(SLO)$/vbawindowbase.obj \
+ $(SLO)$/vbadocumentbase.obj \
+ $(SLO)$/vbadocumentsbase.obj \
+ $(SLO)$/vbaglobalbase.obj \
+ $(SLO)$/vbafontbase.obj \
+ $(SLO)$/vbadialogbase.obj \
+ $(SLO)$/vbadialogsbase.obj \
+ $(SLO)$/vbashape.obj \
+ $(SLO)$/vbacolorformat.obj \
+ $(SLO)$/vbashapes.obj \
+ $(SLO)$/vbalineformat.obj \
+ $(SLO)$/vbafillformat.obj \
+ $(SLO)$/vbapictureformat.obj \
+ $(SLO)$/vbashaperange.obj \
+ $(SLO)$/vbatextframe.obj \
+ $(SLO)$/vbapagesetupbase.obj \
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+ALLTAR : \
+ $(MISC)$/$(TARGET).don \
+
+$(SLOFILES) : $(MISC)$/$(TARGET).don
+
+$(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+ +$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
+ echo $@
+
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
new file mode 100644
index 0000000000..02112dbc6e
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -0,0 +1,218 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbahelper/vbaapplicationbase.hxx"
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+
+#include "vbacommandbars.hxx"
+#include <svx/msvbahelper.hxx>
+
+// start basic includes
+#include <basic/sbx.hxx>
+#include <basic/sbstar.hxx>
+#include <basic/sbuno.hxx>
+#include <basic/sbmeth.hxx>
+#include <basic/sbmod.hxx>
+// end basic includes
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+#define OFFICEVERSION "11.0"
+
+VbaApplicationBase::VbaApplicationBase( const uno::Reference< uno::XComponentContext >& xContext )
+ : ApplicationBase_BASE( uno::Reference< XHelperInterface >(), xContext )
+{
+}
+
+VbaApplicationBase::~VbaApplicationBase()
+{
+}
+
+sal_Bool SAL_CALL
+VbaApplicationBase::getScreenUpdating() throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+ return !xModel->hasControllersLocked();
+}
+
+void SAL_CALL
+VbaApplicationBase::setScreenUpdating(sal_Bool bUpdate) throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+ if (bUpdate)
+ xModel->unlockControllers();
+ else
+ xModel->lockControllers();
+}
+
+sal_Bool SAL_CALL
+VbaApplicationBase::getDisplayStatusBar() throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW );
+
+ if( xProps.is() ){
+ uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ), uno::UNO_QUERY_THROW );
+ rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" ));
+ if( xLayoutManager.is() && xLayoutManager->isElementVisible( url ) ){
+ return sal_True;
+ }
+ }
+ return sal_False;
+}
+
+void SAL_CALL
+VbaApplicationBase::setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW );
+
+ if( xProps.is() ){
+ uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ), uno::UNO_QUERY_THROW );
+ rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" ));
+ if( xLayoutManager.is() ){
+ if( bDisplayStatusBar && !xLayoutManager->isElementVisible( url ) ){
+ if( !xLayoutManager->showElement( url ) )
+ xLayoutManager->createElement( url );
+ return;
+ }
+ else if( !bDisplayStatusBar && xLayoutManager->isElementVisible( url ) ){
+ xLayoutManager->hideElement( url );
+ return;
+ }
+ }
+ }
+ return;
+}
+
+uno::Any SAL_CALL
+VbaApplicationBase::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeException)
+{
+ uno::Reference< XCommandBars > xCommandBars( new ScVbaCommandBars( this, mxContext, uno::Reference< container::XIndexAccess >(), getCurrentDocument() ) );
+ if( aIndex.hasValue() )
+ return uno::makeAny( xCommandBars->Item( aIndex, uno::Any() ) );
+ return uno::makeAny( xCommandBars );
+}
+
+::rtl::OUString SAL_CALL
+VbaApplicationBase::getVersion() throw (uno::RuntimeException)
+{
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(OFFICEVERSION));
+}
+
+void SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const uno::Any& varg1, const uno::Any& varg2, const uno::Any& varg3, const uno::Any& varg4, const uno::Any& varg5, const uno::Any& varg6, const uno::Any& varg7, const uno::Any& varg8, const uno::Any& varg9, const uno::Any& varg10, const uno::Any& varg11, const uno::Any& varg12, const uno::Any& varg13, const uno::Any& varg14, const uno::Any& varg15, const uno::Any& varg16, const uno::Any& varg17, const uno::Any& varg18, const uno::Any& varg19, const uno::Any& varg20, const uno::Any& varg21, const uno::Any& varg22, const uno::Any& varg23, const uno::Any& varg24, const uno::Any& varg25, const uno::Any& varg26, const uno::Any& varg27, const uno::Any& varg28, const uno::Any& varg29, const uno::Any& varg30 ) throw (uno::RuntimeException)
+{
+ VBAMacroResolvedInfo aMacroInfo = resolveVBAMacro( getSfxObjShell( getCurrentDocument() ), MacroName );
+ if( aMacroInfo.IsResolved() )
+ {
+ // handle the arguments
+ const uno::Any* aArgsPtrArray[] = { &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12, &varg13, &varg14, &varg15, &varg16, &varg17, &varg18, &varg19, &varg20, &varg21, &varg22, &varg23, &varg24, &varg25, &varg26, &varg27, &varg28, &varg29, &varg30 };
+
+ int nArg = sizeof( aArgsPtrArray ) / sizeof( aArgsPtrArray[0] );
+ uno::Sequence< uno::Any > aArgs( nArg );
+
+ const uno::Any** pArg = aArgsPtrArray;
+ const uno::Any** pArgEnd = ( aArgsPtrArray + nArg );
+
+ sal_Int32 nLastArgWithValue = 0;
+ sal_Int32 nArgProcessed = 0;
+
+ for ( ; pArg != pArgEnd; ++pArg, ++nArgProcessed )
+ {
+ aArgs[ nArgProcessed ] = **pArg;
+ if( (*pArg)->hasValue() )
+ nLastArgWithValue = nArgProcessed;
+ }
+
+ // resize array to position of last param with value
+ aArgs.realloc( nArgProcessed + 1 );
+
+ uno::Any aRet;
+ uno::Any aDummyCaller;
+ executeMacro( aMacroInfo.MacroDocContext(), aMacroInfo.ResolvedMacro(), aArgs, aRet, aDummyCaller );
+ }
+ else
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("The macro doesn't exist") ), uno::Reference< uno::XInterface >() );
+ }
+}
+
+float SAL_CALL VbaApplicationBase::CentimetersToPoints( float _Centimeters ) throw (uno::RuntimeException)
+{
+ // i cm = 28.35 points
+ static const float rate = 28.35f;
+ return ( _Centimeters * rate );
+}
+
+rtl::OUString&
+VbaApplicationBase::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaApplicationBase") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+VbaApplicationBase::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.VbaApplicationBase" ) );
+ }
+ return aServiceNames;
+}
+
+void VbaApplicationBase::Quit() throw (uno::RuntimeException)
+{
+ // need to stop basic
+ SbMethod* pMeth = StarBASIC::GetActiveMethod();
+ if ( pMeth )
+ {
+ SbModule* pMod = dynamic_cast< SbModule* >( pMeth->GetParent() );
+ if ( pMod )
+ {
+ StarBASIC* pBasic = dynamic_cast< StarBASIC* >( pMod->GetParent() );
+ if ( pBasic )
+ pBasic->QuitAndExitApplication();
+ }
+ }
+}
diff --git a/vbahelper/source/vbahelper/vbacolorformat.cxx b/vbahelper/source/vbahelper/vbacolorformat.cxx
new file mode 100644
index 0000000000..43e7a4ab27
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacolorformat.cxx
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * 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: vbacolorformat.cxx,v $
+ * $Revision: 1.3.146.1 $
+ *
+ * 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 <com/sun/star/beans/XPropertySet.hpp>
+#include <ooo/vba/msforms/XLineFormat.hpp>
+#include "vbacolorformat.hxx"
+
+using namespace ooo::vba;
+using namespace com::sun::star;
+
+sal_Int32
+MsoColorIndizes::getColorIndex( sal_Int32 nIndex )
+{
+ const static sal_Int32 COLORINDIZES[56] =
+ { HAPICOLOR_BLACK, HAPICOLOR_WITHE, HAPICOLOR_RED, HAPICOLOR_BRIGHTGREEN, HAPICOLOR_BLUE, HAPICOLOR_YELLOW, HAPICOLOR_PINK,
+ HAPICOLOR_TURQUOISE, HAPICOLOR_DARKRED, HAPICOLOR_GREEN, HAPICOLOR_DARKBLUE, HAPICOLOR_DARKYELLOW, HAPICOLOR_VIOLET,
+ HAPICOLOR_TEAL, HAPICOLOR_GRAY_25_PERCENT, HAPICOLOR_GRAY_50_PERCENT, HAPICOLOR_PERIWINCKLE, HAPICOLOR_PLUM,
+ HAPICOLOR_IVORY, HAPICOLOR_LIGHTTURQUOISE, HAPICOLOR_DARKPRUPLE, HAPICOLOR_CORAL, HAPICOLOR_OCEANBLUE, HAPICOLOR_ICEBLUE,
+ HAPICOLOR_GREEN, HAPICOLOR_PINK, HAPICOLOR_YELLOW, HAPICOLOR_TURQUOISE, HAPICOLOR_VIOLET, HAPICOLOR_DARKRED, HAPICOLOR_TEAL,
+ HAPICOLOR_BLUE, HAPICOLOR_SKYBLUE, HAPICOLOR_LIGHTTURQUOISE, HAPICOLOR_LIGHTGREEN, HAPICOLOR_LIGHTYELLOW, HAPICOLOR_PALEBLUE,
+ HAPICOLOR_ROSE, HAPICOLOR_LAVENDER, HAPICOLOR_TAN, HAPICOLOR_LIGHTBLUE, HAPICOLOR_AQUA, HAPICOLOR_LIME, HAPICOLOR_GOLD,
+ HAPICOLOR_LIGHTORANGE, HAPICOLOR_ORANGE, HAPICOLOR_BLUEGRAY, HAPICOLOR_GRAY_40_PERCENT, HAPICOLOR_DARKTEAL,
+ HAPICOLOR_SEAGREEN, HAPICOLOR_NONAME, HAPICOLOR_OLIVEGREEN, HAPICOLOR_BROWN, HAPICOLOR_PLUM, HAPICOLOR_INDIGO,
+ HAPICOLOR_GRAY_80_PERCENT
+ };
+ return COLORINDIZES[nIndex];
+}
+ScVbaColorFormat::ScVbaColorFormat( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XHelperInterface > xInternalParent, const uno::Reference< drawing::XShape > xShape, const sal_Int16 nColorFormatType ) : ScVbaColorFormat_BASE( xParent, xContext ), m_xInternalParent( xInternalParent ), m_xShape( xShape ), m_nColorFormatType( nColorFormatType )
+{
+ m_xPropertySet.set( xShape, uno::UNO_QUERY_THROW );
+ m_nFillFormatBackColor = 0;
+ try
+ {
+ uno::Reference< ov::msforms::XFillFormat > xFillFormat( xInternalParent, uno::UNO_QUERY_THROW );
+ m_pFillFormat = ( ScVbaFillFormat* )( xFillFormat.get() );
+ }catch ( uno::RuntimeException e )
+ {
+ m_pFillFormat = NULL;
+ }
+}
+
+void
+ScVbaColorFormat::setColorFormat( sal_Int16 _ntype )
+{
+ m_nColorFormatType = _ntype;
+}
+
+// Attribute
+sal_Int32 SAL_CALL
+ScVbaColorFormat::getRGB() throw (uno::RuntimeException)
+{
+ sal_Int32 nRGB = 0;
+ switch( m_nColorFormatType )
+ {
+ case ColorFormatType::LINEFORMAT_FORECOLOR:
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("LineColor") ) >>= nRGB;
+ break;
+ case ColorFormatType::LINEFORMAT_BACKCOLOR:
+ //TODO BackColor not supported
+ // m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("Color"), uno::makeAny( nRGB ) );
+ break;
+ case ColorFormatType::FILLFORMAT_FORECOLOR:
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("FillColor") ) >>= nRGB;
+ break;
+ case ColorFormatType::FILLFORMAT_BACKCOLOR:
+ nRGB = m_nFillFormatBackColor;
+ break;
+ default:
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() );
+ }
+ nRGB = OORGBToXLRGB( nRGB );
+ return nRGB;
+}
+
+void SAL_CALL
+ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException)
+{
+ sal_Int32 nRGB = XLRGBToOORGB( _rgb );
+ switch( m_nColorFormatType )
+ {
+ case ColorFormatType::LINEFORMAT_FORECOLOR:
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineColor" ), uno::makeAny( nRGB ) );
+ break;
+ case ColorFormatType::LINEFORMAT_BACKCOLOR:
+ // TODO BackColor not supported
+ break;
+ case ColorFormatType::FILLFORMAT_FORECOLOR:
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillColor" ), uno::makeAny( nRGB ) );
+ if( m_pFillFormat )
+ {
+ m_pFillFormat->setForeColorAndInternalStyle(nRGB);
+ }
+ break;
+ case ColorFormatType::FILLFORMAT_BACKCOLOR:
+ m_nFillFormatBackColor = nRGB;
+ if( m_pFillFormat )
+ {
+ m_pFillFormat->setForeColorAndInternalStyle(nRGB);
+ }
+ break;
+ default:
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() );
+ }
+}
+
+sal_Int32 SAL_CALL
+ScVbaColorFormat::getSchemeColor() throw (uno::RuntimeException)
+{
+ sal_Int32 nColor = getRGB();
+ // #TODO I guess the number of elements is determined by the correct scheme
+ // the implementation here seems to be a rehash of color index ( which seems to be a
+ // different thing ) - I would guess we need to know/import etc. the correct color scheme
+ // or at least find out a little more
+ sal_Int32 i = 0;
+ for( ; i < 56; i++ )
+ {
+ if( nColor == MsoColorIndizes::getColorIndex(i) )
+ break;
+ }
+
+ if( i == 56 ) // this is most likely an error condition
+ --i;
+ return i;
+ // #TODO figure out what craziness is this,
+ // the 56 colors seems incorrect, as in default XL ( 2003 ) there are 80 colors
+/*
+ if( i == 56 )
+ {
+ i = -2;
+ }
+
+ return ( i + 2 );
+*/
+}
+
+void SAL_CALL
+ScVbaColorFormat::setSchemeColor( sal_Int32 _schemecolor ) throw (uno::RuntimeException)
+{
+ // the table is 0 based
+ sal_Int32 nColor = MsoColorIndizes::getColorIndex( _schemecolor );
+ // nColor is already xl RGB
+ setRGB( nColor );
+}
+
+
+rtl::OUString&
+ScVbaColorFormat::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaColorFormat") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaColorFormat::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ColorFormat" ) );
+ }
+ return aServiceNames;
+}
+
diff --git a/vbahelper/source/vbahelper/vbacolorformat.hxx b/vbahelper/source/vbahelper/vbacolorformat.hxx
new file mode 100644
index 0000000000..a45d5d83f3
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacolorformat.hxx
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * 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: vbacolorformat.hxx,v $
+ * $Revision: 1.3.146.1 $
+ *
+ * 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_XCOLORFORMAT_HXX
+#define SC_VBA_XCOLORFORMAT_HXX
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <ooo/vba/msforms/XColorFormat.hpp>
+#include <ooo/vba/msforms/XFillFormat.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include "vbafillformat.hxx"
+
+typedef InheritedHelperInterfaceImpl1< ov::msforms::XColorFormat > ScVbaColorFormat_BASE;
+
+class ColorFormatType
+{
+public:
+ const static sal_Int16 LINEFORMAT_FORECOLOR = 1;
+ const static sal_Int16 LINEFORMAT_BACKCOLOR = 2;
+ const static sal_Int16 FILLFORMAT_FORECOLOR = 3;
+ const static sal_Int16 FILLFORMAT_BACKCOLOR = 4;
+ const static sal_Int16 THREEDFORMAT_EXTRUSIONCOLOR = 5;
+};
+
+struct MsoColorIndizes
+{
+ const static sal_Int32 HAPICOLOR_BLACK = 0;
+ const static sal_Int32 HAPICOLOR_WITHE = 16777215;
+ const static sal_Int32 HAPICOLOR_RED = 16711680;
+ const static sal_Int32 HAPICOLOR_BRIGHTGREEN = 65280;
+ const static sal_Int32 HAPICOLOR_BLUE = 255;
+ const static sal_Int32 HAPICOLOR_YELLOW = 16776960;
+ const static sal_Int32 HAPICOLOR_PINK = 16711935;
+ const static sal_Int32 HAPICOLOR_TURQUOISE = 65535;
+ const static sal_Int32 HAPICOLOR_DARKRED = 8388608;
+ const static sal_Int32 HAPICOLOR_GREEN = 32768;
+ const static sal_Int32 HAPICOLOR_DARKBLUE = 128;
+ const static sal_Int32 HAPICOLOR_DARKYELLOW = 8421376;
+ const static sal_Int32 HAPICOLOR_VIOLET = 8388736;
+ const static sal_Int32 HAPICOLOR_TEAL = 32896;
+ const static sal_Int32 HAPICOLOR_GRAY_25_PERCENT = 12632256;
+ const static sal_Int32 HAPICOLOR_GRAY_50_PERCENT = 8421504;
+ const static sal_Int32 HAPICOLOR_PERIWINCKLE = 10066431;
+ const static sal_Int32 HAPICOLOR_PLUM = 10040166;
+ const static sal_Int32 HAPICOLOR_IVORY = 16777164;
+ const static sal_Int32 HAPICOLOR_LIGHTTURQUOISE = 13434879;
+ const static sal_Int32 HAPICOLOR_DARKPRUPLE = 6684774;
+ const static sal_Int32 HAPICOLOR_CORAL = 16744576;
+ const static sal_Int32 HAPICOLOR_OCEANBLUE = 26316;
+ const static sal_Int32 HAPICOLOR_ICEBLUE = 13421823;
+ const static sal_Int32 HAPICOLOR_SKYBLUE = 52479;
+ const static sal_Int32 HAPICOLOR_LIGHTGREEN = 13434828;
+ const static sal_Int32 HAPICOLOR_LIGHTYELLOW = 16777113;
+ const static sal_Int32 HAPICOLOR_PALEBLUE = 10079487;
+ const static sal_Int32 HAPICOLOR_ROSE = 16751052;
+ const static sal_Int32 HAPICOLOR_LAVENDER = 13408767;
+ const static sal_Int32 HAPICOLOR_TAN = 16764057;
+ const static sal_Int32 HAPICOLOR_LIGHTBLUE = 3368703;
+ const static sal_Int32 HAPICOLOR_AQUA = 3394764;
+ const static sal_Int32 HAPICOLOR_LIME = 10079232;
+ const static sal_Int32 HAPICOLOR_GOLD = 16763904;
+ const static sal_Int32 HAPICOLOR_LIGHTORANGE = 16750848;
+ const static sal_Int32 HAPICOLOR_ORANGE = 16737792;
+ const static sal_Int32 HAPICOLOR_BLUEGRAY = 6710937;
+ const static sal_Int32 HAPICOLOR_GRAY_40_PERCENT = 9868950;
+ const static sal_Int32 HAPICOLOR_DARKTEAL = 13158;
+ const static sal_Int32 HAPICOLOR_SEAGREEN = 3381606;
+ const static sal_Int32 HAPICOLOR_NONAME = 13056;
+ const static sal_Int32 HAPICOLOR_OLIVEGREEN = 3355392;
+ const static sal_Int32 HAPICOLOR_BROWN = 10040064;
+ const static sal_Int32 HAPICOLOR_INDIGO = 3355545;
+ const static sal_Int32 HAPICOLOR_GRAY_80_PERCENT = 3355443;
+
+ static sal_Int32 getColorIndex( sal_Int32 nIndex );
+
+};
+
+class ScVbaColorFormat : public ScVbaColorFormat_BASE
+{
+private:
+ css::uno::Reference< ov::XHelperInterface > m_xInternalParent;
+ css::uno::Reference< css::drawing::XShape > m_xShape;
+ css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
+ ScVbaFillFormat *m_pFillFormat;
+ sal_Int16 m_nColorFormatType;
+ sal_Int32 m_nFillFormatBackColor;
+protected:
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ void setColorFormat( sal_Int16 nType );
+public:
+ ScVbaColorFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XHelperInterface > xInternalParent, const css::uno::Reference< css::drawing::XShape > xShape, const sal_Int16 nColorFormatType );
+
+ // Attributes
+ virtual sal_Int32 SAL_CALL getRGB() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRGB( sal_Int32 _rgb ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSchemeColor() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSchemeColor( sal_Int32 _schemecolor ) throw (css::uno::RuntimeException);
+
+};
+
+#endif//SC_VBA_XCOLORFORMAT_HXX
diff --git a/vbahelper/source/vbahelper/vbacommandbar.cxx b/vbahelper/source/vbahelper/vbacommandbar.cxx
new file mode 100644
index 0000000000..6e51a47519
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacommandbar.cxx
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbacommandbar.hxx"
+#include "vbacommandbarcontrols.hxx"
+#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <ooo/vba/office/MsoBarType.hpp>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+ScVbaCommandBar::ScVbaCommandBar( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, VbaCommandBarHelperRef pHelper, const uno::Reference< container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Bool bIsMenu, sal_Bool bTemporary ) throw( uno::RuntimeException ) : CommandBar_BASE( xParent, xContext ), pCBarHelper( pHelper ), m_xBarSettings( xBarSettings ), m_sResourceUrl( sResourceUrl ), m_bIsMenu( bIsMenu ), m_bTemporary( bTemporary )
+{
+}
+
+::rtl::OUString SAL_CALL
+ScVbaCommandBar::getName() throw ( uno::RuntimeException )
+{
+ // This will get a "NULL length string" when Name is not set.
+ uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
+ uno::Any aName = xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("UIName") );
+ rtl::OUString sName;
+ aName >>= sName;
+ if( sName.getLength() < 1 )
+ {
+ if( m_bIsMenu )
+ {
+ if( m_sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) )
+ {
+ if( pCBarHelper->getModuleId().equalsAscii("com.sun.star.sheet.SpreadsheetDocument") )
+ sName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Worksheet Menu Bar") );
+ else if( pCBarHelper->getModuleId().equalsAscii("com.sun.star.text.TextDocument") )
+ sName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Menu Bar") );
+ return sName;
+ }
+ }
+ // Toolbar name
+ uno::Reference< container::XNameAccess > xNameAccess = pCBarHelper->getPersistentWindowState();
+ if( xNameAccess->hasByName( m_sResourceUrl ) )
+ {
+ uno::Sequence< beans::PropertyValue > aToolBar;
+ xNameAccess->getByName( m_sResourceUrl ) >>= aToolBar;
+ getPropertyValue( aToolBar, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UIName") ) ) >>= sName;
+ }
+ }
+ return sName;
+}
+void SAL_CALL
+ScVbaCommandBar::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException)
+{
+ uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
+ xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("UIName"), uno::makeAny( _name ) );
+
+ pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+}
+::sal_Bool SAL_CALL
+ScVbaCommandBar::getVisible() throw (uno::RuntimeException)
+{
+ // menu bar is allways visible in OOo
+ if( m_bIsMenu )
+ return sal_True;
+
+ sal_Bool bVisible = sal_False;
+ try
+ {
+ uno::Reference< container::XNameAccess > xNameAccess = pCBarHelper->getPersistentWindowState();
+ if( xNameAccess->hasByName( m_sResourceUrl ) )
+ {
+ uno::Sequence< beans::PropertyValue > aToolBar;
+ xNameAccess->getByName( m_sResourceUrl ) >>= aToolBar;
+ getPropertyValue( aToolBar, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Visible") ) ) >>= bVisible;
+ }
+ }
+ catch ( uno::Exception e )
+ {
+ }
+ return bVisible;
+}
+void SAL_CALL
+ScVbaCommandBar::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException)
+{
+ try
+ {
+ uno::Reference< frame::XLayoutManager > xLayoutManager = pCBarHelper->getLayoutManager();
+ if( _visible )
+ {
+ xLayoutManager->createElement( m_sResourceUrl );
+ xLayoutManager->showElement( m_sResourceUrl );
+ }
+ else
+ {
+ xLayoutManager->hideElement( m_sResourceUrl );
+ xLayoutManager->destroyElement( m_sResourceUrl );
+ }
+ }
+ catch( uno::Exception e )
+ {
+ OSL_TRACE( "SetVisible get an exception\n" );
+ }
+}
+
+::sal_Bool SAL_CALL
+ScVbaCommandBar::getEnabled() throw (uno::RuntimeException)
+{
+ // emulated with Visible
+ return getVisible();
+}
+
+void SAL_CALL
+ScVbaCommandBar::setEnabled( sal_Bool _enabled ) throw (uno::RuntimeException)
+{
+ // emulated with Visible
+ setVisible( _enabled );
+}
+
+void SAL_CALL
+ScVbaCommandBar::Delete( ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ pCBarHelper->removeSettings( m_sResourceUrl );
+ uno::Reference< container::XNameContainer > xNameContainer( pCBarHelper->getPersistentWindowState(), uno::UNO_QUERY_THROW );
+ if( xNameContainer->hasByName( m_sResourceUrl ) )
+ {
+ xNameContainer->removeByName( m_sResourceUrl );
+ }
+}
+uno::Any SAL_CALL
+ScVbaCommandBar::Controls( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ uno::Reference< awt::XMenu > xMenu;
+ if( m_bIsMenu )
+ {
+ uno::Reference< frame::XLayoutManager > xLayoutManager = pCBarHelper->getLayoutManager();
+ uno::Reference< beans::XPropertySet > xPropertySet( xLayoutManager->getElement( m_sResourceUrl ), uno::UNO_QUERY_THROW );
+ xMenu.set( xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("XMenuBar") ), uno::UNO_QUERY );
+ }
+ uno::Reference< XCommandBarControls > xCommandBarControls( new ScVbaCommandBarControls( this, mxContext, m_xBarSettings, pCBarHelper, m_xBarSettings, m_sResourceUrl, xMenu ) );
+ if( aIndex.hasValue() )
+ {
+ return xCommandBarControls->Item( aIndex, uno::Any() );
+ }
+ return uno::makeAny( xCommandBarControls );
+}
+
+sal_Int32 SAL_CALL
+ScVbaCommandBar::Type() throw (script::BasicErrorException, uno::RuntimeException)
+{
+ // #FIXME support msoBarTypePopup
+ sal_Int32 nType = office::MsoBarType::msoBarTypePopup;
+ nType = m_bIsMenu? office::MsoBarType::msoBarTypeNormal : office::MsoBarType::msoBarTypeMenuBar;
+ return nType;
+}
+
+uno::Any SAL_CALL
+ScVbaCommandBar::FindControl( const uno::Any& /*aType*/, const uno::Any& /*aId*/, const uno::Any& /*aTag*/, const uno::Any& /*aVisible*/, const uno::Any& /*aRecursive*/ ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ // alwayse fail to find control
+ return uno::makeAny( uno::Reference< XCommandBarControl > () );
+}
+
+rtl::OUString&
+ScVbaCommandBar::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBar") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaCommandBar::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBar" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/vbahelper/vbacommandbar.hxx b/vbahelper/source/vbahelper/vbacommandbar.hxx
new file mode 100644
index 0000000000..10670ed562
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacommandbar.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_COMMANDBAR_HXX
+#define SC_VBA_COMMANDBAR_HXX
+
+#include <ooo/vba/XCommandBar.hpp>
+#include <com/sun/star/ui/XUIConfigurationManager.hpp>
+#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/beans/PropertyValues.hpp>
+
+#include <vbahelper/vbahelperinterface.hxx>
+#include "vbacommandbarhelper.hxx"
+
+#include <map>
+
+typedef InheritedHelperInterfaceImpl1< ov::XCommandBar > CommandBar_BASE;
+
+class ScVbaCommandBar : public CommandBar_BASE
+{
+private:
+ VbaCommandBarHelperRef pCBarHelper;
+ css::uno::Reference< css::container::XIndexAccess > m_xBarSettings;
+ rtl::OUString m_sResourceUrl;
+ sal_Bool m_bIsMenu;
+ sal_Bool m_bTemporary;
+
+public:
+ ScVbaCommandBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Bool bIsMenu, sal_Bool bTemporary = sal_True ) throw( css::uno::RuntimeException );
+
+ sal_Bool IsMenu() { return m_bIsMenu; }
+
+ // Attributes
+ virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setName( const ::rtl::OUString& _name ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL Type( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL FindControl( const css::uno::Any& aType, const css::uno::Any& aId, const css::uno::Any& aTag, const css::uno::Any& aVisible, const css::uno::Any& aRecursive ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif//SC_VBA_COMMANDBAR_HXX
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
new file mode 100644
index 0000000000..f532000473
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
@@ -0,0 +1,259 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbacommandbarcontrol.hxx"
+#include "vbacommandbarcontrols.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <svx/msvbahelper.hxx>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+ScVbaCommandBarControl::ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), pCBarHelper( pHelper ), m_sResourceUrl( sResourceUrl ), m_xCurrentSettings( xSettings ), m_xBarSettings( xBarSettings ), m_nPosition( 0 ), m_bTemporary( sal_True )
+{
+}
+
+ScVbaCommandBarControl::ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), pCBarHelper( pHelper ), m_sResourceUrl( sResourceUrl ), m_xCurrentSettings( xSettings ), m_xBarSettings( xBarSettings ), m_nPosition( nPosition ), m_bTemporary( bTemporary )
+{
+ m_xCurrentSettings->getByIndex( nPosition ) >>= m_aPropertyValues;
+}
+
+void ScVbaCommandBarControl::ApplyChange() throw ( uno::RuntimeException )
+{
+ uno::Reference< container::XIndexContainer > xIndexContainer( m_xCurrentSettings, uno::UNO_QUERY_THROW );
+ xIndexContainer->replaceByIndex( m_nPosition, uno::makeAny( m_aPropertyValues ) );
+ pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+}
+
+::rtl::OUString SAL_CALL
+ScVbaCommandBarControl::getCaption() throw ( uno::RuntimeException )
+{
+ // "Label" always empty
+ rtl::OUString sCaption;
+ getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("Label") ) >>= sCaption;
+ return sCaption;
+}
+
+void SAL_CALL
+ScVbaCommandBarControl::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException)
+{
+ rtl::OUString sCaption = _caption.replace('&','~');
+ setPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("Label"), uno::makeAny( sCaption ) );
+ ApplyChange();
+}
+
+::rtl::OUString SAL_CALL
+ScVbaCommandBarControl::getOnAction() throw (uno::RuntimeException)
+{
+ rtl::OUString sCommandURL;
+ getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("CommandURL") ) >>= sCommandURL;
+ return sCommandURL;
+}
+
+void SAL_CALL
+ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (uno::RuntimeException)
+{
+ // get the current model
+ uno::Reference< frame::XModel > xModel( pCBarHelper->getModel() );
+ VBAMacroResolvedInfo aResolvedMacro = ooo::vba::resolveVBAMacro( getSfxObjShell( xModel ), _onaction, true );
+ if ( aResolvedMacro.IsResolved() )
+ {
+ rtl::OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.ResolvedMacro() );
+ OSL_TRACE(" ScVbaCommandBarControl::setOnAction: %s", rtl::OUStringToOString( aCommandURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+ setPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("CommandURL"), uno::makeAny( aCommandURL ) );
+ ApplyChange();
+ }
+}
+
+::sal_Bool SAL_CALL
+ScVbaCommandBarControl::getVisible() throw (uno::RuntimeException)
+{
+ sal_Bool bVisible = sal_True;
+ uno::Any aValue = getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("IsVisible") );
+ if( aValue.hasValue() )
+ aValue >>= bVisible;
+ return bVisible;
+}
+void SAL_CALL
+ScVbaCommandBarControl::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException)
+{
+ uno::Any aValue = getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("IsVisible") );
+ if( aValue.hasValue() )
+ {
+ setPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("IsVisible"), uno::makeAny( _visible ) );
+ ApplyChange();
+ }
+}
+
+::sal_Bool SAL_CALL
+ScVbaCommandBarControl::getEnabled() throw (uno::RuntimeException)
+{
+ sal_Bool bEnabled = sal_True;
+ if( m_xParentMenu.is() )
+ {
+ // currently only the menu in the MenuBat support Enable/Disable
+ // FIXME: how to support the menu item in Toolbar
+ bEnabled = m_xParentMenu->isItemEnabled( m_xParentMenu->getItemId( sal::static_int_cast< sal_Int16 >( m_nPosition ) ) );
+ }
+ else
+ {
+ // emulated with Visible
+ bEnabled = getVisible();
+ }
+ return bEnabled;
+}
+
+void SAL_CALL
+ScVbaCommandBarControl::setEnabled( sal_Bool _enabled ) throw (uno::RuntimeException)
+{
+ if( m_xParentMenu.is() )
+ {
+ // currently only the menu in the MenuBat support Enable/Disable
+ m_xParentMenu->enableItem( m_xParentMenu->getItemId( sal::static_int_cast< sal_Int16 >( m_nPosition ) ), _enabled );
+ }
+ else
+ {
+ // emulated with Visible
+ setVisible( _enabled );
+ }
+}
+
+void SAL_CALL
+ScVbaCommandBarControl::Delete( ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ if( m_xCurrentSettings.is() )
+ {
+ uno::Reference< container::XIndexContainer > xIndexContainer( m_xCurrentSettings, uno::UNO_QUERY_THROW );
+ xIndexContainer->removeByIndex( m_nPosition );
+
+ pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+ }
+}
+
+uno::Any SAL_CALL
+ScVbaCommandBarControl::Controls( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ // only Popup Menu has controls
+ uno::Reference< container::XIndexAccess > xSubMenu;
+ getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_CONTAINER ) ) >>= xSubMenu;
+ if( !xSubMenu.is() )
+ throw uno::RuntimeException();
+
+ uno::Reference< awt::XMenu > xMenu;
+ if( m_xParentMenu.is() )
+ {
+ sal_Int16 nItemId = m_xParentMenu->getItemId( sal::static_int_cast< sal_Int16 >( m_nPosition ) );
+ xMenu.set( m_xParentMenu->getPopupMenu( nItemId ), uno::UNO_QUERY );
+ }
+
+ uno::Reference< XCommandBarControls > xCommandBarControls( new ScVbaCommandBarControls( this, mxContext, xSubMenu, pCBarHelper, m_xBarSettings, m_sResourceUrl, xMenu ) );
+ if( aIndex.hasValue() )
+ {
+ return xCommandBarControls->Item( aIndex, uno::Any() );
+ }
+ return uno::makeAny( xCommandBarControls );
+}
+
+rtl::OUString&
+ScVbaCommandBarControl::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarControl") );
+ return sImplName;
+}
+
+uno::Sequence<rtl::OUString>
+ScVbaCommandBarControl::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarControl" ) );
+ }
+ return aServiceNames;
+}
+
+//////////// ScVbaCommandBarPopup //////////////////////////////
+ScVbaCommandBarPopup::ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary, const css::uno::Reference< css::awt::XMenu >& xMenu ) throw (css::uno::RuntimeException) : CommandBarPopup_BASE( xParent, xContext, xSettings, pHelper, xBarSettings, sResourceUrl )
+{
+ m_nPosition = nPosition;
+ m_bTemporary = bTemporary;
+ m_xCurrentSettings->getByIndex( m_nPosition ) >>= m_aPropertyValues;
+ m_xParentMenu = xMenu;
+}
+
+rtl::OUString&
+ScVbaCommandBarPopup::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarPopup") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaCommandBarPopup::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarPopup" ) );
+ }
+ return aServiceNames;
+}
+
+//////////// ScVbaCommandBarButton //////////////////////////////
+ScVbaCommandBarButton::ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary, const css::uno::Reference< css::awt::XMenu >& xMenu ) throw (css::uno::RuntimeException) : CommandBarButton_BASE( xParent, xContext, xSettings, pHelper, xBarSettings, sResourceUrl )
+{
+ m_nPosition = nPosition;
+ m_bTemporary = bTemporary;
+ m_xCurrentSettings->getByIndex( m_nPosition ) >>= m_aPropertyValues;
+ m_xParentMenu = xMenu;
+}
+
+rtl::OUString&
+ScVbaCommandBarButton::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarButton") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaCommandBarButton::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarButton" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx
new file mode 100644
index 0000000000..daeaf61c32
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_COMMANDBARCONTROL_HXX
+#define SC_VBA_COMMANDBARCONTROL_HXX
+
+#include <ooo/vba/XCommandBarControl.hpp>
+#include <ooo/vba/XCommandBarPopup.hpp>
+#include <ooo/vba/XCommandBarButton.hpp>
+#include <ooo/vba/office/MsoControlType.hpp>
+#include <com/sun/star/awt/XMenu.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include "vbacommandbarhelper.hxx"
+#include <cppuhelper/implbase1.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::XCommandBarControl > CommandBarControl_BASE;
+
+class ScVbaCommandBarControl : public CommandBarControl_BASE
+{
+protected:
+ VbaCommandBarHelperRef pCBarHelper;
+ rtl::OUString m_sResourceUrl;
+ css::uno::Reference< css::container::XIndexAccess > m_xCurrentSettings;
+ css::uno::Reference< css::container::XIndexAccess > m_xBarSettings;
+ css::uno::Sequence< css::beans::PropertyValue > m_aPropertyValues;
+ css::uno::Reference< css::awt::XMenu > m_xParentMenu;
+
+ sal_Int32 m_nPosition;
+ sal_Bool m_bTemporary;
+
+private:
+ void ApplyChange() throw (css::uno::RuntimeException);
+
+public:
+ ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException);
+ ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException);
+
+ // Attributes
+ 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 ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException)
+ {
+ return ov::office::MsoControlType::msoControlButton;
+ }
+
+ // Methods
+ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+typedef cppu::ImplInheritanceHelper1< ScVbaCommandBarControl, ov::XCommandBarPopup > CommandBarPopup_BASE;
+class ScVbaCommandBarPopup : public CommandBarPopup_BASE
+{
+public:
+ ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary, const css::uno::Reference< css::awt::XMenu >& xMenu ) throw (css::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException)
+ {
+ return ov::office::MsoControlType::msoControlPopup;
+ }
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+typedef cppu::ImplInheritanceHelper1< ScVbaCommandBarControl, ov::XCommandBarButton > CommandBarButton_BASE;
+class ScVbaCommandBarButton : public CommandBarButton_BASE
+{
+public:
+ ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary, const css::uno::Reference< css::awt::XMenu >& xMenu ) throw (css::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException)
+ {
+ return ov::office::MsoControlType::msoControlButton;
+ }
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif//SC_VBA_COMMANDBARCONTROL_HXX
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
new file mode 100644
index 0000000000..ebfdf2c524
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -0,0 +1,256 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbacommandbarcontrols.hxx"
+#include "vbacommandbarcontrol.hxx"
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > CommandBarControlEnumeration_BASE;
+class CommandBarControlEnumeration : public CommandBarControlEnumeration_BASE
+{
+ //uno::Reference< uno::XComponentContext > m_xContext;
+ ScVbaCommandBarControls* m_pCommandBarControls;
+ sal_Int32 m_nCurrentPosition;
+public:
+ CommandBarControlEnumeration( ScVbaCommandBarControls* pCommandBarControls ) : m_pCommandBarControls( pCommandBarControls ), m_nCurrentPosition( 0 ) {}
+ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
+ {
+ if( m_nCurrentPosition < m_pCommandBarControls->getCount() )
+ return sal_True;
+ return sal_False;
+ }
+ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
+ {
+ if( hasMoreElements() )
+ {
+ return m_pCommandBarControls->createCollectionObject( uno::makeAny( m_nCurrentPosition++ ) );
+ }
+ else
+ throw container::NoSuchElementException();
+ }
+};
+
+ScVbaCommandBarControls::ScVbaCommandBarControls( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess>& xIndexAccess, VbaCommandBarHelperRef pHelper, const uno::Reference< container::XIndexAccess>& xBarSettings, const rtl::OUString& sResourceUrl, const uno::Reference< awt::XMenu >& xMenu ) throw (uno::RuntimeException) : CommandBarControls_BASE( xParent, xContext, xIndexAccess ), pCBarHelper( pHelper ), m_xBarSettings( xBarSettings ), m_sResourceUrl( sResourceUrl ), m_xMenu( xMenu )
+{
+ m_bIsMenu = sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) ? sal_True : sal_False;
+}
+
+uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemData( const rtl::OUString& sCommandURL, const rtl::OUString& sHelpURL, const rtl::OUString& sLabel, sal_uInt16 nType, const uno::Any& aSubMenu )
+{
+ uno::Sequence< beans::PropertyValue > aProps(5);
+
+ aProps[0].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_COMMANDURL );
+ aProps[0].Value <<= sCommandURL;
+ aProps[1].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_HELPURL );
+ aProps[1].Value <<= sHelpURL;
+ aProps[2].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_LABEL );
+ aProps[2].Value <<= sLabel;
+ aProps[3].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_TYPE );
+ aProps[3].Value <<= nType;
+ aProps[4].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_CONTAINER );
+ aProps[4].Value = aSubMenu;
+
+ return aProps;
+}
+
+uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateToolbarItemData( const rtl::OUString& sCommandURL, const rtl::OUString& sHelpURL, const rtl::OUString& sLabel, sal_uInt16 nType, const uno::Any& aSubMenu, sal_Bool isVisible, sal_Int32 nStyle )
+{
+ uno::Sequence< beans::PropertyValue > aProps(7);
+
+ aProps[0].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_COMMANDURL );
+ aProps[0].Value <<= sCommandURL;
+ aProps[1].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_HELPURL );
+ aProps[1].Value <<= sHelpURL;
+ aProps[2].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_LABEL );
+ aProps[2].Value <<= sLabel;
+ aProps[3].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_TYPE );
+ aProps[3].Value <<= nType;
+ aProps[4].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_CONTAINER );
+ aProps[4].Value = aSubMenu;
+ aProps[5].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ISVISIBLE );
+ aProps[5].Value <<= isVisible;
+ aProps[6].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_STYLE );
+ aProps[6].Value <<= nStyle;
+
+ return aProps;
+}
+
+// XEnumerationAccess
+uno::Type SAL_CALL
+ScVbaCommandBarControls::getElementType() throw ( uno::RuntimeException )
+{
+ return XCommandBarControl::static_type( 0 );
+}
+
+uno::Reference< container::XEnumeration >
+ScVbaCommandBarControls::createEnumeration() throw ( uno::RuntimeException )
+{
+ return uno::Reference< container::XEnumeration >( new CommandBarControlEnumeration( this ) );
+}
+
+uno::Any
+ScVbaCommandBarControls::createCollectionObject( const uno::Any& aSource )
+{
+ sal_Int32 nPosition = -1;
+ aSource >>= nPosition;
+ uno::Sequence< beans::PropertyValue > aProps;
+ m_xIndexAccess->getByIndex( nPosition ) >>= aProps;
+ uno::Reference< container::XIndexAccess > xSubMenu;
+ getPropertyValue( aProps, rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_CONTAINER ) ) >>= xSubMenu;
+ ScVbaCommandBarControl* pNewCommandBarControl = NULL;
+ if( xSubMenu.is() )
+ pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, sal_True, m_xMenu );
+ else
+ pNewCommandBarControl = new ScVbaCommandBarButton( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, sal_True, m_xMenu );
+
+ return uno::makeAny( uno::Reference< XCommandBarControl > ( pNewCommandBarControl ) );
+}
+
+// Methods
+uno::Any SAL_CALL
+ScVbaCommandBarControls::Item( const uno::Any& aIndex, const uno::Any& /*aIndex*/ ) throw (uno::RuntimeException)
+{
+ sal_Int32 nPosition = -1;
+ if( aIndex.getValueTypeClass() == uno::TypeClass_STRING )
+ {
+ rtl::OUString sName;
+ aIndex >>= sName;
+ nPosition = VbaCommandBarHelper::findControlByName( m_xIndexAccess, sName );
+ }
+ else
+ {
+ aIndex >>= nPosition;
+ }
+
+ if( nPosition < 0 || nPosition >= getCount() )
+ {
+ throw uno::RuntimeException();
+ }
+
+ return createCollectionObject( uno::makeAny( nPosition ) );
+}
+
+uno::Reference< XCommandBarControl > SAL_CALL
+ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const uno::Any& Parameter, const uno::Any& Before, const uno::Any& Temporary ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ // Parameter is not supported
+ // the following name needs to be individually created;
+ rtl::OUString sLabel( rtl::OUString::createFromAscii("Custom") );
+ rtl::OUString sCommandUrl = rtl::OUString::createFromAscii( CUSTOM_MENU_STR ) + sLabel;
+ sal_Int32 nType = office::MsoControlType::msoControlButton;
+ sal_Int32 nPosition = 0;
+ sal_Bool bTemporary = sal_True;
+
+ if( Type.hasValue() )
+ {
+ Type >>= nType;
+ }
+
+ if( nType != office::MsoControlType::msoControlButton &&
+ nType != office::MsoControlType::msoControlPopup )
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+
+ if( Id.hasValue() || Parameter.hasValue( ) )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+
+ if( Before.hasValue() )
+ Before >>= nPosition;
+ else
+ nPosition = m_xIndexAccess->getCount();
+
+ if( Temporary.hasValue() )
+ Temporary >>= bTemporary;
+
+ uno::Any aSubMenu;
+ if( nType == office::MsoControlType::msoControlPopup )
+ {
+ // it is a Popmenu
+ uno::Reference< lang::XSingleComponentFactory > xSCF( m_xBarSettings, uno::UNO_QUERY_THROW );
+ aSubMenu <<= xSCF->createInstanceWithContext( mxContext );
+ }
+
+ // create control
+ uno::Sequence< beans::PropertyValue > aProps;
+ rtl::OUString sHelpUrl;
+ sal_uInt16 nItemType = 0;
+ if( IsMenu() )
+ {
+ aProps = CreateMenuItemData( sCommandUrl, sHelpUrl, sLabel, nItemType, aSubMenu );
+ }
+ else
+ {
+ sal_Bool isVisible = sal_True;
+ sal_Int32 nStyle = 0;
+ aProps = CreateToolbarItemData( sCommandUrl, sHelpUrl, sLabel, nItemType, aSubMenu, isVisible, nStyle );
+ }
+
+
+ uno::Reference< container::XIndexContainer > xIndexContainer( m_xIndexAccess, uno::UNO_QUERY_THROW );
+ xIndexContainer->insertByIndex( nPosition, uno::makeAny( aProps ) );
+
+ pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+
+ // sometimes it would crash if passing m_xMenu instead of uno::Reference< awt::XMenu >() in Linux.
+ ScVbaCommandBarControl* pNewCommandBarControl = NULL;
+ if( nType == office::MsoControlType::msoControlPopup )
+ pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, bTemporary, uno::Reference< awt::XMenu >() );
+ else
+ pNewCommandBarControl = new ScVbaCommandBarButton( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, bTemporary, uno::Reference< awt::XMenu >() );
+
+ return uno::Reference< XCommandBarControl >( pNewCommandBarControl );
+}
+
+// XHelperInterface
+rtl::OUString&
+ScVbaCommandBarControls::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarControls") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaCommandBarControls::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarControls" ) );
+ }
+ return aServiceNames;
+}
+
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
new file mode 100644
index 0000000000..ce89794c08
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_COMMANDBARCONTROLS_HXX
+#define SC_VBA_COMMANDBARCONTROLS_HXX
+
+#include <ooo/vba/XCommandBarControls.hpp>
+#include <com/sun/star/awt/XMenu.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <vbahelper/vbacollectionimpl.hxx>
+#include "vbacommandbarhelper.hxx"
+
+typedef CollTestImplHelper< ov::XCommandBarControls > CommandBarControls_BASE;
+
+class ScVbaCommandBarControls : public CommandBarControls_BASE
+{
+private:
+ VbaCommandBarHelperRef pCBarHelper;
+ css::uno::Reference< css::container::XIndexAccess > m_xBarSettings;
+ rtl::OUString m_sResourceUrl;
+ css::uno::Reference< css::awt::XMenu > m_xMenu;
+ sal_Bool m_bIsMenu;
+
+ css::uno::Sequence< css::beans::PropertyValue > CreateMenuItemData( const rtl::OUString& sCommandURL, const rtl::OUString& sHelpURL, const rtl::OUString& sLabel, sal_uInt16 nType, const css::uno::Any& aSubMenu );
+ css::uno::Sequence< css::beans::PropertyValue > CreateToolbarItemData( const rtl::OUString& sCommandURL, const rtl::OUString& sHelpURL, const rtl::OUString& sLabel, sal_uInt16 nType, const css::uno::Any& aSubMenu, sal_Bool isVisible, sal_Int32 nStyle );
+
+public:
+ ScVbaCommandBarControls( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, const css::uno::Reference< css::awt::XMenu >& xMenu ) throw( css::uno::RuntimeException );
+ sal_Bool IsMenu(){ return m_bIsMenu; }
+
+ // 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 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::XCommandBarControl > SAL_CALL Add( const css::uno::Any& Type, const css::uno::Any& Id, const css::uno::Any& Parameter, const css::uno::Any& Before, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif//SC_VBA_COMMANDBARCONTROLS_HXX
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
new file mode 100644
index 0000000000..cc5029acfd
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -0,0 +1,282 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbacommandbarhelper.hxx"
+#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
+#include <com/sun/star/ui/XModuleUIConfigurationManager.hpp>
+#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
+#include <com/sun/star/ui/XUIElement.hpp>
+#ifndef _COM_SUN_STAR_UI_UIElementType_HPP_
+#include <com/sun/star/ui/UIElementType.hpp>
+#endif
+#include <comphelper/processfactory.hxx>
+#include <vbahelper/vbahelper.hxx>
+#include <time.h>
+#include <map>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+#define CREATEOUSTRING(asciistr) rtl::OUString::createFromAscii(asciistr)
+
+typedef std::map< rtl::OUString, rtl::OUString > MSO2OOCommandbarMap;
+
+class MSO2OOCommandbarHelper
+{
+private:
+ static MSO2OOCommandbarHelper* pMSO2OOCommandbarHelper;
+ MSO2OOCommandbarMap maBuildinToolbarMap;
+
+ MSO2OOCommandbarHelper()
+ {
+ // Buildin toolbars
+ maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Standard"),CREATEOUSTRING("private:resource/toolbar/standardbar") ) );
+ maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Formatting"),CREATEOUSTRING("private:resource/toolbar/formatobjectbar") ) );
+ maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Drawing"),CREATEOUSTRING("private:resource/toolbar/drawbar") ) );
+ maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Toolbar List"),CREATEOUSTRING("private:resource/toolbar/toolbar") ) );
+ maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Forms"),CREATEOUSTRING("private:resource/toolbar/formcontrols") ) );
+ maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Form Controls"),CREATEOUSTRING("private:resource/toolbar/formcontrols") ) );
+ maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Full Screen"),CREATEOUSTRING("private:resource/toolbar/fullscreenbar") ) );
+ maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Chart"),CREATEOUSTRING("private:resource/toolbar/flowchartshapes") ) );
+ maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Picture"),CREATEOUSTRING("private:resource/toolbar/graphicobjectbar") ) );
+ maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("WordArt"),CREATEOUSTRING("private:resource/toolbar/fontworkobjectbar") ) );
+ maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("3-D Settings"),CREATEOUSTRING("private:resource/toolbar/extrusionobjectbar") ) );
+ }
+
+public:
+ virtual ~MSO2OOCommandbarHelper() {};
+ static MSO2OOCommandbarHelper* getMSO2OOCommandbarHelper()
+ {
+ if( pMSO2OOCommandbarHelper == NULL )
+ {
+ pMSO2OOCommandbarHelper = new MSO2OOCommandbarHelper();
+ }
+ return pMSO2OOCommandbarHelper;
+ }
+
+ rtl::OUString findBuildinToolbar( const rtl::OUString& sToolbarName )
+ {
+ MSO2OOCommandbarMap::iterator it = maBuildinToolbarMap.begin();
+ for(; it != maBuildinToolbarMap.end(); it++ )
+ {
+ rtl::OUString sName = it->first;
+ if( sName.equalsIgnoreAsciiCase( sToolbarName ) )
+ return it->second;
+ }
+ return rtl::OUString();
+ }
+};
+
+MSO2OOCommandbarHelper* MSO2OOCommandbarHelper::pMSO2OOCommandbarHelper = NULL;
+
+
+VbaCommandBarHelper::VbaCommandBarHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException) : mxContext( xContext ), mxModel( xModel )
+{
+ Init();
+}
+
+void VbaCommandBarHelper::Init( ) throw (css::uno::RuntimeException)
+{
+ uno::Reference< css::ui::XUIConfigurationManagerSupplier > xUICfgSupplier( mxModel, uno::UNO_QUERY_THROW );
+ m_xDocCfgMgr = xUICfgSupplier->getUIConfigurationManager();
+
+ uno::Reference< lang::XServiceInfo > xServiceInfo( mxModel, uno::UNO_QUERY_THROW );
+ if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument") ) ) )
+ {
+ maModuleId = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument") );
+ }
+ else if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) ) )
+ {
+ maModuleId = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument") );
+ }
+
+ if( maModuleId.getLength() == 0 )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+
+ uno::Reference< lang::XMultiServiceFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
+
+ css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUICfgMgrSupp( xServiceManager->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ))), uno::UNO_QUERY_THROW );
+
+ m_xAppCfgMgr.set( xUICfgMgrSupp->getUIConfigurationManager( maModuleId ), uno::UNO_QUERY_THROW );
+
+ css::uno::Reference< css::container::XNameAccess > xNameAccess( xServiceManager->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.WindowStateConfiguration" ))), uno::UNO_QUERY_THROW );
+
+ m_xWindowState.set( xNameAccess->getByName( maModuleId ), uno::UNO_QUERY_THROW );
+}
+
+css::uno::Reference< css::container::XIndexAccess > VbaCommandBarHelper::getSettings( const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException)
+{
+ if( m_xDocCfgMgr->hasSettings( sResourceUrl ) )
+ return m_xDocCfgMgr->getSettings( sResourceUrl, sal_True );
+ else if( m_xAppCfgMgr->hasSettings( sResourceUrl ) )
+ return m_xAppCfgMgr->getSettings( sResourceUrl, sal_True );
+ else
+ {
+ css::uno::Reference< css::container::XIndexAccess > xSettings( m_xAppCfgMgr->createSettings( ), uno::UNO_QUERY_THROW );
+ return xSettings;
+ }
+}
+
+void VbaCommandBarHelper::removeSettings( const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException)
+{
+ if( m_xDocCfgMgr->hasSettings( sResourceUrl ) )
+ m_xDocCfgMgr->removeSettings( sResourceUrl );
+ else if( m_xAppCfgMgr->hasSettings( sResourceUrl ) )
+ m_xAppCfgMgr->removeSettings( sResourceUrl );
+
+ // persistChanges();
+}
+
+void VbaCommandBarHelper::ApplyChange( const rtl::OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, sal_Bool bTemporary ) throw (css::uno::RuntimeException)
+{
+ if( m_xDocCfgMgr->hasSettings( sResourceUrl ) )
+ {
+ m_xDocCfgMgr->replaceSettings( sResourceUrl, xSettings );
+ }
+ else
+ {
+ m_xDocCfgMgr->insertSettings( sResourceUrl, xSettings );
+ }
+ if( !bTemporary )
+ {
+ persistChanges();
+ }
+}
+
+sal_Bool VbaCommandBarHelper::persistChanges() throw (css::uno::RuntimeException)
+{
+ uno::Reference< css::ui::XUIConfigurationPersistence > xConfigPersistence( m_xDocCfgMgr, uno::UNO_QUERY_THROW );
+ sal_Bool result = sal_False;
+ if( xConfigPersistence->isModified() )
+ {
+ xConfigPersistence->store();
+ result = sal_True;
+ }
+ return result;
+}
+
+uno::Reference< frame::XLayoutManager > VbaCommandBarHelper::getLayoutManager() throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xPropertySet( xFrame, uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XLayoutManager > xLayoutManager( xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("LayoutManager") ), uno::UNO_QUERY_THROW );
+ return xLayoutManager;
+}
+
+sal_Bool VbaCommandBarHelper::hasToolbar( const rtl::OUString& sResourceUrl, const rtl::OUString& sName ) throw (css::uno::RuntimeException)
+{
+ if( m_xDocCfgMgr->hasSettings( sResourceUrl ) )
+ {
+ rtl::OUString sUIName;
+ uno::Reference< beans::XPropertySet > xPropertySet( m_xDocCfgMgr->getSettings( sResourceUrl, sal_False ), uno::UNO_QUERY_THROW );
+ xPropertySet->getPropertyValue( rtl::OUString::createFromAscii(ITEM_DESCRIPTOR_UINAME) ) >>= sUIName;
+ if( sName.equalsIgnoreAsciiCase( sUIName ) )
+ return sal_True;
+ }
+ return sal_False;
+}
+
+// return the resource url if found
+rtl::OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException)
+{
+ rtl::OUString sResourceUrl;
+
+ // check if it is an buildin toolbar
+ sResourceUrl = MSO2OOCommandbarHelper::getMSO2OOCommandbarHelper()->findBuildinToolbar( sName );
+ if( sResourceUrl.getLength() > 0 )
+ return sResourceUrl;
+
+ uno::Sequence< ::rtl::OUString > allNames = xNameAccess->getElementNames();
+ for( sal_Int32 i = 0; i < allNames.getLength(); i++ )
+ {
+ sResourceUrl = allNames[i];
+ if(sResourceUrl.indexOf( rtl::OUString::createFromAscii( ITEM_TOOLBAR_URL ) ) == 0 )
+ {
+ if( hasToolbar( sResourceUrl, sName ) )
+ return sResourceUrl;
+ }
+ }
+
+ // the customize toolbars creating during importing, shoud found there.
+ static rtl::OUString sToolbarPrefix( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/custom_" ) );
+ sResourceUrl = sToolbarPrefix.concat( sName );
+ if( hasToolbar( sResourceUrl, sName ) )
+ return sResourceUrl;
+
+ return rtl::OUString();
+}
+
+// if found, return the position of the control. if not found, return -1
+sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException)
+{
+ sal_Int32 nCount = xIndexAccess->getCount();
+ css::uno::Sequence< css::beans::PropertyValue > aProps;
+ for( sal_Int32 i = 0; i < nCount; i++ )
+ {
+ rtl::OUString sLabel;
+ xIndexAccess->getByIndex( i ) >>= aProps;
+ getPropertyValue( aProps, rtl::OUString::createFromAscii(ITEM_DESCRIPTOR_LABEL) ) >>= sLabel;
+ // handle the hotkey character '~'
+ rtl::OUString sNewLabel;
+ sal_Int32 index = sLabel.indexOf( sal_Unicode('~') );
+ if( index < 0 )
+ sNewLabel = sLabel;
+ else if( index == 0 )
+ sNewLabel = sLabel.copy( index + 1);
+ else if( index == sNewLabel.getLength() - 1 )
+ sNewLabel = sLabel.copy(0, index );
+ else
+ sNewLabel = sLabel.copy( 0, index ) + sLabel.copy( index + 1 );
+ OSL_TRACE("VbaCommandBarHelper::findControlByName, control name: %s", rtl::OUStringToOString( sNewLabel, RTL_TEXTENCODING_UTF8 ).getStr() );
+ if( sName.equalsIgnoreAsciiCase( sNewLabel ) )
+ return i;
+ }
+
+ // not found
+ return -1;
+}
+
+rtl::OUString VbaCommandBarHelper::generateCustomURL()
+{
+ rtl::OUString url = rtl::OUString::createFromAscii( ITEM_TOOLBAR_URL );
+ url += rtl::OUString::createFromAscii( CUSTOM_TOOLBAR_STR );
+
+ // use a random number to minimize possible clash with existing custom toolbars
+ srand( unsigned( time( NULL ) ));
+ url += rtl::OUString::valueOf( sal_Int64( rand() ), 16 );
+ return url;
+}
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
new file mode 100644
index 0000000000..e6b0358ad8
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef VBA_COMMANDBARHELPER_HXX
+#define VBA_COMMANDBARHELPER_HXX
+
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/ui/XUIConfigurationManager.hpp>
+#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <boost/shared_ptr.hpp>
+
+
+static const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL";
+static const char ITEM_DESCRIPTOR_HELPURL[] = "HelpURL";
+static const char ITEM_DESCRIPTOR_CONTAINER[] = "ItemDescriptorContainer";
+static const char ITEM_DESCRIPTOR_LABEL[] = "Label";
+static const char ITEM_DESCRIPTOR_TYPE[] = "Type";
+static const char ITEM_DESCRIPTOR_STYLE[] = "Style";
+static const char ITEM_DESCRIPTOR_ISVISIBLE[] = "IsVisible";
+static const char ITEM_DESCRIPTOR_RESOURCEURL[] = "ResourceURL";
+static const char ITEM_DESCRIPTOR_UINAME[] = "UIName";
+
+static const char ITEM_MENUBAR_URL[] = "private:resource/menubar/menubar";
+static const char ITEM_TOOLBAR_URL[] = "private:resource/toolbar/";
+
+static const char CUSTOM_TOOLBAR_STR[] = "custom_toolbar_";
+static const char CUSTOM_MENU_STR[] = "vnd.openoffice.org:CustomMenu";
+
+class VbaCommandBarHelper;
+typedef ::boost::shared_ptr< VbaCommandBarHelper > VbaCommandBarHelperRef;
+
+class VbaCommandBarHelper
+{
+private:
+ css::uno::Reference< css::uno::XComponentContext > mxContext;
+ css::uno::Reference< css::frame::XModel > mxModel;
+ css::uno::Reference< css::ui::XUIConfigurationManager > m_xDocCfgMgr; // current document
+ css::uno::Reference< css::ui::XUIConfigurationManager > m_xAppCfgMgr;
+ css::uno::Reference< css::container::XNameAccess > m_xWindowState;
+ rtl::OUString maModuleId;
+
+ void Init() throw (css::uno::RuntimeException);
+ sal_Bool hasToolbar( const rtl::OUString& sResourceUrl, const rtl::OUString& sName ) throw (css::uno::RuntimeException);
+public:
+ VbaCommandBarHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel ) throw( css::uno::RuntimeException );
+
+ css::uno::Reference< css::frame::XModel > getModel() { return mxModel; }
+
+ css::uno::Reference< css::ui::XUIConfigurationManager > getDocCfgManager() throw (css::uno::RuntimeException)
+ {
+ return m_xDocCfgMgr;
+ }
+ css::uno::Reference< css::ui::XUIConfigurationManager > getAppCfgManager() throw (css::uno::RuntimeException)
+ {
+ return m_xAppCfgMgr;
+ }
+ css::uno::Reference< css::container::XNameAccess > getPersistentWindowState() throw (css::uno::RuntimeException)
+ {
+ return m_xWindowState;
+ }
+ sal_Bool persistChanges() throw (css::uno::RuntimeException);
+ css::uno::Reference< css::container::XIndexAccess > getSettings( const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException);
+ void removeSettings( const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException);
+ void ApplyChange( const rtl::OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, sal_Bool bTemporary = sal_True ) throw (css::uno::RuntimeException);
+
+ css::uno::Reference< css::frame::XLayoutManager > getLayoutManager() throw (css::uno::RuntimeException);
+
+ const rtl::OUString getModuleId(){ return maModuleId; }
+ rtl::OUString findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException);
+ static sal_Int32 findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException);
+ static rtl::OUString generateCustomURL();
+};
+
+#endif//VBA_COMMANDBARHELPER_HXX
diff --git a/vbahelper/source/vbahelper/vbacommandbars.cxx b/vbahelper/source/vbahelper/vbacommandbars.cxx
new file mode 100644
index 0000000000..e87e4a32f5
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacommandbars.cxx
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
+#include <com/sun/star/ui/XModuleUIConfigurationManager.hpp>
+#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
+
+#include "vbacommandbars.hxx"
+#include "vbacommandbar.hxx"
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > CommandBarEnumeration_BASE;
+
+class CommandBarEnumeration : public CommandBarEnumeration_BASE
+{
+ uno::Reference< XHelperInterface > m_xParent;
+ uno::Reference< uno::XComponentContext > m_xContext;
+ VbaCommandBarHelperRef pCBarHelper;
+ uno::Sequence< rtl::OUString > m_sNames;
+ sal_Int32 m_nCurrentPosition;
+public:
+ CommandBarEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, VbaCommandBarHelperRef pHelper) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), pCBarHelper( pHelper ) , m_nCurrentPosition( 0 )
+ {
+ uno::Reference< container::XNameAccess > xNameAccess = pCBarHelper->getPersistentWindowState();
+ m_sNames = xNameAccess->getElementNames();
+ }
+ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
+ {
+ if( m_nCurrentPosition < m_sNames.getLength() )
+ return sal_True;
+ return sal_False;
+ }
+ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
+ {
+ // FIXME: should be add menubar
+ if( hasMoreElements() )
+ {
+ rtl::OUString sResourceUrl( m_sNames[ m_nCurrentPosition++ ] );
+ if( sResourceUrl.indexOf( rtl::OUString::createFromAscii("private:resource/toolbar/") ) != -1 )
+ {
+ uno::Reference< container::XIndexAccess > xCBarSetting = pCBarHelper->getSettings( sResourceUrl );
+ uno::Reference< XCommandBar > xCommandBar( new ScVbaCommandBar( m_xParent, m_xContext, pCBarHelper, xCBarSetting, sResourceUrl, sal_False, sal_False ) );
+ }
+ else
+ return nextElement();
+ }
+ else
+ throw container::NoSuchElementException();
+ return uno::Any();
+ }
+};
+
+ScVbaCommandBars::ScVbaCommandBars( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess, const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) : CommandBars_BASE( xParent, xContext, xIndexAccess )
+{
+ pCBarHelper.reset( new VbaCommandBarHelper( mxContext, xModel ) );
+ m_xNameAccess = pCBarHelper->getPersistentWindowState();
+}
+
+ScVbaCommandBars::~ScVbaCommandBars()
+{
+}
+
+// XEnumerationAccess
+uno::Type SAL_CALL
+ScVbaCommandBars::getElementType() throw ( uno::RuntimeException )
+{
+ return XCommandBar::static_type( 0 );
+}
+
+uno::Reference< container::XEnumeration >
+ScVbaCommandBars::createEnumeration() throw ( uno::RuntimeException )
+{
+ return uno::Reference< container::XEnumeration >( new CommandBarEnumeration( this, mxContext, pCBarHelper ) );
+}
+
+uno::Any
+ScVbaCommandBars::createCollectionObject( const uno::Any& aSource )
+{
+ // aSource should be a name at this time, because of the class is API wrapper.
+ rtl::OUString sResourceUrl;
+ uno::Reference< container::XIndexAccess > xBarSettings;
+ rtl::OUString sBarName;
+ sal_Bool bMenu = sal_False;
+ if( aSource >>= sBarName )
+ {
+ if( sBarName.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii("Worksheet Menu Bar") )
+ || sBarName.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii("Menu Bar") ) )
+ {
+ // menu bar
+ sResourceUrl = rtl::OUString::createFromAscii( ITEM_MENUBAR_URL );
+ bMenu = sal_True;
+ }
+ else
+ {
+ sResourceUrl = pCBarHelper->findToolbarByName( m_xNameAccess, sBarName );
+ bMenu = sal_False;
+ }
+ }
+
+ if( sResourceUrl.getLength() )
+ xBarSettings = pCBarHelper->getSettings( sResourceUrl );
+ else
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toolbar do not exist") ), uno::Reference< uno::XInterface >() );
+
+ return uno::Any( uno::Reference< XCommandBar >( new ScVbaCommandBar( this, mxContext, pCBarHelper, xBarSettings, sResourceUrl, bMenu, sal_False ) ) );
+}
+
+// XCommandBars
+uno::Reference< XCommandBar > SAL_CALL
+ScVbaCommandBars::Add( const css::uno::Any& Name, const css::uno::Any& /*Position*/, const css::uno::Any& /*MenuBar*/, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
+{
+ // FIXME: only support to add Toolbar
+ // Position - MsoBar MenuBar - sal_Bool
+ // Currently only the Name is supported.
+ rtl::OUString sName;
+ if( Name.hasValue() )
+ Name >>= sName;
+
+ rtl::OUString sResourceUrl;
+ if( sName.getLength() )
+ {
+ sResourceUrl = pCBarHelper->findToolbarByName( m_xNameAccess, sName );
+ if( sResourceUrl.getLength() )
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toolbar exists") ), uno::Reference< uno::XInterface >() );
+ }
+ else
+ {
+ sName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom1") );
+ }
+
+ sal_Bool bTemporary = sal_False;
+ if( Temporary.hasValue() )
+ Temporary >>= bTemporary;
+
+ sResourceUrl = VbaCommandBarHelper::generateCustomURL();
+ uno::Reference< container::XIndexAccess > xBarSettings( pCBarHelper->getSettings( sResourceUrl ), uno::UNO_QUERY_THROW );
+ uno::Reference< XCommandBar > xCBar( new ScVbaCommandBar( this, mxContext, pCBarHelper, xBarSettings, sResourceUrl, sal_False, bTemporary ) );
+ xCBar->setName( sName );
+ return xCBar;
+}
+sal_Int32 SAL_CALL
+ScVbaCommandBars::getCount() throw(css::uno::RuntimeException)
+{
+ // Filter out all toolbars from the window collection
+ sal_Int32 nCount = 1; // there is a Menubar in OOo
+ uno::Sequence< ::rtl::OUString > allNames = m_xNameAccess->getElementNames();
+ for( sal_Int32 i = 0; i < allNames.getLength(); i++ )
+ {
+ if(allNames[i].indexOf( rtl::OUString::createFromAscii("private:resource/toolbar/") ) != -1 )
+ {
+ nCount++;
+ }
+ }
+ return nCount;
+}
+
+// ScVbaCollectionBaseImpl
+uno::Any SAL_CALL
+ScVbaCommandBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException )
+{
+ if( aIndex.getValueTypeClass() == uno::TypeClass_STRING )
+ {
+ return createCollectionObject( aIndex );
+ }
+
+ // hardcode if "aIndex = 1" that would return "main menu".
+ sal_Int16 nIndex = 0;
+ aIndex >>= nIndex;
+ if( nIndex == 1 )
+ {
+ uno::Any aSource;
+ if( pCBarHelper->getModuleId().equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" ) )
+ aSource <<= rtl::OUString::createFromAscii( "Worksheet Menu Bar" );
+ else if( pCBarHelper->getModuleId().equalsAscii("com.sun.star.text.TextDocument") )
+ aSource <<= rtl::OUString::createFromAscii( "Menu Bar" );
+ if( aSource.hasValue() )
+ return createCollectionObject( aSource );
+ }
+ return uno::Any();
+}
+
+// XHelperInterface
+rtl::OUString&
+ScVbaCommandBars::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBars") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaCommandBars::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBars" ) );
+ }
+ return aServiceNames;
+}
+
diff --git a/vbahelper/source/vbahelper/vbacommandbars.hxx b/vbahelper/source/vbahelper/vbacommandbars.hxx
new file mode 100644
index 0000000000..2c0cc3f83a
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbacommandbars.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef SC_VBA_COMMANDBARS_HXX
+#define SC_VBA_COMMANDBARS_HXX
+
+#include <ooo/vba/XCommandBar.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>
+#include "vbacommandbarhelper.hxx"
+
+typedef CollTestImplHelper< ov::XCommandBars > CommandBars_BASE;
+
+class ScVbaCommandBars : public CommandBars_BASE
+{
+private:
+ VbaCommandBarHelperRef pCBarHelper;
+
+public:
+ ScVbaCommandBars( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
+ virtual ~ScVbaCommandBars();
+
+ // XCommandBars
+ virtual css::uno::Reference< ov::XCommandBar > SAL_CALL Add( const css::uno::Any& Name, const css::uno::Any& Position, const css::uno::Any& MenuBar, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, 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 );
+
+ 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_COMMANDBARS_HXX
diff --git a/vbahelper/source/vbahelper/vbadialogbase.cxx b/vbahelper/source/vbahelper/vbadialogbase.cxx
new file mode 100644
index 0000000000..43f7f2cfeb
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbadialogbase.cxx
@@ -0,0 +1,51 @@
+/*************************************************************************
+ *
+ * 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: vbadialog.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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 <vbahelper/vbadialogbase.hxx>
+#include <vbahelper/vbahelper.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+// fails silently
+void
+VbaDialogBase::Show() throw(uno::RuntimeException)
+{
+ rtl::OUString aURL;
+ if ( m_xModel.is() )
+ {
+ aURL = mapIndexToName( mnIndex );
+ if( aURL.getLength() == 0 )
+ throw uno::RuntimeException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " Unable to open the specified dialog " ) ),
+ uno::Reference< XInterface > () );
+ dispatchRequests( m_xModel, aURL );
+ }
+}
+
diff --git a/vbahelper/source/vbahelper/vbadialogsbase.cxx b/vbahelper/source/vbahelper/vbadialogsbase.cxx
new file mode 100644
index 0000000000..ca74a1616f
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbadialogsbase.cxx
@@ -0,0 +1,47 @@
+/*************************************************************************
+ *
+ * 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: vbadialogs.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 <vbahelper/vbadialogsbase.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+::sal_Int32
+VbaDialogsBase::getCount() throw (uno::RuntimeException)
+{
+ //#TODO #FIXEME
+ return 0;
+}
+
+uno::Any
+VbaDialogsBase::Item( const uno::Any& /* &aItem */) throw (uno::RuntimeException)
+{
+ return uno::Any();
+}
+
diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx
new file mode 100644
index 0000000000..914c798a36
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx
@@ -0,0 +1,228 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 <vbahelper/vbadocumentbase.hxx>
+#include <vbahelper/helperdecl.hxx>
+#include <comphelper/unwrapargs.hxx>
+
+#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/util/XProtectable.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include <tools/urlobj.hxx>
+#include <osl/file.hxx>
+
+using namespace ::com::sun::star;
+using namespace ::ooo::vba;
+
+VbaDocumentBase::VbaDocumentBase( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext) :VbaDocumentBase_BASE( xParent, xContext ), mxModel(NULL)
+{
+}
+
+VbaDocumentBase::VbaDocumentBase( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< frame::XModel > xModel ) : VbaDocumentBase_BASE( xParent, xContext ), mxModel( xModel )
+{
+}
+
+VbaDocumentBase::VbaDocumentBase( uno::Sequence< uno::Any> const & args,
+ uno::Reference< uno::XComponentContext> const & xContext ) : VbaDocumentBase_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext ), mxModel( getXSomethingFromArgs< frame::XModel >( args, 1 ) )
+{
+}
+
+::rtl::OUString
+VbaDocumentBase::getName() throw (uno::RuntimeException)
+{
+ rtl::OUString sName = getModel()->getURL();
+ if ( sName.getLength() )
+ {
+
+ INetURLObject aURL( getModel()->getURL() );
+ ::osl::File::getSystemPathFromFileURL( aURL.GetLastName(), sName );
+ }
+ else
+ {
+ const static rtl::OUString sTitle( RTL_CONSTASCII_USTRINGPARAM("Title" ) );
+ // process "UntitledX - $(PRODUCTNAME)"
+ uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW );
+ xProps->getPropertyValue(sTitle ) >>= sName;
+ sal_Int32 pos = 0;
+ sName = sName.getToken(0,' ',pos);
+ }
+ return sName;
+}
+::rtl::OUString
+VbaDocumentBase::getPath() throw (uno::RuntimeException)
+{
+ INetURLObject aURL( getModel()->getURL() );
+ rtl::OUString sURL( aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
+ sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 );
+ rtl::OUString sPath;
+ ::osl::File::getSystemPathFromFileURL( sURL, sPath );
+ return sPath;
+}
+
+::rtl::OUString
+VbaDocumentBase::getFullName() throw (uno::RuntimeException)
+{
+ rtl::OUString sPath;
+ ::osl::File::getSystemPathFromFileURL( getModel()->getURL(), sPath );
+ return sPath;
+}
+
+void
+VbaDocumentBase::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg,
+ const uno::Any &rRouteArg ) throw (uno::RuntimeException)
+{
+ sal_Bool bSaveChanges = sal_False;
+ rtl::OUString aFileName;
+ sal_Bool bRouteWorkbook = sal_True;
+
+ rSaveArg >>= bSaveChanges;
+ sal_Bool bFileName = ( rFileArg >>= aFileName );
+ rRouteArg >>= bRouteWorkbook;
+ uno::Reference< frame::XStorable > xStorable( getModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY_THROW );
+
+ if( bSaveChanges )
+ {
+ if( xStorable->isReadonly() )
+ {
+ throw uno::RuntimeException(::rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "Unable to save to a read only file ") ),
+ uno::Reference< XInterface >() );
+ }
+ if( bFileName )
+ xStorable->storeAsURL( aFileName, uno::Sequence< beans::PropertyValue >(0) );
+ else
+ xStorable->store();
+ }
+ else
+ xModifiable->setModified( false );
+
+ uno::Reference< util::XCloseable > xCloseable( getModel(), uno::UNO_QUERY );
+
+ if( xCloseable.is() )
+ // use close(boolean DeliverOwnership)
+
+ // The boolean parameter DeliverOwnership tells objects vetoing the close process that they may
+ // assume ownership if they object the closure by throwing a CloseVetoException
+ // Here we give up ownership. To be on the safe side, catch possible veto exception anyway.
+ xCloseable->close(sal_True);
+ // If close is not supported by this model - try to dispose it.
+ // But if the model disagree with a reset request for the modify state
+ // we shouldn't do so. Otherwhise some strange things can happen.
+ else
+ {
+ uno::Reference< lang::XComponent > xDisposable ( getModel(), uno::UNO_QUERY );
+ if ( xDisposable.is() )
+ xDisposable->dispose();
+ }
+}
+
+void
+VbaDocumentBase::Protect( const uno::Any &aPassword ) throw (uno::RuntimeException)
+{
+ rtl::OUString rPassword;
+ uno::Reference< util::XProtectable > xProt( getModel(), uno::UNO_QUERY_THROW );
+ SC_VBA_FIXME(("Workbook::Protect stub"));
+ if( aPassword >>= rPassword )
+ xProt->protect( rPassword );
+ else
+ xProt->protect( rtl::OUString() );
+}
+
+void
+VbaDocumentBase::Unprotect( const uno::Any &aPassword ) throw (uno::RuntimeException)
+{
+ rtl::OUString rPassword;
+ uno::Reference< util::XProtectable > xProt( getModel(), uno::UNO_QUERY_THROW );
+ if( !xProt->isProtected() )
+ throw uno::RuntimeException(::rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "File is already unprotected" ) ),
+ uno::Reference< XInterface >() );
+ else
+ {
+ if( aPassword >>= rPassword )
+ xProt->unprotect( rPassword );
+ else
+ xProt->unprotect( rtl::OUString() );
+ }
+}
+
+void
+VbaDocumentBase::setSaved( sal_Bool bSave ) throw (uno::RuntimeException)
+{
+ uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY_THROW );
+ xModifiable->setModified( bSave );
+}
+
+sal_Bool
+VbaDocumentBase::getSaved() throw (uno::RuntimeException)
+{
+ uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY_THROW );
+ return xModifiable->isModified();
+}
+
+void
+VbaDocumentBase::Save() throw (uno::RuntimeException)
+{
+ rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Save"));
+ uno::Reference< frame::XModel > xModel = getModel();
+ dispatchRequests(xModel,url);
+}
+
+void
+VbaDocumentBase::Activate() throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
+ xFrame->activate();
+}
+
+rtl::OUString&
+VbaDocumentBase::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaDocumentBase") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+VbaDocumentBase::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.VbaDocumentBase" ) );
+ }
+ return aServiceNames;
+}
+
diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
new file mode 100644
index 0000000000..5d9145ad8a
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
@@ -0,0 +1,305 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 <vbahelper/vbadocumentsbase.hxx>
+#include <comphelper/processfactory.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/beans/PropertyVetoException.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <com/sun/star/document/XTypeDetection.hpp>
+#include <com/sun/star/document/MacroExecMode.hpp>
+#include <com/sun/star/uri/XUriReference.hpp>
+#include <com/sun/star/uri/XUriReferenceFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <sfx2/objsh.hxx>
+#include <tools/urlobj.hxx>
+#include <vbahelper/vbahelper.hxx>
+#include <hash_map>
+#include <osl/file.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+static const rtl::OUString sSpreadsheetDocument( rtl::OUString::createFromAscii( "com.sun.star.sheet.SpreadsheetDocument" ) );
+static const rtl::OUString sTextDocument( rtl::OUString::createFromAscii( "com.sun.star.text.TextDocument" ) );
+
+typedef std::hash_map< rtl::OUString,
+sal_Int32, ::rtl::OUStringHash,
+::std::equal_to< ::rtl::OUString > > NameIndexHash;
+
+typedef std::vector < uno::Reference< frame::XModel > > Documents;
+
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > DocumentsEnumImpl_BASE;
+
+// #FIXME clearly this is a candidate for some sort of helper base class as
+// this is a copy of SelectedSheetsEnum ( vbawindow.cxx )
+
+class DocumentsEnumImpl : public DocumentsEnumImpl_BASE
+{
+ uno::Reference< uno::XComponentContext > m_xContext;
+ Documents m_documents;
+ Documents::const_iterator m_it;
+
+public:
+ DocumentsEnumImpl( const uno::Reference< uno::XComponentContext >& xContext, const Documents& docs ) throw ( uno::RuntimeException ) : m_xContext( xContext ), m_documents( docs )
+ {
+ m_it = m_documents.begin();
+ }
+ DocumentsEnumImpl( const uno::Reference< uno::XComponentContext >& xContext ) throw ( uno::RuntimeException ) : m_xContext( xContext )
+ {
+ uno::Reference< lang::XMultiComponentFactory > xSMgr(
+ m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
+
+ uno::Reference< frame::XDesktop > xDesktop
+ (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), m_xContext), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XEnumeration > mxComponents = xDesktop->getComponents()->createEnumeration();
+ while( mxComponents->hasMoreElements() )
+ {
+ uno::Reference< frame::XModel > xNext( mxComponents->nextElement(), uno::UNO_QUERY );
+ if ( xNext.is() )
+ m_documents.push_back( xNext );
+ }
+ m_it = m_documents.begin();
+ }
+ // XEnumeration
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return m_it != m_documents.end();
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( !hasMoreElements() )
+ {
+ throw container::NoSuchElementException();
+ }
+ return makeAny( *(m_it++) );
+ }
+};
+
+// #FIXME clearly this is also a candidate for some sort of helper base class as
+// a very similar one is used in vbawindow ( SelectedSheetsEnumAccess )
+// Maybe a template base class that does all of the operations on the hashmap
+// and vector only, and the sub-class does everything else
+// => ctor, createEnumeration & factory method need be defined ( to be called
+// by getByIndex, getByName )
+typedef ::cppu::WeakImplHelper3< container::XEnumerationAccess
+ , com::sun::star::container::XIndexAccess
+ , com::sun::star::container::XNameAccess
+ > DocumentsAccessImpl_BASE;
+
+class DocumentsAccessImpl : public DocumentsAccessImpl_BASE
+{
+ uno::Reference< uno::XComponentContext > m_xContext;
+ Documents m_documents;
+ NameIndexHash namesToIndices;
+ VbaDocumentsBase::DOCUMENT_TYPE meDocType;
+public:
+ DocumentsAccessImpl( const uno::Reference< uno::XComponentContext >& xContext, VbaDocumentsBase::DOCUMENT_TYPE eDocType ) throw (uno::RuntimeException) :m_xContext( xContext ), meDocType( eDocType )
+ {
+ uno::Reference< container::XEnumeration > xEnum = new DocumentsEnumImpl( m_xContext );
+ sal_Int32 nIndex=0;
+ while( xEnum->hasMoreElements() )
+ {
+ uno::Reference< lang::XServiceInfo > xServiceInfo( xEnum->nextElement(), uno::UNO_QUERY );
+ if ( xServiceInfo.is()
+ && ( ( xServiceInfo->supportsService( sSpreadsheetDocument ) && meDocType == VbaDocumentsBase::EXCEL_DOCUMENT )
+ || ( xServiceInfo->supportsService( sTextDocument ) && meDocType == VbaDocumentsBase::WORD_DOCUMENT ) ) )
+ {
+ uno::Reference< frame::XModel > xModel( xServiceInfo, uno::UNO_QUERY_THROW ); // that the spreadsheetdocument is a xmodel is a given
+ m_documents.push_back( xModel );
+ INetURLObject aURL( xModel->getURL() );
+ namesToIndices[ aURL.GetLastName() ] = nIndex++;
+ }
+ }
+
+ }
+
+ //XEnumerationAccess
+ virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException)
+ {
+ return new DocumentsEnumImpl( m_xContext, m_documents );
+ }
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
+ {
+ return m_documents.size();
+ }
+ virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw ( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( Index < 0
+ || static_cast< Documents::size_type >(Index) >= m_documents.size() )
+ throw lang::IndexOutOfBoundsException();
+ return makeAny( m_documents[ Index ] ); // returns xspreadsheetdoc
+ }
+
+ //XElementAccess
+ virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException)
+ {
+ return frame::XModel::static_type(0);
+ }
+
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
+ {
+ return (m_documents.size() > 0);
+ }
+
+ //XNameAccess
+ virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ NameIndexHash::const_iterator it = namesToIndices.find( aName );
+ if ( it == namesToIndices.end() )
+ throw container::NoSuchElementException();
+ return makeAny( m_documents[ it->second ] );
+
+ }
+
+ virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException)
+ {
+ uno::Sequence< ::rtl::OUString > names( namesToIndices.size() );
+ ::rtl::OUString* pString = names.getArray();
+ NameIndexHash::const_iterator it = namesToIndices.begin();
+ NameIndexHash::const_iterator it_end = namesToIndices.end();
+ for ( ; it != it_end; ++it, ++pString )
+ *pString = it->first;
+ return names;
+ }
+
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
+ {
+ NameIndexHash::const_iterator it = namesToIndices.find( aName );
+ return (it != namesToIndices.end());
+ }
+
+};
+
+VbaDocumentsBase::VbaDocumentsBase( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext >& xContext, DOCUMENT_TYPE eDocType ) throw (uno::RuntimeException) : VbaDocumentsBase_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new DocumentsAccessImpl( xContext, eDocType ) ) ), meDocType( eDocType )
+{
+}
+
+uno::Any SAL_CALL
+VbaDocumentsBase::Add() throw (uno::RuntimeException)
+{
+ uno::Reference< lang::XMultiComponentFactory > xSMgr(
+ mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
+
+ uno::Reference< frame::XComponentLoader > xLoader(
+ xSMgr->createInstanceWithContext(
+ ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"),
+ mxContext), uno::UNO_QUERY_THROW );
+ rtl::OUString sURL;
+ if( meDocType == WORD_DOCUMENT )
+ sURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("private:factory/swriter") );
+ else if( meDocType == EXCEL_DOCUMENT )
+ sURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("private:factory/scalc") );
+ else
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL(
+ sURL ,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0,
+ uno::Sequence< beans::PropertyValue >(0) );
+ return uno::makeAny( xComponent );
+}
+
+void
+VbaDocumentsBase::Close() throw (uno::RuntimeException)
+{
+// #FIXME this *MUST* be wrong documents::close surely closes ALL documents
+// in the collection, use of getCurrentDocument here is totally wrong
+/*
+ uno::Reference< lang::XMultiComponentFactory > xSMgr(
+ mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+ rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CloseDoc"));
+ dispatchRequests(xModel,url);
+*/
+}
+
+// #TODO# #FIXME# can any of the unused params below be used?
+uno::Any
+VbaDocumentsBase::Open( const rtl::OUString& rFileName, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (uno::RuntimeException)
+{
+ // we need to detect if this is a URL, if not then assume its a file path
+ rtl::OUString aURL;
+ INetURLObject aObj;
+ aObj.SetURL( rFileName );
+ bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+ if ( bIsURL )
+ aURL = rFileName;
+ else
+ osl::FileBase::getFileURLFromSystemPath( rFileName, aURL );
+ uno::Reference< lang::XMultiComponentFactory > xSMgr(
+ mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XDesktop > xDesktop
+ (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop") , mxContext),
+ uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XComponentLoader > xLoader(
+ xSMgr->createInstanceWithContext(
+ ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"),
+ mxContext),
+ uno::UNO_QUERY_THROW );
+
+ uno::Sequence< beans::PropertyValue > sProps( rProps );
+ sProps.realloc( sProps.getLength() + 1 );
+ sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode") );
+ sProps[ sProps.getLength() - 1 ].Value <<= uno::makeAny( document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN );
+
+ sal_Int32 nIndex = sProps.getLength() - 1;
+
+ if ( ReadOnly.hasValue() )
+ {
+ sal_Bool bIsReadOnly = sal_False; ReadOnly >>= bIsReadOnly;
+ if ( bIsReadOnly )
+ {
+ static const rtl::OUString sReadOnly( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") );
+ sProps.realloc( sProps.getLength() + 1 );
+ sProps[ nIndex ].Name = sReadOnly;
+ sProps[ nIndex++ ].Value = uno::makeAny( (sal_Bool)sal_True );
+ }
+ }
+
+ uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL( aURL,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_default") ),
+ frame::FrameSearchFlag::CREATE,
+ sProps);
+ return uno::makeAny( xComponent );
+}
+
diff --git a/vbahelper/source/vbahelper/vbafillformat.cxx b/vbahelper/source/vbahelper/vbafillformat.cxx
new file mode 100644
index 0000000000..ed7fcd2c5a
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbafillformat.cxx
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * 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: vbafillformat.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/awt/Gradient.hpp>
+#include <com/sun/star/awt/GradientStyle.hpp>
+#include <ooo/vba/office/MsoGradientStyle.hpp>
+#include "vbafillformat.hxx"
+#include "vbacolorformat.hxx"
+
+using namespace ooo::vba;
+using namespace com::sun::star;
+
+ScVbaFillFormat::ScVbaFillFormat( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape > xShape ) : ScVbaFillFormat_BASE( xParent, xContext ), m_xShape( xShape )
+{
+ m_xPropertySet.set( xShape, uno::UNO_QUERY_THROW );
+ m_nFillStyle = drawing::FillStyle_SOLID;
+ m_nForeColor = 0;
+ m_nBackColor = 0;
+ m_nGradientAngle = 0;
+}
+
+void
+ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::RuntimeException)
+{
+ m_nFillStyle = nFillStyle;
+ if( m_nFillStyle == drawing::FillStyle_GRADIENT )
+ {
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillStyle"), uno::makeAny( drawing::FillStyle_GRADIENT ) );
+ awt::Gradient aGradient;
+ // AXIAL
+ // RADIAL
+ // ELLIPTICAL
+ // SQUARE
+ // RECT
+ aGradient.Style = awt::GradientStyle_LINEAR;
+ aGradient.StartColor = ForeColor()->getRGB();
+ aGradient.EndColor = BackColor()->getRGB();
+ aGradient.Angle = m_nGradientAngle;
+ aGradient.Border = 0;
+ aGradient.XOffset = 0;
+ aGradient.YOffset = 0;
+ aGradient.StartIntensity = 100;
+ aGradient.EndIntensity = 100;
+ aGradient.StepCount = 1;
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillGradient"), uno::makeAny( aGradient ) );
+ }
+ else if( m_nFillStyle == drawing::FillStyle_SOLID )
+ {
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillStyle"), uno::makeAny(drawing::FillStyle_SOLID) );
+ }
+}
+
+void
+ScVbaFillFormat::setForeColorAndInternalStyle( sal_Int32 nForeColor ) throw (css::uno::RuntimeException)
+{
+ m_nForeColor = nForeColor;
+ setFillStyle( m_nFillStyle );
+}
+
+// Attributes
+sal_Bool SAL_CALL
+ScVbaFillFormat::getVisible() throw (uno::RuntimeException)
+{
+ drawing::FillStyle nFillStyle;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("FillStyle") ) >>= nFillStyle;
+ if( nFillStyle == drawing::FillStyle_NONE )
+ return sal_False;
+ return sal_True;
+}
+
+void SAL_CALL
+ScVbaFillFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException)
+{
+ drawing::FillStyle aFillStyle;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("FillStyle") ) >>= aFillStyle;
+ if( !_visible )
+ {
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillStyle"), uno::makeAny( drawing::FillStyle_NONE ) );
+ }
+ else
+ {
+ if( aFillStyle == drawing::FillStyle_NONE )
+ {
+ setFillStyle( m_nFillStyle );
+ }
+ }
+}
+
+double SAL_CALL
+ScVbaFillFormat::getTransparency() throw (uno::RuntimeException)
+{
+ sal_Int16 nTransparence = 0;
+ double dTransparence = 0;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "FillTransparence" ) ) >>= nTransparence;
+ dTransparence = static_cast<double>( nTransparence );
+ dTransparence /= 100;
+ return dTransparence;
+}
+
+void SAL_CALL
+ScVbaFillFormat::setTransparency( double _transparency ) throw (uno::RuntimeException)
+{
+ sal_Int16 nTransparence = static_cast< sal_Int16 >( _transparency * 100 );
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillTransparence" ), uno::makeAny( nTransparence ) );
+}
+
+
+// Methods
+void SAL_CALL
+ScVbaFillFormat::Solid() throw (uno::RuntimeException)
+{
+ setFillStyle( drawing::FillStyle_SOLID );
+}
+
+void SAL_CALL
+ScVbaFillFormat::TwoColorGradient( sal_Int32 style, sal_Int32 /*variant*/ ) throw (uno::RuntimeException)
+{
+ if( style == office::MsoGradientStyle::msoGradientHorizontal )
+ {
+ m_nGradientAngle = 0;
+ setFillStyle( drawing::FillStyle_GRADIENT );
+ }
+ else if( style == office::MsoGradientStyle::msoGradientVertical )
+ {
+ m_nGradientAngle = 900;
+ setFillStyle( drawing::FillStyle_GRADIENT );
+ }
+ else if( style == office::MsoGradientStyle::msoGradientDiagonalDown )
+ {
+ m_nGradientAngle = 450;
+ setFillStyle( drawing::FillStyle_GRADIENT );
+ }
+ else if( style == office::MsoGradientStyle::msoGradientDiagonalUp )
+ {
+ m_nGradientAngle = 900 + 450;
+ setFillStyle( drawing::FillStyle_GRADIENT );
+ }
+}
+
+uno::Reference< msforms::XColorFormat > SAL_CALL
+ScVbaFillFormat::BackColor() throw (uno::RuntimeException)
+{
+ if( !m_xColorFormat.is() )
+ m_xColorFormat.set( new ScVbaColorFormat( getParent(), mxContext, this, m_xShape, ColorFormatType::FILLFORMAT_BACKCOLOR ) );
+ return m_xColorFormat;
+}
+
+uno::Reference< msforms::XColorFormat > SAL_CALL
+ScVbaFillFormat::ForeColor() throw (uno::RuntimeException)
+{
+ if( !m_xColorFormat.is() )
+ m_xColorFormat.set( new ScVbaColorFormat( getParent(), mxContext, this, m_xShape, ColorFormatType::FILLFORMAT_FORECOLOR ) );
+ return m_xColorFormat;
+}
+
+
+rtl::OUString&
+ScVbaFillFormat::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaFillFormat") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaFillFormat::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.FillFormat" ) );
+ }
+ return aServiceNames;
+}
+
diff --git a/vbahelper/source/vbahelper/vbafillformat.hxx b/vbahelper/source/vbahelper/vbafillformat.hxx
new file mode 100644
index 0000000000..047af92a5f
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbafillformat.hxx
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * 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: vbafillformat.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_XFILLFORMAT_HXX
+#define SC_VBA_XFILLFORMAT_HXX
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <ooo/vba/msforms/XFillFormat.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::msforms::XFillFormat > ScVbaFillFormat_BASE;
+
+class ScVbaFillFormat : public ScVbaFillFormat_BASE
+{
+private:
+ css::uno::Reference< css::drawing::XShape > m_xShape;
+ css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
+ css::uno::Reference< ov::msforms::XColorFormat > m_xColorFormat;
+ css::drawing::FillStyle m_nFillStyle;
+ sal_Int32 m_nForeColor;
+ sal_Int32 m_nBackColor;
+ sal_Int16 m_nGradientAngle;
+private:
+ void setFillStyle( css::drawing::FillStyle nFillStyle ) throw (css::uno::RuntimeException);
+protected:
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+
+public:
+ ScVbaFillFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape );
+
+ void setForeColorAndInternalStyle( sal_Int32 nForeColor ) throw (css::uno::RuntimeException);
+ // Attributes
+ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getTransparency() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTransparency( double _transparency ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL Solid() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL TwoColorGradient( sal_Int32 style, sal_Int32 variant ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XColorFormat > SAL_CALL BackColor() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XColorFormat > SAL_CALL ForeColor() throw (css::uno::RuntimeException);
+
+};
+
+#endif//SC_VBA_XFILLFORMAT_HXX
diff --git a/vbahelper/source/vbahelper/vbafontbase.cxx b/vbahelper/source/vbahelper/vbafontbase.cxx
new file mode 100644
index 0000000000..d6265d46a7
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbafontbase.cxx
@@ -0,0 +1,309 @@
+/*************************************************************************
+ *
+ * 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: vbafont.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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 <com/sun/star/beans/XProperty.hpp>
+#include <com/sun/star/awt/FontWeight.hpp>
+#include <com/sun/star/awt/FontUnderline.hpp>
+#include <com/sun/star/awt/FontStrikeout.hpp>
+#include <com/sun/star/awt/FontSlant.hpp>
+#include <com/sun/star/text/XSimpleText.hpp>
+#include <vbahelper/vbafontbase.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+VbaFontBase::VbaFontBase( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::container::XIndexAccess >& xPalette, uno::Reference< beans::XPropertySet > xPropertySet ) throw ( uno::RuntimeException ) : VbaFontBase_BASE( xParent, xContext ), mxFont( xPropertySet, css::uno::UNO_QUERY_THROW ), mxPalette( xPalette )
+{
+}
+
+VbaFontBase::~VbaFontBase()
+{
+}
+
+
+void SAL_CALL
+VbaFontBase::setSuperscript( const uno::Any& aValue ) throw ( uno::RuntimeException )
+{
+ sal_Bool bValue = sal_False;
+ aValue >>= bValue;
+ sal_Int16 nValue = NORMAL;
+ sal_Int8 nValue2 = NORMALHEIGHT;
+
+ if( bValue )
+ {
+ nValue = SUPERSCRIPT;
+ nValue2 = SUPERSCRIPTHEIGHT;
+ }
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapement" ) ), ( uno::Any )nValue );
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapementHeight" ) ), ( uno::Any )nValue2 );
+}
+
+uno::Any SAL_CALL
+VbaFontBase::getSuperscript() throw ( uno::RuntimeException )
+{
+ short nValue = 0;
+ mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapement" ) ) ) >>= nValue;
+ return uno::makeAny( ( nValue == SUPERSCRIPT ) );
+}
+
+void SAL_CALL
+VbaFontBase::setSubscript( const uno::Any& aValue ) throw ( uno::RuntimeException )
+{
+ sal_Bool bValue = sal_False;
+ aValue >>= bValue;
+ sal_Int16 nValue = NORMAL;
+ sal_Int8 nValue2 = NORMALHEIGHT;
+
+ if( bValue )
+ {
+ nValue= SUBSCRIPT;
+ nValue2 = SUBSCRIPTHEIGHT;
+ }
+
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapementHeight" ) ), ( uno::Any )nValue2 );
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapement" ) ), ( uno::Any )nValue );
+
+}
+
+uno::Any SAL_CALL
+VbaFontBase::getSubscript() throw ( uno::RuntimeException )
+{
+ short nValue = NORMAL;
+ mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapement" ) ) ) >>= nValue;
+ return uno::makeAny( ( nValue == SUBSCRIPT ) );
+}
+
+void SAL_CALL
+VbaFontBase::setSize( const uno::Any& aValue ) throw( uno::RuntimeException )
+{
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ), aValue );
+}
+
+uno::Any SAL_CALL
+VbaFontBase::getSize() throw ( uno::RuntimeException )
+{
+ return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ) );
+}
+
+void SAL_CALL
+VbaFontBase::setColorIndex( const uno::Any& _colorindex ) throw( uno::RuntimeException )
+{
+ sal_Int32 nIndex = 0;
+ _colorindex >>= nIndex;
+
+ --nIndex; // OOo indices are zero bases
+
+ // setColor expects colors in XL RGB values
+ // #FIXME this is daft we convert OO RGB val to XL RGB val and
+ // then back again to OO RGB value
+ setColor( OORGBToXLRGB(mxPalette->getByIndex( nIndex )) );
+}
+
+
+uno::Any SAL_CALL
+VbaFontBase::getColorIndex() throw ( uno::RuntimeException )
+{
+ sal_Int32 nColor = 0;
+
+ XLRGBToOORGB( getColor() ) >>= nColor;
+ sal_Int32 nElems = mxPalette->getCount();
+ sal_Int32 nIndex = -1;
+ for ( sal_Int32 count=0; count<nElems; ++count )
+ {
+ sal_Int32 nPaletteColor = 0;
+ mxPalette->getByIndex( count ) >>= nPaletteColor;
+ if ( nPaletteColor == nColor )
+ {
+ nIndex = count + 1; // 1 based
+ break;
+ }
+ }
+ return uno::makeAny( nIndex );
+}
+
+void SAL_CALL
+VbaFontBase::setBold( const uno::Any& aValue ) throw( uno::RuntimeException )
+{
+ sal_Bool bValue = sal_False;
+ aValue >>= bValue;
+ double fBoldValue = awt::FontWeight::NORMAL;
+ if( bValue )
+ fBoldValue = awt::FontWeight::BOLD;
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ), ( uno::Any )fBoldValue );
+
+}
+
+uno::Any SAL_CALL
+VbaFontBase::getBold() throw ( uno::RuntimeException )
+{
+ double fValue = 0.0;
+ mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ) ) >>= fValue;
+ return uno::makeAny( fValue == awt::FontWeight::BOLD );
+}
+
+void SAL_CALL
+VbaFontBase::setStrikethrough( const uno::Any& aValue ) throw ( uno::RuntimeException )
+{
+ sal_Bool bValue = sal_False;
+ aValue >>= bValue;
+ short nValue = awt::FontStrikeout::NONE;
+ if( bValue )
+ nValue = awt::FontStrikeout::SINGLE;
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharStrikeout" ) ), ( uno::Any )nValue );
+}
+
+uno::Any SAL_CALL
+VbaFontBase::getStrikethrough() throw ( uno::RuntimeException )
+{
+ short nValue = 0;
+ mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharStrikeout" ) ) ) >>= nValue;
+ return uno::Any( nValue == awt::FontStrikeout::SINGLE );
+}
+
+void SAL_CALL
+VbaFontBase::setShadow( const uno::Any& aValue ) throw ( uno::RuntimeException )
+{
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ), aValue );
+}
+
+uno::Any SAL_CALL
+VbaFontBase::getShadow() throw (uno::RuntimeException)
+{
+ return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ) );
+}
+
+void SAL_CALL
+VbaFontBase::setItalic( const uno::Any& aValue ) throw ( uno::RuntimeException )
+{
+ sal_Bool bValue = sal_False;
+ aValue >>= bValue;
+ short nValue = awt::FontSlant_NONE;
+ if( bValue )
+ nValue = awt::FontSlant_ITALIC;
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ), ( uno::Any )nValue );
+}
+
+uno::Any SAL_CALL
+VbaFontBase::getItalic() throw ( uno::RuntimeException )
+{
+
+ awt::FontSlant aFS;
+ mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ) ) >>= aFS;
+ return uno::makeAny( aFS == awt::FontSlant_ITALIC );
+}
+
+void SAL_CALL
+VbaFontBase::setName( const uno::Any& aValue ) throw ( uno::RuntimeException )
+{
+ rtl::OUString sString;
+ aValue >>= sString;
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ), aValue);
+}
+
+uno::Any SAL_CALL
+VbaFontBase::getName() throw ( uno::RuntimeException )
+{
+ return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ) );
+}
+uno::Any
+VbaFontBase::getColor() throw (uno::RuntimeException)
+{
+ uno::Any aAny;
+ aAny = OORGBToXLRGB( mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ) ) );
+ return aAny;
+}
+
+void
+VbaFontBase::setColor( const uno::Any& _color ) throw (uno::RuntimeException)
+{
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ) , XLRGBToOORGB(_color));
+}
+
+void SAL_CALL
+VbaFontBase::setUnderline( const uno::Any& /*aValue*/ ) throw ( uno::RuntimeException )
+{
+/*
+ // default
+ sal_Int32 nValue = excel::XlUnderlineStyle::xlUnderlineStyleNone;
+ aValue >>= nValue;
+ switch ( nValue )
+ {
+// NOTE:: #TODO #FIMXE
+// xlUnderlineStyleDoubleAccounting & xlUnderlineStyleSingleAccounting
+// don't seem to be supported in Openoffice.
+// The import filter converts them to single or double underlines as appropriate
+// So, here at the moment we are similarly silently converting
+// xlUnderlineStyleSingleAccounting to xlUnderlineStyleSingle.
+
+ case excel::XlUnderlineStyle::xlUnderlineStyleNone:
+ nValue = awt::FontUnderline::NONE;
+ break;
+ case excel::XlUnderlineStyle::xlUnderlineStyleSingle:
+ case excel::XlUnderlineStyle::xlUnderlineStyleSingleAccounting:
+ nValue = awt::FontUnderline::SINGLE;
+ break;
+ case excel::XlUnderlineStyle::xlUnderlineStyleDouble:
+ case excel::XlUnderlineStyle::xlUnderlineStyleDoubleAccounting:
+ nValue = awt::FontUnderline::DOUBLE;
+ break;
+ default:
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Unknown value for Underline")), uno::Reference< uno::XInterface >() );
+ }
+
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharUnderline" ) ), ( uno::Any )nValue );
+*/
+
+}
+
+uno::Any SAL_CALL
+VbaFontBase::getUnderline() throw ( uno::RuntimeException )
+{
+ sal_Int32 nValue = awt::FontUnderline::NONE;
+ mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharUnderline" ) ) ) >>= nValue;
+/*
+ switch ( nValue )
+ {
+ case awt::FontUnderline::DOUBLE:
+ nValue = excel::XlUnderlineStyle::xlUnderlineStyleDouble;
+ break;
+ case awt::FontUnderline::SINGLE:
+ nValue = excel::XlUnderlineStyle::xlUnderlineStyleSingle;
+ break;
+ case awt::FontUnderline::NONE:
+ nValue = excel::XlUnderlineStyle::xlUnderlineStyleNone;
+ break;
+ default:
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Unknown value retrieved for Underline") ), uno::Reference< uno::XInterface >() );
+
+ }
+*/
+ return uno::makeAny( nValue );
+}
+
+
diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx
new file mode 100644
index 0000000000..bc0eda2103
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile$
+ *
+ * $Revision$
+ *
+ * last change: $Author$ $Date$
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "vbahelper/vbaglobalbase.hxx"
+
+#include <cppuhelper/component_context.hxx>
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/container/XNameContainer.hpp>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+rtl::OUString sApplication( RTL_CONSTASCII_USTRINGPARAM("Application") );
+
+VbaGlobalsBase::VbaGlobalsBase(
+const uno::Reference< ov::XHelperInterface >& xParent,
+const uno::Reference< uno::XComponentContext >& xContext, const rtl::OUString& sDocCtxName )
+: Globals_BASE( xParent, xContext )
+{
+ // overwrite context with custom one ( that contains the application )
+ ::cppu::ContextEntry_Init aHandlerContextInfo[] =
+ {
+ ::cppu::ContextEntry_Init( sApplication, uno::Any() ),
+ ::cppu::ContextEntry_Init( sDocCtxName, uno::Any() ),
+ };
+
+ mxContext = ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), xContext );
+
+}
+
+
+void
+VbaGlobalsBase::init( const uno::Sequence< beans::PropertyValue >& aInitArgs )
+{
+ sal_Int32 nLen = aInitArgs.getLength();
+ for ( sal_Int32 nIndex = 0; nIndex < nLen; ++nIndex )
+ {
+ uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY_THROW );
+ if ( aInitArgs[ nIndex ].Name.equals( sApplication ) )
+ {
+ xNameContainer->replaceByName( sApplication, aInitArgs[ nIndex ].Value );
+ uno::Reference< XHelperInterface > xParent( aInitArgs[ nIndex ].Value, uno::UNO_QUERY );
+ mxParent = xParent;
+ }
+ else
+ xNameContainer->replaceByName( aInitArgs[ nIndex ].Name, aInitArgs[ nIndex ].Value );
+ }
+}
+
+uno::Reference< uno::XInterface > SAL_CALL
+VbaGlobalsBase::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw (uno::Exception, uno::RuntimeException)
+{
+ uno::Reference< uno::XInterface > xReturn;
+
+ if ( hasServiceName( aServiceSpecifier ) )
+ xReturn = mxContext->getServiceManager()->createInstanceWithContext( aServiceSpecifier, mxContext );
+ return xReturn;
+}
+
+uno::Reference< uno::XInterface > SAL_CALL
+VbaGlobalsBase::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& Arguments ) throw (uno::Exception, uno::RuntimeException)
+{
+
+ uno::Reference< uno::XInterface > xReturn;
+
+ if ( hasServiceName( ServiceSpecifier ) )
+ xReturn = mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( ServiceSpecifier, Arguments, mxContext );
+ return xReturn;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL
+VbaGlobalsBase::getAvailableServiceNames( ) throw (uno::RuntimeException)
+{
+ static const rtl::OUString names[] = {
+ // common
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.msforms.UserForm" ) ),
+ };
+ static uno::Sequence< rtl::OUString > serviceNames( names, sizeof( names )/ sizeof( names[0] ) );
+ return serviceNames;
+}
+
+bool
+VbaGlobalsBase::hasServiceName( const rtl::OUString& serviceName )
+{
+ uno::Sequence< rtl::OUString > sServiceNames( getAvailableServiceNames() );
+ sal_Int32 nLen = sServiceNames.getLength();
+ for ( sal_Int32 index = 0; index < nLen; ++index )
+ {
+ if ( sServiceNames[ index ].equals( serviceName ) )
+ return true;
+ }
+ return false;
+}
+
+
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
new file mode 100644
index 0000000000..5ece204ad7
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -0,0 +1,1199 @@
+/*************************************************************************
+ *
+ * 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: vbahelper.cxx,v $
+ * $Revision: 1.5.32.1 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include <cppuhelper/bootstrap.hxx>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/script/XDefaultProperty.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XIntrospection.hpp>
+#include <ooo/vba/msforms/XShape.hpp>
+
+#include <comphelper/processfactory.hxx>
+
+#include <sfx2/objsh.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/app.hxx>
+#include <svtools/stritem.hxx>
+#include <svtools/eitem.hxx>
+#include <svtools/intitem.hxx>
+#include <svtools/itemset.hxx>
+//#include <svtools/itempool.hxx>
+#include <sfx2/docfac.hxx>
+#include <sfx2/viewfac.hxx>
+
+#include <basic/sbx.hxx>
+#include <basic/sbstar.hxx>
+#include <basic/basmgr.hxx>
+#include <basic/sbmod.hxx>
+#include <basic/sbmeth.hxx>
+#include <rtl/math.hxx>
+#include <sfx2/viewsh.hxx>
+#include <math.h>
+#include <tools/urlobj.hxx>
+#include <osl/file.hxx>
+#include <toolkit/awt/vclxwindow.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <com/sun/star/frame/XModel2.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <vcl/window.hxx>
+#include <vcl/syswin.hxx>
+#include <tools/diagnose_ex.h>
+
+#ifndef OOVBA_DLLIMPLEMENTATION
+#define OOVBA_DLLIMPLEMENTATION
+#endif
+
+#include <vbahelper/vbahelper.hxx>
+#include <sfx2/app.hxx>
+// #FIXME needs service
+//#include "vbashape.hxx"
+//#include "unonames.hxx"
+
+using namespace ::com::sun::star;
+using namespace ::ooo::vba;
+
+#define NAME_HEIGHT "Height"
+#define NAME_WIDTH "Width"
+
+#define POINTTO100THMILLIMETERFACTOR 35.27778
+
+
+void unoToSbxValue( SbxVariable* pVar, const uno::Any& aValue );
+
+uno::Any sbxToUnoValue( SbxVariable* pVar );
+
+
+namespace ooo
+{
+namespace vba
+{
+
+uno::Reference< lang::XMultiServiceFactory > getVBAServiceFactory( SfxObjectShell* pShell )
+{
+ uno::Any aUnoVar;
+ if ( !pShell || ! pShell->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aUnoVar ) )
+ throw lang::IllegalArgumentException();
+ uno::Reference< lang::XMultiServiceFactory > xVBAFactory( aUnoVar, uno::UNO_QUERY_THROW );
+ return xVBAFactory;
+}
+
+css::uno::Reference< css::uno::XInterface > createVBAUnoAPIService( SfxObjectShell* pShell, const sal_Char* _pAsciiName ) throw (css::uno::RuntimeException)
+{
+ OSL_PRECOND( pShell, "createVBAUnoAPIService: no shell!" );
+ ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) );
+ return getVBAServiceFactory( pShell )->createInstance( sVarName );
+}
+
+css::uno::Reference< css::uno::XInterface > createVBAUnoAPIServiceWithArgs( SfxObjectShell* pShell, const sal_Char* _pAsciiName, const uno::Sequence< uno::Any >& aArgs ) throw ( css::uno::RuntimeException )
+{
+ OSL_PRECOND( pShell, "createVBAUnoAPIService: no shell!" );
+ ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) );
+ uno::Reference< uno::XInterface > xIf = getVBAServiceFactory( pShell )->createInstanceWithArguments( sVarName, aArgs );
+ return xIf;
+}
+// helper method to determine if the view ( calc ) is in print-preview mode
+bool isInPrintPreview( SfxViewFrame* pView )
+{
+ sal_uInt16 nViewNo = SID_VIEWSHELL1 - SID_VIEWSHELL0;
+ if ( pView->GetObjectShell()->GetFactory().GetViewFactoryCount() >
+nViewNo && !pView->GetObjectShell()->IsInPlaceActive() )
+ {
+ SfxViewFactory &rViewFactory =
+ pView->GetObjectShell()->GetFactory().GetViewFactory(nViewNo);
+ if ( pView->GetCurViewId() == rViewFactory.GetOrdinal() )
+ return true;
+ }
+ return false;
+}
+#if 0
+namespace excel // all in this namespace probably can be moved to sc
+{
+
+
+const ::rtl::OUString REPLACE_CELLS_WARNING( RTL_CONSTASCII_USTRINGPARAM( "ReplaceCellsWarning"));
+class PasteCellsWarningReseter
+{
+private:
+ bool bInitialWarningState;
+ static uno::Reference< beans::XPropertySet > getGlobalSheetSettings() throw ( uno::RuntimeException )
+ {
+ static uno::Reference< beans::XPropertySet > xTmpProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ static uno::Reference<uno::XComponentContext > xContext( xTmpProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
+ static uno::Reference<lang::XMultiComponentFactory > xServiceManager(
+ xContext->getServiceManager(), uno::UNO_QUERY_THROW );
+ static uno::Reference< beans::XPropertySet > xProps( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.GlobalSheetSettings" ) ) ,xContext ), uno::UNO_QUERY_THROW );
+ return xProps;
+ }
+
+ bool getReplaceCellsWarning() throw ( uno::RuntimeException )
+ {
+ sal_Bool res = sal_False;
+ getGlobalSheetSettings()->getPropertyValue( REPLACE_CELLS_WARNING ) >>= res;
+ return ( res == sal_True );
+ }
+
+ void setReplaceCellsWarning( bool bState ) throw ( uno::RuntimeException )
+ {
+ getGlobalSheetSettings()->setPropertyValue( REPLACE_CELLS_WARNING, uno::makeAny( bState ) );
+ }
+public:
+ PasteCellsWarningReseter() throw ( uno::RuntimeException )
+ {
+ bInitialWarningState = getReplaceCellsWarning();
+ if ( bInitialWarningState )
+ setReplaceCellsWarning( false );
+ }
+ ~PasteCellsWarningReseter()
+ {
+ if ( bInitialWarningState )
+ {
+ // don't allow dtor to throw
+ try
+ {
+ setReplaceCellsWarning( true );
+ }
+ catch ( uno::Exception& /*e*/ ){}
+ }
+ }
+};
+
+void
+implnPaste()
+{
+ PasteCellsWarningReseter resetWarningBox;
+ ScTabViewShell* pViewShell = getCurrentBestViewShell();
+ if ( pViewShell )
+ {
+ pViewShell->PasteFromSystem();
+ pViewShell->CellContentChanged();
+ }
+}
+
+
+void
+implnCopy()
+{
+ ScTabViewShell* pViewShell = getCurrentBestViewShell();
+ if ( pViewShell )
+ pViewShell->CopyToClip(NULL,false,false,true);
+}
+
+void
+implnCut()
+{
+ ScTabViewShell* pViewShell = getCurrentBestViewShell();
+ if ( pViewShell )
+ pViewShell->CutToClip( NULL, TRUE );
+}
+void implnPasteSpecial(SfxViewShell* pViewShell, USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose)
+{
+ PasteCellsWarningReseter resetWarningBox;
+ sal_Bool bAsLink(sal_False), bOtherDoc(sal_False);
+ InsCellCmd eMoveMode = INS_NONE;
+
+ if ( !pTabViewShell )
+ // none active, try next best
+ pTabViewShell = getCurrentBestViewShell();
+ if ( pTabViewShell )
+ {
+ ScViewData* pView = pTabViewShell->GetViewData();
+ Window* pWin = ( pView != NULL ) ? pView->GetActiveWin() : NULL;
+ if ( pView && pWin )
+ {
+ if ( bAsLink && bOtherDoc )
+ pTabViewShell->PasteFromSystem(0);//SOT_FORMATSTR_ID_LINK
+ else
+ {
+ ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
+ ScDocument* pDoc = NULL;
+ if ( pOwnClip )
+ pDoc = pOwnClip->GetDocument();
+ pTabViewShell->PasteFromClip( nFlags, pDoc,
+ nFunction, bSkipEmpty, bTranspose, bAsLink,
+ eMoveMode, IDF_NONE, TRUE );
+ pTabViewShell->CellContentChanged();
+ }
+ }
+ }
+
+}
+
+ScDocShell*
+getDocShell( css::uno::Reference< css::frame::XModel>& xModel )
+{
+ uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW );
+ ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() );
+ ScDocShell* pDocShell = NULL;
+ if ( pModel )
+ pDocShell = (ScDocShell*)pModel->GetEmbeddedObject();
+ return pDocShell;
+
+}
+
+ScTabViewShell*
+getBestViewShell( css::uno::Reference< css::frame::XModel>& xModel )
+{
+ ScDocShell* pDocShell = getDocShell( xModel );
+ if ( pDocShell )
+ return pDocShell->GetBestViewShell();
+ return NULL;
+}
+
+ScTabViewShell*
+getCurrentBestViewShell()
+{
+ uno::Reference< frame::XModel > xModel = getCurrentDocument();
+ return getBestViewShell( xModel );
+}
+
+SfxViewFrame*
+getCurrentViewFrame()
+{
+ ScTabViewShell* pViewShell = getCurrentBestViewShell();
+ if ( pViewShell )
+ return pViewShell->GetViewFrame();
+ return NULL;
+}
+};
+
+#endif
+const double Millimeter::factor = 35.27778;
+
+uno::Reference< beans::XIntrospectionAccess >
+getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
+{
+ static uno::Reference< beans::XIntrospection > xIntrospection;
+ if( !xIntrospection.is() )
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ xIntrospection.set( xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.beans.Introspection") ), uno::UNO_QUERY_THROW );
+ }
+ return xIntrospection->inspect( aObject );
+}
+
+uno::Reference< script::XTypeConverter >
+getTypeConverter( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
+{
+ static uno::Reference< script::XTypeConverter > xTypeConv( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter") ), xContext ), uno::UNO_QUERY_THROW );
+ return xTypeConv;
+}
+const uno::Any&
+aNULL()
+{
+ static uno::Any aNULLL = uno::makeAny( uno::Reference< uno::XInterface >() );
+ return aNULLL;
+}
+
+void dispatchExecute(SfxViewShell* pViewShell, USHORT nSlot, SfxCallMode nCall)
+{
+ SfxViewFrame* pViewFrame = NULL;
+ if ( pViewShell )
+ pViewFrame = pViewShell->GetViewFrame();
+ if ( pViewFrame )
+ {
+ SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
+ if( pDispatcher )
+ {
+ pDispatcher->Execute( nSlot , nCall );
+ }
+ }
+}
+
+void
+dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl, uno::Sequence< beans::PropertyValue >& sProps )
+{
+
+ util::URL url ;
+ url.Complete = aUrl;
+ rtl::OUString emptyString = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" ));
+ uno::Reference<frame::XController> xController = xModel->getCurrentController();
+ uno::Reference<frame::XFrame> xFrame = xController->getFrame();
+ uno::Reference<frame::XDispatchProvider> xDispatchProvider (xFrame,uno::UNO_QUERY_THROW);
+ try
+ {
+ uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ uno::Reference<uno::XComponentContext > xContext( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
+ if ( !xContext.is() )
+ {
+ return ;
+ }
+
+ uno::Reference<lang::XMultiComponentFactory > xServiceManager(
+ xContext->getServiceManager() );
+ if ( !xServiceManager.is() )
+ {
+ return ;
+ }
+ uno::Reference<util::XURLTransformer> xParser( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) )
+ ,xContext), uno::UNO_QUERY_THROW );
+ if (!xParser.is())
+ return;
+ xParser->parseStrict (url);
+ }
+ catch ( uno::Exception & /*e*/ )
+ {
+ return ;
+ }
+
+ uno::Reference<frame::XDispatch> xDispatcher = xDispatchProvider->queryDispatch(url,emptyString,0);
+
+ uno::Sequence<beans::PropertyValue> dispatchProps(1);
+
+ sal_Int32 nProps = sProps.getLength();
+ beans::PropertyValue* pDest = dispatchProps.getArray();
+ if ( nProps )
+ {
+ dispatchProps.realloc( nProps + 1 );
+ // need to reaccquire pDest after realloc
+ pDest = dispatchProps.getArray();
+ beans::PropertyValue* pSrc = sProps.getArray();
+ for ( sal_Int32 index=0; index<nProps; ++index, ++pSrc, ++pDest )
+ *pDest = *pSrc;
+ }
+
+ (*pDest).Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Silent" ));
+ (*pDest).Value <<= (sal_Bool)sal_True;
+
+ if (xDispatcher.is())
+ xDispatcher->dispatch( url, dispatchProps );
+}
+
+void
+dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl)
+{
+ uno::Sequence<beans::PropertyValue> dispatchProps;
+ dispatchRequests( xModel, aUrl, dispatchProps );
+}
+
+
+
+
+ uno::Reference< frame::XModel >
+getCurrentDoc( const rtl::OUString& sKey ) throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel;
+ SbxObject* pBasic = dynamic_cast< SbxObject* > ( SFX_APP()->GetBasic() );
+ SbxObject* basicChosen = pBasic ;
+ if ( basicChosen == NULL)
+ {
+ OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" );
+ return xModel;
+ }
+ SbxObject* p = pBasic;
+ SbxObject* pParent = p->GetParent();
+ SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL;
+
+ if( pParentParent )
+ {
+ basicChosen = pParentParent;
+ }
+ else if( pParent )
+ {
+ basicChosen = pParent;
+ }
+
+
+ uno::Any aModel;
+ SbxVariable *pCompVar = basicChosen->Find( sKey, SbxCLASS_OBJECT );
+
+ if ( pCompVar )
+ {
+ aModel = sbxToUnoValue( pCompVar );
+ if ( sal_False == ( aModel >>= xModel ) ||
+ !xModel.is() )
+ {
+ throw uno::RuntimeException(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't extract model from basic ( its obviously not set yet ) therefore don't know the current documet context") ), uno::Reference< uno::XInterface >() );
+ }
+ else
+ {
+ OSL_TRACE("Have model points to url %s",
+ ::rtl::OUStringToOString( xModel->getURL(),
+ RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+ }
+ }
+ else
+ {
+ OSL_TRACE("Failed to get %s", rtl::OUStringToOString( sKey, RTL_TEXTENCODING_UTF8 ).getStr() );
+ throw uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "Can't determine the currently selected document") ),
+ uno::Reference< uno::XInterface >() );
+ }
+ return xModel;
+}
+
+ uno::Reference< frame::XModel >
+getCurrentDocCtx( const rtl::OUString& ctxName, const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel;
+ // try fallback to calling doc
+ css::uno::Reference< css::container::XNameAccess > xNameAccess( xContext, css::uno::UNO_QUERY_THROW );
+ xModel.set( xNameAccess->getByName( ctxName ), uno::UNO_QUERY_THROW );
+ return xModel;
+}
+
+ uno::Reference< frame::XModel >
+getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
+{
+ static const rtl::OUString sThisExcelDoc( RTL_CONSTASCII_USTRINGPARAM("ThisExcelDoc" ) );
+ uno::Reference< frame::XModel > xModel;
+ try
+ {
+ xModel = getCurrentDoc( sThisExcelDoc );
+ }
+ catch( uno::Exception& e )
+ {
+ xModel = getCurrentDocCtx( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ExcelDocumentContext" ) ), xContext );
+ }
+ return xModel;
+}
+
+ uno::Reference< frame::XModel >
+getCurrentWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
+{
+ static const rtl::OUString sThisWordDoc( RTL_CONSTASCII_USTRINGPARAM("ThisWordDoc" ) );
+ uno::Reference< frame::XModel > xModel;
+ try
+ {
+ xModel = getCurrentDoc( sThisWordDoc );
+ }
+ catch( uno::Exception& e )
+ {
+ xModel = getCurrentDocCtx( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WordDocumentContext" ) ), xContext );
+ }
+ return xModel;
+}
+
+sal_Int32
+OORGBToXLRGB( sal_Int32 nCol )
+{
+ sal_Int32 nAutoBits = nCol;
+ nAutoBits &= 0xFF000000;
+ sal_Int32 nRed = nCol;
+ nRed &= 0x00FF0000;
+ nRed >>= 16;
+ sal_Int32 nGreen = nCol;
+ nGreen &= 0x0000FF00;
+ nGreen >>= 8;
+ sal_Int32 nBlue = nCol;
+ nBlue &= 0x000000FF;
+ sal_Int32 nRGB = ( nAutoBits | (nBlue << 16) | (nGreen << 8) | nRed );
+ return nRGB;
+}
+sal_Int32
+XLRGBToOORGB( sal_Int32 nCol )
+{
+ sal_Int32 nAutoBits = nCol;
+ nAutoBits &= 0xFF000000;
+
+ sal_Int32 nBlue = nCol;
+ nBlue &= 0x00FF0000;
+ nBlue >>= 16;
+ sal_Int32 nGreen = nCol;
+ nGreen &= 0x0000FF00;
+ nGreen >>= 8;
+ sal_Int32 nRed = nCol;
+ nRed &= 0x000000FF;
+ sal_Int32 nRGB = ( nAutoBits | (nRed << 16) | (nGreen << 8) | nBlue );
+ return nRGB;
+}
+uno::Any
+OORGBToXLRGB( const uno::Any& aCol )
+{
+ sal_Int32 nCol;
+ aCol >>= nCol;
+ nCol = OORGBToXLRGB( nCol );
+ return uno::makeAny( nCol );
+}
+uno::Any
+XLRGBToOORGB( const uno::Any& aCol )
+{
+ sal_Int32 nCol;
+ aCol >>= nCol;
+ nCol = XLRGBToOORGB( nCol );
+ return uno::makeAny( nCol );
+}
+
+void PrintOutHelper( SfxViewShell* pViewShell, 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, sal_Bool bUseSelection )
+{
+ sal_Int32 nTo = 0;
+ sal_Int32 nFrom = 0;
+ sal_Int16 nCopies = 1;
+ sal_Bool bPreview = sal_False;
+ sal_Bool bCollate = sal_False;
+ sal_Bool bSelection = bUseSelection;
+ From >>= nFrom;
+ To >>= nTo;
+ Copies >>= nCopies;
+ Preview >>= bPreview;
+ if ( nCopies > 1 ) // Collate only useful when more that 1 copy
+ Collate >>= bCollate;
+
+ rtl::OUString sRange( RTL_CONSTASCII_USTRINGPARAM( "-" ) );
+ rtl::OUString sFileName;
+
+ if (( nFrom || nTo ) )
+ {
+ if ( nFrom )
+ sRange = ( ::rtl::OUString::valueOf( nFrom ) + sRange );
+ if ( nTo )
+ sRange += ::rtl::OUString::valueOf( nTo );
+ }
+
+ if ( PrToFileName.getValue() )
+ {
+ PrToFileName >>= sFileName;
+ }
+ SfxViewFrame* pViewFrame = NULL;
+ if ( pViewShell )
+ pViewFrame = pViewShell->GetViewFrame();
+ if ( pViewFrame )
+ {
+ SfxAllItemSet aArgs( SFX_APP()->GetPool() );
+
+ SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate );
+ aArgs.Put( sfxCollate, sfxCollate.Which() );
+ SfxInt16Item sfxCopies( SID_PRINT_COPIES, nCopies );
+ aArgs.Put( sfxCopies, sfxCopies.Which() );
+ if ( sFileName.getLength() )
+ {
+ SfxStringItem sfxFileName( SID_FILE_NAME, sFileName);
+ aArgs.Put( sfxFileName, sfxFileName.Which() );
+
+ }
+ if ( sRange.getLength() )
+ {
+ SfxStringItem sfxRange( SID_PRINT_PAGES, sRange );
+ aArgs.Put( sfxRange, sfxRange.Which() );
+ }
+ SfxBoolItem sfxSelection( SID_SELECTION, bSelection );
+ aArgs.Put( sfxSelection, sfxSelection.Which() );
+ SfxBoolItem sfxAsync( SID_ASYNCHRON, sal_False );
+ aArgs.Put( sfxAsync, sfxAsync.Which() );
+ SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
+
+ if ( pDispatcher )
+ {
+ if ( bPreview )
+ {
+ if ( !pViewFrame->GetFrame()->IsInPlace() )
+ {
+ // #TODO is this necessary ( calc specific )
+// SC_MOD()->InputEnterHandler();
+ pViewFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SFX_CALLMODE_SYNCHRON );
+ while ( isInPrintPreview( pViewFrame ) )
+ Application::Yield();
+ }
+ }
+ else
+ pDispatcher->Execute( (USHORT)SID_PRINTDOC, (SfxCallMode)SFX_CALLMODE_SYNCHRON, aArgs );
+ }
+
+ }
+
+ // #FIXME #TODO
+ // 1 ActivePrinter ( how/can we switch a printer via API? )
+ // 2 PrintToFile ( ms behaviour if this option is specified but no
+ // filename supplied 'PrToFileName' then the user will be prompted )
+ // 3 Need to check behaviour of Selected sheets with range ( e.g. From & To
+ // values ) in oOO these options are mutually exclusive
+ // 4 There is a pop up to do with transparent objects in the print source
+ // should be able to disable that via configuration for the duration
+ // of this method
+}
+
+ void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, SfxViewShell* pViewShell )
+{
+ dispatchExecute( pViewShell, SID_VIEWSHELL1 );
+}
+
+rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException )
+{
+ uno::Type aType = pvargItem.getValueType();
+ uno::TypeClass eTypeClass = aType.getTypeClass();
+ rtl::OUString sString;
+ switch ( eTypeClass )
+ {
+ case uno::TypeClass_BOOLEAN:
+ {
+ sal_Bool bBool = sal_False;
+ pvargItem >>= bBool;
+ sString = rtl::OUString::valueOf( bBool );
+ break;
+ }
+ case uno::TypeClass_STRING:
+ pvargItem >>= sString;
+ break;
+ case uno::TypeClass_FLOAT:
+ {
+ float aFloat = 0;
+ pvargItem >>= aFloat;
+ sString = rtl::OUString::valueOf( aFloat );
+ break;
+ }
+ case uno::TypeClass_DOUBLE:
+ {
+ double aDouble = 0;
+ pvargItem >>= aDouble;
+ sString = rtl::OUString::valueOf( aDouble );
+ break;
+ }
+ case uno::TypeClass_SHORT:
+ case uno::TypeClass_LONG:
+ case uno::TypeClass_BYTE:
+ {
+ sal_Int32 aNum = 0;
+ pvargItem >>= aNum;
+ sString = rtl::OUString::valueOf( aNum );
+ break;
+ }
+
+ case uno::TypeClass_HYPER:
+ {
+ sal_Int64 aHyper = 0;
+ pvargItem >>= aHyper;
+ sString = rtl::OUString::valueOf( aHyper );
+ break;
+ }
+ default:
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid type, can't convert" ), uno::Reference< uno::XInterface >() );
+ }
+ return sString;
+}
+
+
+rtl::OUString
+ContainerUtilities::getUniqueName( const uno::Sequence< ::rtl::OUString >& _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator)
+{
+ return getUniqueName(_slist, _sElementName, _sSuffixSeparator, sal_Int32(2));
+}
+
+rtl::OUString
+ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix)
+{
+ sal_Int32 a = _nStartSuffix;
+ rtl::OUString scompname = _sElementName;
+ bool bElementexists = true;
+ sal_Int32 nLen = _slist.getLength();
+ if ( nLen == 0 )
+ return _sElementName;
+
+ while (bElementexists == true)
+ {
+ for (sal_Int32 i = 0; i < nLen; i++)
+ {
+ if (FieldInList(_slist, scompname) == -1)
+ {
+ return scompname;
+ }
+ }
+ scompname = _sElementName + _sSuffixSeparator + rtl::OUString::valueOf( a++ );
+ }
+ return rtl::OUString();
+}
+
+sal_Int32
+ContainerUtilities::FieldInList( const uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString )
+{
+ sal_Int32 FieldLen = SearchList.getLength();
+ sal_Int32 retvalue = -1;
+ for (sal_Int32 i = 0; i < FieldLen; i++)
+ {
+ // I wonder why comparing lexicographically is done
+ // when its a match is whats interesting?
+ //if (SearchList[i].compareTo(SearchString) == 0)
+ if ( SearchList[i].equals( SearchString ) )
+ {
+ retvalue = i;
+ break;
+ }
+ }
+ return retvalue;
+
+}
+bool NeedEsc(sal_Unicode cCode)
+{
+ String sEsc(RTL_CONSTASCII_USTRINGPARAM(".^$+\\|{}()"));
+ return (STRING_NOTFOUND != sEsc.Search(cCode));
+}
+
+rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike )
+{
+ rtl::OUStringBuffer sResult;
+ const sal_Unicode *start = rIn.getStr();
+ const sal_Unicode *end = start + rIn.getLength();
+
+ int seenright = 0;
+ if ( bForLike )
+ sResult.append(static_cast<sal_Unicode>('^'));
+
+ while (start < end)
+ {
+ switch (*start)
+ {
+ case '?':
+ sResult.append(static_cast<sal_Unicode>('.'));
+ start++;
+ break;
+ case '*':
+ sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".*")));
+ start++;
+ break;
+ case '#':
+ sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[0-9]")));
+ start++;
+ break;
+ case '~':
+ sResult.append(static_cast<sal_Unicode>('\\'));
+ sResult.append(*(++start));
+ start++;
+ break;
+ // dump the ~ and escape the next characture
+ case ']':
+ sResult.append(static_cast<sal_Unicode>('\\'));
+ sResult.append(*start++);
+ break;
+ case '[':
+ sResult.append(*start++);
+ seenright = 0;
+ while (start < end && !seenright)
+ {
+ switch (*start)
+ {
+ case '[':
+ case '?':
+ case '*':
+ sResult.append(static_cast<sal_Unicode>('\\'));
+ sResult.append(*start);
+ break;
+ case ']':
+ sResult.append(*start);
+ seenright = 1;
+ break;
+ case '!':
+ sResult.append(static_cast<sal_Unicode>('^'));
+ break;
+ default:
+ if (NeedEsc(*start))
+ sResult.append(static_cast<sal_Unicode>('\\'));
+ sResult.append(*start);
+ break;
+ }
+ start++;
+ }
+ break;
+ default:
+ if (NeedEsc(*start))
+ sResult.append(static_cast<sal_Unicode>('\\'));
+ sResult.append(*start++);
+ }
+ }
+
+ if ( bForLike )
+ sResult.append(static_cast<sal_Unicode>('$'));
+
+ return sResult.makeStringAndClear( );
+}
+
+double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical)
+{
+ double fConvertFactor = 1.0;
+ if( bVertical )
+ {
+ fConvertFactor = xDevice->getInfo().PixelPerMeterY/100000;
+ }
+ else
+ {
+ fConvertFactor = xDevice->getInfo().PixelPerMeterX/100000;
+ }
+ return fConvertFactor;
+}
+
+double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical)
+{
+ double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical );
+ return fPoints * POINTTO100THMILLIMETERFACTOR * fConvertFactor;
+}
+double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPixels, sal_Bool bVertical)
+{
+ double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical );
+ return (fPixels/fConvertFactor)/POINTTO100THMILLIMETERFACTOR;
+}
+
+ConcreteXShapeGeometryAttributes::ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& /*xContext*/, const css::uno::Reference< css::drawing::XShape >& xShape )
+{
+ m_pShapeHelper.reset( new ShapeHelper( xShape ) );
+}
+
+sal_Int32 getPointerStyle( const uno::Reference< frame::XModel >& xModel )
+{
+
+ sal_Int32 nPointerStyle( POINTER_ARROW );
+ try
+ {
+ const uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_SET_THROW );
+ const uno::Reference< frame::XFrame > xFrame ( xController->getFrame(), uno::UNO_SET_THROW );
+ const uno::Reference< awt::XWindow > xWindow ( xFrame->getContainerWindow(), uno::UNO_SET_THROW );
+ // why the heck isn't there an XWindowPeer::getPointer, but a setPointer only?
+ const Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
+ if ( pWindow )
+ nPointerStyle = pWindow->GetSystemWindow()->GetPointer().GetStyle();
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return nPointerStyle;
+}
+
+// #FIXME this method looks wrong, shouldn't it just affect calc *or* writer
+// document/frame/window(s) but not both ( and depending on what api called
+// this )
+void setCursorHelper( const uno::Reference< frame::XModel >& xModel, const Pointer& rPointer, sal_Bool bOverWrite )
+{
+ ::std::vector< uno::Reference< frame::XController > > aControllers;
+
+ uno::Reference< frame::XModel2 > xModel2( xModel, uno::UNO_QUERY );
+ if ( xModel2.is() )
+ {
+ const uno::Reference< container::XEnumeration > xEnumControllers( xModel2->getControllers(), uno::UNO_SET_THROW );
+ while ( xEnumControllers->hasMoreElements() )
+ {
+ const uno::Reference< frame::XController > xController( xEnumControllers->nextElement(), uno::UNO_QUERY_THROW );
+ aControllers.push_back( xController );
+ }
+ }
+ else
+ {
+ if ( xModel.is() )
+ {
+ const uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_SET_THROW );
+ aControllers.push_back( xController );
+ }
+ }
+
+ for ( ::std::vector< uno::Reference< frame::XController > >::const_iterator controller = aControllers.begin();
+ controller != aControllers.end();
+ ++controller
+ )
+ {
+ const uno::Reference< frame::XFrame > xFrame ( (*controller)->getFrame(), uno::UNO_SET_THROW );
+ const uno::Reference< awt::XWindow > xWindow ( xFrame->getContainerWindow(), uno::UNO_SET_THROW );
+
+ Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
+ OSL_ENSURE( pWindow, "ScVbaApplication::setCursor: no window!" );
+ if ( !pWindow )
+ continue;
+
+ pWindow->GetSystemWindow()->SetPointer( rPointer );
+ pWindow->GetSystemWindow()->EnableChildPointerOverwrite( bOverWrite );
+ }
+}
+
+void setDefaultPropByIntrospection( const uno::Any& aObj, const uno::Any& aValue ) throw ( uno::RuntimeException )
+{
+ uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObj ) );
+
+ // #MAYBE #FIXME sort of a bit of a hack,
+ uno::Reference< script::XDefaultProperty > xDflt( aObj, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xPropSet;
+
+ if ( xUnoAccess.is() )
+ xPropSet.set( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY);
+
+ if ( xPropSet.is() )
+ xPropSet->setPropertyValue( xDflt->getDefaultPropertyName(), aValue );
+ else
+ throw uno::RuntimeException();
+}
+
+uno::Any getPropertyValue( const uno::Sequence< beans::PropertyValue >& aProp, const rtl::OUString& aName )
+{
+ uno::Any result;
+ for ( sal_Int32 i = 0; i < aProp.getLength(); i++ )
+ {
+ if ( aProp[i].Name.equals(aName) )
+ {
+ aProp[i].Value >>= result;
+ return result;
+ }
+ }
+ return result;
+}
+
+sal_Bool setPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, const rtl::OUString& aName, const uno::Any& aValue )
+{
+ for ( sal_Int32 i = 0; i < aProp.getLength(); i++ )
+ {
+ if ( aProp[i].Name.equals(aName) )
+ {
+ aProp[i].Value = aValue;
+ return sal_True;
+ }
+ }
+ return sal_False;
+}
+
+#define VBA_LEFT "PositionX"
+#define VBA_TOP "PositionY"
+UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComponentContext >& /*xContext*/, const uno::Reference< awt::XControl >& xControl )
+{
+ mxModel.set( xControl->getModel(), uno::UNO_QUERY_THROW );
+}
+ double UserFormGeometryHelper::getLeft()
+ {
+ sal_Int32 nLeft = 0;
+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft;
+ return Millimeter::getInPoints( nLeft );
+ }
+ void UserFormGeometryHelper::setLeft( double nLeft )
+ {
+ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nLeft ) ) );
+ }
+ double UserFormGeometryHelper::getTop()
+ {
+ sal_Int32 nTop = 0;
+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ) ) >>= nTop;
+ return Millimeter::getInPoints( nTop );
+ }
+ void UserFormGeometryHelper::setTop( double nTop )
+ {
+ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nTop ) ) );
+ }
+ double UserFormGeometryHelper::getHeight()
+ {
+ sal_Int32 nHeight = 0;
+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( NAME_HEIGHT ) ) ) >>= nHeight;
+ return Millimeter::getInPoints( nHeight );
+ }
+ void UserFormGeometryHelper::setHeight( double nHeight )
+ {
+ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( NAME_HEIGHT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nHeight ) ) );
+ }
+ double UserFormGeometryHelper::getWidth()
+ {
+ sal_Int32 nWidth = 0;
+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( NAME_WIDTH ) ) ) >>= nWidth;
+ return Millimeter::getInPoints( nWidth );
+ }
+ void UserFormGeometryHelper::setWidth( double nWidth)
+ {
+ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( NAME_WIDTH ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nWidth ) ) );
+ }
+
+ double ConcreteXShapeGeometryAttributes::getLeft()
+ {
+ return m_pShapeHelper->getLeft();
+ }
+ void ConcreteXShapeGeometryAttributes::setLeft( double nLeft )
+ {
+ m_pShapeHelper->setLeft( nLeft );
+ }
+ double ConcreteXShapeGeometryAttributes::getTop()
+ {
+ return m_pShapeHelper->getTop();
+ }
+ void ConcreteXShapeGeometryAttributes::setTop( double nTop )
+ {
+ m_pShapeHelper->setTop( nTop );
+ }
+
+ double ConcreteXShapeGeometryAttributes::getHeight()
+ {
+ return m_pShapeHelper->getHeight();
+ }
+ void ConcreteXShapeGeometryAttributes::setHeight( double nHeight )
+ {
+ m_pShapeHelper->setHeight( nHeight );
+ }
+ double ConcreteXShapeGeometryAttributes::getWidth()
+ {
+ return m_pShapeHelper->getWidth();
+ }
+ void ConcreteXShapeGeometryAttributes::setWidth( double nWidth)
+ {
+ m_pShapeHelper->setWidth( nWidth );
+ }
+
+
+ ShapeHelper::ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape) throw (css::script::BasicErrorException ) : xShape( _xShape )
+ {
+ if( !xShape.is() )
+ throw css::uno::RuntimeException( rtl::OUString::createFromAscii("No valid shape for helper"), css::uno::Reference< css::uno::XInterface >() );
+ }
+
+ double ShapeHelper::getHeight()
+ {
+ return Millimeter::getInPoints(xShape->getSize().Height);
+ }
+
+
+ void ShapeHelper::setHeight(double _fheight) throw ( css::script::BasicErrorException )
+ {
+ try
+ {
+ css::awt::Size aSize = xShape->getSize();
+ aSize.Height = Millimeter::getInHundredthsOfOneMillimeter(_fheight);
+ xShape->setSize(aSize);
+ }
+ catch ( css::uno::Exception& /*e*/)
+ {
+ throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
+ }
+ }
+
+
+ double ShapeHelper::getWidth()
+ {
+ return Millimeter::getInPoints(xShape->getSize().Width);
+ }
+
+ void ShapeHelper::setWidth(double _fWidth) throw ( css::script::BasicErrorException )
+ {
+ try
+ {
+ css::awt::Size aSize = xShape->getSize();
+ aSize.Width = Millimeter::getInHundredthsOfOneMillimeter(_fWidth);
+ xShape->setSize(aSize);
+ }
+ catch (css::uno::Exception& /*e*/)
+ {
+ throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
+ }
+ }
+
+
+ double ShapeHelper::getLeft()
+ {
+ return Millimeter::getInPoints(xShape->getPosition().X);
+ }
+
+
+ void ShapeHelper::setLeft(double _fLeft)
+ {
+ css::awt::Point aPoint = xShape->getPosition();
+ aPoint.X = Millimeter::getInHundredthsOfOneMillimeter(_fLeft);
+ xShape->setPosition(aPoint);
+ }
+
+
+ double ShapeHelper::getTop()
+ {
+ return Millimeter::getInPoints(xShape->getPosition().Y);
+ }
+
+
+ void ShapeHelper::setTop(double _fTop)
+ {
+ css::awt::Point aPoint = xShape->getPosition();
+ aPoint.Y = Millimeter::getInHundredthsOfOneMillimeter(_fTop);
+ xShape->setPosition(aPoint);
+ }
+
+ void DebugHelper::exception( const rtl::OUString& DetailedMessage, const css::uno::Exception& ex, int err, const rtl::OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException )
+ {
+ // #TODO #FIXME ( do we want to support additionalArg here )
+ throw css::script::BasicErrorException( DetailedMessage.concat( rtl::OUString::createFromAscii(" ") ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, rtl::OUString() );
+ }
+
+ void DebugHelper::exception( int err, const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException )
+ {
+ exception( rtl::OUString(), css::uno::Exception(), err, additionalArgument );
+ }
+ void DebugHelper::exception( css::uno::Exception& ex ) throw( css::script::BasicErrorException )
+ {
+ exception( rtl::OUString(), ex, SbERR_INTERNAL_ERROR, rtl::OUString() );
+ }
+
+ Millimeter::Millimeter():m_nMillimeter(0) {}
+
+ Millimeter::Millimeter(double mm):m_nMillimeter(mm) {}
+
+ void Millimeter::set(double mm) { m_nMillimeter = mm; }
+ void Millimeter::setInPoints(double points)
+ {
+ m_nMillimeter = points * 0.352777778;
+ // 25.4mm / 72
+ }
+
+ void Millimeter::setInHundredthsOfOneMillimeter(double hmm)
+ {
+ m_nMillimeter = hmm / 100;
+ }
+
+ double Millimeter::get()
+ {
+ return m_nMillimeter;
+ }
+ double Millimeter::getInHundredthsOfOneMillimeter()
+ {
+ return m_nMillimeter * 100;
+ }
+ double Millimeter::getInPoints()
+ {
+ return m_nMillimeter * 2.834645669; // 72 / 25.4mm
+ }
+
+ sal_Int32 Millimeter::getInHundredthsOfOneMillimeter(double points)
+ {
+ sal_Int32 mm = static_cast<sal_Int32>(points * factor);
+ return mm;
+ }
+
+ double Millimeter::getInPoints(int _hmm)
+ {
+ double points = double( static_cast<double>(_hmm) / factor);
+ return points;
+ }
+
+ SfxObjectShell* getSfxObjShell( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
+ {
+ SfxObjectShell* pFoundShell = NULL;
+ if ( xModel.is() )
+ {
+ uno::Reference< lang::XUnoTunnel > xObjShellTunnel( xModel, uno::UNO_QUERY_THROW );
+ pFoundShell = reinterpret_cast<SfxObjectShell*>( xObjShellTunnel->getSomething(SfxObjectShell::getUnoTunnelId()));
+ }
+ if ( !pFoundShell )
+ throw uno::RuntimeException();
+ return pFoundShell;
+ }
+
+} // openoffice
+} //org
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx.rej b/vbahelper/source/vbahelper/vbahelper.cxx.rej
new file mode 100644
index 0000000000..e6d2d95a74
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbahelper.cxx.rej
@@ -0,0 +1,45 @@
+***************
+*** 67,73 ****
+ #include <toolkit/awt/vclxwindow.hxx>
+ #include <toolkit/helper/vclunohelper.hxx>
+ #include <com/sun/star/frame/XModel2.hpp>
+- #include <com/sun/star/lang/XUnoTunnel.hpp>
+ #include <vcl/window.hxx>
+ #include <vcl/syswin.hxx>
+ #include <tools/diagnose_ex.h>
+--- 67,72 ----
+ #include <toolkit/awt/vclxwindow.hxx>
+ #include <toolkit/helper/vclunohelper.hxx>
+ #include <com/sun/star/frame/XModel2.hpp>
+ #include <vcl/window.hxx>
+ #include <vcl/syswin.hxx>
+ #include <tools/diagnose_ex.h>
+*************** UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComp
+*** 1117,1135 ****
+ double points = double( static_cast<double>(_hmm) / factor);
+ return points;
+ }
+-
+- SfxObjectShell* getSfxObjShell( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
+- {
+- SfxObjectShell* pFoundShell = NULL;
+- if ( xModel.is() )
+- {
+- uno::Reference< lang::XUnoTunnel > xObjShellTunnel( xModel, uno::UNO_QUERY_THROW );
+- pFoundShell = reinterpret_cast<SfxObjectShell*>( xObjShellTunnel->getSomething(SfxObjectShell::getUnoTunnelId()));
+- }
+- if ( !pFoundShell )
+- throw uno::RuntimeException();
+- return pFoundShell;
+- }
+
+ } // openoffice
+ } //org
+--- 1116,1122 ----
+ double points = double( static_cast<double>(_hmm) / factor);
+ return points;
+ }
++
+
+ } // openoffice
+ } //org
diff --git a/vbahelper/source/vbahelper/vbalineformat.cxx b/vbahelper/source/vbahelper/vbalineformat.cxx
new file mode 100644
index 0000000000..82eb483846
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbalineformat.cxx
@@ -0,0 +1,458 @@
+/*************************************************************************
+ *
+ * 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: vbalineformat.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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 <ooo/vba/office/MsoArrowheadStyle.hpp>
+#include <ooo/vba/office/MsoArrowheadLength.hpp>
+#include <ooo/vba/office/MsoArrowheadWidth.hpp>
+#include <ooo/vba/office/MsoLineDashStyle.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/drawing/LineDash.hpp>
+#include "vbalineformat.hxx"
+#include "vbacolorformat.hxx"
+
+using namespace ooo::vba;
+using namespace com::sun::star;
+
+ScVbaLineFormat::ScVbaLineFormat( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape > xShape ) : ScVbaLineFormat_BASE( xParent, xContext ), m_xShape( xShape )
+{
+ m_xPropertySet.set( xShape, uno::UNO_QUERY_THROW );
+ m_nLineDashStyle = office::MsoLineDashStyle::msoLineSolid;
+ m_nLineWeight = 1;
+}
+
+sal_Int32
+ScVbaLineFormat::calculateArrowheadSize()
+{
+ return 0;
+}
+
+sal_Int32
+ScVbaLineFormat::convertLineStartEndNameToArrowheadStyle( rtl::OUString sLineName )
+{
+ sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone;
+ if (sLineName.equals(rtl::OUString::createFromAscii("Small Arrow")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("Arrow")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("msArrowEnd")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("Double Arrow")))
+ {
+ // msoArrowheadTriangle
+ nLineType = office::MsoArrowheadStyle::msoArrowheadTriangle;
+ }
+ else if (sLineName.equals(rtl::OUString::createFromAscii("Square 45")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("Square")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("msArrowDiamondEnd")))
+ {
+ // msoArrowheadDiamond
+ nLineType = office::MsoArrowheadStyle::msoArrowheadDiamond;
+ }
+ else if (sLineName.equals(rtl::OUString::createFromAscii("Circle")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("msArrowOvalEnd")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("Dimension Lines")) )
+ {
+ // msoArrowheadOval
+ nLineType = office::MsoArrowheadStyle::msoArrowheadOval;
+ }
+ else if (sLineName.equals(rtl::OUString::createFromAscii("Arrow concave")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("msArrowStealthEnd")))
+ {
+ // msoArrowheadStealth
+ nLineType = office::MsoArrowheadStyle::msoArrowheadStealth;
+ }
+ else if (sLineName.equals(rtl::OUString::createFromAscii("Rounded short Arrow")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("Rounded large Arrow")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("Symmetric Arrow")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("msArrowOpenEnd")) ||
+ sLineName.equals(rtl::OUString::createFromAscii("Line Arrow")))
+ {
+ // msoArrowheadOpen
+ nLineType = office::MsoArrowheadStyle::msoArrowheadOpen;
+ }
+ else
+ {
+ // msoArrowheadNone
+ nLineType = office::MsoArrowheadStyle::msoArrowheadNone;
+ }
+ return nLineType;
+}
+
+rtl::OUString
+ScVbaLineFormat::convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadStyle ) throw (uno::RuntimeException)
+{
+ switch( nArrowheadStyle )
+ {
+ case office::MsoArrowheadStyle::msoArrowheadNone:
+ return rtl::OUString(rtl::OUString::createFromAscii( "" ) );
+ case office::MsoArrowheadStyle::msoArrowheadStealth:
+ return rtl::OUString::createFromAscii( "Arrow concave" );
+ case office::MsoArrowheadStyle::msoArrowheadOpen:
+ return rtl::OUString::createFromAscii("Line Arrow" );
+ case office::MsoArrowheadStyle::msoArrowheadOval:
+ return rtl::OUString::createFromAscii("Circle" );
+ case office::MsoArrowheadStyle::msoArrowheadDiamond:
+ return rtl::OUString::createFromAscii( "Square 45" );
+ case office::MsoArrowheadStyle::msoArrowheadTriangle:
+ return rtl::OUString::createFromAscii( "Arrow" );
+ default:
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Invalid Arrow Style!"), uno::Reference< uno::XInterface >() );
+ }
+}
+
+// Attributes
+sal_Int32 SAL_CALL
+ScVbaLineFormat::getBeginArrowheadStyle() throw (uno::RuntimeException)
+{
+ sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone;
+ rtl::OUString sLineName;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStartName" ) ) >>= sLineName;
+ if( ( sLineName.getLength() > 7 ) && ( sLineName.indexOf( rtl::OUString::createFromAscii( "msArray" ) ) ) != -1 )
+ {
+ sal_Int32 nIndex = sLineName.indexOf( rtl::OUString::createFromAscii(" ") );
+ rtl::OUString sName = sLineName.copy( 0, nIndex );
+ //sal_Int32 nSize = sLineName.copy( nIndex + 1 ).toInt32();
+ nLineType = convertLineStartEndNameToArrowheadStyle( sName );
+ }
+ else
+ {
+ nLineType = convertLineStartEndNameToArrowheadStyle( sLineName );
+ }
+ return nLineType;
+}
+
+void SAL_CALL
+ScVbaLineFormat::setBeginArrowheadStyle( sal_Int32 _beginarrowheadstyle ) throw (uno::RuntimeException)
+{
+ rtl::OUString sArrayName = convertArrowheadStyleToLineStartEndName( _beginarrowheadstyle );
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStartName" ), uno::makeAny( sArrayName ) );
+}
+
+sal_Int32 SAL_CALL
+ScVbaLineFormat::getBeginArrowheadLength() throw (uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+}
+
+void SAL_CALL
+ScVbaLineFormat::setBeginArrowheadLength( sal_Int32 /*_beginarrowheadlength*/ ) throw (uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+}
+
+sal_Int32 SAL_CALL
+ScVbaLineFormat::getBeginArrowheadWidth() throw (uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+}
+
+void SAL_CALL
+ScVbaLineFormat::setBeginArrowheadWidth( sal_Int32 /*_beginarrowheadwidth*/ ) throw (uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+}
+
+sal_Int32 SAL_CALL
+ScVbaLineFormat::getEndArrowheadStylel() throw (uno::RuntimeException)
+{
+ return 0;
+}
+
+void SAL_CALL
+ScVbaLineFormat::setEndArrowheadStylel( sal_Int32 /*_endarrowheadstylel*/ ) throw (uno::RuntimeException)
+{
+}
+
+sal_Int32 SAL_CALL
+ScVbaLineFormat::getEndArrowheadLength() throw (uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+}
+
+void SAL_CALL
+ScVbaLineFormat::setEndArrowheadLength( sal_Int32 /*_endarrowheadlength*/ ) throw (uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+}
+
+sal_Int32 SAL_CALL
+ScVbaLineFormat::getEndArrowheadWidth() throw (uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+}
+
+void SAL_CALL
+ScVbaLineFormat::setEndArrowheadWidth( sal_Int32 /*_endarrowheadwidth*/ ) throw (uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() );
+}
+
+double SAL_CALL
+ScVbaLineFormat::getWeight() throw (uno::RuntimeException)
+{
+ sal_Int32 nLineWidth=0;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineWidth") ) >>= nLineWidth;
+ double dLineWidth = Millimeter::getInPoints( nLineWidth );
+ return dLineWidth;
+}
+
+void SAL_CALL
+ScVbaLineFormat::setWeight( double _weight ) throw (uno::RuntimeException)
+{
+ if( _weight < 0 )
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Parameter: Must be positv."), uno::Reference< uno::XInterface >() );
+ if( _weight == 0 )
+ _weight = 0.5;
+ m_nLineWeight = _weight;
+ Millimeter aMillimeter;
+ aMillimeter.setInPoints( _weight );
+
+ sal_Int32 nLineWidth = static_cast<sal_Int32>( aMillimeter.getInHundredthsOfOneMillimeter() );
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineWidth" ), uno::makeAny( nLineWidth ) );
+ setDashStyle( m_nLineDashStyle );
+}
+
+sal_Bool SAL_CALL
+ScVbaLineFormat::getVisible() throw (uno::RuntimeException)
+{
+ drawing::LineStyle aLineStyle;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ) ) >>= aLineStyle;
+ if( aLineStyle == drawing::LineStyle_NONE )
+ {
+ return sal_False;
+ }
+ return sal_True;
+}
+
+void SAL_CALL
+ScVbaLineFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException)
+{
+ drawing::LineStyle aLineStyle;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ) ) >>= aLineStyle;
+ if( !_visible )
+ {
+ aLineStyle = drawing::LineStyle_NONE;
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ), uno::makeAny( aLineStyle ) );
+ }
+ else
+ {
+ if( aLineStyle == drawing::LineStyle_NONE )
+ {
+ setDashStyle( m_nLineDashStyle );
+ }
+ }
+}
+
+double SAL_CALL
+ScVbaLineFormat::getTransparency() throw (uno::RuntimeException)
+{
+ sal_Int16 nTransparency = 0;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineTransparence" ) ) >>= nTransparency;
+ double fTransparency = static_cast<double>( nTransparency );
+ return fTransparency / 100;
+}
+
+void SAL_CALL
+ScVbaLineFormat::setTransparency( double _transparency ) throw (uno::RuntimeException)
+{
+ sal_Int16 nTransparency = static_cast<sal_Int16>( _transparency * 100 );
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineTransparence" ), uno::makeAny( nTransparency ) );
+}
+
+sal_Int16 SAL_CALL
+ScVbaLineFormat::getStyle() throw (uno::RuntimeException)
+{
+ //OpenOffice.org only supports one LineStyle (other than the DashStyles)
+ //Therefore we can only return the SingleLine
+ return 1;
+}
+
+void SAL_CALL
+ScVbaLineFormat::setStyle( sal_Int16 /*_style */) throw (uno::RuntimeException)
+{
+ //OpenOffice.org only supports one LineStyle (other than the DashStyles)
+ //Therefore we do not set the LineStyle, because it maybe is already set
+ //to Dashed or Single Line. Setting the 'Visible' or 'DashStyle' properties
+ //will be done with the according methods.
+}
+
+sal_Int32 SAL_CALL
+ScVbaLineFormat::getDashStyle() throw (uno::RuntimeException)
+{
+ drawing::LineStyle eLineStyle;
+ //LineStyle integer in Xray
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ) ) >>= eLineStyle;
+ if( eLineStyle == drawing::LineStyle_SOLID )
+ m_nLineDashStyle = office::MsoLineDashStyle::msoLineSolid;
+ else
+ {
+ drawing::LineDash aLineDash;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineDash" ) ) >>= aLineDash;
+ if( aLineDash.Dots == 0 )
+ {
+ //LineDash
+ //LineLongDash
+ m_nLineDashStyle = office::MsoLineDashStyle::msoLineDash;
+ if( aLineDash.Distance > 0 && ( aLineDash.DashLen / aLineDash.Distance > 1 ) )
+ {
+ m_nLineDashStyle = office::MsoLineDashStyle::msoLineLongDash;
+ }
+ }
+ else if( aLineDash.Dots == 1 )
+ {
+ // LineDashDot
+ // LineLongDashDot
+ // LineSquareDot
+ // LineRoundDot ! not supported
+ m_nLineDashStyle = office::MsoLineDashStyle::msoLineDashDot;
+ if( aLineDash.Dashes == 0 )
+ {
+ m_nLineDashStyle = office::MsoLineDashStyle::msoLineSquareDot;
+ }
+ else
+ {
+ if( aLineDash.Distance > 0 && ( aLineDash.DashLen / aLineDash.Distance > 1 ) )
+ {
+ m_nLineDashStyle = office::MsoLineDashStyle::msoLineLongDashDot;
+ }
+ }
+ }
+ else if( aLineDash.Dots == 2 )
+ {
+ // LineDashDotDot
+ m_nLineDashStyle = office::MsoLineDashStyle::msoLineDashDotDot;
+ }
+ }
+
+ return m_nLineDashStyle;
+}
+
+void SAL_CALL
+ScVbaLineFormat::setDashStyle( sal_Int32 _dashstyle ) throw (uno::RuntimeException)
+{
+ m_nLineDashStyle = _dashstyle;
+ if( _dashstyle == office::MsoLineDashStyle::msoLineSolid )
+ {
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ), uno::makeAny( drawing::LineStyle_SOLID ));
+ }
+ else
+ {
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ), uno::makeAny( drawing::LineStyle_DASH ) );
+ drawing::LineDash pLineDash;
+ Millimeter aMillimeter( m_nLineWeight );
+ sal_Int32 nPixel = static_cast< sal_Int32 >( aMillimeter.getInHundredthsOfOneMillimeter() );
+ switch( _dashstyle )
+ {
+ case office::MsoLineDashStyle::msoLineDashDot:
+ pLineDash.Dots = 1;
+ pLineDash.DotLen = nPixel;
+ pLineDash.Dashes = 1;
+ pLineDash.DashLen = 5 * nPixel;
+ pLineDash.Distance = 4 * nPixel;
+ break;
+ case office::MsoLineDashStyle::msoLineLongDashDot:
+ pLineDash.Dots = 1;
+ pLineDash.DotLen = nPixel;
+ pLineDash.Dashes = 1;
+ pLineDash.DashLen = 10 * nPixel;
+ pLineDash.Distance = 4 * nPixel;
+ break;
+ case office::MsoLineDashStyle::msoLineDash:
+ pLineDash.Dots = 0;
+ pLineDash.DotLen = 0;
+ pLineDash.Dashes = 1;
+ pLineDash.DashLen = 6 * nPixel;
+ pLineDash.Distance = 4 * nPixel;
+ break;
+ case office::MsoLineDashStyle::msoLineDashDotDot:
+ pLineDash.Dots = 2;
+ pLineDash.DotLen = nPixel;
+ pLineDash.Dashes = 1;
+ pLineDash.DashLen = 10 * nPixel;
+ pLineDash.Distance = 3 * nPixel;
+ break;
+ case office::MsoLineDashStyle::msoLineLongDash:
+ pLineDash.Dots = 0;
+ pLineDash.DotLen = 0;
+ pLineDash.Dashes = 1;
+ pLineDash.DashLen = 10 * nPixel;
+ pLineDash.Distance = 4 * nPixel;
+ break;
+ case office::MsoLineDashStyle::msoLineSquareDot:
+ pLineDash.Dots = 1;
+ pLineDash.DotLen = nPixel;
+ pLineDash.Dashes = 0;
+ pLineDash.DashLen = 0;
+ pLineDash.Distance = nPixel;
+ break;
+ case office::MsoLineDashStyle::msoLineRoundDot:
+ pLineDash.Dots = 1;
+ pLineDash.DotLen = nPixel;
+ pLineDash.Dashes = 0;
+ pLineDash.DashLen = 0;
+ pLineDash.Distance = nPixel;
+ break;
+ default:
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("this MsoLineDashStyle is not supported."), uno::Reference< uno::XInterface >() );
+ }
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineDash" ), uno::makeAny( pLineDash ) );
+ }
+}
+
+// Methods
+uno::Reference< msforms::XColorFormat > SAL_CALL
+ScVbaLineFormat::BackColor() throw (uno::RuntimeException)
+{
+ return uno::Reference< msforms::XColorFormat >( new ScVbaColorFormat( getParent(), mxContext, this, m_xShape, ::ColorFormatType::LINEFORMAT_BACKCOLOR ) );
+}
+
+uno::Reference< msforms::XColorFormat > SAL_CALL
+ScVbaLineFormat::ForeColor() throw (uno::RuntimeException)
+{
+ return uno::Reference< msforms::XColorFormat >( new ScVbaColorFormat( getParent(), mxContext, this, m_xShape, ::ColorFormatType::LINEFORMAT_FORECOLOR ) );
+}
+
+
+rtl::OUString&
+ScVbaLineFormat::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaLineFormat") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaLineFormat::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.LineFormat" ) );
+ }
+ return aServiceNames;
+}
+
+
diff --git a/vbahelper/source/vbahelper/vbalineformat.hxx b/vbahelper/source/vbahelper/vbalineformat.hxx
new file mode 100644
index 0000000000..a6287e42f8
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbalineformat.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * 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: vbalineformat.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_XLINEFORMAT_HXX
+#define SC_VBA_XLINEFORMAT_HXX
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <ooo/vba/msforms/XLineFormat.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::msforms::XLineFormat > ScVbaLineFormat_BASE;
+
+class ScVbaLineFormat : public ScVbaLineFormat_BASE
+{
+private:
+ css::uno::Reference< css::drawing::XShape > m_xShape;
+ css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
+ sal_Int32 m_nLineDashStyle;
+ double m_nLineWeight;
+protected:
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ sal_Int32 convertLineStartEndNameToArrowheadStyle( rtl::OUString sLineName );
+ rtl::OUString convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadStyle ) throw (css::uno::RuntimeException);
+ sal_Int32 calculateArrowheadSize();
+public:
+ ScVbaLineFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape );
+
+ // Attributes
+ virtual sal_Int32 SAL_CALL getBeginArrowheadStyle() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setBeginArrowheadStyle( sal_Int32 _beginarrowheadstyle ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getBeginArrowheadLength() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setBeginArrowheadLength( sal_Int32 _beginarrowheadlength ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getBeginArrowheadWidth() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setBeginArrowheadWidth( sal_Int32 _beginarrowheadwidth ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getEndArrowheadStylel() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setEndArrowheadStylel( sal_Int32 _endarrowheadstylel ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getEndArrowheadLength() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setEndArrowheadLength( sal_Int32 _endarrowheadlength ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getEndArrowheadWidth() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setEndArrowheadWidth( sal_Int32 _endarrowheadwidth ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getWeight() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setWeight( double _weight ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getTransparency() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTransparency( double _transparency ) throw (css::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL getStyle() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setStyle( sal_Int16 _style ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getDashStyle() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setDashStyle( sal_Int32 _dashstyle ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual css::uno::Reference< ov::msforms::XColorFormat > SAL_CALL BackColor() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XColorFormat > SAL_CALL ForeColor() throw (css::uno::RuntimeException);
+};
+
+#endif//SC_VBA_XLINEFORMAT_HXX
diff --git a/vbahelper/source/vbahelper/vbapagesetupbase.cxx b/vbahelper/source/vbahelper/vbapagesetupbase.cxx
new file mode 100644
index 0000000000..897fa2d056
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbapagesetupbase.cxx
@@ -0,0 +1,325 @@
+/*************************************************************************
+ *
+ * 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$
+ * $Revision$
+ *
+ * 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 <vbahelper/vbapagesetupbase.hxx>
+
+using namespace ::com::sun::star;
+using namespace ::ooo::vba;
+
+VbaPageSetupBase::VbaPageSetupBase(const uno::Reference< XHelperInterface >& xParent,
+ const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException): VbaPageSetupBase_BASE( xParent, xContext )
+{
+}
+
+double SAL_CALL VbaPageSetupBase::getTopMargin() throw (css::uno::RuntimeException)
+{
+ sal_Bool headerOn = sal_False;
+ sal_Int32 topMargin = 0;
+ sal_Int32 headerHeight = 0;
+
+ try
+ {
+ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsOn")));
+ aValue >>= headerOn;
+
+ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")));
+ aValue >>= topMargin;
+
+ if( headerOn )
+ {
+ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderHeight")));
+ aValue >>= headerHeight;
+ topMargin = topMargin + headerHeight;
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ return Millimeter::getInPoints( topMargin );
+}
+
+void SAL_CALL VbaPageSetupBase::setTopMargin( double margin ) throw (css::uno::RuntimeException)
+{
+ sal_Int32 topMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
+ sal_Bool headerOn = sal_False;
+ sal_Int32 headerHeight = 0;
+
+ try
+ {
+ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsOn")));
+ aValue >>= headerOn;
+
+ if( headerOn )
+ {
+ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderHeight")));
+ aValue >>= headerHeight;
+ topMargin -= headerHeight;
+ }
+
+ aValue <<= topMargin;
+ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")), aValue );
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+double SAL_CALL VbaPageSetupBase::getBottomMargin() throw (css::uno::RuntimeException)
+{
+ sal_Bool footerOn = sal_False;
+ sal_Int32 bottomMargin = 0;
+ sal_Int32 footerHeight = 0;
+
+ try
+ {
+ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsOn")));
+ aValue >>= footerOn;
+
+ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")));
+ aValue >>= bottomMargin;
+
+ if( footerOn )
+ {
+ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterHeight")));
+ aValue >>= footerHeight;
+ bottomMargin += footerHeight;
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ return Millimeter::getInPoints( bottomMargin );
+}
+
+void SAL_CALL VbaPageSetupBase::setBottomMargin( double margin ) throw (css::uno::RuntimeException)
+{
+ sal_Int32 bottomMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
+ sal_Bool footerOn = sal_False;
+ sal_Int32 footerHeight = 0;
+
+ try
+ {
+ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsOn")));
+ aValue >>= footerOn;
+
+ if( footerOn )
+ {
+ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterHeight")));
+ aValue >>= footerHeight;
+ bottomMargin -= footerHeight;
+ }
+
+ aValue <<= bottomMargin;
+ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")), aValue );
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+double SAL_CALL VbaPageSetupBase::getRightMargin() throw (css::uno::RuntimeException)
+{
+ sal_Int32 rightMargin = 0;
+ try
+ {
+ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightMargin")));
+ aValue >>= rightMargin;
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ return Millimeter::getInPoints( rightMargin );;
+}
+
+void SAL_CALL VbaPageSetupBase::setRightMargin( double margin ) throw (css::uno::RuntimeException)
+{
+ sal_Int32 rightMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
+ try
+ {
+ uno::Any aValue;
+ aValue <<= rightMargin;
+ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightMargin")), aValue );
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+}
+
+double SAL_CALL VbaPageSetupBase::getLeftMargin() throw (css::uno::RuntimeException)
+{
+ sal_Int32 leftMargin = 0;
+ try
+ {
+ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin")));
+ aValue >>= leftMargin;
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ return Millimeter::getInPoints( leftMargin );;
+}
+
+void SAL_CALL VbaPageSetupBase::setLeftMargin( double margin ) throw (css::uno::RuntimeException)
+{
+ sal_Int32 leftMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
+ try
+ {
+ uno::Any aValue;
+ aValue <<= leftMargin;
+ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin")), aValue );
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+double SAL_CALL VbaPageSetupBase::getHeaderMargin() throw (css::uno::RuntimeException)
+{
+ sal_Int32 headerMargin = 0;
+ try
+ {
+ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")));
+ aValue >>= headerMargin;
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ return Millimeter::getInPoints( headerMargin );;
+}
+
+void SAL_CALL VbaPageSetupBase::setHeaderMargin( double margin ) throw (css::uno::RuntimeException)
+{
+ sal_Int32 headerMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
+ try
+ {
+ uno::Any aValue;
+ aValue <<= headerMargin;
+ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")), aValue );
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+double SAL_CALL VbaPageSetupBase::getFooterMargin() throw (css::uno::RuntimeException)
+{
+ sal_Int32 footerMargin = 0;
+ try
+ {
+ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")));
+ aValue >>= footerMargin;
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ return Millimeter::getInPoints( footerMargin );;
+}
+
+void SAL_CALL VbaPageSetupBase::setFooterMargin( double margin ) throw (css::uno::RuntimeException)
+{
+ sal_Int32 footerMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
+ try
+ {
+ uno::Any aValue;
+ aValue <<= footerMargin;
+ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")), aValue );
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+sal_Int32 SAL_CALL VbaPageSetupBase::getOrientation() throw (css::uno::RuntimeException)
+{
+ sal_Int32 orientation = mnOrientPortrait;
+ try
+ {
+ sal_Bool isLandscape = sal_False;
+ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")));
+ aValue >>= isLandscape;
+
+ if( isLandscape )
+ {
+ orientation = mnOrientLandscape;
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+ return orientation;
+}
+
+void SAL_CALL VbaPageSetupBase::setOrientation( sal_Int32 orientation ) throw (css::uno::RuntimeException)
+{
+ if( ( orientation != mnOrientPortrait ) &&
+ ( orientation != mnOrientLandscape ) )
+ {
+ DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
+ }
+
+ try
+ {
+ sal_Bool isLandscape = sal_False;
+ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")));
+ aValue >>= isLandscape;
+
+ sal_Bool switchOrientation = sal_False;
+ if(( isLandscape && orientation != mnOrientLandscape ) ||
+ ( !isLandscape && orientation != mnOrientPortrait ))
+ {
+ switchOrientation = sal_True;
+ }
+
+ if( switchOrientation )
+ {
+ aValue <<= !isLandscape;
+ uno::Any aHeight = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height")));
+ uno::Any aWidth = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width")));
+ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")), aValue );
+ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width")), aHeight );
+ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height")), aWidth );
+ }
+
+ if( isLandscape )
+ {
+ orientation = mnOrientLandscape;
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
diff --git a/vbahelper/source/vbahelper/vbapictureformat.cxx b/vbahelper/source/vbahelper/vbapictureformat.cxx
new file mode 100644
index 0000000000..2663682b89
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbapictureformat.cxx
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * 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: vbapictureformat.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 "vbapictureformat.hxx"
+
+using namespace ooo::vba;
+using namespace com::sun::star;
+
+ScVbaPictureFormat::ScVbaPictureFormat( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ uno::Reference< drawing::XShape > xShape )
+ throw( lang::IllegalArgumentException ) : ScVbaPictureFormat_BASE( xParent, xContext ), m_xShape( xShape )
+{
+ m_xPropertySet.set( m_xShape, uno::UNO_QUERY_THROW );
+}
+
+void
+ScVbaPictureFormat::checkParameterRangeInDouble( double nRange, double nMin, double nMax ) throw (css::uno::RuntimeException)
+{
+ if( nRange < nMin )
+ {
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Parameter out of range, value is too small.") , uno::Reference< uno::XInterface >() );
+ }
+ if( nRange > nMax )
+ {
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Parameter out of range, value is too high.") , uno::Reference< uno::XInterface >() );
+ }
+}
+
+// Attributes
+double SAL_CALL
+ScVbaPictureFormat::getBrightness() throw (uno::RuntimeException)
+{
+ sal_Int16 nLuminance = 0;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("AdjustLuminance") ) >>= nLuminance;
+ double fBrightness = static_cast< double >( nLuminance );
+ fBrightness = ( fBrightness +100 ) / 200;
+ return fBrightness;
+}
+
+void SAL_CALL
+ScVbaPictureFormat::setBrightness( double _brightness ) throw (uno::RuntimeException)
+{
+ checkParameterRangeInDouble( _brightness, 0.0, 1.0 );
+ double fLuminance = _brightness * 200 - 100;
+ sal_Int16 nLuminance = static_cast< sal_Int16 >( fLuminance );
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("AdjustLuminance"), uno::makeAny( nLuminance ) );
+}
+
+double SAL_CALL
+ScVbaPictureFormat::getContrast() throw (uno::RuntimeException)
+{
+ sal_Int16 nContrast = 0;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("AdjustContrast") ) >>= nContrast;
+ double fContrast = static_cast< double >( nContrast );
+ fContrast = ( fContrast + 100 ) / 200;
+ return fContrast;
+}
+
+void SAL_CALL
+ScVbaPictureFormat::setContrast( double _contrast ) throw (uno::RuntimeException)
+{
+ checkParameterRangeInDouble( _contrast, 0.0, 1.0 );
+ double fContrast = _contrast * 200 - 100;
+ sal_Int16 nContrast = static_cast< sal_Int16 >( fContrast );
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("AdjustContrast"), uno::makeAny( nContrast ) );
+}
+
+
+// Methods
+void SAL_CALL
+ScVbaPictureFormat::IncrementBrightness( double increment ) throw (uno::RuntimeException)
+{
+ double fBrightness = getBrightness();
+ fBrightness += increment;
+ if( fBrightness < 0 )
+ {
+ fBrightness = 0.0;
+ }
+ if( fBrightness > 1 )
+ {
+ fBrightness = 1;
+ }
+ setBrightness( fBrightness );
+}
+
+void SAL_CALL
+ScVbaPictureFormat::IncrementContrast( double increment ) throw (uno::RuntimeException)
+{
+ double nContrast = getContrast();
+ nContrast += increment;
+ if( increment < 0 )
+ {
+ increment = 0.0;
+ }
+ if( increment > 1 )
+ {
+ increment = 1.0;
+ }
+ setContrast( nContrast );
+}
+
+
+rtl::OUString&
+ScVbaPictureFormat::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPictureFormat") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaPictureFormat::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.PictureFormat" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/vbahelper/vbapictureformat.hxx b/vbahelper/source/vbahelper/vbapictureformat.hxx
new file mode 100644
index 0000000000..a549b882c6
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbapictureformat.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * 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: vbapictureformat.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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_PICTUREFORMAT_HXX
+#define SC_VBA_PICTUREFORMAT_HXX
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <ooo/vba/msforms/XPictureFormat.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::msforms::XPictureFormat > ScVbaPictureFormat_BASE;
+
+class ScVbaPictureFormat : public ScVbaPictureFormat_BASE
+{
+private:
+ css::uno::Reference< css::drawing::XShape > m_xShape;
+ css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
+protected:
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+private:
+ void checkParameterRangeInDouble( double nRange, double nMin, double nMax ) throw (css::uno::RuntimeException);
+public:
+ ScVbaPictureFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::drawing::XShape > xShape ) throw( css::lang::IllegalArgumentException );
+
+ // Attributes
+ virtual double SAL_CALL getBrightness() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setBrightness( double _brightness ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getContrast() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setContrast( double _contrast ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL IncrementBrightness( double increment ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL IncrementContrast( double increment ) throw (css::uno::RuntimeException);
+};
+
+#endif//SC_VBA_PICTUREFORMAT_HXX
diff --git a/vbahelper/source/vbahelper/vbapropvalue.cxx b/vbahelper/source/vbahelper/vbapropvalue.cxx
new file mode 100644
index 0000000000..356c960f31
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbapropvalue.cxx
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * 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: vbapropvalue.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 "vbahelper/vbapropvalue.hxx"
+
+using namespace com::sun::star;
+
+ScVbaPropValue::ScVbaPropValue( PropListener* pListener ) : m_pListener( pListener )
+{
+}
+
+css::uno::Any SAL_CALL
+ScVbaPropValue::getValue() throw (css::uno::RuntimeException)
+{
+ return m_pListener->getValueEvent();
+}
+
+void SAL_CALL
+ScVbaPropValue::setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException)
+{
+ m_pListener->setValueEvent( _value );
+}
diff --git a/vbahelper/source/vbahelper/vbashape.cxx b/vbahelper/source/vbahelper/vbashape.cxx
new file mode 100644
index 0000000000..7a6b0fe3f7
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbashape.cxx
@@ -0,0 +1,676 @@
+/*************************************************************************
+ *
+ * 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: vbashape.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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<ooo/vba/office/MsoZOrderCmd.hpp>
+#include<ooo/vba/office/MsoScaleFrom.hpp>
+#include<com/sun/star/container/XNamed.hpp>
+#include<com/sun/star/drawing/ConnectorType.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include<com/sun/star/drawing/XDrawPagesSupplier.hpp>
+#include<com/sun/star/drawing/XDrawPages.hpp>
+#include<com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <ooo/vba/word/WdRelativeHorizontalPosition.hpp>
+#include <ooo/vba/word/WdRelativeVerticalPosition.hpp>
+
+#include <comphelper/processfactory.hxx>
+#include <vos/mutex.hxx>
+#include <vcl/svapp.hxx>
+#include <svx/unopage.hxx>
+#include <svx/unoshape.hxx>
+
+#include <vbahelper/vbashape.hxx>
+#include <vbahelper/vbatextframe.hxx>
+#include "vbalineformat.hxx"
+#include "vbafillformat.hxx"
+#include "vbapictureformat.hxx"
+#include <vbahelper/vbashaperange.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+using namespace ::vos;
+
+ScVbaShape::ScVbaShape( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape, const uno::Reference< drawing::XShapes >& xShapes, const uno::Reference< frame::XModel >& xModel, sal_Int32 nType ) throw( lang::IllegalArgumentException ) : ScVbaShape_BASE( xParent, xContext ), m_xShape( xShape ), m_xShapes( xShapes ), m_nType( nType ), m_xModel( xModel )
+{
+ m_xPropertySet.set( m_xShape, uno::UNO_QUERY_THROW );
+ m_pShapeHelper.reset( new ShapeHelper( m_xShape ) );
+ addListeners();
+}
+
+ScVbaShape::ScVbaShape( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape, const uno::Reference< frame::XModel >& xModel ) throw( lang::IllegalArgumentException ) : ScVbaShape_BASE( uno::Reference< XHelperInterface >(), xContext ), m_xShape( xShape ), m_xModel( xModel )
+{
+ // add listener
+ addListeners();
+}
+
+ScVbaShape::~ScVbaShape()
+{
+ // dtor must never ever throw
+ /*try
+ {
+ removeShapeListener();
+ removeShapesListener();
+ }
+ catch( uno::Exception& )
+ {
+ }*/
+}
+
+void SAL_CALL
+ScVbaShape::disposing( const lang::EventObject& rEventObject ) throw( uno::RuntimeException )
+{
+ try
+ {
+ uno::Reference< drawing::XShapes > xShapes( rEventObject.Source, uno::UNO_QUERY );
+ uno::Reference< drawing::XShape > xShape( rEventObject.Source, uno::UNO_QUERY );
+ if ( xShapes.is() )
+ removeShapesListener();
+ if ( xShape.is() )
+ removeShapeListener();
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+
+void ScVbaShape::addListeners()
+{
+ uno::Reference< lang::XComponent > xComponent( m_xShape, uno::UNO_QUERY );
+ if ( xComponent.is() )
+ xComponent->addEventListener( this );
+
+ xComponent.set( m_xShapes, uno::UNO_QUERY );
+ if ( xComponent.is() )
+ xComponent->addEventListener( this );
+}
+
+void
+ScVbaShape::removeShapeListener() throw( uno::RuntimeException )
+{
+ if( m_xShape.is() )
+ {
+ uno::Reference< lang::XComponent > xComponent( m_xShape, uno::UNO_QUERY_THROW );
+ xComponent->removeEventListener( this );
+ }
+ m_xShape = NULL;
+ m_xPropertySet = NULL;
+}
+
+void
+ScVbaShape::removeShapesListener() throw( uno::RuntimeException )
+{
+ if( m_xShapes.is() )
+ {
+ uno::Reference< lang::XComponent > xComponent( m_xShapes, uno::UNO_QUERY_THROW );
+ xComponent->removeEventListener( this );
+ }
+ m_xShapes = NULL;
+}
+
+sal_Int32
+ScVbaShape::getType( const css::uno::Reference< drawing::XShape > xShape ) throw (uno::RuntimeException)
+{
+ rtl::OUString sShapeType;
+ uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor( xShape, uno::UNO_QUERY_THROW );
+ sShapeType = xShapeDescriptor->getShapeType();
+ OSL_TRACE("ScVbaShape::getType: %s", rtl::OUStringToOString( sShapeType, RTL_TEXTENCODING_UTF8 ).getStr() );
+ // office::MsoShapeType::msoDiagram to "com.sun.star.drawing.GroupShape"
+ if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.GroupShape" ) ) )
+ return office::MsoShapeType::msoGroup;
+ else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.GraphicObjectShape" ) ) )
+ return office::MsoShapeType::msoPicture;
+ else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.ControlShape" ) ) ||
+ sShapeType.equals( rtl::OUString::createFromAscii( "FrameShape" ) ) )
+ return office::MsoShapeType::msoOLEControlObject;
+ // OOo don't support office::MsoShapeType::msoComment as a Shape.
+ else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.OLE2Shape" ) ) )
+ return office::MsoShapeType::msoChart;
+ // Art characters office::MsoShapeType::msoTextEffect, in OOo corresponding to "com.sun.star.drawing.CustomShape"
+ else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.ConnectorShape" ) ) )
+ {
+ enum drawing::ConnectorType connectorType;
+ uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW );
+ xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("EdgeKind")) >>= connectorType;
+ if( connectorType == drawing::ConnectorType_CURVE )
+ return office::MsoShapeType::msoFreeform;
+ else if( connectorType == drawing::ConnectorType_LINE )
+ return office::MsoShapeType::msoLine;
+ else
+ return office::MsoShapeType::msoAutoShape;
+ }
+ else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.LineShape" ) ) )
+ return office::MsoShapeType::msoLine;
+ else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.CustomShape" ) ) ||
+ sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.RectangleShape") ) )
+ return office::MsoShapeType::msoAutoShape;
+ else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.TextShape" ) ) )
+ return office::MsoShapeType::msoTextBox;
+ else
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "the shape type do not be supported: " ) + sShapeType, uno::Reference< uno::XInterface >() );
+}
+
+// Attributes
+rtl::OUString SAL_CALL
+ScVbaShape::getName() throw (uno::RuntimeException)
+{
+ rtl::OUString sName;
+ uno::Reference< container::XNamed > xNamed( m_xShape, uno::UNO_QUERY_THROW );
+ sName = xNamed->getName();
+ return sName;
+}
+
+void SAL_CALL
+ScVbaShape::setName( const rtl::OUString& _name ) throw (uno::RuntimeException)
+{
+ uno::Reference< container::XNamed > xNamed( m_xShape, uno::UNO_QUERY_THROW );
+ xNamed->setName( _name );
+}
+
+double SAL_CALL
+ScVbaShape::getHeight() throw (uno::RuntimeException)
+{
+ return m_pShapeHelper->getHeight();
+}
+
+void SAL_CALL
+ScVbaShape::setHeight( double _height ) throw (uno::RuntimeException)
+{
+ m_pShapeHelper->setHeight( _height );
+}
+
+double SAL_CALL
+ScVbaShape::getWidth() throw (uno::RuntimeException)
+{
+ return m_pShapeHelper->getWidth();
+}
+
+void SAL_CALL
+ScVbaShape::setWidth( double _width ) throw (uno::RuntimeException)
+{
+ m_pShapeHelper->setWidth( _width );
+}
+
+double SAL_CALL
+ScVbaShape::getLeft() throw (uno::RuntimeException)
+{
+ return m_pShapeHelper->getLeft();
+}
+
+void SAL_CALL
+ScVbaShape::setLeft( double _left ) throw (uno::RuntimeException)
+{
+ m_pShapeHelper->setLeft( _left );
+}
+
+double SAL_CALL
+ScVbaShape::getTop() throw (uno::RuntimeException)
+{
+ return m_pShapeHelper->getTop();
+}
+
+void SAL_CALL
+ScVbaShape::setTop( double _top ) throw (uno::RuntimeException)
+{
+ return m_pShapeHelper->setTop( _top );
+}
+
+sal_Bool SAL_CALL
+ScVbaShape::getVisible() throw (uno::RuntimeException)
+{
+ //UNO Shapes are always visible
+ return sal_True;
+}
+
+void SAL_CALL
+ScVbaShape::setVisible( sal_Bool /*_visible*/ ) throw (uno::RuntimeException)
+{
+ //UNO Shapes are always visible
+}
+
+sal_Int32 SAL_CALL
+ScVbaShape::getZOrderPosition() throw (uno::RuntimeException)
+{
+ sal_Int32 nZOrderPosition = 0;
+ uno::Any aZOrderPosition = m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ) );
+ aZOrderPosition >>= nZOrderPosition;
+ return nZOrderPosition + 1;
+}
+
+sal_Int32 SAL_CALL
+ScVbaShape::getType() throw (uno::RuntimeException)
+{
+ return m_nType;
+}
+
+double SAL_CALL
+ScVbaShape::getRotation() throw (uno::RuntimeException)
+{
+ double dRotation = 0;
+ sal_Int32 nRotation = 0;
+ m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "RotateAngle" ) ) >>= nRotation;
+ dRotation = static_cast< double >( nRotation /100 );
+ return dRotation;
+}
+
+void SAL_CALL
+ScVbaShape::setRotation( double _rotation ) throw (uno::RuntimeException)
+{
+ sal_Int32 nRotation = static_cast < sal_Int32 > ( _rotation * 100 );
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "RotateAngle" ), uno::makeAny( nRotation ) );
+}
+
+uno::Reference< msforms::XLineFormat > SAL_CALL
+ScVbaShape::getLine() throw (uno::RuntimeException)
+{
+ // TODO should ongly return line
+ return uno::Reference< msforms::XLineFormat >( new ScVbaLineFormat( this, mxContext, m_xShape ) );
+}
+
+uno::Reference< msforms::XFillFormat > SAL_CALL
+ScVbaShape::getFill() throw (uno::RuntimeException)
+{
+ return uno::Reference< msforms::XFillFormat >( new ScVbaFillFormat( this, mxContext, m_xShape ) );
+}
+
+uno::Reference< msforms::XPictureFormat > SAL_CALL
+ScVbaShape::getPictureFormat() throw (uno::RuntimeException)
+{
+ return uno::Reference< msforms::XPictureFormat >( new ScVbaPictureFormat( this, mxContext, m_xShape ) );
+}
+
+// Methods
+uno::Any SAL_CALL
+ScVbaShape::TextFrame() throw (uno::RuntimeException)
+{
+ uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW );
+ if( xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument" ) ) ) )
+ {
+ uno::Reference< lang::XMultiServiceFactory > xSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ uno::Sequence< uno::Any > aArgs(2);
+ aArgs[0] = uno::makeAny( getParent() );
+ aArgs[1] <<= m_xShape;
+ uno::Reference< uno::XInterface > xTextFrame( xSF->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.TextFrame") ) , aArgs ) , uno::UNO_QUERY_THROW );
+ return uno::makeAny( xTextFrame );
+ }
+
+ return uno::makeAny( uno::Reference< msforms::XTextFrame >( new VbaTextFrame( this, mxContext, m_xShape ) ) );
+}
+
+void SAL_CALL
+ScVbaShape::Delete() throw (uno::RuntimeException)
+{
+ OGuard aGuard( Application::GetSolarMutex() );
+ m_xShapes->remove( m_xShape );
+}
+
+void SAL_CALL
+ScVbaShape::ZOrder( sal_Int32 ZOrderCmd ) throw (uno::RuntimeException)
+{
+ sal_Int32 nOrderPositon;
+ uno::Any aOrderPostion = m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ) );
+ aOrderPostion >>= nOrderPositon;
+ switch( ZOrderCmd )
+ {
+ case office::MsoZOrderCmd::msoBringToFront:
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( SAL_MAX_INT32 ) );
+ break;
+ case office::MsoZOrderCmd::msoSendToBack:
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( (sal_Int32)0 ) );
+ break;
+ case office::MsoZOrderCmd::msoBringForward:
+ nOrderPositon += 1;
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( nOrderPositon ) );
+ break;
+ case office::MsoZOrderCmd::msoSendBackward:
+ if( nOrderPositon > 0 )
+ {
+ nOrderPositon -= 1;
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( nOrderPositon ) );
+ }
+ break;
+ // below two commands use with Writer for text and image object.
+ case office::MsoZOrderCmd::msoBringInFrontOfText:
+ case office::MsoZOrderCmd::msoSendBehindText:
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "This ZOrderCmd is not implemented, it is use with writer." ), uno::Reference< uno::XInterface >() );
+ default:
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid Parameter." ), uno::Reference< uno::XInterface >() );
+ }
+}
+
+void SAL_CALL
+ScVbaShape::IncrementRotation( double Increment ) throw (uno::RuntimeException)
+{
+ double nCurrentRotation = getRotation();
+ nCurrentRotation += Increment;
+ setRotation(nCurrentRotation);
+}
+
+void SAL_CALL
+ScVbaShape::IncrementLeft( double Increment ) throw (uno::RuntimeException)
+{
+ double nCurrentLeft = getLeft();
+ nCurrentLeft += Increment;
+ setLeft(nCurrentLeft);
+}
+
+void SAL_CALL
+ScVbaShape::IncrementTop( double Increment ) throw (uno::RuntimeException)
+{
+ double nCurrentTop = getTop();
+ nCurrentTop += Increment;
+ setTop(nCurrentTop);
+}
+
+void SAL_CALL
+ScVbaShape::ScaleHeight( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal_Int32 Scale ) throw (uno::RuntimeException)
+{
+ double nHeight = getHeight();
+ double nNewHeight = nHeight * Factor;
+ if( Scale == office::MsoScaleFrom::msoScaleFromTopLeft )
+ {
+ setHeight(nNewHeight);
+ }
+ else if( Scale == office::MsoScaleFrom::msoScaleFromBottomRight )
+ {
+ double nDeltaHeight = nNewHeight - nHeight;
+ double nNewTop = getTop() - nDeltaHeight;
+ setTop(nNewTop);
+ setHeight(nNewHeight);
+ }
+ else if( Scale == office::MsoScaleFrom::msoScaleFromMiddle )
+ {
+ double nDeltaHeight = (nNewHeight - nHeight) / 2;
+ double nNewTop = getTop() - nDeltaHeight;
+ setTop(nNewTop);
+ setHeight(nNewHeight);
+ }
+ else
+ {
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "ScaleHeight.Scale wrong value is given." ) , uno::Reference< uno::XInterface >() );
+ }
+}
+
+void SAL_CALL
+ScVbaShape::ScaleWidth( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal_Int32 Scale ) throw (uno::RuntimeException)
+{
+ double nWidth = getWidth();
+ double nNewWidth = nWidth * Factor;
+ if( Scale == office::MsoScaleFrom::msoScaleFromTopLeft )
+ {
+ setWidth(nNewWidth);
+ }
+ else if( Scale == office::MsoScaleFrom::msoScaleFromBottomRight )
+ {
+ double nDeltaWidth = nNewWidth - nWidth;
+ double nNewLeft = getLeft() - nDeltaWidth;
+ setLeft(nNewLeft);
+ setWidth(nNewWidth);
+ }
+ else if( Scale == office::MsoScaleFrom::msoScaleFromMiddle )
+ {
+ double nDeltaWidth = (nNewWidth - nWidth) / 2;
+ double nNewLeft = getLeft() - nDeltaWidth;
+ setLeft(nNewLeft);
+ setWidth(nNewWidth);
+ }
+ else
+ {
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "ScaleHeight.Scale wrong value is given." ) , uno::Reference< uno::XInterface >() );
+ }
+}
+
+void SAL_CALL
+ScVbaShape::Select( const uno::Any& /*Replace*/ ) throw ( uno::RuntimeException )
+{
+ uno::Reference< view::XSelectionSupplier > xSelectSupp( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ xSelectSupp->select( uno::makeAny( m_xShape ) );
+}
+
+// This method should not be part of Shape, what we reall need to do is...
+// dynamically create the appropriate objects e.g. TextBox, Oval, Picture etc.
+// ( e.g. the ones that really do have ShapeRange as an attribute )
+uno::Any SAL_CALL
+ScVbaShape::ShapeRange( const uno::Any& index ) throw ( uno::RuntimeException )
+{
+ // perhaps we should store a reference to the Shapes Collection
+ // in this class
+ // but anyway this method should not even be in this class
+ // #TODO not sure what the parent of the Shapes collection should be
+
+ XNamedObjectCollectionHelper< drawing::XShape >::XNamedVec aVec;
+ aVec.push_back( m_xShape );
+ uno::Reference< container::XIndexAccess > xIndexAccess( new XNamedObjectCollectionHelper< drawing::XShape >( aVec ) );
+ uno::Reference< container::XChild > xChild( m_xShape, uno::UNO_QUERY_THROW );
+ // #FIXME for want of a better parent, setting this
+ uno::Reference< msforms::XShapeRange > xShapeRange( new ScVbaShapeRange( mxParent, mxContext, xIndexAccess, uno::Reference< drawing::XDrawPage >( xChild->getParent(), uno::UNO_QUERY_THROW ), m_xModel ) );
+ if ( index.hasValue() )
+ return xShapeRange->Item( index, uno::Any() );
+ return uno::makeAny( xShapeRange );
+}
+
+sal_Bool SAL_CALL
+ScVbaShape::getLockAspectRatio() throw (uno::RuntimeException)
+{
+ // FIXME:
+ return sal_False;
+}
+
+void SAL_CALL
+ScVbaShape::setLockAspectRatio( sal_Bool /*_lockaspectratio*/ ) throw (uno::RuntimeException)
+{
+ // FIXME:
+}
+
+sal_Bool SAL_CALL
+ScVbaShape::getLockAnchor() throw (uno::RuntimeException)
+{
+ // FIXME:
+ return sal_True;
+}
+
+void SAL_CALL
+ScVbaShape::setLockAnchor( sal_Bool /*_lockanchor*/ ) throw (uno::RuntimeException)
+{
+ // FIXME:
+}
+
+sal_Int32 SAL_CALL
+ScVbaShape::getRelativeHorizontalPosition() throw (uno::RuntimeException)
+{
+ sal_Int32 nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionMargin;
+ text::TextContentAnchorType eType = text::TextContentAnchorType_AT_PARAGRAPH;
+ m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AnchorType") ) ) >>= eType;
+
+ switch( eType )
+ {
+ case text::TextContentAnchorType_AT_PARAGRAPH:
+ {
+ nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionColumn;
+ break;
+ }
+ case text::TextContentAnchorType_AT_PAGE:
+ {
+ nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionPage;
+ break;
+ }
+ case text::TextContentAnchorType_AT_CHARACTER:
+ {
+ nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionCharacter;
+ break;
+ }
+ case text::TextContentAnchorType_AT_FRAME:
+ case text::TextContentAnchorType_AS_CHARACTER:
+ {
+ nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionMargin;
+ break;
+ }
+ default:
+ {
+ nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionMargin;
+ }
+ }
+ return nRelativeHorizontalPosition;
+}
+
+void SAL_CALL
+ScVbaShape::setRelativeHorizontalPosition( ::sal_Int32 _relativehorizontalposition ) throw (uno::RuntimeException)
+{
+ text::TextContentAnchorType eType = text::TextContentAnchorType_AT_PARAGRAPH;
+ switch( _relativehorizontalposition )
+ {
+ case word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionCharacter:
+ {
+ eType = text::TextContentAnchorType_AT_CHARACTER;
+ break;
+ }
+ case word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionColumn:
+ case word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionMargin:
+ {
+ eType = text::TextContentAnchorType_AT_PARAGRAPH;
+ break;
+ }
+ case word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionPage:
+ {
+ eType = text::TextContentAnchorType_AT_PAGE;
+ break;
+ }
+ default:
+ {
+ DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString());
+ }
+ }
+ m_xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AnchorType") ), uno::makeAny( eType ) );
+}
+
+sal_Int32 SAL_CALL
+ScVbaShape::getRelativeVerticalPosition() throw (uno::RuntimeException)
+{
+ sal_Int32 nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionMargin;
+ text::TextContentAnchorType eType = text::TextContentAnchorType_AT_PARAGRAPH;
+ m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AnchorType") ) ) >>= eType;
+
+ switch( eType )
+ {
+ case text::TextContentAnchorType_AT_PARAGRAPH:
+ {
+ nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionParagraph;
+ break;
+ }
+ case text::TextContentAnchorType_AT_PAGE:
+ {
+ nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionPage;
+ break;
+ }
+ case text::TextContentAnchorType_AT_CHARACTER:
+ {
+ nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionLine;
+ break;
+ }
+ case text::TextContentAnchorType_AT_FRAME:
+ case text::TextContentAnchorType_AS_CHARACTER:
+ {
+ nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionMargin;
+ break;
+ }
+ default:
+ {
+ nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionMargin;
+ }
+ }
+ return nRelativeVerticalPosition;
+}
+
+void SAL_CALL
+ScVbaShape::setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition ) throw (uno::RuntimeException)
+{
+ text::TextContentAnchorType eType = text::TextContentAnchorType_AT_PARAGRAPH;
+ switch( _relativeverticalposition )
+ {
+ case word::WdRelativeVerticalPosition::wdRelativeVerticalPositionLine:
+ {
+ eType = text::TextContentAnchorType_AT_CHARACTER;
+ break;
+ }
+ case word::WdRelativeVerticalPosition::wdRelativeVerticalPositionParagraph:
+ case word::WdRelativeVerticalPosition::wdRelativeVerticalPositionMargin:
+ {
+ eType = text::TextContentAnchorType_AT_PARAGRAPH;
+ break;
+ }
+ case word::WdRelativeVerticalPosition::wdRelativeVerticalPositionPage:
+ {
+ eType = text::TextContentAnchorType_AT_PAGE;
+ break;
+ }
+ default:
+ {
+ DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString());
+ }
+ }
+ m_xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AnchorType") ), uno::makeAny( eType ) );
+}
+
+uno::Any SAL_CALL
+ScVbaShape::WrapFormat() throw (uno::RuntimeException)
+{
+ uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW );
+ if( xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) ) )
+ {
+ uno::Reference< lang::XMultiServiceFactory > xSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ uno::Sequence< uno::Any > aArgs(2);
+ aArgs[0] = uno::makeAny( getParent() );
+ aArgs[1] <<= m_xShape;
+ uno::Reference< uno::XInterface > xWrapFormat( xSF->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.WrapFormat") ) , aArgs ) , uno::UNO_QUERY_THROW );
+ return uno::makeAny( xWrapFormat );
+ }
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+}
+
+
+rtl::OUString&
+ScVbaShape::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaShape") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaShape::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.Shape" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/vbahelper/vbashaperange.cxx b/vbahelper/source/vbahelper/vbashaperange.cxx
new file mode 100644
index 0000000000..7bbd86d2c0
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbashaperange.cxx
@@ -0,0 +1,382 @@
+/*************************************************************************
+ *
+ * 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: vbashaperange.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 <com/sun/star/drawing/XShapeGrouper.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include<com/sun/star/view/XSelectionSupplier.hpp>
+
+#include <vbahelper/vbahelper.hxx>
+#include <vbahelper/vbashaperange.hxx>
+#include <vbahelper/vbashape.hxx>
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+class VbShapeRangeEnumHelper : public EnumerationHelper_BASE
+{
+ uno::Reference< XCollection > m_xParent;
+ uno::Reference<container::XIndexAccess > m_xIndexAccess;
+ sal_Int32 nIndex;
+public:
+ VbShapeRangeEnumHelper( const uno::Reference< XCollection >& xParent, const uno::Reference< container::XIndexAccess >& xIndexAccess ) : m_xParent( xParent ), m_xIndexAccess( xIndexAccess ), nIndex( 0 ) {}
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex < m_xIndexAccess->getCount() );
+ }
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ ScVbaShapeRange* pCollectionImpl = dynamic_cast< ScVbaShapeRange* >(m_xParent.get());
+ if ( pCollectionImpl && hasMoreElements() )
+ return pCollectionImpl->createCollectionObject( m_xIndexAccess->getByIndex( nIndex++ ) );
+ throw container::NoSuchElementException();
+ }
+
+};
+
+ScVbaShapeRange::ScVbaShapeRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xShapes, const uno::Reference< drawing::XDrawPage >& xDrawPage, const uno::Reference< frame::XModel >& xModel ) : ScVbaShapeRange_BASE( xParent, xContext, xShapes ), m_xDrawPage( xDrawPage ), m_nShapeGroupCount(0), m_xModel( xModel )
+{
+}
+
+// Methods
+void SAL_CALL
+ScVbaShapeRange::Select( ) throw (uno::RuntimeException)
+{
+ uno::Reference< view::XSelectionSupplier > xSelectSupp( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ xSelectSupp->select( uno::makeAny( getShapes() ) );
+}
+
+uno::Reference< msforms::XShape > SAL_CALL
+ScVbaShapeRange::Group() throw (uno::RuntimeException)
+{
+ uno::Reference< drawing::XShapeGrouper > xShapeGrouper( m_xDrawPage, uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XShapeGroup > xShapeGroup( xShapeGrouper->group( getShapes() ), uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XShape > xShape( xShapeGroup, uno::UNO_QUERY_THROW );
+ return uno::Reference< msforms::XShape >( new ScVbaShape( getParent(), mxContext, xShape, getShapes(), m_xModel, office::MsoShapeType::msoGroup ) );
+}
+
+uno::Reference< drawing::XShapes >
+ScVbaShapeRange::getShapes() throw (uno::RuntimeException)
+{
+ if ( !m_xShapes.is() )
+ {
+ uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
+ m_xShapes.set( xMSF->createInstance( rtl::OUString::createFromAscii( "com.sun.star.drawing.ShapeCollection" ) ), uno::UNO_QUERY_THROW );
+ sal_Int32 nLen = m_xIndexAccess->getCount();
+ for ( sal_Int32 index = 0; index < nLen; ++index )
+ m_xShapes->add( uno::Reference< drawing::XShape >( m_xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ) );
+
+ }
+ return m_xShapes;
+}
+
+
+void SAL_CALL
+ScVbaShapeRange::IncrementRotation( double Increment ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->IncrementRotation( Increment );
+ }
+}
+
+void SAL_CALL
+ScVbaShapeRange::IncrementLeft( double Increment ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->IncrementLeft( Increment );
+ }
+}
+
+void SAL_CALL
+ScVbaShapeRange::IncrementTop( double Increment ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->IncrementTop( Increment );
+ }
+}
+
+double SAL_CALL ScVbaShapeRange::getHeight() throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->getHeight( );
+ }
+ throw uno::RuntimeException();
+}
+
+void SAL_CALL ScVbaShapeRange::setHeight( double _height ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->setHeight( _height );
+ }
+}
+
+double SAL_CALL ScVbaShapeRange::getWidth() throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->getWidth( );
+ }
+ throw uno::RuntimeException();
+}
+
+void SAL_CALL ScVbaShapeRange::setWidth( double _width ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->setWidth( _width );
+ }
+}
+
+double SAL_CALL ScVbaShapeRange::getLeft() throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->getLeft();
+ }
+ throw uno::RuntimeException();
+}
+
+void SAL_CALL ScVbaShapeRange::setLeft( double _left ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->setLeft( _left );
+ }
+}
+
+double SAL_CALL ScVbaShapeRange::getTop() throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->getTop();
+ }
+ throw uno::RuntimeException();
+}
+
+void SAL_CALL ScVbaShapeRange::setTop( double _top ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->setTop( _top );
+ }
+}
+
+uno::Reference< ov::msforms::XLineFormat > SAL_CALL ScVbaShapeRange::getLine() throw (css::uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->getLine();
+ }
+ throw uno::RuntimeException();
+}
+
+uno::Reference< ov::msforms::XFillFormat > SAL_CALL ScVbaShapeRange::getFill() throw (css::uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->getFill();
+ }
+ throw uno::RuntimeException();
+}
+
+::sal_Bool SAL_CALL ScVbaShapeRange::getLockAspectRatio() throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->getLockAspectRatio();
+ }
+ throw uno::RuntimeException();
+}
+
+void SAL_CALL ScVbaShapeRange::setLockAspectRatio( ::sal_Bool _lockaspectratio ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->setLockAspectRatio( _lockaspectratio );
+ }
+}
+
+::sal_Bool SAL_CALL ScVbaShapeRange::getLockAnchor() throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->getLockAnchor();
+ }
+ throw uno::RuntimeException();
+}
+
+void SAL_CALL ScVbaShapeRange::setLockAnchor( ::sal_Bool _lockanchor ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->setLockAnchor( _lockanchor );
+ }
+}
+
+::sal_Int32 SAL_CALL ScVbaShapeRange::getRelativeHorizontalPosition() throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->getRelativeHorizontalPosition();
+ }
+ throw uno::RuntimeException();
+}
+
+void SAL_CALL ScVbaShapeRange::setRelativeHorizontalPosition( ::sal_Int32 _relativehorizontalposition ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->setRelativeHorizontalPosition( _relativehorizontalposition );
+ }
+}
+
+::sal_Int32 SAL_CALL ScVbaShapeRange::getRelativeVerticalPosition() throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->getRelativeVerticalPosition();
+ }
+ throw uno::RuntimeException();
+}
+
+void SAL_CALL ScVbaShapeRange::setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xShape->setRelativeVerticalPosition( _relativeverticalposition );
+ }
+}
+
+uno::Any SAL_CALL ScVbaShapeRange::TextFrame( ) throw (css::uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->TextFrame();
+ }
+ throw uno::RuntimeException();
+}
+
+uno::Any SAL_CALL ScVbaShapeRange::WrapFormat( ) throw (css::uno::RuntimeException)
+{
+ sal_Int32 nLen = getCount();
+ for ( sal_Int32 index = 1; index <= nLen; ++index )
+ {
+ uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
+ return xShape->WrapFormat();
+ }
+ throw uno::RuntimeException();
+}
+
+uno::Type SAL_CALL
+ScVbaShapeRange::getElementType() throw (uno::RuntimeException)
+{
+ return msforms::XShape::static_type(0);
+}
+
+uno::Reference< container::XEnumeration > SAL_CALL
+ScVbaShapeRange::createEnumeration() throw (uno::RuntimeException)
+{
+ return new VbShapeRangeEnumHelper( this, m_xIndexAccess );
+}
+
+uno::Any
+ScVbaShapeRange:: createCollectionObject( const css::uno::Any& aSource )
+{
+ uno::Reference< drawing::XShape > xShape( aSource, uno::UNO_QUERY_THROW );
+ // #TODO #FIXME Shape parent should always be the sheet the shapes belong
+ // to
+ uno::Reference< msforms::XShape > xVbShape( new ScVbaShape( uno::Reference< XHelperInterface >(), mxContext, xShape, getShapes(), m_xModel, ScVbaShape::getType( xShape ) ) );
+ return uno::makeAny( xVbShape );
+}
+
+rtl::OUString&
+ScVbaShapeRange::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaShapeRange") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaShapeRange::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.ShapeRange" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx
new file mode 100644
index 0000000000..4bc2f8dfa1
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -0,0 +1,491 @@
+/*************************************************************************
+ *
+ * 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: vbashapes.cxx,v $
+ * $Revision: 1.3.32.1 $
+ *
+ * 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 <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
+#include <ooo/vba/msforms/XShapeRange.hpp>
+#include <ooo/vba/office/MsoAutoShapeType.hpp>
+#include <ooo/vba/office/MsoTextOrientation.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/text/XTextContent.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <com/sun/star/text/HoriOrientation.hpp>
+#include <com/sun/star/text/VertOrientation.hpp>
+#include <com/sun/star/text/RelOrientation.hpp>
+#include <com/sun/star/text/SizeType.hpp>
+#include <com/sun/star/text/WritingMode.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+
+#include <vbahelper/vbahelper.hxx>
+#include <vbahelper/vbashape.hxx>
+#include <vbahelper/vbashapes.hxx>
+#include <vbahelper/vbashaperange.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+class VbShapeEnumHelper : public EnumerationHelper_BASE
+{
+ uno::Reference<msforms::XShapes > m_xParent;
+ uno::Reference<container::XIndexAccess > m_xIndexAccess;
+ sal_Int32 nIndex;
+public:
+ VbShapeEnumHelper( const uno::Reference< msforms::XShapes >& xParent, const uno::Reference< container::XIndexAccess >& xIndexAccess ) : m_xParent( xParent ), m_xIndexAccess( xIndexAccess ), nIndex( 0 ) {}
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex < m_xIndexAccess->getCount() );
+ }
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ ScVbaShapes* pShapes = dynamic_cast< ScVbaShapes* >(m_xParent.get());
+ if ( pShapes && hasMoreElements() )
+ return pShapes->createCollectionObject( m_xIndexAccess->getByIndex( nIndex++ ) );
+ throw container::NoSuchElementException();
+ }
+
+};
+
+void ScVbaShapes::initBaseCollection()
+{
+ if ( m_xNameAccess.is() ) // already has NameAccess
+ return;
+ // no NameAccess then use ShapeCollectionHelper
+ XNamedObjectCollectionHelper< drawing::XShape >::XNamedVec mShapes;
+ sal_Int32 nLen = m_xIndexAccess->getCount();
+ mShapes.reserve( nLen );
+ for ( sal_Int32 index=0; index<nLen; ++index )
+ mShapes.push_back( uno::Reference< drawing::XShape >( m_xIndexAccess->getByIndex( index ) , uno::UNO_QUERY ) );
+ uno::Reference< container::XIndexAccess > xShapes( new XNamedObjectCollectionHelper< drawing::XShape >( mShapes ) );
+ m_xIndexAccess.set( xShapes, uno::UNO_QUERY );
+ m_xNameAccess.set( xShapes, uno::UNO_QUERY );
+}
+
+ScVbaShapes::ScVbaShapes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess > xShapes, const uno::Reference< frame::XModel>& xModel ): ScVbaShapes_BASE( xParent, xContext, xShapes ), m_nNewShapeCount(0), m_xModel( xModel )
+{
+ m_xShapes.set( xShapes, uno::UNO_QUERY_THROW );
+ m_xDrawPage.set( xShapes, uno::UNO_QUERY_THROW );
+ initBaseCollection();
+}
+
+uno::Reference< container::XEnumeration >
+ScVbaShapes::createEnumeration() throw (uno::RuntimeException)
+{
+ return new VbShapeEnumHelper( this, m_xIndexAccess );
+}
+
+uno::Any
+ScVbaShapes::createCollectionObject( const css::uno::Any& aSource ) throw (uno::RuntimeException)
+{
+ if( aSource.hasValue() )
+ {
+ uno::Reference< drawing::XShape > xShape( aSource, uno::UNO_QUERY_THROW );
+ return uno::makeAny( uno::Reference< msforms::XShape >( new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) ) ) );
+ }
+ return uno::Any();
+}
+
+uno::Type
+ScVbaShapes::getElementType() throw (uno::RuntimeException)
+{
+ return ooo::vba::msforms::XShape::static_type(0);
+}
+rtl::OUString&
+ScVbaShapes::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaShapes") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+ScVbaShapes::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.Shapes" ) );
+ }
+ return aServiceNames;
+}
+
+css::uno::Reference< css::container::XIndexAccess >
+ScVbaShapes::getShapesByArrayIndices( const uno::Any& Index ) throw (uno::RuntimeException)
+{
+ if ( Index.getValueTypeClass() != uno::TypeClass_SEQUENCE )
+ throw uno::RuntimeException();
+
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter(mxContext);
+ uno::Any aConverted;
+ aConverted = xConverter->convertTo( Index, getCppuType((uno::Sequence< uno::Any >*)0) );
+
+ uno::Sequence< uno::Any > sIndices;
+ aConverted >>= sIndices;
+ XNamedObjectCollectionHelper< drawing::XShape >::XNamedVec mShapes;
+ sal_Int32 nElems = sIndices.getLength();
+ for( sal_Int32 index = 0; index < nElems; ++index )
+ {
+ uno::Reference< drawing::XShape > xShape;
+ if ( sIndices[ index ].getValueTypeClass() == uno::TypeClass_STRING )
+ {
+ rtl::OUString sName;
+ sIndices[ index ] >>= sName;
+ xShape.set( m_xNameAccess->getByName( sName ), uno::UNO_QUERY );
+ }
+ else
+ {
+ sal_Int32 nIndex = 0;
+ sIndices[ index ] >>= nIndex;
+ // adjust for 1 based mso indexing
+ xShape.set( m_xIndexAccess->getByIndex( nIndex - 1 ), uno::UNO_QUERY );
+
+ }
+ // populate map with drawing::XShapes
+ if ( xShape.is() )
+ mShapes.push_back( xShape );
+ }
+ uno::Reference< container::XIndexAccess > xIndexAccess( new XNamedObjectCollectionHelper< drawing::XShape >( mShapes ) );
+ return xIndexAccess;
+}
+
+uno::Any SAL_CALL
+ScVbaShapes::Item( const uno::Any& Index, const uno::Any& Index2 ) throw (uno::RuntimeException)
+{
+ // I don't think we need to support Array of indices for shapes
+/*
+ if ( Index.getValueTypeClass() == uno::TypeClass_SEQUENCE )
+ {
+ uno::Reference< container::XIndexAccess > xIndexAccess( getShapesByArrayIndices( Index ) );
+ // return new collection instance
+ uno::Reference< XCollection > xShapesCollection( new ScVbaShapes( this->getParent(), mxContext, xIndexAccess ) );
+ return uno::makeAny( xShapesCollection );
+ }
+*/
+ return ScVbaShapes_BASE::Item( Index, Index2 );
+}
+
+uno::Reference< msforms::XShapeRange > SAL_CALL
+ScVbaShapes::Range( const uno::Any& shapes ) throw (css::uno::RuntimeException)
+{
+ // shapes, can be an index or an array of indices
+ uno::Reference< container::XIndexAccess > xShapes;
+ if ( shapes.getValueTypeClass() == uno::TypeClass_SEQUENCE )
+ xShapes = getShapesByArrayIndices( shapes );
+ else
+ {
+ // wrap single index into a sequence
+ uno::Sequence< uno::Any > sIndices(1);
+ sIndices[ 0 ] = shapes;
+ uno::Any aIndex;
+ aIndex <<= sIndices;
+ xShapes = getShapesByArrayIndices( aIndex );
+ }
+ return new ScVbaShapeRange( getParent(), mxContext, xShapes, m_xDrawPage, m_xModel );
+}
+
+void SAL_CALL
+ScVbaShapes::SelectAll() throw (uno::RuntimeException)
+{
+ uno::Reference< view::XSelectionSupplier > xSelectSupp( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ try
+ {
+ xSelectSupp->select( uno::makeAny( m_xShapes ) );
+ }
+ // viewuno.cxx ScTabViewObj::select will throw IllegalArgumentException
+ // if one of the shapes is no 'markable' e.g. a button
+ // the method still works
+ catch( lang::IllegalArgumentException& )
+ {
+ }
+}
+
+uno::Reference< drawing::XShape >
+ScVbaShapes::createShape( rtl::OUString service ) throw (css::uno::RuntimeException)
+{
+ uno::Reference< lang::XMultiServiceFactory > xMSF( m_xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XShape > xShape( xMSF->createInstance( service ), uno::UNO_QUERY_THROW );
+ return xShape;
+}
+
+uno::Any
+ScVbaShapes::AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, uno::Any aRange ) throw (css::uno::RuntimeException)
+{
+ rtl::OUString sCreateShapeName( rtl::OUString::createFromAscii( "com.sun.star.drawing.RectangleShape" ) );
+ sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX );
+ sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY );
+ sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth );
+ sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight );
+
+ uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
+ m_xShapes->add( xShape );
+
+ rtl::OUString sName = createName( rtl::OUString::createFromAscii( "Rectangle" ) );
+ setDefaultShapeProperties( xShape );
+ setShape_NameProperty( xShape, sName );
+
+ awt::Point aMovePositionIfRange(0, 0);
+ awt::Point position;
+ position.X = nXPos - aMovePositionIfRange.X;
+ position.Y = nYPos - aMovePositionIfRange.Y;
+ xShape->setPosition( position );
+
+ awt::Size size;
+ size.Height = nHeight;
+ size.Width = nWidth;
+ xShape->setSize( size );
+
+ ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
+ pScVbaShape->setRange( aRange );
+ return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
+}
+
+uno::Any
+ScVbaShapes::AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, uno::Any aRange ) throw (css::uno::RuntimeException)
+{
+ rtl::OUString sCreateShapeName( rtl::OUString::createFromAscii( "com.sun.star.drawing.EllipseShape" ) );
+ sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX );
+ sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY );
+ sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth );
+ sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight );
+
+ uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
+ m_xShapes->add( xShape );
+
+ awt::Point aMovePositionIfRange( 0, 0 );
+ //TODO helperapi using a writer document
+ /*
+ XDocument xDocument = (XDocument)getParent();
+ if (AnyConverter.isVoid(_aRange))
+ {
+ _aRange = xDocument.Range(new Integer(0), new Integer(1));
+ // Top&Left in Word is Top&Left of the paper and not the writeable area.
+ aMovePositionIfRange = calculateTopLeftMargin((HelperInterfaceAdaptor)xDocument);
+ }
+
+ setShape_AnchorTypeAndRangeProperty(xShape, _aRange);
+ */
+ rtl::OUString name = createName( rtl::OUString::createFromAscii( "Oval" ));
+ setDefaultShapeProperties(xShape);
+ setShape_NameProperty(xShape, name);
+
+ awt::Point position;
+ position.X = nXPos - aMovePositionIfRange.X;
+ position.Y = nYPos - aMovePositionIfRange.Y;
+ xShape->setPosition(position);
+
+ awt::Size size;
+ size.Height = nHeight;
+ size.Width = nWidth;
+ xShape->setSize(size);
+
+ ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
+ pScVbaShape->setRange( aRange );
+ return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
+}
+
+//helpeapi calc
+uno::Any SAL_CALL
+ScVbaShapes::AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_Int32 endY ) throw (uno::RuntimeException)
+{
+ sal_Int32 nLineWidth = endX - StartX;
+ sal_Int32 nLineHeight = endY - StartY;
+
+ sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight );
+ sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth );
+ sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( StartX );
+ sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( StartY );
+
+ uno::Reference< drawing::XShape > xShape( createShape( rtl::OUString::createFromAscii("com.sun.star.drawing.LineShape") ), uno::UNO_QUERY_THROW );
+ m_xShapes->add( xShape );
+
+ awt::Point aMovePositionIfRange( 0, 0 );
+
+ rtl::OUString name = createName( rtl::OUString::createFromAscii( "Line" ) );
+ setDefaultShapeProperties(xShape);
+ setShape_NameProperty(xShape, name);
+
+ awt::Point position;
+ position.X = nXPos - aMovePositionIfRange.X;
+ position.Y = nYPos - aMovePositionIfRange.Y;
+ xShape->setPosition(position);
+
+ awt::Size size;
+ size.Height = nHeight;
+ size.Width = nWidth;
+ xShape->setSize(size);
+
+ ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
+ return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
+}
+
+uno::Any SAL_CALL
+ScVbaShapes::AddShape( sal_Int32 _nType, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException)
+{
+ uno::Any _aAnchor;
+ if (_nType == office::MsoAutoShapeType::msoShapeRectangle)
+ {
+ return AddRectangle(_nLeft, _nTop, _nWidth, _nHeight, _aAnchor);
+ }
+ else if (_nType == office::MsoAutoShapeType::msoShapeOval)
+ {
+ return AddEllipse(_nLeft, _nTop, _nWidth, _nHeight, _aAnchor);
+ }
+ return uno::Any();
+}
+
+uno::Any SAL_CALL
+ScVbaShapes::AddTextbox( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException)
+{
+ uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW );
+ if( xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) ) )
+ {
+ return AddTextboxInWriter( _nOrientation, _nLeft, _nTop, _nWidth, _nHeight );
+ }
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+}
+
+uno::Any
+ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException)
+{
+ rtl::OUString sCreateShapeName( rtl::OUString::createFromAscii( "com.sun.star.drawing.TextShape" ) );
+ sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( _nLeft );
+ sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( _nTop );
+ sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( _nWidth );
+ sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( _nHeight );
+
+ uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
+ m_xShapes->add( xShape );
+
+ setDefaultShapeProperties(xShape);
+
+ rtl::OUString sName = createName( rtl::OUString::createFromAscii( "Text Box") );
+ setShape_NameProperty( xShape, sName );
+
+ awt::Size size;
+ size.Height = nHeight;
+ size.Width = nWidth;
+ xShape->setSize(size);
+
+ uno::Reference< beans::XPropertySet > xShapeProps( xShape, uno::UNO_QUERY_THROW );
+ xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "AnchorType" ), uno::makeAny( text::TextContentAnchorType_AT_PAGE ) );
+ xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "HoriOrientRelation" ), uno::makeAny( text::RelOrientation::PAGE_LEFT ) );
+ xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "HoriOrient" ), uno::makeAny( text::HoriOrientation::NONE ) );
+ xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "HoriOrientPosition" ), uno::makeAny( nXPos ) );
+
+ xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "VertOrientRelation" ), uno::makeAny( text::RelOrientation::PAGE_FRAME ) );
+ xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "VertOrient" ), uno::makeAny( text::VertOrientation::NONE ) );
+ xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "VertOrientPosition" ), uno::makeAny( nYPos ) );
+
+ // set to visible
+ drawing::LineStyle aLineStyle = drawing::LineStyle_SOLID;
+ xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ), uno::makeAny( aLineStyle ) );
+ // set to font
+ sal_Int16 nLayerId = 1;
+ rtl::OUString sLayerName = rtl::OUString::createFromAscii("Heaven");
+ xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "LayerID" ), uno::makeAny( nLayerId ) );
+ xShapeProps->setPropertyValue( rtl::OUString::createFromAscii( "LayerName" ), uno::makeAny( sLayerName ) );
+
+
+ ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
+ return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
+}
+
+uno::Any
+ScVbaShapes::AddShape( const rtl::OUString& sService, const rtl::OUString& sName, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException)
+{
+ sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( _nLeft );
+ sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( _nTop );
+ sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( _nWidth );
+ sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( _nHeight );
+
+ uno::Reference< drawing::XShape > xShape( createShape( sService ), uno::UNO_QUERY_THROW );
+ m_xShapes->add( xShape );
+
+ setDefaultShapeProperties(xShape);
+ setShape_NameProperty( xShape, sName );
+
+ awt::Point aMovePositionIfRange( 0, 0 );
+ awt::Point position;
+ position.X = nXPos - aMovePositionIfRange.X;
+ position.Y = nYPos - aMovePositionIfRange.Y;
+ xShape->setPosition(position);
+
+ awt::Size size;
+ size.Height = nHeight;
+ size.Width = nWidth;
+ xShape->setSize(size);
+
+ ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
+ return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
+}
+void
+ScVbaShapes::setDefaultShapeProperties( uno::Reference< drawing::XShape > xShape ) throw (uno::RuntimeException)
+{
+ uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW );
+ xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillStyle" ), uno::makeAny( rtl::OUString::createFromAscii( "SOLID" ) ) );
+ xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillColor"), uno::makeAny( sal_Int32(0xFFFFFF) ) );
+ xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextWordWrap"), uno::makeAny( text::WrapTextMode_THROUGHT ) );
+ //not find in OOo2.3
+ //xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "Opaque"), uno::makeAny( sal_True ) );
+}
+
+void
+ScVbaShapes::setShape_NameProperty( uno::Reference< css::drawing::XShape > xShape, rtl::OUString sName )
+{
+ uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW );
+ try
+ {
+ xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "Name" ), uno::makeAny( sName ) );
+ }
+ catch( script::BasicErrorException e )
+ {
+ }
+}
+
+rtl::OUString
+ScVbaShapes::createName( rtl::OUString sName )
+{
+ sal_Int32 nActNumber = 1 + m_nNewShapeCount;
+ m_nNewShapeCount++;
+ sName += rtl::OUString::valueOf( nActNumber );
+ return sName;
+}
+
+#if 0
+//TODO helperapi using a writer document
+awt::Point
+calculateTopLeftMargin( uno::Reference< XHelperInterface > xDocument )
+{
+ awt::Point aPoint( 0, 0 );
+ uno::Reference< frame::XModel > xModel( xDocument, uno::UNO_QUERY_THROW );
+ return awt::Point();
+}
+#endif
diff --git a/vbahelper/source/vbahelper/vbatextframe.cxx b/vbahelper/source/vbahelper/vbatextframe.cxx
new file mode 100644
index 0000000000..a461c54947
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbatextframe.cxx
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * 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: vbatextframe.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 <vbahelper/helperdecl.hxx>
+#include <com/sun/star/drawing/TextFitToSizeType.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <vbahelper/vbatextframe.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+VbaTextFrame::VbaTextFrame( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< drawing::XShape > xShape ) : VbaTextFrame_BASE( xParent, xContext ), m_xShape( xShape )
+{
+ m_xPropertySet.set( m_xShape, uno::UNO_QUERY_THROW );
+}
+
+void
+VbaTextFrame::setAsMSObehavior()
+{
+ //set property TextWordWrap default as False.
+ // TextFitToSize control the text content. it seems we should set the default as False.
+ // com.sun.star.drawing.TextFitToSizeType.NONE
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextWordWrap" ), uno::makeAny( sal_False ) );
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextFitToSize" ), uno::makeAny( drawing::TextFitToSizeType_NONE ) );
+}
+
+sal_Int32 VbaTextFrame::getMargin( rtl::OUString sMarginType )
+{
+ sal_Int32 nMargin = 0;
+ uno::Any aMargin = m_xPropertySet->getPropertyValue( sMarginType );
+ aMargin >>= nMargin;
+ return nMargin;
+}
+
+void VbaTextFrame::setMargin( rtl::OUString sMarginType, float fMargin )
+{
+ sal_Int32 nMargin = Millimeter::getInHundredthsOfOneMillimeter( fMargin );
+ m_xPropertySet->setPropertyValue( sMarginType, uno::makeAny( nMargin ) );
+}
+
+// Attributes
+sal_Bool SAL_CALL
+VbaTextFrame::getAutoSize() throw (uno::RuntimeException)
+{
+ // I don't know why, but in OOo, TextAutoGrowHeight is the property control autosize. not TextFitToSize.
+ // TextFitToSize control the text content.
+ // and in mso, there isnot option TextWordWrap which means auto wrap. the default is False.
+ sal_Bool bAutosize = sal_False;
+ uno::Any aTextAutoGrowHeight = m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "TextAutoGrowHeight" ) );
+ aTextAutoGrowHeight >>= bAutosize;
+ return bAutosize;
+}
+
+void SAL_CALL
+VbaTextFrame::setAutoSize( sal_Bool _autosize ) throw (uno::RuntimeException)
+{
+ setAsMSObehavior();
+ m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextAutoGrowHeight" ), uno::makeAny( _autosize ) );
+}
+
+float SAL_CALL
+VbaTextFrame::getMarginBottom() throw (uno::RuntimeException)
+{
+ sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextLowerDistance" ) );
+ float fMargin = (float)Millimeter::getInPoints( nMargin );
+ return fMargin;
+}
+
+void SAL_CALL
+VbaTextFrame::setMarginBottom( float _marginbottom ) throw (uno::RuntimeException)
+{
+ setMargin( rtl::OUString::createFromAscii( "TextLowerDistance" ), _marginbottom );
+}
+
+float SAL_CALL
+VbaTextFrame::getMarginTop() throw (uno::RuntimeException)
+{
+ sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextUpperDistance" ) );
+ float fMargin = (float)Millimeter::getInPoints( nMargin );
+ return fMargin;
+}
+
+void SAL_CALL
+VbaTextFrame::setMarginTop( float _margintop ) throw (uno::RuntimeException)
+{
+ setMargin( rtl::OUString::createFromAscii( "TextUpperDistance" ), _margintop );
+}
+
+float SAL_CALL
+VbaTextFrame::getMarginLeft() throw (uno::RuntimeException)
+{
+ sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextLeftDistance" ) );
+ float fMargin = (float)Millimeter::getInPoints( nMargin );
+ return fMargin;
+}
+
+void SAL_CALL
+VbaTextFrame::setMarginLeft( float _marginleft ) throw (uno::RuntimeException)
+{
+ setMargin( rtl::OUString::createFromAscii( "TextLeftDistance" ), _marginleft );
+}
+
+float SAL_CALL
+VbaTextFrame::getMarginRight() throw (uno::RuntimeException)
+{
+ sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextRightDistance" ) );
+ float fMargin = (float)Millimeter::getInPoints( nMargin );
+ return fMargin;
+}
+
+void SAL_CALL
+VbaTextFrame::setMarginRight( float _marginright ) throw (uno::RuntimeException)
+{
+ setMargin( rtl::OUString::createFromAscii( "TextRightDistance" ), _marginright );
+}
+
+
+// Methods
+uno::Any SAL_CALL
+VbaTextFrame::Characters() throw (uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+}
+
+rtl::OUString&
+VbaTextFrame::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaTextFrame") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+VbaTextFrame::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.TextFrame" ) );
+ }
+ return aServiceNames;
+}
+
diff --git a/vbahelper/source/vbahelper/vbawindowbase.cxx b/vbahelper/source/vbahelper/vbawindowbase.cxx
new file mode 100644
index 0000000000..a5d4d2947a
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbawindowbase.cxx
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * 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:
+ * $Revision:
+ *
+ * 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 <vbahelper/helperdecl.hxx>
+#include <vbahelper/vbawindowbase.hxx>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/awt/XWindow2.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::ooo::vba;
+
+VbaWindowBase::VbaWindowBase( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ) : WindowBaseImpl_BASE( xParent, xContext ), m_xModel( xModel )
+{
+}
+
+VbaWindowBase::VbaWindowBase( uno::Sequence< uno::Any > const & args, uno::Reference< uno::XComponentContext > const & xContext )
+ : WindowBaseImpl_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext ),
+ m_xModel( getXSomethingFromArgs< frame::XModel >( args, 1 ) )
+{
+}
+
+sal_Bool SAL_CALL
+VbaWindowBase::getVisible() throw (uno::RuntimeException)
+{
+ sal_Bool bVisible = sal_True;
+ uno::Reference< frame::XController > xController( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW );
+ uno::Reference< css::awt::XWindow2 > xWindow2 (xWindow, uno::UNO_QUERY_THROW );
+ if( xWindow2.is() )
+ {
+ bVisible = xWindow2->isVisible();
+ }
+ return bVisible;
+}
+
+void SAL_CALL
+VbaWindowBase::setVisible(sal_Bool _visible) throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XController > xController( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW );
+ if( xWindow.is() )
+ {
+ xWindow->setVisible( _visible );
+ }
+}
+
+css::awt::Rectangle getPosSize( const uno::Reference< frame::XModel >& xModel )
+{
+ css::awt::Rectangle aRect;
+ uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW );
+ if( xWindow.is() )
+ {
+ aRect = xWindow->getPosSize();
+ }
+ return aRect;
+}
+
+void setPosSize( const uno::Reference< frame::XModel >& xModel, sal_Int32 nValue, USHORT nFlag )
+{
+ uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW );
+ if( xWindow.is() )
+ {
+ css::awt::Rectangle aRect = xWindow->getPosSize();
+ switch( nFlag )
+ {
+ case css::awt::PosSize::X:
+ xWindow->setPosSize( nValue, aRect.Y, 0, 0, css::awt::PosSize::X );
+ break;
+ case css::awt::PosSize::Y:
+ xWindow->setPosSize( aRect.X, nValue, 0, 0, css::awt::PosSize::Y );
+ break;
+ case css::awt::PosSize::WIDTH:
+ xWindow->setPosSize( 0, 0, nValue, aRect.Height, css::awt::PosSize::WIDTH );
+ break;
+ case css::awt::PosSize::HEIGHT:
+ xWindow->setPosSize( 0, 0, aRect.Width, nValue, css::awt::PosSize::HEIGHT );
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+sal_Int32 SAL_CALL
+VbaWindowBase::getHeight() throw (uno::RuntimeException)
+{
+ css::awt::Rectangle aRect = getPosSize(m_xModel);
+ return aRect.Height;
+}
+
+void SAL_CALL
+VbaWindowBase::setHeight( sal_Int32 _height ) throw (uno::RuntimeException)
+{
+ setPosSize(m_xModel, _height, css::awt::PosSize::HEIGHT);
+}
+
+sal_Int32 SAL_CALL
+VbaWindowBase::getLeft() throw (uno::RuntimeException)
+{
+ css::awt::Rectangle aRect = getPosSize(m_xModel);
+ return aRect.X;
+}
+
+void SAL_CALL
+VbaWindowBase::setLeft( sal_Int32 _left ) throw (uno::RuntimeException)
+{
+ setPosSize(m_xModel, _left, css::awt::PosSize::X);
+}
+sal_Int32 SAL_CALL
+VbaWindowBase::getTop() throw (uno::RuntimeException)
+{
+ css::awt::Rectangle aRect = getPosSize(m_xModel);
+ return aRect.Y;
+}
+
+void SAL_CALL
+VbaWindowBase::setTop( sal_Int32 _top ) throw (uno::RuntimeException)
+{
+ setPosSize(m_xModel, _top, css::awt::PosSize::Y);
+}
+sal_Int32 SAL_CALL
+VbaWindowBase::getWidth() throw (uno::RuntimeException)
+{
+ css::awt::Rectangle aRect = getPosSize(m_xModel);
+ return aRect.Width;
+}
+
+void SAL_CALL
+VbaWindowBase::setWidth( sal_Int32 _width ) throw (uno::RuntimeException)
+{
+ setPosSize(m_xModel, _width, css::awt::PosSize::WIDTH);
+}
+
+rtl::OUString&
+VbaWindowBase::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaWindowBase") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+VbaWindowBase::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.VbaWindowBase" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/util/makefile.mk b/vbahelper/util/makefile.mk
new file mode 100644
index 0000000000..33c0ca1f29
--- /dev/null
+++ b/vbahelper/util/makefile.mk
@@ -0,0 +1,104 @@
+#*************************************************************************
+#
+# 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: makefile.mk,v $
+#
+# $Revision: 1.24 $
+#
+# 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.
+#
+#*************************************************************************
+
+PRJ=..
+
+PRJNAME=vbahelper
+TARGET=vbahelper
+
+# --- Settings ---------------------------------------------------
+
+.INCLUDE : settings.mk
+
+
+TARGET_HELPER=vbahelper
+
+LIB1TARGET= $(SLB)$/$(TARGET).lib
+LIB1FILES=$(SLB)$/$(TARGET)bits.lib
+
+SHL1TARGET= $(TARGET_HELPER)$(DLLPOSTFIX)
+
+
+# dynamic libraries
+SHL1STDLIBS= \
+ $(CPPULIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(BASICLIB) \
+ $(TOOLSLIB) \
+ $(SALLIB)\
+ $(SFXLIB) \
+ $(SVTOOLLIB) \
+ $(SVLLIB) \
+ $(VCLLIB) \
+ $(SVTOOLLIB) \
+ $(TKLIB) \
+ $(SVXMSFILTERLIB) \
+
+SHL1DEPN=
+SHL1IMPLIB= i$(TARGET_HELPER)
+SHL1USE_EXPORTS=name
+SHL1LIBS=$(LIB1TARGET)
+
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME=$(SHL1TARGET)
+DEFLIB1NAME=$(TARGET)
+
+TARGET_MSFORMS=msforms
+SHL2TARGET=$(TARGET_MSFORMS)$(DLLPOSTFIX).uno
+SHL2IMPLIB= i$(TARGET_MSFORMS)
+
+SHL2VERSIONMAP=$(TARGET_MSFORMS).map
+SHL2DEF=$(MISC)$/$(SHL2TARGET).def
+DEF2NAME=$(SHL2TARGET)
+SHL2STDLIBS= \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(COMPHELPERLIB) \
+ $(SVLIB) \
+ $(TOOLSLIB) \
+ $(SALLIB)\
+ $(VBAHELPERLIB) \
+ $(SFXLIB) \
+ $(SVXLIB) \
+ $(SVTOOLLIB) \
+ $(SVLLIB) \
+ $(VCLLIB) \
+ $(TKLIB) \
+ $(BASICLIB) \
+
+SHL2DEPN=$(SHL1TARGETN)
+SHL2LIBS=$(SLB)$/$(TARGET_MSFORMS).lib
+
+# --- Targets -----------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/vbahelper/util/msforms.map b/vbahelper/util/msforms.map
new file mode 100644
index 0000000000..737cddbfe3
--- /dev/null
+++ b/vbahelper/util/msforms.map
@@ -0,0 +1,9 @@
+OOO_1.1 {
+ global:
+ component_getImplementationEnvironment;
+ component_getFactory;
+ component_writeInfo;
+
+ local:
+ *;
+};
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 52cfa47c36..f88392a3db 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -137,6 +137,19 @@ rtl::OUString Databases::expandURL( const rtl::OUString& aURL, Reference< uno::X
return aRetURL;
}
+
+// Hold Packages to improve performance (#i106100)
+// The PackageManager implementation seems to completely throw away all cached data
+// as soon as the last reference to a XPackage dies. Maybe this should be changed.
+struct ImplPackageSequenceHolder
+{
+ Sequence< Reference< deployment::XPackage > > m_aUserPackagesSeq;
+ Sequence< Reference< deployment::XPackage > > m_aSharedPackagesSeq;
+};
+
+static ImplPackageSequenceHolder* GpPackageSequenceHolder = NULL;
+
+
Databases::Databases( sal_Bool showBasic,
const rtl::OUString& instPath,
const com::sun::star::uno::Sequence< rtl::OUString >& imagesZipPaths,
@@ -182,6 +195,8 @@ Databases::Databases( sal_Bool showBasic,
m_xSFA = Reference< ucb::XSimpleFileAccess >(
m_xSMgr->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ),
m_xContext ), UNO_QUERY_THROW );
+
+ GpPackageSequenceHolder = new ImplPackageSequenceHolder();
}
Databases::~Databases()
@@ -230,6 +245,7 @@ Databases::~Databases()
}
}
+ delete GpPackageSequenceHolder;
}
static bool impl_getZipFile(
@@ -1525,6 +1541,8 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextUserHelpPack
thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("user") );
m_aUserPackagesSeq = xUserManager->getDeployedPackages
( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ if( GpPackageSequenceHolder != NULL )
+ GpPackageSequenceHolder->m_aUserPackagesSeq = m_aUserPackagesSeq;
m_bUserPackagesLoaded = true;
}
@@ -1555,6 +1573,8 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("shared") );
m_aSharedPackagesSeq = xSharedManager->getDeployedPackages
( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ if( GpPackageSequenceHolder != NULL )
+ GpPackageSequenceHolder->m_aSharedPackagesSeq = m_aSharedPackagesSeq;
m_bSharedPackagesLoaded = true;
}
diff --git a/xmloff/source/forms/gridcolumnproptranslator.cxx b/xmloff/source/forms/gridcolumnproptranslator.cxx
index ae8975bc20..d5e647f4b2 100644
--- a/xmloff/source/forms/gridcolumnproptranslator.cxx
+++ b/xmloff/source/forms/gridcolumnproptranslator.cxx
@@ -235,9 +235,15 @@ namespace xmloff
}
//--------------------------------------------------------------------
- void SAL_CALL OGridColumnPropertyTranslator::setPropertyValue( const ::rtl::OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
+ void SAL_CALL OGridColumnPropertyTranslator::setPropertyValue( const ::rtl::OUString& _rPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
- Sequence< ::rtl::OUString > aNames( &aPropertyName, 1 );
+ // we implement this by delegating it to setPropertyValues, which is to ignore unknown properties. On the other hand, our
+ // contract requires us to throw a UnknownPropertyException for unknown properties, so check this first.
+
+ if ( !getPropertySetInfo()->hasPropertyByName( _rPropertyName ) )
+ throw UnknownPropertyException( _rPropertyName, *this );
+
+ Sequence< ::rtl::OUString > aNames( &_rPropertyName, 1 );
Sequence< Any > aValues( &aValue, 1 );
setPropertyValues( aNames, aValues );
}
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 23422c10f6..5e59f12ee6 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1508,8 +1508,6 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
return sStyleName;
}
-// --> OD 2006-10-12 #i69629#
-// adjustments to reflect change of internal data structure <mpOutlineStylesCandidates>
void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName,
sal_Int8 nOutlineLevel )
{
@@ -1560,9 +1558,7 @@ void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName,
}
// else: we already had a style name, so we let it pass.
}
-// <--
-// --> OD 2006-10-12 #i69629#
void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel,
const OUString& rStyleName )
{
@@ -1585,16 +1581,13 @@ void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel
mpOutlineStylesCandidates[nOutlineLevel-1].push_back( rStyleName );
}
}
-// <--
-// --> OD 2006-10-12 #i69629#
void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
{
if ( ( mpOutlineStylesCandidates != NULL || bSetEmptyLevels ) &&
xChapterNumbering.is() &&
!IsInsertMode() )
{
- // --> OD 2007-12-19 #152540#
bool bChooseLastOne( false );
{
if ( GetXMLImport().IsTextDocInOOoFileFormat() )
@@ -1607,15 +1600,12 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
sal_Int32 nBuild( 0 );
if ( GetXMLImport().getBuildIds( nUPD, nBuild ) )
{
- // --> OD 2008-03-19 #i86058#
// check explicitly on certain versions
bChooseLastOne = ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
( nUPD == 680 && nBuild <= 9073 ); // OOo 2.0 - OOo 2.0.4
- // <--
}
}
}
- // <--
OUString sOutlineStyleName;
{
@@ -1624,8 +1614,15 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
xChapterNumRule->getPropertyValue(sName) >>= sOutlineStyleName;
}
- OUString sEmpty;
- sal_Int32 nCount = xChapterNumbering->getCount();
+ const sal_Int32 nCount = xChapterNumbering->getCount();
+ // --> OD 2009-11-13 #i106218#
+ // First collect all paragraph styles choosen for assignment to each
+ // list level of the outline style, then perform the intrinsic assignment.
+ // Reason: The assignment of a certain paragraph style to a list level
+ // of the outline style causes side effects on the children
+ // paragraph styles in Writer.
+ ::std::vector<OUString> sChosenStyles(nCount);
+ // <--
for( sal_Int32 i=0; i < nCount; ++i )
{
if ( bSetEmptyLevels ||
@@ -1634,17 +1631,12 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
{
// determine, which candidate is one to be assigned to the list
// level of the outline style
- OUString sChoosenStyle( sEmpty );
if ( mpOutlineStylesCandidates &&
!mpOutlineStylesCandidates[i].empty() )
{
- // --> OD 2007-12-19 #152540#
if ( bChooseLastOne )
- // <--
{
- // --> OD 2006-11-06 #i71249# - take last added one
- sChoosenStyle = mpOutlineStylesCandidates[i].back();
- // <--
+ sChosenStyles[i] = mpOutlineStylesCandidates[i].back();
}
else
{
@@ -1655,24 +1647,26 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
sNumberingStyleName,
sOutlineStyleName ) )
{
- sChoosenStyle = mpOutlineStylesCandidates[i][j];
+ sChosenStyles[i] = mpOutlineStylesCandidates[i][j];
break;
}
}
}
}
-
- Sequence < PropertyValue > aProps( 1 );
- PropertyValue *pProps = aProps.getArray();
- pProps->Name = sHeadingStyleName;
- pProps->Value <<= sChoosenStyle;
-
- xChapterNumbering->replaceByIndex( i, makeAny( aProps ) );
}
}
+ // --> OD 2009-11-13 #i106218#
+ Sequence < PropertyValue > aProps( 1 );
+ PropertyValue *pProps = aProps.getArray();
+ pProps->Name = sHeadingStyleName;
+ for ( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ pProps->Value <<= sChosenStyles[i];
+ xChapterNumbering->replaceByIndex( i, makeAny( aProps ) );
+ }
+ // <--
}
}
-// <--
void XMLTextImportHelper::SetHyperlink(
SvXMLImport& rImport,
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 69e73929f2..21df9d374c 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -807,6 +807,11 @@ void XMLTextParagraphExport::exportListChange(
}
}
+ const bool bExportODF =
+ ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0;
+ const SvtSaveOptions::ODFDefaultVersion eODFDefaultVersion =
+ GetExport().getDefaultVersion();
+
// start a new list
if ( rNextInfo.GetLevel() > 0 )
{
@@ -829,10 +834,6 @@ void XMLTextParagraphExport::exportListChange(
if ( nListLevelsToBeOpened > 0 )
{
- const bool bExportODF =
- ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0;
- const SvtSaveOptions::ODFDefaultVersion eODFDefaultVersion =
- GetExport().getDefaultVersion();
const ::rtl::OUString sListStyleName( rNextInfo.GetNumRulesName() );
// Currently only the text documents support <ListId>.
// Thus, for other document types <sListId> is empty.
@@ -1038,16 +1039,14 @@ void XMLTextParagraphExport::exportListChange(
pListElements->Remove( pListElements->Count()-1 );
delete pElem;
- if ( rNextInfo.IsRestart() && !rNextInfo.HasStartValue() )
+ // --> OD 2009-11-12 #i103745# - only for sub lists
+ if ( rNextInfo.IsRestart() && !rNextInfo.HasStartValue() &&
+ rNextInfo.GetLevel() != 1 )
+ // <--
{
// start new sub list respectively list on same list level
pElem = (*pListElements)[pListElements->Count()-1];
GetExport().EndElement( *pElem, sal_True );
- if ( rNextInfo.GetLevel() == 1 )
- {
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- GetExport().EncodeStyleName( rNextInfo.GetNumRulesName() ) );
- }
GetExport().IgnorableWhitespace();
GetExport().StartElement( *pElem, sal_False );
}
@@ -1059,8 +1058,18 @@ void XMLTextParagraphExport::exportListChange(
OUStringBuffer aBuffer;
aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
- aBuffer.makeStringAndClear() );
+ aBuffer.makeStringAndClear() );
+ }
+ // --> OD 2009-11-12 #i103745# - handle restart without start value on list level 1
+ else if ( rNextInfo.IsRestart() && /*!rNextInfo.HasStartValue() &&*/
+ rNextInfo.GetLevel() == 1 )
+ {
+ OUStringBuffer aBuffer;
+ aBuffer.append( (sal_Int32)rNextInfo.GetListLevelStartValue() );
+ GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
+ aBuffer.makeStringAndClear() );
}
+ // <--
if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0 &&
GetExport().getDefaultVersion() >= SvtSaveOptions::ODFVER_012 )
{
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index 1e4dab709f..9b82d3ce3b 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -30,34 +30,29 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/style/XStyle.hpp>
+
+#include "XMLTextPropertySetContext.hxx"
+#include "xmlnmspe.hxx"
+#include "xmloff/XMLEventsImportContext.hxx"
+#include "xmloff/attrlist.hxx"
+#include "xmloff/families.hxx"
+#include "xmloff/txtprmap.hxx"
+#include "xmloff/txtstyli.hxx"
+#include "xmloff/xmlimp.hxx"
+#include "xmloff/xmltkmap.hxx"
+#include "xmloff/xmltoken.hxx"
+#include "xmloff/xmluconv.hxx"
+
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/document/XEventsSupplier.hpp>
+#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/style/ParagraphStyleCategory.hpp>
-#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTSSUPPLIER_HPP
-#include <com/sun/star/document/XEventsSupplier.hpp>
-#endif
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-#include "xmlnmspe.hxx"
-#include <xmloff/xmltoken.hxx>
-#ifndef _XMLOFF_FAMILIES_HXX
-#include <xmloff/families.hxx>
-#endif
-#include "XMLTextPropertySetContext.hxx"
-#include <xmloff/xmltkmap.hxx>
-#include <xmloff/xmlimp.hxx>
-#include <xmloff/xmluconv.hxx>
-
-#ifndef _XMLOFF_TXTPRMAP_HXX
-#include <xmloff/txtprmap.hxx>
-#endif
-#ifndef _XMLOFF_TXTSTYLI_HXX
-#include <xmloff/txtstyli.hxx>
-#endif
-#include <xmloff/attrlist.hxx>
-#include <xmloff/XMLEventsImportContext.hxx>
+#include <com/sun/star/style/XStyle.hpp>
+
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
// STL includes
#include <algorithm>
@@ -464,6 +459,9 @@ void XMLTextStyleContext::FillPropertySet(
{ -1, -1 }
};
+ // get property set info
+ Reference< XPropertySetInfo > xInfo( rPropSet->getPropertySetInfo(), UNO_SET_THROW );
+
bool bAutomatic = false;
if( ((SvXMLStylesContext *)GetStyles())->IsAutomaticStyle() &&
( GetFamily() == XML_STYLE_FAMILY_TEXT_TEXT || GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH ) )
@@ -476,11 +474,15 @@ void XMLTextStyleContext::FillPropertySet(
OUString( RTL_CONSTASCII_USTRINGPARAM("ParaAutoStyleName") );
try
{
- rPropSet->setPropertyValue( sAutoProp, makeAny(GetAutoName()) );
+ if ( xInfo->hasPropertyByName( sAutoProp ) )
+ rPropSet->setPropertyValue( sAutoProp, makeAny(GetAutoName()) );
+ else
+ bAutomatic = false;
}
catch( const RuntimeException& ) { throw; }
catch( const Exception& )
{
+ DBG_UNHANDLED_EXCEPTION();
bAutomatic = false;
}
}
@@ -499,9 +501,6 @@ void XMLTextStyleContext::FillPropertySet(
bHasCombinedCharactersLetter = bVal;
}
- // get property set info
- Reference< XPropertySetInfo > xInfo;
-
// keep-together: the application default is different from
// the file format default. Hence, if we always set this
// value; if we didn't find one, we'll set to false, the file
@@ -534,9 +533,6 @@ void XMLTextStyleContext::FillPropertySet(
// check for StarBats and StarMath fonts
- if (!xInfo.is())
- xInfo.set(rPropSet->getPropertySetInfo());
-
// iterate over aContextIDs entries 3..6
for ( sal_Int32 i = 3; i < 7; i++ )
{
@@ -572,8 +568,6 @@ void XMLTextStyleContext::FillPropertySet(
// set property
OUString rPropertyName(
rPropMapper->GetEntryAPIName(nMapperIndex) );
- if( !xInfo.is() )
- xInfo = rPropSet->getPropertySetInfo();
if ( xInfo->hasPropertyByName( rPropertyName ) )
{
rPropSet->setPropertyValue( rPropertyName, aAny );